brackets

'Bracket initializing'. (C++)

I'm learning C++ at the moment, C++ Primer plus. But I just felt like checking out the cplusplus website and skip a little forward to file handling. I pretty much know the basics of file handling coming from java, php, visual basic. But I came across a pretty weird line. ostream os(&fb); fb represents a filebuf. I just don't get the ...

Remove all nested blocks, whilst leaving non-nested blocks alone via python

Source: [This] is some text with [some [blocks that are nested [in a [variety] of ways]]] Resultant text: [This] is some text with I don't think you can do a regex for this, from looking at the threads at stack overflow. Is there a simple way to to do this -> or must one reach for pyparsing (or other parsing library)? ...

Bash syntax question: variable in brackets {} with # comments?

I just saw some code in bash that I didn't quite understand. Being the newbie bash scripter, I'm not sure what's going on. echo ${0##/*} echo ${0} I don't really see a difference in output in these two commands (prints the script name). Is that # just a comment? and what's with the /*. If it is a comment, how come it doesn't int...

Is there a way for NetBeans to automatically create brackets in a seperate line? [details inside]

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 hate it when brackets are placed this way. Is there a way to make it create things like t...

Remove Text Between Parentheses PHP

Hi, I'm just wondering how I could remove the text between a set of parentheses and the parentheses themselves in php. Example : ABC (Test1) I would like it to delete (Test1) and only leave ABC Thanks ...

Modelling tournament brackets in MongoDB

I've been experimenting with MongoDB in order to move some parts of an app to it. I'm thinking a document-based db like mongodb would be a nice fit for tournament brackets but I'm having sort of a hard time coming up with a suitable model. (still trying to break free from RDBMS dogma) Anyone have any ideas for a good way to model Single...

What is this JavaScript construct: " = [y for each ...]"

myColl.y = [y for each (y in myColl.y) if (y != myThing.getY())]; I understand what this is doing, returning all the 'y' items that are not the current one... But, what is the concept called here with the brackets? I would like to read up on what this is , syntax, etc. ...

How to make Visual Studio to automatically include curly brackets in C# code?

After namespace, class, struct, enum, for, foreach, while, switch, do, using, unchecked and at the beginning of methods, shouldn't Visual Studio automatically include curly brackets? How to activate this feature? ...

How do I match a quoted string followed by a string in curly brackets?

I need a regex expression for matching a string in quotes and then a white space then a round bracket then a curly bracket. For example this is the text I want to match in Java: "'Allo 'Allo!" (1982) {A Barrel Full of Airmen (#7.7)} What would the regex for this be? Sorry, but I'm just really lost. I tried a lot of different things b...

Readability and IF-block brackets: best practice

I am preparing a short tutorial for level 1 uni students learning JavaScript basics. The task is to validate a phone number. The number must not contain non-digits and must be 14 digits long or less. The following code excerpt is what I came up with and I would like to make it as readable as possible. if ( //set of rules for invalid...

How to match parameter names in an expression?

Hi, I have a set of expressions representing some formula with some parameters inside. Like: [parameter1] * [parameter2] * [multiplier] And many others like this. I want to use a regular expression so that I can get a list of strings (List<string>) which will have the following inside: [paramter1] [paramter2] [multiplier] I am n...

VS2008: Is there a way to enable bracket matching for javascript?

The bracket matching in VS2008 is a handy feature, but doesn't seem to work for javascript code. Is there a way to enable it? ...

Phone number transformation. Separate prefix in brackets.

There is an element: <phone>(987) 123-45-67</phone>. It is necessary to transform it in: <span><small>(987)</small>&#160;123-45-67</span>. How it can be made? ...

php curly braces into array

Hi, I would like to check a opened .txt file for braces that open and close like below: file { nextopen { //content } } no this is not my own language or anything, but I want to get say the nextopen function and all the contents inside the brackets, and all the stuff from inside the file function and add it to an array if you know w...

Finding and replacing content between brackets with jQuery

I have a requirement to place text between brackets using jQuery; the content will be updated once an action occurs e.g. search. The structure is: - <h2>Placeholder Text Placeholder Text Placeholder Text ()</h2> ...

awk - brackets checking

hi, i'm looking for script in awk which will check if it has proper bracket placing. used brackets are {} [] and () every bracket should be closed, and brackets can't be mixed, illegal example: ( [ ) ] ...

how do I fix bracket matching on Netbeans + Javascript?

I've been using Netbeans for a while as my PHP editor, I have some pages with javascript and the bracket matching is really bad: (bracket is highlighted in blue but it can't find it's match) as shown below: http://i40.tinypic.com/119c8wz.png http://i43.tinypic.com/pr9r7.png thanks :) ...

CSS Brace Styles

I'm unable to figure how the standard (or just popular) brace style names apply to CSS. Here're all the brace styles: /* one - pico? */ selector { property: value; property: value; } /* two - pico extra */ selector { property: value; /* Start Properties on Newline */ property: value; } /* three - horstmann? */ sel...

what is [] brackets in .net ?

Hello i have seen [] such brackets in c# very very rarely but when i start to learn asp.net i have seen them many times but still i couldn't understand what they does ? They are not part of code as using for arrays.For example [webmethods] which is just over the methods or there are some over classes. Are they part of .net or they are...

Python regex confused by brackets ([])?

Is python confused, or is the programmer? I've got a lot of lines of this: some_dict[0x2a] = blah some_dict[0xab] = blah, blah What I'd like to do is to convert the hex codes into all uppercase to look like this: some_dict[0x2A] = blah some_dict[0xAB] = blah, blah So I decided to call in the regular expressions. Normally, I'd jus...