canonical-form

What is the general complexity of building a canonical language representation?

It is often handy to have a canonical representation of a language (in my case they are usually domain specific languages); however, I believe there are strict limits on the expressiveness of the languages involved that determine whether a canonical form can be determined and/or created for an arbitrary program in that language. Unfortu...

Are there canonical-forms for database queries?

Say I want to make an "Optimized query generator". Basically a SQL query optimizer that is a lot better than what can be put in an SQL server based on time/space limitations. It would take a query and DB stats as input and generate an SQL query tailored for the target system that will quickly optimize to a nearly ideal plan. How much of...

Canonicalize NFL team names.

This is actually a machine learning classification problem but I imagine there's a perfectly good quick-and-dirty way to do it. I want to map a string describing an NFL team, like "San Francisco" or "49ers" or "San Francisco 49ers" or "SF forty-niners", to a canonical name for the team. (There are 32 NFL teams so it really just means f...

Canonical form of += operator for classes

I know that it's a good idea to make as much of the interface of a class non-member non-friend as possible, and I've just realised that for my 3D vector class, 'Vector3', I can move the +=, -= and so on operators out of the class, leaving just constructors and the copy assignment operator. The question is: what should this operator look...

XML Canonicalization algorithm gives two difference results when called directly than when called as part of an xml digital signature?

Hi all, I'm getting two different hashes of the same xml document when I directly canonicalize some xml than when I perform a digital signature on it which also performs the same canonicalization algoririth on the xml before hashing it? I worked out that the digital signature canonicalization includes the new line characters '\n' and s...

How can I canonicalize Windows file paths in Perl?

Update: I can make this a simpler problem to solve: I want to figure out what the correct regex would be to substitute any single occurrence of a back slash with two back slashes. I want to turn this: vlc.plugin.path = C:\Program Files\JekyllV0.9.2\\VLC_1.0.0\\plugins into: vlc.plugin.path = C:\\Program Files\\JekyllV0.9.2\\VLC_1....

Which is the proper XML exclusive canonicalization?

I'm using xmlseclibs to try and sign a SOAP document, but it does not seem to canonicalize things in the same way depending on whether I'm signing or validating. I'll give you an example. This is the XML I am trying to sign: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt; <soapenv:Header/> <soapenv:Body>...

Should I delete the record of my site with WWW in it?

I currently have both urls of my site listed in google and yahoo siteexplorer etc, there is some difference in the pages that are indexed. Do I need both, or can I delete the one with the www at the start and then let it find all pages using the new url? I have already set my preferred domain in google but can not see a way to do it in ...