Find User Behavior Profile Using One Class SVM In Java
Feb 16, 2014
I'm new to machine learning approach. I want to find user behavior profile using one class SVM in java. I d't know how to do it. Finally, we need to provide privacy to each user and their data.
Requirement:
1. Collect the behavior profile for each user.
2. Apply one class SVM.
I currently use Eclipse to maintain our Java application. I recently upgraded from Java 6 to Java 7. I updated my Eclipse projects to use the Java 7 .jar files. I can run the application from Eclipse via the Run Configuration.
I can also run the Ant build and it completes successfully. When I install the application on my desktop, I receive the "Java Virtual Machine Launcher: Could not find main class..." error. My CLASSPATH is set to ".".
I have two classes LightController & Circle. I am trying to create a method to do the following.
1.Grows the diameter of the circle referenced by the receiver's instance variable light, to the argument size.
2. The diameter is incremented in steps of 2, the xPos and yPos are decremented in steps of 1 until the diameter reaches the value given by size.
3. Between each step there is a random colour change. The message delay(anInt) is used to slow down tthe graphical interface, as required.
How can I write the method to do this? I have been fiddling around for ages and just had no luck.
The method is called public void grow(int size) and is in the Light Controller class.
Both classes can be seen below.
import ou.*; import java.util.*; /** * Class LightController * This class uses the Circle class, and the Shapes window to simulate a disco light, that grows and shrinks and changes colour. * */
public class LightController { /* instance variables */ private Circle light; // simulates a circular disco light in the Shapes window private Random randomNumberGenerator;
I have two classes LightController & Circle. I am trying to create a method to do the following.
1. Increase the size of the circle by increments of 2 as created in grow() 2. Once it has reached the size specified to then reduce in size in crements of 2 as created in shrink()
I have got the method to increase the size but once it reaches the specified size it then does not shrink.The method is called public void lightCycle(int sizeIncrease) and is in the Light Controller class.Both classes can be seen below.
import ou.*; import java.util.*; /** * Class LightController * This class uses the Circle class, and the Shapes window * to simulate a disco light, that grows and shrinks and * changes colour.
I just wanna confirm that when a certain processing throws an exception even when said exception happens inside doFilter, any servlet container will never proceed to the next filter right?
I have a JTable that is being used to display, and edit data from a database. When the user presses the Enter key on the keyboard I want a carriage return to occur in the cell they are typing in. I do not want the cursor to go to the next row which is the default behavior.
My program seems to work ok when i enter number in order like 1,2,3 = true , and all the numbers for false seem to be working as well! my problem is when i enter number like 3,2,4 that are not in order but still are consecutive!! I thought that another if statement would be the solution but i have tray several different ones and still can't make it work !!!
Java Code:
import java.util.*; public class Consecutive{ public static void main (String [] args){ Scanner console= new Scanner(System.in); System.out.println("Enter three numbers"); String numbers = console.nextLine();
I am trying to write a code that asks the user to input ten numbers and then finds and displays the smallest number out of the ones given. I am supposed to implement arrays into the program to do this. But the problem I have run into is that when I compile the code in jgrasp, I am given several error messages and I am not quite sure what I have done wrong. I'm assuming it is either a syntax or a logical error on my part but reading over the code I do not understand what is causing these errors.
This is the most current draft of my code:
import java.util.Scanner; public class Exercise7_9 { public static void main(String[] args) { double[] numbers = new double[10]; //Enter ten double numbers: Scanner(System.in) java.util.Scanner input = new java.util.Scanner(System.in); System.out.println("Please enter ten numbers: ");
[Code] ....
/* Sample Run: Enter ten numbers: 1.9, 2.5, 3.7, 2, 1.5, 6, 3, 4, 5, 2 */
And these are the exact error messages:
----jGRASP exec: javac -g Exercise7_9.java Exercise7_9.java:35: error: '.class' expected if (double m > list[i]) { ^ Exercise7_9.java:35: error: illegal start of expression if (double m > list[i]) {
I decided to code this quiz I took in class about asking the user to input a string and the code is suppose to check for upper case letters. If a upper case letter is found, it should increase a count by one. Once the check is done, it should display the number of uppercase letters. For some reason I am getting this weird compile error stating that symbols can't be found...
Java Code:
import java.util.*; import java.lang.*; public class StringCheck{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("please enter a string: " ); String s = input.nextLine();
Write a java program that will ask a user to input grades until the user inputs the sentinel value -1. The program should test each input to determine whether 0<=grade<=100. If the grade entered is within this range, the program should print "Grade accepted;" if not, the program should print "Invalid input".
I have permanently set the path of bin of JDK 1.6 in the environment variables of my system. I am able to compile any of my java programs successfully. But when I give command to run the program I am getting an error "could not find or load main class".
When I write the command "set classpath=.;" program runs successfully. I want to know whether I have to set this classpath everytime I run a new progaram. Is there any permanent way to set classpath ?
I creates this simple code (shown below) inside a package of a major opensource code (i.e., openSHA), but when i run it the following error appears. The error mentions a class named "KT_testGmpeForScenarioRupture" that i wrote before and did not run showing exactly the same error.
Code:
package org.opensha.sha.gcim.imr.attenRelImpl; public class KT_Test { private static void main(String args) { int x=4; System.out.println("x is " + x); } }
Error: Could not find or load main class org.opensha.sha.gcim.imr.attenRelImpl.KT_testGmpeF orScenarioRupture
I am using Netbeans as my IDE and I have created a program called Saluton.java
I navigate to the folder holding the class file using the command line under Windows 7 but when I issue the command java Saluton.class I get an error it cannot load or find the main class.
I made a breakout like game that runs as a applet and now i wanted to make it run in a jframe so i wrote this
Java Code:
import java.applet.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; public class BrickBuster{ public static void main(String[] args){ JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); JApplet BrickBuster = new JApplet(); frame.add(BrickBuster); BrickBuster.init(); } } mh_sh_highlight_all('java');
It compiles fine but whenever i try running it with the java command it says it couldnt find or load main class. also i have it save in a folder called BrickBuster so i called java BrickBusterBrickBuster.class
I tried running my program on cmd but it produces the error "could not find or load main class" ...It compiles well but it just doesn't run. Here is my code:
package writedoc; import java.io.FileWriter; import java.io.PrintWriter; import java.io.IOException; public class WriteDoc { public static void main(String[] args) throws IOException { String strDocument="grades.txt";
I created a Test main method to test my Inventory and InventoryItem class to see if they are functioning properly. I am currently trying to read a text .dat file, but I keep getting "...cannot find symbol" for descripIn when I try to compile it.
I'm trying to run a java program from cmd. I'm using Windows 8, java version "1.8_0_20". I've got two classes, the main class called Middleware and a secondary class, called WorkerThread, of which the main class is using functions. I've successfully compiled both .java files with javac, and created the .class file. So all files are in the same folder. However, when I attempt to run the main class with java Middleware, I get the error message: "Error: Could not find or load main class". Here's the main class:
package middleware; import java.net.*; import java.util.concurrent.*; public class Middleware { //Number of threads serving clients. private static int nr_threads = 5; private static int portNr = 6789; private static ServerSocket welcomeSocket; private static ExecutorService executor;
[code]....
My code compiles and runs fine in eclipse but on the console, I'm having troubles.
This is my first java program,i am using eclipse IDE-----
package day1.example;
public class MyFirstJava {
/** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("hi"); } }
When i saved it,it shows no error.when i run it then a pop-up says "could not find the main class.the program will exit" and in the console it says---
java.lang.UnsupportedClassVersionError: day1/example/MyFirstJava : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source)
I have two classes (Daughter and Son) that contain some very similar method definitions:
public class Family { public static void main(String[] args) { Daughter d = new Daughter(); Son s = new Son(); d.speak(); s.speak();
[Code] .....
Each of those classes has a "speak" method with two out of three lines being identical. I could move those into a parent class, but I need each of the child classes to continue to exhibit its unique behavior. I'm trying the approach below, which replaces the unique code with a call to a "placeholder" method that must be implemented by each child class:
public class Family { public static void main(String[] args) { Daughter d = new Daughter(); Son s = new Son();
[Code] .....
This works and moves the shared code from two places (the Daughter and Son classes) into one place (the new Mother class, which is now a parent class of Daughter and Son). Something about this feels a bit odd to me, though. It's one thing for a child class to override a parent class's methods to extend or alter their behavior. But, here, I've implemented an abstract method in the parent class to alter what happens when the parent class's method (speak(), in this case) is called, without overriding that parent class method itself.
I'm getting an error trying to run a welcome app from a book. I've looked at the FAQs and can't seem to solve the issue. I'm guessing my path and/or classpath are not right. Here's my path environment variable.
I was trying to write my own version of the game SimpleDotCom from Head First Java. I have two files:
Game.java: package project_01; public class Game{ byte hitCount = 0; String result = "miss"; int counter = 0; String checkGuess(int[] location,int userGuess){
[Code] .....
The two files are in the same directory, "project_01" and the CLASSPATH environment variable is set to ".;". The game compiled but when I tried launching it with "java GameTester" it returned the error : Could not find or load main class GameTester. I know my game is horrible and probably extremely buggy but I'll fix all the bugs, etc. later, right now I just need to get it to run.
My problem is that I can compile a java HelloWorld program using javac HelloWorld.java but I cannot run the program using java HelloWorld. I didn't create the code it was developed by a professional programmer. My assignment is to compile and run, so that I see the output.
I'm new to this java stuff and when I go to notepad++ and this keeps coming up when I try to compile it: "Error: Could not find or load main class HelloWorld" what it means...