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
-1
votes
1 answer

element in R dataframe good practice

Accessing the ith element in the column bar in the dataframe foo in R can be done in two different ways: foo[i,"bar"] and foo$bar[i]. Is there any difference between them? If so, which one should be used in terms of efficiency, readability,…
ami232
  • 55
  • 8
-1
votes
3 answers

balanced bracket C++ not working, what am i doing wrong

#include #include using namespace std; main() { int i, j=0, perlen, countcp=0, countsp=0, countrp=0, countcl=0, countsl=0, countrl=0; string str, str1; cout<<"Please enter string"<
Dementor
  • 19
  • 1
  • 7
-1
votes
1 answer

Find a string between 1 or 2 sets of parenthesis

I'm looking for a way in VB to find a string between two characters, "(" and ")". For example, for the string... "THIS IS (ONE) AND THIS IS (TWO)" ....I would like for a variable to store the characters between the second set of parenthesis, e.g.…
-1
votes
1 answer

What does it mean to have 3 brackets after array?

I am curious as to what the args['fields'][$k]['order'] means. I am new to PHP and so far I know that args['fields'] would mean that the user is talking about the value for the key 'fields' in the array args. But what does it mean to have 3 brackets…
ggkid2002
  • 53
  • 1
  • 8
-1
votes
3 answers

Using a Passed Dot-Notated Parameter as Property Accessor within a Function

I'm fairly certain this is a simple mistake, but I'm confused as to why this won't work. I've been unable to find any documentation on using multiple brackets in a row when accessing properties. This is part of my code that creates a link that when…
RGStrat
  • 25
  • 7
-1
votes
2 answers

Remove everything after 1st opening bracket incl. the opening bracket - in a string - PHP

I am pulling location off an API. The variable $location sometimes contains: Paris New York (Manhattan) Paris is OK. I only want the city name. So, New York (Manhattan) should be New York. How do I remove everything after the 1st bracket (and…
Cody Raspien
  • 1,753
  • 5
  • 26
  • 51
-1
votes
3 answers

Organizing methods within classes in a simulation of a dice game

I had help writing this program as a simulation of a dice game, but I can't seem to get it to run because of the syntax/bracket situation. I think I am having trouble organizing my methods within the classes. Any tips? import…
-1
votes
2 answers

php - function()[] syntax

I have a strange syntax problem in php. At some point in my code, I do a mysql query (which only send back one line with one value), and I get the query result the following way : $myvar = mysql_fetch_assoc($result)["something"]; $result being the…
Nemhya
  • 1
  • 1
-1
votes
1 answer

Naming my initial class and bracket placements

Definitely not looking for anyone to do my homework, just having a little trouble understanding naming conventions in Eclipse as well as bracket placement. I'm still getting pretty tripped up by not knowing exactly what to name my (not sure what the…
antalt
  • 1
  • 3
-1
votes
1 answer

Trouble with regex in javascript; any content within brackets disappear

I am trying to parse a formula, and display it on screen. For example I should be able to take T Q, where T cannot change, and Q is a variable. It accepts it,however when printing it on screen again the only thing that will appear is T…
-1
votes
6 answers

Bracket Syntax Java

I am studying for an upcoming AP Computer Science Exam and I have a quick question on syntax within brackets. In the book I'm working through shows the open bracket to always be on the next line rather than being on the same line as the statement.…
-1
votes
2 answers

recursion in Python extra brackets

Not sure where i went wrong, but it gives me [-1, [-2, [-3, []]]] instead of just [-1,-2,-3] def search(list1,list2): if list2 == []: return list1 elif list2[0] == list1[0]: return [-list1[0] ,…
-1
votes
2 answers

Determining a string's structure

I have a program that displays square brackets, '[' and ']'. It displays them in random order and a random amount of times (up to 99). The code below is my current code, it displays things like the following each time you run the…
Baileyavfc
  • 47
  • 1
  • 9
-1
votes
1 answer

Loop to return next match number

I am trying to form a loop in returning the next match number in a tournament tree. I managed to do the upper bracket but the lower bracket I am having trouble. You can take a look at this pic to know exackly what I am looking…
Karim Ali
  • 61
  • 2
  • 10
-1
votes
2 answers

Brackets in the statement. How does it work?

I'm not Python developer, but I need to translate a script from that language into C#. So far so good, but... What does this statement do? I tried to look for it in the internet, but nothing found. self.bands = 5 self.ci = [0] * self.bands Could…
Nickon
  • 9,652
  • 12
  • 64
  • 119