Gcm sender id is out of range - google-cloud-messaging

I am trying to create an xmpp gcm server.
The project number generated by gcm is greater than the range of long. what should i do?
Does using project id help?
But the project id is not integer.
Also the max value of long is 2^63 which is larger than the project number generated. still i am getting the error in eclipse
final long senderId = 908*********;
error that i get:-
The literal 908********* of type int is out of range

Appended L at the end of the integer project number and got it working.
For more detail see-
The literal of int xxxxx is out of range

Related

DBMS_SQL.LAST_ERROR_POSITION: error position for PostgreSQL database

What is the equivalent for DBMS_SQL.LAST_ERROR_POSITION in PostgreSQL to get the offset of an error?
You don't specify in what programming language you want to access this information, and not all APIs give you access to the location of the error, but it is sent with the PostgreSQL error message.
See the documentation for the C API:
PQresultErrorField
Returns an individual field of an error report.
char *PQresultErrorField(const PGresult *res, int fieldcode);
fieldcode is an error field identifier; see the symbols listed below. NULL is returned if the PGresult is not an error or warning result, or does not include the specified field. Field values will normally not include a trailing newline. The caller should not free the result directly. It will be freed when the associated PGresult handle is passed to PQclear.
The following field codes are available:
[...]
PG_DIAG_STATEMENT_POSITION
A string containing a decimal integer indicating an error cursor position as an index into the original statement string. The first character has index 1, and positions are measured in characters not bytes.
PG_DIAG_INTERNAL_POSITION
This is defined the same as the PG_DIAG_STATEMENT_POSITION field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The PG_DIAG_INTERNAL_QUERY field will always appear when this field appears.

SSRS Report builder LENGTH expression & size specific field

I'm trying to build a bank file using SSRS report builder (3.0). I'm running into two issues:
I'm trying to get a length expression to work on a check number field but LEN(Field) doesn't work (returns 4 as the value regardless of the actual length of the field).
And LENGTH(Field) gives me an error:
The Value expression for the textrun 'Textbox15.Paragraphs[0]. TextRuns[0\' contains an error: [BC30451] Name 'LENGTH' is not declared*
The only reason why I'm even trying to get #1 to work is because I need to have one of the fields on the bank file have a constant length. Regardless of the check number, I need to make sure this field is always at 14 characters with leading zeros. I thought the best way to do this is to do a switch statement and add the number of appropriate zeros in depending on the size of the check number field.
Thanks for the help.
Edit: using a SQL server DB
For the length issue:
There are two ways to get string length
Using the LEN function
= LEN(Fields!myfield.Value)
Using the length property
= Fields!myfield.Value.Length
If your field is not a string, try converting first by using the Cstr function
= LEN( Cstr(Fields!myfield.Value) )
= Cstr(Fields!myfield.Value).Length
For the formatting issue:
For numeric fields set the cell format expression to have as many zeros as required eg. for 14 digit numbers
= "00000000000000"
I don't know on which database you are working if you are using sql server then try LEN
function and LENGHT in oracle.
I think you first convert it into integer if it's character and then try len function.

invalid number: not a valid number string ':i_s' at function to_int()

I am trying to fetch data from a HANA view through a program in se38 based on SQL queries. I have declared a variable status date type c which will contain the value of today's date. Now, when I am trying to pass this variable it is giving the error as invalid number: not a valid number string ':i_s' at function to_int().
variable-> i_status_date(8) type c.
I am trying to pass this value with ('PLACEHOLDER' = ('$$STATUS_DATE_DM$$', ':i_status_date').
I have also checked in HANA view which is the only input parameter for this having data type NVARCHAR. Also tried changing the data type of variable as date and Integer but still facing the same issue.
Can anyone please help and guide how to overcome through this problem?

Jmeter -- how to combine variable name & counter()

I've got the following problem:
I do gather that ProductId variable is assigned with the first value and then only that value is used when I refer to ${productId}.
I was trying to apply ${__counter()} to reference name in RegexExtractor,
but then BeanShellAssertion fails to set the property.
How should I properly work this around?
You can use __V() function in order to combine 2 variables.
I.e. if you have 2 variables like:
productId
counter
And would like to evaluate i.e. ${productId_1}, ${productId_2}, etc.
It should be as simple as:
${__V(productId${counter})}
Same approach applies to __counter() function:
${__V(productId_${__counter(,)})}
Demo:
See How to Use JMeter Functions posts series for comprehensive information on above and other functions
ProdGroup
please store the product Id property as prod_id_1, prod_id_2,...prod_id_n or according to you convenience
How to to that ?
in post processor "Parameters" section use ${__counter(FALSE,)} and in the script part try getting that String counter = arg[0] and convert that to integer and store it to a script variable by default arg[0] value is String
int c= arg[0] as Integer //this is groovystyle check in your way to convert as int
now props.put("prod_id_"+c,"extractedfrom_response")
BID:
In you Bid group add a user defined variable section add the variable
"prod_id" and value is empty
Define a counter start with the same counter 1 and give counter reference name [if your counter value in prod group was 0 then here also it must start with zero]
script sampler convert all the props to the variables
Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
String propertyName = e.nextElement().toString();
if (propertyName.startsWith("prod_id_")) {
vars.put(propertyName, props.getProperty(propertyName));
}
}
With this you have converted properties to variables named prod_id_1 ...to ... prod_id_n
In http sampler user reference as ${__V(prod_id_${counterreference in step 2})} will do your job
For each thread the counter will increment by default
user ${__threadNum} or ${counter reference name} in sampler labels for debugging.
Hope this helps. Please let us know if still problem is there.

what are the components to formulate a unique identifier like GUID

I have recently heard about GUID which is a global unique identifier. However, i would like to formulate my own unique identifier with components such as random numbers, timestamp, ip adress and userID. I would like to have my end result to be in the format of 19 digits (long variable). What are the other components that i can add? I am currently using Visual Basic.
set obj = CreateObject("Scriptlet.TypeLib")
msgbox obj.GUID
If you want your own then create it.