Questions tagged [square-bracket]

The symbols "[" and "]", commonly used in programming languages. Please use this tag only if the specific usage of these symbols is a relevant part of the question.

Overview

The square brackets "[" and "]" are special cases of brackets, along with parentheses and curly brackets (or braces) ("{", "}").

Uses

Square brackets have many uses in most programming languages, such as:

279 questions
0
votes
1 answer

How match with pattern and "like" operator escaping sware brackets ([]) in .net

This method returns true when it shouldn't pattern = "*[cryptservice@inbox.ru]*" file = "test.pdf" If file Like pattern Then MsgBox("like method, file: " & file) End If for every file i put into the var file, i get true in this…
0
votes
1 answer

reformatting dates with square brackets

When transferring my XML-files to TeX I try to reformat dates – my publisher said I had to use a smaller horizontal space between dates – and can't manage to go beyond the first step. My input file is this January 1900 2. 2.…
martinanton
  • 217
  • 1
  • 7
0
votes
2 answers

Check if URL contains text and brackets

I want to check my current URL, for example: http://www.dummy.com/subpageone/pagetwo.html?ineedthis[andthis]&butnotthis I want an alert if I got exactly ineedthis[andthis] So far I got if (window.location.href.indexOf("ineedthis") > -1) { …
TZP
  • 53
  • 5
0
votes
1 answer

Theano function not working on a simple, 4-value array

I was working through the theano documentation/tutorial, and the very first example was this: >>> import numpy >>> import theano.tensor as T >>> from theano import function >>> x = T.dscalar('x') >>> y = T.dscalar('y') >>> z = x + y >>> f =…
Rich
  • 1,103
  • 1
  • 15
  • 36
0
votes
1 answer

rewriting multiple columns based on different columns

I have a bit of a problem with my code, I solved it, but now i kind of want to find a more efficient way of doing so, since I'm positive there is one. I have a data of 120K people, with 262 variables, and I need to update some columns in the data…
abe05254
  • 13
  • 5
0
votes
0 answers

Confused by accessing the object property with dot or square brackets

Going through some online resource I've came across these examples: In this case this properties can be accessed via this.property method and this['property'], but can't be accesed using this[property] function showFullName() { alert(…
Adrian
  • 273
  • 2
  • 13
0
votes
2 answers

Overloading multi-dimensional brackets

How can I overload multi-dimensional brackets? Let's say that I have a class which enables me to access points in an n-vector space. For example: class NSpaceVector { private: int vectorSpace[8][8][8][8][8][8][8]; public: …
kmiklas
  • 13,085
  • 22
  • 67
  • 103
0
votes
2 answers

Javascript can't find strings containing square brackets

I'm using this function that helps my webdevelopers to find a piece of code in a webpage: function findString (str) { var strFound; strFound=self.find(str); if (strFound && self.getSelection && !self.getSelection().anchorNode ){ …
Zakaria
  • 14,892
  • 22
  • 84
  • 125
0
votes
1 answer

Swift: Variable of Optional Dictionary inside Class: Shows Brackets in Output

I would like to make an Optional Dictionary Variable inside of a Class so that when I create an instance I don't HAVE to add that argument... example class Stuff { var dictionary: [String: Double]? init(dictionary:…
0
votes
3 answers

RegEx for square brackets' string but not vector's index, it's possible?

I'm using Habour in Sublime Text 3. How can I create a regex for square brackets string like below: a:= [text] // same as a:= "text" b:= [3] // same as b:= "3" c:= {2,[text]} // same as c:= {2,"text"} d:=[text] // same as d:="text" Funtion([text])…
0
votes
3 answers

Python Parsing with a Variable Name and Square Brackets

I have a file named item.dat containing bracketed keywords: [ITEM1] banana peach apple orange grapes [END] [ITEM3] tennis bowling [END] ........ I want to the lines between the bracketed keywords to be processed. The variable wil contain the…
et_phonehome
  • 137
  • 12
0
votes
1 answer

powershell square brackets meaning

I'm transforming a script, but I not sure what the following means: $valueData = (Get-ItemProperty $key).digitalproductid[52..66] Is $valueData storing the values from 52 to 66, or is it storing the the 52th through the 66th value? The long…
Ezeq
  • 11
  • 8
0
votes
1 answer

VBA UserForm: Filter Name with square Bracket

I have problem when searching with square bracket to seach name: for example Peter[Jones] (combobox1). It coundn't find that name? How to fix this problem? Anyone can help or suggest Dim a, LngIndex As Long Dim ytCrit, mtCrit, dtCrit As Long Dim…
0
votes
3 answers

Match and capture the (capital) letters inside the square brackets

I'm fairly new to regex and I'd like to know the pattern to match and capture the letters inside the square brackets. For example, I'd like to capture DATA from the string below. My sample code's as below: var myString = "testing/node/234 test_TEST…
J.Jay
  • 249
  • 1
  • 4
  • 18
0
votes
2 answers

C++ Upper Triangular Matrix Bracket Operator

I've hit a road block with a certain project of mine. I want to create an Upper Triangle Matrix (all elements below the diagonal are zero) that allocates only the memory necessary to hold the nonzero elements. The problem that I'm having is indexing…