comparison

Ruby addict looking for PHP subexpressions in strings

Assume color = "orange"; Ruby: puts("My favorite color is #{color.downcase() + 'ish'} -- at least for now."); PHP: print("My favorite color is {strtolower( $color ) + 'ish'} -- at least for now."); The PHP version does not work like I would like it to. I'm not looking for any language wars, I just want to know if anyone knows of a...

How do I do a simple Perl hash equivalence comparison?

I'm wondering if there's an idiomatic one-liner or a standard-distribution package/function that I can use to compare two Perl hashes with only builtin, non-blessed types. The hashes are not identical (they don't have equivalent memory addresses). I'd like to know the answer for both for shallow hashes and hashes with nested collections...

Tool or library for comparing xml files.

I am looking for an XML comparing tool that understands xml. It cannot be a line by line comparision like WinMerge or Beyond Compare. An ideal solution would be one that shows changes similar to the way Word 2007 shows track changes. DeltaXML does this, but does not come with a real GUI 'out of the box' and is $500 per user!: Xamxm...

Most elegant way to check for equality in size of sub-arrays in multidimensional array?

(can you tell I'm learning Ruby today? :)) I want to determine if the multidimensional array I'm working with is a 'rectangle'--i.e., the rows are the same size. Here's what I'm doing, which works but feels clunky. if @myArray[0].size != @myArray[[email protected]].size raise "This array is not a rectangle." end Basically, I'm check...

Python or Ruby for a .NET developer ?

I'm a C# .NET developer and I work on mostly ASP.NET projects. I want to learn a new programming language, to improve my programming skills by experiencing a new language, to see something different then microsoft environment, and maybe to think in a different way. I focus on two languages for my goal. Python and Ruby. Which one ...

XML compare tool that can "Tidy" the XML and ignore differences in attributes.

I am looking at using Beyond Compare 3 with XML Tidy compare comparison format. XML Tidy formats all the nodes with proper line breaks and indentation if an XML file is all slopped onto one line. ...So I would love a tool that can do this and can ignore differences in attributes, or not even show attributes at all (this is because attr...

JavaScript Library Performance Comparisons - any resources out there?

I'm putting together a presentation to my company on the reasons I'm adopting jQuery as the preferred JavaScript / AJAX library. While most of the work is done, a comparison between different libraries would be of great use - especially against the Microsoft ASP.Net Ajax framework. Now please note I'm not after a theological debate on ...

Calculating Binary Data Similarity

I've seen a few questions here related to determining the similarity of files, but they are all linked to a particular domain (images, sounds, text, etc). The techniques offered as solutions require knowledge of the underlying file format of the files being compared. What I am looking for is a method without this requirement, where arbit...

Handling comparisons with a custom boolean type?

I have a custom object that maps a boolean value from a legacy database to a C# bool (and back again). My custom bool object looks like this: public class S2kBool : IUserDefinedType { public bool Value { get; set; } public Type SupportedType { get { return typeof(string); } } // These are the values used to represent bool...

MDB comparison tool

Is there any other MS Access DB comparison tool like Cross-Database comparator? I want a tool that does a mass comparison like CDB ...

php == vs === operator

What is the difference between == and === in php. I am unsure when to use both. Updated note: So that it shows up in StackOverflow search, the difference between == and === is the same as the difference between != and !==. ...

Checking two dozen values, textboxes against datacolumns, algorithmically.

Okay big brains here's something that's more of a challenge than a requirement. I am a bit stumped. I usually just need a prod in the right direction, so get your prodding sticks ready. I have a tabcontrol covered in textboxes. I want to perform a check of the contents of all the textboxes during the SelectedIndexChanged event on a list...

Comparison between two big directories

I have a large directory that contains only stuff in CS and Math. It is over 16GB in size. The types are text, png, pdf and chm. I have currently two branches: a branch of my brother's and mine. The initial files were the same. I need to compare them. I have tried to use Git, but there is a long loading time. What is the best way to co...

About Comparing String With String

I tried to make character by character comparison under string type, with the following code: vector <int> getQuality(string seedTag, vector <string> &MuTag) { vector <int> Quals; for (unsigned i = 0; i<MuTag.size(); i++) { Quals.push_back(-40); cout << MuTag[i] << " " << seedTag[i] << endl; if...

Java: reverse sorting without keeping the order

Update: In fact, the only acceptable solution for this problem would be sorting the array ascending and then reversing it. Let S be the following sequence of events: Event | Time A | 0:00 B | 0:01 C | 0:01 D | 0:02 I have a simple Comparator to sort S, which sorts the elements according to the time value. public int ...

.NET equivalent of java.util.Arrays.toString(...) methods in Java

In Java, the java.util.Arrays class have several static toString(...) methods that take an array and return its string representation (i.e. the string representation of the contents of the array separated by commas and the whole representation enclosed in square brackets -- e.g. "[1, 2, 3]"). Is there an equivalent method/functionality ...

What's more expensive, comparison or assignment?

I've started reading Algorithms and I keep wondering, when dealing with primitives of the same type, which is the more expensive operation, assignment or comparison? Does this vary a great deal between languages? ...

Spring vs Jboss

What are the advantages and disadvantages for Spring vs. Jboss for an enterprise web application. ...

Which is the best encryption mechanism?

Triple DES or RC4? I have the choice to employ either one. ...

SQL data comparison tool for SQL Server Compact

Does anyone know of a tool similiar to RedGate's SQL Data Compare that works with Microsoft SQL Server Compact 3.5? ...