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
12
votes
3 answers

Finding difference between strings in Javascript

I'd like to compare two strings (a before and after) and detect exactly where and what changed between them. For any change, I want to know: Starting position of the change (inclusive, starting at 0) Ending position of the change (inclusive,…
Richard
  • 125
  • 1
  • 1
  • 9
12
votes
4 answers

How do I do a one way diff in Linux?

How do I do a one way diff in Linux? Normal behavior of diff: Normally, diff will tell you all the differences between a two files. For example, it will tell you anything that is in file A that is not in file B, and will also tell you everything…
Jonathan
  • 1,050
  • 1
  • 12
  • 36
11
votes
3 answers

Differences between two images with slightly different point of view and lighting conditions with OpenCV

With the method explained in CV - Extract differences between two images we can identify the differences between two aligned images. How to do this with OpenCV when the camera angle (point of view) and the lighting condition are slightly…
Basj
  • 41,386
  • 99
  • 383
  • 673
11
votes
2 answers

Difference between torch.flatten() and nn.Flatten()

What are the differences between torch.flatten() and torch.nn.Flatten()?
jules
  • 143
  • 1
  • 1
  • 5
11
votes
4 answers

Average neighbours inside a vector

My data : data <- c(1,5,11,15,24,31,32,65) There are 2 neighbours: 31 and 32. I wish to remove them and keep only the mean value (e.g. 31.5), in such a way data would be : data <- c(1,5,11,15,24,31.5,65) It seems simple, but I wish to do it…
Loulou
  • 703
  • 5
  • 17
11
votes
4 answers

How to find the indices where there are n consecutive zeroes in a row

Suppose I have this data: x = c(14,14, 6, 7 ,14 , 0 ,0 ,0 , 0, 0, 0 , 0 , 0, 0 , 0 , 0 , 0, 9 ,1 , 3 ,8 ,9 ,15, 9 , 8, 13, 8, 4 , 6 , 7 ,10 ,13, 3, 0 , 0 , 0 , 0 , 0 , 0, 0, 0 , 0 , 0 , 0, 0, 0, 0, 0 ,0, 0 , 0 , 0, 0, 0, …
wolfsatthedoor
  • 7,163
  • 18
  • 46
  • 90
11
votes
4 answers

With() vs Compact() in Laravel

Is there any difference between with() and compact() ? Which one is more efficient ?
Animesh
  • 417
  • 2
  • 5
  • 14
11
votes
1 answer

Find Minimum Possible difference between numbers with unknown digits

I have some cases as follows. 1? 2? ?2? ??3 ? ? ?5 ?0 Now what I am supposed to do is to find some values in place of question marks, that would give produce the minimum possible difference between the 2 numbers. Answers Should be like 19 20 023…
Tirthraj Barot
  • 2,671
  • 2
  • 17
  • 33
11
votes
1 answer

Entity Framework - CreateQuery VS ExecuteFunction VS ExecuteStoreQuery VS ExecuteStoreCommand

What are the differences between following- CreateQuery()  ExecuteFunction(), ExecuteStoreQuery() and ExecuteStoreCommand() As per my knowledge CreateQuery is used for Entity SQL & rest of the methods are used for sql function or stored procedure…
paul sim
  • 463
  • 2
  • 10
  • 23
10
votes
1 answer

Difference between the headers ncurses.h and curses.h

What is the difference between the headers and as variations for the curses library? Why should I prefer #include Instead of #include ? I have searched for the difference in my Linux distribution. In…
10
votes
0 answers

Difference between recyclerView and recyclerListView?

.Difference between recyclerView and recyclerListView. recyclerListView is ListView?? or both are same?
Amit Sharma
  • 261
  • 1
  • 4
  • 20
10
votes
3 answers

What exactly is flushing?

I'm brand new to coding and programming (started today actually). I've been watching a few videos and reading the beginning to a few books to see which I can click with, but I'm having trouble understanding some of it. One of the videos utilized…
B Mai
  • 101
  • 1
  • 3
10
votes
5 answers

Why is react setState method immutable?

Following comes from React tutorial: const squares = this.state.squares.slice(); squares[i] = 'X'; this.setState({squares: squares}); This code changes copied state.squares and assign it to orginal state.squares. Finally this changes original…
Tetote
  • 111
  • 1
  • 1
  • 5
10
votes
5 answers

Getting the difference (in values) between two dictionaries in python

Let's say you are given 2 dictionaries, A and B with keys that can be the same but values (integers) that will be different. How can you compare the 2 dictionaries so that if the key matches you get the difference (eg if x is the value from key "A"…
celeminus
  • 101
  • 1
  • 1
  • 3
10
votes
1 answer

Linux differences between consecutive lines

I need to loop trough n lines of a file and for any i between 1 and n - 1 to get the difference line(n - 1) - line(n). And here is the source file: root@syncro:/var/www# cat cron.log | grep "/dev/vda" /dev/vda 20418M 14799M 4595M 77%…
SYNCRo
  • 450
  • 5
  • 21