How to disable hibernate and free some disk space in Windows 7
Run a command prompt as administrator.
Run the following command:
powercfg.exe -h off
The disk space is freed immediately. To turn it back on run:
powercfg.exe -h on
Reference: +
Including .eps images with pdflatex
PdfLaTeX does not support eps files by default. Add the following imports in the beginning:
\usepackage{graphicx} % already added
\usepackage{epstopdf}
After that the includegraphics commands with eps arguments should produce no problems.
Reference: +
Code Snippet: Mean, Variance, and Standard Deviation Methods
The methods to calculate mean, variance, and standard deviation of a vector of values. These are put here for easy reference, so that I do not need to rewrite them again.
A Helper Method for Performing K-Fold Cross Validation
The following method is a utility method for creating the K divisions upon which one is going to perform the K-fold cross validation operation. The input of the method is the length of the training data, and the number K. The output says which indices of the training-data is to be put in each division.
Problem in finding local resources in Intellij IDEA
Some classes use external data files which are located in the same directory as the one that the .java file is located, or somewhere nearby which can be easily addressed with a relative path. This happens a lot for me, esp. when I am running open source programs developed by someone else. As an example, imagine a class called SampleClass located in a directory in which there exists a text file with the name of “SomeFile.txt”. One way to have access to the file is through calling the class loader’s getResource function:
URL theURL = this.getClass().getResource("SomeFile.txt");
System.out.println(theURL.toString());
I tested this piece of code in NetBeans and it works fine. But not in Intellij IDEA! To solve this (annoying) problem, I needed to add the path of the source directory to classpath. For this purpose I did the following steps in Intellij IDEA 10.0.3 Community Edition:
- Right click on the module name and select "Open Module Settings"
- Select "Modules" from the leftmost pane
- Select "Dependencies" tab
- Press "Add…" button and select "1 Single-Entry Module Library…" from the popup menu
- Find and select the "src" folder of your sources.
- Under the "Scope" column, change the scope to "Runtime"
- Press Apply and OK
leave a comment