comparison

Find the closest time from a list of times

So, here's the scenario. I have a file with a created time, and I want to choose a time from a list of times that that file's created time is closest or equal too...what would be the best way to accomplish this? ...

How do I compare an object with an NHibernate proxy object?

I'm using Compare .NET Objects to test whether my POCOs are persisted correctly to a test database. Let's take an example POCO: public class NoahsArk { public virtual Noah Noah { get; set; } } And the mapping file, using FNH: public class NoahsArkMap : ClassMap<NoahsArk> { References(x => x.Noah).Cascade.All(); } Now, I run...

C# - XML vs MySQL

In this program I'm writing, it would need frequent database communication, and at the moment I'm using just XML files. Is there really a benefit from using MySQL or SQL in general over XML. Just note that I'm using C# so MySQL is not very fun to deal with in it (from what little experience I have). ...

Comparing ruby hashes

Hi I have two ruby hashes (which are essentially models) and am trying to find the differences between them, one is an old instance of an object where the other has new values assigned to some attributes. I'm trying to determine which keys have changed, but there doesn't seem to be anything built into the Hash for this. I can think of...

Objective-C - Comparing integers not working as expected

Hi everyone. So my problem is this: I am receiving a JSON string from across the network. When decoded (using SBJSON libraries), it becomes an NSDictionary that SHOULD contain a number of some sort for the key 'userid'. I say 'should' because when I compare the value to an int, or an NSINTEGER, or NSNumber, it never evaluates correctly....

Comparing character arrays and string literals in C++ without cstring

In my programming class we currently have a project that requires us to take arguments into the program. I then need to be able to check one of the arguments to see which value was passed to the program so that I can choose the appropriate behavior for the program to follow. In a previous homework assignment I did this with the strcmp fu...

Java Generics comparison

How do you go about comparing two generic classes? class Entry<K,V> { protected K key; protected V value; public K getKey() { return key; } public V getValue() { return value; } public static Comparator KeyComparator = new Comparator() { public int compare(Object o1, Object o2) { int key1 = ( (Entry) o1 ).getKey(); int...

What PHP Blogging Software Should I Choose

I am thinking of starting a blog, which I would like integrated into my existing website. I come back empty handed from googling for a comparison of blogging software written in PHP. My requirements: Simple but not rudimentary (not a result of a 15 minute CodeIgniter tutorial) Quality source code (I'd like to be able to learn from it ...

MyFaces vs Sun Reference Implementation of JSF

Maybe, some performance comparison or some noticeable specific differences is what I want to know. As I heard there is no really big difference. Hence, I've got one more question. For what purposes dozens of people spent their time to reinvent the wheel implement already implemented spec ones more? ...

What is the key difference between a Web application and a Web Portal?

I taught i had a clear view of the difference between these, but giving it a deep i got confused. Can someone help with a comparison, please? ...

Arrays: Counting, Comparing and Increase

Woohoo, I've come to arrays now, thank god. Now, I've got 2 arrays! int colorvalues[][] = {{34,255,255,56},{127,204,11,34},{123,98,127,34},{34,34,127,17}}; Imagine it as a 4x4 pixel picture Now, I want to create a histogram, the distribution of colorvalues from 0 to 255. For example here I've 2*255, 2*127, 5*34 and so on. So I've ...

Bitmap (of a signature) comparison in c#

We have a for fun project which require us to compare two black and white bitmaps of two signature and say whether they are the same persons signature. As this is just two loaded bitmaps rather than data captured from a tablet the approach is going to be a little different to normal signature recognition. I am thinking it would require...

Python time comparison

How do I compare times in python? I see that date comparisons can be done and there's also "timedelta", but I'm struggling to find out how to check if the current time (from datetime.now()) is earlier, the same, or later than a specified time (e.g. 8am) regardless of the date. ...

Compare NSString accounting for articles (i.e. "the" and "a")

I thought caseinsensitiveLocalizedCompare: would take care of this (that is not including "the" and "a" in the comparison) , but it does not. (Also, In response to the first answer below, I understand that "case insensitive" part wouldn't help, but I thought that the "localized" part may help. I can't find any options to do this and g...

Basic excel date and time problem

Hi everyone, Have a list of dates in excel in the format (this comes originally from csv): 23/11/09 07:27:02 23/11/09 08:01:50 23/11/09 08:38:58 23/11/09 09:40:01 What I want to do is count the number of these falling between hour blocks, like 7-8, 8-9, 9-10 etc Not sure how to get started, but one idea was just to put logic statemen...

How to compare groups of tuples in sql

How to compare groups of tuples in sql: consider the following example: TABLE T1 -------- GROUP VALUE ----- ----- A FOO A BAR X HHH X ZOO TABLE T2 -------- GROUP VALUE ----- ----- B ZOO C FOO C BAR I want to write an sql query which compares the groups of values...

Is there an effective way to determine whether .Equals on two different but "equal" instances will return true?

I'm attempting to use reflection to determine the result of a call to .Equals on two different but "equal" instances of a type. My method would be something like: public static bool TypeComparesProperties(Type t) { // return true if (an instance of t).Equals(a different instance of t) // will be true if all publicly accessible...

Compare the textual content of websites

I'm experimenting a bit with textual comparison/basic plagiarism detection, and want to try this on a website-to-website basis. However, I'm a bit stuck in finding a proper way to process the text. How would you process and compare the content of two websites for plagiarism? I'm thinking something like this pseudo-code: // extract tex...

Emacs Lisp: difference between (function (lambda ...)) and (lambda ...)?

What is the difference between (function (lambda ...)) and (lambda ...) and '(lambda ...) ? It seems three are interchangeable in a lot of cases. ...

Best way to write an or is equal statement

Hello $mostamazingforumforfastanswersever. I have a quick silly question; what is the best way to write this : if ($curpageurl == "www.mysite.com/this" || "www.mysite.com/this/") { echo 'this is the this page'; } and if it isn't, then I need to call while (isset($somevariable) { echo '$somevariable'; } and if that variable isn'...