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
-2
votes
3 answers

Minimum no of bracket reversals?

Given an expression with only ‘}’ and ‘{‘. The expression may not be balanced. Find the minimum number of bracket reversals to make the expression balanced …. python `` a=['}{}{}{}}}{{{{{}{}{}}{{}{}{}}{{}}{{'] for elem in a: sol=0 …
Lakshya
  • 1
  • 2
-2
votes
3 answers

get multiline data in parantheses without regex

I am trying to parse go metafiles in the format of following: require ( github.com/cheggaaa/pb v1.0.28 github.com/coreos/go-semver v0.2.0 // indirect github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect …
Lorem
  • 39
  • 1
  • 3
-2
votes
1 answer

Example of Square Brackets

I read this post Use of [square brackets] around JavaScript variables, but I din't really get the idea why to use. This is the code I'm trying to understand: let [translations] = await translate.translate(text, target); translations =…
Yuri Aps
  • 929
  • 8
  • 13
-2
votes
1 answer

Backgroundimg url not changing with javascript

window.onload = myFunction; function myFunction() { document.getElementById('banner').style.backgroundImage = "url (../img/Background2.jpg)"; //This function is to change the backgroundimg on launch } #banner { background-image:…
user10428319
-2
votes
3 answers

Why are square brackets displayed inconsistently when printing out a 3D array in numpy?

Follow with me for a second: a = np.zeros((4, 4, 3), 'int') for n in range(4): for m in range(4): a[n, m] = n + m Then we print(a.shape) and get (4, 4, 3) Finally, we print(a) [[[0 0 0] [1 1 1] [2 2 2] [3 3 3]] [[1 1 1] [2…
Monica Heddneck
  • 2,973
  • 10
  • 55
  • 89
-2
votes
2 answers

Bracket balancing algorithm doesn't detect imbalanced brackets

The code takes in any combination of brackets and checks if they are balanced or not. If they are balanced it should output success; if they aren't balanced it should output the index (starting at index 1) where the brackets are not…
-2
votes
2 answers

I have an array with an extra closing bracket. How do I remove it or prevent it from showing up?

Here is my code: function fix(arr) { var x = arr.pop(); var y = arr.splice(0, 1); arr.unshift(x); arr.push(y); return arr; } The output gives the array elements in the order I need. It has an extra ] at the end of the array which I can't figure out…
Artzelij
  • 1
  • 1
-2
votes
1 answer

How do I make my navigation bar lead to another page?

So I'm REALLY new to HTML and brackets, however I have a little navigation bar going. That's pretty much it. What I want to ask is, how do I make it so when I press one of the buttons in the bar, that button leads to another page? This is the…
Winu Petinu
  • 1
  • 1
  • 1
-2
votes
1 answer

Escaping curly brackets in ansible

I'm trying to replace {{ var }} in file and have no idea how to escape curly brackets. " {{ item.key }} " of course replaces item.key but ignores {{ }}. Variables to replace in my file look like this: define ( 'DB_HOST', '{{ DB_HOST }}' ); Part of…
Saus
  • 33
  • 5
-2
votes
1 answer

What does foo[] mean in $this->foo[] in php

Is foo[] an array? In the following code is an array element being assigned to foo[]? And is there an array key that is automatically associated with it? $this->foo[] = 'hello world';
Simon Suh
  • 10,599
  • 25
  • 86
  • 110
-2
votes
4 answers

Illegal start of type/expression (Bracket placement help?)

So I'm very new to java and I'm trying to write a program that will print a correct fine for overdue books. I've read multiple questions like this and most of them involve misplacement of curly brackets, but I cannot find a bracket error anywhere. I…
-2
votes
3 answers

How do you remove square brackets in python easily

I have a basic list EG : Test1 = [] then i used .append to add to it and fore EG it became: Test1 = ["hahaha", "lalalal", "mamama"] at the end i print out the list but of course the brackets are there i checked other posts like this and didn't…
matvey-tk
  • 641
  • 7
  • 18
-2
votes
3 answers

Java bracket issue

I think I am missing brackets somewhere but I have been searching for 3 hours and cannot find what is wrong, nor has googling helped me at all. I tried adding end braces/brackets to the if then statements but then I get a bunch of errors. Probably…
Martelmungo
  • 42
  • 1
  • 8
-2
votes
2 answers

groovy array remove the brackets

def colarray=[] def num def newRole = rolecol.split(',') def len = newRole.size() println "$newRole,$len" for (num = 0; num < len; num++) { …
Long Chen
  • 11
  • 5
-2
votes
3 answers

Trouble with my brackets

I am coding in Java and I have a final project due friday and I've done the whole thing but I can't fix my brackets at the end so the whole thing is messed up. Also for some reason the tag List won't work in my code. Please see below. I know they…