Questions tagged [bisect]

the "bisect" subcommand of Git or the "bisect" module of Python

105 questions
6
votes
4 answers

using bisect on list of tuples but compare using first value only

I read that question about how to use bisect on a list of tuples, and I used that information to answer that question. It works, but I'd like a more generic solution. Since bisect doesn't allow to specify a key function, if I have this: import…
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
5
votes
3 answers

rspec Bisect Runs Indefinitely

I'm seeing some unexpected behavior regarding rspec --bisect when running on circleci. Often times the bisect runs indefinitely until it times out after 5 hours. Bisecting appears to be working initially, but once it reaches the expected end, it…
seanriordan08
  • 296
  • 3
  • 14
5
votes
2 answers

How can 'git bisect skip' be done in TortoiseGit?

TortoiseGit has a GUI for running Git Bisect. However during a bisect-session the context menu only provides 'Bisect good', 'Bisect bad' and 'Bisect reset'. Is there a way to do 'Bisect skip' without the overhead of using the command line?
Johannes Matokic
  • 892
  • 8
  • 15
5
votes
8 answers

Find numbers within a range bisect python

I have a list of integer numbers and I want to write a function that returns a subset of numbers that are within a range. Something like NumbersWithinRange(list, interval) function name... I.e., list =…
Dnaiel
  • 7,622
  • 23
  • 67
  • 126
4
votes
1 answer

How can git bisect tell me which merge broke the master branch?

Git bisect is branch aware, so it will usually happily venture into some branch to test those commits. I am not interested in whether the branch contains some bad commits. I am interested in whether or not merging a feature broke something,…
oligofren
  • 20,744
  • 16
  • 93
  • 180
4
votes
1 answer

Absolute Elements Sums

I was trying to solve this problem on Hackerrank. https://www.hackerrank.com/challenges/playing-with-numbers/problem Given an array of integers, you must answer a number of queries. Each query consists of a single integer, x, and is performed as…
datduong
  • 61
  • 6
4
votes
2 answers

git bisect first guess outside of bounds

I am trying to use git bisect I identified the bad commit to be: 2ac4ac0a46d902235a51216b24257a977877979a at 19 Oct 2016 The first good commit that I found is: 6a1d1ec5599d011a75df18075feb1819f1ad8877 at 9 Jan 2016 So i run: > git bisect start >…
Berty
  • 1,081
  • 1
  • 18
  • 49
4
votes
2 answers

Python: Fast mapping and lookup between two lists

I'm currently working on a high-performance python 2.7 project utilizing lists ten thousands elements in size. Obviously, every operation must be performed as fast as possible. So, I have two lists: One of them is a list of unique arbitrary numbers,…
JiaYow
  • 5,207
  • 3
  • 32
  • 36
3
votes
1 answer

How to find all lower and upper values for a given value in a list

I have an array that looks like this: [1,2,4,1,2,5,1,2,6] Given a value of 3 I want to find all value-pairs in the list above that encapsulate that given value. i.e; [2,4];[2,5];[2,6] I can find the [2,6] values by using bisect, but how can I find…
Skobo Do
  • 49
  • 6
3
votes
2 answers

How does the `key` arg in Python bisect work?

I believe I understand sorting and bisection. When using key with sorted I get the results I expect, but when I call bisect(..., key=fn) I don't understand the outcome. Possibly a bug? Where would I report that? from bisect import bisect fn =…
Paul
  • 766
  • 9
  • 28
3
votes
2 answers

Bisector of two vectors in 2D (may be collinear)

How to find a bisecor b = (bx, by) of two vectors in general (we consider two non–zero vectors u = (ux, uy), v = (vx, vy), that may be collinear ). For non-collinear vector we can write: bx = ux/|u| + vx / |v| by = uy/|u| + vy / |v| But for…
Beginner
  • 31
  • 1
  • 3
3
votes
1 answer

blender 2.8 python, dividing object in 2 halfs using bisect is producing wrong result

With Blender 2.8 I have created a complex object that I wanted to split in two seperate objects. The procedure I followed (all scripted): Create object; duplicate object; go to edit mode and bisect with '''clear_inner=True'''. (works Perfect!) Then…
Odvkram
  • 33
  • 3
3
votes
2 answers

Bisecting lists containing multi-value entries? Advice on approaching this task

I really need some advice on what data structure and functions to use to solve a task I'm trying to perform. I'm just not sure of the best approach here. The problem/task: I have a list of chromosomal start and end positions. I'm trying to figure…
user1995839
  • 737
  • 2
  • 8
  • 19
3
votes
2 answers

Does a bisect in version control benefit from using a rebaseif workflow?

The rebaseif mercurial extension automates the process, when pulling, of doing a rebase only if the merge can be done automatically with no conflicts.  (If there are conflicts to resolve manually, it does not rebase, leaving you ready to do a manual…
Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
3
votes
4 answers

git-bisect creating modified files

I ran into a strange issue when trying to use git-bisect to find a particular change in the jquery git repository: the bisect command seems to create modified files that prevent the bisect process from continuing. These are the commands I ran…
msridhar
  • 2,846
  • 4
  • 22
  • 23