Questions tagged [ampersand]

An ampersand (or epershand; "&") is a logogram representing the conjunction word "and". This symbol is a ligature of the letters in et, Latin for "and".

The word ampersand is a conflation of the phrase "and per se and", meaning "and [the symbol which] by itself [is] and".

445 questions
597
votes
10 answers

How do I escape ampersands in XML so they are rendered as entities in HTML?

I have some XML text that I wish to render in an HTML page. This text contains an ampersand, which I want to render in its entity representation: &. How do I escape this ampersand in the source XML? I tried &, but this is decoded as the…
AJM
  • 32,054
  • 48
  • 155
  • 243
186
votes
8 answers

'and' (boolean) vs '&' (bitwise) - Why difference in behavior with lists vs numpy arrays?

What explains the difference in behavior of boolean and bitwise operations on lists vs NumPy arrays? I'm confused about the appropriate use of & vs and in Python, illustrated in the following examples. mylist1 = [True, True, True, False, …
rysqui
  • 2,779
  • 2
  • 19
  • 26
180
votes
2 answers

What does the ampersand (&) mean in a TypeScript type definition?

On line 60359 of this type definition file, there is the following declaration: type ActivatedEventHandler = ( ev: Windows.ApplicationModel.Activation.IActivatedEventArgs & WinRTEvent ) => void; What does the & sigil mean in this…
Carl Patenaude Poulin
  • 6,238
  • 5
  • 24
  • 46
175
votes
8 answers

How do I escape ampersands in batch files?

How do I escape ampersands in a batch file (or from the Windows command line) in order to use the start command to open web pages with ampersands in the URL? Double quotes will not work with start; this starts a new command-line window…
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
79
votes
3 answers

how does the ampersand(&) sign work in c++?

Possible Duplicate: What are the differences between pointer variable and reference variable in C++? This is confusing me: class CDummy { public: int isitme (CDummy& param); }; int CDummy::isitme (CDummy& param) { if (¶m == this) { …
infinitloop
  • 2,863
  • 7
  • 38
  • 55
75
votes
5 answers

What does an ampersand (&) mean in the Swift language?

I know about the ampersand as a bit operation but sometimes I see it in front of variable names. What does putting an & in front of variables do?
applejuiceteaching
  • 1,473
  • 3
  • 13
  • 25
41
votes
6 answers

Python a &= b meaning?

What does the &= operator mean in Python, and can you give me a working example? I am trying to understand the __iand__ operator. I just don't know what &= means and have looked online but couldn't find it.
Aaron Lelevier
  • 19,850
  • 11
  • 76
  • 111
30
votes
1 answer

Unable to get ampersand (&) to display in a Delphi TActionMainMenuBar

I am in need of help trying to get the ampersand character to show up in a Delphi XE6 VCL TActionMainMenuBar. I have come across similar requests on Stack Overflow but none that directly address the problem I am having. When creating an action in…
CKilpatrick
  • 313
  • 2
  • 8
28
votes
5 answers

C++ member function overloading with & (ampersand)

How to pick the correct error() member function? Do I need to cast somehow? using namespace std; struct test { int error(); void error(int x); int fun(); }; int main() { auto f1 = &test::error; // how to pick the correct function? …
24
votes
2 answers

Prevent Rails from encoding the ampersands in a URL when outputting JSON

I have the following code: render json: { image: image } Image has an attribute "url". Let's say it's: https://blah.com/a?A=B&C=D When rendering, this is what I get: {"image":{"url":"https://blah.com/a?A=B\u0026C=D"}} The ampersand is getting…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
20
votes
3 answers

Does & need to be & in the meta description?

I'm inserting content which has the & sign. I would like to know if it's needed to insert it as & so this sign is read correctly. Like this: Or like this:
Daniel Ramirez-Escudero
  • 3,877
  • 13
  • 43
  • 80
19
votes
2 answers

Java String Replace '&' with & but not & to &

I have a large String in which I have & characters used available in following patterns - A&B A & B A& B A &B A&B A & B A& B A &B I want to replace all the occurrences of & character to & While replacing this, I also need to…
sribasu
  • 680
  • 2
  • 6
  • 24
19
votes
4 answers

How to replace a character within a matched pattern using ampersand (&)

When we match a pattern using sed, the matched pattern is stored in the "ampersand" (&) variable. IS there a way to replace a character in this matched pattern using the ampersand itself ? For example, if & contains the string "apple1", how can I…
user1418321
  • 1,191
  • 2
  • 9
  • 6
18
votes
2 answers

What is the purpose of `&` before the loop variable?

What is the purpose of & in the code &i in list? If I remove the &, it produces an error in largest = i, since they have mismatched types (where i is &32 and i is i32). But how does &i convert i into i32? fn largest(list: &[i32]) -> i32 { …
Muhammad Naufil
  • 2,420
  • 2
  • 17
  • 48
15
votes
3 answers

Running bash script does not return to terminal when using ampersand (&) to run a subprocess in the background

I have a script (lets call it parent.sh) that makes 2 calls to a second script (child.sh) that runs a java process. The child.sh scripts are run in the background by placing an & at the end of the line in parent.sh. However, when i run parent.sh, i…
theGuardian
  • 439
  • 2
  • 6
  • 17
1
2 3
29 30