[Solved] Regex patterns for AANNN and ANEE formats [closed]

I’m assuming you want ASCII letters and digits, but not Thai digits, Arabic letters and the like. AANNN is (?i)^[a-z]{2}[0-9]{3}$ ANEE is (?i)^[a-z][0-9][a-z0-9]{2}$ Explanation The ^ anchor asserts that we are at the beginning of the string [a-z] is what’s called a character class. It allows any chars between a and z. In a character … Read more

[Solved] Quotes for values of html attributes [closed]

The escaped quotes match each other in the HTML string that you’re creating. The quotes are not “surrounding” +i+. They’re being used to end the string that begins with “<p id=\”element” and to begin the next string: “\”>Hello world, …” This is concatenating i between these two strings. So if i contains 0, the resulting … Read more

[Solved] How to create objects dynamically? [closed]

The keyword new lets you create a new object. C++ is a little different than a language like .Net or Java, if you are familiar with those languages. The C++ languages uses the keyword new, but new return a “pointer” to the new object. If your class is named “Bet”, then the statement: Bet *betPointer … Read more

[Solved] Using php in CSS ID/Class name [closed]

This is ok as long as its in a php file (with .php extension) <div class=”box <?php echo $something ; ?>”> This however, .sample-<?php echo $something; ?> { /* CSS Styles */ } Please never do this. There’s really no reason to. Furthermore, the purpose of CSS is for styling your webpage not handling server … Read more

[Solved] What is wrong with this programming? [closed]

Aside from several ugly antipatterns, there’s one obvious mistake/typo: Take a good look at if a > 0: kb = int(str(byte)[a:b]) else: kd = int(str(byte)[0:b]) Do you see now where your error comes from? 1 solved What is wrong with this programming? [closed]

[Solved] String object creation in loop [closed]

Your code is going to loop 1001 times, thus creating 1001 independent String-objects. s is a local variable inside the loop, thus the garbage collector is going to free the memory occupied by these no longer referenced instances as soon as the system needs the memory. Thus, I would not expect any memory issues. As … Read more

[Solved] C++ double char array deliminator [closed]

On the coding side, since this is C++, don’t store lists of strings in a two-dimensional array of char. Try std::vector<std::string> instead. And don’t read your file one character at a time; read larger blocks of characters. If you can guarantee that there are never spaces embedded within first names, you can write something like … Read more

[Solved] What are these meta tags? [closed]

charset: Specifies the character encoding for the HTML document. http-equiv: Provides an HTTP header for the information/value of the content attribute. Edge mode tells Internet Explorer to display content in the highest mode available. With Internet Explorer 9, this is equivalent to IE9 mode. If a future release of Internet Explorer supported a higher compatibility … Read more

[Solved] Python if statements [closed]

Try that (see the new indention) script_username=”test” script_password=”1″ login_username=raw_input(‘Please Enter the script username:’) login_password=getpass.getpass(‘Please Enter the script password:’) if login_password == script_password and login_username == script_username: print ” Welcome to the Script ” else: print ” your Username or Password is false ” exit() name=raw_input(“Enter your name: “) family=raw_input(“Enter your family: “) sex=raw_input(“Enter your Sex: … Read more