Questions tagged [symbols]

can refer to a letter or special character; a primitive data type in many programming languages; an item of the alphabet of a formal language.

Symbol can refer to:

  • A letter or special character, e.g. '@'. Questions about character processing or dealing with specific characters can be tagged with this tag.
  • A primitive data type in many programming languages (Lisp, Prolog, Ruby, Smalltalk etc.)
  • An item of the alphabet of a formal language.
3495 questions
61
votes
12 answers

How to convert characters to HTML entities using plain JavaScript

I have the following: var text = "Übergroße Äpfel mit Würmern"; I'm searching for a Javascript function to transform the text so that every special letter is represented by its HTML entity sequence like this: var newText =…
Chris
  • 15,429
  • 19
  • 72
  • 74
57
votes
7 answers

Cannot find symbol assertEquals

I'm trying to write my first unit tests for a calculator, but NetBeans says it can't find the symbol assertEquals and annotation @Test. Should i include something? I'm using NetBeans 7.3.1 and W7. package calculator; import…
Giome Pool Guy
  • 607
  • 1
  • 6
  • 8
55
votes
5 answers

In Ruby what does "=>" mean and how does it work?

While learning Ruby I've come across the "=>" operator on occasion. Usually I see it in the form of :symbol => value and it seems to be used frequently when passing values to functions. What exactly is that operator called? What does it do/mean?…
Dustin Martin
  • 1,297
  • 2
  • 12
  • 22
52
votes
1 answer

What does the compile-time error "Undefined symbols for architecture x86_64" mean?

I'm trying to program a graph class using an adjacent list from an example in my C++ text book, and when I compile using this command: Code: g++ -o prog program.cpp ...I get the following error: Undefined symbols for architecture x86_64: "_main",…
gravity black
  • 646
  • 1
  • 5
  • 12
52
votes
1 answer

Android set degree symbol to Textview

How can I set the degree symbol to a TextView in Android?
narancs
  • 5,234
  • 4
  • 41
  • 60
52
votes
3 answers

Symbol hiding in static libraries built with Xcode

I'm trying to figure out whether I can build a static library that hides all of its internal objects and functions, etc, except for the interfaces I want to export. I'm experimenting with Xcode (gcc 4.2). I've used the…
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
50
votes
5 answers

What is the meaning of + in a regex?

What does the plus symbol in regex mean?
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
48
votes
4 answers

Symbol to string issue

Following code fails world = :world result = 'hello' + world puts result #=> can't convert Symbol into String Following code works world = :world result = "hello #{world}" puts result #=> hello world Why? Using ruby 1.8.7
Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106
45
votes
4 answers

What does the => symbol mean in Haskell?

I'm new to Haskell and, in general, to functional programming, and I'm a bit uncomfortable with its syntax. In the following code what does the => denote? And also (Num a, Ord a)? loop :: (Num a, Ord a) => a -> (t -> t) -> t -> t
n00b
  • 901
  • 1
  • 9
  • 20
43
votes
2 answers

How to merge two columns in R with a specific symbol?

I have a table read in R as follows: column1 column2 A B What is the command to be used to match two columns together as follows? Column 3 A_B
Catherine
  • 5,345
  • 11
  • 30
  • 28
43
votes
3 answers

Why is this string key in a hash converted to a symbol?

Using Ruby 2.3: In example 1, the string key "a" is automatically converted to a symbol, whereas with example 2, it stays a string. Example 1 {"a": 1} # => {:a=>1} Example 2 {"a"=>"c"} # => {"a"=>"c"} I thought : was the same as the old style…
Nona
  • 5,302
  • 7
  • 41
  • 79
42
votes
4 answers

How to create Hash with string keys by default

When I do the following: h = { "a": 123 } Ruby converts the key to a symbol automatically. h[:a] # => 123 h["a"] # => nil How can I prevent this behaviour? I created the hash with a string key, and would like to keep it that way without always…
Joerg
  • 3,553
  • 4
  • 32
  • 41
42
votes
4 answers

Inserting a degree symbol into python plot

This is a really simple problem but its escaping me. I'm just trying to insert a degree symbol into the titles and legends of my python plot. Code is below. Thanks. from numpy import * import numpy as np import matplotlib.pyplot as plt theta1 =…
user2739143
  • 591
  • 2
  • 8
  • 13
41
votes
3 answers

Microsoft equivalent of the nm command

I've long used cygwin's nm command for all my .lib symbol debugging needs, but recently I thought about referring to it in a SO answer and realized that most Windows developers don't have cygwin installed. So what is the Microsoft equivalent to nm,…
David Norman
  • 19,396
  • 12
  • 64
  • 54
40
votes
3 answers

What is bang dollar (!$) in Bash?

Bang dollar seems to refer to the last part of the last command line. E.g. $ ls -l .... something $ !$ -l bash: -l command not found I can find plenty on the dollar variables (e.g. $!) but not on this. Any explanation?
Snowcrash
  • 80,579
  • 89
  • 266
  • 376