comparison

Type comparison not returning expected result.

I am using the following code to compare types so that a DataContractSerializer will re-initialize with the correct type if necessary. private void InitializeSerializer(Type type) { if (this.serializer == null) { this.serializer = new DataContractSerializer(type); this.typeToSerialize = ty...

Compare two string ArrayLists

I have two array lists dim Colors1 = New ArrayList Colors1.Add("Blue") Colors1.Add("Red") Colors1.Add("Yellow") Colors1.Add("Green") Colors1.Add("Purple") dim Colors2 = New ArrayList Colors2.Add("Blue") Colors2.Add("Green") Colors2.Add("Yellow") I would like to find out which colors are missing from Colors2 that a...

Advantages of Erlang over (something like) node.js?

I realize that they are different beast used to solve different problems, but I would like to ask for an enumerated list of advantages of Erlang over node.js (and vice-versa). When would you use one over the other? ...

High-level differences between node.js and ZeroMQ?

Excuse my ignorance, but what is the high-level overview of (something like) node.js versus ZeroMQ? ...

Tkinter or wxpython

Hey guys I want a simple gui for one of may apps and am a noob when it comes gui itself. Tkinter and wxpython are the two standards in python i see.. Which one is simpler and more intuitive? ...

C++: ptr_container comparison

How can I customize the comparison of elements in a ptr_container? Using a ptr_set, I would like to define a function that checks for equality of elements. However, defining bool operator==(const Foo& other) (or a friend function) does not work. It just won't be invoked, although boost's unordered containers, on the other side, are aw...

How a processor can calculate if A < B

This is probably a dumb question came to my mind, but I think I don't have answer to this - How processor would find if A < B? In fact there are other things as well like A>B or A==B. But if we solve A I understand that different processors may probably have different implementations but I wanted to have some high level idea of doing ...

How does a sorting network beat generic sorting algorithms?

In reference to fastest sort of fixed length 6 int array, I do not fully understand how this sorting network beats an algorithm like insertion sort. Form that question, here is a comparison of the number of CPU cycles taken to complete the sort : Linux 32 bits, gcc 4.4.1, Intel Core 2 Quad Q8300, -O2 Insertion Sort (Daniel S...

Automated testing with PHP

I'm a .net developer so pardon me for not knowing anything about PHP. I read some things on the net but I can't say how it compares to Asp.net MVC in terms of automated testing. I tend to think that PHP is very much like classic ASP except that it's OOP (is it?). In order to improve its testability you have to follow certain development...

How to get the number of differences in a string comparison?

I know I can get whether 2 strings are equal in content, but I need to be able to get the number of characters that differ in the result of comparing 2 string values. For instance: "aaaBaaaCaaaDaaaEaaa" "aaaXaaaYaaaZaaaEaaa" so the asnwer is 3 for this case. Is there an easy way to do this, using regex, linq or any other way? EDIT:...

adjacent date element in array

Hi friends how to compare an adjacent array element that contains date. The thing is when i compare BOOL day = [[temp_date objectAtIndex:k] compare:[temp_date objectAtIndex:k+1]]; it throughs the following expection * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (23) be...

Compare fields of two unrelated objects

Hi. I've got two objects of different classes that share some fields with the same name and type. These two objects are not related to each other. There's no possibility for me to create an interface or a parent class. Now I want to compare those shared fields and as far as I know this should be possible using reflection. These are th...

Validation of existence per result on a indexed list, mysql/php

We have a directory system that lists people with their credentials such as email phone and etc Their web profile link is also listed. but this link is created by taking the email username and adding it to a link. so [email protected] has a profile page at school.com/user/joe01 currently there is no validation to check if the actual user...

Searching for similar groupings; including diff and score (ie. Similar Recipes)

I'm trying to find the best way to determine how similar a group of items (in this example; ingredients in a guacamole recipe) is to all groups of items (recipes in a table; linked to another table of ingredients). For instance; I have the following guacamole recipe: 3 Avocados 1 Vine-Ripened Tomatoes 1 Red Onion 3 Jalapenos 1 Sea Salt...

similarity metric to compare 2 sets of 2D points?

I am using a software tool SentiWordNet that can map an English word to a pair of numbers showing how positive and negative the word is. The pair of numbers p and n satisfies the 3 conditions. p ≥ 0 n ≥ 0 p + n ≤ 1 One can process each word of, say, a movie review and then find out the overall positiveness/negativeness. I was t...

Performance monitoring : CA Wily vs Dynatrace - Are you using these ?

Tried researching a comparison study with CA Wily & Dynatrace, but couldn't find good material. Wanted to know if fellow SO users have used either of these two. If you are, are there any features you like/dislike in them ? ...

Comparing 2 Dictionary<string, string> Instances

I want to compare the contents of two Dictionary<string, string> instances regardless of the order of the items they contain. SequenceEquals also compares the order, so I first order the dictionaries by key and then call SequenceEquals. Is there a method that I can use instead of SequenceEquals that will only compare the contents? I...

String Comparison with a Format - Python

I wanted to check if user has entered the input in particular order or not. Basically i wanted user to input date in format like this %d/%m/%y %H:%M Is there any way i can compare string input with the above format in python? ...

Compare two xml files using Junit

Hi, I am writing a JUnit test case which want to test whether a particular file is added with some content or not. In that case, I want to get the instance of the file before modification and another file instance of the same file after modification and want to check whether both are not equal. how to do that in Java Junit ? ...

Comparison Based Ranking Algorithm

I would like to rank or sort a collection of items (with size potentially greater than 100,000) where each item in the collection does not have an intrinsic (comparable) value, instead all I have is the comparisons between any two items which have been provided by users in a 'subjective' manner. Example: Consider a collection with el...