Questions tagged [difference]

This tag may refer to 1) the difference between two numbers (i.e. the difference between 5 and 10 is 5) or 2) the things that two or more particular objects do not share in common.

Use this tag for questions that deal with either of the following two topics:

  1. The difference between two numbers.
  2. What two or more particular objects do not share in common.

Related tags:

1970 questions
6
votes
3 answers

SQL Server: Replace characters different than a char in a string using no temporary table

I have a NVARCHAR(10) column in a table. It can store any type of UNICODE strings. I want to replace every char which is different than '1' with '0'. Let's say I have the string '012345C18*'. I should get '0100000100'. I managed to do it using a…
darkdante
  • 707
  • 1
  • 17
  • 36
6
votes
4 answers

Datetime comparison PHP/Mysql?

I'm trying to make something like this: if (datetime - system date > 15 minutes) (false) if (datetime - system date <= 15 minutes) (true) But I'm totally lost. I don't know how to make this operation in PHP. I'd like to see how I can pick that…
GBS
  • 124
  • 1
  • 3
  • 16
6
votes
3 answers

Calculate the greatest distance between any two strings in a group, using Python

My question is how to calculate greatest distance between any two strings that correspond to a certain group. Each line in my file starts with a 'group number' followed by a long string. I want to know, for each group, what the greatest distance…
Jen
  • 1,141
  • 2
  • 11
  • 16
6
votes
1 answer

Get the difference between two values

I got totally stuck on comparing two tables and getting the difference between them So here we go: I got table a with the following columns Name|Value|Date and the second table b with the same columns What i wanna do now is get the difference…
ZeroGS
  • 129
  • 2
  • 3
  • 11
6
votes
3 answers

What is the Difference between CMMI and Agile?

Is there anyone who can tell me what is the difference between CMMI and Agile. I know some obvious difference, but I want to know it further. I will appreciate it a lot if someone can help me! Thanks!
lute
  • 392
  • 2
  • 7
  • 17
5
votes
2 answers

Compare numeric values (using a threshold/tolerance) from two arrays with matching keys

I need to compare database values with post values. If post values (decimal price) are within 2 cents threshold consider values equal. Result is array with 'real' difference. Arrays are consistent: same number of values, same keys. $db_values = …
phpJs
  • 432
  • 1
  • 4
  • 23
5
votes
4 answers

How could I safely find the absolute difference between 2 signed integers in C?

An absolute difference would be the absolute value of the difference between 2 numbers. Suppose I have 2 int variables (x and y) and I would like to find the absolute difference. An easy solution would be: unsigned diff = abs(x-y); However these…
user16217248
  • 3,119
  • 19
  • 19
  • 37
5
votes
4 answers

How to substract multiple .x from .y with same prefixes

I have this tibble: # A tibble: 2 x 8 a.x b.x c.x d.x a.y b.y c.y d.y 1 13 13 12 11 7 1 4 2 2 17 11 0 0 16 2 0 0 df <-…
TarJae
  • 72,363
  • 6
  • 19
  • 66
5
votes
2 answers

Calculate difference between rows in R based on a specifc row for each group

Hi everyone, I have a dataframe with where each ID has multiple visits from 1-5. I am trying to calculate the difference of a score between each visit to visit 1. eg. (Score(Visit 5-score(Visit1) and so on). How do I achieve that in R ? Below is a…
Datamaniac
  • 171
  • 2
  • 9
5
votes
2 answers

How to reverse a seasonal log difference of timeseries in python

Could you please help me with this issue as I made many searches but cannot solve it. I have a multivariate dataframe for electricity consumption and I am doing a forecasting using VAR (Vector Auto-regression) model for time series. I made the…
k_bm
  • 81
  • 1
  • 10
5
votes
2 answers

What are some algorithms for comparing the differences between two trees?

I'm looking to find the differences while comparing two tree structures. The nodes will be strings. And I would like to capture at what level of the tree it is occurring. For example finding the differences between these two trees:
Y Mika
  • 71
  • 1
  • 6
5
votes
1 answer

Calculate the difference in seconds between two epoch timestamps in Javascript

I'm trying to calculate the difference (in seconds) between two EPOCH timestamps using Javascript. I have two timestamps: START: 1565628094441 END: 1565714527812 Both timestamps were obtained using: var time = new Date().getTime().toString(); I…
5
votes
3 answers

Is There an Example of an Iterator Which Wouldn't use ptrdiff_t as its difference_type?

I see that iterator_traits always defines a difference_type: https://en.cppreference.com/w/cpp/iterator/iterator_traits#Member_types I'm just wondering why, wouldn't that be ptrdiff_t for every type? Is there an example of an iterator which doesn't…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
5
votes
1 answer

relation between random testing and fuzz testing

I am wondering what the relation between random and fuzz testing is. I understand that random testing has been there for a longer time, but I cannot see any differences between them. They both seem to make use of random input to see if the program…
5
votes
2 answers

How to convert a deeply nested list to a string

If I make a deeply nested list, like this: arr = [1] for i in range(1000): arr = [arr] then print(arr) will work fine, but str(arr) fails miserably with maximum recursion depth exceeded. ("%s" % arr, and repr(arr) too.) How could I get the…
vagoston
  • 171
  • 8