0
голосов
2ответов
172 просмотров

Compare array attributes

I would like to compare two array items with php, I think I should use array_intersect_key but I don't know how I can do that. Array 1 [1] => obj Object ( [idobj:protected] => 2 ) [2] => obj Object ( [idobj:protected] =&amp...

14
голосов
4ответов
4010 просмотров

Should we always override equals?

When writing one's own classes, is it always necessary to override equals(Object o)? If I don't, will it automatically check that all the fields are the same? Or does it just check if the two variables point to the same object?

-2
голосов
2ответов
5330 просмотров

Web Services vs WCF , advantage and disadvantages

I want to clear my doubts about some questions related to web services and WCF. Following are my doubts.. What is the message format in Web Services , like in WCF every message is a SOAP message? Can we use TCP/IP protocol in Web Services if not then why not ? Why we use DataContractSerializer ...

62
голосов
9ответов
45836 просмотров

Comparing two List<string> for equality</string>

Other than stepping through the elements one by one, how do I compare two lists of strings for equality (in .NET 3.0): This fails: // Expected result. List&lt;string&gt; expected = new List&lt;string&gt;(); expected.Add( "a" ); expected.Add( "b" ); expected.Add( "c" ); // Actual result act...

2
голосов
3ответов
2570 просмотров

How can I compare md5 checksums in Perl?

I'm trying to compare the checksum value of a file. One variable $a has the checksum (output of md5sum command, only the hexadecimal part) and the same value is in variable $b. If I do ($a == $b), I am getting an error, but if I do ($a eq $b) it gives not equal. Thanks for your answers, it wor...

48
голосов
6ответов
27649 просмотров

C# implementation of deep/recursive object comparison in .net 3.5

I am looking for a C# specific , open source (or source code available) implementation of recursive, or deep, object comparison. I currently have two graphs of live objects that I am looking to compare to each other, with the result of the comparison being a set of discrepancies in the graphs. T...

6
голосов
3ответов
5305 просмотров

Comparing floating point values

I just read a statement about the floating point value comparison Floating point values shall not be compared using either the == or != operators. Most floating point values have no exact binary representation and have a limited precision. If so what is the best method for comparing ...

10
голосов
3ответов
8354 просмотров

MOTODEV Studio vs. Android Google plugin

Does anybody have any advice, experience, suggestions? I'm pretty comfortable with Google plugin - what would make me change to MOTODEV? Needless to say - I will download and play with it but I'm also interested in fellow developer's feedback.

1
голосов
1ответов
1373 просмотров

text comparison/difference algorithm

Is there a c# library/algorithm that compares 2 texts and displays what is different in them?

6
голосов
5ответов
3473 просмотров

How does Smalltalk (Pharo for example) compare to Python?

I've seen some comparisons between Smalltalk and Ruby on the one hand and Ruby and Python on the other, but not between Python and Smalltalk. I'd especially like to know what the fundamental differences in Implementation, Syntax, Extensiabillity and Philosophy are. For example Python does not s...

1167
голосов
14ответов
1538050 просмотров

Why does comparing strings using either '==' or 'is' sometimes produce a different result?

I've got a Python program where two variables are set to the value 'public'. In a conditional expression I have the comparison var1 is var2 which fails, but if I change it to var1 == var2 it returns True. Now if I open my Python interpreter and do the same "is" comparison, it succeeds. &gt;&gt;...

2
голосов
7ответов
2416 просмотров

How could I test if two bit patterns differs in any N bits (position doesn't matter)

Let's say i have this bit field value: 10101001 How would i test if any other value differs in any n bits. Without considering the positions? Example: 10101001 10101011 --&gt; 1 bit different 10101001 10111001 --&gt; 1 bit different 10101001 01101001 --&gt; 2 bits different 10101001 001010...

1
голосов
3ответов
359 просмотров

Combobox with comparison operators

I have an equation evaluator I need to make in Visual Basic. For example, for the following equation the answer would be true. (12 = 12) AND (12 &gt; 1) true and true For both comparison operators I've created a combo box to insert , =, &lt;=,&gt;=, &lt;&gt;. My problem is, I don't kn...

1
голосов
2ответов
1083 просмотров

Watch a web page for changes

I googled and couldn't find any could that would compare a webpage to a previous version. In this case the page I'm trying to watch is link text. There are services that can watch a page, but I'd like to set this up on my own server. I've set this up as a wiki so anyone can add to the code. H...

24
голосов
11ответов
18387 просмотров

Why is Perl the best choice for most string manipulation tasks?

I've heard that Perl is the go-to language for string manipulation (and line noise ;). Can someone provide examples and comparisons with other language(s) to show me why?

1
голосов
4ответов
156 просмотров

Compare many files at once with Vista?

I have a project composed of 100s of files. One version contains a bug that the other does not. Is there some tool I can use to compare everything at once? I was thinking I could examine each difference to see if it's causing the problem. (There wouldn't be too many differences, it's just a matte...

5
голосов
9ответов
10971 просмотров

How do you get how much memory a program uses?

I have two programs, one in C++, the other in assembler. I want to compare how much memory they use when running respectively. How can I do this? I am doing the testing on Windows, but I also would like to know how to do it on Linux.

1
голосов
3ответов
101 просмотров

What's the most concise way to check if a variable matches one of a range of values in PHP?

I'm currently using this for a nav list to highlight the active page: &lt;?= ($current_page == 'thema_list' ? 'class="on"' : '') ?&gt; Extending this to check another page would be: &lt;?= ($current_page == 'thema_list' || $current_page == 'thema_edit' ? 'class="on"' : '') ?&gt; Is there a ...

0
голосов
1ответов
72 просмотров

mateo ...javascript

hi what happens is that I am making an Enrollment Form, and I have a text field where I need 2 comparisons, I assess the number of ICFES snp, and if prior to 2000 has 12 digits, and after the 2000 14 ... and I've tried and nothing ... restricts me when I'm older than 14. function verificar(valor...

0
голосов
5ответов
1155 просмотров

Java: Cache results of computation?

I'm writing a program to calculate a value that is a measure of the similarity between two objects. The comparison is commutative, so compare(a, b) == compare(b, a). The program's output to the console is a matrix of all results. However, since the matrix has each comparison twice ((a, b) and (b...

1
голосов
2ответов
783 просмотров

Speed up text comparisons (feature vectors) with spatial MySQL features

I have a function which takes two arrays containing the tokens/words of two texts and gives out the cosine similarity value which shows the relationship between both texts. The function takes an array $tokensA (0=&gt;house, 1=&gt;bike, 2=&gt;man) and an array $tokensB (0=&gt;bike, 1=&gt;house, 2...

0
голосов
2ответов
282 просмотров

Speed up text comparisons (with sparse matrices)

I have a function which takes two strings and gives out the cosine similarity value which shows the relationship between both texts. If I want to compare 75 texts with each other, I need to make 5,625 single comparisons to have all texts compared with each other. Is there a way to reduce this n...

4
голосов
7ответов
651 просмотров

Can I expect float variable values that I set from literal constants to be unchanged after assignment to other variables?

If I do something like this: float a = 1.5f; float b = a; void func(float arg) { if (arg == 1.5f) printf("You are teh awresome!"); } func(b); Will the text print every time (and on every machine)? EDIT I mean, I'm not really sure if the value will pass through the FPU at some point even ...

13
голосов
2ответов
15357 просмотров

scheme list equivalence comparison

Hello I need to check if two lists have same elements in same order but I wasn't able to achieve as it seems like scheme eq? and eqv? checks by reference so giving false to such: &gt; (eq? (list 1 2 3) (list 1 2 3)) #f &gt; (eqv? (list 1 2 3) (list 1 2 3)) #f How to achieve this ?

99
голосов
16ответов
79670 просмотров

Is there a Java reflection utility to do a deep comparison of two objects?

I'm trying to write unit tests for a variety of clone() operations inside a large project and I'm wondering if there is an existing class somewhere that is capable of taking two objects of the same type, doing a deep comparison, and saying if they're identical or not?

3
голосов
2ответов
281 просмотров

Are there any production-ready LINQ implementations for javascript?

Background: Just for laughs I decided to search to see if anyone out there had developed a JavaScript implementation of LINQ. Lo and behold, there seem to be several of them. It would seem like LINQ implementations are almost like string Template processing engines: everyone and his dog has wri...

0
голосов
2ответов
107 просмотров

Comparer Class Most Efficient?

Consider the following A list of approximately 10,000 folders Of these folders, a list of rules determine if they qualify to go to the next stage The rules are a text based comparison such that if folder name contains (...any of the following from a list of exceptions) - such that there is a one ...

87
голосов
13ответов
49821 просмотров

Comparison of CI Servers?

I am searching for a comparison of different continuous integration (CI) Servers (esp. focusing on .NET) and couldn't find any. Therefore I'd like to know what you think about the different solutions available, what are the pros and cons, what are the hosting requirements and why CI Server XY is...

1
голосов
2ответов
1683 просмотров

Java Hashmap Iteration: Look at two values at once?

I have this loop: for (Map.Entry&lt;Integer, String&gt; entry: collection.entrySet()) { } I'd like to compare entry and the next one after that. How would I do it?

1
голосов
1ответов
688 просмотров

Eclipse 'Compare' menu options are all disabled

I recently upgraded my Subversion repository to version 1.6 and I'm connecting to it with Eclipse. However, when I check out a project branch and try to compare it with a different revision, (or any other circumstances for that matter) all of the options for comparison are disabled except for co...