Help with replacing char

I have been working with this code for almost a week now and I cannot figure out what I am doing wrong. The program initializes fine, but when I go to use the ActionListener it goes haywire. The purpose of this code is to mask a string and then unmask the characters one letter at a time, sort of like hangman. I got the mask working, unmasking is where I am seriously stuck. Please can I get some help here in figuring out what I am doing wrong. Code is posted below.
   import javax.swing.*;
   import java.awt.*;
   import java.awt.event.*;
   import java.util.*;
    public class JSecretPhrase extends JApplet implements ActionListener
      JLabel title = new JLabel("Secret Phrase Game");
      JLabel intro = new JLabel("Play our game - guess the phrase");
      JLabel enter = new JLabel("Enter one letter");
      //array of Strings for the random phrase
      String[] secretPhrase = {"PAPAS GOT A NEW PAIR OF SHOES",
                         "LIFE IS A BEACH",
                         "DID YOU GET THE MEMO",
                         "LIVE LAUGH AND LOVE",
                         "A PENNY SAVED IS A PENNY EARNED",
                         "ARE YOU GONNA EAT THOSE TOTS",
                         "LIVE FAST AND RIDE HARD",
                         "LIFE IS LIKE A BOX OF CHOCOLATES",
                         "WOULD YOU LIKE FRIES WITH THAT",
                         "HOOAH ITS AN ARMY THING"};
      JLabel phraseMask = new JLabel("");
      JLabel yesOrNo = new JLabel("");
      JButton[] letter = new JButton[26];
      Font font1 = new Font("TimesRoman", Font.BOLD, 34);
      Font font2 = new Font("TimesRoman", Font.BOLD, 20);
      String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      int rand;
      String phrase, phraseTrue, phraseFix;
      char phraseLtr, buttonLtr, phraseLtrTrue, replaceLtr;
      Container con = getContentPane();
      //random number generator for the selection of the phrase
       public void choosePhrase()
         Random generator = new Random();
         for (int i = 1; i < 11; i++)
            rand = generator.nextInt(10);
       public void init()
         con.setLayout(new FlowLayout());
         con.add(title);
         con.add(intro);
         con.add(enter);
         choosePhrase();
         phraseTrue = secretPhrase[rand];
         phrase = phraseTrue;
         con.add(phraseMask);
         con.add(yesOrNo);
         title.setFont(font1);
         intro.setFont(font2);
         for (int i = 0; i < letters.length(); i++)
            String ltr = Character.toString(letters.charAt(i));
            letter[i] = new JButton(ltr);
            letter.addActionListener(this);
con.add(letter[i]);
for (int p = 0; p < phrase.length(); ++p)
phraseLtr = phrase.charAt(p);
for (int c = 0; c < letters.length(); ++c)
buttonLtr = letters.charAt(c);
if(buttonLtr == phraseLtr)
phrase = phrase.replace(phraseLtr, '*');
phraseMask.setFont(font2);
phraseMask.setText(phrase);
public void actionPerformed(ActionEvent e)
Object source = e.getSource();
for(int s = 0; s < letter.length; ++s)
if(source == letter[s])
buttonLtr = letters.charAt(s);
letter[letters.indexOf(buttonLtr)].setEnabled(false);
for(int t = 0; t < phraseTrue.length(); t++)
phraseLtrTrue = phraseTrue.charAt(t);
if(phraseLtrTrue == buttonLtr)
phraseFix = phrase.replace(phrase.charAt(phraseTrue.indexOf(phraseLtrTrue)), buttonLtr);
phraseMask.setText(phraseFix);
yesOrNo.setText("Correct!");
else
yesOrNo.setText("Sorry - not in the phrase: " + buttonLtr);

corlettk wrote:
TrailorParkKid,
(I love your handle)lol, 30 years old and I still call myself that. Some things you just never grow out of.
>
Yeah, java.lang.* is imported automatically.
The question is what is phrase. Is it a StringBuilder? ... I suspect it's a String.
Cheers. Keith.I started playing with the StringBuilder Class and had a small breakthrough, but I still have a small issue. Instead of unmasking the entire phrase on the first pressed letter that is in the phrase and making them all the same letter, it only unmasks the entire phrase when the last letter in the phrase is the correctly pressed button and shows the phrase as it should read.
I suspect that one of my loops is not working as intended, I just don't know how to determine which one and what to change.
New Code:
import javax.swing.*;
   import java.awt.*;
   import java.awt.event.*;
   import java.util.*;
    public class JSecretPhrase extends JApplet implements ActionListener
      JLabel title = new JLabel("Secret Phrase Game");
      JLabel intro = new JLabel("Play our game - guess the phrase");
      JLabel enter = new JLabel("Enter one letter");
      //array of Strings for the random phrase
      String[] secretPhrase = {"PAPAS GOT A NEW PAIR OF SHOES",
                         "LIFE IS A BEACH",
                         "DID YOU GET THE MEMO",
                         "LIVE LAUGH AND LOVE",
                         "A PENNY SAVED IS A PENNY EARNED",
                         "ARE YOU GONNA EAT THOSE TOTS",
                         "LIVE FAST AND RIDE HARD",
                         "LIFE IS LIKE A BOX OF CHOCOLATES",
                         "WOULD YOU LIKE FRIES WITH THAT",
                         "HOOAH ITS AN ARMY THING"};
      JLabel phraseMask = new JLabel("");
      JLabel yesOrNo = new JLabel("");
      JButton[] letter = new JButton[26];
      Font font1 = new Font("TimesRoman", Font.BOLD, 34);
      Font font2 = new Font("TimesRoman", Font.BOLD, 20);
      String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      int rand;
      String phrase, phraseTrue, pLtrT, phraseFix;
      char phraseLtr, buttonLtr, phraseLtrTrue, replaceLtr;
      StringBuilder phraseBuilder = new StringBuilder();
      Container con = getContentPane();
      //random number generator for the selection of the phrase
       public void choosePhrase()
         Random generator = new Random();
         rand = generator.nextInt(10);
       public void changeLetter()
         for(int t = 0; t < phraseTrue.length(); t++)
            phraseLtrTrue = phraseTrue.charAt(t);
            pLtrT = Character.toString(phraseLtrTrue);
    @Override
       public void init()
         con.setLayout(new FlowLayout());
         con.add(title);
         con.add(intro);
         con.add(enter);
         choosePhrase();
         phraseTrue = secretPhrase[rand];
         phrase = phraseTrue;
         con.add(phraseMask);
         con.add(yesOrNo);
         title.setFont(font1);
         intro.setFont(font2);
         for (int i = 0; i < letters.length(); i++)
            String ltr = Character.toString(letters.charAt(i));
            letter[i] = new JButton(ltr);
            letter.addActionListener(this);
con.add(letter[i]);
phraseBuilder = new StringBuilder(phrase);
for (int p = 0; p < phrase.length(); ++p)
phraseLtr = phrase.charAt(p);
for (int c = 0; c < letters.length(); ++c)
buttonLtr = letters.charAt(c);
if(buttonLtr == phraseLtr)
phrase = phrase.replace(phraseLtr, '*');
phraseMask.setFont(font2);
phraseMask.setText(phrase);
public void actionPerformed(ActionEvent e)
Object source = e.getSource();
int phraseIndex = 0;
String bLtr = null;
for(int s = 0; s < letter.length; ++s)
if(source == letter[s])
buttonLtr = letters.charAt(s);
bLtr = Character.toString(buttonLtr);
letter[letters.indexOf(buttonLtr)].setEnabled(false);
changeLetter();
phraseIndex = phraseTrue.indexOf(phraseLtrTrue);
if(pLtrT.equals(bLtr))
phraseBuilder.setCharAt(phraseIndex,buttonLtr);
phraseFix = phraseBuilder.toString();
phraseMask.setText(phraseFix);
yesOrNo.setText("Correct!");
else
yesOrNo.setText("Sorry - not in the phrase: " + buttonLtr);

Similar Messages

  • Help with Replacing text in a file using a vbscript

    I have the following script which I am wanting to
    1. Take the prf file and read it
    2. Edit a line in the  outlook .prf file replacing it with the text I have asked it to replace which is the full name of the user pulled from the currently logged on user
    The problem I am seeing is that when the temp file is being generated it is throwing off the formatting of the file hence the script doesn't work. Can anyone help me please.
    set objSysInfo = CreateObject("ADSystemInfo")
    struser = objSysInfo.Username
    set objUser = GetObject("LDAP://" & strUser)
    strFullName = objUser.Get("displayName")
    Const ForReading=1
    Const ForWriting=2
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    folder = "C:\test"
    'filePath = folder & "file.txt"
    filePath = "c:\test\test2007_3.prf"
    Set myFile = objFSO.OpenTextFile(filePath, ForReading)
    Set myTemp= objFSO.OpenTextFile(filePath & ".tmp", ForWriting, True)
    Do While Not myFile.AtEndofStream
    myLine = myFile.ReadLine
     If InStr(myLine, "MailboxName=%UserName%") Then
      myLine = "&strFullName"
     End If
     myTemp.WriteLine myLine
    Loop
    myFile.Close
    myTemp.Close
    objFSO.DeleteFile(filePath)
    objFSO.MoveFile filePath& ".tmp", filePath
    Christopher

    Sorry Irv,
    Here is the code I have and then after that is the prf file. I think there is an issue with the file structure because if I take a regular text file and add the lines in there myself it replaces the lines, but with the prf file or even the prf file as a
    text file it gives me the invalid argument message
    Const filePath = "c:\test\test2007_3.txt"
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     Set myFile = objFSO.OpenTextFile(filePath)
    fileText = myFile.ReadAll()
    myFile.Close
    fileText=Replace(fileText,"%UserName%","THIS_IS_THS_REPLACEMENT_TEXT")
     Set myTemp= objFSO.OpenTextFile(filePath, 2, True)
     myTemp.Write fileText
     myTemp.Close
    ;Automatically generated PRF file from the Microsoft Office Customization and Installation Wizard
    ; Section 1 - Profile Defaults
    [General]
    Custom=1
    ProfileName=Somthing
    DefaultProfile=Yes
    OverwriteProfile=Yes
    ModifyDefaultProfileIfPresent=false
    DefaultStore=Service1
    ; Section 2 - Services in Profile
    [Service List]
    ServiceX=Microsoft Outlook Client
    ServiceEGS=Exchange Global Section
    Service1=Microsoft Exchange Server
    ServiceEGS=Exchange Global Section
    ; Section 3 - List of internet accounts
    [Internet Account List]
    ; Section 4 - Default values for each service.
    [ServiceX]
    CachedExchangeMode=0x00000002
    CachedExchangeSlowDetect=true
    [ServiceEGS]
    CachedExchangeConfigFlags=0x00000900
    MailboxName=%UserName%
    HomeServer=
    RPCoverHTTPflags=0x0027
    RPCProxyServer=
    RPCProxyPrincipalName=
    RPCProxyAuthScheme=0x0001
    [Service1]
    OverwriteExistingService=No
    UniqueService=Yes
    MailboxName=%UserName%
    HomeServer=
    OfflineAddressBookPath=%USERPROFILE%\local settings\application data\microsoft\outlook\
    OfflineFolderPathAndFilename=%USERPROFILE%\local settings\application data\microsoft\outlook\outlook.ost
    AccountName=Microsoft Exchange Server
    DefaultAccount=TRUE
    ;[ServiceX]
    ;FormDirectoryPage=
    ;-- The URL of Exchange Web Services Form Directory page used to create Web forms.
    ;WebServicesLocation=
    ;-- The URL of Exchange Web Services page used to display unknown forms.
    ;ComposeWithWebServices=
    ;-- Set to true to use Exchange Web Services to compose forms.
    ;PromptWhenUsingWebServices=
    ;-- Set to true to use Exchange Web Services to display unknown forms.
    ;OpenWithWebServices=
    ;-- Set to true to prompt user before opening unknown forms when using Exchange Web Services.
    ; Section 5 - Values for each internet account.
    ; Section 6 - Mapping for profile properties
    [Microsoft Exchange Server]
    ServiceName=MSEMS
    MDBGUID=5494A1C0297F101BA58708002B2A2517
    MailboxName=PT_STRING8,0x6607
    HomeServer=PT_STRING8,0x6608
    OfflineAddressBookPath=PT_STRING8,0x660E
    OfflineFolderPathAndFilename=PT_STRING8,0x6610
    [Exchange Global Section]
    SectionGUID=13dbb0c8aa05101a9bb000aa002fc45a
    MailboxName=PT_STRING8,0x6607
    HomeServer=PT_STRING8,0x6608
    RPCoverHTTPflags=PT_LONG,0x6623
    RPCProxyServer=PT_UNICODE,0x6622
    RPCProxyPrincipalName=PT_UNICODE,0x6625
    RPCProxyAuthScheme=PT_LONG,0x6627
    CachedExchangeConfigFlags=PT_LONG,0x6629
    [Microsoft Mail]
    ServiceName=MSFS
    ServerPath=PT_STRING8,0x6600
    Mailbox=PT_STRING8,0x6601
    Password=PT_STRING8,0x67f0
    RememberPassword=PT_BOOLEAN,0x6606
    ConnectionType=PT_LONG,0x6603
    UseSessionLog=PT_BOOLEAN,0x6604
    SessionLogPath=PT_STRING8,0x6605
    EnableUpload=PT_BOOLEAN,0x6620
    EnableDownload=PT_BOOLEAN,0x6621
    UploadMask=PT_LONG,0x6622
    NetBiosNotification=PT_BOOLEAN,0x6623
    NewMailPollInterval=PT_STRING8,0x6624
    DisplayGalOnly=PT_BOOLEAN,0x6625
    UseHeadersOnLAN=PT_BOOLEAN,0x6630
    UseLocalAdressBookOnLAN=PT_BOOLEAN,0x6631
    UseExternalToHelpDeliverOnLAN=PT_BOOLEAN,0x6632
    UseHeadersOnRAS=PT_BOOLEAN,0x6640
    UseLocalAdressBookOnRAS=PT_BOOLEAN,0x6641
    UseExternalToHelpDeliverOnRAS=PT_BOOLEAN,0x6639
    ConnectOnStartup=PT_BOOLEAN,0x6642
    DisconnectAfterRetrieveHeaders=PT_BOOLEAN,0x6643
    DisconnectAfterRetrieveMail=PT_BOOLEAN,0x6644
    DisconnectOnExit=PT_BOOLEAN,0x6645
    DefaultDialupConnectionName=PT_STRING8,0x6646
    DialupRetryCount=PT_STRING8,0x6648
    DialupRetryDelay=PT_STRING8,0x6649
    [Personal Folders]
    ServiceName=MSPST MS
    Name=PT_STRING8,0x3001
    PathAndFilenameToPersonalFolders=PT_STRING8,0x6700 
    RememberPassword=PT_BOOLEAN,0x6701
    EncryptionType=PT_LONG,0x6702
    Password=PT_STRING8,0x6703
    [Unicode Personal Folders]
    ServiceName=MSUPST MS
    Name=PT_UNICODE,0x3001
    PathAndFilenameToPersonalFolders=PT_STRING8,0x6700 
    RememberPassword=PT_BOOLEAN,0x6701
    EncryptionType=PT_LONG,0x6702
    Password=PT_STRING8,0x6703
    [Outlook Address Book]
    ServiceName=CONTAB
    [LDAP Directory]
    ServiceName=EMABLT
    ServerName=PT_STRING8,0x6600
    UserName=PT_STRING8,0x6602
    UseSSL=PT_BOOLEAN,0x6613
    UseSPA=PT_BOOLEAN,0x6615
    EnableBrowsing=PT_BOOLEAN,0x6622
    DisplayName=PT_STRING8,0x3001
    ConnectionPort=PT_STRING8,0x6601
    SearchTimeout=PT_STRING8,0x6607
    MaxEntriesReturned=PT_STRING8,0x6608
    SearchBase=PT_STRING8,0x6603
    CheckNames=PT_STRING8,0x6624
    DefaultSearch=PT_LONG,0x6623
    [Microsoft Outlook Client]
    SectionGUID=0a0d020000000000c000000000000046
    FormDirectoryPage=PT_STRING8,0x0270
    WebServicesLocation=PT_STRING8,0x0271
    ComposeWithWebServices=PT_BOOLEAN,0x0272
    PromptWhenUsingWebServices=PT_BOOLEAN,0x0273
    OpenWithWebServices=PT_BOOLEAN,0x0274
    CachedExchangeMode=PT_LONG,0x041f
    CachedExchangeSlowDetect=PT_BOOLEAN,0x0420
    [Personal Address Book]
    ServiceName=MSPST AB
    NameOfPAB=PT_STRING8,0x001e3001
    PathAndFilename=PT_STRING8,0x001e6600
    ShowNamesBy=PT_LONG,0x00036601
    ; Section 7 - Mapping for internet account properties.  DO NOT MODIFY.
    [I_Mail]
    AccountType=POP3
    ;--- POP3 Account Settings ---
    AccountName=PT_UNICODE,0x0002
    DisplayName=PT_UNICODE,0x000B
    EmailAddress=PT_UNICODE,0x000C
    ;--- POP3 Account Settings ---
    POP3Server=PT_UNICODE,0x0100
    POP3UserName=PT_UNICODE,0x0101
    POP3UseSPA=PT_LONG,0x0108
    Organization=PT_UNICODE,0x0107
    ReplyEmailAddress=PT_UNICODE,0x0103
    POP3Port=PT_LONG,0x0104
    POP3UseSSL=PT_LONG,0x0105
    ; --- SMTP Account Settings ---
    SMTPServer=PT_UNICODE,0x0200
    SMTPUseAuth=PT_LONG,0x0203
    SMTPAuthMethod=PT_LONG,0x0208
    SMTPUserName=PT_UNICODE,0x0204
    SMTPUseSPA=PT_LONG,0x0207
    ConnectionType=PT_LONG,0x000F
    ConnectionOID=PT_UNICODE,0x0010
    SMTPPort=PT_LONG,0x0201
    SMTPSecureConnection=PT_LONG,0x020A
    ServerTimeOut=PT_LONG,0x0209
    LeaveOnServer=PT_LONG,0x1000
    [IMAP_I_Mail]
    AccountType=IMAP
    ;--- IMAP Account Settings ---
    AccountName=PT_UNICODE,0x0002
    DisplayName=PT_UNICODE,0x000B
    EmailAddress=PT_UNICODE,0x000C
    ;--- IMAP Account Settings ---
    IMAPServer=PT_UNICODE,0x0100
    IMAPUserName=PT_UNICODE,0x0101
    IMAPUseSPA=PT_LONG,0x0108
    Organization=PT_UNICODE,0x0107
    ReplyEmailAddress=PT_UNICODE,0x0103
    IMAPPort=PT_LONG,0x0104
    IMAPUseSSL=PT_LONG,0x0105
    ; --- SMTP Account Settings ---
    SMTPServer=PT_UNICODE,0x0200
    SMTPUseAuth=PT_LONG,0x0203
    SMTPAuthMethod=PT_LONG,0x0208
    SMTPUserName=PT_UNICODE,0x0204
    SMTPUseSPA=PT_LONG,0x0207
    ConnectionType=PT_LONG,0x000F
    ConnectionOID=PT_UNICODE,0x0010
    SMTPPort=PT_LONG,0x0201
    SMTPSecureConnection=PT_LONG,0x020A
    ServerTimeOut=PT_LONG,0x0209
    CheckNewImap=PT_LONG,0x1100
    RootFolder=PT_UNICODE,0x1101
    [INET_HTTP]
    AccountType=HOTMAIL
    Account=PT_UNICODE,0x0002
    HttpServer=PT_UNICODE,0x0100
    UserName=PT_UNICODE,0x0101
    Organization=PT_UNICODE,0x0107
    UseSPA=PT_LONG,0x0108
    TimeOut=PT_LONG,0x0209
    Reply=PT_UNICODE,0x0103
    EmailAddress=PT_UNICODE,0x000C
    FullName=PT_UNICODE,0x000B
    Connection Type=PT_LONG,0x000F
    ConnectOID=PT_UNICODE,0x0010
    Christopher

  • Help with replacing an Adobe XI with an older version on Windows8

    I have Windows 8, Adobe Export PDF (which is an essential for me), and Adobe Reader XI. An online course that I am taking requires that I uninstall Adobe XI, and replace it with an older version (10.1.4?) in order to access class online textbooks. I am concerned and wondering if it will affect my Adobe Export or if it is compatible with Windows 8. Help? I want to try to find out if I will be facing any issues before I start messing with things.

    What is the problem with the Reader XI accessing these online docs?  All Reader versions should be fully backwards compatible.  Also I don't think Reader X was tested on Windows 8.
    However, if you really want to install Reader X, uninstall XI (from Control Panel, or using http://labs.adobe.com/downloads/acrobatcleaner.html), then download/install Reader 10.1.4 from http://get.adobe.com/reader/enterprise/ and update it to 10.1.9.

  • Need help with replacement hard drive

    My hard drive has stopped working on this computer and since i only purchased it on 10/2012 I really don't want to replace it just yet.  I am trying to buy a new hard drive but I would like a Seagate.  I want to upgrade from  1 TB to 2TB.  I was wondering if there is a Seagate product out there that would be compatable with the original hard drive but in 2 TB.The original hard drive is a HDD GNRC 1 TB SATA 3 ECO 7200 rpm 3.5".  I was looking at a Seagate 2TB SATA 6.0 but I do not know is the SATA 6 will work with the original SATA 3.  Can you please help me or guide me in the right direction for a replacement.  I also have the HP recovery CD's coming to me in the mail.Thanks,GinaCee 

    Hi Big_Dave,Thank you for your help.  I found this hard drive at Newegg and I was hoping you could tell me if it would be compatable.Seagate Barracuda ST2000DM001 2TB 7200 RPM 64MB Cache SATA 6.0Gb/s 3.5" Internal Hard Drive Bare Drive.   Or is there any Seagate product you could reccomend? I have a Seagate external hard drive and I like thier product, so I was hoping that they made something compatable for my HP.  I will be installing this drive myself.  I have all the instructions from the HP website and it doesn't look that difficult.  Just waiting for my restore CD's and a replacement hard drive so I can start this project.   Thanks again!Gina 

  • Need help with Replace Metadata then multiple Save script

    I am attempting to create a javascript to run on a folder of PSDs. I need it to:
    1. Replace image Metadata with an existing Metadata Template called "UsageTerms".
    2. Play an existing Action "Prep_PrintRes". (The action sharpens and converts to 8-bit)
    3. Append "_PrintRes" to the filename. (ie OriginalPSDName_PrintRes.jpg)
    4. Save the file as a 12 Quality JPEG to specific folder on my hard drive, "D:/Transfer".
    5. Play an existing Action "Prep_Magazine" (The action resizes, sharpens, and converts to CMYK)
    6. Append "_Magazine" to the filename. (ie OriginalPSDName_Magazine.jpg)
    7. Save the file as a 10 Quality JPEG WITH NO EMBEDDED PROFILE to "D:/Transfer".
    8. Play an existing Action "Prep_Screen". (The action sizes, sharpens, and converts to sRGB)
    9. Append "_ScreenRes" to the filename (ie OriginalPSDName_ScreenRes.jpg)
    10. Save the file as an 8 Quality JPEG to "D:/Transfer"
    If anyone is available to help me get started with this I would greatly appreciate it. I can do a minimal amount of Visual Basic but Javascript is alien to me. Thanks so much!

    Try the following as the custom calculate script:
    // Sum the field values, as numbers
    var sum = +getField("LaborCost").value;
    sum += +getField("MaterialCost").value;
    sum += +getField("EquipmentCost").value;
    // Set this field value
    event.value = sum > 0 ? sum : 0;
    For the other one, change the last line to:
    event.value = sum < 0 ? sum : 0;

  • New and need help with replace harddrive M45-s265

    Hello,
    I am not sure were to post this had a hard time trying to find were to post this message.
    (I also upgraded to 2g memory with out a problem)
    I replaced the board and get a message as if it has none 
    part of message
    PXE-E61: Media test failure, check cable
    PXE-MOF: Exiting PXE ROM
    The new board is from newegg and is a western digital wd scorpio ATA 250 gb wd2500beve-00wzto, I was told this is what i needed. 
    The key in and pins are the same as old board.
    Thank you so much for any help I can get

    That's the correct drive.  What is your question?  To do the replacement, you flip the unit over, remove the hard drive cover, slip the drive out, remove the 'caddy' and put it on the new drive, slide the new drive back in, replace the cover and boot from your recovery disks to restore the original disk image.

  • Graphics card is dead! Help with replacement please!

    Hi,
    I've just been given a Dual core G5 powermac (2.0ghz) model. It works fine with the exception of the graphics card. Previous owner took it to an apple store for testing and they said he would need a new card.
    I've got an apple display with the ADC plug.
    Can someone please advise me on a suitable replacement please? I guess my options are a card with an ADC plug or and adaptor and a standard DVI card?
    I find it all a bit confusing! Most of my work is music related so I don't need a high end card. I really just want a cheap solution to get this machine back up and running!
    Any help would be greatly appreciated.
    Thanks
    Bradley

    My graphic card failed and developed strange barcode type lines that flickered intermittently - getting worse the longer the computer was on. The flickering changed when the cable to the graphics card was "jiggled" / moved around. It turned out to be a problem with the ATI Radeon 9800 graphic card that came installed with the G5. There was nothing obviously wrong with the card the fan was fully operational.
    This is how I fixed it:
    1. Ran a Apple Hardware Diagnostic check from the Startup disk - hold down the Options key, Select Hardware Diagnostic and then select Extended. This confirmed that it was the Graphics board (Video (RAM)) and not the Logic board (contrary to the view of Apple and TechServe - both of whom wanted me to bring the G5 in for their diagnostic ... $150 +)
    2. Purchased the new board (I got it from B&H Photo):
    http://ati.amd.com/products/Radeon9600/Radeon9600propcmac/index.html
    3. Installed the new board - 5 minutes total: remove one screw - carefully remove cooked 9800 board - install new board - replace screw.
    4. Install new 9600 software (which the manufacturers suggest you do first) - it automatically overwrites the necessary 9800 files.
    5. Purchase and connect the Apple ADC-to-DVI converter - used to connect the new board to my Apple Cinema Display 23".
    6. Reboot
    I hope this helps anyone else with a similar problem.
    Best
    Dom

  • Help with replacing special characters and how/where to put the javascript...

    Hey there
    A while ago I added javascript to some parts of my PDF around the use of dates and phone numbers, I now have Acrobat 11, and I am at a loss of how to add a new javascript (i cant remember at all) the code I have is
    if (!event.willCommit) {
        event.change = event.change.replace(/\, "-");
    and it does not appear to be working, but if the code is right, then I am guessing I am putting it in the wrong place.
    Any help would be awesome.
    Cheers

    Probably like this:
    // Custom Keystroke script
    if (!event.willCommit) {
        event.change = event.change.replace(/\, "-");
        event.change = event.change.toUpperCase();
    If it doesn't work, post what the other script is and where it's placed.

  • Help with Replacing the Hard Disk Drive

    Product name and number:
    Hp Pavilion DV7-4131SA
    Windows 7 64-bit.
    The hard drive has failed. When i run the test it comes up with "Hard Disk Quick 1 (303) error)
    I have discovered i can get it replaced on warranty for free (will call up the hotline tommorow to confirm this)
    just need advice on removing and installing safely.I have an idea but just want to be sure as this is my first laptop. Usually a Desktop computer type of guy.
    Thank you.

    Hi,
    The procedure is detailed starting on Page 48 of your Maintenance & Service Guide.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Please, Help with Hebrew chars

    Hello all,
    I have an applet that should support multi language, for that I have a resource file for each language
    ( for Hebrew I tried myRes_he.java and myRes_iw.java)
    The problem is that I don't see the strings in the dialogs as they should appear, I see other characters, not in Hebrew
    The font I'm using is "Dialog"
    and I also have the font.properties.iw file that starts like that:
    dialog.0=David,HEBREW_CHARSET,NEED_CONVERTED
    dialog.1=Arial,ANSI_CHARSET
    dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
    dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
    can anyone tell me why I don't see the Hebrew characters??
    I also changed the Local and Language to Hebrew and it didn't help
    (i'm working in windows 2000, Hebrew enabled, do I need windows 2000 all in Hebrew??)
    Thanks
    Tamar

    I decided to answer this one even though it's very old....
    This person starts out saying they are using Windows 2000.
    One thing that Microsoft has done is created a non-unicode
    font named Lucida Sans
    Therefore if you call the unicode Java Lucida Sans font in lib\font
    you figure everybody has this and can see Hebrew fine right.
    But the Windows 2000 font masks the Java font and screws this up, one would guess on purpose
    I assume this is the same for xp
    You have to, and get everyone else to , uninstall
    the entire set of Lucida Sans fonts that now come with windows for the Java font to work !!!!!
    so thus onward to deleeting all yee Java fans

  • NEED HELP WITH WORD & CHAR COUNT USING HASHTABLE

    I have to use a hashtable to be able to count all the words and characters (#'s, punctuations, etc) from a file
    I have been able to get it to correctly count the words in the file but none of the characters and it also does not display the words alphabetically and just displays it in an odd way
    Here's the code: public static void main (String [] args)
          Hashtable table = new Hashtable();
          String input = JOptionPane.showInputDialog("Enter the filename:");
          try{
          BufferedReader br = new BufferedReader(new FileReader(input));
          String s = br.readLine();
          StringTokenizer words = new StringTokenizer( s, " \n\t\r" );
            while ( words.hasMoreTokens() ) {
             String word = words.nextToken().toLowerCase(); // get word
             // if the table contains the word
             if ( table.containsKey( word ) ) {
                Integer count = (Integer) table.get( word ); // get value
                // and increment it
                table.put( word, new Integer( count.intValue() + 1 ) );
             else // otherwise add the word with a value of 1
                table.put( word, new Integer( 1 ) );
           } // end while
             String output = "";
          Enumeration keys = table.keys();
          // iterate through the keys
          while ( keys.hasMoreElements() ) {
             Object currentKey = keys.nextElement();
             output += currentKey + "\t" + table.get( currentKey ) + "\n";
             System.out.println(output.toString());
          catch (IOException e)
            System.out.println(e);
          }The output that I get for a file containing the line " Hi this is my java program" is:
    this     1
    this     1
    program     1
    this     1
    program     1
    hi     1
    this     1
    program     1
    hi     1
    java     1
    this     1
    program     1
    hi     1
    java     1
    is     1
    this     1
    program     1
    hi     1
    java     1
    is     1
    my     1
    I'm not sure what I am doing wrong and help would be greatly appreciated.

    I have been able to get it to correctly count the
    words in the file but none of the characters and it
    also does not display the words alphabetically and
    just displays it in an odd way
    That's because hash tables are not ordered; to maintain order of insertion you could use LinkedHashMap and to maintain alphabetical order TreeMap.

  • Beginner needs Help with Replace

    Post Author: SportzLuvr1979
    CA Forum: Formula
    When pulling data from the DB it returns #@# as listed in the DB.  I need to replace the #@# with a ; but do not see where in CR Reports 2008 i can do this replace function.  I attempted using the "Format Field" with the x-2 to open the "Format Formula Editor".  In the Crystal Syntax I entered the below. // Replace (inputString, "#@#", ";")However this didn't work.    When i refreshed the report it still returned the #@#.  Is there another way to perform this replace or convert?   Thanks!

    Post Author: yangster
    CA Forum: Formula
    you don't use the format field to change the field itself, the format field is a conditional to apply formatting to text itselfyou need to use the replace function within a formulasimply create a formula with your above formula and insert it into the detail section of your reportput it next to your actual input string and you'll be able to confirm that it is replacing the proper string with the string you wantthen remove the input string from your report layout and leave the formula

  • Needing help with CONVERT(CHAR(11))

    I need to convert an output(l_line_body_note) to a string and limit the string to a length of 128 characters. I have tried using the Convert to string character and everything i can think of. All help would be greatly appreciated.
    l_line_body_Note := '<Notes>' ||'GIA Notice Event '||pc_log_rec.notice_id||': '|| pc_log_rec.pc_comments || '</Notes>';

    I need to convert an output(l_line_body_note) to a
    string and limit the string to a length of 128
    characters. I have tried using the Convert to string
    character and everything i can think of. All help
    would be greatly appreciated.
    l_line_body_Note := '<Notes>' ||'GIA Notice Event
    '||pc_log_rec.notice_id||': '||
    pc_log_rec.pc_comments || '</Notes>';I believe you are using PL/SQL appending. In jave you can use '+' instead of the '||'.
    String l_line_body_Note = "<Notes>"
    + "GIA Notice Event"
    + pc_log_rec.notice_id + ": "
    + pc_log_rec.pc_comments
    + "</Notes>";If you are actually after a PL/SQL answer then I suggest you don't post in a java forum.
    Ted.

  • Need help with replacing hard drive please

    Can I upgrade to a hard drive that has SATA 3 interface with my Macbook Pro mid 2009 model?

    It may well work and be backward compatible as jk said, however your machine was spec'd for one type of drive. For me, even if the older technology for the same capacity was slightly more in cost, I'd want to put that in my machine rather than something that may not be fully compatible. Just my opinion.

  • Replacing chars

    I have a problem with replacing chars. I want to replace the following chars <, > and '
    I've implemented the following code:
    remove(String str) {
        Pattern p = Pattern.compile("[<>']");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        boolean result = m.find();
        boolean deletedIllegalChars = false;
        while (result) {
          deletedIllegalChars = true;
          m.appendReplacement(sb, " ");
          result = m.find();
        // Add the last segment of input to the new String
        m.appendTail(sb);
        str = sb.toString();
        return str;
    }The problem now is, that the ' is not replaced after running the method above. What I'm doing wrong?
    P.S.: Maybe my problem doesn't fit to this forum, but I don't found a better place.

    The problem now is, that the ' is not replaced after
    running the method above. What I'm doing wrong?
    It is on my computer, maybe the string doesn't really contain the ascii apostrophe-signle quote but some special "smart quote" or the acute/grave accent symbol. They all look like the similar but aren't the same.
    For instance the preferred character for apostrophe is \u2019 according to the unicode spec. Maybe you want to be replacing it instead/aswell.
    P.S.: Maybe my problem doesn't fit to this forum, but
    I don't found a better place.I think Java Programming and New to Java get most of the miscallaneous posts..

Maybe you are looking for

  • Nested IF Statement in WHERE clause...

    Here is a really abridged sample of my package. I need to ensure that if a salesrep has a status of 'I' (for "inactive") that the next salesrep with a status of 'A' (for "active") will be selected in its place. Should I include a nested loop within t

  • Shortdump while calling UNIX command

    Hi all, I have a problem while trying to remove a file in UNIX platform in ABAP program. It is working fine in the development and quality server, but not in production server. Based on the debug result, the shortdump was thrown while executing "CALL

  • Lightbox gallery widget next and prev buttons do not work with iOS?

    This widget works perfectly on Windows, but these two buttons do not appear on either iPhones or iPads.  Does anyone know why not and if there is a fix?

  • Frequent crashing in Adobe Dreamweaver CC 2014 on Windows 7 Professional 32bit

    Dear All, We have Adobe Dreamweaver CC 2014 installed as part of a Creative Cloud package across multiple machines running Windows 7 Professional 32bit. EVERY time we open the software, we are able to run through the "demo" introduction but when we g

  • I have purchased Monster Mouth and it didnt download in my ipad

    please can anybody help with this issue.  im trying to report the problem using itunes and its impossible, they  always send me to de main page that explain the way to made the itunes solution. BUT IT DOESNT WOORKKK!!!!!!! They already made the charg