Latest Trending Topics / Questions

How To Auto-Format / Indent XML/HTML in Notepad++

Is there a way to re-indent a block of code? I'm looking for something similar to Ctrl+Shift+F in Eclipse (Auto-Format/Indent).


To be clear,


I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don't need a bunch of links to other XML-formatting tools.


I'm specifically working with XML and HTML.


Ideally, there's a keybinding as convenient as the one in Eclipse, so I don't have to break my workflow.


I already know about NppAutoIndent - it won't work, as I'm working with XML, HTML, and CSS.

0
Answers

 

Here is the code

class method


{


    int counter = 0;


    public static void main(String[] args)


    {


        System.out.println(counter);


    }


}


It gave me this error.


Main.java:6: error: non-static variable counter cannot be referenced from a static context


        System.out.println(counter);


How do I make it recognize the variables of the class?

0
Answers

 

Python Math - TypeError: nonetype object is not subscriptable

I'm making a small program for math (no particular reason, just kind of wanted to) and I ran into the error "TypeError: 'NoneType' object is not subscribable.



I have never before seen this error, so I have no idea what it means.



import math 
print("The format you should consider:")
print str("value 1a")+str(" + ")+str("value 2")+str(" = ")+str("value 3a ")+str("value 4")+str("\n") 
print("Do not include the letters in the input, it automatically adds them") 
v1 = input("Value 1: ") 
v2 = input("Value 2: ")
v3 = input("Value 3: ") 
v4 = input("Value 4: ") 
lista = [v1, v3] 
lista = list.sort(lista) 
a = lista[1] - lista[0] 
list = [v2, v4] 
list = list.sort(list) 
b = list[1] = list[0] 
print str(a)+str("a")+str(" = ")+str(b)

The error:


Traceback (most recent call last): File "C:/Users/Nathan/Documents/Python/New thing", line 16, in <module> 


a = lista[1] - lista[0] 


TypeError: 'NoneType' object is not subscriptable

0
Answers

 

How to use requirements.txt to install all dependencies in a python project


I am new to python. Recently I got a project written by python and it requires some installation. I run below command to install but got an error.


# pip install requirements.txt 


Collecting requirements.txt 


Could not find a version that satisfies the requirement requirements.txt (from versions: ) 


No matching distribution found for requirements.txt



Below is my requirements.txt file:


# cat requirements.txt 


ordereddict==1.1 


argparse==1.2.1 


python-dateutil==2.2 


matplotlib==1.3.1 


nose==1.3.0 


numpy==1.8.0 


pymongo==3.3.0 


psutil>=2.0



Is there an easy way to install all the required dependencies in this python project?

0
Answers

 

SyntaxError: unexpected EOF while parsing

I am getting error while running this part of the code. tried some of the existing solutions, none of them helped


elec_and_weather = pd.read_csv(r'C:\HOUR.csv', parse_dates=True,index_col=0) 


# Add historic DEMAND to each X vector 


for i in range(0,24): 


elec_and_weather[i] = np.zeros(len(elec_and_weather['DEMAND'])) 


elec_and_weather[i][elec_and_weather.index.hour==i] = 1 


# Set number of hours prediction is in advance 


n_hours_advance = 24 


# Set number of historic hours used 


n_hours_window = 24 


for k in range(n_hours_advance,n_hours_advance+n_hours_window): 


elec_and_weather['DEMAND_t-%i'% k] = 


np.zeros(len(elec_and_weather['DEMAND']))'


I am always getting this error



for i in range(0,24): 


File "<ipython-input-29-db3022a769d1>", line 1 


for i in range(0,24): 



SyntaxError: unexpected EOF while parsing File "<ipython-input-25-df0a44131c36>", line 1 


for k in range(n_hours_advance,n_hours_advance+n_hours_window): 



SyntaxError: unexpected EOF while parsing 

0
Answers

 

MySQL Error: : 'Access denied for user 'root'@'localhost'

SQL

$ ./mysqladmin -u root -p 'redacted'


Enter password:


mysqladmin: connect to the server at 'localhost' failed error:


'Access denied for user 'root'@'localhost' (using password: YES)'


How can I fix this?

0
Answers

 

What is the difference between UNION and UNION ALL?

SQL

What is the difference between UNION and UNION ALL?

0
Answers

 

create folder in github-How to create folder in github repository?

I want to create a folder in the github repository and add files in that folder. How to achieve this?

0
Answers

 

Git show remote url-How can I determine the URL that a local Git repository was originally cloned from?

I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I determine which of those forks I pulled?

0
Answers

 

What is SAP software used for?

SAP

Can you please explain what is SAP software used for?

0
Answers

 
To Top