Все вопросы: [compare]

127 вопросов

3
голосов
5ответов
3230 просмотров

Eclipse (3.5) how to compare files horizontally?

Normally Eclipse 'File Compare' compares files in vertical panels like: Is there a way I can compare them horizontally like: Compare using Horizontal Panel http://www.sqlservertool.com/images/ad_hex_diff_small.gif Its too tiring to scroll everytime to see what was changed!! Thx

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

Comparer.Compare needs one Object that implements IComparable but will throw exception if not the first parameter is

In the documentation for Compare function in Comparer class it says: If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b implements IComparable, then the negated result of b. CompareTo (a) is returned. But when I test it It seams like it will demand that the firs...

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

comparing a Node and an Object with a BST data structure

I'm getting a "java.lang.string cannot be cast to node" exception. I thought of converting the localRoot to a string using a provided toString method then comparing them, nut this leaves no concept of 'greater than' or 'less than' which I need to navigate the BST... int computeResult = ((Node&l...

2
голосов
2ответов
8660 просмотров

given 5 numbers, what is the minimum number of comparisons needed to find the median?

how do you setup minimum number of comparisons in general?

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

Key compare using dictionary

I have a file with the following structure: system.action.webMessage=An error has happened during web access. system.action.okMessage=Everything is ok. core.alert.inform=Error number 5512. I need a script to compare the keys in 2 files with this structure. I was working in a script to convert t...

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

Ruby: Comparing two Arrays of Hashes

I'm definitely a newbie to ruby (and using 1.9.1), so any help is appreciated. Everything I've learned about Ruby has been from using google. I'm trying to compare two arrays of hashes and due to the sizes, it's taking way to long and flirts with running out of memory. Any help would be apprec...

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

script,unix,compare

I have two files ... file1: 002009092312291100098420090922111 010555101070002956200453T+00001190.81+00001295.920010.87P 010555101070002956200449J+00003128.85+00003693.90+00003128 010555101070002956200176H+00000281.14+00000300.32+00000281 file2: 002009092410521000098420090709111 0105604585200...

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

Getting The Last Changes since Last Value Change

I want to check the last value changes. Some times the objectId is the same as another objectId but the value can be different. And i cant compare this to get the Last changes. How do i do that? This are the Objects object(stdClass)#38 (6) { ["id"]=> string(7) "1715680" ...

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

implementing the IComparable Interface on two string fields

How do I implement the IComparable Interface on two string fields? Using the Person class example below. If Person objects are added to a list. How do I sort the list based on Surname first THEN Forename? Class Person { public string Surname { get; set; } public string Forname { get; se...

2
голосов
4ответов
11795 просмотров

java compare objects: using reflection?

I have an object which itself has multiple objects as fields. The question I have is, I have two objects of these kind and I want to compare these two. I know I can do equals, comparator etc. but is there a way to use reflection to get the properties of the object and make comparison. for examp...

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

Enumerated Type Value Not Comparing Correctly

I'm writing some C code for an embedded application, and I've run into a problem wherein a compare against an enumerated value is not being executed correctly. Take the following code snippet, for example: typedef unsigned int UINT16; typedef enum enum_items_tag { ITEM_1, ITEM_2, ITEM_...

4
голосов
4ответов
5372 просмотров

Case-insensitive comparison of sets in Python

I have two sets (although I can do lists, or whatever): a = frozenset(('Today','I','am','fine')) b = frozenset(('hello','how','are','you','today')) I want to get: frozenset(['Today']) or at least: frozenset(['today']) The second option is doable if I lowercase everything I presume, but I...

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

Comparing two files

I am comparing two files by reading them into filestream and comparing byte by byte. How can I skip whitespaces while comparing? I am using C#.net

0
голосов
3ответов
847 просмотров

SQL qn:- comparing data in rows

i would like to compare numeric data in rows. for eg, i have a table that has a column as such:- Number ====== 1.88 9.99 8.76 9.88 I want to compare 2nd value, 3rd value, 4th value to the 1st value. And then 3rd, 4th value to the 2nd. then 4th to 3rd. How can i construct an sql to do th...

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

Diff/Compare Tool That Lets Me Write Comments On Differing Lines

I'm looking for a diff/compare tool that shows differing lines from two text files, and gives me a space to comment on those files. Ideally this application would have three panes, pane one would be file A, pane two would file B and pane three would be a comment I can enter to on why the files ar...

8
голосов
3ответов
11021 просмотров

Compare two xml and print the difference using LINQ

I am comparing two xml and I have to print the difference. How can I achieve this using LINQ. I know I can use XML diff patch by Microsoft but I prefer to use LINQ . If you have any other idea I will implement that //First Xml <Books> <book> <id="20504" image="C01" name="C...

57
голосов
7ответов
28497 просмотров

Difference between period and comma when concatenating with echo versus return?

I just found that this will work: echo $value , " continue"; but this does not: return $value , " continue"; While "." works in both. What is the difference between a period and a comma here?

5
голосов
1ответов
5668 просмотров

library that identifies similar images

I want to determine how similar 2 images are. The images may have been scaled, cropped, etc, so a simple pixel comparison won't work. I have had a look around and there are a lot of academic papers on this topic but they don't release their code. So, do you know of a released library that can co...

0
голосов
8ответов
3387 просмотров

Adding time in PHP

I am pulling a datetime from a mysql db and i would like to add X hours to it then compare it to the current time. So far i got $dateNow = strtotime(date('Y-m-d H:i:s')); $dbTime = strtotime($row[0]); then i tried $dbTime + strtotime("4 hours"); but 4 hours seem to add 4hrs to the current tim...

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

Efficiently comparing a vector to a series of numbers in Java

I have a series of numbers, i.e. 6, 5, 7, 8, 9, 1, which through some mathematical process I will eventually obtain through repetition. For this reason, I want to use a vector to store the last six numbers yielded by this process and then compare the contents of that vector to the series of numbe...

2
голосов
2ответов
327 просмотров

Tool to diff webpage semantic structure rather than content

Does anyone know of any tools that allow diff'ing between two web pages semantic markup rather than content? Cheers.

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

How to compare a date from mysql with current date and send a notification email

I have database entrys that have a date column ( mySQL date type ). I want to compare that date with the current server date and with 3 days before that day, every month, to automatically send an email to a specified address.

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

Any existing php code out there for condorcet comparing?

I beleive the website 'whatsbetter.com' (defunct) used a Condorcet method for comparing two images such that they could join a list of ranked images, and also have data stored about their performance against each other over time. I would like to implement something like this myself. I don't wan...

17
голосов
6ответов
8681 просмотров

Looking for a web based diff component

In a content management system, moderators have to approve changes to existing articles. Currently the system shows the old and the revised version of the text in plain text. It is a pain to find the actual differences. In GoogleDocs, there is a 'Compare revisions' feature which highlights the d...

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

MIPS how can you compare a character taken from input?

My program asks the user if the number he/she is thinking of is in a list. The user inputs a y or an n. How can I check if a user has entered y or n in assembly? Is it sufficient to put the user input into a register and branch if equal to 121 (decimal ASCII code for 'y') or branch if the value i...

0
голосов
3ответов
129 просмотров

Compare the value of a variable at intervals

Hey I have a problem comparing the value of a CGPoint (struct with two ints: x and y) with another at certain time intervals. One is called location and has the value of where the cursor is. Every half a second or so, I want to see if it changed. How do I do this? The language is Objective-C (so...

8
голосов
6ответов
5308 просмотров

How to show a comparison of 2 html text blocks

I need to take two text blocks with html tags and render a comparison - merge the two text blocks and then highlight what was added or removed from one version to the next. I have used the PEAR Text_Diff class to successfully render comparisons of plain text, but when I try to throw text with ht...

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

How does String.CompareTo work?

When I compare strings containing positive/negative numbers, for example: int res1 = "-1".CompareTo("1"); int res2 = "-1".CompareTo("2"); res1 equals 1. res2 equals -1. How does String.CompareTo work?? That would mean it is order is "2 -1 1"...

136
голосов
18ответов
185724 просмотров

How to compare 2 files fast using .NET?

Typical approaches recommend reading the binary via FileStream and comparing it byte-by-byte. Would a checksum comparison such as CRC be faster? Are there any .NET libraries that can generate a checksum for a file?

1
голосов
5ответов
1527 просмотров

What is the best way of comparing a string variable to a set of string constants?

if statement looks too awkward, because i need a possibility to increase the number of constatnts. Sorry for leading you into delusion by that "constant" instead of what i meant.