Questions tagged [brackets]

Brackets are tall punctuation marks used in matched pairs within text, to set apart or interject other text. They have a variety of meanings in different programming languages. DO NOT USE THIS for the IDE, use [adobe-brackets] instead.

Brackets are tall punctuation marks used in matched pairs within text, to set apart or interject other text. They have a variety of meanings in different programming languages.

1033 questions
29
votes
1 answer

What is the difference between [ ] and ( ) brackets in Racket (lisp programming language)?

It seems to me that technically both are interchangeable but have different conventional meanings.
Mahathi Vempati
  • 1,238
  • 1
  • 12
  • 33
28
votes
11 answers

Tournament bracket placement algorithm

Given a list of opponent seeds (for example seeds 1 to 16), I'm trying to write an algorithm that will result in the top seed playing the lowest seed in that round, the 2nd seed playing the 2nd-lowest seed, etc. Grouping 1 and 16, 2 and 15, etc.…
glen-84
  • 1,778
  • 2
  • 18
  • 30
27
votes
1 answer

Meaning of double bracket "[[foo()]] type name;" syntax in c++?

In this article about avoiding False Sharing, the following code snipped for alignment is presented: // C++ (using C++0x alignment syntax) template struct cache_line_storage { [[ align(CACHE_LINE_SIZE) ]] T data; char pad[…
JMC
  • 1,723
  • 1
  • 11
  • 20
27
votes
3 answers

IntelliJ IDEA braces, brackets and quotes customize color highlighting

How to change color of brackets when they are selected ?
Anton Dozortsev
  • 4,782
  • 5
  • 34
  • 69
26
votes
4 answers

Disable Highlight Matched Parentheses in ViM : "let loaded_matchparen = 1" not working

How to disable auto highlighting of Matched Parentheses (cursor briefly jumping to the matched bracket, when a new bracket is inserted) in ViM? When I faced this issue in my earlier company, then I was able to resolve it by adding below line to my…
BluVio
  • 449
  • 1
  • 5
  • 11
25
votes
2 answers

int([x[, base]]). Square brackets in functions in Python documentation?

What is the meaning of the square brackets inside the round brackets of a function in the Python documentation? E.g.: help([object]) or int([x[, base]])
Bentley4
  • 10,678
  • 25
  • 83
  • 134
20
votes
2 answers

Eclipse - how to go to matching bracket?

How to go to matching bracket in Eclipse IDE (in Text, Java or JavaScript)? (match opening and closing brackets) I naturally tried Ctrl+}, but it is not there.
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
20
votes
3 answers

Is there a way for NetBeans to automatically create brackets in a separate line?

When I create a new class for instance, I get this: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package helloworld; /** * * @author Sergio */ public class WordManipulations{ } I…
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
19
votes
1 answer

Prettier forces curlyless, single-line if-statement to be on the same line instead for below

After reading the docs for EsLint, I'm using the rule curly set to warning for multiple or nested rows of statements at conditionals. "rules": { "curly":["warn", "multi-or-nest"], "quotes":"warn" } It works as expected but when the code is to…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
18
votes
4 answers

Mismatched parentheses: a quick way to find them?

I just rearranged a very large JavaScript file. I now get "Unexpected end of input." Somewhere in those hundred of functions, one has lost (or gained) a bracket. What's the quickest way to find it?
Chris Tolworthy
  • 2,066
  • 4
  • 20
  • 24
18
votes
4 answers

issue with brackets in jQuery Form Data when sending data as json

I have the object var dataformdata={"key1":"value1","key2":"value2"}; then I add some more values with the same key(key3) like this dataformdata.key3 = []; dataformdata.key3.push("value3"); dataformdata.key3.push("value4"); I do…
Björn
  • 12,587
  • 12
  • 51
  • 70
18
votes
8 answers

how to remove brackets character in string (java)

I want to remove all type of brackets character (example: [],(),{}) in string by using java. I tried using this code: String test = "watching tv (at home)"; test = test.replaceAll("(",""); test = test.replaceAll(")",""); But it's not working, help…
18
votes
6 answers

How do i replace [] brackets using SED

I have a string that i am want to remove punctuation from. I started with sed 's/[[:punct:]]/ /g' But i had problems on HP-UX not liking that all the time, and some times i would get a 0 and anything after a $ in my string would dissappear. So i…
nitrobass24
  • 371
  • 2
  • 8
  • 21
16
votes
2 answers

double square brackets side by side in python

I'm completely new at Python and have an assignment coming up. The professor has asked that we look at examples of users coding Pascal's Triangle in Python for something that will be 'similar'. I managed to find several ways to code it but I found…
Syrum
  • 163
  • 1
  • 1
  • 5
16
votes
3 answers

[: missing `]' in bash script

So I'm writing a bash shell script, and my first few lines looks like this: if ! [ $# -eq 0 || $# -eq 1 ]; then echo -e "Usage: myScriptName [\e[3mdir\e[0m] [\e[3m-f file\e[0m]" exit 1 fi But when I run it, it says "[: missing `]'". I don't…
Majora320
  • 1,321
  • 1
  • 13
  • 33
1
2
3
68 69