text:
InfoQ Homepage News Interview with Sanjiva Weerawarana: Debunking REST/WS-* Myths

# Interview with Sanjiva Weerawarana: Debunking REST/WS-* Myths

InfoQ's Stefan Tilkov had a chance to talk to Sanjiva Weerawarana, who founded WSO2 after having spent nearly 8 years in IBM Research, where he was one of the founders of the Web services platform. During that time, he co-authored many Web services specifications including WSDL, BPEL4WS, WS-Addressing, WS-RF and WS-Eventing. He lead the creation of IBM SOAP4J, which was released just 2 days after the SOAP 1.1 specification was released and which later became Apache SOAP. He went on to architect and implement many other products, including Apache Axis, Apache WSIF, the IBM Web Services Gateway and IBM BPWS4J, a BPEL4WS implementation, and was a key driver of IBMs Web services technical strategy.

Sanjiva has been involved with Open Source software both in IBM and in Apache for several years. In addition to the Apache Web services projects, Sanjiva is the father of Apache Jakarta BSF and also contributed to Apache Xalan. He is also a co-editor of the WSDL 2.0 specification.

As one of the fathers and a firm advocate of the WS-* architectural vision, we questioned him on the WS-* platform and his views on Microsoft's role in standardization. Sanjiva also took the opportunity to address "WS-* and REST myths".

Style

## Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

• ##### Re: SOA?

by Sanjiva Weerawarana /

• ##### Re: SOA?

by Sanjiva Weerawarana /

• ##### Re: SOA?

by Stefan Tilkov /

• ##### Re: SOA?

by Sanjiva Weerawarana /

• ##### Re: SOA?

by Rajith Attapattu /

• ##### Re: SOA?

by Rafael de F. Ferreira /

• ##### Re: SOA?

by Rafael de F. Ferreira /

• ##### Re: SOA?

by Rajith Attapattu /

• ##### Re: SOA?

by Sanjiva Weerawarana /

• ##### Re: SOA?

by Sanjiva Weerawarana /

• ##### Re: SOA?

by Rafael de F. Ferreira /

• ##### Re: SOA?

by Stefan Tilkov /

• ##### Re: SOA?

by Peter Thomas /

• ##### Re: SOA?

by Rajith Attapattu /

• ##### Re: SOA?

by Carlos Rodriguez /

• ##### An implementation in search of an architecture

by Benjamin Carlyle /

• ##### Re: An implementation in search of an architecture

by Sanjiva Weerawarana /

• ##### Re: An implementation in search of an architecture

by Benjamin Carlyle /

• ##### Re: An implementation in search of an architecture

by Kurt Christensen /

• ##### Re: An implementation in search of an architecture

by Sanjiva Weerawarana /

• ##### Re: An implementation in search of an architecture

by Kurt Christensen /

• ##### Re: An implementation in search of an architecture

by Sanjiva Weerawarana /

• ##### Re: An implementation in search of an architecture

by Stefan Tilkov /

• ##### Re: An implementation in search of an architecture

by Mark Baker /

• ##### Re: An implementation in search of an architecture

by Frank Cohen /

• ##### Ignores the main issue

by Dean Jones /

• ##### Re: Ignores the main issue

by Sanjiva Weerawarana /

• ##### REST Standards

by Victor Volle /

• ##### Re: REST Standards

by Benjamin Carlyle /

• ##### Re: REST Standards

by Victor Volle /

• ##### Re: REST Standards

by Benjamin Carlyle /

• ##### Re: REST Standards

by Johannes Brodwall /

• ##### Re: REST Standards

by Ron Ten-Hove /

• ##### SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

"There's not only one way to build a distributed system. RESTful is one way, SOA is another as are distributed objects and RPC."

So, REST!=SOA? So, SOA==SOAP+WS-*?

I hope he was just kidding.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

I didn't anywhere say SOA == SOAP+WS-*! SOA is an approach to building systems, WS-* is a bunch of technologies .. with which you can certainly realize SOAs but its by no means the only way.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

"SOA is another [way]"

So what's the point in putting SOA as an alternative to REST?

• ##### An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

What a hoot :)

We need WS-Addressing because we don't want people who design non-working architectures to use an alternative specification. No one would trust HTTPS to do business transactions like banking or business-to-business purchasing, so we need WS-Security. You can't implement services like amazon using REST because the web is a "Resource-Oriented" rather than "Service-Oriented" architecture. We need to exchange WSDL documents before I can "GET" the share price of MSFT from your web service, because otherwise your service might return data in a format I don't understand.

It's the same old bandwagon. Start with the assumption that all interactions must be possible. Design a protocol suite that permits these interactions, then wonder why all of the practical architectures are infeasible with your technology. REST starts with the architectural constraints and ends at a practical, evolvable, scalable wide-participation architecture like that of the web. It's interaction patterns aren't described in WSDL, they are described in rfc2616. There is the GET interaction pattern. There is a PUT, a POST, so on and so-forth. If you want to design new interaction patterns you are free to make your case. It won't take another 100+ specifications to extract all of the useful parts of the WS-* stack and apply them back to the web. I suspect the only valuable piece there is to extract is the equivalent of "POST at most once".

Benjamin

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

SOA is an alternative to ROA.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

Well I certainly wasn't expecting a lot of love from RESTafarians after this interview :). Stefan himself had to keep his hands in his pockets to control himself I think!

Yep, REST solved everything and those of us who are not RESTafarins are just too dumb to know a good thing when they see it.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

So... you can't do SOA using REST?

• ##### Ignores the main issue

by Dean Jones /

Your message is awaiting moderation. Thank you for participating in the discussion.

This article, like many recent web services articles (including the recent shenanigans comparing the performance of Axis2 with other stacks) avoids the single most important issue that (in my experience) most development teams care about, and which they base their choice of stack on. Namely, how easy is it to develop, deploy and maintain a web service? In this respect, the original Axis was shockingly bad. Unfortunatly, Axis2 makes no significant improvements in this area. XFire is a huge improvement on both of these, beating the pants off the usual Apache bloat, and I expect the forthcoming Spring WS to do so as well.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

SOA as a business concept can be implemented using WS-* or REST - both (and many others) are valid strategies.

Others view SOA and ROA as alternatives, with WS-* being an implementation of SOA, and RESTful HTTP an implementation of ROA. That view is valid as well.

I believe Sanjiva's view is the first, yours is the second.

• ##### Re: Ignores the main issue

Your message is awaiting moderation. Thank you for participating in the discussion.

This interview was not about ease of development. I can talk at length about the programming model decisions we've made in Axis2 and why I think many (not all!) of those are right. XFire addresses a different set of needs and if you want to see where they're heading you should check out Apache CXF, which is what Dan considers XFire 2.0.

FWIW I absolutely agree ease of development is critical. We in Axis2 land are not done trying to make development easy or easier.

In any case, let's not divert this conversation into yet another Axis2 vs. XFire food fight; surely we can argue about REST vs. WS-* without needing to bring that in too! :)

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

+1 for the most part. The only point where I'd differ is that its any architecture or design patern can be implemented with any combination of technologies. Its all a matter of finding the right tool for a particular job- there's no such thing as a single tool that works for all scenarios.

Thus, I'd *never* say that WS-* was the solution to all distributed systems problems; just like I'd never agree REST is the solution to all distributed systems problems. Good engineers and architects must know all of these approaches and mix and match them appropriately to solve the given problems. Fanaticism about any given technology is so stupid.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

<quote>I believe Sanjiva's view is the first, yours is the second.</quote>

Just the opposite. Sanjiva puts something like 'you can use SOA *or* REST' in the sentence:

"There's not only one way to build a distributed system. RESTful is one way, SOA is another as are distributed objects and RPC. Anyone who thinks that RESTful is the one true way is simply naiive (or fanatically RESTafarian!)."

So he states that they're mutually exclusive, what's simply not true. SOA, as your second paragraph says, can be implemented in REST, SOAP and other architectures/technologies/strategies/whatever. He didn't compared REST to WS-* or SOAP, he compares it to SOA what is totally nonsense for me, and that's why I'm asking him about his definition of SOA and why it is 'another way'.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

The web was service-oriented long before anyone from the WS camp coined the term. Rather than offer your service in terms of a one-off custom WDSL specification you offer it in terms of standard interactions with a collection of resources. It is service-oriented that works in a large-scale participation network.

The long and the short of it is that REST defines a limited number of interactions that all system components should support if they are both meaningful and permitted. Because the number of interaction patterns and the kinds of data exchanged are both limited it is possible to plug system components together without prior planning. This is simply a dream in the WS-* world, where extra code being written in addition to generated code is usually a prerequisite.

The kind of service-orientation that corba and WS-* offer relies on special code to be written on both sides for each new IDL or WSDL developed. REST interactions rely on special code to be written whenever the current HTTP rfc is superceded or features of a new content type are required. WS-SOA works in systems where there are a small number of server-side implementations, particularly in special-purpose systems that are not designed to interact with a wider network.

We can see the history of this pattern already played out a number of times in the SCADA industry and in other system monitoring and control environments. One of the popular SCADA protocols in US electrical systems is OPC, OLE for process control. This is based on COM, but layers an IDL on top of COM that has RESTful properties. This allows it to act as a data interchange between units out in the field, servers in the data centre, and operator workstations. In order for a large number of both server and client components to interact you need a defined protocol that conforms to appropriate architectural constraints. In WS-SOA the whole protocol is not defined until you include the WSDL file on top of the specifications already in play as part of the WS-* stack. REST architectures define the full protocol in its combination of transport protocol and content type specifications.

I concede there is a scale between pure REST practice on the wider web and the needs of a small set of programs operating within a corporate environment. As you get to smaller networks and smaller numbers of server implementations the need to constrain both interact types and data types diminishes. The most important question in architecture today is probably how to deal with the various points on this scale within the same architectural envelope. I think REST forms a better basis for beginning this discussion than the nebulous WS-SOA concept, which really doesn't address issues of architecture directly.

WS-SOA advocates aren't stupid. I don't contend that. However they are facing and solving problems in ways that don't scale up to large participation architectures, and that will bite at some point. Does REST scale down better than WS-SOA scales up? I think so. My experience is that building small distributed systems RESTfully produces significant benefits and is not significantly more difficult. Probably the biggest inhibitor is that developers are often forced to think at two levels of abstraction:

• Which resources am I offering and how do client interact with them, and

• Which objects am I creating, and what function calls are being made on these objects.

Benjamin.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

"Same old bandwagon..." I couldn't agree more. I can't understand why more people haven't drawn parallels between WS-* and CORBA. Remember CORBA? Remember the sheer number of un-implementable specs produced by the OMG? Remember how ORBs from different vendors couldn't communicate with one another as soon as the IDL became non-trivial?

I wonder how many times we'll all watch this same play performed over the course of our careers...

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Phillip,

>He didn't compared REST to WS-* or SOAP he compares it to SOA what is totally nonsense for me
You simply cannot compare REST vs SOAP. REST is an architectural style while SOAP is a protocol (and WS-* is just a set of standards). So how can you compare apples to oranges?? SOA on the other hand is an architectural style, so it makes sense to compare REST with SOA.

I have had lengthy email discussions with Roy Fielding and Anne Thomas Manes (of course with Sanjiva too) about the subject and they both are of the view that SOAP (or WS-*) vs REST is not the right comparison, rather REST vs SOA is the more meaningful comparison. Unless you understands this, you cannot make the right decesions on what architecture is more appropriate for a given situation.

Also bear in mind that there is no formal definition for SOA,ROA or Web Services. Web Services like ESB is a term coined by marketing (pls correct me if I am wrong). Nobody says Web Services == SOA, but it's widely accepted that Web Services is one way of realizing SOA.

Now the question is can you use web services to realize REST ?? When you apply the REST constraints can you still call your service a web service? This is where there is a clear division in the community. While some think it's possible others thinks it is not. It also depends on how you define Web Services.

However one thing is for sure. The resurgence of REST and the concept of RESTful Web Services is purely driven by marketing. REST was there even before the Web. Roy thought about it even before he designed HTTP. Funny it was ignored all this time :). REST is now very hot and every stack thats out there wants to say they support REST eventhough there is utter confusion about the whole thing.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hello Rajith.

Also bear in mind that there is no formal definition for SOA,ROA or Web Services. Web Services like ESB is a term coined by marketing (pls correct me if I am wrong). Nobody says Web Services == SOA, but it's widely accepted that Web Services is one way of realizing SOA.

That is one of the big distinctions between REST and SOA. REST is very well defined (I won't get into "formality" here) in Roy Fielding's thesis as an architectural style. Any architectural style is, by definition, an abstract concept, more descriptive than prescriptive in nature. But is is well defined nonetheless. SOA is defined as many things in many places, which is another way of saying that it is not defined at all. Stefan's previous post hinted at two different possible meanings for SOA, both of which are interesting and useful, and in a perfect world would have good distinct names. But I guess we'll just have to live with the ambiguity and ensuing cognitive dissonance for, well..., forever.

Now the question is can you use web services to realize REST ?? When you apply the REST constraints can you still call your service a web service? This is where there is a clear division in the community. While some think it's possible others thinks it is not. It also depends on how you define Web Services.

I don't see this division at all, much less "clearly" :)
Full-stack WSDL+SOAP+XSD Web Services break constraints that are an integral part of the REST architectural style. One obvious difference is that there is no "Uniform interface" when we talk about invoking SOAP endpoints. As an aside, SOAP by itself is a fine XML vocabulary for extensible message envelopes and I don't see why it could not
be used, if *necessary*, as a media-type for a resource representation (though I guess that would be rare).

However one thing is for sure. The resurgence of REST and the concept of RESTful Web Services is purely driven by marketing. REST was there even before the Web. Roy thought about it even before he designed HTTP. Funny it was ignored all this time :). REST is now very hot and every stack thats out there wants to say they support REST eventhough there is utter confusion about the whole thing.

Utter confusion about what? And the only "stack support" needed for developing a RESTful web service is a good http library. It remains to be seen if further abstractions can be helpful (as opposed to WS-*, where they are pretty much necessary).

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

(ugh. I screwed-up the formatting. This is the same as the previous message, but properly formatted.)

Hello Rajith.

Also bear in mind that there is no formal definition for SOA,ROA or Web Services. Web Services like ESB is a term coined by marketing (pls correct me if I am wrong). Nobody says Web Services == SOA, but it's widely accepted that Web Services is one way of realizing SOA.

That is one of the big distinctions between REST and SOA. REST is very well defined (I won't get into "formality" here) in Roy Fielding's thesis as an architectural style. Any architectural style is, by definition, an abstract concept, more descriptive than prescriptive in nature. But is is well defined nonetheless. SOA is defined as many things in many places, which is another way of saying that it is not defined at all. Stefan's previous post hinted at two different possible meanings for SOA, both of which are interesting and useful, and in a perfect world would have good distinct names. But I guess we'll just have to live with the ambiguity and ensuing cognitive dissonance for, well..., forever.

Now the question is can you use web services to realize REST ?? When you apply the REST constraints can you still call your service a web service? This is where there is a clear division in the community. While some think it's possible others thinks it is not. It also depends on how you define Web Services.

I don't see this division at all, much less "clearly" :)
Full-stack WSDL+SOAP+XSD Web Services break constraints that are an integral part of the REST architectural style. One obvious difference is that there is no "Uniform interface" when we talk about invoking SOAP endpoints. As an aside, SOAP by itself is a fine XML vocabulary for extensible message envelopes and I don't see why it could not
be used, if *necessary*, as a media-type for a resource representation (though I guess that would be rare).

However one thing is for sure. The resurgence of REST and the concept of RESTful Web Services is purely driven by marketing. REST was there even before the Web. Roy thought about it even before he designed HTTP. Funny it was ignored all this time :). REST is now very hot and every stack thats out there wants to say they support REST eventhough there is utter confusion about the whole thing.

Utter confusion about what? And the only "stack support" needed for developing a RESTful web service is a good http library. It remains to be seen if further abstractions can be helpful (as opposed to WS-*, where they are pretty much necessary).

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi Phillip, nice to see you around here. :)

SOA, as your second paragraph says, can be implemented in REST, SOAP and other architectures/technologies/strategies/whatever. He didn't compared REST to WS-* or SOAP, he compares it to SOA what is totally nonsense for me, and that's why I'm asking him about his definition of SOA and why it is 'another way'.

I agree that asking him to pick which (of the many) definitions of SOA he was referring to is a good idea. The paragraph quoted above is, I think, pretty illustrative of the ambiguity. Stefan suggested that there are two views of SOA. A business view, which I would loosely describe as organizing an institution's IT development efforts as separate services, probably run by distinct teams, which communicate through well-defined interfaces. It is opposed to business strategies like "everything has to pass through the Big Integration Database" or "lets build one giant Consolidated app containing everything we need", etc. (Stefan, please correct me if I am mischaracterizing your views).

And then there is the second, more technical, view of SOA as an architectural style. The problem is that, IMHO, there is ambiguity in defining this second view as well. One could say that the SOA architectural style is predicated on message exchanges by loosely coupled systems. This is somewhat compatible with the REST style. It is also too unconstrained to be of any use. We could try to refine it and say that in a SOA, systems communicate by exchanging documents consisting in header/body envelopes that can be processed and routed by intermediaries using language-independent technologies. This is less compatible with REST, but reads like just a definition of WS-*, not an abstract architectural style.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Rafael, the first definition is exactly the one I was trying to provide, so you did definitely not misunderstand me. I agree with the ambiguity issue of the second definition as well, but did not want to complicate things even further :-)

When someone points out differences between SOA and REST, they're usually (at least in this particular moment) subscribing to the *technical* view. Every single time someone who subscribes to "SOA as a business concept" view complains "but you can do SOA with REST!"

• ##### Re: SOA?

by Peter Thomas /

Your message is awaiting moderation. Thank you for participating in the discussion.

Sanjiva: I would also really like to hear your definition of SOA. Or do you also feel that SOA is just marketing?

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

I have had lengthy email discussions with Roy Fielding and Anne Thomas Manes (of course with Sanjiva too) about the subject and they both are of the view that SOAP (or WS-*) vs REST is not the right comparison, rather REST vs SOA is the more meaningful comparison. Unless you understands this, you cannot make the right decesions on what architecture is more appropriate for a given situation.

Can you provide arguments on this conclusion?

Also bear in mind that there is no formal definition for SOA,ROA or Web Services. Web Services like ESB is a term coined by marketing (pls correct me if I am wrong). Nobody says Web Services == SOA, but it's widely accepted that Web Services is one way of realizing SOA.

However one thing is for sure. The resurgence of REST and the concept of RESTful Web Services is purely driven by marketing. REST was there even before the Web. Roy thought about it even before he designed HTTP. Funny it was ignored all this time :). REST is now very hot and every stack thats out there wants to say they support REST eventhough there is utter confusion about the whole thing.

I think it's the same thing as 'from-EJB-to-POJO'. POJOs were there all that time but it only got recognition as an architecture when the EJB model failed.

Actually I do think there is space for both technologies right now, my point is that stating that 'you use SOA or REST' is simply FUD.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi Rafael,

I don't see this division at all, much less "clearly" :)
Full-stack WSDL+SOAP+XSD Web Services break constraints that are an integral part of the REST architectural style. One obvious difference is that there is no "Uniform interface" when we talk about invoking SOAP endpoints. As an aside, SOAP by itself is a fine XML vocabulary for extensible message envelopes and I don't see why it could not be used, if *necessary*, as a media-type for a resource representation (though I guess that would be rare).

Even in your analysis you have described the two different schools of thought, which IMHO is an accurate reflection of the current division. In you main point you say REST constraints are broken with Web Services and then as a side point you mention, it is possible if *necessary* to use SOAP as a media type for a resource representation. I too agree. But in your second point, If I am not mistaken you don't seem to think, that SOAP as a media type doesn't necessarily mean it's Web Services. I also think the same. However there are many people who thinks that it's also Web Services. Thats why I said there is a clear distinction.

When someone points out differences between SOA and REST, they're usually (at least in this particular moment) subscribing to the *technical* view. Every single time someone who subscribes to "SOA as a business concept" view complains "but you can do SOA with REST!"

This is the clear division I am talking about. While some compare SOA and REST as alternatives, some thinks it's possible to do SOA with REST, or Web Services with REST. The fact that SOA, ROA and Web Services means many things many people, some things it is possible to do REST with Web Services while others think it's not.

Well look at the confusion and ambiguity surrounding REST and RESTful web services. IMO a lot of people have not groked the concept of REST properly. Many think POX/HTTP is REST. And that is why people tend to compare SOAP vs REST.

And the only "stack support" needed for developing a RESTful web service is a good http library. It remains to be seen if further abstractions can be helpful (as opposed to WS-*, where they are pretty much necessary)

Spot on. Thats exactly my point. We had HTTP libraries for ages. Did anybody talk about REST? Now every SOAP stack out there is trying to say we support REST !!!!! Since when do u need a SOAP stack to do REST??? Look at Sun's new JSR 311, why aren't they improving the existing API's for HTTP and adding that support their instead of doing it inside JAX-WS? That is more marketing than anything else. REST is hot now, so is Web Services. Most people think it's possible to do both in one (the feeling I got from attending conferences last year), so marketing is trying to cater to this large segment.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

When someone points out differences between SOA and REST, they're usually (at least in this particular moment) subscribing to the *technical* view. Every single time someone who subscribes to "SOA as a business concept" view complains "but you can do SOA with REST!"

I totally agree here. People who talk about SOA as an abstract architectural style, compares REST and SOA as alternatives.
Folks who think SOA as a "Business Concept" mostly promoted by marketing and executives(and I have heard comments like SOA is not technology but a culture change etc at conferences) thinks and wants to do SOA with REST (and everything under the sun that can make money) wether it is possible or not. As I said it's more marketing driven than anything else.

• ##### REST Standards

by Victor Volle /

Your message is awaiting moderation. Thank you for participating in the discussion.

I do not like the WS-* standards, there simply are too many for my taste. They are complicated (I hate XML Schema), they are difficult to debug, if anything in your toolset seems to behave wrong. But ...
But I like having standards. And I prefer to have a standard for signing XML messages. I like to have a standard that gives "types" and "syntax" for XML messages. And so on.

With REST I can solve all these issues (and did), but without a standard I have to solve them again and again. For every new company/partner that I want to integrate, I have to negotiate again, how to handle these issues. Ok, if I am Google or Amazon _I_ do not have to negoatiate.

And picking up a discussion with Stefan Tilkov (see www.innoq.com/blog/st/2006/06/30/rest_vs_soap_o...) I am still thinking, it might be my mind set that seems to prefer "methods" like "promoteToCustomer" "and transferMoney" As far as I have understood REST by now, I would have to write the first as something like "PUT Customer" (and check which fields have changed) or "POST CustomerCollection?Customer".
And for transferMoney I would have to do something like "POST Transactions?Account1&Account2&Amount". And how do I define the parameters that are allowed/necessary?

• ##### Re: REST Standards

Your message is awaiting moderation. Thank you for participating in the discussion.

I think you are right that the REST community has so far not been great at developing standards. Most relevant standards have come out of the IETF or w3c, and the rest community can be said to have come out of those organisations more than it has really turned around and put back into them.

I think there are two sides to this. On one side you have the universality issue. If we are talking about REST in terms of the architecture of the web it takes a pretty big problem that affects a lot of people to create impetus to change anything. HTTP/1.1 is still not universally adopted after how many years of standardisation? On the other side of the issue you have more corporate-minded people who I think are only just starting to seriously join the REST camp.

I think the REST community is almost ready to start seriously organising around grass-roots solutions to problems that many of us face in implementing real REST technology. Technology that is ready for the web can still go through the IETF, but I wonder if we need a set of alternative bodies. These bodies would work on smaller problem sets within particular industries or on problems that could take decades to be solved on the wider web.

I'm not entirely sure what you mean by promoteToCustomer (this highlights the issue of using non-uniform methods). I'll assume you mean something like "send to customer" or "make an issue known to the customer". The answer to this one really depends on the detail, but one could see either a POST to the customer's message queue or a PUT of "true" the information's "customer visible" url.

I would see most transferMoney requests as POSTing a transaction, eg POST "<transfer><debit account="1">100</debit><credit account="2">100</credit></transfer>" to example.com/newTransactions. As I mentioned earlier, the REST community hasn't made the inroads that it perhaps should have. I don't think we have a straightforward content type for this transaction, though there are probably a few contenders out there in limited circulation.

Benjamin

• ##### Re: REST Standards

by Victor Volle /

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi,

I should have added some documentation to "promoteToCustomer" :-) In our company that means "promoting" someone who previously has expressed an interest in one of our products/services to become a customer (this is different compared to someone completely new, w.r.t. to some backend processes). But I do not think that "this highlights the issue of non-uniform methods" as you put it. Because PUTting the person to the CustomersList would not be as explicit. There may be many processes, where finally someone becomes a customer, but only one way where "promoteToCustomer" must be called (you can think of this service as kind of "orchestration" service that calls other services).

W.r.t. to transferMoney POSTed as <transfer> just seems to move the "verb" of the operation ("transfer") into the message. Where is the advantage compared to a WS? Creating a mapping for all "operations" onto PUT/POST/GET/DELETE seems to me now like a reduction in expressiveness of the interface. How would I describe the REST "interface" to an interested party, another company that wants to use our services? Again: as bad as XML-Schema and WSDL might sometimes be, they are there, we can use them now.

Sorry, I do not get the REST vs. WS debate. For me REST just looks like another technology based on another mind set. It might feel better from a developer perspective. It might be better for one-to-one communications or for _very_ big hubs with many spokes (Amazon, Ebay, Google). But from my point of view it doesn't look that well for B2B (many-to-many) of for some big "corporate" in-house development teams. So is it perhaps just: "Choose the right tool for the right problem"?

I am currently mostly using SessionBeans/DTOs as interface for a diverse set of clients, perhaps this influences my way of thinking (and it would take a huge amount of effort to change every developer toward a REST perspective). But even for a green field project, I don't really understand the advantages of using REST. So perhaps it is my "socialization". How does yours differ?

Victor

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi Rafael,

WSDL+SOAP+XSD Web Services break constraints that are an integral part
of the REST architectural style. One obvious difference is that there
is no "Uniform interface" when we talk about invoking SOAP endpoints.

WSDL+SOAP+XSD most definitely <em>allow</em> one to break the uniform interface constraint. However, that's user choice- in WSDL 2.0 in particular its perfectly possible to describe 100% RESTful services. (WSDL 1.1 allows it too but its at least a bit messy.) So if you want to use WSDL+SOAP+XSD in a RESTful manner you can.

Similarly, HTTP has extension methods- which clearly allows one to break the uniform interface constraints. (Anyone remember M-POST from SOAP 0.9?) In fact, WebDAV has its own new uniform interface extending from the 4 HTTP ones.

Does that mean HTTP is non-RESTful? It means that one can build RESTful and non-RESTful systems with HTTP. Its user choice.

Is WebDAV RESTful? Interesting question .. in its own world it works within a uniform interface and therefore it does not break the constraint. However, relative to base HTTP its not keeping to the rules right?

As an aside, SOAP by itself is a fine XML vocabulary for extensible
message envelopes and I don't see why it could not
be used, if *necessary*, as a media-type for a resource representation (though I guess that would be rare).

I can see where that could be useful- imagine wanting to sign the body of a POSTed XML? Where would you put the signature? You'd need some envelope structure and SOAP is as good as any at saying envelope/header/body. I believe Amazon's WS API has their own (pre-SOAP/pre-WS-Sec) form of an envelope.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi Philip,

If your point is that its perfectly possible to implement a service that adheres to the constrained interface and so on, then I agree with you that its possible to implement SOA with REST.

What I was trying to point out is that if you take a given distributed systems problem and try to design a soltion, then artifacts you'd be dealing with and the shape of them would be different if you tried to design it as as a bunch of interacting services vs. as a bunch of interacting resources. Its at that level that I see SOA and ROA as being two different ways to skin a cat.

Does that mean one is wrong or one is better? Of course not. Given a particular problem it may indeed be the case that SOA or ROA is a better approach for the problem but I don't see how anyone can say that either approach is better for all distributed systems problems.

• ##### Re: REST Standards

Your message is awaiting moderation. Thank you for participating in the discussion.

Sorry, I mean "transaction" rather than "transfer" in the newTransactions example. In REST we would normally never PUT or POST a document that didn't also make sense to GET. It makes sense to GET a transaction, or have it returned as part of a transaction list. A transfer on the other hand is, as you say, a verb that it doesn't usually make sense to transfer.

Check out my (still pretty draft) REST in plain English article on restwiki. It's all about constraining interaction patterns to small set that everyone understands, allowing components with similar patterns and document types to interoperate without prior planning. REST does this in a way that allows interfaces to evolve over decades of new demands being placed on the architecture, as well as scale to huge network sizes.

Does REST help a single client interact with a single server? Not much, though the REST API of the server will likely be familiar to someone already comfortable with REST. REST is really about how the architecture performs when there are thousands of client implementations, hundreds of server implementations, and millions of architecture components controlled by just as many different agency interests over limited bandwidth fixed latency networks.

If you think you'll never participate in that kind of architecture you can stick with WS-SOA, but I would generally plan with at least one eye on the big picture. REST's benefits are not simply on or off. They improve as the size and criticality of your architecture increase. I also think the big picture architecture will do some bending over the next few years to more directly meet the needs of developers who currently depend on WS-SOA.

Benjamin.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Hello, Sajiva,

Atlhough we agree, that statement I've quoted a lot of times in this thread is very problematic, as I said in my lat post here. Someone has to read tons of papers and posts to realize what you were trying to say there, and most people simply will not do it at all before taking conclusions.

Therefore we will have people who read this interview and will get the feeling that SOA is antagonic to REST. By the time a developer suggest RESTful services to solve a business problem, his manager possibly will say something like "Not at all, we're on SOA here. Get these SOAP books and bring me solutions using SOA".

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

Hmmm .. maybe people realize that WS-* is not a distributed object system like CORBA is? At least those people who understand that WS-* is not what SOAP 1.1 and its RPC system enabled understand that WS-* is not a distributed OO!

You shouldn't also judge WS-* by the old generation of middleware that has been built for it- look at it with new stuff like Apache Axis2 / WSO2 WSAS / Microsoft WCF and you'll see that its not at all about making RPC calls over XML.

• ##### Re: SOA?

Your message is awaiting moderation. Thank you for participating in the discussion.

Well. REST is a architecture style,it is not a tecnology.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

Yeah dude, I get it. What I also understand is that french vanilla is so close to vanilla that it's not worth quibbling about. What I understand beyond that is that the same things that effectively killed CORBA (and when I say "CORBA" I mean all of the other stuff that went with it, which overlap nicely with all the WS-* stuff) are the same things that are going to kill WS-*.

Of course, unfortunately, it won't be killed before a whole lot of snake oil salesmen have sold a whole lot of expensive middleware junk on a whole lot of golf courses to a whole lot of CIOs. And then those CIOs move on to the next sorry company, while a bunch of rank-and-file programmers are left with a bunch of angry users, trying to figure out how to get server X to understand the XML coming out of server Y.

I don't mean to sound rude, man - I know that you're trying to solve a lot of big hairy problems. It's just that these problems aren't new, and the solutions aren't quite as new and improved as some would have us believe.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

I understand the view about snakeoil salespeople but how do you explain the wide adoption of open source WS-* stacks? We don't go around "selling" that stuff; people are coming and "buying" it (at zero cost) without us marketing it. How do you explain that- maybe all the developers who are looking and using those are misguided?

Come on. REST has its place in the world. So does WS-*. Neither is a magic solution.

• ##### Re: REST Standards

Your message is awaiting moderation. Thank you for participating in the discussion.

I should have added some documentation to "promoteToCustomer" :-) In our company that means "promoting" someone who previously has expressed an interest in one of our products/services to become a customer (this is different compared to someone completely new, w.r.t. to some backend processes). But I do not think that "this highlights the issue of non-uniform methods" as you put it. Because PUTting the person to the CustomersList would not be as explicit. There may be many processes, where finally someone becomes a customer, but only one way where "promoteToCustomer" must be called (you can think of this service as kind of "orchestration" service that calls other services).

POST /party/124134/customership<customerRelationship>  <keyAccountManager>my.org.com/employees/12355</keyAccountManager>  <customerStatus>GOLD</customerStatus>  <expirationDate>2008/12/31</expirationDate></customerRelationship>

Sorry about the beating of deceased equines.

• ##### Re: An implementation in search of an architecture

Your message is awaiting moderation. Thank you for participating in the discussion.

Sanjiva wrote

how do you explain the wide adoption of open source WS-* stacks? We don't go around "selling" that stuff; people are coming and "buying" it (at zero cost) without us marketing it.

With all due respect, you are definitely "marketing" the stuff -- just with slightly different means than the vendors of commercial products. And the marketing of WS-* done by the big vendors of commercial products, including your former employer, obviously benefits WSO2, too.

Which is all perfectly OK; just pointing out that adoption of Axis2 and other WSO2 products, however widespread it may be, is in itself not a sign of WS-*'s qualities (or lack of thereof).

• ##### Re: An implementation in search of an architecture

by Mark Baker /

Your message is awaiting moderation. Thank you for participating in the discussion.

"REST has its place in the world. So does WS-*. Neither is a magic solution."

Of course neither is a magic solution. But I think the point that you're missing Sanjiva, is that REST is an architectural *improvement* on SOA; it adds a lot of loose coupling. Some generality is sacrificed with these constraints - for example high performance stateful messaging - but not that much.

REST separates interface from implementation, while SOA does not. That's what the difference boils down to. See my earlier article here on that topic.

• ##### Re: REST Standards

by Ron Ten-Hove /

Your message is awaiting moderation. Thank you for participating in the discussion.

• ##### Re: An implementation in search of an architecture

by Frank Cohen /

Your message is awaiting moderation. Thank you for participating in the discussion.

Hi Ben: I disagree. WADL (www.pushtotest.com/thecohenblog/wsdl-and-wadl) is getting some traction with me as a way to provide a service interface definition for REST and AJAX services. It seems to me that there is a lot more investigation and experimentation over the next couple of years before any of these message-oriented protocols and their respectives stacks will emerge as a winner.

-Frank Cohen
www.pushtotest.com

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.


text:
# [tex4ht] Again biblatex

Thompson,Paul Paul.Thompson at SanfordHealth.org
Wed Oct 5 04:46:18 CEST 2011

Googling, I find:

This also rings a faint bell, but I cannot find other comments about it. I think that it is an asynchronous update.

________________________________________
From: tex4ht-bounces at tug.org [tex4ht-bounces at tug.org] on behalf of Andrew Goldstone [andrew.goldstone at gmail.com]
Sent: Tuesday, October 04, 2011 1:14 PM
To: tex4ht at tug.org
Subject: Re: [tex4ht] Again biblatex

Today I hit the same error with biblatex and tex4ht described in this thread: footnote citation styles produce a "Missing \begin{document}" error in the tex4ht run. Just in case it's some help to the maintainers as they debug, may I mention a kludge which seems to help?

Noticing that the error had to do with the biblatex package variable \abx at aux@fnpage, I checked to see how biblatex.4ht treats this variable. Answer: not quite analogously to how it treats \abx at aux@page. So I tried simply adding the line

\let\abx at aux@fnpage\@gobbletwo

right after biblatex.4ht, l. 170 (this is in the biblatex.4ht in the trunk of the svn repository). Cf. biblatex.sty as well for the handling of this variable.

Now I can htlatex a test file, with footnote cites, and not get errors during the tex4ht run. The resulting HTML looks correct. Obviously I haven't tested this much, and I do not understand the underlying biblatex or tex4ht code. But maybe this idea will help zero in on the problem.

Now really I don't want to produce HTML but ODT. oolatex also runs without errors, and produces correct-looking footnotes. But there is a separate bug in oolatex's code for handling the list of references (\printbibliography), which comes out blank. I have some ideas about that, but that's for another thread.

Best,
Andrew Goldstone

-----------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
privileged and confidential information.  Any unauthorized review, use,
disclosure or distribution is prohibited.  If you are not the intended

format: plain


text:
## graydarl Can someone hlep me with this math problem? serie : an=(alpha*n)/(n+1), n>=1 (alpha is from R-real number). I must determine if the series is monotone and bouded thank you very much one year ago one year ago

1. satellite73

i would try with $$\alpha =1$$ first

2. satellite73

in this case you would get $$a_n=\frac{n}{n+1}$$ which is bounded below by $$1$$ since $$\frac{n}{n+1}<1$$ for all $$n$$ and $$\lim_{n\to \infty}\frac{n}{n+1}=1$$

3. satellite73

i meant "bounded above by one" not below!

4. satellite73

it is monotone increasing as you can check by taking the derivative and seeing that is always positive

5. satellite73

then try the general case with $$\alpha$$

6. Fazeelayaz

yes alpha* n/(n+1) limi$\lim_{x \rightarrow \infty}{n/n+1}$ $n/n(1+1/n)=1/(1+1/n)$ take limit to infinity $1/(1+0)=1$ $\alpha*1=alpha$

7. Fazeelayaz

the last term is alpha

8. Fazeelayaz

the serries os monotone

9. Fazeelayaz

the serries is also bounded below becaise it says n>1 soo first term is 1

10. Fazeelayaz

plz give me medal if i helped


text:
# Singular

#### D.14.3.3 PH_ais

Procedure from library phindex.lib (see phindex_lib).

Usage:
PH_ais(I); I ideal of coordinates of the vector field.

Return:
the Poincare-Hopf index of type int.

Note:
the isolated singularity must be algebraically isolated.

Theory:
The Poincare-Hopf index of a real vector field X at the isolated singularity 0 is the degree of the map (X/|X|) : S_epsilon ---> S, where S is the unit sphere, and the spheres are oriented as (n-1)-spheres in R^n. The degree depends only on the germ, X, of X at 0. If the vector field X is real analytic, then an invariant of the germ is its local ring
Qx=R[[x1..xn]]/Ix
where R[[x1,..,xn]] is the ring of germs at 0 of real-valued analytic functions on R^n, and Ix is the ideal generated by the components of X. The isolated singularity of X is algebraically isolated if the algebra Qx is finite dimensional as real vector space, geometrically this mean that 0 is also an isolated singularity for the complexified vector field. In this case the Poincare-Hopf index is the signature of the non degenerate bilinear form <,> obtained by composition of the product in the algebra Qx with a linear functional map
<,> : (Qx)x(Qx) ---(.)--> Qx ---(L)--> R
with L(Jo)>0, where Jo is the residue class of the Jacobian determinant in Qx. Here, we use a natural linear functional defined as follows. Suppose that E={E_1,..E_r} is a basis of Qx, then Jo can be written as
Jo=a_1E_{j1}+...+a_kE_{jk}, js\in {1...r}, s=1..k, k<=r, where a_s are constant. The linear functional L:Qx--->R is defined as L(E_{j1})=(a_1)/|a_1|=sign of a_1,
the other elements of the base are sent to 0.
Refs. -Eisenbud & Levine, An algebraic formula for the degree of a C^\infty map germ, Ann. Math., 106, (1977), 19-38.
-Khimshiashvili, On a local degree of a smooth map, trudi Tbilisi Math. Inst., (1980), 105-124.

Example:
 LIB "phindex.lib"; ring r=0,(x,y,z),ds; ideal I=x3-3xy2,-y3+3yx2,z3; PH_ais(I); ==> 3


text:
# Uniformly sampling or counting connected graph partitions with any number of blocks

Question: Is it possible to uniformly sample in polynomial time from the set of all connected partitions of a graph? Or is there a JVV type argument that proves this to be NP-hard?

To clarify: By a connected partition of $$G = (V,E)$$ I mean a partition of the nodes of $$V$$ into blocks $$A_1, \ldots, A_m$$, where each $$A_i$$ induces a connected subgraph. There are no constraints on the number of blocks. In different language, I am asking about uniformly sampling from the flats of the graphic matroid of $$G$$.

I thought about this for a while, but couldn't figure it out. Maybe someone knows the answer or can suggest something to try? The question of counting the number of connected partitions is closely related and also interesting to me.

Here are some related things I know:

• If you fix the number of blocks of the partition, then this is NP-hard to sample. For example, in the $$2$$ block case, this follows by reducing to uniformly sampling simple cycle in the plane dual graph. (Both the NP-hard optimization problem and the probability concentration gadget do not carry over meaningfully to the any number of blocks case.)

• Enumeration is possible in total linear time. For instance this follows from this: https://arxiv.org/pdf/1107.4301.pdf

• The idea of the previously linked paper also lets you sample low rank flats somewhat efficiently. That is, by picking weights $$2^k$$ so that each flat has a unique min basis, and then using that a rank $$r$$ flat in the graphic matroid of a plane graph will have $$O(6^{2r})$$ basis ( https://arxiv.org/abs/0912.0712 ) to obtain a bound on the rejection rate obtained by sampling a nearly uniform rank r independent set (using basis-exchange walk) and then checking if it is the min-weight basis of its span.

• There is natural family of Glauber dynamics type Markov chains to try: Any connected partition can be identified with the corresponding flat in the graphic matroid (i.e. the edges with both endpoints in the same block), and one can introduce a Metropolis-Hasting's score function that measures deviation of a subset of edges from being a flat. For instance, for any set of edges, $$J \subset E$$, and some fixed $$\lambda > 0$$, the score can be $$\lambda^{ loops(G/J)}$$, where $$loops$$ measures the number of self loops, that is, edges in $$E \setminus J$$ that go between the same connected components of $$G[J]$$. For $$\lambda = 1$$ this mixes rapidly, but the stationary distribution is not concentrated on the flats.

• For $$\lambda$$ very small the stationary distribution in the chain of the previous bullet is concentrated on the flats. However, there are examples where the mixing slows down when decreasing $$\lambda$$ (for instance, a $$d$$-dipole graph will have a hard time leaving the flat containing all edges). I couldn't figure out cases like the grid graph.

• Describing connected partitions as flats as in the Markov chain two bullets above leads to another total linear time enumeration algorithm; you can tell whether it is possible to extend a set of deleted and a set of included edges to a flat by checking whether there are any contradictions. Checking whether there are any such contradictions is straightforward to do efficiently, and so one can use backtracking to enumerate.

• Somewhat surprisingly, for small grid graphs, say $$8 \times 8$$, rejection sampling for flats from subsets of edges is reasonably efficient. This can be used to test the Markov chain in the previous bullet for grid graphs, and it seems to work ok. Empirically, a typical connected partition of a grid graph appears to consist of many small blocks.

• Another Markov chain uses spanning trees to parametrize partitions. Versions of this have been written about in a few places: https://arxiv.org/abs/1908.07176 (see the thesis of Tien Vo on "Large-Scale Statistical Inference for Graph-Associated data" for details on the Markov chain mentioned in that paper), https://arxiv.org/abs/1808.00050, https://arxiv.org/abs/1911.05725.

• The complete graph case is already interesting and non-trivial: https://www.sciencedirect.com/science/article/pii/0097316583900092

• For purposes of counting or sampling connected partitions on smaller graphs, ZDDs are a natural structure to use. The python package Graphillion should be able to handle this -- I spoke with one of the developers recently and they apparently have been working on adding connected partitions: https://github.com/takemaru/graphillion/issues/43

• I believe sampling/counting flats is still open. A related open problem is the log-concavity of the number of flats parametrised by sizes, or the so-called Whitney number of the second kind. See e.g. Section 4.10 of arxiv.org/pdf/1705.07960.pdf – Heng Guo Apr 8 '20 at 9:37
• (cont.) Usually an easy to sample structure form a log-concave sequence when parameterised by sizes. (If there were two exponentially large peaks, local Markov chains are always slow.) This is the case for independent sets for matroids thanks to a sequence of great work by Huh and others. Flats are conjectured to be log-concave but we still don't know. – Heng Guo Apr 8 '20 at 9:41
• @HengGuo Just to clarify -- you think it's open that counting flats is #P complete, not even when restricted to the case of graphic matroids? (E.g. in the context where the Matroids are representable over some field, or the family of matroids is given by a polytime constructable circuit realizing the independence oracle.) Thanks for the interesting comments. – Lorenzo Najt Apr 14 '20 at 17:12
• I think approximate counting / sampling is open. I cannot recall exact counting being #P hard, but perhaps that's not too hard to show? (Just my guess and I haven't tried.) – Heng Guo Apr 15 '20 at 9:58

## 1 Answer

The generalized question about exact counting of flats of a matroid has an answer.

Let $$G$$ be a graph, and let $$G^{\circ}$$ be the same graph with a loop at every vertex. Then, the flats of the bicircular matroid of $$G^{\circ}$$ are exactly the forests of $$G$$; see Bicircular geometry and the lattice of forests of a graph.

It is known, on the other hand, that counting the number of spanning forests in a graph is a $$\#$$P-hard problem. See for instance Fast exponential-time algorithms for the forest counting and the Tutte polynomial computation in graph classes.

Putting these together shows that exact counting of flats is in general $$\#$$P-hard.

Remark: The approach that led to finding this example was to search through examples of matroids on wikipedia, and reading the section on flats until I saw one that I knew to be related to NP-hard problems.

Remark: Additionally, it is known that the forest counting problem remains hard when parametrized by the number of edges. See here. (Although that paper points out that the problem is fixed parameter tractable for plane graphs, because of this algorithm: https://arxiv.org/abs/cs/9911003 .)

Sampling or approximate counting: I'm not sure about sampling or approximate counting flats from a matroid.

There appears to be a long line of work on the problem of approximately counting forests: see Forests, colorings and acyclic orientations of the square lattice or A Randomised Approximation Algorithm for Counting the Number of Forests in Dense Graphs. Perhaps another matroid would provide a more tractable example of hardness of approximation / sampling. I will update this answer if I learn about one.


text:
# Changeset 4636

Ignore:
Timestamp:
Nov 2, 2020 10:25:36 AM (2 years ago)
Message:

fixes for sphinx docs

Location:
trunk
Files:
2 edited

### Legend:

Unmodified
 r4582 *d* is the d-spacing, and :math:d^* is the reciprocal lattice spacing, :math:Q = 2 \\pi d^* = 2 \\pi / d. Note that GSAS-II variables p::Ai (i=0,1,...5) and p is a phase number are Note that GSAS-II variables p::Ai (i = 0, 1,... 5) and p is a phase number are used for the *Ai* values. See :func:A2cell, :func:cell2A for interconversion between A and unit cell parameters; :func:cell2Gmat :func:Gmat2cell for G and cell parameters. *A* tensor terms (Ai, :math:A_{i}) so that A is redefined :math:A = (\\begin{matrix} A_{0} + D_{11} & A_{1} + D_{22} & A_{2} + D_{33} & A_{3} + 2D_{12} & A_{4} + 2D_{13} & A_{5} + 2D_{23}\\end{matrix}). See :func:cellDijFill. Note that GSAS-II variables p:h:Dij (i,j=1,2,3) and p is a phase number Note that GSAS-II variables p:h:Dij (i,j = 1, 2, 3) and p is a phase number and h a histogram number are used for the *Dij* values. '''


text:
# Positive Solutions to Linear Diophantine Equation

• Aug 3rd 2010, 11:24 PM
roninpro
Positive Solutions to Linear Diophantine Equation
I've been looking at the following problem, involving Diophantine equations:

Let $a,b,c\geq 0$ such that $\gcd(a,b)=1$ and $c\geq (a-1)(b-1)$. Show that there exist nonnegative integers $s,t$ so that $as+bt=c$.

I know that the solutions to a linear Diophantine equation are given by $x=x_0+bt, y=y_0-at$, where $(x_0,y_0)$ is a particular solution and $t$ is an integer parameter. If I want these to be positive simultaneously, I need to have $\dfrac{-x_0}{b}\leq t\leq \dfrac{y_0}{a}$. In other words, there needs to be an integer in the interval $\left[\dfrac{-x_0}{b}, \dfrac{y_0}{a}\right]$.

From here, I cannot seem to put bounds on the endpoints of the interval. I would appreciate any insight you may have on the issue.
• Aug 4th 2010, 12:11 AM
chiph588@
• Aug 4th 2010, 12:22 AM
roninpro
Thanks. I looked into the link provided in the Yahoo answer and was pleasantly surprised to see that the proof given was geometric. I myself spent some time trying to handle the problem geometrically (with a similar approach), but I couldn't get it to work. I should be more careful next time!


text:
# Labels at an angle: an unexpected gap

I am trying to put some labels at some angles:

\documentclass[14pt]{extarticle}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[label distance=0.5cm]

\node[draw,circle, minimum size=10cm, thick,
label=1:a, label=2:a, label=3:a, label=4:a, label=5:a,
label=6:a, label=7:a, label=8:a, label=9:a, label=10:a,
label=44:a, label=45:a, label=46:a, label=47:a, label=48:a,
label=91:a, label=92:a, label=93:a, label=94:a, label=95:a,]
(c1) at (0,0) {};

\end{tikzpicture}
\end{document}

The labels are positioned evenly except for some gaps, that seem to appear only around the angles of 90*n+3 degrees:

Why is this happening and what can I do about it?

• The problem also appears at 90*n-3: \documentclass[14pt]{extarticle} \usepackage{tikz} \begin{document} \begin{tikzpicture}[label distance=0.5cm] \foreach \Angle in {1,2,...,360} \node[draw,circle, minimum size=10cm,label=\Angle:a] (c1) at (0,0) {}; \end{tikzpicture} \end{document} – Gonzalo Medina Aug 8 '15 at 15:32
• Same for pin: \tikz\foreach~in{0,...,359}\node[circle, minimum size=10cm, thick,pin=~:.]{}; – Kpym Aug 8 '15 at 16:14
• If you check this snippet \tikz\draw[draw=red]foreach~in{0,...,99}{(0,0) node[circle, minimum size=4cm,thick,pin=~:.]{}(~:2)--(~:2.1)}; you can see that the imprecision is everywhere ... – Kpym Aug 8 '15 at 16:34
• This is probably the same problem as in this question. – Kpym Aug 8 '15 at 16:43
• An answer and explanaitions are here : tex.stackexchange.com/questions/163762/… – Tarass Aug 8 '15 at 17:03

I clicked Kpym and Tarass's links and in fact Loop Space gives the reason.

Briefly speaking, TikZ invented anchor to help you put nodes at the desired position. In this case, we are putting labels, which are nodes internally, lacking the information of which anchor is used.

Obviously TikZ uses the anchor on the edge if the inout angle is about 90x, and uses the anchor at the corner otherwise. What is not obvious is that TikZ implemented two mechanisms to do so: normally it is \tikz@auto@anchor deciding the anchor; with absolute option it is \tikz@compute@direction. Perhaps the most obscure thing is that they do not always return the same result:

\documentclass[border=9,tikz]{standalone}
\usetikzlibrary{shapes.misc}
\begin{document}
\def\r{100cm}\def\s{10cm}\def\t{1cm}

\tikzset{
every label/.style={draw=black,inner sep=0,minimum size=\t}
}
\begin{tikzpicture}
\clip(0,\r)+(-\s,-\s)rectangle+(\s,\s);
\draw(0,0)node[draw,circle,minimum size=\r*2,
label=90:90,label=91:91,label=92:92,label=93:93,label=94:94,label=95:95]{}
(0,0)edge(90:\r) edge(91:\r) edge(92:\r) edge(93:\r) edge(94:\r) edge(95:\r);
\end{tikzpicture}

\begin{tikzpicture}[absolute]
\clip(0,\r)+(-\s,-\s)rectangle+(\s,\s);
\draw(0,0)node[draw,circle,minimum size=\r*2,
label=90:90,label=91:91,label=92:92,label=93:93,label=94:94,label=95:95]{}
(0,0)edge(90:\r) edge(91:\r) edge(92:\r) edge(93:\r) edge(94:\r) edge(95:\r);
\end{tikzpicture}

To create a \tikz@whatever@called which is continuous with respect to the input angle, and hence prevent the gap, the final \tikz@anchor should either

• be fixed; or
• vary continuously with respect to the input angle.

Loop Space implement the first possibility, in which the anchor center is the default choice.

\makeatletter
\tikzset{
reset label anchor/.code={%
\let\tikz@auto@anchor=\pgfutil@empty
\def\tikz@anchor{#1}
},
reset label anchor/.default=center,
every label/.append style={reset label anchor}
}
\makeatother
\begin{tikzpicture}
\clip(0,\r)+(-\s,-\s)rectangle+(\s,\s);
\draw(0,0)node[draw,circle,minimum size=\r*2,
label=90:90,label=91:91,label=92:92,label=93:93,label=94:94,label=95:95]{}
(0,0)edge(90:\r) edge(91:\r) edge(92:\r) edge(93:\r) edge(94:\r) edge(95:\r);
\end{tikzpicture}

I implemented the second possibility. In case the input angle is, say, 95, the output anchor is 275. In general, I add 180 to the input.

Therefore, if you extend the line connecting the parent and child nodes, it pass through the two centers, regardless its shape. (For circle labels, the distance is unstable because TikZ adds mandatory fix designed for rectangle labels.)

\tikzset{
every label/.append style={cross out},
every edge/.append style={shorten >=-1cm}
}
\makeatletter
\def\tikz@compute@direction#1{
\let\tikz@do@auto@anchor=\relax
\pgfmathsetcount{\c@pgf@counta}{#1+180}
\def\tikz@anchor{\the\c@pgf@counta}
}
\begin{tikzpicture}[absolute]
\clip(0,\r)+(-\s,-\s)rectangle+(\s,\s);
\draw(0,0)node[draw,circle,minimum size=\r*2,
label=90:90,label=91:91,label=92:92,label=93:93,label=94:94,label=95:95]{}
(0,0)edge(90:\r) edge(91:\r) edge(92:\r) edge(93:\r) edge(94:\r) edge(95:\r);
\end{tikzpicture}

To understand why these gaps around 0 or 90 appear, you should carefully read section "17.10.2 The Label Option" from pgfmanual. There you can read:

Then, an anchor point for the label node is computed. It is determined in such a way that the label node will “face away” from the border of the main node. The anchor that is chosen depends on the position of the border point that is chosen and its position relative to the center of the main node and on whether the transform shape option is set. In detail, when the computed border point is at 0º, the anchor west will be used. Similarly, when the border point is at 90º, the anchor south will be used, and so on for 180º and 270º.

For angles between these “major” angles, like 30º or 110º, combined anchors, like south west for 30º or south east for 110º, are used. However, for angles close to the major angles, (diﬀering by up to 2º from the major angle), the anchor for the major angle is used. Thus, a label at a border point for 2º will have the anchor west, while a label for 3º will have the anchor south west, resulting in a “jump” of the anchor. You can set the anchor “by hand” using the anchor key or indirect keys like left.

Now you can understand why there's a gap between labels at 2º and 3º. The former is placed according its west anchor, while for the last south west anchor is used. Remember that, by default, nodes are rectangular, then next figure shows the expected (although strange) behaviour

It shows labels at angles 1º, 2º and 3º. You can see how two first labels are closer than the third although red dots keep similar distance. The gap between labels contents is due to explained anchor selection.

In case you decide to use circle labels, results are similar, for similar reasons:

The code for previous results is:

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}[label distance=0.5cm, every label/.style={draw}]

\node[draw, circle, minimum size=3cm, thick,
label={[name=1]1:a}, label={[name=2]2:a}, label={[name=3]3:a}]
(c1) at (0,0) {};

\foreach \i/\j in {1/west,2/west,3/south west}
\draw (0,0)--(\i.\j) node[circle, fill=red, minimum size=2pt, inner sep=0pt]{};
\end{tikzpicture}

\begin{tikzpicture}[label distance=0.5cm, every label/.style={draw, circle}]

\node[draw, circle, minimum size=3cm, thick,
label={[name=1]1:a}, label={[name=2]2:a}, label={[name=3]3:a}]
(c1) at (0,0) {};

\foreach \i/\j in {1/west,2/west,3/south west}
\draw (0,0)--(\i.\j) node[circle, fill=red, minimum size=2pt, inner sep=0pt]{};
\end{tikzpicture}\end{document}


text:
# JMeter – Property File Reader – A custom config element

JMeter has many config elements to define some variables  which can be used in the JMeter test.

For example – the mostly used ones,

• User Defined Variables to create variable names & values
• CSV Data Set Config to read the test data from CSV file

But we do not have one to read a user property files!!  hm..Well..that is not true exactly!!

In the JMETER_HOME/bin folder, we have a jmeter.properties file which has JMeter specific properties to set logging configuration, HTTPClient configuration, remote host configuration etc.

The same file also has a property called user.properties in which we can mention our file path to be read to use it in JMeter. So, JMeter can actually read the user property files. Then what?  But – I do not want to touch JMETER_HOME/bin folder to read my property files every time.

Reading a user property files can also be done using Beanshell pre processors/Samplers in JMeter. However, as JMeter is open source, I wanted to create a custom config element to read the property files.   This link has the details to create a plugin for JMeter.

## Property File Reader  – Config Element:

• Go to JMETER_HOME/lib/ext foler.
• Place the jar file & Restart JMeter.
• Once yo launch the JMeter, You will see ‘Property File Reader’ as given below.

•  Select it to add it under Test Plan. Enter the file path of the Property file. Enter the absolute file path Or a variable containing file path.
• It supports both absolute or relative file path
• relative file path should be relative to the current jmx test plan.

• Lets assume our property file contains below properties.

• Create a simple test as given below. Response data of the Debug sampler shows the user properties we wanted to read.  Use ${__P(PROPERTYNAME)} in JMeter test to get the property value. I maintain no of users, ramp up period, test duration, application URL & many other information for my test in the property file. So I wanted to create a simple config element to read property file instead of using a Beanshell preprocessor to make a test neat & reusable. Happy Testing & Subscribe 🙂 Categories: Articles, Best Practices, JMeter ### 69 comments • nice blog. also if you can post a blog on custom code(Where custom code can be used in JMeter ) and monitoring part would help us. Thanks, Satish • When i add location in property file and try to pass in http request it is not picking correct value getting http://d:/test/ it should be like this http://d:/test/ error is when we pass C;\abc in this : colon is giving error can you solve this problem asap • Sorry that I do not understand your question at all. If you want c:\abc , You need to have c:\\abc as value in your property file as \ is used for escape sequence in Java. It is not limitation of this property file reader. • in property file i have this url=c:\abc in jmeter i get this http:/// error is due to use of colon if i use without colon ie url=c\abc then it get correct value • Instead of using Property File Reader, Just declare a User Defined Variable url=c:\abc & use it in your test. You should see the same error. So, It is not limitation of this config element. I do not understand why you use c:\abc in HTTP sampler. • I followed the installation procedure and not able to see the updated config element. Should i be changing any settings? • it looks like a Java version above 6 is required. when i updated the version to 8,, the property file reader is visible in the options. but still my jmeter doesn’t pick any values from the properties file. i declared them as below {_P(threads)} {_P(rampup)} and set the values in the properties file as threads=10 rampup=10 • Is it possible to get the source code for this extension? I would like to integrate this into some existing libraries I have for meter? • Hi, I’m using this just with C:\\abc. But the problem is: If I try to run my test, it does not work for first time(I think JMeter reads the file in C:\\ in first try too late! ) but if I run the test several times again, then it works good. do you have any Idea? • Weird. I see a similar issue reported by someone else. I will take a look for sure. Thanks for pointing it out. • Hey, This property reader is very handy add-on, but I think I found a minor defect. It doesn’t limit the functionality but still is the pain in the ass a bit 😉 The property reader is the first item of my Test Plan in JM. Even thou, the first launch of the test run gives fails of all tests relying on properties data. If I stop the run and restart it everything work like a charm then. Or maybe it is because I store values property file as JM’s properties? Is JMeter property is created as first thing ever, so read values needs a restart to be stored as properties too? JMeter version is use is: 2.13 r 1665067 Cheers, Kris. • I will try to check it clean after restart with debug sampler and get back if this will give any more info. • I did check it once again with a fresh start. The thing I am doing is to read the property file and after that assign property values to user variables with User Defined Variables config item. And, as I wrote yesterday – it works starting from second launch of the test plan. • Kris, That was a good find. Thanks once again. I tried to fix it. What happens here is… Jmeter’s StandardJMeterEngine class always loads the User Defined Variables first before loading other config elements (!!!). As you can also define UDV in the test plan level. So basically even if you place an UDV element as the last element of your test plan, that will get loaded first. StandardJMeterEngine’s run method starts as given below…  @Override public void run() { log.info("Running the test!"); running = true;    /* * Ensure that the sample variables are correctly initialised for each run. * TODO is this the best way to do this? should it be done elsewhere ? */ SampleEvent.initSampleVariables(); JMeterContextService.startTest();  SampleEvent.initSampleVariables() -> is for initializing the UDV. JMeterContextService.startTest() -> After this point only all other config elements get initialized. So, We might not be able to fix the issue you are reporting. As you already know, you can directly use the property in your testplan instead of assigning the property to a UDV. • Hi, I am unable to retrieve the value from the Properties file. I have a properties file called Testdata.properties in that i have #url url=www.google.com in HTTP Request Defaults i gave${_P(url)} to retrieve the data from properties file
if i execute its giving error message
java.net.URISyntaxException: Illegal character in authority at index 8: https://${_P(url)}/ • 1 )how to give path of the properties file to execute in command line i have Testdata.properties in “c:\Jmter\Testdata.properties” it is working file when i give only filepath =”Testdata.properties” in GUI mode, but it will fail when i execute in the command line 2) How to give the file path dynamically in the command line?? • You need to pass the file path as a property to the test. jmeter -n -t test.jmx -Jmypropfile=”c:/path/to/file.properties” In the prop file reader, for the file path, use${__P(mypropfile)}

I tried the same its giving error in Command line
let me explain more details , i have both jmx and properties file in the same folder in C drive
C:\performace\Sampler.jmx and C:/performace/Testdata.properties
and in Properties file i have
durl=www.xyz.com
dport=8080
req=http
and finally i gave ${__P(mypropfile)} in prop file reader and${__P(dUrl)},${__P(dport)},${__P(req)} in Http request defaults
then i tried to execute in command line using below command
jmeter -n -t C:\performace\Sampler.jmx -Jmypropfile=”C:/performace/Testdata.properties” -Jdurl -Jport -Jreq
it is giving error
but if i hard code the path of the properties file mean to say if i give C:/performace/Testdata.properties in the prop file reader it will work

2) one more thing i saw -Jdurl always take value from the properties file only if i give
-Jdurl=”www.abc.com” in the command line it will not take . it will take http://www.xyz.com which is there in properties file

• Why do you pass these info (-Jdurl -Jport -Jreq) in the commandline?
See..you need to use either property file or pass the info using commandline arguments.
As you have all the url, port, req details in the property file, you do not need to pass the info.

Below statement will do to execute in your case.

jmeter -n -t C:\performace\Sampler.jmx -Jmypropfile=”C:/performace/Testdata.properties”

• No its failing in the command line, you can see my email id, could you email me so that i can send screen shot…
the same thing if i hard code the path in prop file it will work

2) how to give URL , portnumber dynamically
i am using like this “jmeter -n -t C:\performace\Sampler.jmx -Jmypropfile=”C:/performace/Testdata.properties” -Jdurl= “www.xyy.com” -Jport=”8089″ -Jreq=”https”” is this right ??

• I do not really understand the issue. When you have the url, port etc in the property file, why do you need to pass the information in the commandline?

Eventhough it is nothing wrong to pass the arguments, I am afraid it might not reflect if you have the same properties in the property file as it might overwrite.

Either this

jmeter -n -t C:\performace\Sampler.jmx -Jdurl=”www.xyy.com” -Jport=8089 -Jreq=https

or this

jmeter -n -t C:\performace\Sampler.jmx -Jmypropfile=”C:/performace/Testdata.properties”

Good luck!

• Hi Its not working for me, both are not working.
I want to pass URL,,Portnumber dynamically its not working

• There was a recent update in the wordpress blog which messed up many things – this is one of them :(. It has been fixed now.

• Hi ,

I want to insert the throughtput values,i tried using Property File but it is failing.

• Thanks for putting this plugin together and sharing it. I’m trying to get the best of all worlds. I was using UDV to define defaults and pull in CLI driven variable changes. Now that i’ve found this, most of the time I will be using the properties file, but it would still be great to be able to pass in quick changes via command line when need be. Any plans to support something like:
server=${__P(server_ip,localhost)} so i can pass in -Jserver_ip=10.0.3.10 • Thanks for creaeting this add-on. it’s exactly what i’m looking for. A couple questions: * have you thought about adding on ability to still use -J command line option to override the property file variable? * 2.13 does not show the variables in debug sampler from property file. any suggesetions? • By default, debug sampler shows only the variables. Please enable the properties to see that. Regarding the overriding the property file variable, It is bit difficult to implement as the property file reader reads the file only when the test starts whereas the command line options would have already set the property values before the test starts. But i will see how we can include this. I agree that it could be nice. • Please help me with this: I am unable to access the property values. propertyfile name: ThreadGroups.properties path in PFR – C:\Users\Jmeter\ThreadGroups.properties Contents of file #ThreadGroup usercount=1 rampup=1 Property value in thread group Number of Threads (Users) :${__P(usercount)}
Ramp up period (In seconds): ${__P(rampup)} Log : 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: Running the test! 2016/05/27 14:37:51 INFO – jmeter.samplers.SampleEvent: List of sample_variables: [] 2016/05/27 14:37:51 INFO – com.tag.jmeter.ext.config.PropertyReader: Property file reader – loading the properties from C:\Users\Jmeter\ThreadGroups.properties 2016/05/27 14:37:51 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : A 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: Starting 0 threads for group A 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: Thread will continue on error 2016/05/27 14:37:51 INFO – jmeter.threads.ThreadGroup: Starting thread group number 1 threads 0 ramp-up 0 perThread NaN delayedStart=false 2016/05/27 14:37:51 INFO – jmeter.threads.ThreadGroup: Started thread group number 1 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: All thread groups have been started 2016/05/27 14:37:51 INFO – jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 2016/05/27 14:37:51 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) • Hi, I am able to successfully use this plugin, i am using a mac machine, the plugin is picking up the file if i am giving the absolute path “/Users/z001wp5/Desktop/JScripts-2016/Adaptive SearchMOD – 2016/user.properties” , But its not working when i am giving the relative path. My main jmx is in and the user.properties are in the “/Adaptive SearchMOD – 2016” . The csv config element works fine if i give just like “file.csv” or relative path from the working directory. Is there any way we can make the same work in this plugin also • You still face the issue? Relative path should work. Confirm. I will also take a look. • Hi, I am able to successfully use this plugin, the only issue i figured out is to enter the absolute path of the properties file. It is not taking the .properties file when the file and jmx is in same directory or the .properties file in child directory. Could you please add that feature also into the element. The CSV Data Set config element works in all the way , you can give absolute path , relative path or if the file is in working directory you can mention the filename alone. It will be very helpful if you can do that , is this in GIT repo , i mean the code. Thanks and Great Work!!! • “File path” takes only absolute path value. File name works if the property file is placed in the same path as the jmeter bin. Is there any possible solution to load the property file from the same location as the Test.jmx file or from the repo? • Deepa, Yes, It used to work with only absolute path. I have uploaded the updated version. It will now work with both absolute / relative path. Please download and try. • I too wanted to do the same for all the utilities i have in github. Too many things going on – could not find time to do that. Will do that. • I used this plug in. Installed and add in test plan. I gave path as C:\my.properties. While executing getting error ERROR – com.tag.jmeter.ext.config.PropertyReader: C:\my.properties (The system cannot find the file specified) • Please check the path and file name once again. That would be first testcase to check if it reads the file properly. Check the log – does it give any proper message like this? com.tag.jmeter.ext.config.PropertyReader: Property file reader – loading the properties from C:\my.properties • You can use any number of property file reader in the same test plan. 1 element is to read 1 property file. These properties are all like JMeter.properties – will be globally accessible by all the thread groups of the test plan. Not specific to a ThreadGroup. If you need something to specific to a thread group, then you would need to use JMeter Variables. https://jmeter-plugins.org/wiki/VariablesFromCSV/ • Yes，as you spoke，the property file “will be globally accessible by all the thread groups of the test plan. Not specific to a ThreadGroup.” But I want just that it just be used in “current thread group”， so is it easy to add a function of “sharing mode ”? Like the image : http://i.stack.imgur.com/UZoV5.jpg • I understand your question. But properties, in general, are not specific to a thread group / function / module. If you would like to do something specific to a thread group, do not use properties. use variables and share it with all the threads. • Thanks you. The property file reader is part of my JMETER framework and templates. Beautiful work. Cheers, Stijn • Hi i am trying to use this plugin. but it’s not working for me. I am using the file reader path as C:\PartnerService\testData.properties. and it contains Target=***.***.59.38 Users=2 Duration=300 Ramp=1 When i am trying to read the properties like${__P(Users)} , the test stops immediately. Please help me out here.

• Hi,
I have senarios where i run a test for 24 hrs with random no of threads and randomly generated durations between a certain range for both.

can it be done through the properties file.

• You can use ultimate thread group to define variables for load & time. Then you use Property file reader to update the values

• Hi
Have just tried to read the value from the property file as you mentioned in the post. But, the values are not read from the file. Have just created a property file and debug sampler to verify the values. In the log too, couldn’t see any errors. Attached the log for reference.

• I have been using this for 2 years without any issues. Do you have some properties in the file? Can you try to print the property value in the log and see if it works? Enable ‘JMeter Properties’ in Debug Sampler to see them

• Looks like NO WORKY on Macbook Pro 🙁

The file exists, yo! Yet attempt to load fails ~ perhaps not coded for platform independence for the Mac OS X Yosemite Version 10.10.5 (14F1021) operating system???

SymMacToolkit-C02Q5SKUG8WP:2.13 orbit_websig$ls -la /Users/orbit_websig/git_src/nop-services/nop-core-service/jMeter/cpsTestPlan.properties -rw-r–r– 1 orbit_websig SYMC\Domain Users 157 Feb 1 16:12 /Users/orbit_websig/git_src/nop-services/nop-core-service/jMeter/cpsTestPlan.properties SymMacToolkit-C02Q5SKUG8WP:2.13 orbit_websig$
• Hi Vins, I am trying to read from the property file into a String. “String destinationStr = ${__P(destination)};” Here is what I have in my OCR.properties: destination=C:\\Users\\irina \\parasoft\\workspace\\FSTOR_OCR\\Datasources\\Base64enc original=C:\\Users\\irina\\parasoft\\workspace\\FSTOR_OCR\\Datasources\\Original Can you please help? Thanks! • Irina, In beanshell, I would advise not to use${..} format as it might lead to this kinda exceptions due to missing quotes.


text:
zbMATH — the first resource for mathematics

Gordon, Cameron McA.

Compute Distance To:
 Author ID: gordon.cameron-mca Published as: Gordon, C. M.; Gordon, C. McA.; Gordon, C. Mca.; Gordon, Cameron; Gordon, Cameron M.; Gordon, Cameron McA. External Links: MGP · Wikidata · GND
 Documents Indexed: 100 Publications since 1970, including 7 Books
all top 5

Co-Authors

 37 single-authored 16 Luecke, John 6 Boyer, Steven 5 Kauffman, Louis Hirsch 5 Litherland, Richard A. 5 Wu, Yingqing 5 Zhang, Xingru 3 Baker, Kenneth L. 3 Birman, Joan S. 3 Casson, Andrew J. 3 Culler, Marc 3 Jin, Gyo Taek 3 Kawauchi, Akio 3 Ko, Ki Hyoung 3 Levine, Jerome P. 3 Lidman, Tye 3 Matsumoto, Yukio 3 Oliver, Bob 3 Shalen, Peter B. 2 Conway, John Horton 2 Heil, Wolfgang H. 2 Jones, Vaughan Frederick Randal 2 Lambropoulou, Sofia S. F. 2 Lück, Wolfgang 2 Moriah, Yoav 2 Przytycki, Józef H. 2 Reid, Alan W. 1 Adams, Colin C. 1 Boileau, Michel Charles 1 Calegari, Danny 1 González Acuña, Francisco Javier 1 Kirby, Robion Cromwell 1 Koda, Yuya 1 Long, Darren D. 1 Millett, Kenneth C. 1 Montesinos-Amilibia, José María 1 Murasugi, Kunio 1 Ozawa, Makoto 1 Ricca, Renzo L. 1 Rieck, Yo’av 1 Rodriguez-Villegas, Fernando 1 Sazdanović, Radmila 1 Schick, Thomas 1 Simon, Julie D. 1 Sumners, De Witt L. 1 Wajnryb, Bronislaw 1 Watson, Liam 1 Wilton, Henry
all top 5

Serials

 6 Proceedings of the American Mathematical Society 6 Transactions of the American Mathematical Society 6 Journal of Knot Theory and its Ramifications 4 Mathematical Proceedings of the Cambridge Philosophical Society 4 Mathematische Annalen 4 Topology 4 Topology and its Applications 3 Commentarii Mathematici Helvetici 3 Communications in Analysis and Geometry 3 Algebraic & Geometric Topology 3 Oberwolfach Reports 2 Acta Mathematica Vietnamica 2 Inventiones Mathematicae 2 Journal of the London Mathematical Society. Second Series 2 Proceedings of the London Mathematical Society. Third Series 2 The Quarterly Journal of Mathematics. Oxford Second Series 2 Bulletin of the American Mathematical Society. New Series 2 Annals of Mathematics. Second Series 2 Proceedings of the Cambridge Philosophical Society 2 Contemporary Mathematics 2 Geometry and Topology Monographs 1 Advances in Mathematics 1 Bulletin of the London Mathematical Society 1 Canadian Journal of Mathematics 1 Journal of Algebra 1 Journal of Differential Geometry 1 Journal of Graph Theory 1 Journal of Pure and Applied Algebra 1 Memoirs of the American Mathematical Society 1 Pacific Journal of Mathematics 1 Journal of the American Mathematical Society 1 L’Enseignement Mathématique. 2e Série 1 Journal of the Australian Mathematical Society. Series A 1 Boletín de la Sociedad Matemática Mexicana. Third Series 1 Bulletin of the American Mathematical Society 1 Series on Knots and Everything 1 Journal of Topology 1 Science China. Mathematics 1 Springer Proceedings in Mathematics & Statistics
all top 5

Fields

 97 Manifolds and cell complexes (57-XX) 13 General mathematics (00-XX) 7 Group theory and generalizations (20-XX) 6 Algebraic topology (55-XX) 3 Order, lattices, ordered algebraic structures (06-XX) 2 Combinatorics (05-XX) 1 History and biography (01-XX) 1 $K$-theory (19-XX)


text:
# If I find the GDP deflator (i.e., price level) for a given time series, can I then find real consumption given nominal consumption?

I've found the gdp deflator for a country over a 25 year span. If I have nominal consumption for the same time series, then I just have to divide nominal consumption by the p-level I found with the deflator right?


text:
Divide and Conquer majority element algorithm

The algorithm should return the majority element if it exists (majority meaning that there are $> n/2$ occurrences in the array)

I came up with this linear divide and conquer algorithm, but I'm not sure if it's correct. It returns an array with two elements, the name of the majority element and a number that is less than or equals to its occurrences. Can someone help to prove/disprove it?

def findMajority(arr):
if len(arr) == 1:
return [arr[0], 1]
else:
leftHalf = findMajority(arr[:len(arr)/2])
rightHalf = findMajority(arr[len(arr)/2:])

if leftHalf[0] is None and rightHalf[0] is not None: #Left half is indeterminate
return [rightHalf[0], rightHalf[1]]

if leftHalf[0] is not None and rightHalf[0] is None: #Right half is indeterminate
return [leftHalf[0], leftHalf[1]]

if leftHalf[0] is None and rightHalf[0] is None: #Both halves are indeterminate
return [None, 0]

if leftHalf[0] == rightHalf[0]: #Majority in both halves is the same
return [leftHalf[0], leftHalf[1] + rightHalf[1]]

elif leftHalf[1] < rightHalf[1]: #Right majority has more occurrences
return [rightHalf[0], rightHalf[1]]

elif leftHalf[1] > rightHalf[1]: #Left majority has more occurrences
return [leftHalf[0], leftHalf[1]]

else: #There is no winner between the two halves and they have equal occurrences
return [None, 0]

EDIT: It returns the wrong answer for [2,2,2,2,1,1,1,0,1,1,1,0,1,1,1,0] . So it doesn't work.

• @xavierm02 But in this case there is no majority, there needs to be more than $n/2$ occurrences – Jack Black Mar 3 '17 at 17:40
• @xavierm02 There is still no majority, there needs to be an element with 5 or more occurrences – Jack Black Mar 3 '17 at 17:44
• How about $[0;1;1;1]$? – xavierm02 Mar 3 '17 at 17:46
• @xavierm02 It works in this case. – Jack Black Mar 3 '17 at 17:48
• If you're looking for a linear time algorithm, try this en.wikipedia.org/wiki/… – skankhunt42 Mar 3 '17 at 17:59

It's not correct. On input [a a b c], the left side yields [a, 2], the right side yields [nil, 1]. They would be merged into [a, 2].
I'll outline a linear time solution. If there exists a value $x$ such that more than $n/2$ of the elements of $A$ have value $x$, then certainly the $n/2$-th order statistic of $A$ must be $x$. The selection problem is solved in linear time using, for example, median of medians; checking that such value does indeed appear at least $n/2$ times is trivially linear time.


text:
# qiskit.circuit.ControlledGate.to_matrix¶

ControlledGate.to_matrix()

Return a Numpy.array for the gate unitary matrix.

Renvoie

if the Gate subclass has a matrix definition.

Type renvoyé

np.ndarray

Lève

CircuitError – If a Gate subclass does not implement this method an exception will be raised when this base class method is called.


text:
# Wydawnictwa / Czasopisma IMPAN / Studia Mathematica / Wszystkie zeszyty

## Non-regularity for Banach function algebras

### Tom 141 / 2000

Studia Mathematica 141 (2000), 53-68 DOI: 10.4064/sm-141-1-53-68

#### Streszczenie

Let A be a unital Banach function algebra with character space $Φ_{A}$. For $x ∈ Φ_{A}$, let $M_{x}$ and $J_{x}$ be the ideals of functions vanishing at x and in a neighbourhood of x, respectively. It is shown that the hull of $J_{x}$ is connected, and that if x does not belong to the Shilov boundary of A then the set ${y ∈ Φ_{A}: M_{x} ⊇ J_{y}}$ has an infinite connected subset. Various related results are given.

• J. Feinstein
• D. Somerset

## Przeszukaj wydawnictwa IMPAN

Zbyt krótkie zapytanie. Wpisz co najmniej 4 znaki.

Odśwież obrazek


text:
## countrygirl1431 one year ago Solve the following equation. Then place the correct mixed number in the box provided.

1. countrygirl1431

5x/7=22

2. phi

if this is $\frac{5x}{7}= 22$ multiply both sides by $$\frac{7}{5}$$


text:
# Left/right inverses in non-commutative ring

Let the setting be a non-commutative unital ring $A$ and $a,b \in A$. Assume $a$ is invertible, meaning it has either a left inverse, a right inverse or both.

Does it then hold that $ab$ is invertible if and only if $b$ is?

I believe not: If $a$ has a right inverse $aa^{-1} = 1$ and $b$ has a left inverse: $b^{-1}b=1$ then I can't see how to invert $ab$. Am I missing something?

• The statement is correct if invertible is interpreted as 'having a right- and a leftinverse'. If it is interpreted differently (I think you better do not) then I don't think so. – drhab Feb 15 '14 at 10:10
• @drhab But if the setting is not commutative one cannot assume an invertible element has both left and right inverse. Or am I missing something here? – newb Feb 15 '14 at 10:28
• Are you assuming that every element of $A$ has either a left or a right inverse, but some may have left, others right? Or as the question seems, are you only asking whether assuming $ab$ has a one-sided inverse (left or right) then also $b$ has a one sided inverse (also left or right)? – coffeemath Feb 15 '14 at 10:47
• Normally this is practicized as definition: an element in a ring (commutative or not) is invertible if it has a right- and a leftinverse. If that is the case then it can be shown that these inverses are the same. Have a look at: en.wikipedia.org/wiki/Unit_(ring_theory) – drhab Feb 15 '14 at 10:48
• @drhab The question of post maybe better worded: is it true that $ab$ has a left or right inverse iff $b$ has a left or right inverse? [The OP newb should clear this up, in my opinion.] – coffeemath Feb 15 '14 at 11:02

Any standard example of elements such that $ba=1$ and $ab\neq 0,1$ is a counterexample for you.
The first says that $a,b$ are both one-sided invertible. Then you can deduce that $(ab)^2=ab$, so $ab$ is a nonzero idempotent. A nontrivial idempotent in a ring with identity (meaning one other than $0,1$) is never left or right invertible because it is both a left and right zero divisor: $(1-ab)ab=ab(1-ab)=0$.
Examples of such rings with $a$ and $b$ like that are scattered throughout the site, but a little hard to search for. I found one here at this related question, although you don't really need to say "bounded linear operators on $\ell^2$," you can just say "linear transformations from $V\to V$ where $V$ is a vector space with countably infinite dimension." For a fixed basis, the "right shift" $a$ and the "left shift" $b$ on the basis elements create linear transformations such that $ba=1$ and $ab\neq 0,1$.
• In the first line, did you mean $ab = 1$? – newb Feb 24 '14 at 14:32
• And $ba \neq 0,1$? – newb Feb 24 '14 at 14:33
• Dear @newb : No, I didn't intend that, because I'm giving an example where $ab$ is not invertible as a counterexample to the posted claim. However, thanks to your comment I can see that the $ba$'s in the second paragraph ought to be $ab$'s... thanks for spotting this typo. I usually type this example so that $ab=1$ and I managed to mix that with this. – rschwieb Feb 24 '14 at 14:54