comparison

How to simplify stopping movement of image when within threshold of target

I've already tried to explain what I'm trying to do to others, and failed horribly. Therefore, if you will excuse me, I'll just show you the code and attempt to explain a little. if (MovePetMoving) { if (MovePetSlope[0] > 0) { if (MovePetSlope[1] > 0 && Convert.ToDouble(pictureBoxP...

Zendesk or tenderapp?

I've been looking at support systems for a webapp I'm going to be pushing really hard over summer. I've narrowed it down to Zendesk and tenderapp. They both seem to offer much of a similar product, price & features. Has anyone out there used the two and can advise how to best make the decision? Thanks :) ...

How to compare almost similar Strings in Java (ME)? (String distance measure)

I would like to compare two strings and get some score how much these look alike. For example "The sentence is almost similar" and "The sentence is similar". I'm not familiar with existing methods in Java ME, but for php I know the levenshtein function. Are there better methods in Java? ...

Scanning a coin and then determining the date from the image

I want to write a .NET program that takes an image of a specific coin type (say a US nickle) and then searches the image for the year. Assume the scan is always 300dpi and has a consistent image size cropped to the coin. What changes is the rotation of the coin. So how would I determine the date? Should I image match by creating a libra...

Comparing date time

Hi. It seems I can't compare 2 date values with time. When I compare just date part - year, month and day - everything works fine. But when I add comparing times everything breaks down and not even month fits. So what's some basic algorithm for comparing 2 dates? I mean generally, I can't juse use dateTime1.CompareTo(dateTime2). Prefer...

Practical Difference between XHTML, HTML, AND XML

So here's what I understand (please correct if wrong) : HTML5 is the newest version (or at least soon to be released) of HTML and contains features that XHTML does not yet have XHTML served as MIME type text/html is equal to HTML for the purposes of rendering Converting from text/html to application/xhtml+xml is difficult because it's ...

AS3: Compare Two Arrays, Get Uncommon Values

I have a simple problem that I'm having trouble thinking around: var oldValues : Array = [ 4, 5, 6 ]; var newValues : Array = [ 3, 4, 6, 7 ]; I want to get the values from newValues that aren't in oldValues - 3, 7 I want to get the values from oldValues that aren't in newValues - 5 A way of getting both sets of values together would ...

Javascript Strings don't compare, escape characters not being escaped when using jQuery.val() func

I have: <input type="text" value="Raphaël\nkicks\nbutt!" id="tzbox_txt"> var inputText = $("#tzbox_txt").val(); var stringText = "Raphaël\nkicks\nbutt!" inputText === stringText - false! If I use $(input).val() I get "Raphaël\nkicks\nbutt!" where \n is not being interpreted as line breaks. And if I do var text = "Raphaël\nkicks\nbut...

How does Mercurial stack up against GIT and SVN?

With Phil Haack and others recently tweeting about CodePlex's move to support Mercurial as a DVCS, I thought it might be worth a look. As someone who currently uses SVN for personal projects and TFS at The Office, how does Mercurial compare in terms of usability, features and what are some of the better Mercurial hosting services availa...

Distance between regular expression

Can we compute a sort of distance between regular expressions ? The idea is to mesure in which way two regular expression are similar. ...

Does 1 always equal '1' in SQL?

I am trying to determine that standard SQL behaviour for comparing a number to a character or string version of the same number. Does SELECT 1 = '1' (or the like) always return some sort of "truthy" value (true, 1, 't', etc.)? I have confirmed as much on PostgreSQL and MySQL, but I cannot find a resource for SQL as a whole. Update: The ...

Delphi - Compare and Mark String Differences

What I need to do is compare two strings and mark the differences with begining/ending marks for changes. Example: this is string number one. this string is string number two. output would be this [is|string is] string number [one|two]. I've been trying to figure this out for some time now. And I found something I blieved would h...

Need Help Programming in C comparing times together..

Hi Everyone, i need some advice and help with a plugin i am writing for Nagios. i am writing the plugin in C, but have no previous experience in the language except for minor amounts whilst trying to get this plugin to work. basically what i am trying to-do is the following. read a text file that is generated on a remote PC by an appl...

Django templates problem — {% if object|length > 4 %} raises TemplateDoesNotExist: 500.html

Hello, I have the following in my template. {% block content %} {% for album in albumsList %} {% if fotosList %} <div class="photoalbum-wrapper"> <h3>{{ album.title }}</h3> <ul class="photoalbum"> {% for foto in fotosList %}<li>item</li>{% endfor %} ...

why do some languages require function to be declared in code before calling?

Suppose you have this pseudo-code do_something(); function do_something(){ print "I am saying hello."; } Why do some programming languages require the call to do_something() to appear below the function declaration in order for the code to run? ...

Mysql compare Strings

Hi, from a resultset of about 5 different strings, I would like to select the result of which the string resembles my given string the most. Is there any possibility to do this in mysql? ...

comparing values of two arrays in php

i have two arrays which keys are book id( 61, 78 ,...etc) (1) book_width ( [61] => 8.3 [72] => 8286.1 [78] => 6.4 [100] => 8407.0 [102] => 0.7 ) (2) book_height ( [61] => 9.00 [72] => 150 [78] => 8.00 [100] => 150 [102] => 3.00 ) now i want an array whic...

Comparing two files

Can anyone create a script for a file comparison? The pseudo code looks like this extract line 5 from file 1 save it in another variable, extract line 5 from file 2, save it in another variable, if variable 1 is not equal to variable 2 (while allowing for differing characters at positions 11 and 12 from the end of line) the...

How can i see differences between two .sdf files?

I need a tool that show me the differences between two .sdf files. Is there something I can download or do I have to write some code? ...

Optimum way to compare strings in Javascript?

I am trying to optimize a function which does binary search of strings in Javascript. Binary search requires you to know whether the key is == the pivot or < the pivot. But this requires two string comparisons in Javascript, unlike in C like languages which have the strcmp() function that returns three values (-1, 0, +1) for (less than...