Questions tagged [dollar-sign]

Anything related to the dollar symbol `$` and its special meanings in programming. The dollar symbol is often used in various programming languages as a special symbol for various purposes.

Anything related to the dollar symbol $ and its special meanings in programming. The dollar symbol is often used in various programming languages as a special symbol for various purposes.

For example, the dollar symbol has special meaning in:

  • most flavors of regular expressions
  • PHP language
  • R language
  • some Basic dialects
  • BASH shell language
  • assembly language
  • makefiles language
  • TCL language
  • etc.
199 questions
942
votes
4 answers

What are the special dollar sign shell variables?

In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ./myprogram &; echo $! will return the PID of the process which backgrounded myprogram. I know of others, such as $? which I think is the…
Z Douglas
  • 9,531
  • 3
  • 16
  • 9
174
votes
10 answers

Dynamically select data frame columns using $ and a character value

I have a vector of different column names and I want to be able to loop over each of them to extract that column from a data.frame. For example, consider the data set mtcars and some variable names stored in a character vector cols. When I try to…
Samuel Song
  • 2,075
  • 3
  • 18
  • 17
146
votes
2 answers

What are '$$' used for in PL/pgSQL

Being completely new to PL/pgSQL , what is the meaning of double dollar signs in this function: CREATE OR REPLACE FUNCTION check_phone_number(text) RETURNS boolean AS $$ BEGIN IF NOT $1 ~ e'^\\+\\d{3}\\ \\d{3} \\d{3} \\d{3}$' THEN RAISE…
vector
  • 7,334
  • 8
  • 52
  • 80
74
votes
5 answers

When/why to prefix variables with "$" when using jQuery?

Possible Duplicate: Why would a javascript variable start with a dollar sign? I see people using the dollar sign in front of variables when using jQuery. Is there any reason behind this? I'm I missing something basic or is it just a common…
elclanrs
  • 92,861
  • 21
  • 134
  • 171
68
votes
6 answers

$ Variable (Dollar Sign) in Chrome?

I was working with the developer tools of google chrome on a page without jQuery (or any other library that uses the $ sign as a shortcut). When I inspected $ by the console (by just typing it in and hitting enter), i got this: $ function () {…
Dennis
  • 14,210
  • 2
  • 34
  • 54
67
votes
2 answers

What does $ mean/do in Haskell?

When you are writing slightly more complex functions I notice that $ is used a lot but I don't have a clue what it does?
Eddie
  • 897
  • 2
  • 7
  • 12
63
votes
5 answers

What does the "$" character mean in Ruby?

Been playing with Ruby on Rails for awhile and decided to take a look through the actual source. Grabbed the repo from GitHub and started looking around. Came across some code that I am not sure what it does or what it references. I saw this code…
51
votes
4 answers

jQuery dollar sign ($) as function argument?

I understand JavaScript closures, and I've seen this done in native JS: (function () { // all JS code here })(); But, what does adding the jQuery spice do? (function ($) { // all JS code here })(jQuery);
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
44
votes
6 answers

Is there an inverse of the Haskell $ operator?

A quick question, is there an operator in Haskell that works like the dollar sign but gives precedence to the left hand side. I.E. instead of f (x 1) being written as f $ x 1 I'd like to write it as x 1 $ f This is purely a stylistic thing. I'm…
Benjamin Confino
  • 2,344
  • 3
  • 26
  • 30
41
votes
1 answer

What does the dollar prefix ($) mean in Vue.js?

What is the meaning of the dollar character/symbol prefix before property names in Vue.js? For example: this.$emit('clicked', 'demo')
cluster1
  • 4,968
  • 6
  • 32
  • 49
34
votes
2 answers

Why IntelliJ Idea doesn't recognize the dollar operator of JQuery?

IntelliJ shows a warning "Unresolved function or method $()" when mouse over the $ sign despite the file is in the same directory as js file. So I can't take advantage of intellisense when typing $ functions. Just one line of code and the IDE…
Ali Tor
  • 2,772
  • 2
  • 27
  • 58
32
votes
2 answers

Dollar Sign with Thousands Comma Tick Labels

Given the following bar chart: import numpy as np import matplotlib.pyplot as plt import pandas as pd df = pd.DataFrame({'A': ['A', 'B'], 'B': [1000,2000]}) fig, ax = plt.subplots(1, 1, figsize=(2, 2)) df.plot(kind='bar', x='A', y='B', …
Dance Party2
  • 7,214
  • 17
  • 59
  • 106
30
votes
3 answers

Dollar sign before a variable

I have this sample code to create a new data frame 'new_data' from the existing data frame 'my_data'. new_data = NULL n = 10 #this number correspond to the number of rows in my_data conditions = c("Bas_A", "Bas_T", "Oper_A", "Oper_T") # the vector…
this.is.not.a.nick
  • 2,631
  • 3
  • 21
  • 26
25
votes
4 answers

Using 'window', 'document' and 'undefined' as arguments in anonymous function that wraps a jQuery plugin

Honestly, I didn't know how to make the title shorter. I learnt how to write a jQuery plugin by studying the source of SlidesJS plugin. When I encountered something new, I just asked my good friend Google and most of the times, got a satisfactory…
Zia Ur Rehman
  • 1,141
  • 2
  • 11
  • 20
25
votes
3 answers

Four Dollar signs in Makefile

I am reading the document of GNU Make. Here is an example %.d: %.c @set -e; rm -f $@; \ $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ sed ’s,\($*\)\.o[ :]*,\1.o $@ : ,g’ < $@.$$$$ > $@; \ rm -f $@.$$$$ I tried this on a C++ program,…
Tim
  • 1
  • 141
  • 372
  • 590
1
2 3
13 14