Input mask on initials (microsoft access) - validation

Im trying to work out how to put an input mask on initials which will allow for initials that are two/three letters on.
I have tried entering >L?L< but this only allows three letter initials to be entered and not two letter initials.
Is there another symbol I should be using other than '?' that means that the user does not have to enter a character in that place?

I would suggest >LL?
> forces everything to uppercase
L is a required character
? is an optional character

Related

How to encode a TAB character in a Code128 barcode using only raw ZPL

In the past, we've used ZPL to create Code39 barcodes with a TAB character encoded in the middle using something similar to the following:
*USERNAME$IPASSWORD*
The $I in the middle gets translated to a TAB by the barcode scanners we use.
Now we have a need to do the same thing, but using Code128. With Code39, all the text needs to be uppercase (unless you're using Code39Extended, which supports lowercase letters). Because some of the data that is going to be encoded will be lowercase, we need to use Code128 B for most of the barcode, switching to Code128 A in the middle to encode the TAB character, then back to Code128 B for the final part.
Looking through the "ZPL II Programming Guide", it should be as easy as:
>:username>7{TAB}>6PA55w0rd
The >: at the beginning sets the subset to B, the >7 changes the subset to A, and the >6 changes the subset back to B. The problem I'm having (and haven't found a solution after almost a week of searching) is: How do I encode a TAB character using only text?
Use the ^FH (field hexidecimal encoding) command immediately prior to your field data. Based on your example:
^FH_^FD>:username>7_09>6PA55w0rd^FS
Where the underscore '_' is used as the escape character and 09 is the hex value for tab.
Also note that if the chosen escape character appears in the user name or password, you will need to escape it as well.
I tried what Mark Warren suggested, but unfortunately, it didn't work. It did, however, get me looking back through the ZPL II Programming Guide and I found the following, which I had overlooked before:
Code 128, Subsets A and C are programmed in pairs of digits, 00 to 99, in the field data string.
...
In Subset A, each pair of digits results in a single character being encoded in the bar code...
So, since 73 equates to a TAB in Subset A, I tried the following:
>:username>773>6PA55w0rd
And it worked!

How can I use all the characters of a string?

I make a string and I ask the user to insert a name. I need three of the letters they wrote
print "what is your name: "
a = gets.chomp
I want to use the first three letters. In this case is for adding other characters and create a different word. How can I separate the string? Can I do the same thing with numbers, with variables that use numbers instead of characters?
This should do the trick:
a[0..2]
numbers that are entered manually are considered string so there should be no problem neither.

Regular Expression in Ruby on Rails

I need create a regular expression for validate the first and second name of a person. The second name is optional because there are people without second name. The space character can be between the two names, but it can not be the end of string
example
"Juan Perez" is valid
"Juan Perez " is invalid because there is a space character the end of the string
You could use the below regex which uses an optional group.
^[A-Za-z]+(?:\s[A-Za-z]+)?$
(?:\s[A-Za-z]+)? optional group will do a match if there is a space followed by one or more alphabets. It won't match the string if there is only a single space exists. And also it asserts that there must be an alphabet present at the last.
DEMO
Update:
If the user name contains not only the firstname but also middlename,lastname ... then you could use the below regex. * repeats the previous token zero or more times where ? after a token (not of * or +) will turn the previous token as an optional one.
^[A-Za-z]+(?:\s[A-Za-z]+)*$
How about a way that doesn't require repeating the char class:
^\b(\s?[[:alpha:]]+)+$

Error with utf8 encoding

When I get data from some website, sometime the data is encode in utf8 but look like this:
Thỏ , Nạt
The accent mark is seperated from character when in fact these string must be:
Thỏ, Nạt
I don't know what is the problem here and how to correct it. Can someone help me with this
The first sample string contains two Vietnamese characters in decomposed form. The first one of them is “ỏ”, consisting of simple letter “o” followed by U+0309 COMBINING HOOK ABOVE.
The second sample string has those characters in precomposed form. The first one of them is “ỏ” U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE.
The decomposed and precomposed form are defined to be “canonical equivalent” and are normally expected to result in the same rendering (though this does not always happen). They are not identical, however; in programmatic comparison of characters and strings, they are very much different.
Mostly Latin letters with diacritics, such as “é” and “ä”, are used in precomposed form only, since that’s what keyboard drivers, online keyboards, character picking utilities, etc., normally produce. However, Vietnamese keyboard drivers often work so that some diacritic marks are entered after entering a base character, and the diacritic is thus produced as a combining character, i.e. the letter (like “ỏ”) is then in decomposed form.
One way of dealing with this issue, recommended in many contexts, is to convert your strings to Normalization Form C (NFC). This would put these characters into precomposed form. Note, however, that conversion to NFC removes some other distinctions, too (but this is not relevant if the text is in Vietnamese only and does not contain special symbols).
It remains a mystery why the first sample string has a space character before the comma.

Credit Card validation: can Card Name contain non-ASCII characters?

Can the Card Name (i.e. the cardholder name, not the card type) contain non-ASCII characters?
Example: "JOSÉ GONZÁLEZ".
The character set that is used does not allow for diacritics. In brief, it only allows uppercase ASCII characters.
The restriction ultimately comes from the historical way in which banking cards encode data onto the magnetic stripe (as defined in ISO 7811). The data is encoded in a 7 bits per character format known as ITU-T.50
The cardholder name is encoded with up to 26 characters, each within the range from hex 20-5F. You can see the table for this here: http://www.zytrax.com/tech/ia5.html
Magnetic stripe can store even punctuation symbols like ! " * # % & ( ) ^ : ; < > = ? [ / ] _
But in practice cardholders names uses only:
Range of English uppercase letters
Apostrophe (') for names like "Gareth O'Hare"
Minus (-) for double names like "Alexandru-Cristian"
Dot (.) for honorific prefixes like "MR.", "MRS.", "MISS.", "MS.", "DR.", "THE."
Dot (.) for initials like "Jimmy L. Morgan", "J.P. Teron"
Indeed, only ASCII characters are allowed. But other manipulation is allowed. One can print the name on the first or the second line. One can choose with or without dots and so on.
So, you can't make the customer happy with diacrits (thinks Norwegian and German names). But you can the customer let choose between full firstname of only one character (e.g. JOSE GONZALES or J. GONZALES). It helps to make the customer happy.
Chip cards (aka smart Cards, EMV cards) contain and can return a plethora of different values including "Cardholder Name" (tag 5F20) and "Cardholder Name Extended" (tag 9F0B). EMV Co. says that both of these tags should follow ISO 7813 but I've already seen one card (an "NH Card" from Korea Air) in which tag 5F20 contained lowercase characters. Pandora's box has been opened!
The credit card processors I've used in the past only allowed ASCII in the cardholder name, but you should check with your credit card processor to see what their requirements/restrictions are.

Resources