Check if Zip Code or postal code is real - validation

After some searching, I haven't been able to find a definite answer.
If I am given a zip code like 11111, it is technically a valid zip code but it doesn't exist. Is there a way to check this? The same goes for a postal code like a1a a1a (valid but not real).

For United States zipcodes:
You can purchase / download databases of zip codes, which you can use in your local app.
Google for
us zip code database
Here is one that you can use for free for non-commercial purposes (for commercial purposes you can purchase a cheap license):
http://www.unitedstateszipcodes.org/zip-code-database/
There are some providers which allow you to perform remote HTTP calls, search around

For any who stumble onto this and are using Python, this exists: https://github.com/Brobin/usps-api
It doesn't cover all the API functionality, but it makes the standard stuff much easier than constructing XML by hand.

Related

What do protofiles represent for googles API Linter?

since google did not create extensive documentation for their API Linter and I cannot find anything from other sources, i wanted to ask here.
From what exactly am i supposed to create protofiles and what do they represent?
As I understood, these protofiles get checked for compliance to their AIPs.
I'm interested in creating a automatic prototype (Java) to check for customized API Rules and am thinking about using Protobufer for this goal. Would this be a pragmatic solution?
Thank you!
As I now understand, Googles API Linter isn't supposed to check a API or a different API specification for compliance.
It checks proto files because they are themself the API specification and can be converted to Code. But before converting them they can be checked against rules they have to comply with.
These rules are not in the protofiles (as I initially thought) but in the many GO-files under rules/ .
Please correct me if you read this and find mistakes! Thanks!

How can I work with Windows security groups without knowing their localized names in advance?

I've searched around online but can't find what I'm after. Basically, during an install, we fire off a separate executable that basically brute forces a few folders to be read/write enabled for the user group "EVERYONE".
Now, the person that wrote this never took into consideration system language. I had a call with a customer in France that kept failing installation because "EVERYONE" isn't what we would expect.
I'm after an API call to Windows that would return a security group name which would be "safe" to use in a localized environment. Essentially I'm looking to safely edit this code so instead of hardcoding in "EVERYONE", we call a function instead.
The fundamental mistake here is not so much the use of EVERYONE, but rather that the code is using names at all. Instead of using names you should use the well-known SIDs. In your case you need S-1-1-0.

SmartyStreets Address Validation PHP Example?

Can I get a sample PHP code example which calls SmartyStreets LiveAddress API for address validation?
Sure -- we have sample code at our GitHub repository. There's 3 examples there:
A request to our API using cURL (can handle many addresses at once)
A GET request. Easy, but only supports one address per request
A "SLAP" (Single-Line Address Processing) example which shows how to verify an address if it's not already split into components like street, city, state, etc.
If you have any further questions, I'd be happy to help; I wrote these examples.
If you are developing SmartyStreet code on a test system that doesn't have a secure certificate, you can add this line to disable the certificate test:
if ($bTestSystem) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Smarty streets uses the same approach as many other solutions. The user enters an Address and then a lookup is performed and if the address is not found the user is presented a list of valid addresses to select. This is a slower approach that may not be ideal.
A newer approach that may be a better option comes from Addrexx. The Addrexx solutions allows users to autoselect their information from dropdown lists. This speeds the process on entering personal information. Full disclosure: I am a developer at Addrexx. Addrexx is a SaaS that includes complete integration packages for salesforce, magento, big commerce and many more platforms.
You can see the Addrexx approach at http://addrexx.com/ecommerce.html.

Is there any tool to generate a labels.rdf file?

Examining the 404 errors for my website I noticed requests for a "labels.rdf" file. After some digging I think I understand what it is and want to create one for my website. But I don't really understand how to generate it. Is there any tool or a generic file that I can use?
Thanks
RDF is not just one format, but a collection - most likely it's expecting RDF/XML.
IMHO the esiest thing to do is create the data you need in a format called Turtle (http://www.w3.org/TeamSubmission/turtle/) - there's lots of tutorials online, then convert it to RDF/XML with a tool, such as rapper (http://librdf.org/raptor/).
You will need to know a bit about the RDF data model though, and what the labels.rdf file is trying to express.

Sonar - Can we use for OSB/BPEL code review?

I am new to sonar,just heard about this tool.
Can we use this tool to perform code review for FMW(Fusion Middleware) -OSB(Oracle Service Bus)/BPEL project ?
If so can anyone give some inputs on this?
The official plugin-List : http://docs.codehaus.org/display/SONAR/Sonar+Plugin+Library/ does not mention support for your tools.
But sonar can be extended with custom plugins, so you may be able to write your own plugins to provide metrics for your tools.
What level of review you want to cover? It is really easy to make your own review tool for BPEL. All BPEL resources are XML files. For example if you want to check for naming convetion of BPEL activities, you can define a simple XPath based rule.
Ex:
//sequence/#name ~= "^sequence.*".
A Java program can use the above XPath to pull-out all sequence names from the xxxx.bpel file and compare it against a regular expression. Similar rules can be created for checking WSDL usage, partner links, end-point addresses, usage of Error handling etc.

Resources