compare

Compare Version Identifiers

Here is my code, which takes two version identifiers in the form "1, 5, 0, 4" or "1.5.0.4" and determines which is the newer version. Suggestions or improvements, please! /// <summary> /// Compares two specified version strings and returns an integer that /// indicates their relationship to one another in the sort order. ...

An easy way to diff log files, ignoring the time stamps?

I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out? ...

SQL - How do you compare a CLOB

in a DB2 trigger, I need to compare the value of a CLOB field. Something like: IF OLD_ROW.CLOB_FIELD != UPDATED_ROW.CLOB_FIELD but "!=" does not work for comparing CLOBs. What is the way to compare it? Edited to add: My trigger needs to do some action if the Clob field was changed during an update. This is the reason I need to comp...

How to compare two PDF files?

I need to compare large count of PDF files for it optical content. Because the PDF files was created on different platforms and with different versions of the software there are structural differences. For example: the chunking of text can be different the write order can be different the position can be differ some pixels It should ...

C# object is not null but (myObject != null) still return false

I need to do a comparaison between an object and NULL. When the object is not NULL I fill it with some data. Here is the code : if (region != null) { .... } This is working but when looping and looping sometime the region object is NOT null (I can see data inside it in debug mode). In step-by-step when debugging, it doesn't go i...

Compare view with stream

I use ClearCase. I have a snapshot view. Is there a way to compare this view with stream to find changed files? In TortoiseSVN this is called "Check for modifications" and shows all difference between local copy and what we have in the repo. ...

How would you compare two XML Documents?

As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this: The first document is the source, e.g. what I want the XML document to look like. Thus the second is the one I want to find differ...

Comparing VB6.exes

Hi, We're going through a massive migration project at the minute and trying to validate the code that is deployed to the live estate matches the code we have in source control. Obviously the .net code is easy to compare because we can disassemble. I don't believe this is possible in vb6 exes because of the manner of compilation. Does...

Updating client SQL Server database structure from text file

We have a "master database structure", and need a routine to keep the database structure on client sites up-to-date. A number of suggestions have been given to a related question, but I am looking for a more specific solution, along these lines: I would like to generate a text file (XML or other readable format) which describes the en...

Compare Strings given in $_POST with php

I have a form that is sending in sizes of things, and I need to see what the strings are equal to so that I can set the price accordingly. When i try to do this, it says that they are not equal, and i get no prices. This is the code i'm using: if ($_POST['sizes'] == "Small ($30)"){$total = "30";} if ($_POST['sizes'] == "Medium ($40)"){$...

What tool to use to compare and reduce css style sheets

I have a page (page1.html) which references a css file (style1.css) All is good. I need Page1.html to additionally reference Style2.css However when I add the reference, some stuff on Page1.html screws up. How can I determine what it is about Style2.css that is causing this problem? Some diff Tool? Some Process? ...

Best method to determine changed data in C++

I need to write a tool in C++ to determine the changed bits in a file compared against another file for replication. What would be the best method of accomplishing this? I don't have a specific OS or library in mind, I'm open to suggestions. My primary goal is reducing the amount of network traffic involved in replicating. ...

Which is the best way to compare the integer part of two non-integer numbers?

I need to compare the integer part of two doubles for inequality and I'm currently doing this: int iA = (int)dA; int iB = (int)dB; if( iA != iB ) { ... } but I wonder if there's a better approach than this. Thanks. If I used Math.Truncate() instead of a cast to int, would it still be accurate to compare the two resulting double...

What's a good tool/method to find which files on disk have been changed after a program has been run?

I'm experiencing a strange issue where my Visual Studio 2005 C++ program crashes the first time it runs after a new build. I'm having a difficult time debugging this intermittent issue and I suspect it's somehow related to a file somewhere on my hard drive that is being changed. If I can find the file(s), that might provide some more i...

Comparing Char which holds hex values C++

Hi, in C++ I have two chars holding hex values e.g.: char t = 0x4; char q = 0x4; How would i compare if the two values held in the char are the same?? I tried if (t == q) // should give me true but no, any help, thanks! ...

How to parse a month name (string) to an integer for comparison in C#?

I need to be able to compare some month names I have in an array. It would be nice if there were some direct way like: Month.toInt("January") > Month.toInt("May") My Google searching seems to suggest the only way is to write your own method, but this seems like a common enough problem that I would think it would have been already imp...

Compare two consecutive elements in std::list

I'd like to compare two consecutive elements in a std::list while iterating through the list. What is the proper way to access element i+1 while my iterator is at element i? Thanks Cobe ...

Chaining of ordering predicates (e.g. for std::sort)

You can pass a function pointer, function object (or boost lambda) to std::sort to define a strict weak ordering of the elements of the container you want sorted. However, sometimes (enough that I've hit this several times), you want to be able to chain "primitive" comparisons. A trivial example would be if you were sorting a collectio...

Can I compare MySQL enums?

I have an enumeration: ENUM( 'alpha', 'beta', 'gamma', 'delta', 'omega' ) If I sort my table by this column I get them in the correct order defined above. However, I can't find a way to select a subset of these, e.g. everything before delta. Using WHERE status < 'delta' only returns alpha and beta, not gamma. It seems MySQL uses a stri...

regex compare two numbers

can i somehow compare two numbers in regex? i want regex that is correct for 10-12, but incorrect for 12-10. I mean that 10 must be smaller than 12. I want to do it in Javascript. ...