An attribute in the provided entity has invalid value - flutter-ios-build

An attribute in the provided entity has invalid value
An App ID with Identifier 'com.smartsoftware.usprime' is not available. Please enter a different string.

Related

Invalid data updating form error when updating textvalidation of item

I use the following code to update textvalidation with a string:
function updateform(strtokens) {
var form = FormApp.openById(#formid#);
var textItem = form.getItemById(#formid#);
var textValidation = FormApp.createTextValidation()
.requireTextMatchesPattern(strtokens)
.build();
textItem.asTextItem().setValidation(textValidation);
return form.getPublishedUrl();
}
I get error saying invalid data updating form at line textItem.asTextItem().setValidation(textValidation)
I get this issue on occasion but not all the time and i can't figure out why.
Are any of the following issues possible explanation?
strtokens is of the format: text1|text2|text3|.. etc, it can be very long. text1, etc also include special characters. note strtokens is concatenates randomly generated text of length 10 and the # of text is currently set to 10.
The text is generated by randomly sampling 10 characters from A-Z, a-z, 0-9 & special characters. please see examples below where they cause and do not cause error.
Does the form id/item id change so that it doesn't identify accurately? I got form id from the url and I got item id from inspecting the id in the html of the form.
Answer:
The pattern parameter you pass into .requireTextMatchesPattern(pattern) is a Regular Expression and the * character is a RegEx quantifier. If incorrectly used the pattern will be invalid and throws an error.
More Information:
For Regular Expressions, the * character indicates:
Zero or more occurances of the previous element.
For example:
For the expression stacko*verflow the following strings will match:
stackverflow
stackoverflow
stackooverflow
stackoooverflow
stackoooverflow
And so on, provided the string starts with stack and ends with verflow.
In the examples you provided in the above comments, you have the following Regular Expressions:
1:
WvGMkRIQf>|X2ANqg<SGu|j$aN6on**L|v5$N#z7dW!|XU5#5Ml&8Q|Bz%EzuWLiE|a&Cv!IE3E4|-IK4>#ljA8|5ytvZeRJLd|dAOe2L6-g7|P>1UQ<iMYO|yoCZrb7Tom|cuIfBUN%js|FfIq2ASpF0|gZDf8abN1p|mHV>swDHwR|rDgknKK3CS|<$dbw0TfvO|K6xCL&zqk5
2:
hFI*ek0Ypa|>O3eLWaNyI|34UGs*BGWG|4xTlqI5$1v|6J5b4hxhQB|e!UGlGUe!d|RuQgm!07UR|JSe%zMrw84|kEffwcplYp|V#EOUi9xrK|mxxLLZ9rcJ|Z8-PgwizSH|j#lPl3nt3l|q$qzansAMi|<>FOR&yGl2|O0#hIat24N|7DVrI>Oz!5|BgmHjZpoC<|Q53a0cwxw<
3:
mOU-4p%ArY|o>&cL!JMeN
4:
*<R2&$fKfz|x&c&mmNdgT
You can test these for yourself using an online Regular Expression validator but I will explain this here.
In the first example, the culprit is the third string: j$aN6on**L. A double asterisk (**) is not a valid expression as the first asterisk would need to be escaped with a \ (j$aN6on\**L).
The second example does not throw an error as it validates correctly. The same can be said about the third example.
The fourth example also throws an error - this time however it is due to the string starting with the * character. As the * character indicates zero or more occurances of the previous element, but there is no character before the *.
You can check out the basic concepts of Regular Expressions to get a more detailed understanding.
References:
Wikipedia - Regular Expression
Regular Expression - Basic concepts

MS Access - Using a period in field name

is there any way, to use a period (.) in the field name of Access?
For example if I have foo.bar as string. Access will give me the following error message:
This is not a valid name. Make sure it is a valid parameter or alias name,
that it does not include invalid characters or punctuation, and that the name
is not too long. (Error 3125)
I tried escaping it in many ways, like:
[foo.bar]
*foo.bar*
'foo.bar'
foo[.]bar
foo*.*bar
foo'.'bar
foo\.bar
Nothing seems correct, nothing seems to work. I need to put a period in the field name, I can't replace it with some different character. Is there any way to fix my problem?
Short answer is No.
You will have to live with that limitation.
My field names were measurements in millimeters, so I needed field names like 1.1, 1.2, etc. I used 1,1 as the field name and 1.1 as the caption and it worked fine.

AES_DECRYPT How do you check value is already decrypted in mysql

I want to decrypt fields in my database using sql on mysql but before I decrypt I need to check if the fields can be decrypted.
update customer
set name = aes_decrypt(from_base64(name), 'key')
If the provided key is wrong or data is invalid the name field will be set to null;
I have tried adding a where clause like below to make sure the field name is not already decrypted but this doesn't work all the time as the aes_decrypt can return null or garbage if the key is incorrect or data is invalid.
update customer
set name = aes_decrypt(from_base64(name), 'key')
where aes_decrypt(from_base64(name), 'key') is not null.
So how can I check if the returned value is null or "garbage"? Or what other approach is there?
From mysql doc: "it is possible for AES_DECRYPT() to return a non-NULL value (possibly garbage) if the input data or the key is invalid."
garbage example I get: w���� ��Y�'v��Y�m��_
Thanks
Instead of storing raw ciphertext, follow the lead of version 2 of Defuse Security's PHP encryption library:
Use authenticated encryption.
Use a version tag which tells what library was used as well as what version and any optional configuration information you need to add.
Make sure to calculate HMAC(tag || IV || ciphertext) instead of just HMAC(ciphertext).
Store the tag, IV/nonce, ciphertext, and MAC together; preferably as a hex- or base64-encoded string.
Then the question becomes "Do the first N bytes of the string evaluate to a known version tag of my encryption library"?

Error "attribute parameter is not in hash ref" when using Perl DBI selectall_hashref

I'm trying to get my first select to work using selectall_hashref from the Perl DBI module. I've opened a connection to the database (MySQL) successfully. I'm getting an error when I execute the following:
$dbh->selectall_hashref('SELECT id FROM users WHERE login=?',undef,"myusername");
DBI::st=HASH(0x1505a60)->_prepare(...): attribute parameter 'myusername' is not a hash ref at /usr/lib/x86_64-linux-gnu/perl5/5.20/DBD/mysql.pm line 238.
My table should be able to support this query, it has an id column and login column for each user.
The examples I've found for selectall_hashref show the ? substitution parameter being passed as the third parameter. The DBI documentation says that the second and third arguments should be %attr and #bind_values but doesn't give much documentation about them or show working examples.
What is causing the error, and more importantly how do you actually use the %attr and #bind_values correctly?
If you want to store everything as an arrayref where each row is a hashref (which is what your comment seems to indicate), you can use the selectall_arrayref() method with the Slice attribute:
$dbh->selectall_arrayref('SELECT id FROM users WHERE login=?', {Slice => {}}, 'myusername');
It's a little weird, but here's how it works:
If $slice is a hash reference, fetchall_arrayref fetches each row as
a hash reference. If the $slice hash is empty then the keys in the
hashes have whatever name lettercase is returned by default. (See
"FetchHashKeyName" attribute.) If the $slice hash is not empty,
then it is used as a slice to select individual columns by name. The
values of the hash should be set to 1. The key names of the returned
hashes match the letter case of the names in the parameter hash,
regardless of the "FetchHashKeyName" attribute.
It's a good idea to set the FetchHashKeyName attribute on the database handle to make your hash key names consistent; I happen to like NAME_lc in my applications.
The methods expects key column as the second parameter and attributes ref is passed as third one. In the result it builds a hash with the specified column as a key. What you probably want, is selectall_arrayref:
$ dbh->selectall_arrayref('SELECT id FROM users WHERE login=?',undef,"myusername");

What is DC2Type array datatype in mysql

I have been working with Symfony2 and doctrine2 recently and have realized a peculiar datatype called DC2Type:array that certain Symfony2 Roles get saved as. To me it just looks like a serialized PHP array where a signifies the total number of elements, i is the array index.
The value looks like this:
a:15:{i:0;s:32:"ROLE_SONATA_USER_ADMIN_USER_EDIT";i:1;s:32:"ROLE_SONATA_USER_ADMIN_USER_LIST";i:2;s:34:"ROLE_SONATA_USER_ADMIN_USER_CREATE";i:3;s:32:"ROLE_SONATA_USER_ADMIN_USER_VIEW";i:4;s:34:"ROLE_SONATA_USER_ADMIN_USER_DELETE";i:5;s:36:"ROLE_SONATA_USER_ADMIN_USER_OPERATOR";i:6;s:34:"ROLE_SONATA_USER_ADMIN_USER_MASTER";i:7;s:33:"ROLE_SONATA_USER_ADMIN_GROUP_EDIT";i:8;s:33:"ROLE_SONATA_USER_ADMIN_GROUP_LIST";i:9;s:35:"ROLE_SONATA_USER_ADMIN_GROUP_CREATE";i:10;s:33:"ROLE_SONATA_USER_ADMIN_GROUP_VIEW";i:11;s:35:"ROLE_SONATA_USER_ADMIN_GROUP_DELETE";i:12;s:37:"ROLE_SONATA_USER_ADMIN_GROUP_OPERATOR";i:13;s:35:"ROLE_SONATA_USER_ADMIN_GROUP_MASTER";i:14;s:10:"ROLE_ADMIN";}
I want to know what this datatype is?
And what do the following identifier signifies:
s:
I have searched the internet but haven't got any useful data.
I also bumped upon this cookbook entry - http://readthedocs.org/docs/doctrine-orm/en/2.0.x/cookbook/mysql-enums.html but didn't figure out the origin.
This is not a data type. You might have noticed that the column type is LONGTEXT. DC2Type:array is a comment of the field.
Doctrine uses the field's comment as column's metadata storage place. Since Mysql does not allow you to store an array, Doctrine use DC2Type:array as comment in order to know how to unserialize the content.
Take a look at the link below.
https://github.com/doctrine/dbal/issues/1614
From the link you mentioned, you can see that the comment DC2Type:enumvisibility indicates that the content of the field is a flag, indicating that the record is visible or not. It is not a new data type at all. It should be considered an helper strategy in the database level. For Doctrine, it's a custom data type.
This is simply a string. Its format is a serialized PHP array. The s: refers to the size or length of each item value in the array.
e.g. s:32:"ROLE_SONATA_USER_ADMIN_USER_EDIT"
If you count the characters in the ROLE string, there are 32.
Hope this helps.