bibiki 18 Posting Whiz

hey there,

I have the following piece of PHP code to retrieve a list of files on a directory, and then build links to each file:

<?php

$dir=""; // Directory where files are stored

	if ($dir_list = opendir($dir)){
		while(($filename = readdir($dir_list)) !== false){
?>

<li><a href="<?php echo $filename; ?>"><?php echo $filename;

?></a></li>

<?php
}
	closedir($dir_list);
}

?>

it is all nice and fine, but it builds two links too many. the first link leads to the folder where the php file resides, and the second link leads to the folder that contains the folder where the php file resides. I was wondering if there is a way, other than putting an if statement inside my while loop, to have php only generate links for the files on the directory I wish, excluding the other two links.

thanks in advance.

bibiki 18 Posting Whiz

hey there,
I havbe the following html and css files:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
	<link rel=StyleSheet href="style.css" type="text/css">
	<title>My site</title>
</head>

<body>

	<div id="con">
		<div id="navigation">
			<ul>
				<li><a href="http://gagi.zxq.net/star.html">About me</a></li>
				<li><a href="http://gagi.zxq.net/ekes.html">Blog</a></li>
				<li><a href="http://gagi.zxq.net/mbretereshat.html">Links</a></li>
				<li><a href="http://gagi.zxq.net/bouncingball.html">News</a></li>
			</ul>
		</div>

		<hr>


		<div id="main">
			<h1>This is a sample article</h1>

				<p> Just some stuff to help me in building my first page.
					I intend to have a nice site, and I will have it. Just some stuff to help me in building my first page.
					I intend to have a nice site, and I will have it.
		</div>

		<div id="right">
			<p> Just some stuff to help me in building my first page.
					I intend to have a nice site, and I will have it.
		</div>

		<hr>





		<div id="foot">	
			<p>Running since 2011Running since 2011Running since 2011Running since 2011Running since 2011Running since 2011Running since 2011Running since 2011Running since 2011</p>
		</div>

	</div>

</body>


</html>

and my css file is:

#navigation{
	font-size: 100%;
	width: 800px;
}

#navigation ul {
	list-style: none;
	margin: auto;
	padding: 0;
	padding-top: 0;
}

#navigation li {
	margin-top: 0.0em;
	margin-bottom: 0.0em;
	display: inline;

}

#navigation a:link, #navigation a:visited {
	margin-right: 0.2em;
	padding: 0.0em 0.6em 0.0em 0.6em;
	color: #A62020;
	background-color: #FCE6EA;
	text-decoration: none;
	border-top: 1px solid #FFFFFF;
	border-left: 1px solid #FFFFFF;
	border-bottom: 1px solid #717171;
	border-right: 1px solid #717171;
}

#navigation a:hover {
	border-top: 1px solid #FFFFFF;
	border-left: 1px solid #FFFFFF;
	border-bottom: …
bibiki 18 Posting Whiz

hey there,

I have a simple page online, and tried to style it a little. here is my page. there are five links. I tried to build a simple, css-styled vertical menu. however, the button-like appearance of the links is not of equal length. would anyone tell me what part of my css file do I need to modify, and how, so that I can have the 'buttons' be of equal length?

#navigation{
	font-size: 100%;
}

#navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	padding-top: 1em;
}

#navigation li {
	margin-top: 0.5em;
}

#navigation a:link, #navigation a:visited {
	margin-right: 0.2em;
	padding: 0.2em 0.6em 0.2em 0.6em;
	color: #A62020;
	background-color: #FCE6EA;
	text-decoration: none;
	border-top: 1px solid #FFFFFF;
	border-left: 1px solid #FFFFFF;
	border-bottom: 1px solid #717171;
	border-right: 1px solid #717171;
}

#navigation a:hover {
	border-top: 1px solid #FFFFFF;
	border-left: 1px solid #FFFFFF;
	border-bottom: 1px solid #717171;
	border-right: 1px solid #717171;
}
bibiki 18 Posting Whiz

why don't you just bring your laptop over, and I'll do everything for you... I'm in Kosovo :)
come on man, just install it, I'm sure it will work in Windows 7 or whichever version you happen to have. try installing it, if it does not, look for instructions on specific problems you encounter.

bibiki 18 Posting Whiz

I used to have a dell inspiron 2650 laptop, an old one, running xp, and mysql worked on it perfectly. I don't see why wouldn't MySQL run on a machine :) I guess the best way to verify though is to try and install it.

bibiki 18 Posting Whiz

I am not sure if I understand you, but if I understood you correctly, then my advice is move on to MySQL, and be sure that it's very easy to connect to it with Java. you have a working class ready in a couple of recent threads here in Java forums. if that's the route you chose to take, then I assure you will very fast be able to interact with MySQL with Java.

bibiki 18 Posting Whiz

thanks for replying guys. I have fixed this issue on my windows machine, but can't seem to do so on my ubuntu machine. thanks, anyways.

bibiki 18 Posting Whiz

hey there,
I am trying to make my first connection to a mysql server with java. I took the following code from another thread:

import java.sql.Connection;
   import java.sql.DriverManager;
     
   public class Connect {
      public static Connection ConnectDB()
      {
         Connection conn = null;
      
         try
         {
            String userName = "root";
            String password = "";
            String url = "jdbc:mysql://localhost:3306/test";
            Class.forName ("com.mysql.jdbc.Driver").newInstance();
            conn = DriverManager.getConnection (url, userName, password);
            System.out.println ("Database connection established");
         }
            catch (Exception e)
            {
               e.printStackTrace();
            }
         return (conn);
      }
		
		public static void main(String[] args){
			ConnectDB();
		}
		
   }

it compiles well, but when I run the code, I cat the following complaint:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Connect.ConnectDB(Connect.java:16)
at Connect.main(Connect.java:28)

how do I go about making the com.mysql.jdbc.Driver available. is it something I need to download and install separately from JDK or is it something that comes with JDK but I am not knowing how to use. please help!

bibiki 18 Posting Whiz

man, your code really is a mess. try fixing it a little first and then someone will surely help you. this problem is a simple problem that would easily be solved had you provided a complete class, one that includes the imports, a class name, putting pieces of code inside methods... try doing that first friend, I really don't know where to start helping you.

bibiki 18 Posting Whiz

hsuan,
let us assume that the default color of keys on your painted keybord is red, and that when you press a key on your keyboard, the color is changed to blue.

say now that you press key D and it turns blue on your screen. do you want it to stay blue until you press another letter, or do you just want it to stay blue for a few moments and then turn back to red regardless if you press another key?! let me know, and I'll give you an idea.

bibiki 18 Posting Whiz

well, there are ways to see the bit/byte representation of an audio files. in linux, you type "od filename" (od standing for octal dump), and what you get is a hexadecimal representation of an audio file. there are different options you can pass to od to give you various results... I suspect you're willing to go too deep with this and see how to make use of it, but I thought I give you some idea. besides, I suppose that the byte representation of a song I sing (without the beat accompanying my singing) and the byte representation of an actual song would be different... anyways. I think this is an algorithm that YouTube does use to detect 'copy right' violations. hope this is of any help to you.

bibiki 18 Posting Whiz

alright, your application is all right, except for two minor defects.

one, you only have your application reading time once, that's why it repaints the same time every time it repaints. you need to put your line 28 somewhere where it is run each time a repaint is needed. that is, inside your for loop. and, another problem is that your thread sleeps a second and a half, which basically means that every third second is not painted. hope this helps.

bibiki 18 Posting Whiz

I get to my router's web interface with Ubuntu through wireless, and I get access to the interface from my xp through wire (my xp machine is a desktop, so I only use wired connection for it). I can also ping one machine from the other using the following IPs:
Router: 192.168.0.1
XP: 192.168.0.100
Ubuntu: 192.168.0.101
I have installed Samba server on my Ubuntu, and can now effectively share files between my machines. However, the remote desktop software from neither machine accesses the other. weird. and the other problem is that I can't seem to connect to router's web interface through wire with my Ubuntu (I turn off wireless, and it fails to work). however, when I plug the straight through cable in my Ubuntu machine, a corresponding light on my router goes on, so I know the router detects it, but it won't allow it any access. I hope this is all clear.

one point worth noting, though, is that I have my default ttl changed on both of machines so that I can enjoy wireless, otherwise I wouldn't be able to because the ISP limits my plan from having wireless. I am more prone to believe that that may not be the cause behind my issue.

bibiki 18 Posting Whiz

I hate to be the bearer of bad news, but nobody is going to do your homework. nobody did mine, either, so no hard feelings, ok :P

seriously, you are expected to give the code you wrote and that does not work before anyone will give you any help. show some effort.

bibiki 18 Posting Whiz

I don't want to connect them directly. I want to build my network using a router. I am effectively sharing folders between my machines, but I can't seem to share screens, unless I access my XP from Ubuntu using LogMeIn, but this is not what I want. I am still struggling to understand why won't my laptop communicate with the router through a cable (straight-through). perhaps after upgrading to Ubuntu 10.10, the nic driver was not installed. who knows...

bibiki 18 Posting Whiz

well, remove lines 22 to 24 first. you do not need that if just yet. then see what .you get, perhaps that will direct you.

bibiki 18 Posting Whiz

try k less than 7...it most likely won't work perfectly, but it will give you a hint. tell us what does your int[][] a parameter to the method hold. it's dimensions. besides, you could reach the effect with a one-dimensional array as well...

bibiki 18 Posting Whiz

well, I'm using the software that comes by default on both systems, Ubuntu and Windows XP. in my Ubuntu machine, I have changed some parameters to allow remote access on it, but windows fails to connect. as far as windows machine goes, I have to check kater as I don't have my machine near. thanks... I wonder though why can't I access 192.168.0.1 (router) from my laptop when connected through a wire. I can only access it through wireless connection.

bibiki 18 Posting Whiz

aanders,
a couple of weeks ago I was hired to do some data mining, and the mechanism at the core of the task I was assigned was this what you are trying to accomplish.

what i did is the following, and I believe this will help you, too.

I accessed remote files with Java's URL, BufferredReader, InputStream, and InputStreamReader classes. so, I read the html source code one line at a time, so every time I searched for a substring inside the line, the return was either -1 or somethinge way less than 35k, because a line of html code is never as long as that.

additionally, as I had to do the same for various sites, I would first analyze the source code of pages I was interested in and looked for ways to reduce the part of each page to be parsed, and that could help you too. the simplest example would be reading the source code between <body and </body instead of the entire page.

one more point to mention is that when I looked for the index of a string, say <hr class=, and needed to extract a string coming after the index returned, I would always add the length of this searched for string so that it I do not extract it.

I believe you know, but I want to remind you that string.indexOf("<hr class=") returns the position of < character... lest you forgot.

I hope I was …

bibiki 18 Posting Whiz

Thank you for your reply Mike,
I managed to do something about sharing files between my two computers. all I did is installed samba software on my linux machine, and it worked. overall, installing samba is almost the same as changing the workgroup name of a windows machine. just a different way of doing the same. (for anyone that's interested, though, be aware that different versions of ubuntu have diferent ways for installing samba, so when you research, make sure you seek asolution in accordance with the ubuntu/linux version you have).

however, what's weird is that I can't seem to be able to access one machine from the other using remote desktop software although I can ping one from the other. any ideas along these lines?

bibiki 18 Posting Whiz

hey there,
I have a simple problem... but it seems overwhelming for me.

I have a router, a desktop that runs XP, a laptop that runs Ubuntu 10.10.

I want to make a home network with these devices I have.

I have already managed to connect two computers, both running xp, through a cross-over cable. that's all the experience I have. any help is greatly appreciated.

after I build my network, my intention is to make use of Synergy software (it makes possible using two computers at the same time, with a single mouse and keybord).

thank you.

bibiki 18 Posting Whiz

no I'm on linux, Ubuntu.any ideas, James?

bibiki 18 Posting Whiz

hey there,
I downloaded the jxbrowser package that comes in the following folder jxbrowser-2.8-cross-desktop-win_mac_linux
. I put it on a directory JavaBrowser on my desktop. I tried writing a java class that makes use of the package but my compiler complains for absence of the package. anyways, after reading the readme.txt file, I found this line:

Installing Library JAR Files

----------------------------

All the JAR files in the lib directory should be in the application class path.

I am confused as I don't know what exactly is meant when they say "application class path". I know what a path is, but what is application class path. anyone help, please.

bibiki 18 Posting Whiz

I guess if your if statement is the last inside your paintComponent method, the last screen should persist unless you have some other place you invoke the repaint method in... like say if you have an interactive application, like some button or some method linked to some key pressed, and it calls repaint... then you of course are invoking the repaint outside the paintcomponent method too, and in that case your boolean variable may be out of reach and useless. glad you made it work.

bibiki 18 Posting Whiz

perhaps you can add some boolean variable and an if statement that check for truth value of the variable and call the repaint method only inside the if statement, which means that repaint will be called only while the boolean variable evaluates to true. hope that helps.

bibiki 18 Posting Whiz

I think you only need to pass to the constructor method of JTextArea two in variables, int rows and int cols, and they will appear. try that and see if it works, I haven't tried. and please, post your code

bibiki 18 Posting Whiz

hey there. I have the following code. I am trying to build an applet that displays all possible (92) ways of arranging eight queens on a chess board with no two of them on the same column, row, or diagonal. I built this as an application and it ran fine. I made the necessary modifications of my Eksi class to construct an applet, but it won't repaint(). can anyone lend their experience and show me what I am doing wrong. I think my problem is specifically on line 77 of my code. thank you!

import javax.swing.*;
   import java.awt.*;

   public class Eksi extends JApplet{
      private Kutia[][] k;
      private int count = 0;
      public void init(){}
   
      public void paint(Graphics g){
         g.setColor(Color.blue);
         g.fillRect(0, 0, 500, 500);
      
         for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
               if((i+j)%2 == 0){
                  g.setColor(Color.black);
               }
               else{
                  g.setColor(Color.red);
               }
               g.fillRect(50 + i*20, 50 + j*20, 20, 20);
            }
         
         }
      	
         if(k != null){
            System.out.println("Gagi");
            count++;
            for(int i = 0; i < 8; i++){
               for(int j = 0; j < 8; j++){
                  g.setColor(Color.white);
                  g.drawString(k[i][j].figura(), i*20 + 52, j*20 + 70);
                  g.setColor(Color.black);
                  g.drawString("Mundesia " + count, 140, 30);
               
               }			
            }
         
         }
      	
      }
   
      public void ndihmesePaint(Kutia[][] ituk){
         k = ituk;
         System.out.println("Ngadhnjim");
         repaint();
      
      }
   
      public static void main(String[] args){
         int variable = 0;
         Model mod = new Model();
         VeproMeMatrica vm = new VeproMeMatrica();
         String[] ar = vm.permutim("8");
         int[][] xarg = vm.ConvertPermute(ar);
         Eksi ek = new Eksi();
         Kutia[][] x = new Kutia[8][8];
      
      
         for(int k = 0; k …
bibiki 18 Posting Whiz

thanks a lot for trying to help friends. I have solved my initial problem. I don't know what exactly solved it, but it is working.

bibiki 18 Posting Whiz

a newer, simpler, shorter version of my controller class. please check it.

public class Anot{
   
   
      public static void main(String[] args){
      
         Kutia[][] x = new Kutia[8][8];
      	//here I initialize 64 objects of type Kutia;
         for(int i = 0; i < x.length; i++){
            for(int j = 0; j < x.length; j++){
               if((i == 0 & j == 1) || (i == 1 & j == 3) || (i == 2 & j == 5) || (i == 3 & j == 7) || (i == 4 & j == 2) || (i == 5 & j == 0)|| (i == 6 & j == 6) || (i == 7 & j == 4)){
                  x[i][j] = new Kutia(i, j, "M");
               }
               else{
                  x[i][j] = new Kutia(i, j, "");
               }
            }
         }
      	//here I instantiate my view component
         Eksi ek = new Eksi();
      	//here I pass the 64 objects of Kutia to ndihmesePaint method of
      	//my view component
      	//the method ndihmesePaint assigns the 64 objects to the field variable k
      	//of the view component. the method then System.out's the chess piece each
      	//of 64 objects holds, and then it calls method repaint().
         ek.ndihmesePaint(x);
      	
      	//i change the 64 Kutia objects in these two for loops
         for(int i = 0; i < x.length; i++){
            for(int j = 0; j < x.length; j++){
               if((i == 0 & j == 2) || (i == 1 & j == 4) || (i == 2 & j == 6) || (i == 3 & j == 0) || (i …
bibiki 18 Posting Whiz

it's here too one a.m. I'm from Kosovo. anyways. that milliseconds thing... I'm confused man. I'm not a pro. I put that RepaintManager line because if I don't, when I use try-catch for animation purposes, it works better with RepaintManager.

thanks for trying though. good night to you.

bibiki 18 Posting Whiz

Another forum member told me that paintComponent is not good for animation, but that is all I know right know. however, I do not have in my actual code that 3 second pause in between each iteration of my loops. I have removed them - I thought that I did that prior to posting the code. anyways. my code ndihmesePaint method is System.out-ing updated versions of k variable, but it wont paint it.

bibiki 18 Posting Whiz

a note to Ezzaral,
the for loops preceding ek.ndihmesePaint(x) lines update the variable x.

bibiki 18 Posting Whiz

My System.out is working fine. However, the painting in my paintComnponent is not taking place.
here is my controller class (read it from bottom up, as for experimenting I call ndihmesePaint() method at the end of this file):

public class Kontroller{
   
      public static void main(String[] args){
      
         Kutia[][] x = new Kutia[8][8];
         VeproMeMatrica vm = new VeproMeMatrica();
      //------------------------------------------------------
      
      /*         String[] perm = vm.permutim("8");
         for(int i = 0; i < vm.Factoriel(8); i++){
            System.out.println(perm[i]);
         }
      */    
      
      //------------------------------------------------------
      	//kjo pjese e ben inicializimin e objekteve Kuti me mbretereshat e vendosura
      	//sipas vlerave te i-ve dhe j-ve ne kushtin if
         for(int i = 0; i < x.length; i++){
            for(int j = 0; j < x.length; j++){
               if((i == 0 & j == 1) || (i == 1 & j == 3) || (i == 2 & j == 5) || (i == 3 & j == 7) || (i == 4 & j == 2) || (i == 5 & j == 0)|| (i == 6 & j == 6) || (i == 7 & j == 4)){
                  x[i][j] = new Kutia(i, j, "M");
               }
               else{
                  x[i][j] = new Kutia(i, j, "");
               }
            }
         }
      //-------------------------------------------------------
      //pasi te jete inicializu 'situata', apo pasi te jene vendose mbretereshat ne tabele
      //situata x i pasohet klases model, ne menyre qe ajo t'i shenjoj kutite qe preken nga
      //mbreteresha (por jo edhe kutite qe jane te zena me mbretereshat)
         Model y = new Model(x);
         Eksi ek = new Eksi();
      //-------------------------------------------------------
      //keta dy cikle for bejn afishimin …
bibiki 18 Posting Whiz

I am trying to build an application that finds all possible ways of arranging 8 queens on a chess board in such a way that no two of them are on either the same row, column, or diagonal. I am also trying to do this applying what I think is supposed to be MVC architecture. However, I am a little confused and am having hard time with my view component.

here I have my view component:

import javax.swing.*;
   import java.awt.*;

   public class Eksi extends JPanel{
   
   //this field variable holds 64 squares of a chess board
   //that is, 64 instances of my Kutia class
      private Kutia[][] k;
      private Model doc;

      public Eksi(){
         RepaintManager.currentManager(this).setDoubleBufferingEnabled(false);
         JFrame x = new JFrame();
         x.getContentPane().add(this);
         x.setSize(500, 500);
         x.setVisible(true);
      }
   
      public void paintComponent(Graphics g){
      
         for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
               if((i+j)%2 == 0){
                  g.setColor(Color.black);
               }
               else{
                  g.setColor(Color.red);
               }
               g.fillRect(50 + i*20, 50 + j*20, 20, 20);
            }
         
         }
         if(k != null){
            for(int i = 0; i < 8; i++){
               for(int j = 0; j < 8; j++){
                  if(k[j][i].occupied()){
                     g.setColor(Color.white);
                     g.drawString(k[i][j].figura(), i*20 + 52, j*20 + 70);
                     try { Thread.sleep(3000); }
                        catch (InterruptedException e) { }					
                  }
               
               }			
            }
            try { Thread.sleep(300); }
               catch (InterruptedException e) { }
         }
      }
   
      public void ndihmesePaint(Kutia[][] ituk){
         k = ituk;
      	
         for(int i = 0; i < k.length; i++){
            for(int j = 0; j < k.length; j++){
               System.out.print(k[i][j].figura() + " " );
            }
            System.out.println();
         }
         repaint();      	
      }
   
   
   
   
   }

I expect that …

bibiki 18 Posting Whiz

this is a Java forum man, I don't know how is this related to java, but anyways:

say you have a binary number as follows 1001. that is, you have four digits. what 1001 actually says is that you have 1*2^3 + 0*2^2 + 0*2^1 + 1 *2^0 = 8 + 0 + 0 + 1 = 9. Analogously. you can find a 32 digit binary number's decimal equivalent.

AND, your most significant bit is the left-most bit as it indicates the highest power of two; your least significant bit is the right-most bit... say you have a decimal number 999. if you reduce the first digit by one, you reduced the number 999 by 100. if you reduce the last digit by 1, you reduce the number 999 by 1. this is why most significant bit is the left most one, and the least significant bit the right most one.

bibiki 18 Posting Whiz

I replaced line six with the following two lines, and expect it to work find. (in case some other reader may be interested)

c = x;
	touch(c);
bibiki 18 Posting Whiz

thank you a lot Ezzaral. kind regards!

bibiki 18 Posting Whiz

Hello people.
I have the following class.

public class Model{
      private Kutia[][] c;
   
   
      public Model(Kutia[][] x){
         c = touch(x);
      
      }
   	
      public void touch(Kutia[][] k){
         for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
               if(k[i][j].occupied()){
                  touchHorizontal(k, i, j);
                  touchVertical(k, i, j);						
               }
            }
         }
      }
   
      public void touchHorizontal(Kutia[][] k, int i, int j){
         for(int r = 0; r < 8; r++){
            if(r != j){
               k[r][j].increaseVlera();
            }
         }
      }
   
      public void touchVertical(Kutia[][] k, int i, int j){
         for(int r = 0; r < 8; r++){
            if(r != i){
               k[i][r].increaseVlera();
            }
         }	
      }
   
   
      public Kutia[][] modeled(){
         return c;
      }
   
   }

Compiler is complaining for line six - incompatible types. I don't get it: how is a Kutia[][] object incompatible with another Kutia[][] object. please help.

bibiki 18 Posting Whiz

for comparing whether a number is between two and five (inclusive) digits in length, you can also do a test on whether it is grater or equal to ten and less than 100.000. another advantage of this is that someone could give your app an input such as 01, and although its length is 2, it still is wrong because the output would be 'zero one' which should be same as 'one'... in case you proceed with testing input length as a string length.

bibiki 18 Posting Whiz

an idea:
say the shape is that of a star. you want more transparent stars to follow behind it. my idea is that you need to specify the number of stars first. say that are five stars, firs (1), second (2), 3, 4 5. when you initialize the app, each star has a position inside your screen. after this, every change that happens, should only be reflected on star one changing its position. star two assumes the previous position of star one, star three assumes the previous position of star two, star four that of star three, and star five that of star four. hope this helps, and if you write the app, share your code please. I would like to see how it turned out.

bibiki 18 Posting Whiz

try woking with BigINteger class. there are ways to turn BigINteger to int and vice versa, I think. hope that helps.

bibiki 18 Posting Whiz

i think each line is read as a single string. as a result, you could temporarily store your file in a String array, each line, one element on the array. and then, you put back the strings from your array to the file, excluding the ones you do not need on the file. that just means that you need first to open your file, count how many lines it has. initialize an array with that many elements on it. store file lines on the array. reopen your file, but now on writable mode (but not appendable), and put the strings from your array back on the file. hope this helps.

bibiki 18 Posting Whiz

you need an || (or operator) inside your loop, not an and operator. plus, in this code you posted you need two more sets of brackets, although I think you can do without the curly ones:

while ((lineNo == 1) || (lineNo == 2)){
br.readLine =null ;
}

try this know, and see if it works

bibiki 18 Posting Whiz

I tried to compile your code, but as I expected line 17 complains. besides, = is not a comparison operator, I assumed you meant ==. check that first!

bibiki 18 Posting Whiz

there must be some if statement that checks whether bullet border's (x and y positions) equal those of a monster, right? now, try adding/subtracting a few pixel's in that statement like:

if (bullet_border + 3 pixels == monster border){monster disappear}

if that does not work, try subtracting 3 pixels :)

bibiki 18 Posting Whiz

your getScores() method does not contain a line to take input. inside your constructor method, there is a line that takes input through nextInt() method. you need similar code for your getScores() method so that your app can get scores. plus, you need some array variable to store your input scores. and, your if statement on line 21 is of not much use. you'd be better of using a while loop which would execute as long as the input on line 18 is not in the range 0 - 15. hope this helps.

bibiki 18 Posting Whiz

yes there is. there must be somewhere in your code a part that updates bullet's position by increasing/decreasing the values of bullet's x and y positions. if you increase the number by which x and y positions increase, your bullet appears to move faster in your screen.

bibiki 18 Posting Whiz

if you know the standard used for naming methods and attributes, then it's actually easier. you tokenize the entire input file, and as James suggested, everything that's not a key word, is a class, method, or attribute name. now, you know class name follows keyword class. now, perhaps, method names start with a lower case letter, and attribute names contain only upper case letters. if you set the conventions for naming attributes and methods, your job to identify them is easier. just an idea.

bibiki 18 Posting Whiz

try posting the rest of your code.

bibiki 18 Posting Whiz

the best way to know if you are getting it right is to implement it, and along the way you'll see what you are doing wrong. what I tried to say is not exactly what you said last, but that does not mean your idea won't work. try it, see if it works, and if does not, come back and tell us what you did, and someone will help.