How do you check if a username contains invalid characters?
I want to restrict each users username with PHP to having numbers, letters, and underscores.
I have a strange problem replacing chars in string...
I read a .txt file containing russian text, and starting from a list of letters russian to english (ru=en), I loop the list and I WOULD like to replace russian characters with english characters.
The problem is: I can see in the debug the right reading of the russian and the right reading of the english, but using myWord = myWord.Replace(ruChar, enChar), the string is not replaced.
My txt file is a UTF-8 encoding.
Hi,
I'm interested in the Presentation-Abstraction-Control? (aka Hierarchical-Model-View-Controller (HMVC)) Architectural Pattern for constructing complex user interfaces (GUI or web) and was wondering if anyone was aware of any examples in the wild where I could read the code?
My list so far;
Cairngorm framework for Adobe Flex
any others
I'm aware of the JavaWorld article and associated letters cited in the wikipedia article
http://en.wikipedia.org/wiki/Presentation-abstraction-control
How would you use regex to write a function that replaces all lowercase letters with uppercase and vice versa?
Note: this is NOT a homework question. See also my previous explorations of regex:
Regex split into overlapping strings (Alan Moore's answer is especially instructive)
Can you use zero-width matching regex in String split? (my solution exploits a known Java regex bug with regards to non-obvious length lookbehind!)
I use custom routes for my URLs and my action become accessible via two URLs (not counting trailing slash and lower\upper case letters): one via my custom route /my-custom-route-url/ and one via default /controller/action.
I see one possible solution -- put all controllers which use default routing (they are mostly backend) in one area, and place all others in separate area and use it without default route.
May be there is a better way?
I'm using Flash Builder 4 to build my AIR application.
For a certain reason, I need to declare my package name in camelcase, and class names in lowercase:
//test.as
package Core {
public class test {
}
}
The folder structure is like this (the dir 'Core' matches the package name):
src/
Core/
test.as
However, Flash Builder shows error and it doesn't compile at all, only when I put the package name as 'core' then it compiles.
Does AS3 syntax allow uppercase letters in package name? Or just because Flash Builder implicitly disallows this?
Is it possible to have a tex command which will take the whole next word (or the next letters up to but not including the next punctuation symbol) as an argument and not only the next letter or {} group?
I’d like to have a \caps command on certain acronyms but don’t want to type curly brackets over and over.
Can someone give me a regular expression that will verify if all the letters in the word "cat" were also in the word "coating" in the proper sequence? So for the word "coating", the RegEx will test true for "cat" but false for "act".
How can I build a function
slice(x, n=2)
which would return a list of vectors where each vector except maybe the last has size n, i.e.
slice(letters, 10)
would return
list(c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j"),
c("k", "l", "m", "n", "o", "p", "q", "r", "s", "t"),
c("u", "v", "w", "x", "y", "z"))
?
Hey,
How to create shortcut to menu in WinForms.
I think about something like in Visual Studio and Firefox, where I press Alt and mainly menu items shortcut letters have been underline.
How to do this??
/Users/smcho/Desktop/bracket/[10,20] directory has "abc.txt", but when I run this python code
import glob
import os.path
path1 = "/Users/smcho/Desktop/bracket/\[10,20\]"
pathName = os.path.join(path1, "*.txt")
print glob.glob(pathName)
It returns empty list.
Can't python's glob doesn't handle the bracket letters or others?
Is there any way to solve this problem?
As a mere example, I want to apply the class "fancy" to all occurrences of the sign "&" in the document.
The CSS:
.fancy { font-style: italic; }
So a text that looks like this:
Ben & Jerry's
would be manipulated by jquery to this:
Ben <span class="fancy">&</span> Jerry's
Is there a function to target specific words/phrases/letters like this?
I had printer on network and I tried to install it as driver on pc on network it installed but the letters with bad language note . that I installed win7 on pc
any one help me
I have a question about the pronunciation of the SQL word. In my native language (French) we used to say it like spell each letters.
I've been listening to the stackoverflow podcast today. And I noticed the usage of the word sequel to describe SQL.
My question is what is the common or correct pronunciation of SQL in english. Is it a matter of taste?
I need to convert series of images drawn as white on black background letters to images where white and black are inverted (as negative). How can I achieve this using PIL?
I am new to programming PHP and am trying to validate a field in a form.
The field if for a RAL color code and so would look something like : RAL 1001.
so the letters RAL and then 4 numbers.
Can someone help me set them into a regular expression to validate them.
i have tried this with no success:
$string_exp = "/^[RAL][0-9 .-]+$/i";
What can I say but sorry for being a complete NOOB at PHP.
Cheers
Ben
I want to find a way to programmatically fire the selector that causes the iPhone keyboard to switch from letters to numbers. I am aware that I can switch the keyboard type, but I want to know if there is a way to do this without switching the keyboard type.
Hi folks. On the comment of my old form needing a CAPTHA, I felt I share my problem, perhaps you recognize it and find its time we had better solutions:
FACTUAL PROBLEM
I know most of my clients (typical age= 40~60) hate CAPTCHA things.
Now, I myself always feel like a robot, when I have to sueeze my eyes and fill in the strange letters from the Capcha... Sometimes I fail! Go back etc. Turnoff.
I mean comon its 2011, shouldnt the forms have better A.I. by now?
MY NEW IDEA (please dont laugh)
Ive thought about it and this is my idea's to tell difference between human and robot:
My idea is to give credibility points. 100 points = human 0% = robot.
require real human mouse movements
require mousemovements that dont follow any mathematical pattern
require non-instantaneous reading delays, between load and first input in form
when typing in form, delays are measured between letters and words
approve as human when typical human behaviour measured (deleting, rephrasing etc)
dont allow instant pasting or all fields
give points for real keyboard pressures
retract points for credibility when hyperlinks in form
Test wether fake email field (invisible by human) is populated (suggested by Tomalak)
when more than 75% human cretibility, allow to be sent without captcha
when less than 25% human crecibility, force captcha puzzle to be sure
Could we write a A.I. PHP that replaces the human-annoying capthas, meanwhile stopping most spamservers filing in the data? Not only for the fun of it, but also actually to provide a 99% better alternative than CAPTHCA's.
Imagine the userfriendlyness of your forms!
Your site distinguishing itself from others, showing your audience your sites KNOWS the difference between a robot and a human. Imagine the advangage. I am trying to capture the essense of that distinguishing edge.
PROGRAMMING QUESTION:
1) Are such things possible to programm?
2) If so how would you start such programm?
3) Are there already very good working solutions available elsewhere?
4) If it isn't so hard, your are welcome to share your answer/solutions below.
5) upon completion of hints and new ideas, could this page be the start of a new AI captcha, OR should I forget about it and just go with the flow, forget about the whole AI dream, and use captcha like everyone else.
Is it possibe to skip a rule validating it using ruby code in treetop?
Say there is something like this:
rule short_words
[a-z]+ {
def method1
text_value
end
...
}
end
And I want the words size to be from 2 to 5 letters. Can I exit rule if I find that the length of text_value is not between 2 and 5?
def horizline(col):
for col in range (col):
print("*", end='')
print()
def vertline(rows, col):
for rows in range (rows-2):
print ("*", end='')
for col in range (col-2):
print(' ', end='')
print("*")
def functionA(width):
horizline(width)
vereline(width)
horizline(width)
vertline(width)
print()
#def funtionB(width):
#def functionC(width):
#def functionE(width):
def main():
width=int(input("Please enter a width for the letter: "))
lenght=int(input("Please enter a lenght for the letter: "))
letter=input("Enter one of the capital letters: A,B,C,E ")
if(width>=5 and width<=20):
functionA
functionB(width,length)
functionC(width,length)
functionE(width,length)
else:
print("You have entered an incorrect value")
main()
I have the following code:
printf("num: %d\n", strcasecmp(buf, "h\n"));
And I get the following results when I try plugging in different letters:
a: -7
g: -1
i: 1
j: 2
h: 156
H: 156
Should strcasecmp not return 0 when buf is equal to H or h? Any ideas why it's returning 156? I need to figure out how to check whether the user types H or h.
Thanks!
i need to disable the arrow keys in a flowplayer.org scrollable i have a text input that i cant move between the letters due to the scroller moving when arrow keys pressed, i dont care to disable the scroller keys permanently.
thanks
link to scrollable
link to forum to disable keys
I have to filter user input to on my web ASP.NET page:
<asp:TextBox runat="server" ID="recipientBankIDTextBox" MaxLength="11" />
<asp:RegularExpressionValidator runat="server" ValidationExpression="?" ControlToValidate="recipientBankIDTextBox" ErrorMessage="*" />
As far is I know SWIFT code must contain 5 or 6 letters and other symbols up to total length 11 are alphanumeric.
How to implement such rule properly? TIO
Hi,
I am trying to parse one XML file that contains some unicode characters.I tried to parse the file using NSXMLParser but i am unable to parse XML.Parser stops when it encounters any unicode characters.
Is there any other good solution to parse XML file with unicode letters?
Please suggest.
Thanks,
Jim.