![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Web Development Java/PHP/Perl/ASP and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Silence Join Date: Nov 2004 Location: back to meta level
Posts: 3,929
Blog Entries: 3 Rep Power: 4 Reputation:
189 | http://coltrane.wiwi.hu-berlin.de/le...omework_1.html deadline is knocking & i can't deal with last probs. 39 errors root@lil:~/homework/MAT# javac SearchResults.java root@lil:~/homework/MAT# javac LilitHw1.java LilitHw1.java:27: cannot resolve symbol symbol : variable Konsole location: class LilitHw1 auswahl = Konsole.readInt("Please chose an option"); ^ 1 error root@lil:~/homework/MAT# java LilitHw1.class Exception in thread "main" java.lang.NoClassDefFoundError: LilitHw1/class if smb could help asap, i'll attach the file. thx voraus |
| | |
| | #2 | |
| ★★★★★★★★★★★★★ Join Date: Aug 2004 Location: ★★★★★★★★★★★★★
Posts: 16,586
Rep Power: 8 Reputation:
432 | Quote:
hey Moonlight! how is it going/ hope all is well! I'll ask our guys in software what solution they have to your issues ... unfortunately, the filed I am in is a little bit different ... it's silicon ip field and semiconductors - I am not a coder but I'll ask the guys to help you out with this ... let me check with our s/w engineers first ... cheers! Hrachya
__________________ Мадмазель, Медам, Месье! "Глория" меняет курс и направляется в Кейптаун! Кому это не нравится будет расстрелян на месте. (с) http://texneg.livejournal.com | |
| | |
| | #3 |
| ★★★★★★★★★★★★★ Join Date: Aug 2004 Location: ★★★★★★★★★★★★★
Posts: 16,586
Rep Power: 8 Reputation:
432 | перепутал приват с эфиором - бывает ... ![]()
__________________ Мадмазель, Медам, Месье! "Глория" меняет курс и направляется в Кейптаун! Кому это не нравится будет расстрелян на месте. (с) http://texneg.livejournal.com |
| | |
| | #4 |
| Silence Join Date: Nov 2004 Location: back to meta level
Posts: 3,929
Blog Entries: 3 Rep Power: 4 Reputation:
189 | thx considering i didn?t go any further. if understood the prob, mayb could do smth. i believed it should b right. in case posting the codesCode: class LilitHw1
{
//To change the search term, just change this
static String Term = "implementation";
public static void main(String[] args)
{
double eingabe1;
double ergebnis = 0.0;
int auswahl;
System.out.println("\nDesktop Search beta version");
System.out.println("\nThis program allows textual search for keywords in .doc, .txt, .html,");
System.out.println(" files locally stored in your computer.\n");
System.out.println("The current search term is fixed in this version and is: " + Term + ". ");
do
//User manu
{
System.out.println("\n\n\nDesktop Search beta version");
System.out.println("");
System.out.println("(1) PDF");
System.out.println("(2) TXT");
System.out.println("(3) DOC");
System.out.println("(4) HTML");
System.out.println("(0) Ende");
auswahl = Konsole.readInt("Please chose an option");
switch (auswahl)
{
case 1 : {
System.out.print("\nThe PDF search result is : ");
runPDFsearch();
break;
}
case 2 : {
System.out.print("\nThe TXT search result is : ");
runTXTsearch();
break;
}
case 3 : {
System.out.print("\nThe DOC search result is : ");
runDOCsearch();
break;
}
case 4 : {
System.out.print("\nThe HTML search result is : ");
runHTMLsearch();
break;
}
case 0 : {
System.out.println("\ncaio!");
break;
}
default:{
System.out.println("\nInvalid choice.\n");
}
}
}while (auswahl != 0);
}
private static void runPDFsearch()
{
int Lines = SearchResults.pdfResultsFN.length;
System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n");
for(int count=0; count < Lines; count++)
{
System.out.print(SearchResults.pdfResultsFN[count] + " : " );
ProcessLine( SearchResults.pdfResultsTL[count] );
}
}
private static void runTXTsearch()
{
int Lines = SearchResults.txtResultsFN.length;
System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n");
for(int count=0; count < Lines; count++)
{
System.out.print(SearchResults.txtResultsFN[count] + " : " );
ProcessLine( SearchResults.txtResultsTL[count] );
}
}
private static void runDOCsearch()
{
int Lines = SearchResults.docResultsFN.length;
System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n");
for(int count=0; count < Lines; count++)
{
System.out.print(SearchResults.docResultsFN[count] + " : " );
ProcessLine( SearchResults.docResultsTL[count] );
}
}
private static void runHTMLsearch()
{
int Lines = SearchResults.htmlResultsFN.length;
System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n");
for(int count=0; count < Lines; count++)
{
System.out.print(SearchResults.htmlResultsFN[count] + " : " );
ProcessLine( SearchResults.htmlResultsTL[count] );
}
}
//This will do all the printing with the '...' if needed
private static void ProcessLine(String ProcessString)
{
int Length = ProcessString.length();
int Location = FindTerm(ProcessString);
if(Location < 0 || Location > Length){
System.out.print("Error\n");
System.out.println(Location);
return;
}
int End = Term.length() + Location;
if (Location > 10){
System.out.print("...");
System.out.print(ProcessString.substring(Location-10, Location));
}else{
System.out.print(ProcessString.substring(0, Location));
}
System.out.print(ProcessString.substring(Location,Location+Term.length()));
if ((End + 10) < Length){
System.out.print(ProcessString.substring(End, End+10));
System.out.print("...");
}else{
System.out.print(ProcessString.substring(End, Length));
}
System.out.print("\n");
}
//This will find an index in the string where the term starts
private static int FindTerm(String ProcessString)
{
int iRet=-1;
//Put into a char array to get at individual bytes
int Length = ProcessString.length();
char[] ProcessCharArray =
ProcessString.toLowerCase().toCharArray();
//same as above
int TermLength = Term.length();
char[] TermCharArray = Term.toLowerCase().toCharArray();
//look for the term
for(int processcount=0; processcount < Length; processcount++)
{
//find the begining
if (ProcessCharArray[processcount] == TermCharArray[0]){
iRet=processcount;
//see if the whole term is found
for(int termcount=0; termcount<TermLength; termcount++){
if (ProcessCharArray[processcount+termcount] !=
TermCharArray[termcount]){
//keep trying
iRet=-1;
}
}
if(iRet == processcount){
//found it
return iRet;
}
}
}
//didn't find it
return iRet;
}
} |
| | |
| | #5 |
| Дикообраз-безобраз Join Date: Jul 2004 Location: У самого синего моря
Posts: 2,861
Rep Power: 5 Reputation:
128 | I'm not so familiar with java, but the problem is that java "doesn't know" who is "Konsole", check out whether you imported the lib (correctly). By the way, there is a link to the Konsole class implementation, try to place that above the LilitHw1 class. ![]() Ciao.
__________________ - Гитлер?!! - Да?!! - Зурна!!! |
| | |
| | #6 | |
| Silence Join Date: Nov 2004 Location: back to meta level
Posts: 3,929
Blog Entries: 3 Rep Power: 4 Reputation:
189 | AvDav: thx so so much!! i had even translated german text in the given file, but forgot 2 add Konsole.class (no way 2 replace the hw1). finally no errors, but prog runned only 2 prove me that is working not the way it was supposed to!! after classes i?ll have only some hrs b4 the deadline.. Quote:
| |
| | |
| | #7 | |
| Дошкольник Join Date: Aug 2004 Location: Oxford
Posts: 141
Rep Power: 5 Reputation:
10 | Quote:
| |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Saddam Hussein Captured Alive Near Tikrit | DaNYer | General | 29 | Dec 18, 2003 23:15 |
| CODER & DECODER | petar | Languages, Compilers and Interpreters | 4 | Jul 27, 2002 12:21 |