verification

How can I get a regex to check that a string only contains alpha characters [a-z] or [A-Z]?

白昼怎懂夜的黑 提交于 2019-11-27 19:28:54
I'm trying to create a regex to verify that a given string only has alpha characters a-z or A-Z. The string can be up to 25 letters long. (I'm not sure if regex can check length of strings) Examples: 1. "abcdef" = true; 2. "a2bdef" = false ; 3. "333" = false; 4. "j" = true; 5. "aaaaaaaaaaaaaaaaaaaaaaaaaa" = false; //26 letters Here is what I have so far... can't figure out what's wrong with it though Regex alphaPattern = new Regex("[^a-z]|[^A-Z]"); I would think that would mean that the string could contain only upper or lower case letters from a-z, but when I match it to a string with all

Same page processing

人盡茶涼 提交于 2019-11-27 18:21:19
问题 How can process a form on the same page vs using a separate process page. Right now for signups, comment submissions, etc I use a second page that verifies data and then submits and routes back to home.php. How can I make it so that on submit, the page itself verifies rather than using a second page. 回答1: You can tell the form to submit to the PHP's self, then check the $_POST variables for form processing. This method is very good for error checking as you can set an error and then have the

ssh remote host identification has changed

偶尔善良 提交于 2019-11-27 09:55:40
I've reinstalled my server and I am getting these messages: [user@hostname ~]$ ssh root@pong @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is 6e:45:f9:a8:af:38:3d:a1:a5:c7:76:1d:02:f8:77:00. Please contact your system

Easiest way for PHP email verification link

情到浓时终转凉″ 提交于 2019-11-27 00:23:34
I already have an advanced user login/register system on my website ( colemansystems.psm2.co.uk ). However, I would like to have a email sent to new users for verification of their email address. If they have not clicked the link they will not be able to access their account. I am semi-experienced with PHP and MySQL, so please explain in depth. Edit: The code I'm using for the verify.php file (the link the user click on with a GET (for example, verify.php?d=51773199320 )) $secret = $_GET['d']; $result = mysql_query("SELECT valid FROM users WHERE secret=$secret"); while ($row = mysql_fetch

ssh remote host identification has changed

旧时模样 提交于 2019-11-26 22:18:54
问题 I've reinstalled my server and I am getting these messages: [user@hostname ~]$ ssh root@pong @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by

Mockito: Verifying with generic parameters

别说谁变了你拦得住时间么 提交于 2019-11-26 15:50:54
问题 With Mockito I can do the following: verify(someService).process(any(Person.class)); But how do I write this if process takes a Collection<Person> instead? Can't figure out how to write it correctly. Just getting syntax errors... 回答1: Try: verify(someService).process(Matchers.<Collection<Person>>any()); Actually, IntelliJ automatically suggested this fix when I typed any() ... Unfortunately you cannot use static import in this case. 回答2: Try : verify(someService).process(anyCollectionOf

Validate SSL certificates with Python

懵懂的女人 提交于 2019-11-26 11:03:30
I need to write a script that connects to a bunch of sites on our corporate intranet over HTTPS and verifies that their SSL certificates are valid; that they are not expired, that they are issued for the correct address, etc. We use our own internal corporate Certificate Authority for these sites, so we have the public key of the CA to verify the certificates against. Python by default just accepts and uses SSL certificates when using HTTPS, so even if a certificate is invalid, Python libraries such as urllib2 and Twisted will just happily use the certificate. Is there a good library somewhere

Easiest way for PHP email verification link

試著忘記壹切 提交于 2019-11-26 09:21:38
问题 I already have an advanced user login/register system on my website (colemansystems.psm2.co.uk). However, I would like to have a email sent to new users for verification of their email address. If they have not clicked the link they will not be able to access their account. I am semi-experienced with PHP and MySQL, so please explain in depth. Edit: The code I\'m using for the verify.php file (the link the user click on with a GET (for example, verify.php?d=51773199320 )) $secret = $_GET[\'d\'

Validate SSL certificates with Python

≯℡__Kan透↙ 提交于 2019-11-26 03:29:02
问题 I need to write a script that connects to a bunch of sites on our corporate intranet over HTTPS and verifies that their SSL certificates are valid; that they are not expired, that they are issued for the correct address, etc. We use our own internal corporate Certificate Authority for these sites, so we have the public key of the CA to verify the certificates against. Python by default just accepts and uses SSL certificates when using HTTPS, so even if a certificate is invalid, Python