Google calendar id max length - google-api

I would like to know, what is maximum length of Google calendar id?
If I generate some new calendar, so it have 52 chars. Is it ever 52 chars?
Thank you for answers.

You can find the answer in the official documentation:
https://developers.google.com/google-apps/calendar/v3/reference/events/insert
* the length of the ID must be between 5 and 1024 characters
* characters allowed in the ID are those used in base32hex encoding,
i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in
RFC2938
* the ID must be unique per calendar
Two last conditions are important too. I tried to create an event with 140-character length, but it failed always with the error "HttpError 400 ... Invalid resource id value." The error description is not very expainable, so the wrong length was my first thought too.
As I saw, IDs for events, which are created from Web-Interface have 26-character length. E.g. "h89br54f22543csaelbvd9bpg8".
Appeared, that I tried to put IDs with upper-case characters, which contradict another condition. I simply swiched my ID to lower case and it worked. My example is: "00000000a261a0d73f0bc4489e041b2cf89de14307003368d9e80b5c214287f8ce52b5f2ce9b000000e73a1500006036a1321a462f4a9efbc0d55b344c120000129689b50000".
The third condition snapped, when I tried to re-create the event after deletion it thought API. The event disappeared in Web-Interface, but it turned out, that calling delete() is not really deleting it, but is switching event['status'] to 'cancelled'. You can reuse the event using get() and then switching status e.g. back to 'confirmed'. BTW here I got the error "HttpError 409 ... The requested identifier already exists."

Related

create a URL shortener with Base 62?

I understood the process to shorten the URL with base 62 at How do I create a URL shortener?.
Steps given are
Think of an alphabet we want to use. In your case, that's [a-zA-Z0-9]. It contains 62 letters.
Take an auto-generated, unique numerical key (the auto-incremented id of a MySQL table for example).
For this example, I will use 12510 (125 with a base of 10).
Now you have to convert 12510 to X62 (base 62)
My question is why not just create unique numerical key and return it ? What is the advantage of concerting numerical key > Base 62 > then Finally some alphanumeric number ?
Is it because final alphanumeric number will be much smaller than unique numerical key ?
Yes. The idea is to make it short and usable in a URL. A number in base 62 will use fewer characters than the same number in base 10. Notice also that URL shorteners use short hosts, such as g.co.
I can see you understand that, yes, a number written in base 62 takes less characters than a number in base 10 just like a number in base 10 takes less characters than a number in base 2 (e.g. 0101 is 3 characters longer than just '5').
So, I'll answer specifically "Why".
Sometimes a link is shortened to be more visually pleasing. A company worried about their public perception likely doesn't want their links to look like an error code due to how long they are so they resort to shortening. That's why some url shortening services allow you to add your own "vanity url" which customizes the domain name, so that a link can be shortened and branded.
Other times a link is shortened to minimize character count when working with constraints, like Twitter. For example, at my company we shortened the links in our automated Twilio messages because SMS messages that contain more than 160 characters are technically 2 concatenated messages so it is more expensive to send.
And finally if the link is being shared through a medium that cannot be directly clicked on (e.g. verbally, on paper), making it shorter makes it much easier to type into an address bar manually. (Imagine trying to type the url to this SO question when someone is reading it to you.) I assume this is also at least partially why the base used for these links usually stop at around 62. If you start including other arbitrary characters to higher the base and consequentially make the link marginally shorter, it'll become harder to communicate, read and type. ("domain.name/5omeC0d3" vs "domian.name/🈲}♠ "

Odoo 8 "message_id" column in "mail_message" table

I was writing an external app in python that uses the message system in odoo.
So, I need to use, the mail_message, and the mail_notification tables.
I tried to put elements individually via INSERT into the table filling the necessary elements to make this work, and it works perfectly, the messages appear in the "inbox" of messages in Odoo and the notification appears correctly.
But checking the rest of the fields in this table, I see that message_id got a tag format (between <>) and a series of numbers (that I haven't found any correlation) followed by "-openerp-'res_id'-'model'-#'company'".
So, I don't know how to fill this field, my proofs determined that is not a necessary field, but in a serious implementation I don't know if left this field empty can cause some issues.
Anyone can explain me the reason of this field and how to fill it?
Thanks
You can check the code in tools/mail.py and do something similar
def generate_tracking_message_id(res_id):
"""Returns a string that can be used in the Message-ID RFC822 header field
Used to track the replies related to a given object thanks to the "In-Reply-To"
or "References" fields that Mail User Agents will set.
"""
try:
rnd = random.SystemRandom().random()
except NotImplementedError:
rnd = random.random()
rndstr = ("%.15f" % rnd)[2:]
return "<%.15f.%s-openerp-%s#%s>" % (time.time(), rndstr, res_id, socket.gethostname())

Parse email subject office 365 flows

I am trying to get some data parsed out of a subject line in Office 365 Flows. I have an email that has a consistent format:
Help Desk [Ticket #12345]
I want to get the number '12345' for use in later steps in the flow. So far, I've attempted to use the substring expression in a compose connector:
substring(triggerBody()?['Subject'], 20, 5)
But I get an error about the string being null.
Besides the index being incorrect (to retrieve '12345' from Help Desk [Ticket #12345] you need to use substring(value, 0, 5) as the index is 0-based), the expression looks correct. But you can take a step-by-step approach to see what is wrong.
To start, take a look at the flow run to see exactly what the trigger outputs are:
If you see the Subject field (as I do in my case), create a variable containing that value only to make sure that you don't have any typo:
If it works correctly, then you should see in the flow run the subject:
If everything is still good at that point, create a new variable with the substring that you want:
And again, check the value.
If you got to this point, then you should be able to retrieve the ticket id.

The text length cannot exceed the limit 50

I'm trying to import a Watson conversation app to a LUIS app, I have already converted the json to its equivalent in LUIS converting all Watson entities into Lists with synonyms, but when I try to import it to LUIS I get the following error:
The text length cannot exceed the limit 50
What's the cause of this and how can I fix it? It may be related to the limit of 50 explicit lists detailed here, if that's the case what exactly is a explicit list? I couldn't find any documentation related.
The entity name or the list normalized value or the list value synonym is more than 50 char.
As Dina mentioned above please check if the entity name or the list normalized value or the list value synonym is more than 50 characters. And you can try after fixing this. And regarding your second question: you can find more information about explicit list here. Hope this helps!!

Character length in single line edit filter PowerBuilder

My SQL code gives me over 10 000 rows, each containing client id, name, address and so forth. In my PowerBuilder 10.5 window I've set my DataWindow in which I'm retrieving my SQL code using id as retrieve argument. I have a Single line Edit (sle_id) in which the user can write an id and search by it. What I've figured out is that all of my clients have id's length of 8 characters and starting with either "46XXXXXXXX" or "7052XXXX". So to optimize my retrieve time I want to write a code in the clicked event of my "Start" button that is located in PowerBuilder window that would first check if the id starts with one of does two options: "46..." or "7052...". I assume I'd need to use length of the characters? For example, this is what I'd want...
IF sle_id.text STARTS with 46 or 7052 THEN retrieve
ELSE MessageBox ("INFO", "Your id must have begin with either 32 or 7052")
END IF;
Of course, I need something better then "Starts with". Much oblige for all the help!
there are some string functions in powerbuilder. I think you need this:
If( left(sle_id.text, 2) = "46" or left(sle_id.text, 4) = "7052" ) then
Best Regards
Gábor
I think you're trying to solve the wrong problem. Your database should have an index on client id. If the client id is unique use a unique index.

Resources