Is there any possible way to find out if an email address exists in c#?
e.g. I have an email address like [email protected] or [email protected] How can I do the validation?
Hi all
Sorry my English is bad.I hope u can get what I want.
I have lots of *.sql files that i want to write a program to compile them and if there is any issue(problem or mistake) report me.
One of my friend write an IDE for java,as I remember he use javac to generate the codes error,in other hand maybe u see when u try to write code in a Visual stadio or Netbean the IDE generate errors for u.so now I want to know any one have any idea how I can do it for my sql files?
In other mean I want to write a Editor for SQL files(PL/SQL) that compile my code and tell me what is my error.
this problem raise up when I try to compile all of them in SQL PLUS,it's so boring.
please help me...
Hi,
I have an application in C# (2.0 running in XP embedded) that is using a watchdog that is implemented as a Windows Service. When the device boots, this service typically takes some time to start. I'd like to check, from my code, if the service is running. How can I accomplish this?
I am trying to set up a MySQL trigger that does the following:
When someone inserts data into databaseA.bills, it verifies if databaseB.bills already has that row, if it doesn't, then it does an additional insert into databaseB.bills.
Here is what I have:
CREATE TRIGGER ins_bills AFTER INSERT ON databaseA.bills
FOR EACH ROW
BEGIN
IF NOT EXISTS (SELECT 1 FROM databaseB.bills WHERE billNumber=NEW.billNumber) THEN
INSERT INTO databaseB.bills (billNumber) VALUES (NEW.billNumber)
END IF
END;//
DELIMITER ;
The problem is, I can't create it through mysql console or phpMyAdmin. It returns syntax errors near END IF END, and I am sure it's a delimiter problem.
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END IF END' at line 6
What am I doing wrong?
I'm using a thirdparty credit card processing service (Paybox) that, after a successful transaction, redirects back to the website with a signature in the URL as a security measure to prevent people from manipulating data. It's supposed to prove that the request originated from this service. So my success URL looks something like this:
/success.php?signature=[HUGE HASH]
I have no idea where to start with verifying this signature. This service does provide a public key, and I assume I need to create a private key, but I don't know much beyond that.
I'm pretty good with linux, and I know I'll have to run some openssl commands. I'm writing the verification script in PHP, which also has native openssl() functions.
If anyone could please push me in the right direction with some pseudo code, or even functional code, I'd be very grateful. Thanks.
In my DB I have a column 'own_product' that contains 2 values ( quantity and name)
In my Edit form I want to check if the first field (quantity) is string and positive or not.
I added a new column 'type-prod' (int , string)
this is my controller :
$request = $this->container->get('request');
if ($request->getMethod() == 'POST')
{
$formel = $request->query->get('edit_formal');
$type_value = $formel['own_product'];
//case int
$type_int= $this ->getDoctrine()
->getEntityManager()
->getRepository('DHG\WelcomeBundle\Entity\type-prod')
->findOneBy(array('type' => 'int'));
//case string
$type_string = $this ->getDoctrine()
->getEntityManager()
->getRepository('DHG\WelcomeBundle\Entity\type-prod')
->findOneBy(array('type' => 'string'));
if (isset($type_value) && $type_int && $type_value > 0 && is_int($type_value))
{
echo 'Success';
}
else echo 'error' ;
}
Thank you !
So I'm working on just a learning project to expose myself to doing some things I do not get to do at work. I'm just making a simple bug and case tracking app (I know there are a million this is just to work with some tools I don't get to). So I was designing my database and realized I've never actually used Foreign Keys before in any of my projects, I've used them before but never actually setting up a column as a FK. So I've designed my database as follows, which I think is close to correct (at least for the initial layout).
However When I try to add the FK's to the linking Tables I get an error saying, "The tables present in the relationship must have the same number of columns". I'm doing this by in SQLSMS by going to the Keys 'folder' and adding a FK. Is there something that I am doing wrong here, I don't understand why the tables would have to have the same number of columns for me to add a FK relationship between the tables?
I'm currently using StructureMap to inject instances of NHibernate ISessions using the following code:
ObjectFactory.Initialize(x =>
{
x.ForRequestedType<ISession>()
.CacheBy(InstanceScope.PerRequest)
.TheDefault.Is.ConstructedBy(y => NHibernateSessionManager.Instance.GetSession());
});
I'm assuming that the CacheBy(InstanceScope.PerRequest) will properly dispose of the ISession it creates, but I'd like to make sure. What's the easiest way to test this?
Does anyone check the domain of an email address as part of their verification steps? eg. Confirm that gmail.com exists if the user specified [email protected] as their address.
Hi folks,
I'm playing around with some unit tests and mocking. I'm trying to verify that some code, in my method, has been called. I don't think I understand the Verify part of mocking right, because I can only ever Verify main method .. which is silly because that is what I Act upon anyways.
I'm trying to test that my logic is working - so I thought I use Verify to see that certain steps in the method have been reached and enacted upon.
Lets use this example to highlight what I am doing wrong.
public interface IAuthenticationService
{
bool Authenticate(string username, string password);
SignOut();
}
public class FormsAuthenticationService : IAuthenticationService
{
public bool Authenticate(string username, string password)
{
var user = _userService.FindSingle(x => x.UserName == username);
if (user == null) return false;
// Hash their password.
var hashedPassword = EncodePassword(password, user.PasswordSalt);
if (!hashedPassword.Equals(password, StringComparison.InvariantCulture))
return false;
FormsAuthentication.SetAuthCookie(userName, true);
return true;
}
}
So now, I wish to verify that
EncodePassword was called.
FormsAuthentication.SetAuthCookie(..) was called.
Now, I don't care about the implimentations of both of those. And more importantly, I do not want to test those methods. That has to be handled elsewhere. What I though I should do is Verify that those methods were called and .. if possible ... an expected result was returned.
Is this the correct understanding of what 'Verify' means with mocking?
If so, can someone show me how I can do this. Preferable with moq but i'm happy with anything.
Cheers :)
I've got an external USB disk running btrfs. I use it for backups, and each time I do a backup I take a snapshot.
However, it's giving me this error now:
parent transid verify failed on 109973766144 wanted 1823 found 1821
parent transid verify failed on 109973766144 wanted 1823 found 1821
Obviously, this is a non-critical disk, but I have a few files on here that aren't available elsewhere. Is there any way to recover data from this disk? Maybe by mounting one of the snapshots as root?
All other methods of Activesync and web access to my Exchange server are working fine with no errors or issues, but when we attempt to configure Android phones for the server, it will only work with 'verify certificate' checked off.
Ideally, I'd like my users to be able to use the default configuration, which includes the 'Verify Certificate' option.
My primary question is: 'What does Verify Certificate do?', as I imagine if I knew that, I might have some idea why it isn't working.
I'm working on my CMS (in PHP platform) for a long time now. The main program is done and I'm currently developing the Installer part. Installation itself will be fairly simple:
Upload all files
Verify that the "content/" dir has correct permissions
Check if ALL files are intact and not modified [This is the subject of this question]
Insert the config data and first settings
Run install (Generate all DB tables and insert sample data etc.)
Now the question-mark is at step 3. How do I verify ALL files? Verification itself should compare all CMS root-directories files against a list from remote location. List should contain filename, filesize and filetype. This way the user can check, that there are no unnecessary or corrupted files, that could indicated a breach in the software.
I have seen some software installers do that, but I cannot find any right now and there for I'm clueless on the most optimal method for this. Of course there always is a simple array trick, but there surely must be a better and faster method?!
I wrote an app and I want to sell it online, so I uploaded it to my website and tried to download and run it as a test, but a window appeared, it said : "The publisher could not be verified. Are you sure you want to run this software ?", and it also said : "Publisher : Unknown Publisher". It's actually a self-signed Java jar file wrapped into an exe file, I self-signed it with Netbeans6.7.
I wonder what should I do to be a "known" publisher ?
Frank
Can anyone tell me what's wrong with my IL code here?
IL_0000: nop
IL_0001: ldarg.1
IL_0002: isinst MyXmlWriter
IL_0007: stloc.0
IL_0008: ldloc.0
IL_0009: ldarg.2
IL_000a: ldind.ref
IL_000b: unbox.any TestEnum
IL_0010: ldfld Int64 value__/FastSerializer.TestEnum
IL_0015: callvirt Void WriteValue(Int64)/System.Xml.XmlWriter
IL_001a: nop
IL_001b: ret
I'm going crazy here, since I've written a test app which does the same thing as above, but in C#, and in reflector the IL code from that looks just like my DynamicMethod's IL code above (except my test C# app uses a TestStruct with a public field instead of the private value field on the enum above, but I have skipVisibility set to true)...
I get a NullReferenceException.
My DynamicMethod's signature is:
public delegate void DynamicWrite(IMyXmlWriter writer, ref object value, MyContract contract);
And I'm definitely not passing in anything null.
Thanks in advance!
How can I test if my server is vulnerable for SSL renegotiation?
I tried the following (using OpenSSL 0.9.8j-fips 07 Jan 2009:
openssl s_client -connect 10.2.10.54:443
I see it connects, it brings the certificate chain, it shows the server certificate, and last:
SSL handshake has read 2275 bytes and written 465 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 1024 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES256-SHA
Session-ID: 50B4839724D2A1E7C515EB056FF4C0E57211B1D35253412053534C4A20202020
Session-ID-ctx:
Master-Key: 7BC673D771D05599272E120D66477D44A2AF4CC83490CB3FDDCF62CB3FE67ECD051D6A3E9F143AE7C1BA39D0BF3510D4
Key-Arg : None
Start Time: 1354008417
Timeout : 300 (sec)
Verify return code: 21 (unable to verify the first certificate)
What does Secure Renegotiation IS supported mean? That SSL renegotiation is allowed?
Then I did but did not get an exception or get the certificate again:
verify error:num=20:unable to get local issuer certificate
verify return:1
verify error:num=27:certificate not trusted
verify return:1
verify error:num=21:unable to verify the first certificate
verify return:1
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 174
Date: Tue, 27 Nov 2012 09:13:14 GMT
Connection: close
So is the server vulnerable to SSL renegotiation or not?
Recently I wrote an small prototype that uses some relatively new technology. Now I wanted to verify if this prototype is usefull and could be used in real world example. But now I have a problem, how can I do that?
Normally, it would be a good thing to compare the prototype with already existing similar applications and compare if you perform better, provide better usability, etc. Since I'm not aware of something similar, this is quite difficult
Normally, I would see if the requirements of the customers are met. But there aren't any real requirements and no real customers. It as just an idea.
So the problem is, how can I get feedback on my prototype to see how it is accepted by potential users and what should be improved in a real implementation?
The question Is it illegal to rewrite every line of an open source project in a slightly different way, and use it in a closed source project? makes me wonder what would be considered a clean-room implementation in the era of open source projects.
Hypothetically, if I were to develop a library which duplicates the publicly documented interface of an open-source library, without ever looking at the source code for that library, could that code ever be considered a derivative work?
Obviously it would need the same class hierarchy and method signatures, so that it could be a drop-in replacement - could that in itself, be enough to provoke a copyright claim?
What about if I used the test suite of the open source project to verify whether my clean implementation behaved in the same way as the original library? Would using the test suite be enough to dirty my clean code?
As should be expected from a question like this, I am not looking for specific legal advice, but looking to document experiences people may have had with this sort of issue.
I have been looking at different tutorials about rsync about some specific situation I have.
I have a home server with all my pics, this server is my backup, my PC is the one that receives the new pics and until now i had been manually copying and pasting new photos from the PC to the server.
I was trying to setup rsync to do this automatically and in principle, it does without problem.
Now the issue; when I fire up rsync it start copying all the files, even the ones were already in the destination (this is because it is the 1st sync).
so my question is: Is it possible for rsync to verify that a file is the same (name/size/bin) so it will skip the copy on the 1st sync?
I'd like to verify that nothing within /foo/bar is chmod 777. Or, alternatively, I'd like to make sure that nothing within /foo/bar us owned by user1 or in group1.
Is there any way I can recursively verify the permissions within a given subdirectory to make sure there aren't any security holes?
Notice that I do not want to change all the permissions to something specific, nor do I want to change the owner to something specific, so a recursive chmod or chown won't do it...
Thanks!
I can´t verify my site on Google.
I´ve done this several times for several sites, all inside the same host.
I´ve tried the HTML tag method, HTML upload, Domain Name provider (I canp´t find the options that Google tell me that I should activate...), and Google Analytics.
I always get this response:
Verification failed for http://www.mysite.com/ using the Google Analytics method (1 minute ago). Your verification file returns a status of 403 (Forbidden) instead of 200 (OK).
I´ve checked the server headers, and I get this result:
REQUESTING: http://www.mysite.com GET / HTTP/1.1 Connection: Keep-Alive Keep-Alive: 300 Accept:/ Host: www.mysite.com
Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent:
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
SERVER RESPONSE: HTTP/1.1 403 Forbidden Date: Wed, 19 Sep 2012
03:25:22 GMT Server: Apache/2.2.19 (Unix) mod_ssl/2.2.19
OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.17 Connection:
close Content-Type: text/html; charset=iso-8859-1
Final Destination Page (It shows my actual homepage).
What can I do? The hosting is the very same as in my other sites, where I didn´t have any issue at all! Thanks for your help!
Note: As I have a Drupal 7 site, I´ve tried a "Drupal solution" first, but haven´t found any that solved this issue...
How can it be forbidden when I can access the link perfectly ok? Is there any solution to this? Thanks!
As a follow up to my prev question:
What is the best aproach for coding in a slow compilation environment
To recap: I am stuck with a large software system with which a TDD ideology of "test often" does not work. And to make it even worse the features like pre-compiled headers/multi-threaded compilation/incremental linking, etc is not available to me - hence I think that the best way out would be to add the extensive logging into the system and to start "coding in large chunks", which I understand as code for a two-three hours first (as opposed to 15-20 mins in TDD) - thoroughly eyeball the code for a 15 minutes and only after all that do the compilation and run the tests.
As I have been doing TDD for a quite a while, my code eyeballing / code verification skills got rusty (you don't really need this that much if you can quickly verify what you've done in 5 seconds by running a test or two) - so I am after a recommendations on how to learn these source code verification/error spotting skills again.
I know I was able to do that easily some 5-10 years ago when I din't have much support from the compiler/unit testing tools I had until recently, thus there should be a way to get back to the basics.
I am new to openssl and I am having some trouble verifying (from a client machine) an ftp server using ssl with a self-signed certificate.
I generated the .cer file by going to my server in IIS and exporting the certificate without the private key. I believe that this is all that I should need on the client side, right?
I use the following code to verify the certificate
openssl verify ftp.cer
and the error that I get back is
error 20 at 0 depth lookup:unable to get local issuer certificate
I tried this as well:
openssl verify -CAfile ftp.cer ftp.cer
but received the same error.
From what I understand about SSL, this is happening because I have no chain of trust that connects to this server. By default, openssl did not install any trusted CAs and this is fine. I would just like to tell it to trust this server. I tried various tutorials telling me how to add a certificate authority, including this one here, however the instructions are for linux and include adding a symlink and I am trying to do this in windows.
If anyone could provide any guidance on how to do this, or enlighten me if I am not understanding something correctly, I would greatly appreciate it.
Thanks!
I have a C# application that uses XML digital signatures to sign license files. I've used the standard Microsoft approach described here.
I'm porting the application to the MAC and need to verify the signature. My general question is how best to do this?
This is what I've done:
I've used macport to install Aleksey's xmlsec1 library.
Used the Chilkat library to convert my XML public key to a PEM file
Chilkat.PublicKey pubKey = new Chilkat.PublicKey();
pubKey.LoadXml(publicKeyXml);
pubKey.SaveOpenSslPemFile("publicKey.pem");
Compiled and ran the alekseys sample program. See (http://www.aleksey.com/xmlsec/api/xmlsec-verify-with-key.html) to verify an XML dsig.
Result: my license files fail to validate. The call to xmlSecDSigCtxVerify fails with status=unknown. Now for my specific question: What can I do next?
Geoff