comparison

When is the `==` operator not equivalent to the `is` operator? (Python)

I noticed I can use the == operator to compare all the native data types (integers, strings, booleans, floating point numbers etc) and also lists, tuples, sets and dictionaries which contain native data types. In these cases the == operator checks if two objects are equal. But in some other cases (trying to compare instances of classes I...

Find the delta between two xelements using "except" C#

My first XElement is: XElement sourceFile = new XElement("source", from o in Version1.Element("folder").Elements("folders").ElementAt(0).Elements("folder") where o.Name != null && o.Name == "folder" select new XElement("data", new XElement("name",(string) o.Attribute("n...

Mysql Compare Dates

Hello, I want to compare a date from DB that is between 2 given dates. The column from DB is DATETIME ,and I want to compare it only to date format,not datetime format. SELECT * FROM `players` WHERE CONVERT(CHAR(10),us_reg_date,120) >= '2000-07-05' AND CONVERT(CHAR(10),us_reg_date,120) <= '2011-11-10' I get this error when I execute ...

Where can I find a comparison of Distributed (and Offline?) Issue Trackers?

Hi, I'm looking for a fairly recent in depth comparison of currently available Distributed and hopefully Offline Issue Trackers. I've found this http://heapkeeper-heap.github.com/hh/thread_298.html#post-summary-hh-1076 which is decently recent and covers a number of solutions, but isn't up to date and IMO wasn't as researched as it coul...

What are the important features of C#

So, I am a C/C++ programmer currently in development of a small win32 project. I was told that C++ was becoming outdated, to be replaced with C#. This was over two years ago. So in your opinion, is C# a significant step up from C++, and does it provide more features/ease of use/ect.. that would make it worthwhile to learn. How much of ...

which method shoude be used to compare 2 similar strings in java?

hi all 1---- i'm using java. which method shoude be used to compare 2 similar strings. if the strings are similar, it return TRUE(ABC is similar to B, B is similar to ABC) . 2------- how can i get the number of times a string is repeated in an array of strings? some of The strings are similar (for example person is similar to twolegper...

PHP string comparison weirdness

I'm comparing a string from the database to a list of strings in an array: if (in_array($entry, array('Söme&nbsp;string', 'other-string'))) This works for other-string, but not for Söme&nbsp;string, the main difference beeing that this string has an umlaut and an html entity in it. If $entry is Söme&nbsp;string in the database, the co...

Compare two List<T> objects for equality, ignoring order

Yet another list-comparing question. I have: List<MyType> list1; List<MyType> list2; I need to check that they both have the same elements, regardless of their position within the list. Each MyType object may appear multiple times on a list. Is there a built-in function that checks this? What if I guarantee that each element appears on...

What's the difference between "package" and "module"

I use Java where we only have packages. I know there are other programming languages that also include modules. What's the difference? Thanks ...

Are there any floating-point comparison "anomalies"?

If I compare two floating-point numbers, are there cases where a>=b is not equivalent to b<=a and !(a<b), or where a==b is not equivalent to b==a and !(a!=b)? ...

Similar image search software (like TinEye)

Hi guys, In one of our community sites, we allow users to upload images. These images are approved or rejected by our moderators. To limit the work needed by our administrators, we want to 'log' each picture that is rejected to some kind of database, and do a lookup in this database prior to submitting an image for approval. If a simi...

Python vs C : Line of Code Comparison vs Dev Time

Hi I'm currently learning Python since the syntax feels so succinct and the idioms match well with my mental model. However I'm also interested in learning about OS internals and reverse engineering software, which ultimately means knowing C in a rather thorough capacity. When originally picking a language I did lots of reading and com...

MetaLinq vs MSDN's ExpressionTreeSerialization

Hi, There are two available solutions (that I could find) that have the ability to serialize expression trees: MetaLinq which has some other awesome features Expression Tree Serialization on MSDN Code Gallery which seems to be more lightweight I have little experience with these tools, so I can't decide whichever is the better. I'm ...

Case and accent insensitive 'like' comparison oracle without altering session on oracle

Hi all I need to be able to do 'like' queries across several languages, so that a umlaut, a and A are treated the same and so on. I'm on 10gr2 of oracle and I can't alter the session. I've been trying things like nls_upper(col_name,'NLS_SORT=BINARY_AI') like nls_upper('%fur%','NLS_SORT=BINARY_AI') but I'm not having any joy. Whatever...

String comparison algorithm, relevancy, how much "alike" 2 strings are

I have 2 sources of information for the same data (companies), which I can join together via a unique ID (contract number). The presence of the second, different source, is due to the fact that the 2 sources are updated manually, independently. So what I have is an ID and a company Name in 2 tables. I need to come up with an algorithm t...

Ignore few children for comparison when comparing xml documents with XMLUnit

Hi, Is it possible to ignore few children in elements when comparing xml documents with xmlunit. i want to ignore any empty text nodes in the element when comparing them. Best Regards, Keshav ...

JQuery string contains check

Hello, I need to check a string to see if it contains another string. var str1 = "ABCDEFGHIJKLMNOP"; var str2 = "DEFG"; What function do I use to find out if str1 contains str2? Cheers, Thomas. ...

Converting SQL number into a time, to perform date comparisons.

I am struggling with an SQL time comparison on two fields that have been set up as integers, rather than time stamps. I have some performance metrics in a database that the developer originally set up as int(8). The database contains the start and end times of a transaction. For example Some sample data may be id | start_time | end_ti...

Ruby, get hours, seconds and time from Date.day_fraction_to_time

I've found this method here. start = DateTime.now sleep 15 stop = DateTime.now #minutes puts ((stop-start) * 24 * 60).to_i hours,minutes,seconds,frac = Date.day_fraction_to_time(stop-start) I have the following error: `<main>': private method `day_fraction_to_time' called for Date:Class (NoMethodError) I've checked /us...

Eclipse CDT vs NetBeans C++ vs ...

Possible Duplicate: Best C++ IDE or Editor for Windows Hello, everyone. For a long time now, for C/C++ development, I have been using Notepad++ and the command line for compiling C/C++ programs. Now, I want to start using an IDE, and I have tried out quite a few. Currently, I am thinking of either Eclipse CDT or Netbeans C++,...