indentation

Indentation Error [closed]

梦想与她 提交于 2019-12-13 08:36:31
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I'm trying to define a method similar to the method max but I get an error for an expected indentation. I'm not exactly sure what is wrong with the code.

How would you format/indent this piece of code?

天涯浪子 提交于 2019-12-13 05:52:08
问题 How would you format/indent this piece of code? int ID = Blahs.Add( new Blah( -1, -2, -3) ); or int ID = Blahs.Add( new Blah( 1,2,3,55 ) ); Edit: My class has lots of parameters actually, so that might effect your response. 回答1: I agree with Patrick McElhaney; there is no need to nest it.... Blah aBlah = new Blah( 1, 2, 3, 55 ); int ID = Blahas.Add( aBlah ); There are a couple of small advantage here: You can set a break point on the second line and inspect 'aBlah'. Your diffs will be cleaner

Java DocumentBuilder - wrong indentation in XML file

寵の児 提交于 2019-12-13 01:16:45
问题 I try to write a simple XML file in Java using the DocumentBuilder. I expected the XML file to look like this: <outer> <inner> <element name="WEB"/> <element name="WEB"/> <element name="WEB"/> </inner> </outer> But it generates it like this: <outer> <inner> <element name="WEB"/> <element name="WEB"/> <element name="WEB"/> </inner> </outer> Why the third element does not have the same indentation as the other two elements? Note: I read the XML file again to simulate a method in a project,

Sublime Text indentation issue

心不动则不痛 提交于 2019-12-12 17:09:10
问题 I encountered an indentation issue while combining html and jsp tags. Steps to reproduce: File > New File (Ctrl+N) View > Syntax > Java > Java Server Page (JSP) Paste the following code: <ul> <c:if test="${a > 0}"> <li>a</li> </c:if> </ul> Select all the content (Ctrl+A) and run Ctrl+Shift+P > Indentation: Reindent Lines The result is: <ul> <c:if test="${a > 0}"> <li>a</li> </c:if> </ul> Tested running Build 3047 under Windows 7 x64. Any clues? 回答1: For ST2 : Open the html package and edit

Python 2.7 IndentationError [closed]

半腔热情 提交于 2019-12-12 10:32:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am getting an IndentationError when trying to run my program in a Python Interpreter: line 127 global map ^ IndentationError: expected an indented block I am using python version 2.7 What's wrong with the following code?: def make_map(): global map 回答1: Python expects 4 spaces or a tab to indent and align code

Qt Mode for Emacs

守給你的承諾、 提交于 2019-12-12 09:54:06
问题 What are you using to develop Qt code in Emacs, so that it's highlighted/indented properly? This page explains an extension to CC mode, but it seems a little outdated. Since Qt is constantly evolving, is there a more up-to-date Qt mode available? 回答1: That page makes it pretty clear that the standard cc-mode packaged with GNU Emacs is supporting Qt extensions now; just make sure your cc-mode is up to date and you should be all set. 来源: https://stackoverflow.com/questions/6144512/qt-mode-for

Can VIM autoindent SQL?

痞子三分冷 提交于 2019-12-12 07:47:29
问题 "SQL Statement indentation good practice" appears to be the accepted format for writing SQL blocks. Is there a Vim indent/syntax file that would adhere to this standard, or at least be close? Currently my Vim left alights pretty much everything and only indents certain keywords. 回答1: "SQLUtilities : SQL utilities - Formatting, generate - columns lists, procedures for databases" has the SQL Utilities plugin, which is capable. And "How to auto-format and auto-capitalize SQL in Vim" is a related

Python indentation semantics

荒凉一梦 提交于 2019-12-12 06:49:09
问题 I just have a very simple question, and just need to confirm that I got the point. Say that we have the following Python code snippet: x = 0 if x == 5: print 'x is equal to 5' else: print 'x is not equal to 5' print 'program done' If we indent the statement print 'program done' as follows: else: print 'x is not equal to 5' print 'program done' Will print 'program done' in this case be part of the block code associated with else ? 回答1: From Python Docs: Leading whitespace (spaces and tabs) at

List with no indent?

空扰寡人 提交于 2019-12-12 05:53:10
问题 I came accross this fiddle, I would like the 2.1 to have NO INDENT. Please see below some code I got from someone else, works like a charm but I dont want the indents! Any ideas? If anyone can assist it would be greatly appreciated, thanks! the code: ol { list-style-type: none; counter-reset: item; margin: 0; padding: 0; } li { display: table; counter-increment: item; margin-bottom: 0.6em; } li:before { content: counters(item, ".") ". "; display: table-cell; padding-right: 0.6em; } li li {

Sublime Text 2 >IndentationError< [duplicate]

痴心易碎 提交于 2019-12-12 03:48:14
问题 This question already has answers here : How to fix/convert space indentation in Sublime Text? (9 answers) Closed 3 years ago . I have a problem with sublime text 2. When I write some python scripts correctly at sublime text I always face on with this problem "IndentationError: unexpected indent" after a while I found, the problem is causing by sublime text. I tried other editors and corrected but sublime text didnt work correctly. The main problem is, sublime text is adding extra tab to my