This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - root | |
cd /var | |
touch swap.img | |
chmod 600 swap.img | |
dd if=/dev/zero of=/var/swap.img bs=1024k count=8000 | |
mkswap /var/swap.img | |
swapon /var/swap.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.exceptions; | |
public class InvalidInputException extends Exception{ | |
/** | |
* | |
*/ | |
private static final long serialVersionUID = 1L; | |
public InvalidInputException(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.exceptions; | |
public class OutOfRangeException extends Exception { | |
/** | |
* | |
*/ | |
private static final long serialVersionUID = 1L; | |
public OutOfRangeException(String msg){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.implementation; | |
import nasa.main.Nasa; | |
public class TestMain { | |
public static void main(String args[]) { | |
try { | |
TestSignal test = new TestSignal(); | |
Nasa n = new Nasa(test); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.implementation; | |
import nasa.main.ISignal; | |
public class TestSignal implements ISignal { | |
private String bounds = "5 5"; | |
private String data = "LMLMLMLMM"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.main; | |
import java.util.StringTokenizer; | |
import nasa.exceptions.InvalidInputException; | |
import nasa.exceptions.OutOfRangeException; | |
public class ControlPanel { | |
private Rover rover; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.main; | |
public class Constants { | |
public static final byte DIRECTION_NORTH = 'N'; | |
public static final byte DIRECTION_EAST = 'E'; | |
public static final byte DIRECTION_SOUTH = 'S'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.main; | |
import nasa.exceptions.InvalidInputException; | |
import nasa.exceptions.OutOfRangeException; | |
public class Rover { | |
ControlPanel parentControl; | |
Heading currentHeading; | |
public Rover(ControlPanel control){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nasa.main; | |
public interface ISignal { | |
/** | |
* This returns the upper right corner of the Rectangle in string format | |
*/ | |
public String getBounds(); | |
/** |