Need help to check multiple conditions and set AD user properties

hello All,
I have a data csv sheet where information as follows, using below information I need to update AD account attributes based on below conditions . I have full right and I can set any user properties. So this is not access right issue.   
samaccountname,Othertelephone,language,employeeId
abcd                      XXXXXXXXX     EN         SMS
Now I need to check following conditions:
Othertelephone =  if this should not be blank ,if so display message " filed is blank " and no changes should allowed in further attributes and  it should abort
language= this field should only contain  EN or FR value if No display msg " error in language field " and no further changes to  the user attributes and it should abort
employeeID= this field should only contain OTP or SMS value if Not filled display msg " error in Employee ID field " No further changes to the user attributes and it should abort
changes to user will permit  when all attributes is filled. I do the testing taking samaccountname , othertelephone and employeeId into consideration but it did not helped. Getting error
THIS is complete Code Of my Task where you need my focus on conditions
group=Get-QAdGroup -SearchRoot  "domain/vpn group"
Import-Csv D:\VPN.csv |
ForEach-Object{
if ($_.samaccountname -eq "")
   Write-Host "SAMACCOUNTNAME is blank"   -fore red
else
 $user=Get-QAduser $_.samaccountname
if ($user.memberof -contains  $group.DN)
 Write-Host "$($_.Samaccountname) user is allready a member" -fore red
else
 Add-QADGroupMember $group $_.Samaccountname
If ($_.othertelephone -eq "")
Write-Output "$($_.samaccountname) telephone Number is blank"
else
if ($_.EmployeeID -notmatch 'OTP' -and 'SMS')
Write-Output "$($_.samaccountname) EmployeeID field is not correctly field")
Else
Set-QADUser $_.SamAccountName -ObjectAttributes @{telephonenumber=$_.othertelephone;EmployeeID=$_.EmployeeID}
error
Set-QADUser : Access is denied.
At C:\Users\g512263\AppData\Local\Temp\5f8facb6-f942-4c3d-b924-8953d9a706da.ps1:37 char:8
+                    Set-QADUser $_.SamAccountName -ObjectAttributes @{telephonenumber=$_.othe ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-QADUser], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.SetUserCm
   dlet

<title>Untitled - PowerGUI Script Editor</title>
Hello JRV,Thank you for your time, There is no comma in my csv file , I double check. below I wrote a simple code.I removed all the conditions and just try to set the EmployeeID and it is working fine with same file.But as soon as I add conditions it gives access denied. as well as if I remove employee Id from your previous code and only try to set telephone No. still it gives access denied.I am just trying to figure out what is causing this.
$group=Get-QAdGroup -SearchRoot "com/Group"
Import-Csv D:\VPN.csv |
ForEach-Object{
if ($_.samaccountname -eq ""){
Write-Host "SAMACCOUNTNAME is blank" -fore red
}else{
$user=Get-QAduser $_.samaccountname
if ($user.memberof -contains $group.DN){
Write-Host "$($_.Samaccountname) user is allready a member" -fore red
}else
Add-QADGroupMember $group $_.Samaccountname
If ($_.othertelephone -ne "")
Set-QADUser $user.SamAccountName -ObjectAtt Aributes @{telephonenumber=$_.othertelephone}
} else
Write-Output "$($_.samaccountname) phonenumber is blank"
If ($_.EmployeeID -ne "")
Set-QADUser $_.SamAccountName -ObjectAttributes @{EmployeeID=$_.EmployeeID}
}else
Write-Output "$($_.samaccountname) EmployeeID field is blank"
If ($_.Preferredlanguage -ne "")
Set-QADUser $_.SamAccountName -ObjectAttributes @{Preferredlanguage=$_.preferredlanguage}
} else
Write-Output "$($_.samaccountname) PreferredLanguage field is blank"

Similar Messages

  • Hi! I am newbie to Reports need help with check boxes

    Hi! I am newbie to Reports need help with check boxes. I am try-in to make a new check boxes that will validate in runtime. I have created two frames and one frame is dummy and other frame has big X line on it with conditions. Is this a right way to create check box! Please help thanks!

    and one frame is dummy and other frame has big X
    line on it with conditions. Is this a right way to
    create check box! Please help thanks!Instead of creating a frame for X, you can create Ractangle and place X in it. Rest is fine.

  • Need help in creating multiple signature forms?

    need help in creating multiple signature forms that can be digitally signed in adobe reader

    Automator gets a bit unweildy when trying to vary things outside of what the actions provide.  Since you are already using an AppeScript in your workflow, might as well do the whole thing:
    set baseFolder to (path to desktop) -- the location to create the folder
    display dialog "Please provide a new folder name:" default answer "test"
    set folderName to text returned of the result
    repeat -- keep repeating until a number is returned
      display dialog "How many subfolders?" default answer "5"
      set theNumber to text returned of the result
        try -- test the result
          set theNumber to theNumber as integer
          exit repeat -- success
        end try
    end repeat
    tell application "Finder"
      try -- make new folder
        set newFolder to (make new folder at baseFolder with properties {name:folderName})
      on error number -48 -- skip errors if the folder is already there
        set newFolder to ((baseFolder as text) & folderName) as alias
      end try
      repeat with X from 1 to theNumber
        try -- make new subfolder
          make new folder at newFolder with properties {name:folderName & X}
        on error number -48 -- skip errors if the folder is already there
        end try
      end repeat
    end tell

  • Help me check 2 fields and then show final number

    I'm very new to JavaScript and need a little help with a function.
    I need to have JS check to make sure 'Equipment Description' and 'Equipment Serial' are filled out before showing a field named 'Incentive'. My hope is that if the fields are NOT filled out that it will then give an app.alert('Please enter an equipment serial number').
    I had originally started a different way and this was as far as I got if that helps anyone. (the first 2 lines are used because there are many rows of information that can be gathered - this was from a previous developer who is no longer on our team ) The issue is that they are seperate and I need it to check for both and obviously it doesn't tell the incentive field to do anything as far as visibility goes. I am file starting from scratch and not using this code.
    function getcheck() {
    var rowName = event.target.name;
    var rowNum = rowName.substr(rowName.length-5,5);
    if (this.getField("Equipment Description"+ rowNum).value == " ") {
         app.alert('Please enter an equipment description');
    if (this.getField("Equipment Serial"+ rowNum).value == " ") {
         app.alert('Please enter an equipment serial number');
    Any help is appreciated.

    In case clicking over to the original thread is too much work...
    And your question is...?
    Are you asking someone to just do your homework for you? If not, then what particular part are you having trouble with? We're not going to read your mind.
    You should be able to at least make a start on this assignment. If you can't, then either you haven't been paying attention in class, or you don't have much ability in this area or your instructor is giving assignments that are way beyond the level of what he's teaching. Whichever of these it is, it's beyond the scope of this forum to address it--you'll have to deal with it.
    If you've done some work, then post it (in and tags) and explain specifically what troubles you're having.

  • I need to factory restore my iPhone and set up as new device...

    I need to factory restore my iPhone and set up as new device... If I back up the device, but set it up as a new iPhone, will I be able to get all of my data, apps, music, notes, texts and settings back? (ditto with TeamLava game data??)
    I need 100% confirmation as I'm worried I'll lose both some important app and data on their, as well as some hard-earned game time on a few apps!!
    (The reason I need to restore and set up fresh - I set this iPhone up from a back years ago which pulled through an encrypted local backup password that I don't remember setting and no password I can think of will turn it off. I have been told the only way around this is to factory restore and set up as a new iPhone)
    Many thanks in advance for any and all advice. I welcome your Apple expertise!

    Stupid Apple! Thanks though.
    Can you confirm what I will and will not be able to get back? (Bare in mind I also have an iPad that syncs things like Notes.)
    Contacts - can back up to Orange App
    Music - I mainly use Spotify anyway
    Text Messages?
    Safari bookmarks?
    Previously purchased Apps? (or will I just have to re-download them?)
    The data on these apps? (I guess most will either be simply logging in, or re-setting up)
    Storm8/TeamLava Game progress?
    Again, thanks in advance for your help.

  • I need help integrating Microsoft Office, Outlook and Calendar with my job and is it possible

    Ok guys I am new to the iphone 4s. I just dumped my Blackberry after 10 years. I need help integrating Microsoft Office, Outlook and Calendar with my job and is it possible? Also I need it to automatically push email and appointments to my phone? I will buy any app just need to know which is best for work environment. Here is what I am thinking about doing. http://www.groovypost.com/howto/apple/sync-iphone-or-ipod-touch-calendar-and-con tacts-with-google/ Is this the best way? For personal use I am using paid G whiz app

    I use Google Calendar Sync to sync my work Outlook calendar to a gmail account, then sync that to my iPhone.  It works well for me for the past couple of years.
    As far as mail itself, just ask your it folks for settings for remote access to your exchange account, and then set it up on the phone.
    As far as working with Office docs, to be able to actually edit them and such, look in the app store for DocsToGo or QuickOffice - they both are good but each has it's pros and cons, so on balance it's down to mere preference i think.

  • Need help with my iPhone 5 and my Macbook Pro.

    Need help with my iPhone 5 and my Macbook Pro.  I was purchased some music on itunes at my mac. Some reason I deleted those music from both on Mac and iPhone 5.  Today, I went to my iPhone iTunes store inside of iCloud to redownload my puchased. But those song won't able to sync back to my iTunes library on my Mac.  Can anyone help me with that ??....
    iPhone 5, iOS 6.0.1

    You've posted to the iTunes Match forum, which your question does not appear to be related to. You'll get better support responses by posting to either the iTunes for Mac or iTunes for Windows forum. Which ever is more appropriate for your situation.

  • TS4268 I need help getting my face time and imessage to work.

    I need help getting my face time and imessage to work. It is saying wating for activation. I just got my iphone 5 2 days ago. I have reset it from the phone and from itunes on the computer, made sure I'm attached to wifi.

    The 3 basic troubleshooting steps are these in order: 1. Restart your iphone  2.  Reset your settings/iphone  3.  Restore your iphone.  Since your iphone is only a couple of days old, you should backup your device before restoring.  If you don't have anything on your iphone that you care to lose, then simply restoring without a backup is fine.  A quick reset of pressing the sleep/wake button (top of iphone) and your home button simultaneously and holding it until the silver Apple logo appears. 

  • I am john and I need help downloading a progmmme yesterday and wanted to finish downloading open it and I am not told me that the program was shut down unexpectedly and restart ponia not opened and went back to download it and not opened my back probe to

    i am john and I need help downloading a progmmme yesterday and wanted to finish downloading open it and I am not told me that the program was shut down unexpectedly and restart ponia not opened and went back to download it and not opened my back probe to turn off the computer and there was no case

    i am john and I need your help yesterday bought a program called DJAY when I finish the download and got an error opened and I saw him there was no case to install and thank you for your help anyway

  • I need help i lost my ipod and found it but someone elses id is on it i trtied resoring it but i still cant go in it help

    i need help i lost my ipod and found it but someone elses id is on it i trtied resoring it but i still cant go in it help

    See this -> Find My iPhone Activation Lock: Removing a device from a previous owner’s account

  • I need to change my billing info and set up a busi...

    I need to change my billing info and set up a business account.

    Hello matthew1405tallai,
    I have linked an article that will walk you through the process of updating your payment information:
    iTunes Store: Changing your payment information
    http://support.apple.com/kb/ht1918
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Need help moving my cs5 illustrator and photoshop to my new computer

    I need help installing my cs5 illustrator and photoshop on my new computer

    I have a macbook air...not sure what operating system....
    Kelsey West
    Kelsey West Designs
    [email protected]
    818.631.0172
    [image:
    http://www.hmcatering.com/wp-content/uploads/2013/03/AsSeenOnSMP_Blue.png][image:
    http://tobinphotography.com/wp-content/uploads/2013/02/Style_me_pretty_blog_badge.png]

  • I need help trying to print ,move and resize multiple images on a page to print!help!

    can anyone give me to some advice. I was using an older version of photoshop elements where i could position the image i wanted to print on the page. I could resize it, move it around and add more photo's. I print small images that I cut out for jewelry making and need to be able to add 12 small images to a 4x6 print size page. My new elements is not allowing me to do that! I'm frustrated and need help!! thanks!

    It should work just the same as before: create a blank document, place your images on it, then print it. The only difference is that you can't change the position of the image in the print window anymore.

  • I need help to draw an image and move it plz plz : )

    Ok, so I have this whole code and I understand most of it but not all of it but I'm trying to make image "drop.gif" to move down the right side of the window. For each shot that is taken the image moves down ever so much and if the image hits the Entity ship "background" than notify death. PLease anyone help me !
    there are 7 classes but here is the main ...
    package spaceinvaderss;
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.image.BufferStrategy;
    import java.util.ArrayList;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class Main extends Canvas {
    /*A Canvas component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.
    An application must subclass the Canvas class in order to get useful functionality such as creating a custom component.
    The paint method must be overridden in order to perform custom graphics on the canvas.*/
    /** The stragey that allows us to use accelerate page flipping.*/
    private BufferStrategy strategy;
    /** True if the game is currently "running", i.e. the game loop is looping */
    private boolean gameRunning = true;
    /** The list of all the entities that exist in our game */
    private ArrayList entities = new ArrayList();
    /** The list of entities that need to be removed from the game this loop */
    private ArrayList removeList = new ArrayList();
    /** The entity representing the player */
    private Entity ship;
    /** The entity representing the alien */
    private Entity alien;
    /** The speed at which the player's ship should move (pixels/sec) */
    private double moveSpeed = 600;
    /** The time at which last fired a shot */
    private long lastFire = 0;
    /** The interval between our players shot (ms) */
    private long firingInterval = 400;
    /** timer */
    private long time = 0;
    /** The number of aliens left on the screen */
    private int alienCount;
    /** The message to display which waiting for a key press */
    private String message = "";
    /** True if we're holding up game play until a key has been pressed */
    private boolean waitingForKeyPress = true;
    /** True if the left cursor key is currently pressed */
    private boolean leftPressed = false;
    /** True if the right cursor key is currently pressed */
    private boolean rightPressed = false;
    /** True if we are firing */
    private boolean firePressed = false;
    /** True if game logic needs to be applied this loop, normally as a result of a game event */
    private boolean logicRequiredThisLoop = false;
    private static Image drop;
    /** The constant for the width*/
    private int DOMAIN = 800;
    /** The constant fot the length*/
    private int RANGE = 950;
    /** The constant for the number of rows of aliens */
    private int numbaofrows = 8;
    /** The constant for the number of aliens per row */
    private int aliensperrow = 12;
    /** The constant for the percent of which the speed increases*/
    private double speedincrease = 1.02;
    /** Starts the variable that counts the shots*/
    private int shotsfired = 0;
    /** Construct our game and set it running.*/
    public Main() {
    // Creates a frame to contain Main.
    JFrame container = new JFrame("SPACE INVADERS !!! WOOT !!! WOOT !!!");
    // Gets a hold of the content of the frame and sets up the resolution of the game
    // Names the inside of the "container" as panel.
    JPanel panel = (JPanel) container.getContentPane();
    // Stes the demensions of the panel.
    panel.setPreferredSize(new Dimension(DOMAIN,RANGE));
    //Sets the layout as nothing which overrides any automatic properties.
    panel.setLayout(null);
    // Sets up our canvas size and puts it into the content of the frame
    setBounds(0, 0, DOMAIN, RANGE);
    panel.add(this);
    // Tell AWT not to bother repainting our canvas since we're
    // going to do that our self in accelerated mode.
    setIgnoreRepaint(true);
    // Actually sizes the window approximately.
    container.pack();
    // Makes it so that the window can't be resized.
    container.setResizable(false);
    // Makes the window visible.
    container.setVisible(true);
    // Add a listener to respond to the user pressing the x.
    // End the program when the window is closed.
    container.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    // add a key input system (defined below) to our canvas
    // so we can respond to key pressed
    addKeyListener(new KeyInputHandler());
    // request the focus so key events come to us
    requestFocus();
    // Create the buffering strategy which will allow AWT
    // to manage our accelerated graphics.
    createBufferStrategy(2);
    strategy = getBufferStrategy();
    // initialise the entities in our game so there's something
    // to see at startup
    initEntities();
    time = System.currentTimeMillis();
    * Start a fresh game, this should clear out any old data and
    * create a new set.
    private void startGame() {
    // clear out any existing entities and intialise a new set
    entities.clear();
    initEntities();
    // blank out any keyboard settings we might currently have
    leftPressed = false;
    rightPressed = false;
    firePressed = false;
    * Initialise the starting state of the entities (ship and aliens). Each
    * entitiy will be added to the overall list of entities in the game.
    private void initEntities() {
    ClassLoader cloader = Main.class.getClassLoader();
    drop = Toolkit.getDefaultToolkit().getImage(cloader.getResource("drop.gif"));
    prepareImage(drop, this);
    // create the player ship and place it in the center of the screen
    ship = new ShipEntity(this,"background.gif", 0, (RANGE - 75));
    entities.add(ship);
    ship = new ShipEntity(this,"ship.gif", (DOMAIN / 2) - 0, (RANGE - 50));
    entities.add(ship);
    // create a block of aliens
    alienCount = 0;
    for (int row = 0; row < numbaofrows; row++) {
    for (int x = 0; x < aliensperrow; x++) {
    alien = new AlienEntity(this,"alien.gif", 100 + (x*50),(50)+row*30);
    entities.add(alien);
    alienCount++;
    * Notification from a game entity that the logic of the game
    * should be run at the next opportunity (normally as a result of some
    * game event)
    public void updateLogic() {
    logicRequiredThisLoop = true;
    * Remove an entity from the game. The entity removed will
    * no longer move or be drawn.
    * Remove the entity
    public void removeEntity(Entity entity) {
    removeList.add(entity);
    /**Notify that the player has died.*/
    public void notifyDeath() {
    message = "Oh no! The aliens win, wanna try again?";
    waitingForKeyPress = true;
    /** Notification that the player has won since all the aliensare dead.*/
    public void notifyWin() {
    long time2;
    time2 = (System.currentTimeMillis() - time) / 1000;
    int acuracy = 1000*(aliensperrow*numbaofrows)/shotsfired;
    message = "Congradulations! You win! Your time was: " + time2 + " seconds. Your acuracy was " + acuracy + "%.";
    waitingForKeyPress = true;
    /**Notification that an alien has been killed*/
    public void notifyAlienKilled() {
    // reduce the alient count, if there are none left, the player has won!
    alienCount--;
    if (alienCount == 0) {
    notifyWin();
    // if there are still some aliens left then they all need to get faster, so
    // speed up all the existing aliens
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    if (entity instanceof AlienEntity) {
    // speed up every time the aliens move down
    entity.setHorizontalMovement(entity.getHorizontalMovement() * speedincrease);
    /**Attempt to fire a shot from the player. Its called "try" since we must first
    * check that the player can fire at this point, i.e. has he/she waited long
    * enough between shots.*/
    public void tryToFire() {
    // check that we have been waiting long enough to fire
    if (System.currentTimeMillis() - lastFire < firingInterval) {
    return;
    // if we waited long enough, create the shot entity, and record the time.
    lastFire = System.currentTimeMillis();
    ShotEntity shot = new ShotEntity(this, "bullet.gif", ship.getX() + 27, ship.getY() - 30);
    entities.add(shot);
    * The main game loop. This loop is running during all game
    * play as is responsible for the following activities:
    * - Working out the speed of the game loop to update moves
    * - Moving the game entities
    * - Drawing the screen contents (entities, text)
    * - Updating game events
    * - Checking Input
    public void gameLoop() {
    long lastLoopTime = System.currentTimeMillis();
    // Keep looping around till the game ends.
    while (gameRunning) {
    // Work out how long its been since the last update, this
    // will be used to calculate how far the entities should
    // move this loop.
    long delta = System.currentTimeMillis() - lastLoopTime;
    lastLoopTime = System.currentTimeMillis();
    // Get hold of a graphics context for the accelerated
    // surface and black it out.
    Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
    g.setColor(Color.black);
    g.fillRect(0, 0, DOMAIN, RANGE);
    // Cycle around asking for each entity to move itself.
    if (!waitingForKeyPress) {
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.move(delta);
    // cycle round drawing all the entities we have in the game
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.draw(g);
    // brute force collisions, compare every entity against
    // every other entity. If any of them collide notify
    // both entities that the collision has occured
    for (int p = 0; p < entities.size(); p++) {
    for (int s = p + 1; s < entities.size(); s++) {
    Entity me = (Entity) entities.get(p);
    Entity him = (Entity) entities.get(s);
    if (me.collidesWith(him)) {
    me.collidedWith(him);
    him.collidedWith(me);
    // remove any entity that has been marked for clear up
    entities.removeAll(removeList);
    removeList.clear();
    // if a game event has indicated that game logic should
    // be resolved, cycle round every entity requesting that
    // their personal logic should be considered.
    if (logicRequiredThisLoop) {
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.doLogic();
    logicRequiredThisLoop = false;
    // if we're waiting for an "any key" press then draw the
    // current message
    if (waitingForKeyPress) {
    g.setColor(Color.green);
    g.drawString(message,(DOMAIN-g.getFontMetrics().stringWidth(message)) / 2, 250);
    g.drawString("TO PLAY, PRESS ANY KEY : )", (DOMAIN-g.getFontMetrics().stringWidth("TO PLAY, PRESS ANY KEY : )")) / 2, 40);
    // Clear up the graphics.
    g.dispose();
    // Flip the buffer over.
    strategy.show();
    // resolve the movement of the ship. First assume the ship
    // isn't moving. If either cursor key is pressed then
    // update the movement appropraitely
    ship.setHorizontalMovement(0);
    if ((leftPressed) && (!rightPressed)) {
    ship.setHorizontalMovement(-moveSpeed);
    } else if ((rightPressed) && (!leftPressed)) {
    ship.setHorizontalMovement(moveSpeed);
    // if we're pressing fire, attempt to fire
    if (firePressed) {
    shotsfired++;
    tryToFire();
    // finally pause for a bit. Note: this should run us at about
    // 100 fps but on windows this might vary each loop due to
    // a bad implementation of timer
    try { Thread.sleep(10); } catch (Exception e) {}
    * A class to handle keyboard input from the user. The class
    * handles both dynamic input during game play, i.e. left/right
    * and shoot, and more static type input (i.e. press any key to
    * continue)
    * This has been implemented as an inner class more through
    * habbit then anything else. Its perfectly normal to implement
    * this as seperate class if slight less convienient.
    private class KeyInputHandler extends KeyAdapter {
    /** The number of key presses we've had while waiting for an "any key" press */
    private int pressCount = 1;
    * Notification from AWT that a key has been pressed. Note that
    * a key being pressed is equal to being pushed down but NOT
    * released. Thats where keyTyped() comes in.
    * @param e The details of the key that was pressed
    public void keyPressed(KeyEvent e) {
    // if we're waiting for an "any key" typed then we don't
    // want to do anything with just a "press"
    if (waitingForKeyPress) {
    return;
    if (e.getKeyCode() == KeyEvent.VK_LEFT) {
    leftPressed = true;
    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
    rightPressed = true;
    if (e.getKeyCode() == KeyEvent.VK_SPACE) {
    firePressed = true;
    * Notification from AWT that a key has been released.
    * @param e The details of the key that was released
    public void keyReleased(KeyEvent e) {
    // if we're waiting for an "any key" typed then we don't
    // want to do anything with just a "released"
    if (waitingForKeyPress) {
    return;
    if (e.getKeyCode() == KeyEvent.VK_LEFT) {
    leftPressed = false;
    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
    rightPressed = false;
    if (e.getKeyCode() == KeyEvent.VK_SPACE) {
    firePressed = false;
    * Notification from AWT that a key has been typed. Note that
    * typing a key means to both press and then release it.
    * @param e The details of the key that was typed.
    public void keyTyped(KeyEvent e) {
    // if we're waiting for a "any key" type then
    // check if we've recieved any recently. We may
    // have had a keyType() event from the user releasing
    // the shoot or move keys, hence the use of the "pressCount"
    // counter.
    if (waitingForKeyPress) {
    if (pressCount == 1) {
    // since we've now recieved our key typed
    // event we can mark it as such and start
    // our new game
    waitingForKeyPress = false;
    startGame();
    pressCount = 0;
    } else {
    pressCount++;
    // if we hit escape, then quit the game
    if (e.getKeyChar() == 27) {
    System.exit(0);
    * The entry point into the game. We'll simply create an
    * instance of class which will start the display and game
    * loop.
    * @param argv The arguments that are passed into our game
    public static void main(String argv[]) {
    Main g = new Main();
    // Starts the main game loop, this method will not return until the game has finished running. Hence we are
    // using the actual main thread to run the game.
    g.gameLoop();
    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Ap_Compsci_student_13 wrote:
    ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long.

  • I need help to recover my Entourage and iCal

    I have just synced my iphone - daily event - but this time all the calender entries hit the fan!  Oh dear, what a mess.  I appeared to have duplicateds of almost everything! 
    So I went through day by day deleting and updated profiles etc.  then I thought Id check that iCal had everything (needed for the iphone sync) and found it had no entries at all!  I tried to use TM to go back to this morning on Entrouage with little effexct.  I had to reinstall Entrougage (2008).  All appeared ok - but then I checked iCal again and no sync services were imported. 
    I then used the import from iCal to import entourgage and it appeared to do this several times.  I ended up again with duplicates calendars. 
    I mistakingly then deleted the Entourage calendars from iCal which then deleted the Entourage entries.  I am in a right mess!  Somewhere through this process I did copy the main identity and have since imported that back into Entrouage but its come back without catogoriers and projects. 
    Please... is there not a way I can just revert everything back to earlier this morning (I have Time Machine set up) without having to completely reinstall everything. I really miss thsat useful 'system estore' on PC! And.. if possible , has anyone any ideas why this happed?

    Sorry to say that no one was able to help me.  Apples upport closed for the evening so I was on my own!!  I ended up having to reinstall OS X and restore to earlier time through time machne.  That was ok but iCal did not restore.  Entourage was ok - so I decided to import Entrouage again into iCal and started that process last night - and I have just aborted it as it was taking so many hours.  I thought perhaps i'd be better using Outlook 2011??  Just set that all up only to find that it doesn't sync with iCal???  How do I get that onto my iphone then?  Getting increasingly frustrated here....

Maybe you are looking for

  • How to get text vertically centred in Li box

    I am updating our company website in another area of the system which is why you'll see a tf in the web address I am about to give. http://www.essentialfinance.net/tf/products/reconciling/accruals_manager.asp Now, the problem I have is that the optio

  • Input a string and assign to a variable in the console window

    i'm absolutely and completely new to java i need to be able to input a string and then assign it to a variable, entirely using the console window, basically i'm looking for the Java alternative to C++'s "cin" i've tried the System.in. method but noth

  • Spelling Errors In Mail Are Not Highlighted As I Type

    Hi, I have 'Check Spelling As I Type' enabled in Preferences in Mail, however my spelling errors are not highlighted (underlined in red) as I type. This feature used to work but for some reason no longer does - not sure if this is attributable to rec

  • Major Aperture 3 memory leak

    Well, I've completed the migration of my A2 library over to A3, but it still needed to do some processing. I left it overnight and awoke to find a "Warning: Your startup disk is almost full" message, Aperture 3 paused, and everything else paged out o

  • Regarding Updating Database

    hi guys, i just got a problem with updation of Database table EINE. I got some price details and these details have to be updated to EINE-NETPR. i am using select statement to select price details and using update command to update EINE-netpr.     up