normalize

How can I normalize a URL in python

I'd like to know do I normalize a URL in python. For example, If I have a url string like : "http://www.example.com/foo goo/bar.html" I need a library in python that will transform the extra space (or any other non normalized character) to a proper URL. ...

Is there an html css normalizer that works?

Long ago, I wrote a style 'normalizer' program to scan the ASP/HTML code of a big pile of classic ASP pages (most of which were originally generated from MS-Word documents, so naturally they were littered with superflous stylesheets and massive one-off styles). The style normalizer generated a minimal set of stylesheets and styles and a ...

Normalizing a list of items in MSBuild

I am trying to get a list of all unit test assemblies under the root of my project. I can do this as follows: <CreateItem Include="**\bin\**\*.UnitTest.*.dll"> <Output TaskParameter="Include" ItemName="Items"/> </CreateItem> However, this will find the same DLLs multiple times since they exist in multiple sub-directories. Is there ...

Correct way to standardize/scale/normalize multiple variables following power law distribution for use in linear combination

I'd like to combine a few metrics of nodes in a social network graph into a single value for rank ordering the nodes: in_degree + betweenness_centrality = informal_power_index The problem is that in_degree and betweenness_centrality are measured on different scales, say 0-15 vs 0-35000 and follow a power law distribution (at least...

How to: select normalized view from denormalized data using CTE?

This is a very standard newbie question, but I am looking for an expert clever way to do this with little code. (I know how to do this long hand, with procedural code and cursors, so we can skip that part of the answer.) Basically, I have a de-normalized data set for which I need to extract a normalized table in a set processing way. T...

Normalizing from [0.5 - 1] to [0 - 1]

Hi all, I'm kind of stuck here, I guess it's a bit of a brain teaser. If I have numbers in the range between 0.5 to 1 how can I normalize it to be between 0 to 1? Thanks for any help, maybe I'm just a bit slow since I've been working for the past 24 hours straight O_O ...

Denormalizing for sanity or performance?

I've started a new project and they have a very normalized database. everything that can be a lookup is stored as the foreign key to the lookup table. this is normalized and fine, but I end up doing 5 table joins for the simplest queries. from va in VehicleActions join vat in VehicleActionTypes on va.VehicleActionTypeId equals...

In xsl, is there a way to next a normalize-space call inside a sum?

I have an XML file that has a number of nodes, each of which contains a <current-fine> node. I need to sum these values but unfortunately they contain white-space so I end up getting NaN as the total. Is there a way of achieving the following: <xsl:value-of select="sum(normalize-space(node/sub-node/current-fine))"/> Many thanks ...

Surface Normals

Hello All, I have a request about surface normals. At the following code snippet is from the URL : http://www.kindohm.com/technical/wpf3dtutorial.htm private Model3DGroup CreateTriangleModel(Point3D p0, Point3D p1, Point3D p2) { MeshGeometry3D mesh = new MeshGeometry3D(); mesh.Positions.Add(p0); mesh.Positions.Add(p1); ...

C# code snippet calculating the surface and vertex normals

Hello, I need a C# code snippet calculating the surface and vertex normals. Kind of surface is triangulated 3D closed mesh. The required code snippet must be able to use a vertex set and triangleindices. These are ready to use at the moment. The surface of 3D mesh object is not smooth, so it needs to be smoothed. Could you help me. Th...

How can I normalize/collapse paths or URLs in Python in OS independent way?

I tried to use os.normpath in order to convert http://example.com/a/b/c/../ to http://example.com/a/b/ but it doesn't work on Windows because it does convert the slash to backslash. ...

What's wrong with this string normilizer Python snippet?

It seems that every time I think I mastered encoding, I find something new to puzzle me :-) I'm trying to get rid of French accents from an UTF-8 string: >>> import unicodedata >>> s = u"éèêàùçÇ" >>> print(unicodedata.normalize('NFKD', s).encode('ascii','ignore')) I expected eeeaucC as an output and got instead AA AaA A1AA using Py...

How can I draw a log-normalized imshow plot with a colorbar representing the raw data in matplotlib

I'm using matplotlib to plot log-normalized images but I would like the original raw image data to be represented in the colorbar rather than the [0-1] interval. I get the feeling there's a more matplotlib'y way of doing this by using some sort of normalization object and not transforming the data beforehand... in any case, there could ...

LINQ Normalizing data

I am using an OMS that stores up to three line items per record in the database. Below is an example of an order containing five line items. Order Header Order Detail Prod 1 Prod 2 Prod 3 Order Detail Prod 4 Prod 5 One order header record and two detail records. My goal is have a one to one relation for details records(...

AVAudioRecorder normalize volume

hey there, I've got an app that records audio. I'm wondering how I can increase the gain. is there a way to normalize the audio or amplify it somehow? thanks, howie ...

How to have normalize data around the average for the column in MATLAB?

I am trying to take a matrix and normalize the values in each cell around the average for that column. By normalize I mean subtract the value in each cell from the mean value in that column i.e. subtract the mean for Column1 from the values in Column1...subtract mean for ColumnN from the values in ColumnN. I am looking for script in Mat...

Database Design: Defining Access Control

An application I am developing needs to provide access to data based on a list of cities defined for each client. A client can have: access to all cities in a country OR access to all cities in a state / region OR access to select cities in any state or country. What would be the best way to define this in the database (if the db has...

CSS "Normalizer" tool?

I need to maintain & improve an existing website and I am drowning in the redundancy I have discovered in its CSS stylesheet. Given the existing redundancy and non-methodlogical ordering of elements, it's hard to track and predict how a minor change will propagate through the system, or where to apply a change to achieve a certain effect...

Removing diacritics in Silverlight (String.Normalize issue)

I did create a function that transforms diacritic characters into non-diacritic characters (based on this post) Here’s the code: Public Function RemoveDiacritics(ByVal searchInString As String) As String Dim returnValue As String = "" Dim formD As String = searchInString.Normalize(System.Text.NormalizationForm.FormD) Dim u...