Search Results

Search found 237 results on 10 pages for 'braces'.

Page 2/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • noweb dpp filter and latex not printing curly braces

    - by Dervin Thunk
    Hello. Well, this smells like a tumbleweed, but I will ask it anyway. Suppose you have a noweb file with some c# code. You also have the c++ pretty-print filter dpp. If you run the command noweave -filter ./dpp -x test.nw > csharp.tex on the file below, it will print everything except for the curly braces. Instead of them, I get an em-dash and a closing quotations marks (i.e. ?) in the dvi. The tex source looks fine... Any ideas? @ C\# test file <<test.c>>= while( (a[right] >= pivot) && (left < right) ) { right--; }

    Read the article

  • Visual Assist X: curly braces are moving during refactoring

    - by overrider
    I use Visual Assist X, build from 05.01.2009, but the same problem occurred in the previous releases as well. (I run it on MSVS 2005) When I do some refactoring (like extracting a method), everything's fine, but all the curly braces move forward. For example, before refactoring the code looked like this: while (expr) { doSmth(); } After refactoring: while (expr) { doSmth(); } So, I need to move manually all the brackets. Sure, the problem is minor, but it becomes annoying when you do a lot of refactoring. Is it a bug or just default settings? So, does anyone know a workaround?

    Read the article

  • php curly braces groups

    - by David
    is there a function or regex or anything to group items by a { and } tag? so it should group items by the opening tag { and the closing tag }. but be careful, there are also groups inside parent groups like so: group { text1 group2 { text2 } } so basically think of it like php, you make an opening tag, you need to close it with a closing tag, curly braces in php's case. i just need it to like substr() each group into an associative array somehow, except I cant figure it out with the whole, "group inside a parent group".

    Read the article

  • prolog to solve grammar involving braces

    - by Abhilash Muthuraj
    I'm trying to solve DCG grammar in prolog and succeeded upto a point, i'm stuck in evaluating the expressions involving braces like these. expr( T, [’(’, 5, +, 4, ’)’, *, 7], []), expr(Z) --> num(Z). expr(Z) --> num(X), [+], expr(Y), {Z is X+Y}. expr(Z) --> num(X), [-], expr(Y), {Z is X-Y}. expr(Z) --> num(X), [*], expr(Y), {Z is X*Y}. num(D) --> [D], {number(D)}. eval(L, V, []) :- expr(V, L, []).

    Read the article

  • begin...end VS braces {...} VS indentation grouping

    - by Halst
    Hi, everyone. I don't want to fuel any holy-wars here, but I need to ask your opinion. Right now I'm in process of designing a Hardware Description Language as a project in my university. I decided to take VHDL language and just add some syntax-sugar 'coz VHDL is rather obese in syntax. I decided to use indentation to group blocks of code (like in Python), and I'm strongly criticized for that. Originally Begin...End; grouping is used in VHDL language. I have no clue what are cons and pros of these 3 types of grouping, the only thing I know is that I like Python style and I don't understand if it's usage could be erroneous or something? What do you think? What do you like? (hope that I can get some feedback from people who extensively used different languages with different code-grouping syntax, like Pasca, Ada, Delphi, C, C++, C#, Java, Python)

    Read the article

  • latex: curly braces outside math

    - by basweber
    Hi, I am producing some latex beamer slides (but I think it is not a beamer specific question per se). I have the following: \begin{itemize} \item Issue1 \item Issue2 \item Issue3 \end{itemize} now I want to have a right curly brace (i.e. '}') behind the items spreading over issue1 and issue2. And of course I want to write something behind that curly brace I a perfect world I would write something like: \begin{itemize} \left . \item Issue1 \item Issue2 \right \\} One and Two are cool \item Issue3 \end{itemize} This does not work because I am not in a math environment and I can not put the whole snippet inside a math environment because itemize would not work in that case. Is their a clean solution or a hack to produce my desired result? Regards, Bastian.

    Read the article

  • XCode: Adjusting indentation of auto-generated braces?

    - by Nocturne
    Code auto-generated by XCode seems to have the opening brace on the same line by default: @interface Controller : NSObject { } I'd like the opening brace on a line of its own, like this: @interface Controller : NSObject { } This applies in general to any method / class auto-generated by XCode. In XCode preferences I have "Indent solo { by" set to 0: How can I fix this?

    Read the article

  • Automatically closing braces in emacs?

    - by Dave Rigby
    Hi I've seen a plugin for Vim called AutoClose (discovered from this post) which automatically adds the closing brace when typing '(', '{' etc. For example; when I type the following ( | is the cursor): int main(| I would like the closing ) to be inserted automatically for me: int main(|) Does anyone know of a similar feature for emacs - Google has failed me this time!

    Read the article

  • Latex: stretchable curly braces outside math

    - by basweber
    Hi, I am producing some latex beamer slides (but I think it is not a beamer specific question per se). I have the following: \begin{itemize} \item Issue1 \item Issue2 \item Issue3 \end{itemize} Now, I want to have a right curly brace (i.e. '}') behind the items spreading over issue1 and issue2. And of course I want to write something behind that curly brace. In a perfect world I would write something like: \begin{itemize} \left . \item Issue1 \item Issue2 \right \} One and Two are cool \item Issue3 \end{itemize} This does not work because I am not in a math environment and I can not put the whole snippet inside a math environment because itemize would not work in that case. Is there a clean solution or a hack to produce my desired result? Regards, Bastian.

    Read the article

  • Should I use curly brackets or concatenate variables within strings?

    - by mririgo
    Straight forward question: Is there an advantage or disadvantage to concatenating variables within strings or using curly braces instead? Concatenated: $greeting = "Welcome, ".$name."!"; Curly braces: $greeting = "Welcome, {$name}!"; Personally, I've always concatenated my strings because I use UEStudio and it highlights PHP variables a different color when concatenated. However, when the variable is not broken out, it does not. It just makes it easier for my eyes to find PHP variables in long strings, etc. EDIT: People are confusing this about being about SQL. This is not what this question is about. I've updated my examples to avoid confusion.

    Read the article

  • Sed non greedy curly braces match

    - by Cesar
    I have a string in a file a.txt {moslate}alho{/moslate}otra{moslate}a{/moslate} a need to get the string otra using sed. With this regex sed 's|{moslate}.*{/moslate}||g' a.txt a get no output at all but when i add a ? to the regex s|{moslate}.*?{/moslate}||g a.txt (I've read somewhere that it makes the regex non-greedy) i get no match at all, i mean a get the following output {moslate}alho{/moslate}otra{moslate}a{/moslate} How can i get the required output using sed?

    Read the article

  • Single statement if block - braces or no? [on hold]

    - by Zannjaminderson
    Which is better/more generally accepted? This: if(condition) { statement; } Or: if(condition) statement; I tend to prefer the first one, because I think it makes it easier to tell what actually belongs in the if block, it saves others from adding the braces later (or creating a bug by forgetting to), and it makes all your if statements uniform instead of some with braces and some without. The second one, however, is still syntactically correct and definitely more compact. I'm curious to see which is more generally preferred by others though.

    Read the article

  • VS 2010 JavaScript editor – matching braces highlighting – is it so difficult to implement?

    - by AGS777
    I do not know. Just curious. But first things first. As a web developer I spend about 80% of my work-time editing JavaScript code. And since my server-side platform is .NET then it would be very convenient to have decent JavaScript text editor within Visual Studio IDE. So, Visual Studio 2010 is out. Downloaded and installed. What were my expectations regarding JavaScript editor? Pretty low, actually.  I just wanted to have matching braces highlighted eventually. That’s all. Yes, I know about Ctrl + ] shortcut but it is not event remotely close to convenience. And the result? Alas. Without further ado, just look at some real-world fragment of code from jQuery Templates Proposal experimental plugin as I see it in Notepad++, Notepad2 and Visual Studio 2010 editors respectively: Notepad++ Notepad2 Visual Studio 2010 Look at the highlighted parentheses, regular expression literals, numbers. Do you have a feeling that the last screenshot is not very informative in comparison with the other ones? If yes, then my question is why? Instead I was given an IntelliSense. Sorry, but I do not need it to rot my mind. Especially the one which does not always work properly (try to use it with base2 library for example). With all the expressive power of the language I have to know what I am doing. Instead I still have the same plain old Notepad with some of the JavaScript keywords colorized, plus partially functional/useful IntelliSense. What I do need, is just a little help to make less errors when I type the code – some essential text editor facilities that I really need. Give me that and only then feel free to improve on something else. Maybe I am wrong. Then, sorry. Just cannot believe that I have to wait for another couple of years to get very basic code editor feature.  

    Read the article

  • How come BraceMatch() doesn't work when a lexer is set in wxStyledTextCtrl?

    - by George Edison
    I have the following chunk of C++ code that gets called when } is pressed: int iCurPos = GetCurrentPos(); InsertText(iCurPos,wxT("}")); int iPos = BraceMatch(iCurPos); This works fine (iPos gets the position of the matching brace) except when I call SetLexer(...) beforehand. Then it returns -1? How can I get it to work? Edit: I should point out that the above code is being called from the EVT_KEY_DOWN handler in a wxStyledTextCtrl-derived class.

    Read the article

  • Why do I not see stricter scoping more often?

    - by Ben
    I've found myself limiting scope fairly often. I find it makes code much clearer, and allows me to reuse variables much more easily. This is especially handy in C where variables must be declared at the start of a new scope. Here is an example of what I mean. { int h = 0; foreach (var item in photos) { buffer = t.NewRow(); h = item.IndexOf("\\x\\"); buffer["name"] = item.Substring(h, item.Length - h); t.Rows.Add(buffer); } } With this example, I've limited the scope of h, without initializing it in every iteration. But I don't see many other developers doing this very often. Why is that? Is there a downside to doing this?

    Read the article

  • Replace strings differently depending if is enclosed in braces or not.

    - by peroyomas
    I want to replace all instances of an specific words between braces with something else, unless it is written between double braces, while it should show as is it was written with single braces without the filter. I have tried a code but only works for the first match. The rest are shown depending of the first one: $foo = 'a {bar} b {{bar}} c {bar} d'; $baz = 'Chile'; preg_match_all( '/(\{?)\{(tin)\}(\}?)/i', $foo, $matches, PREG_SET_ORDER ); if ( !empty($matches) ) { foreach ( (array) $matches as $match ) { if( empty($match[1]) && empty($match[3])) { $tull = str_replace( $match[0], $baz, $foo ); } else { $tull = str_replace( $match[0], substr($match[0], 1, -1), $foo ) ; } } } echo $tull;

    Read the article

  • Why do some languages not use semicolons and braces?

    - by Incognito
    It is interesting that some languages do not use semicolons and braces, even though their predecessors had them. Personally, it makes me nervous to write code in Python because of this. Semicolons are also missing from Google's GO language, although the lexer uses a rule to insert semicolons automatically as it scans. Why do some languages not use semicolons and braces?

    Read the article

  • Why not put all braces inline in C++/C#/Java/javascript etc.?

    - by DanM
    Of all the conventions out there for positioning braces in C++, C#, Java, etc., I don't think I've ever seen anyone try to propose something like this: public void SomeMethod(int someInput, string someOtherInput) { if (someInput > 5) { var addedNumber = someInput + 5; var subtractedNumber = someInput - 5; } else { var addedNumber = someInput + 10; var subtractedNumber = someInput; } } public void SomeOtherMethod(int someInput, string someOtherInput( { ... } But why not? I'm sure it would take some getting used to, but I personally don't have any difficulty following what's going on here. I believe indentation is the dominant factor in being able to see how code is organized into blocks and sub-blocks. Braces are just visual noise to me. They are these ugly things that take up lines where I don't want them. Maybe I just feel that way because I was weened on basic (and later VB), but I just don't like braces taking up lines. If I want a gap between blocks, I can always add an empty line, but I don't like being forced to have gaps simply because the convention says the closing brace needs to be on its own line. I made this a community wiki because I realize this is not a question with a defined answer. I'm just curious what people think. I know that no one does this currently (at least, not that I've seen), and I know that the auto-formatter in my IDE doesn't support it, but are there are any other solid reasons not to format code this way, assuming you are working with a modern IDE that color codes and auto-indents? Are there scenarios where it will become a readability nightmare? Better yet, are you aware of any research on this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >