Why can't uniformCount equal to GL_ACTIVE_UNIFORMS - opengl-es

According to the documention for glGetActiveUniformsiv, GL_INVALID_VALUE is generated when
uniformCount is greater than or equal to the value of GL_ACTIVE_UNIFORMS for program.
Why can't uniformCount equal to GL_ACTIVE_UNIFORMS?

That looks like a mistake in the man page. Unfortunately, the man pages are not always a reliable source of information. The final word is always the spec. I haven't been able to find this error in the ES 3.0 spec. The only related error I could find is:
For GetActiveUniformsiv, uniformIndices speciļ¬es an array of uniformCount indices in this list. If index or any value in uniformIndices is greater than or equal to the value of ACTIVE_UNIFORMS, the error INVALID_VALUE is generated.
There is no limit on the uniformCount, as far as I can tell.
In the OpenGL 4.5 spec, glGetActiveUniformsiv() is described as equivalent to a loop where glGetProgramResourceiv() is called uniformCount times. glGetPogramResourceiv() documents a GL_INVALID_VALUE error for invalid indices. But there is nothing about a limitation for uniformCount.

Related

To have a distribution for integer

I have a parameter that says default value 120 in the main that is linked to the initial number of agents for a particular agent. Now if I wanted that parameter to provide random numbers between 115 to 125 I tried using some distribution but it didn't work.
The error shown in the screenshot refers to type mismatch. triangular() returns a double but the parameter is of type int. This particular error can be fixed by changing the code to (int)triangular(2,5).
Admittingly, it would be good to understand what the purpose of this is in order to provide a more useful method as this approach will generate a sample value between 2 and 5 only at model start.

MS Access 2013 DSum calculated field DSum returns #error

OK, I have searched for an answer in the usual places, and tried several fixes (i.e. quote syntax, field type) but have still not found a solution to this issue...
I have a calculated field in Access 2013 in a query as follows:
CumGPA: DSum([TermGPA],[Transcript_Info],"[Sequence]<=" &[Sequence])
Give a running sum of TermGPA for every row from the Transcript_Info table where Sequence is less than or equal to the current row's value
I get the unhelpful #Error returned.
TermGPA and Sequence are Fixed Decimal
Any ideas? I could be staring right at it, but I've been on a long programming binge and can't see straight right now.
CumGPA: DSum("TermGPA","Transcript_Info","Sequence<=" &[Sequence])

google search appliance accurate result count parameter not making a difference

We are having a result count issue where the pages have 10 results per page. For pagination we are getting 64 result count on page 1 (ie start=0), 25 for page 2, and 21 for page 3.
I understand as per documentation for estimated vs actual results that it is not guaranteed but the above result count is when I set filter=0 and rc=1. The rc=1 does not appear to make a difference when included or not. We are on version 7.2.0.G.252
filter=0&rc=1 should work for you and you should see the same count even after paginating.
What you need to notice is, when you click on pagination link, make sure the filter=0&rc=1 are carried over. i.e., after pagination, see if you still have the filter and rc parameters intact.
Also check using the default_frontend as your custom frontend may not be handling it?
The problem was related to the collection not the query. The content match pattern did not include a "/" at end which when resolved gave an accurate count. Thanks for the assistance.

Testing jsonpath that array contains specfic objects in any order

I'm testing a Spring controller which can give back a 400 with field errors. These field errors is an array of objects containing a "path" and "message" field.
Now I want to test that some specific call returns multiple errors with specific path and message.
I cannot come to anything closer then below:
.andExpect(jsonPath("$.fieldErrors[*].path", containsInAnyOrder("title", "description")))
.andExpect(jsonPath("$.fieldErrors[*].message", containsInAnyOrder(
"The maximum length of the description is 500 characters.",
"The maximum length of the title is 100 characters.")));
But this keeps the option open that bad combinations of "path" and "message" is accepted.
Any ideas how to improve the jsonpath to test this?
This seems to the better approach:
.andExpect(jsonPath('$.fieldErrors[?(#.path == \'title\' && #.message == \'The maximum length of the title is 100 characters.\')]').exists())
Just expanding on the answer provided by Marcel, as it helped me solve the same issue but I had to modify slightly. I found that the '&&' operator wasn't supported in the version of jsonpath we currently use in one project (0.8.1), according to this issue it was marked as 'done' on Dec 8th which implies it should be available in the latest version, 2.0:
JSON Path issue 27 - AND operators
The 'old' syntax for logical AND which I ended up using is also shown on that issue and using the example above would be:
.andExpect(jsonPath('$.fieldErrors[?(#.path == \'title\')][?(#.message == \'The maximum length of the title is 100 characters.\')]').exists())
You can use org.hamcrest.Matchers.containsInAnyOrder().
.andExpect(jsonPath("$.fieldErrors[*].path", Matchers.contains("str1", "str2")))

Can I get the information at which node or element or attribute the xpath failed while evaluating it against an xml

I have some xpath and I am evaluating against an XML.
//view/section/row
[(cell/data[#value='Other Roles']) and
(cell/data[contains(#value,'336')]) and
(cell/data[contains(#value,'0')]) and
(cell/data[contains(#value,'320')]) and
(cell/data[contains(#value,'16')]) and
(cell/data[contains(#value,'0')]) ]
While doing so, the xpath might not be available say row does not have the cell with data 336 , can I get that piece of information where it failed
Any code/utils that gives this information
In general, No.
Even if the result set is empty, it does not mean it fails. It is just an empty result set, which is a valid result. So as a matter of fact, your assumption is wrong, because the XPath did not fail.
If you want to check whether your XPath yiels an empty sequence, you can check using fn:empty(), e.g. empty(cell/data[contains(#value,'336')]).
Using XPath 2.0 you can also raise your own errors, using the fn:error() function. However, I do not see how you want to apply that in this specific example in a useful manner.
I've not seen any tools that automatically do this, but manually performing such sanity checks can be very useful:
First check that you're matching views:
//view
then sections:
//view/section
then rows:
//view/section/row
then specific rows:
//view/section/row[(cell/data[#value='Other Roles'])]
...until you get to a point where reality deviates from your expectations. You'll then know where an adjustment must be made.

Resources