Questions tagged [selection]

The selection can refer to text that has been highlighted, or it can refer to a choice made in UI elements that require one, e.g. a particular option in an HTML `select`. Selection is also the stage of a genetic algorithm in which individual genomes are chosen from a population for later breeding.

The selection can refer to:

  • a range of text that has been highlighted, a feature intended to mark the text for copying and, in editable areas, pasting over.

  • a choice made in UI elements that require one, e.g. a particular option in an HTML select. In UI elements, the selection is often made by means of drop-down boxes, radio buttons, checkboxes, file choosers, and more. Selections can be made with the mouse by clicking and dragging over the desired text, or by holding down the Shift key while navigating the text with the arrow keys. Selections are not usually permanent marks, and can often be removed just by clicking or selecting elsewhere.

  • the stage in genetic algorithms / programming is in which individual genomes are chosen from a population for later breeding (recombination or crossover).

4031 questions
67
votes
8 answers

WPF ListView Inactive Selection Color

I'm creating a WPF application where several ListView selections are made in a row (similar to the iTunes browser). The problem is that the default inactive selection color is too light. (see below) How can I change this color so my inactive…
Joseph Sturtevant
  • 13,194
  • 12
  • 76
  • 90
65
votes
2 answers

Understanding "median of medians" algorithm

I want to understand "median of medians" algorithm on the following example: We have 45 distinct numbers divided into 9 group with 5 elements each. 48 43 38 33 28 23 18 13 8 49 44 39 34 29 24 19 14 9 50 45 40 35 30 25 20 15 10 51 46 41 36 31 26…
simon
  • 1,405
  • 1
  • 15
  • 24
63
votes
4 answers

Select range of lines in Notepad++

Is there a way to select range of lines in Notepad++? I would like to write two numbers - from and to, say: from 10000 to 25000. I've got this large MySQL dump file and I can select it only by using some function.
David
  • 1,932
  • 3
  • 27
  • 35
62
votes
3 answers

Multiple selections in VIM

Is it possible to select multiple non-consecutive lines (or sections) in VIM's visual mode? If so, how?
Marcin
  • 12,245
  • 9
  • 42
  • 49
58
votes
3 answers

WPF - How to combine DataTrigger and Trigger?

NOTE I have asked the related question: How to combine DataTrigger and EventTrigger? I have a list box containing several items. The item's class implements INotifyPropertyChanged and has a property IsAvailable. I use that property to indicate…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
58
votes
13 answers

Disable selecting in WPF DataGrid

How can I disable selecting in a WPFTooklit's DataGrid? I tried modifying the solution that works for ListView (from WPF ListView turn off selection), but that doesn't work:
svick
  • 236,525
  • 50
  • 385
  • 514
57
votes
8 answers

How To Wrap / Surround Highlighted Text With An Element

I want to wrap a selected text in a div container with span, is it possible? A user will select a text and will click a button, on button click event I want to wrap that selected text with span element. I can get the selected text using…
coure2011
  • 40,286
  • 83
  • 216
  • 349
57
votes
3 answers

Getting selected text position

Currently I'm getting the selected text in the browser doing this: window.getSelection(); Now I need to show a tooltip above that text when pressing a custom key(note that the mouse could not be over the text anymore), so in order to do that I need…
Ecarrion
  • 4,940
  • 1
  • 33
  • 44
57
votes
9 answers

android: smoothScrollToPosition() not working correctly

I'm trying to smoothly scroll to last element of a list after adding an element to the arrayadapter associated with the listview. The problem is that it just scrolls to a random position arrayadapter.add(item); //DOES NOT WORK…
55
votes
14 answers

UITableViewCell Selected Background Color on Multiple Selection

// Doesn't work cell.selectionStyle = .Blue //Works when the selection is not multiple, if it's multiple with each selection the previous one disappear... let cellBGView = UIView() cellBGView.backgroundColor = UIColor(red: 0, green: 0, blue: 200,…
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
53
votes
3 answers

How to copy/select a whole file or buffer in Emacs?

Is there any command to select the whole file contents in Emacs? For example, Control+a selects whole contents of a file in Notepad, Notepad++, etc. I can select whole contents using the mouse, but it's inconvenient for large files. I found the…
Sajib Mahmood
  • 3,382
  • 3
  • 37
  • 50
52
votes
8 answers

Select subset of characters in many lines (column selection) in Eclipse/Android Studio

How to select subset of characters in many lines (column selection) in Eclipse/Android Studio? Ideally without plugins. Shift+Alt+A seems not to be working for me either. In Notepad++ you can do it with Shift+Alt+(Arrows) or Alt+Left_Mouse (and drag…
Wojciech Jakubas
  • 1,499
  • 1
  • 15
  • 22
51
votes
5 answers

Selection with .loc in python

I saw this code in someone's iPython notebook, and I'm very confused as to how this code works. As far as I understood, pd.loc[] is used as a location based indexer where the format is: df.loc[index,column_name] However, in this case, the first…
bugsyb
  • 5,662
  • 7
  • 31
  • 47
50
votes
5 answers

Why is the runtime of the selection algorithm O(n)?

According to Wikipedia, partition-based selection algorithms such as quickselect have runtime of O(n), but I am not convinced by it. Can anyone explain why it is O(n)? In the normal quick-sort, the runtime is O(n log n). Every time we partition the…
user926958
  • 9,355
  • 7
  • 28
  • 33
46
votes
9 answers

Select2 deselect all values

I want to deselect all values with one click without using each id seperately. I fiddled around for a while, but this deselect only first value. Any suggestions? This is how I try to deselect: $( "#mybutton" ).click(function() { …
Jaanus
  • 16,161
  • 49
  • 147
  • 202