Calculate Auto And Cross-correlation From A File
Oct 30, 2014
I have to calculate auto and cross-correlation from a file, like this:
Rxx(n)= 1/N* SUM[from k=1 to N-n]((x(k)-x(mean))*x(k+n)-x(mean))
and after
Rxy(n)= 1/N* SUM[from k=1 to N-n]((x(k)-x(mean))*y(k+n)-y(mean))
I've 600 x an y,
k = the numbers of x (N is the last one)
n = 0....N-1
View Replies
ADVERTISEMENT
Oct 26, 2014
I have to calculate auto and cross-correlation from a file, like this:
Rxx(n)= 1/N* SUM[from k=1 to N-n]((x(k)-x(mean))*x(k+n)-x(mean))
and after
Rxy(n)= 1/N* SUM[from k=1 to N-n]((x(k)-x(mean))*y(k+n)-y(mean))
I've 600 x an y,
k = the numbers of x (N is the last one)
n = 0....N-1
already calculated mean, and I've tried the following (but it doesnt work):
String sor;
int i=0;
while ((sor = br.readLine()) != null) {
String [] adatok =sor.trim().split(",");
[Code] ....
View Replies
View Related
Sep 26, 2014
I am working on a project named as "Auto Click and Populate". This is link is like online feedback form / surveys which we program. I have a link with me which is mentioned below and there will be a counter box which will hit the link that much number of times.
Inputs:
-A text box having this link.
-A numeric box having counter number i.e. the number of times the link should be processed.
-A button named as process which will INITIATE the process.
Now say if I input 10 into the numeric box; the attached file contain link should be processed 10 times and the question which is coming on the link should be answered randomly out of the options which are present. For ex: When you will hit a link; the first question will be gender in that 3 options are present "Male", "Female" and "Prefer not to answer"; either of 1 out of 3 should be punched automatically and proceed automatically ahead. The punch(es) will be stored in database which is maintained at my end.I have done research and till now found the code for auto click only and not for auto process.
View Replies
View Related
Oct 3, 2014
I need to create a diagonal cross however I can not figure out how to do the upper left side of it.
Currently I am getting
0*
1--*
2---*
3 *--*
4*-----*
I want to get it to look like
0*------*
1 *--*
2----*
3 *---*
4*------ *
( I replaced spaces with -) So far I have
System.out.println("Input a size(must be larger than 1: )");
size=input.nextInt();
if (size>1) {
for (x=0;x<size;x++){
System.out.println("");
[Code] ....
View Replies
View Related
Aug 13, 2014
I need fixing an issue in the search textbox in one of the jsp's. I was informed that cross site scripting can be done in the textbox and I kept the below code in my jsp to fix the issue:
Java Code:
searchTerm = request.getParameter("search");
searchTerm = searchTerm.replaceAll("<", "<").replaceAll(">", ">");
searchTerm = searchTerm.replaceAll("[^A-Za-z0-9 ]", "");
searchTerm = searchTerm.replaceAll("eval((.*))", "");
searchTerm = searchTerm.replaceAll("["'][s]*((?i)javascript):(.*)["']", """");
[Code] ....
Now, after applying the above code, the cross site scripting can be done and the problem is that the search can't be done using the textbox and all the time will display none results.
View Replies
View Related
Dec 8, 2014
The program I'm supposed to create generates a random number between one to ten. Then the program is to ask me if I wish to cross the road.
If you choose to cross, the outcomes for 0-2 are "You crossed safely."
For 3-5, 75% of the time it should say "RIP you got run over", and 35% of the time it should say "You crossed the street."
For 6-8, 60% of the time it should say you made it.", and 40% of the time it should say "You died". For 9-10, it should say "RIP".
So far I have gotten the random number generation part working,
import java.util.Random;
public class test4 {
public static void main(String[] args) {
Random random = new Random();
for(int i =0; i < 1; i++){
int num = random.nextInt(10) + 1;
System.out.println("The number of cars on the street are: " + num + "
Do you wish to cross the road?");
}
}
}
View Replies
View Related
Aug 13, 2014
fixing an issue in the search textbox in one of the jsp's. I was informed that cross site scripting can be done in the textbox and I kept the below code in my jsp to fix the issue:
searchTerm = request.getParameter("search");
searchTerm = searchTerm.replaceAll("<", "<").replaceAll(">", ">");
searchTerm = searchTerm.replaceAll("[^A-Za-z0-9 ]", "");
searchTerm = searchTerm.replaceAll("eval((.*))", "");
searchTerm = searchTerm.replaceAll("["'][s]*((?i)javascript):(.*)["']", """");
[code]...
Now, after applying the above code, the cross site scripting can be done and the problem is that the search can't be done using the textbox and all the time will display none results.
View Replies
View Related
Jan 30, 2015
I am having a hard time compiling this code: I need to calculate the gpa of each student in the csv file which looks like this:
ID First Name Last NameClass LevelDesired ClassCreditsPoints GPA
9410917 Reagan Walls SophomoreCOMP 18275 77 1.026667
13498070 Stewart Fry Senior COMP 10070 92 1.314286
37500410 Talon Witt Junior COMP 100107 389 3.635514
47845461 Ciara Beard Grad COMP 11097 196 2.020619
The GPA column needs to be added by dividing the points by credits. I also need to sort the class level column by class level. For example:
ID First NameLast NameClass LevelDesired ClassCreditsPointsGPA
9410917 Reagan Walls SophomoreCOMP 18275 77 1.026667
46309070 Ivy Valdez SophomoreCOMP 1006 16 2.666667
37405616 Miriam Welch SophomoreCOMP 11057 179 3.140351
Here is my code:
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.String;
import java.io.File;
import java.io.PrintStream;
import java.io.Serializable;
import java.io.ObjectOutputStream;
import java.io.FileOutputStream;
import java.util.Comparator;
[code]...
I am taking the two things that needed to be outputted, one at a time. Working on the GPA portion.
View Replies
View Related
Jan 12, 2015
If some one add script in my URL, I want the script not pop up, we have tomcat 6 [URL] .....
View Replies
View Related
Apr 9, 2014
I made a small aplication which draws 3 rectangles in different spots(0,0 , 50,50 , 100,100)
Am I used an KeyListener + ActionListener, to make them move in the let's call it box.
How can I do in order that those 3 elements do not cross, so you can always see them, they don't collapse into each other?
Java Code:
package matrixmoveelements;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
[Code] ......
View Replies
View Related
Jun 20, 2014
the prime numbers from 1 to 2500 can be obtained as follows. From a list of the numbers of 1 to 2500,cross out al multiples of 2 (but not 2 itself). Then, find the next number (n, say) that is not crossed out and cross out all multiples of n (but not including n).
Repeat this last step provided that n has not exceeded 50 (the square root of 2500). The numbers remaining in the list (except 1) are prime. Write a program which uses this method to print all primes from 1 to 2500. Store your output in a file called primes.out.
View Replies
View Related
Feb 1, 2014
My assignment is to make GUI to calculate orders and to save the calculation to .csv file.I have solved "save" button and it really does save my input to .csv file.But, my problem is "Load button" When I press it, how to load .csv file to my existing JTextFields?
View Replies
View Related
Apr 22, 2015
The intent of the code is to read date from a file, does calculation and then displays that data in a table format on the screen. Then creates another file with those values:
Reads file: Beginningbalance.txt
Displays Data with calculation
Creates a file called "Newbalance.txt" with the following values:
111
251.41
222
402.00
With the way the code is written I can get it to create the file but it only displays one of the customers (111). I know that I need to create a loop but I am not sure how to build that. I tried creating another while loop and changing it to outFile but that was without success.
import java.io.*;
import java.util.Scanner;
import java.text.DecimalFormat;
public class Output {
public static void main(String[]args) throws IOException {
[Code] .....
View Replies
View Related
Sep 13, 2014
How to write a program which will automatically correct the parts of speech of a document.
Example: say in my document I have My/PRONOUN name/PRONOUN is/VERB Jhon/NOUN. He/PRONOUN is/VERB going/ADJ to/PREPOSITION school/NOUN
Now I need to change My/PRONOUN name/NOUN is/VERB Jhon/NOUN. He/PRONOUN is/VERB going/VERB to/PREPOSITION school/NOUN...How to do using java. The document may contain 100 lines tagged with parts of speech.
View Replies
View Related
Apr 11, 2015
I need my Java program (I'm working in Eclipse if it matters) to detect if an image is a portrait or a landscape, but since i am directly downloading them from my camera they only have it written somewhere in metadata, the image width and height is the same for landscape and portrait. I have the rotation code and the rest of the program working, but I need to somehow get a variable (for example integer one) to tell me if it is a portrait or a landscape image. I tried getting to the metadata but my Eclipse decided that import com.drew.metadata.Metadata; cannot be resolved.
BufferedImage image = ImageIO.read(new File(imagePath, imageName)); and after I get the variable "orientation" it looks like this
int orientation = ???;
BufferedImage newImage = oldImage;
if (orientation>1){
newImage = rotate(oldImage);
}
View Replies
View Related
Oct 8, 2014
I wanted to make a small program to move a small rectangle by pressing the WASD keys. The program works, except that when I hold a key to move the rectangle, after a second, auto-repeat starts up, and the rectangle motion accelerates. I want to prevent automatic repeat to activate, so that the rectangle moves at a constant speed when I hold a key and stops when I released. Here is the ButtonMotion classe :
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.KeyStroke;
[code]....
View Replies
View Related
Sep 5, 2014
I have swing UI designed and I want the components to resize when the frame is manually resized. The design is as shown in the fig Project UI.jpg
The panel 4 and panel 5 will change their contents according to the list item clicked. Panel 4 just has text area but panel 5 a panel with numerous components as label, combo box, text field,check box will be present.Now if the frame resizes, I won't all the components to resize according to the frame size.
View Replies
View Related
Jul 23, 2014
I'm learning about abstract classes and I have to create an abstract auto class with make and price of a car, then two classes with a different type of car, and finally a main to use them. Everything seems to work and when I run it it's fine but I do get an error on the main that I'm not using the local variable buick1 and acura1.I'm curious because, while it runs for me, I want to make sure I'm doing it right and don't know of another way to do the output than this. I've put all four classes but the issue is on the last one (5 and 7).
public abstract class Auto
{
protected String makeCar;
protected double priceCar;
public Auto(String newMake)
{
makeCar = newMake;
[code]....
View Replies
View Related
Oct 1, 2014
[java] I am using eclipse luna and it auto terminates as soon as it starts it just terminates?
import java.util.Scanner;
public class data {
public static void main(String args[]){
Scanner input = new Scanner (System.in);
}
}
View Replies
View Related
Feb 10, 2015
I'm doing an application which needs a JTable with data from an existing database. I need the table to periodically (I plan to use a Timer) reflect the changes made to the DB (inserting new rows, deleting or updating existing rows) without making the dirty approach of clearing the whole JTable and refilling it again, which is not nice. I need to just add/modify/delete the needed rows, not the whole table.
View Replies
View Related
Apr 30, 2015
I have to write a resize method so that when my Bucket gets to a certain point, then it resizes the bucket when it is called. What is happening is, I am getting strange results when I run the method. My mean bucket length should be at 2.5 for the last insertion, but I am getting something like 0.1346. Here is my dictionary class
// The "Dictionary" class.
// The Dictionary class implemented using hashing. Hash buckets are used. A dictionary contains a set of data elements with corresponding keys. Each element is inserted into the dictionary with a key. Later the key can be used to look up the element. Using the key, an element can be changed or it can be deleted from the dictionary. There is also an operation for checking to see if the dictionary is empty.
package dictionary;
public class Dictionary {
protected final static int MAX_BUCKETS = 1000; // number of buckets
protected DictHashEntry[] buckets; // the bucket array
private int collisionCount = 0;
[Code] .....
View Replies
View Related
Jul 5, 2014
i want to need auto gerneraion user id for registration form using jsp & servlet with my sql database
View Replies
View Related
Jul 5, 2014
I want to need auto gerneraion user id for registration form using jsp & servlet with my sql database.
View Replies
View Related
Apr 25, 2014
Ok I am trying to auto populate a bean and retrieve the values from it using the jsp:useBean tags ect..
My code looks like this..
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String redirect = request.getParameter("page").trim();
if(redirect.equals("create_account"))
response.sendRedirect("/WebProgrammers/sign_on_server_pages/"+redirect+".jsp");
if(redirect.equals("confirm_info"))
[Code] ....
The error my Apache Tomcat is throwing
org.apache.jasper.JasperException: An exception occurred processing JSP page /sign_on_server_pages/confirm_info.jsp at line 91
88:
89:
90: %>
91: <jsp:useBean id="acct" type="beans.Creating_Account" scope="application"></jsp:useBean>
[Code] ....
I have tried sever different values for the scope attribute and all of them say the same thing about 'not found in scope'.
View Replies
View Related
Apr 26, 2013
I am using Jboss as application server and tomcat as web server.
How to turn off auto-reloading of servlets and jsps.
View Replies
View Related
Sep 18, 2014
I do have 2 JBoss standalone instances running. 1 act as Server and another 1 would client.
SERVER:
View Replies
View Related