init the most essential program for UNIX systems. Started as first process generally with PID 1, when system boots up. Nothing to worry about it because it is already configured to work in any system.init starts other processes directly or indirectly.
e.g. init starts a separate instance of getty(responsible for logins) when asked.
getty reads the username and runs the login program, which reads the password if every thing is fine then it runs the shell.
'init' dies last
When the system is shut down, it is init that is in charge of killing all other processes, unmounting all
filesystems and stopping the processor.
Monday, March 22, 2010
Saturday, March 20, 2010
Weka on NetBeans
Here is a very easy way out extract jar sorce file of weka you will probably get weka-src folder.
Now create a new java application project in NetBeans name is your choice. Let us say you have created a project named javaapplication then do following =>
just put folder weka-src/src/main/java/weka in src folder of your newly created project folder also put weka-src/lib inside the newly created project src folder.
So, your src folder in javaapplication folder contains lib folder from weka, weka from weka and javaapplication it already have this one. That's all start coding and using weka.
Now in javaapplication project you can add as many file as you wish and call weka classes by importing the class files you want to call. You can't call classifier directly because they are protected for classifiers use only. So you can't call directly Classifier.runClassifier(new REPTree(), argv) etc.
If you want something like this then just change the runClassifier from protected to public.
So it will be
changed from protected static void runClassifier(Classifier classifier, String[] options) {
to
public static void runClassifier(Classifier classifier, String[] options) {
Now you can just use following program to run REPTree with arguments.
package javaapplication;
import weka.classifiers.trees.REPTree;
import weka.classifiers.Classifier;
/**
*
* @author nandan
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] argv) {
// TODO code application logic here
Classifier.runClassifier(new REPTree(), argv);
}
}
make any class like this in javaapplication project put argument from run menu using customize main project specify something like -t trainingfile.arff.
trainingfile.arff should be inside javaapplication folder.
This also tells you how to pass command line argument to NetBeans main project. To change main project go to run menu then search for Set main project.
This is simplest solution. You can also add Weka as library the jar folder itself can be added as library.
Now create a new java application project in NetBeans name is your choice. Let us say you have created a project named javaapplication then do following =>
just put folder weka-src/src/main/java/weka in src folder of your newly created project folder also put weka-src/lib inside the newly created project src folder.
So, your src folder in javaapplication folder contains lib folder from weka, weka from weka and javaapplication it already have this one. That's all start coding and using weka.
Now in javaapplication project you can add as many file as you wish and call weka classes by importing the class files you want to call. You can't call classifier directly because they are protected for classifiers use only. So you can't call directly Classifier.runClassifier(new REPTree(), argv) etc.
If you want something like this then just change the runClassifier from protected to public.
So it will be
changed from protected static void runClassifier(Classifier classifier, String[] options) {
to
public static void runClassifier(Classifier classifier, String[] options) {
Now you can just use following program to run REPTree with arguments.
package javaapplication;
import weka.classifiers.trees.REPTree;
import weka.classifiers.Classifier;
/**
*
* @author nandan
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] argv) {
// TODO code application logic here
Classifier.runClassifier(new REPTree(), argv);
}
}
make any class like this in javaapplication project put argument from run menu using customize main project specify something like -t trainingfile.arff.
trainingfile.arff should be inside javaapplication folder.
This also tells you how to pass command line argument to NetBeans main project. To change main project go to run menu then search for Set main project.
This is simplest solution. You can also add Weka as library the jar folder itself can be added as library.
Subscribe to:
Posts (Atom)