Captcha with $, #, £, €, &, % characters? - captcha

Is it a good idea to have a captcha with $, #, £, €, &, % characters in it? (the users will be university students ("freshman"?).

No, See for example the Apple US keyboard How do you enter £ and € ?

What would be the point? Aren't regular captchas good enough?
Also, remember that different users may have different keyboard layouts. What if I don't have € on my keyboard, for example?

Related

regex decimal with negative

with the help of this thread I have tweak a regex for my use.
Decimal number regular expression, where digit after decimal is optional
So far I have this /^-?[1-9]$|^,\d+$|^0,\d$|^[1-9]\d*,\d*$
It works for
-12
0
1
It does not work for
-1,
-1,1
what I want is:
-1,1
may a kind soul explain what I am missing or doing wrong with this regex pls? Thank you very much!
I am tweaking it with : https://regexr.com/6sjkh but it's been 2 hours and I still don't know what I am missing. I don't know if language is important but I am in visual basic.
The thread you are quoting in your question has already some good answers. However if you do not need to also capture + and do not care about numbers without the leading zero before the comma and no thousand separator I would recommend the following:
/^-?\d+(,\d+)?/
The ^ indicates the beginning so that no other text in front is allowed
The -? is allowing a negative sign ( you need to escape this with \ as - can be a special character
\d+ expects 1 or more digits
The last part in parentheses covers the fractional part which as a whole can occure 0 or one time due to the question mark at the end
, is the decimal separator (if you want to have dots you need to put her ., as a dot is the special character for any character and also needs to be escaped if you look for a real dot)
\d+ is again one or more digits after the comma
I hope this helps a bit. Besides this I can also recommend using an online regular expression tool like https://regex101.com/

Substring in Postgresql

I have a quick question.
I'm studying some SQL exercises, and one of them, I need to remove the number from a street name.
For example:
5026 S CRENSHAW BLVD - Should be CRENSHAW
2635 WHITTIER BLVD - Should be WHITTIER
308 WESTWOOD PLZ # 1390L - Should Be WESTWOOD
1111 WILSHIRE BLVD - Should be WILSHIRE
Then, the answer to treat the address above was like this:
substring(facility_address FROM '[\d]+\s?\w?\s([\w]+)\s?')
I would like to understand how the substring works, what does it means de [\D] etc.
Could someone explain?
Thank you very much indeed! :)
You should read up on regular expressions.
'[\d]+\s?\w?\s([\w]+)\s?' is a regular expression.
I'll try to break it down:
First of all, these are quantifiers:
+ means one or more
? means one or none
And now for the regular expression:
[\d]+ matches one or more digits. I think the square brackets are actually not necessary here.
\s? optionally matches a whitespace character (optionally meaning it may or may not be there)
\w? optionally matches a word character
\s matches a whitespace character, but this time it's not optional since there is no ? at the end
([\w]+) matches one or more word characters. Notice the parenthesis which denote a so called 'capture group`. Everything within the parenthesis is actually returned by the substring function.

Which Unicode characters are "composing" characters (whose sole purpose is to add accent, tilda)?

This is related to
What are the characters that count as the same character under collation of UTF8 Unicode? And what VB.net function can be used to merge them?
This is how I plan to do this:
Use http://msdn.microsoft.com/en-us/library/dd374126%28v=vs.85%29.aspx to turn the string into
KD form.
Basically it'll turn most variation such as superscript into the normal number. Also it decompose tilda and accent into 2 characters.
Next step would be to remove all characters whose sole purpose is tildaing or accenting character.
How do I know which characters are like that? Which characters are just "composing characters"
How do I find such characters? After I find those, how do I get rid of it? Should I scan character by character and remove all such "combining characters?"
For example:
Character from 300 to 362 can be gotten rid off.
Then what?
Combining characters are listed in UnicodeData.txt as having a nonzero Canonical_Combining_Class, and a General_Category of Mn (Mark, nonspacing).
For each character in the string, call GetUnicodeCategory and check the UnicodeCategory for NonSpacingMark, SpacingCombiningMark or EnclosingMark.
You may be able to do it more efficiently using regex, eg Regex.Replace(str, "\p{M}", "").

XCode - Display Vietnamese : Unicode problem

I need to display Vietnamese in my APP. But now, i cannot show the words in correct format. For example, the word "&#code" i cannot convert it to Vietnamese, it just display "&#code;".
Does anyone can help me how to handle the word in unicode ?
Thanks a lot!
Tisa
Just write the unicode string inside #"..." without quoting. Strictly speaking, that's non-portable, but as long as you use it for just for Objective-C, it should be OK. It should work on a modern XCode toolchain.
In general, you need to understand that &#... is a way to quote unicode character in HTML, not in a C-string. In C, if you want to be most portable, you need to use \x escapes. Some newer compilers accept \u... and \U... for unicodes.

Delimiting User Input

What is the best character to use to delimit user input?
For example if a user has an infinite number of textboxes to type things into, but each textbox's value will be concatenated into a single database field, what is the safest character to delimit each input?
I think it should be a character not on your typical keyboard. Is there a character out there just for this?
You could use one of the ASCII control characters. There's one called "Record Separator" which has a hex value of 0x1E that might fit your needs.
Edit: Incidentally, if you want to do a proper job, you should probably ensure that \x1E is escaped in user input. One way to do this would be to use another ASCII control character: \x1B which is the "escape" control code. Thus, "\x1E" in input becomes "\x1B\x1E" and "\x1B" becomes "\x1B\x1B".
Keep in mind, of course, that because these are non-printing control codes, they can't be displayed. If you want a printable representation, you might want to go with a normal character like the comma and just escape it from input.
I guess one approach is to use a comma, and then to escape commas within the user input. It's probably not safe to assume any character (or even a sequence of characters) can't appear in user input -- if you can enter it in your code, then there's a way the user can enter it into a text box!
Normally commas or semi-colons are used for splitting data. What about | which the average user never uses?
How about a combination of keys? e.g.
|::|
so
this|::|and|::|that. Plus Those:Here and there.|::|Even this|that works
Any markup language will do for this. They're a little verbose but at least they'll be future proofing your field.
use ♥
ftw