|
Please delete as it's a duplicate.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
Have a bit more patience with newbies. Of course some of them act dumb -- they're often *students*, for heaven's sake. -- (Terry Pratchett, alt.fan.pratchett)
|
|
|
|
|
Duplicate + No Code format (Pre Tags)
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
Sir ,
Can any one help me in reading the exact word content.
I have the following code with me:
_____***********Code start here*********----------------
import java.io.File;
import java.io.FileInputStream;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
public class DocRead1 {
public void readDocFile() {
File docFile = null;
WordExtractor docExtractor = null ;
WordExtractor exprExtractor = null ;
try {
docFile = new File("/Users/priyaranjan/Desktop/Hello.doc");
//A FileInputStream obtains input bytes from a file.
FileInputStream fis=new FileInputStream(docFile.getAbsolutePath());
//A HWPFDocument used to read document file from FileInputStream
HWPFDocument doc=new HWPFDocument(fis);
docExtractor = new WordExtractor(doc);
}
catch(Exception exep)
{
System.out.println(exep.getMessage());
}
//This Array stores each line from the document file.
String [] docArray = docExtractor.getParagraphText();
for(int i=0;i<docArray.length;i++)
{
if(docArray[i] != null)
System.out.println("Line "+ i +" : " + docArray[i]);
}
}
public static void main(String[] args) {
DocRead1 reader = new DocRead1();
reader.readDocFile();
}
}
------------*****************________________________
But i am getting the same out put whenever i made a change in font of letters used in word.I mean suppose in first case i have made the letter bold then in the second case i have made the letters italics.
But the above program is giving me the same output in both the case.I want to read the exact content of word document.
Can any one help me in this case...
Regards,
Priya
|
|
|
|
|
You are reading out the text from the document and ignoring the markup.
Check the API to see if you can maybe read it as RTF or with some other markup so you can see the changes.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
Have a bit more patience with newbies. Of course some of them act dumb -- they're often *students*, for heaven's sake. -- (Terry Pratchett, alt.fan.pratchett)
|
|
|
|
|
Hi All,
I think the answer to this is easy but its been causing me all kinds of problems. If i want to create an object of a super class in a subclass, how do i go about it if the superclass has arguments? Eg
Superclass Player - has the constructor:
public Player (Animation left, Animation right){
super(left, right)
this.left = left;
this.right = right;}
To make things more complecated the Player class extends another class with the following arguments:
public Monster (Animation left, Animation right){
super(right);
this.left = left;
this.right = right;}
Finally Monster extends Sprite
public Sprite(Animation a){
this.a = a;}
I want to create an object (instance) of Player in a new class called InventoryItems so it gives me access to all of the methods of the Player class (cant extend the class Player as im already extending another class), can anyone help?
Thank you.
|
|
|
|
|
When you have an inheritance chain child -> father -> grandfather , then each class constructor can access its father's constructor, and each class method can call it's fathers methods using the super keyword as documented here[^], however the child cannot access constructors nor methods of his grandfather.
This is inherent on how object-orientation works, it is the same in C# (where super is called base ); if you feel a need to do that, your design is probably flawed.
Have you considered using interfaces instead of, or on top of, inheritance?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
modified on Tuesday, May 10, 2011 6:59 PM
|
|
|
|
|
Further to Luc's excellent answer your classes are:
class Sprite {
...
}
class Monster
extends Sprite {
...
}
class Player
extends Monster {
...
}
You need to have an interface for InventoryItems that defines all the methods required and then impliement it in Player:
class Player
extends Monster
impliments InventoryInterface {
...
}
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
Have a bit more patience with newbies. Of course some of them act dumb -- they're often *students*, for heaven's sake. -- (Terry Pratchett, alt.fan.pratchett)
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
My guess is that you want to create an instance of Player but you don't have 'left' and 'right'.
If so I suspect your design is flawed.
It isn't clear what 'Animation' is but if is some type of avatar display then it should be optional. If it is an attempt to actually display the player then that logic shouldn't be in player at all.
And Monster shouldn't exist. You can add an attribute to Player which designates the difference between the two unless they are in fact different and in that case they should have an inheritence relationship (a different parent or even composition would be better.)
|
|
|
|
|
I want to get only the modified files from vss using ant scripting. so far I was able to get all the files from the vss from a particular folder but I want only the latest modified files or the files by date-time
here goes the code:
<code>
<?xml version="1.0"?>
<project name="PDN Processing" default="" basedir=".">
<property file="${basedir}/process.properties"/>
<mkdir dir="${basedir}/Workspace/Library"/>
<echo message="${pathvss}" />
<vssget localpath=".\Workspace\Library"
recursive="true"
login="${login},${password}"
ssdir="${pathvss}"
serverPath="${serverPath}"
vsspath="${basefolder}/Library"
writable="true"
date = "4/18/11"
filetimestamp="modified"/>
</project>
</code>
Thanks
-- Modified Tuesday, May 10, 2011 2:41 AM
|
|
|
|
|
What is this to do with Java?
The best things in life are not things.
|
|
|
|
|
Ant is written in Java and 99% of the people who use it are using it for building Java applications. There isn't a dedicated Ant forum, so this seems as good a place to ask the question as any.
|
|
|
|
|
A number of people seem not to like this answer for some reason. Personally, I thought it perfectly reasonable (although I don't necessarily agree with you) so I have bunged in a 5 as compensation.
The best things in life are not things.
|
|
|
|
|
|
Payam Rastogi wrote: I want to get only the modified files from vss using ant scripting.
Why?
Just to eliminate one situation...
You are running a 'build' which is generally intended for a production delivery.
Then the ONLY way you should be doing this is.
1. Clear the ENTIRE directory tree.
2. Extract EVERYTHING.
3. Build.
In the above scenario there is no need to extract a subset of files.
|
|
|
|
|
For a full production build, yes, you would want to rebuild everything from the ground up. But a continuous integration build doesn't need to do this, it only needs to do an incremental build of the things that have changed since the last time it ran.
All the main continuous integration tools allow you to do this as far as I am aware.
|
|
|
|
|
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (0xe06d7363), pid=3292, tid=820
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [kernel32.dll+0x12aeb]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
I receive the following error intermittently while running a batch of scripts.
The problem is that it only happens some times and randomly. Any suggestions to stop this from happening are welcome.
|
|
|
|
|
Check that you're not getting yourself into an infinite loop as this has been observered to cause this problem.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
Have a bit more patience with newbies. Of course some of them act dumb -- they're often *students*, for heaven's sake. -- (Terry Pratchett, alt.fan.pratchett)
|
|
|
|
|
The vast majority of infinite loops will not cause that.
|
|
|
|
|
If and ONLY if you are not using JNI or a 3rd party library that uses JNI then you have a VM bug.
It is remotely possible that this might be caused by your environment. But even so there isn't much you can do about it in terms of fixing it.
You would need to localize the code that caused it and then you must find another way to write the code. If you can localize it to something fairly small then you should report it as a bug to Oracle via the java bug list.
|
|
|
|
|
I second that - try every script by it's own and find the one that crashes the Java Hot Spot VM[^]
regards
Torsten
I never finish anyth...
|
|
|
|
|
You could try updating to a more recent build of Java. Update 17 is quite old now and it is possible that there may have been some fixes to more recent releases. I know that these things aren't always that easy, particularly if this involves upgrading a live production system, but if you can upgrade then it might be worth a try.
|
|
|
|
|
Who can give me an example ? Please
|
|
|
|
|
|
Oh, Thanks, Have you a good day!
|
|
|
|