Question about Microsoft Windows XP Professional

1 Answer

I am an MCA student.To read the file from PC to handheld device

This the method I am using to reda the file.

public void upload_route_data ()
{
String upload_string = "SSS6";
int i = 1,k=0,ret_val;
long no_of_bytes;
String s="";
result =0; hex_checksum="";
filename="";
filename = get_filename ();
String str1="CS:\\Aeon_PManager\\Datafiles\\"+filename;
//System.out.println (str1);
//File f1 = new File (filename);
File f1 = new File (str1); //shiva
no_of_bytes = f1.length();
//System.out.println(no_of_bytes);
conv_dec_to_hex (no_of_bytes);
reverse_data_string ();
s = "::: B ";
s += hex_checksum+" ";
ss.writeString (upload_string);
while (true)
{
int data_available = ss.available ();
if (data_available > 0)
{
String g = ss.readString();
break;
}
}

try { Thread.sleep(5000); } catch (InterruptedException e) {}
ss.writeString (s);

try
{
FileReader fr = new FileReader(str1); // to read character wise from file
while (k < no_of_bytes)
{
i = fr.read(); //Read a character
ss.writeByte ((byte)i);
checksum (i);
k++;
}
fr.close();
ss.writeByte ((byte)' ');
hex_checksum = "";
conv_checksum_tohex (result);
reverse_string ();
ss.writeString (hex_checksum);
try { Thread.sleep(500); } catch (InterruptedException e) {}
}
catch (Exception e){System.out.println ("System File input error");}
}

The problem here is when I try to load the data from the data files. I am getting an System File input error.Can you help to read the file from the datafiles.

Posted by on

Ad

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

  • Contributor
  • 32 Answers

You might need to run a anti-virus through your computer. it might have a bug. :) hope this helps!!

Posted on May 20, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

3 Answers

A java code for anagram


import java.io.IOException;

public class AnagramApp {
static int size;

static int count;

static char[] charArray;

public static void main(String[] args) throws IOException {
String input = "Java Source and Support";
size = input.length();
count = 0;
charArray = new char[size];
for (int j = 0; j < size; j++)
charArray[j] = input.charAt(j);
doAnagram(size);
}

public static void doAnagram(int newSize) {
int limit;
if (newSize == 1) // if too small, return;
return;
// for each position,
for (int i = 0; i < newSize; i++) {
doAnagram(newSize - 1); // anagram remaining
if (newSize == 2) // if innermost,
display();
rotate(newSize); // rotate word
}
}

// rotate left all chars from position to end
public static void rotate(int newSize) {
int i;
int position = size - newSize;
// save first letter
char temp = charArray[position];
//shift others left
for (i = position + 1; i < size; i++)
charArray[i - 1] = charArray[i];
//put first on right
charArray[i - 1] = temp;
}

public static void display() {
System.out.print(++count + " ");
for (int i = 0; i < size; i++)
System.out.print(charArray[i]);
System.out.println();
}
}

Nov 22, 2010 | Computers & Internet

1 Answer

Design the program 3 grades output the grades according to each rank


#include <string>
#include <fstream>

#define MAX_NUM_STUDENTS 15
#define MAX_LEN_NAME 20
#define LEN_SSN 10

enum Rank {Freshment, Sofomore, Junior, Senior};
enum letGrade {A, B, C, D, F};

class StuRecord {
public:
void ReadRecord(ifstream& inputFile);
// Precondition:
// Input stream inputfile is opened and the file is not empty.
// Postcondition:
// The next student record in the input file is read and stored
// in this object. The rank is save as a value of the enumeration
// type "letGrade" according to the read-in numeric rank number.
void Average();
// Precondition:
// The 3 grades (grade1, grade2, and grade3) are assigned.
// Postcondition:
// Find the average of the 3 grades.
void LetterGrade();
// Precondition:
// The average is assigned.
// Postcondition:
// Determine the letter grade according to the average.
void Print() const;
// Precondition:
// name, ssn, rank, and grade are assigned.
// Postcondition:
// Print out the student record.
StuRecord();
// Default constructor.

private:
string name;
string ssn;
Rank rank;
letGrade grade;
int grade1, grade2, grade3, average;
};

And a source file...which i am not sure what to do from this point forward =(

#include "project 1.h"
#include <iostream>
#include <fstream>

using namespace std;




enum Rank {Freshment, Sofomore, Junior, Senior};
enum letGrade {A, B, C, D, F};
struct StuRecord
{
string name;
string ssn;
Rank rank;
letGrade grade;
int grade1, grade2, grade3, average;
};

Jul 08, 2010 | Computers & Internet

1 Answer

How to get no. Of pixels from given image through java


try this code

import java.awt.image.PixelGrabber;
import java.awt.Toolkit;
import java.awt.Image;
class getpixel2
{
public static void main(String args[]) throws Exception
{

Image image = Toolkit.getDefaultToolkit().getImage("D:\\one.jpg");

if(image==null)
System.out.println("NO FIle");
PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, false);

if (grabber.grabPixels())
{
int width = grabber.getWidth();
int height = grabber.getHeight();

if (isGreyscaleImage(grabber))
{
byte[] data = (byte[]) grabber.getPixels();

}
else
{
int[] data = (int[]) grabber.getPixels();
for(int i=0;i<data.length;i++)
{
int r = (data[i] >> 16) & 0xff;
int g = (data[i] >> 8) & 0xff;
int b = (data[i] >> 0) & 0xff;
System.out.println("(R,G,B)=("r","g","b")");
}
}

}
}
public static final boolean isGreyscaleImage(PixelGrabber pg)
{
return pg.getPixels() instanceof byte[];
}
} import java.awt.image.PixelGrabber;
import java.awt.Toolkit;
import java.awt.Image;
class getpixel2
{
public static void main(String args[]) throws Exception
{

Image image = Toolkit.getDefaultToolkit().getImage("D:\\one.jpg");

if(image==null)
System.out.println("NO FIle");
PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, false);

if (grabber.grabPixels())
{
int width = grabber.getWidth();
int height = grabber.getHeight();

if (isGreyscaleImage(grabber))
{
byte[] data = (byte[]) grabber.getPixels();

}
else
{
int[] data = (int[]) grabber.getPixels();
for(int i=0;i<data.length;i++)
{
int r = (data[i] >> 16) & 0xff;
int g = (data[i] >> 8) & 0xff;
int b = (data[i] >> 0) & 0xff;
System.out.println("(R,G,B)=("r","g","b")");
}
}

}
}
public static final boolean isGreyscaleImage(PixelGrabber pg)
{
return pg.getPixels() instanceof byte[];
}
}

May 15, 2010 | Computers & Internet

1 Answer

I want to read text file which is located in c drive using java code can anybody help me out


import java.io.*;
import java.util.Scanner;

public final class ReadWithScanner { public static void main(String... aArgs) throws FileNotFoundException {
ReadWithScanner parser = new ReadWithScanner("C:\\Temp\\test.txt");
parser.processLineByLine();
log("Done.");
}

/**
* @param aFileName full name of an existing, readable file.
*/

public ReadWithScanner(String aFileName){
fFile = new File(aFileName);
}

/** Template method that calls {@link #processLine(String)}. */
public final void processLineByLine() throws FileNotFoundException {
Scanner scanner = new Scanner(fFile);
try {
//first use a Scanner to get each line
while ( scanner.hasNextLine() ){
processLine( scanner.nextLine() );
}
}
finally {
//ensure the underlying stream is always closed
scanner.close();
}
}

/**
* Overridable method for processing lines in different ways.
*
* <P>This simple default implementation expects simple name-value pairs, separated by an
* '=' sign. Examples of valid input :
* <tt>height = 167cm</tt>
* <tt>mass = 65kg</tt>
* <tt>disposition = "grumpy"</tt>
* <tt>this is the name = this is the value</tt>
*/

protected void processLine(String aLine){
//use a second Scanner to parse the content of each line
Scanner scanner = new Scanner(aLine);
scanner.useDelimiter("=");
if ( scanner.hasNext() ){
String name = scanner.next();
String value = scanner.next();
log("Name is : " + quote(name.trim()) + ", and Value is : " + quote(value.trim()) );
}
else {
log("Empty or invalid line. Unable to process.");
}
//(no need for finally here, since String is source)
scanner.close();
}

// PRIVATE //
private final File fFile;

private static void log(Object aObject){
System.out.println(String.valueOf(aObject));
}

private String quote(String aText){
String QUOTE = "'";
return QUOTE + aText + QUOTE;
}
}

Jun 22, 2009 | Sun Java Programming Language (cdj-275)

2 Answers

I am getting the error as Launch file error.


I believe this is what you are looking for: http://www.java.com/en/download/faq/5000070700.xml From a browser: Click on a link from a web page. From desktop icon: If you use an application frequently, you can create a shortcut on your desktop or in the Start Menu. Java Web Start may ask if you would like to create shortcuts or an entry in the Start Menu. If you say "yes," all future launches of the application can start without a browser. From Java Application Cache Viewer: Java Web Start also provides an Application Cache Viewer which you can launch from the Java Control Panel. The Cache viewer enables you to directly launch applications that you have downloaded. Instructions to launch from Application Cache Viewer Go to Start > Settings > Control Panel > Double click on the Java icon. The Java Control Panel will start. Click on the General tab Click on the Settings button from the Temporary Internet Files section Click on the View Applications button Double click on the respective application from the list that you want to launch From command prompt: You can also launch an application from a command prompt by typing javaws jnlp_url where jnlp_url is a url to the jnlp file of the application. Go to Start > Run > type "cmd". A command prompt window will appear. Type "javaws url_of_jnlp"

Jun 02, 2009 | Microsoft Office Word 2007 Upgrade Version...

1 Answer

Code for method parseInt() in java


parseInt(java.lang.String, int)

This code takes two arguments, a string constructor from the Java language and an integer. Its purpose is to parse (meaning de-construct or disassemble into component parts) one data type into another.

Here is an example of a Java program to specify and print out the dimensions of a rectangle, taken from the page http://www.roseindia.net/java/beginners/entervaluesfromkeyboard.shtml:

class Rectangle{
int length, breadth;
void show(int x, int y){
length = x;
breadth = y;
}
int calculate(){
return(length * breadth);
}
}
public class EnterValuesFromKeyboard{
public static void main(String[] args) {
Rectangle rectangle = new Rectangle();
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
rectangle.show(a, b);
System.out.println(" you have entered these values : " + a + " and " + b);
int area = rectangle.calculate();
System.out.println(" area of a rectange is : " + area);
}
}

Apr 09, 2009 | Sun Java Programming Language (cdj-275)

1 Answer

Hi everybody can anyone help me with the project ''Data Hiding in Audio Files'' project in Java and how to run the project with full source code to


The Circle Class Using Data Hiding and Encapsulation package shapes; // Specify a package for the class public class Circle { // The class is still public // This is a generally useful constant, so we keep it public public static final double PI = 3.14159; protected double r; // Radius is hidden, but visible to subclasses // A method to enforce the restriction on the radius // This is an implementation detail that may be of interest to subclasses protected checkRadius(double radius) { if (radius < 0.0) throw new IllegalArgumentException("radius may not be negative."); } // The constructor method public Circle(double r) { checkRadius(r); this.r = r; } // Public data accessor methods public double getRadius() { return r; }; public void setRadius(double r) { checkRadius(r); this.r = r; } // Methods to operate on the instance field public double area() { return PI * r * r; } public double circumference() { return 2 * PI * r; } }

Mar 25, 2009 | Computers & Internet

1 Answer

Student library record







Import java.awt;
Import java.applet;
class Book extends Applet
{ String book name="Handbook";
int Book no=50;
int d.o.s=” ”;}
Type ur required body content here.
}
public static void main(String args[])

{
}

/*<applet code=”book” height=500 width=500 ></applet>
this appears to go beyond the scope of troubleshooting



















Sep 27, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

3 Answers

Jawa void


you should not use arguments in void function in java ... in java pertaining to void the compiler doesn't understand the arguments and treats that as invalid... in c it is ok

Aug 07, 2008 | Sun Java Studio Standard 5 (SSJI9501TL9M)...

4 Answers

Java-collection frame work, Arraylist datastruture


class DD
{
public static void main()
{
student s=new Student[4];
for(int i=0;i<4;i++)
{
S[i].get();
s[i].put;
}
}
}

Feb 17, 2008 | Sharp AL 1631 Copier

Not finding what you are looking for?
Microsoft Windows XP Professional Logo

Related Topics:

130 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2885 Answers

Piyal Perera
Piyal Perera

Level 3 Expert

528 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18408 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...