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
177
votes
17 answers

Multiple select in Visual Studio?

Is there a way to select multiple non-adjoining (totally separate) texts in VS? I can do it in MS Word by selecting the texts separately by holding the Ctrl button, like this: My version is 11. Edit: I'm not talking about Alt+Select block…
nawfal
  • 70,104
  • 56
  • 326
  • 368
174
votes
2 answers

XPath: select text node

Having the following XML: Text1text2 How do I select either the first or the second text node via XPath? Something like this: /node/text()[2] of course doesn't work because it's the merged result of every text inside the…
kernel
  • 3,654
  • 3
  • 25
  • 33
172
votes
11 answers

How to select all columns whose names start with X in a pandas DataFrame

I have a DataFrame: import pandas as pd import numpy as np df = pd.DataFrame({'foo.aa': [1, 2.1, np.nan, 4.7, 5.6, 6.8], 'foo.fighters': [0, 1, np.nan, 0, 0, 0], 'foo.bars': [0, 0, 0, 0, 0, 1], …
ccsv
  • 8,188
  • 12
  • 53
  • 97
170
votes
20 answers

Android RecyclerView addition & removal of items

I have a RecyclerView with an TextView text box and a cross button ImageView. I have a button outside of the recyclerview that makes the cross button ImageView visible / gone. I'm looking to remove an item from the recylerview, when that items cross…
150
votes
6 answers

Programmatically select text in a contenteditable HTML element?

In JavaScript, it's possible to programmatically select text in an input or textarea element. You can focus an input with ipt.focus(), and then select its contents with ipt.select(). You can even select a specific range with…
callum
  • 34,206
  • 35
  • 106
  • 163
133
votes
6 answers

jQuery - select all text from a textarea

How can I make it so when you click inside a textarea, its entire content gets selected? And eventually when you click again, to deselect it.
Alex
  • 66,732
  • 177
  • 439
  • 641
131
votes
5 answers

Is there a function to deselect all text using JavaScript?

Is there a function in javascript to just deselect all selected text? I figure it's got to be a simple global function like document.body.deselectAll(); or something.
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
99
votes
8 answers

How can I select or highlight a block in Emacs?

I want to select or highlight a block in Emacs without using the mouse, but doing it from the keyboard like Vim's visual mode. What is the easiest way to do this from a keyboard?
systemsfault
  • 15,207
  • 12
  • 59
  • 66
92
votes
5 answers

Is there a shortcut for selecting word under cursor in Sublime Text, Atom

Is there a shortcut or a command to select word under cursor in Sublime Text or Atom? I want a replacement for double-click. So I could press shortcut instead and get selection on a current word and start typing to replace it or get in quotes etc...
firedev
  • 20,898
  • 20
  • 64
  • 94
91
votes
5 answers

Prevent selection in HTML

I have a div on a HTML page and whenever I press the mouse and move it, it will show that "can't drop" cursor like it selects something. Is there a way to disable selection? I tried CSS user-select with none without success.
Tower
  • 98,741
  • 129
  • 357
  • 507
87
votes
10 answers

Custom UITableViewCell selection style?

When I click on my UITableViewCell, the background part (the areas that my background image doesn't cover) turns blue when I click on the cell. Also, all of the UILabels on the cell turn to white when it is clicked which is what I want. However what…
SimplyKiwi
  • 12,376
  • 22
  • 105
  • 191
85
votes
12 answers

JavaScript eyedropper (tell color of pixel under mouse cursor)

I am looking for an "eyedropper" tool, that gives me the hex value of the pixel the mouse cursor is under, in JavaScript for a CMS. For Firefox, there is the excellent ColorZilla extension that does exactly that. However, it's FF only of course, and…
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
81
votes
7 answers

How to select an item in a ListView programmatically?

I'm trying to select the first item in a ListView programmatically, but it doesn't appear to have been selected. I am using the following code: if (listView1.Items.Count > 0) listView1.Items[0].Selected = true; Actually I've had this problem…
Homam
  • 23,263
  • 32
  • 111
  • 187
80
votes
8 answers

How can I save a text block in visual mode to a file in Vim?

The title is very descriptive. Just in case, I will give an example: START BLOCK1 something END BLOCK1 START BLOCK2 something somenthing... END BLOCK2 I select the BLOCK1 in visual mode I yank it by pressing y How can I save the yanked BLOCK1 to…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
76
votes
8 answers

manual language selection in an iOS-App (iPhone and iPad)

My question: How can my iPhone-app tell the iOS, that the user did select a language in the apps preferences, that is different from the language set in the general settings? Other formulation of the same question: How can i tell the system, that…
Hubert Schölnast
  • 8,341
  • 9
  • 39
  • 76
1
2 3
99 100