comparison

What is the best way to compare 2 folder trees on windows?

Hello. I'm movimg a repository from sourcesafe to subversion and i need to ensure that vital points are equal. Is it any existing command / tool for windows that allows me to compare two folder trees that they are equal (has equal folder structure and files of same content)? The ideal will be something command-line like: some_cool_comp...

Another class instead of SHA1Managed to making Checksum's with fewer than 128 length bytes

hi, i have a table that have one column (AbsoluteUrl NVARCHAR(2048)) and i want to querying on this column, so this took long time to comparing each records with my own string. at least this table have 1000000 records. Now i think there is better solution to making a checksum for each AbsoluteUrl and compare to checksum together instead...

String Comparison differences between .NET and T-SQL?

In a test case I've written, the string comparison doesn't appear to work the same way between SQL server / .NET CLR. This C# code: string lesser = "SR2-A1-10-90"; string greater = "SR2-A1-100-10"; Debug.WriteLine(string.Compare("A","B")); Debug.WriteLine(string.Compare(lesser, greater)); Will output: -1 1 This SQL Server code: ...

coldfusion string comparison

I have a form that returns a list like this when submitted: 2009,9 I want to compare it to database pulled values but keep getting an error. <cfif #FORM.month# eq #qGetDates.year#,#qGetDates.month#> I know I probably have to cast it or convert it to a string for the comparison to work, how do I do this? Thanks, R. ...

Count number of vector values in range with R

In R, if you test a condition on a vector instead of a scalar, it will return a vector containing the result of the comparison for each value in the vector. For example... > v <- c(1,2,3,4,5) > v > 2 [1] FALSE FALSE TRUE TRUE TRUE In this way, I can determine the number of elements in a vector that are above or below a certain numb...

Best method for accessing static members

In my previous question I found two solutions for accessing static members. I would like to know which one is the better way, and why. Using reflection Using object methods using eval ...

locale-aware number comparison with XSLT

I have a bunch of costs in my XML that I am trying to compare against another cost value, to determine which values to display (only ones higher than the comparator). This works when the numbers use the decimal point as the separator but not with numbers using comma as the decimal separator. I could be getting either, depending on the ...

Ruby Set class: equality of sets.

According to the Ruby Set class's documentation, "== Returns true if two sets are equal. The equality of each couple of elements is defined according to Object#eql?. The essence of this can be demonstrated using Date objects, where sets containing different Date objects but with the same date compare to equal: require 'set' d1 = Date.t...

check if all elements in a list are identical

I need the following function: Input: a list. Output: True if all elements in the input list evaluate as equal to each other using the standard equality operator; False otherwise. Performance: of course, I prefer not to incur any unnecessary overhead. I feel it would be best to iterate through the list, compare adjacent elements, and...

PHP: calculating birthday from age.

Yes, this may sound strange. In the advanced profile searching form, where you can filter by age. Now you would type 18 or some other age in the field. I am storing the birthdays, in the mysql db, in the birthday field in users i have example: 1990-02-02 How can i filter by age then, in a query? Should i first make a query before, m...

How is python more poweful programming language than Matlab for engineering projects?

I have started learning python now and shortly we'll be employing it by writing codes and scripts to better the already existing geo-statiscal modeling software package called SGeMS. As to what I know right now regarding the project, it'll involve using the sophisticated programming and visualization capabilities built into Python. I hav...

Can BuildForge do what Hudson CI is currently doing?

I am looking for a comparison between IBM Build Forge (Rational) and Hudson CI. At work we have full licenses for BuildForge but recently we started using Hudson for doing continuous integration and automating other tasks. I used BuildForge very little and I would like to see if there are any special advantages of BuildForge over Hudso...

approximate comparison in python

I want to make '==' operator use approximate comparison in my program: float values x and y are equal (==) if abs(x-y)/(0.5(x+y)) < 0.001 What's a good way to do that? Given that float is a built-in type, I don't think I can redefine the == operator, can I? Note that I would like to use other features of float, the only thing that I'...

custom comparison for built-in containers

In my code there's numerous comparisons for equality of various containers (list, dict, etc.). The keys and values of the containers are of types float, bool, int, and str. The built-in == and != worked perfectly fine. I just learned that the floats used in the values of the containers must be compared using a custom comparison function...

Type equality performance

I have an iterator of objects and I have to take specific action if the item is of some type. That type is a friend class in the runtime, and therefore cannot be used in design-time. So my question is, which of the following will cost less performance: Private Const myType As String = "System.HiddenNameSpace.MyHiddenType" Sub Compare()...

Problem using NSString compare:options:range, conflicting results

Ohh, what is wrong with this code !?!?! NSString *s1 = @"5 Oct 2010 18:30"; NSString *s2 = @"5 Oct 2010 09:47"; NSRange range = {0, 11}; // Both "D MMM YYYY " and "DD MMM YYYY" NSComparisonResult result = 0; result = [s1 compare:s2 options:NSLiteralSearch range:range]; // result == -1 NSString *sa = [s1 subst...

Iphone development: UIColor / CGColor components comparison

Hello, I've got some internal codes for colors in my application, so I created a function that, given a color, returns the code. I'm having problems as it just doesn't work and return always "01" for every color else than the red, which returns the proper code. Has someone a clue about it? (NSString *)internalColorCode:(UIColor *)color ...

Measuring the similarity between two binary files???

Hi Guys, I have two G729 encoded files, i took the pcm version of them. i want to measure the similarity between these two files. these files are binary files so how one can measure the similarity between binary files, i wrote a code in C that takes patterns from the first one and search for similar ones in the second one, but i want to ...

Identical strings comparison gives me false

I have two identical strings, one in an array and one in a String variable. When I compare these IDENTICAL strings I get false every time. I have debugged and debugged, but I get the same result every time. Here is the code in question String temp = ""+(num1*num2); Boolean equal = temp == answers[i]; if(equal) { correct[i] = true; ...

Doctrine - Compare two objects

Hi! What would to know the best way to compare two objects using Doctrine! On the domain login I am considering, two objects are equal if they have the same properties values, except the id and the created_at and updated_at auto-generated fields through the Timestampable behavior. Thanks in advance for the help, Best regards! ...