Negative outcome?

import static java.lang.Math.*;
public class catapult
    private double acceleration = 9.8;
     * Default constructor for objects of type catapult
    catapult()
     * Accessor Method to calculate the distance in meters
     * @param velocity of object (launch speed)
     * @param the launch angle
     * @param the acceleration due to gravity
     * @return the distance an object will be launched
    public double calcR(double speed, double angle)
        return (Math.pow(speed, 2) * sin(2 * angle)) / acceleration;
}this is class one
public class catapultTester
    public static void main(String[] args)
        //variable declaration
        double speed1 = 20;
        double speed2 = 25;
        double speed3 = 30;
        double speed4 = 35;
        double speed5 = 40;
        double speed6 = 45;
        double speed7 = 50;
        double angle1 = 25;
        double angle2 = 30;
        double angle3 = 35;
        double angle4 = 40;
        double angle5 = 45;
        double angle6 = 50;
        double MPH20, MPH201, MPH202, MPH203, MPH204, MPH205;
        double MPH25, MPH251, MPH252, MPH253, MPH254, MPH255;
        double MPH30, MPH301, MPH302, MPH303, MPH304, MPH305;
        double MPH35, MPH351, MPH352, MPH353, MPH354, MPH355;
        double MPH40, MPH401, MPH402, MPH403, MPH404, MPH405;
        double MPH45, MPH451, MPH452, MPH453, MPH454, MPH455;
        double MPH50, MPH501, MPH502, MPH503, MPH504, MPH505;
        //create object
        catapult fire = new catapult();
        MPH20 = fire.calcR(speed1, angle1);
        MPH201 = fire.calcR(speed1, angle2);
        MPH202 = fire.calcR(speed1, angle3);
        MPH203 = fire.calcR(speed1, angle4);
        MPH204 = fire.calcR(speed1, angle5);
        MPH205 = fire.calcR(speed1, angle6);
        System.out.println(MPH201);
}this is class 2. When I print the outcome, it's negative. why is it doing that?

Yep thats how i would have done it :). Really manually how you convert degrees to radians if you wanted to know is take the (Degree*pi)/180
Oh and here is the java api... the best reference for things java.
http://java.sun.com/j2se/1.5.0/docs/api/
on the left you click the class you wanna look up like Math and you can see the individual methods it has. Click a method for its advanced documentation.
Edited by: javed.b.ahamed on Feb 16, 2008 11:36 AM

Similar Messages

  • IMac takes 4 minutes to boot up, bluetooth not available

    Hello, this is my first post on Apple Discussions!
    The day before yesterday we had quite a vicious storm here and lost power for about a minute. My Mac was switched on when the power cut out, but I was downstairs, having some lunch. Unfortunately, I have no surge protection on my power bar / extension cord thing (I know...). I immediately unplugged it, only turning it back on after the storm had calmed down.
    Thinking nothing of it, I powered on my Mac and left it unattended for about 10 minutes (so I don't know how long it took to boot up!). When I came back, I was greeted by the login screen and proceeded as usual. However, the next time I powered on my computer, I could not get past the white screen after the chime (no Apple logo). Now, this has happened to me before, so I waited a couple of minutes. Nothing. I decided to power it down (holding down the power button) and try rebooting it, this time holding down the option key (to bring up the partitions), as this has helped me in the past. White screen for a couple of minutes. Impatient and annoyed, I powered it down again. Rebooted holding down the shift key, for Safe Mode. Nothing again. This time I left it on the white screen while I looked for an old USB keyboard, thinking my wireless keyboard might not have been pairing. Little did I know I would have to use this sh***y keyboard from this point forward.
    So, I got my keyboard (remember I had left my Mac on the white screen) and when I returned I was pleasantly surprised to see the login screen. I noticed, however, that I could not use my wireless keyboard (I have a wired Razer mouse). So I plugged in the old PC keyboard I found, and logged in. Which is when I noticed the Bluetooth icon was strange; it was greyed out and had a jagged line through it, and when I clicked on it, said "Bluetooth: Not Available".
    I restarted my Mac, just to see if the issues would be fixed. Nope. It took about four minutes to start up, and no Bluetooth. I checked the System Preferences and it says there is "No Bluetooth Hardware Found". "No information found" in System Information either.
    The problem is that during the white screen on bootup (I always hear the chime btw), I have no control. I cannot enter Safe Mode, see the partitions, reset the NVRAM or PRAM. I just have to wait until I see the Apple logo after about four minutes. After login, everything (bar Bluetooth) seems fine. I have verified disk, and it says it's fine. Verified and repaired permissions as well. I looked and noticed that I have no com.apple.bluetooth.plist file in my library.
    I don't know what to do from here! My extended Apple Care has expired Should I install Mavericks? Could that fix my problems? Or should I clean install ML, and then install Mavericks? But if the storm did do some damage, the issue is probably hardware... Please help me.
    Thanks, and sorry for the length
    PS. I have been having a little trouble with my finder since a while now (months). Sometimes, when I open a folder the CPU will shoot up to 100% and the Mac would freeze for a couple of seconds. Then it would be normal again. I have used up about 1.5 TB (including a Bootcamp partition) from my 2TB HDD. I doubt this is related, but I though I'd throw it in anyway. Again, I apologise for the length.

    Installing a new OS X over a problematic one will get you a new problematic OS X.
    I suggest you run repair disk first.  Then I would reset the SMC.
    I "think" that some of your problems stem from the power problem you described.  No surge protector is akin to (fill in the negative outcome blank).  The lecture ends here.
    IMHO, you have some hardware problem(s).  I suggest you take the computer to an Apple store for diagnosis.  Be sure to bring your documentation of the things above along.
    Barry

  • Help with a hangman class with Gui

    Gah, so I'm creating a Java Hangman program using a gui program. Everything was working fine till I started adding the program to the gui. I'm hopelessly confused, and I can't seem to get it working. Help appreciated! Thanks guys... I'm really bad at this, sorry for the noob question.
    import java.awt.BorderLayout;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.io.File;
    import java.util.Random;
    import java.util.Scanner;
    import javax.accessibility.AccessibleContext;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.plaf.PanelUI;
    public class hmg extends JPanel {
         private char[] word;
         private int Misses;
         private int myWordIndex;
         private int index;
         private boolean[] used;
         protected Image[] i = new Image[8];
         protected Image[] s = new Image[3];
         private final static char NADA = '_';
         private final static int GUESSES = 8;
         private String fileName;
              i[0] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang1.jpg");
              i[1] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang2.jpg");
              i[2] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang3.jpg");
              i[3] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hange4.jpg");
              i[4] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang5.jpg");
              i[5] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang6.jpg");
              i[6] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang7.jpg");
              i[7] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang8.jpg");
              s[0] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
              s[1] = Toolkit.getDefaultToolkit().getImage(
              "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
              s[2] = Toolkit.getDefaultToolkit().getImage(
              "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
         protected int x = 0;
         protected ImageIcon icon = new ImageIcon(i[x++]);
         protected ImageIcon icon2 = new ImageIcon(s[x++]);
         private JLabel j = new JLabel(icon);
         private JButton b = new JButton();
         private JLabel a = new JLabel();
         private String[] wordArray;
         private String wordChosen;
         public void paintComponent(Graphics g) {
              super.paintComponents(g);
         public hmg() {
              this.add(j);
              JButton guess = new JButton("The Click of Faith!");
              this.add(guess, BorderLayout.WEST);
              guess.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        if (!(x == i.length)) {
                             icon = new ImageIcon(i[x++]);
                             j.setIcon(icon);
              JButton guess2 = new JButton("Click here if your almost dead! ");
              this.add(guess2, BorderLayout.WEST);
              guess2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        icon2 = new ImageIcon(s[x++]);
                        j.setIcon(icon);
              this.add(a, BorderLayout.SOUTH);
              a.setText(showWord());
              a.setText(play());
              Misses = 0;
              index = 0;
              used = new boolean[Character.MAX_VALUE];
         //     public void actionPerformed(ActionEvent arg0) {
         //          if (!(x == i.length)) {
         //          icon = new ImageIcon(i[x++]);
         //          j.setIcon(icon);
         private void clear() {
              int k;
              for (k = 0; k < Character.MAX_VALUE; k++) {
                   used[k] = false;
              word = new char[myWords[myWordIndex].length()];
              for (k = 0; k < word.length; k++) {
                   word[k] = NADA;
         private void guess(char ch) {
              int b;
              boolean charFound = false;
              ch = Character.toLowerCase(ch);
              for (b = 0; b < word.length; b++) {
                   if (!used[ch] && myWords[index].charAt(b) == ch) {
                        word[b] = ch;
                        charFound = true;
              if (!used[ch] && !charFound) {
                   Misses++;
              used[ch] = true;
         private void chooseRandomWord()
         // myWords[];
    //     loadFileList();
              Random generator = new Random();
              int x = generator.nextInt(wordArray.length);
              wordChosen = wordArray[x];
         //public void processFile(String commonWords) {
         //     wordArray = commonWords.split(",");
         //private String[] loadFileList() {
         //     try
         //          fileName = "C:\\Documents and Settings\\mfleming\\Desktop\\Wordlist";
         //               File file = new File("C:\\Documents and
         // Settings\\mfleming\\Desktop\\Wordlist");
         //          if(file.exists());
         //               Scanner scan = new Scanner(file);
         //               while(scan.hasNext())
         //                    String word = scan.next();
         //                    processFile(word);
         //     } catch (Exception e)
         //          e.printStackTrace();
         //     return wordArray;
         //     public void add() {
         //          try {
         //               Scanner s = new Scanner(new File("Wordlist"));
         //               while (s.hasNext())
         //          } catch (Exception e) {
         private String showWord() {
              int k;     
              String temp = "";
              for (k = 0; k < word.length; k++) {
                   temp +=word[k];
    //               System.out.print(word[k] + " ");
              return temp;
              //                    return showWord();
    //          System.out.println(" \nYou have exactly " + (GUESSES - Misses)
    //                    + " guesses left! Time is running out! Cue Music LOL ");
         private boolean wordGuessed() {
              int a;
              for (a = 0; a < word.length; a++) {
                   if (word[a] == NADA) {
                        return false;
              return true;
         // .setIcon --- Put image.
         public String play() {
              clear();
              String temp = "";
              while (true) {
    //               showWord();
                   a.setText(showWord());
                   //May not have to return string.
    //               System.out
    //                         .print("Your guess shall be? 1234567890abcdefhijklmnopqrstuvqxyz hA! Guess... it's simply up to you!");
                   String s = Blah.readString();
                   if (s.length() > 0) {
                        guess(s.charAt(0));
                   if (Misses >= GUESSES) {
    //                    System.out.println("You killed your hangman because....");
                        //                    System.out.println(storeWord);
                        break;
                   } else if (wordGuessed()) {
    //                    System.out.println("You win. You suck. LOL. ><");
    //                    System.out.println(word);
                        break;
              index = (index + 1) / myWords.length;
              return temp;
         //     public String storeWord() {
         //          return SW;
         public static final void main(String args[]) {
              hmg hmg = new hmg();
              hmg.play();
         private class MousePressedListener implements MouseListener {
              public void mousePressed(MouseEvent e) {
                   if (e.getButton() == e.BUTTON1) {
                        ((JButton) e.getSource()).setText("X");
                   if (e.getButton() == e.BUTTON3) {
                        ((JButton) e.getSource()).setText("O");
              * (non-Javadoc)
              * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
              public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
              * (non-Javadoc)
              * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
              public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
              * (non-Javadoc)
              * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
              public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
              * (non-Javadoc)
              * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
              public void mouseReleased(MouseEvent arg0) {
                   // TODO Auto-generated method stub
         * (non-Javadoc)
         * @see java.awt.Component#getAccessibleContext()
         public AccessibleContext getAccessibleContext() {
              // TODO Auto-generated method stub
              return super.getAccessibleContext();
         * (non-Javadoc)
         * @see javax.swing.JPanel#getUI()
         public PanelUI getUI() {
              // TODO Auto-generated method stub
              return super.getUI();
         * (non-Javadoc)
         * @see javax.swing.JComponent#getUIClassID()
         public String getUIClassID() {
              // TODO Auto-generated method stub
              return super.getUIClassID();
         * (non-Javadoc)
         * @see java.awt.Component#paramString()
         protected String paramString() {
              // TODO Auto-generated method stub
              return super.paramString();
         * (non-Javadoc)
         * @see javax.swing.JPanel#setUI(javax.swing.plaf.PanelUI)
         public void setUI(PanelUI arg0) {
              // TODO Auto-generated method stub
              super.setUI(arg0);
         * (non-Javadoc)
         * @see javax.swing.JComponent#updateUI()
         public void updateUI() {
              // TODO Auto-generated method stub
              super.updateUI();
         private String myWords[] = { "analysis", "approach", "area", "assessment",
                   "assume", "authority     ", "available", "benefit ", "concept ",
                   "consistent", "constitutional", "context", "contract", "create",
                   "data", "definition", "derived ", "distribution ", "economic",
                   "environment ", "established", "estimate ", "evidence", "export",
                   "factors", "financial", "formula", "function", "identified",
                   "income", "indicate ", "individual ", "interpretation",
                   "involved", "issues", "labour", "legal", "legislation", "major ",
                   "method", "occur", "percent ", "period", "policy", "principle",
                   "procedure", "process", "required", "research", "response", "role",
                   "section", "sector", "significant ", "similar", "source",
                   "specific", "structure", "theory", "variables", "achieve ",
                   "acquisition", "administration ", "affect", "appropriate ",
                   "aspects", "assistance ", "categories", "chapter", "commission",
                   "community", "complex ", "computer ", "conclusion", "conduct",
                   "consequences", "construction", "consumer ", "credit", "cultural ",
                   "design", "distinction", "elements ", "equation", "evaluation ",
                   "features ", "final", "focus", "impact", "injury", "institute ",
                   "investment", "items", "journal ", "maintenance", "normal",
                   "obtained ", "participation", "perceived ", "positive ",
                   "potential", "previous", "primary ", "purchase ", "range ",
                   "region", "regulations", "relevant ", "resident", "resources",
                   "restricted ", "security ", "sought", "select", "site",
                   "strategies", "survey", "text", "traditional", "transfer",
                   "alternative", "circumstances ", "comments", "compensation",
                   "components", "consent", "considerable", "constant ",
                   "constraints", "contribution", "convention ", "coordination",
                   "core", "corporate ", "corresponding", "criteria", "deduction",
                   "demonstrate ", "document", "dominant", "emphasis ", "ensure",
                   "excluded", "framework ", "funds", "illustrated ", "immigration",
                   "implies", "initial ", "instance ", "interaction", "justification",
                   "layer", "link", "location", "maximum ", "minorities", "negative ",
                   "outcomes", "partnership", "philosophy ", "physical ",
                   "proportion ", "published ", "reaction", "registered ", "reliance",
                   "removed", "scheme", "sequence", "sex", "shift", "specified ",
                   "sufficient", "task", "technical ", "techniques", "technology",
                   "validity", "volume", "access", "adequate", "annual", "apparent",
                   "approximated", "attitudes ", "attributed ", "civil", "code",
                   "commitment ", "communication", "concentration", "conference ",
                   "contrast ", "cycle", "debate", "despite ", "dimensions ",
                   "domestic ", "emerged ", "error", "ethnic", "goals", "granted",
                   "hence", "hypothesis ", "implementation", "implications",
                   "imposed", "integration", "internal ", "investigation", "job",
                   "label", "mechanism ", "obvious", "occupational ", "option",
                   "output", "overall ", "parallel", "parameters", "phase",
                   "predicted", "principal", "prior", "professional", "project",
                   "promote", "regime", "resolution ", "retained", "series",
                   "statistics ", "status", "stress", "subsequent", "sum", "summary",
                   "undertaken ", "academic ", "adjustment ", "alter ", "amendment ",
                   "aware ", "capacity ", "challenge ", "clause ", "compounds ",
                   "conflict ", "consultation ", "contact ", "decline ",
                   "discretion ", "draft ", "enable ", "energy ", "enforcement ",
                   "entities ", "equivalent ", "evolution ", "expansion ",
                   "exposure ", "external ", "facilitate ", "fundamental ",
                   "generated ", "generation ", "image ", "liberal", "licence ",
                   "logic ", "marginal ", "medical ", "mental ", "modified ",
                   "monitoring ", "network ", "notion ", "objective ", "orientation ",
                   "perspective ", "precise ", "prime ", "psychology ", "pursue ",
                   "ratio ", "rejected ", "revenue ", "stability ", "styles ",
                   "substitution ", "sustainable", "symbolic ", "target ",
                   "transition ", "trend ", "version ", "welfare ", "whereas ",
                   "abstract ", "accurate ", "acknowledged ", "aggregate ",
                   "allocation ", "assigned ", "attached ", "author ", "bond ",
                   "brief ", "capable ", "cited ", "cooperative ", "discrimination ",
                   "display ", "diversity ", "domain ", "edition ", "enhanced ",
                   "estate ", "exceed ", "expert ", "explicit ", "federal ", "fees ",
                   "flexibility ", "furthermore ", "gender ", "ignored ",
                   "incentive ", "incidence ", "incorporated ", "index ",
                   "inhibition ", "initiatives ", "input ", "instructions ",
                   "intelligence ", "interval ", "lecture ", "migration ", "minimum ",
                   "ministry ", "motivation ", "neutral ", "nevertheless ",
                   "overseas ", "preceding ", "presumption ", "rational ",
                   "recovery ", "revealed ", "scope ", "subsidiary ", "tapes ",
                   "trace ", "transformation ", "transport ", "underlying ",
                   "utility ", "adaptation ", "adults ", "advocate ", "aid ",
                   "channel ", "chemical", "classical ", "comprehensive ",
                   "comprise ", "confirmed ", "contrary ", "converted ", "couple ",
                   "decades ", "definite", "deny ", "differentiation ", "disposal ",
                   "dynamic ", "eliminate ", "empirical ", "equipment ", "extract ",
                   "file ", "finite ", "foundation ", "global ", "grade ",
                   "guarantee ", "hierarchical ", "identical ", "ideology ",
                   "inferred ", "innovation ", "insert ", "intervention ",
                   "isolated ", "media ", "mode ", "paradigm ", "phenomenon ",
                   "priority ", "prohibited ", "publication ", "quotation ",
                   "release ", "reverse ", "simulation ", "solely ", "somewhat ",
                   "submitted ", "successive ", "survive ", "thesis ", "topic ",
                   "transmission ", "ultimately ", "unique ", "visible ",
                   "voluntary ", "abandon ", "accompanied ", "accumulation ",
                   "ambiguous ", "appendix ", "appreciation ", "arbitrary ",
                   "automatically ", "bias ", "chart ", "clarity", "conformity ",
                   "commodity ", "complement ", "contemporary ", "contradiction ",
                   "crucial ", "currency ", "denote ", "detected ", "deviation ",
                   "displacement ", "dramatic ", "eventually ", "exhibit ",
                   "exploitation ", "fluctuations ", "guidelines ", "highlighted ",
                   "implicit ", "induced ", "inevitably ", "infrastructure ",
                   "inspection ", "intensity ", "manipulation ", "minimised ",
                   "nuclear ", "offset ", "paragraph ", "plus ", "practitioners ",
                   "predominantly ", "prospect ", "radical ", "random ",
                   "reinforced ", "restore ", "revision ", "schedule ", "tension ",
                   "termination ", "theme ", "thereby ", "uniform ", "vehicle ",
                   "via ", "virtually ", "widespread ", "visual ", "accommodation ",
                   "analogous ", "anticipated ", "assurance ", "attained ", "behalf ",
                   "bulk ", "ceases ", "coherence ", "coincide ", "commenced ",
                   "incompatible ", "concurrent ", "confined ", "controversy ",
                   "conversely ", "device ", "devoted ", "diminished ", "distorted",
                   "distortion", "equal", "figures", "duration ", "erosion ",
                   "ethical ", "format ", "founded ", "inherent ", "insights ",
                   "integral ", "intermediate ", "manual ", "mature ", "mediation ",
                   "medium ", "military ", "minimal ", "mutual ", "norms ",
                   "overlap ", "passive ", "portion ", "preliminary ", "protocol ",
                   "qualitative ", "refine ", "relaxed ", "restraints ",
                   "revolution ", "rigid ", "route ", "scenario ", "sphere ",
                   "subordinate ", "supplementary ", "suspended ", "team ",
                   "temporary ", "trigger ", "unified ", "violation ", "vision ",
                   "adjacent ", "albeit ", "assembly ", "collapse ", "colleagues ",
                   "compiled ", "conceived ", "convinced ", "depression ",
                   "encountered ", "enormous ", "forthcoming ", "inclination ",
                   "integrity ", "intrinsic ", "invoked ", "levy ", "likewise ",
                   "nonetheless ", "notwithstanding ", "odd ", "ongoing ", "panel ",
                   "persistent ", "posed ", "reluctant ", "straightforward ",
                   "undergo ", "whereby ", "noob", "frag", "punish", "lamer", "noobs",
                   "knife", "shank", "humvee", "sniper", "don't", "run", "you'll",
                   "only", "die", "tired", "LOL", "ROFL", "GG", "FTW", "indeed",
                   "sure", "yeah", "yea", "hi", "hello", };
    DRIVER CLASS
    import java.awt.BorderLayout;
    import java.awt.Container;
    import javax.swing.JFrame;
    public class HangManGuiTest {
         public static void main(String[] args) {
    //          hangmangui hmg = new hangmangui();
              hmg hmg = new hmg();
              JFrame frame = new JFrame("Hangman! DJ Joker[8]Baller");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setContentPane(hmg);
              frame.pack();
              frame.show();
    //          JFrame j = new JFrame();
    //          Listeners - Control everything - Call stuff from hmg.
    //          frame.getContentPane().add(hmg);
    //          j.setSize(500, 500);
    //          j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //          j.setVisible(true);
              hmg.play();
    Message was edited by:
    joker8baller

    Hey! Thanks for the tip...
    Anyways, I fixed all of the errors (T hank god) and now all I have t o do is add the text to the gui. Help for adding the text into the gui. When I run it, it runs a gui, and it shows the spaces, but when I put in input.. nothing shows up and nothing plays.
    So I'm going to use a.setText... for showWord and and play()... Is there anything else I woiuld need to do?
    import java.awt.BorderLayout;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.io.File;
    import java.util.Random;
    import java.util.Scanner;
    import javax.accessibility.AccessibleContext;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.plaf.PanelUI;
    public class hmg extends JPanel {
         private char[] word;
         private int Misses;
         private int myWordIndex;
         private int index;
         private boolean[] used;
         protected Image[] i = new Image[8];
         protected Image[] s = new Image[3];
         private final static char NADA = '_';
         private final static int GUESSES = 8;
         private String fileName;
              i[0] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang1.jpg");
              i[1] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang2.jpg");
              i[2] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang3.jpg");
              i[3] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hange4.jpg");
              i[4] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang5.jpg");
              i[5] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang6.jpg");
              i[6] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang7.jpg");
              i[7] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hang8.jpg");
              s[0] = Toolkit.getDefaultToolkit().getImage(
                        "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
              s[1] = Toolkit.getDefaultToolkit().getImage(
              "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
              s[2] = Toolkit.getDefaultToolkit().getImage(
              "C:\\Documents and Settings\\mfleming\\Desktop\\hacks.jpg");
         protected int x = 0;
         protected ImageIcon icon = new ImageIcon(i[x++]);
         protected ImageIcon icon2 = new ImageIcon(s[x++]);
         private JLabel j = new JLabel(icon);
         private JButton b = new JButton();
         private JLabel a = new JLabel();
         private String[] wordArray;
         private String wordChosen;
         public void paintComponent(Graphics g) {
              super.paintComponents(g);
         public hmg() {
              this.add(j);
              JButton guess = new JButton("The Click of Faith!");
              this.add(guess, BorderLayout.WEST);
              guess.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        if (!(x == i.length)) {
                             icon = new ImageIcon(i[x++]);
                             j.setIcon(icon);
              JButton guess2 = new JButton("Click here if your almost dead! ");
              this.add(guess2, BorderLayout.WEST);
              guess2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        icon2 = new ImageIcon(s[x++]);
                        j.setIcon(icon);
    //          this.add(a, BorderLayout.SOUTH);
    //          a.setText(clear());
    //          a.setText(showWord());
    //          a.setText(play());
              Misses = 0;
              index = 0;
              used = new boolean[Character.MAX_VALUE];
         //     public void actionPerformed(ActionEvent arg0) {
         //          if (!(x == i.length)) {
         //          icon = new ImageIcon(i[x++]);
         //          j.setIcon(icon);
         private void clear() {
              int k;
              for (k = 0; k < Character.MAX_VALUE; k++) {
                   used[k] = false;
              word = new char[myWords[myWordIndex].length()];
              System.out.println(word.length);
              for (k = 0; k < word.length; k++) {
                   word[k] = NADA;
         private void guess(char ch) {
              int b;
              boolean charFound = false;
              ch = Character.toLowerCase(ch);
              for (b = 0; b < word.length; b++) {
                   if (!used[ch] && myWords[index].charAt(b) == ch) {
                        word[b] = ch;
                        charFound = true;
              if (!used[ch] && !charFound) {
                   Misses++;
              used[ch] = true;
         private void chooseRandomWord()
         // myWords[];
    //      loadFileList();
              Random generator = new Random();
              int x = generator.nextInt(wordArray.length);
              wordChosen = wordArray[x];
         //public void processFile(String commonWords) {
         //     wordArray = commonWords.split(",");
         //private String[] loadFileList() {
         //     try
         //          fileName = "C:\\Documents and Settings\\mfleming\\Desktop\\Wordlist";
         //               File file = new File("C:\\Documents and
         // Settings\\mfleming\\Desktop\\Wordlist");
         //          if(file.exists());
         //               Scanner scan = new Scanner(file);
         //               while(scan.hasNext())
         //                    String word = scan.next();
         //                    processFile(word);
         //     } catch (Exception e)
         //          e.printStackTrace();
         //     return wordArray;
         //     public void add() {
         //          try {
         //               Scanner s = new Scanner(new File("Wordlist"));
         //               while (s.hasNext())
         //          } catch (Exception e) {
         private String showWord() {
              int k;     
              String temp = "";
              for (k = 0; k < word.length; k++) {
                   temp +=word[k];
    //               System.out.print(word[k] + " ");
              return temp;
              //                    return showWord();
    //          System.out.println(" \nYou have exactly " + (GUESSES - Misses)
    //                    + " guesses left! Time is running out! Cue Music LOL ");
         private boolean wordGuessed() {
              int a;
              for (a = 0; a < word.length; a++) {
                   if (word[a] == NADA) {
                        return false;
              return true;
         // .setIcon --- Put image.
         public String play() {
              clear();
              String temp = "";
              while (true) {
    //               showWord();
                   a.setText(showWord());
                   //May not have to return string.
         JOptionPane.showInputDialog("Your guess shall be? 1234567890abcdefhijklmnopqrstuvqxyz hA! Guess... its simply up to you!");
    //               System.out
    //                         .print("Your guess shall be? 1234567890abcdefhijklmnopqrstuvqxyz hA! Guess... it's simply up to you!");
                   String s = Blah.readString();
                   if (s.length() > 0) {
                        guess(s.charAt(0));
                   if (Misses >= GUESSES) {
                        JOptionPane.showMessageDialog(null,"You killed your hangman because....");
    //                    System.out.println("You killed your hangman because....");
                        //                    System.out.println(storeWord);
                        break;
                   } else if (wordGuessed()) {
                        JOptionPane.showMessageDialog(null, "You win. You suck. LOL. ><");
    //                    System.out.println("You win. You suck. LOL. ><");
    //                    System.out.println(word);
                        break;
              index = (index + 1) / myWords.length;
              return temp;
         //     public String storeWord() {
         //          return SW;
         public static final void main(String args[]) {
              hmg hmg = new hmg();
              hmg.play();
               * (non-Javadoc)
               * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
              public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
               * (non-Javadoc)
               * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
              public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
               * (non-Javadoc)
               * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
              public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
               * (non-Javadoc)
               * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
              public void mouseReleased(MouseEvent arg0) {
                   // TODO Auto-generated method stub
          * (non-Javadoc)
          * @see java.awt.Component#getAccessibleContext()
         public AccessibleContext getAccessibleContext() {
              // TODO Auto-generated method stub
              return super.getAccessibleContext();
          * (non-Javadoc)
          * @see javax.swing.JPanel#getUI()
         public PanelUI getUI() {
              // TODO Auto-generated method stub
              return super.getUI();
          * (non-Javadoc)
          * @see javax.swing.JComponent#getUIClassID()
         public String getUIClassID() {
              // TODO Auto-generated method stub
              return super.getUIClassID();
          * (non-Javadoc)
          * @see java.awt.Component#paramString()
         protected String paramString() {
              // TODO Auto-generated method stub
              return super.paramString();
          * (non-Javadoc)
          * @see javax.swing.JPanel#setUI(javax.swing.plaf.PanelUI)
         public void setUI(PanelUI arg0) {
              // TODO Auto-generated method stub
              super.setUI(arg0);
          * (non-Javadoc)
          * @see javax.swing.JComponent#updateUI()
         public void updateUI() {
              // TODO Auto-generated method stub
              super.updateUI();
         private String myWords[] = { "approach", "area", "assessment",
                   "assume", "authority     ", "available", "benefit ", "concept ",
                   "consistent", "constitutional", "context", "contract", "create",
                   "data", "definition", "derived ", "distribution ", "economic",
                   "environment ", "established", "estimate ", "evidence", "export",
                   "factors", "financial", "formula", "function", "identified",
                   "income", "indicate ", "individual  ", "interpretation",
                   "involved", "issues", "labour", "legal", "legislation", "major ",
                   "method", "occur", "percent ", "period", "policy", "principle",
                   "procedure", "process", "required", "research", "response", "role",
                   "section", "sector", "significant  ", "similar", "source",
                   "specific", "structure", "theory", "variables", "achieve ",
                   "acquisition", "administration  ", "affect", "appropriate ",
                   "aspects", "assistance ", "categories", "chapter", "commission",
                   "community", "complex ", "computer ", "conclusion", "conduct",
                   "consequences", "construction", "consumer ", "credit", "cultural ",
                   "design", "distinction", "elements ", "equation", "evaluation ",
                   "features ", "final", "focus", "impact", "injury", "institute ",
                   "investment", "items", "journal ", "maintenance", "normal",
                   "obtained ", "participation", "perceived ", "positive ",
                   "potential", "previous", "primary ", "purchase ", "range ",
                   "region", "regulations", "relevant ", "resident", "resources",
                   "restricted ", "security ", "sought", "select", "site",
                   "strategies", "survey", "text", "traditional", "transfer",
                   "alternative", "circumstances ", "comments", "compensation",
                   "components", "consent", "considerable", "constant ",
                   "constraints", "contribution", "convention ", "coordination",
                   "core", "corporate ", "corresponding", "criteria", "deduction",
                   "demonstrate ", "document", "dominant", "emphasis ", "ensure",
                   "excluded", "framework ", "funds", "illustrated ", "immigration",
                   "implies", "initial ", "instance ", "interaction", "justification",
                   "layer", "link", "location", "maximum ", "minorities", "negative ",
                   "outcomes", "partnership", "philosophy ", "physical ",
                   "proportion ", "published ", "reaction", "registered ", "reliance",
                   "removed", "scheme", "sequence", "sex", "shift", "specified ",
                   "sufficient", "task", "technical ", "techniques", "technology",
                   "validity", "volume", "access", "adequate", "annual", "apparent",
                   "approximated", "attitudes ", "attributed ", "civil", "code",
                   "commitment ", "communication", "concentration", "conference ",
                   "contrast ", "cycle", "debate", "despite ", "dimensions ",
                   "domestic ", "emerged ", "error", "ethnic", "goals", "granted",
                   "hence", "hypothesis ", "implementation", "implications",
                   "imposed", "integration", "internal ", "investigation", "job",
                   "label", "mechanism ", "obvious", "occupational ", "option",
                   "output", "overall ", "parallel", "parameters", "phase",
                   "predicted", "principal", "prior", "professional", "project",
                   "promote", "regime", "resolution ", "retained", "series",
                   "statistics ", "status", "stress", "subsequent", "sum", "summary",
                   "undertaken ", "academic ", "adjustment ", "alter ", "amendment ",
                   "aware ", "capacity ", "challenge ", "clause ", "compounds ",
                   "conflict ", "consultation ", "contact ", "decline ",
                   "discretion ", "draft ", "enable ", "energy ", "enforcement ",
                   "entities ", "equivalent ", "evolution ", "expansion ",
                   "exposure ", "external ", "facilitate ", "fundamental ",
                   "generated ", "generation ", "image ", "liberal", "licence ",
                   "logic ", "marginal ", "medical ", "mental ", "modified ",
                   "monitoring ", "network ", "notion ", "objective ", "orientation ",
                   "perspective ", "precise ", "prime ", "psychology ", "pursue ",
                   "ratio ", "rejected ", "revenue ", "stability ", "styles ",
                   "substitution ", "sustainable", "symbolic ", "target ",
                   "transition ", "trend ", "version ", "welfare ", "whereas ",
                   "abstract ", "accurate ", "acknowledged ", "aggregate ",
                   "allocation ", "assigned ", "attached ", "author ", "bond ",
                   "brief ", "capable ", "cited ", "cooperative ", "discrimination ",
                   "display ", "diversity ", "domain ", "edition ", "enhanced ",
                   "estate ", "exceed ", "expert ", "explicit ", "federal ", "fees ",
                   "flexibility ", "furthermore ", "gender ", "ignored ",
                   "incentive ", "incidence ", "incorporated ", "index ",
                   "inhibition ", "initiatives ", "input ", "instructions ",
                   "intelligence ", "interval ", "lecture ", "migration ", "minimum ",
                   "ministry ", "motivation ", "neutral ", "nevertheless ",
                   "overseas ", "preceding ", "presumption ", "rational ",
                   "recovery ", "revealed ", "scope ", "subsidiary ", "tapes ",
                   "trace ", "transformation ", "transport ", "underlying ",
                   "utility ", "adaptation ", "adults ", "advocate ", "aid ",
                   "channel ", "chemical", "classical ", "comprehensive ",
                   "comprise ", "confirmed ", "contrary ", "converted ", "couple ",
                   "decades ", "definite", "deny ", "differentiation ", "disposal ",
                   "dynamic ", "eliminate ", "empirical ", "equipment ", "extract ",
                   "file ", "finite ", "foundation ", "global ", "grade ",
                   "guarantee ", "hierarchical ", "identical ", "ideology ",
                   "inferred ", "innovation ", "insert ", "intervention ",
                   "isolated ", "media ", "mode ", "paradigm ", "phenomenon ",
                   "priority ", "prohibited ", "publication ", "quotation ",
                   "release ", "reverse ", "simulation ", "solely ", "somewhat ",
                   "submitted ", "successive ", "survive ", "thesis ", "topic ",
                   "transmission ", "ultimately ", "unique ", "visible ",
                   "voluntary ", "abandon ", "accompanied ", "accumulation ",
                   "ambiguous ", "appendix ", "appreciation ", "arbitrary ",
                   "automatically ", "bias ", "chart ", "clarity", "conformity ",
                   "commodity ", "complement ", "contemporary ", "contradiction ",
                   "crucial ", "currency ", "denote ", "detected ", "deviation ",
                   "displacement ", "dramatic ", "eventually ", "exhibit ",
                   "exploitation ", "fluctuations ", "guidelines ", "highlighted ",
                   "implicit ", "induced ", "inevitably ", "infrastructure ",
                   "inspection ", "intensity ", "manipulation ", "minimised ",
                   "nuclear ", "offset ", "paragraph ", "plus ", "practitioners ",
                   "predominantly ", "prospect ", "radical ", "random ",
                   "reinforced ", "restore ", "revision ", "schedule ", "tension ",
                   "termination ", "theme ", "thereby ", "uniform ", "vehicle ",
                   "via ", "virtually ", "widespread ", "visual ", "accommodation ",
                   "analogous ", "anticipated ", "assurance ", "attained ", "behalf ",
                   "bulk ", "ceases ", "coherence ", "coincide ", "commenced ",
                   "incompatible ", "concurrent ", "confined ", "controversy ",
                   "conversely ", "device ", "devoted ", "diminished ", "distorted",
                   "distortion", "equal", "figures", "duration ", "erosion ",
                   "ethical ", "format ", "founded ", "inherent ", "insights ",
                   "integral ", "intermediate ", "manual ", "mature ", "mediation ",
                   "medium ", "military ", "minimal ", "mutual ", "norms ",
                   "overlap ", "passive ", "portion ", "preliminary ", "protocol ",
                   "qualitative ", "refine ", "relaxed ", "restraints ",
                   "revolution ", "rigid ", "route ", "scenario ", "sphere ",
                   "subordinate ", "supplementary ", "suspended ", "team ",
                   "temporary ", "trigger ", "unified ", "violation ", "vision ",
                   "adjacent ", "albeit ", "assembly ", "collapse ", "colleagues ",
                   "compiled ", "conceived ", "convinced ", "depression ",
                   "encountered ", "enormous ", "forthcoming ", "inclination ",
                   "integrity ", "intrinsic ", "invoked ", "levy ", "likewise ",
                   "nonetheless ", "notwithstanding ", "odd ", "ongoing ", "panel ",
                   "persistent ", "posed ", "reluctant ", "straightforward ",
                   "undergo ", "whereby ", "noob", "frag", "punish", "lamer", "noobs",
                   "knife", "shank", "humvee", "sniper", "don't", "run", "you'll",
                   "only", "die", "tired", "LOL", "ROFL", "GG", "FTW", "indeed",
                   "sure", "yeah", "yea", "hi", "hello", };
    }Message was edited by:
    joker8baller

  • Is there any way to repair (re-install) the internal flash player for IE10?

    Hi eveyone,
    In short;
    been running Win 8 Pro 64-bit for a couple of days now. Decided it was time to try out some software so installed  a trial of Fix It Utilities Professional (bad decision).
    Installed it, played around for a bit and after a while I came up with the brilliant idea of running a registry clean/fix (insert facepalm) and some overall clean-up, just curious
    to seel the results.
    Being stupid and feeling lazy, cleaned everything and didn't create a backup. Everything seemed fine afterwards. Only the internal flash player for IE 10 dissapeared
    from the Add-ons list, hence the plugin itself stopped working.I've tried everything I think I've tried all the help options I could find on the Adobe site, but nothing seems to work (un-install tool,
    delete files and folders, IE's security settings back to default, checked ActiveX status and permissons, reset all data and settings for IE10 etc) Something must have been modified in the registry
    but I'm just unable to locate the problem. I also installed the latest beta for Chrome and that's working like a charm, no problems at all and the performance is great.
    So this is the error I receive:
    I'm kinda stuck now; the installer won't let me installl it because IE has a built in plugin, but it's not working in IE. It's not even visible in the add-on menu.
    I know it was a pretty stupid thing to do, but I still hope someone here knows what to do. I;m kinda running out of ideas/options (not going to edit the registry myself, because you can
    bet your money this will only have a negative outcome
    thanks in advance!
    edit
    the last thing I can think of is that OpenOffice and Windows Live Messenger also use flash, if i'm correct. E.g. in the OpenOffice folder there is a flash.dll file. Could these files be of real
    influence?
    ill copy all the current flash files and keys/values, seems the only way to clear thing ups a bit

    No, you can ask questions, but you'll have to wait until someone shows up who knows the answer.
    I do not have Windows 8 / IE10, so I don't know anything about it.
    You may have to wait until US daytime; maybe someone from the Adobe staff knows the answer.  But you may be better off asking in a IE10 forum.
    Meanwhile check if you can find any relevant information in http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flas h_player_windows8_admin_guide.pdf

  • Red light flashing twice indicates that battery life was below 20%

    By the way, I was using my Playbook down to 10% battery life.  I plugged it into the wall to charge it after shutting it down and it wouldn't come back up.  Your Playbook will die!!  Then you can reload the OS and start all over.  So, RIM doesn't feel the need to let you know that sometime between 20% and 10% you will be screwed. This is not only a product defect, it's also a ridiculous oversight in the user manual, or lack thereof, that is sent to you when you buy it.  At the very least, the screen pop-up ought to say, I'm gonna erase your book if you don't plug me in!!!!
    So aggravated, reloading everything now.  Be sure to plug in to your pc/mac and back-up now!  And watch those batteries and your behind.
    AGGRAVATION!!!!!!!
    P.S  why does it take so long for this thing to boot up?  i think my dinosaur PC is faster.

    The advice in the title of this thread is wrong, of course, and can safely be ignored.  I don't know what occurred in the specific situation described here, but I've repeatedly drained my PlayBook to the point where it shut itself off, at 0%, with no such negative outcome.
    That said, there do seem to be some issues with getting it back on sometimes when it's very low.  I've never had much issue myself, but I'm a patient sort.  If it doesn't turn on immediately, I assume some mysterious software problem is involved, wait a few minutes, and try again.  I also find that sometimes a brief press on the power button isn't recognized or responded to, and feel like I need to hold it down for a second before the thing notices and responds.  Maybe that's required in some cases, maybe not.  Lastly, I've read (but never seen this myself) that it may be necessary to recharge it for an hour or so after a complete discharge, before it will come on.  Not sure where people got that one, but possibly it is required.
    Sorry for your aggravation, but if you are willing to actually try to work through the issue here, whatever it is, you could probably get some good advice from others here.  This is a community forum, "staffed" pretty much solely by other RIM customers who are volunteering here to help people out, so please keep that in mind when venting.
    As for the boot up, in case you seriously wanted an answer: it's probably because the flash storage with the operating system image on it is being scanned and checked against a cryptographic signature, to ensure that it hasn't been tampered with.  If your dinosaur PC, which may well be faster, would do that, we'd have a lot fewer viruses and other security breaches in this world. 
    Most people only rarely cycle power on their tablet, and if you merely put it in standby (I realize that wasn't possible in this case... just talking in general terms here) you'll find it comes on effectively instantly, which is way better than your PC, or even a modern one, can do.
    Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
    Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!

  • SELECT  QUERIES IN ABAP.....

    Can you give some idea about writing efficient select queries in ABAP?

    Hi kishan,
      i can give you some hint from one document, please reward point.
    The hit list is the set of rows determined by the WHERE clause. In other words, it is the set of table rows that the database system must take into account to respond to the query. Don’t confuse the hit list with the solution set, which is the set of rows (not necessarily from the table the query deals with) the database system returns to the program. Notice that in many cases the query’s hit list and the solution set are different.
    What is the reason behind this rule? A smaller hit list saves disk I/Os by the database system and often reduces network load. Both of these factors have a strong influence on your program’s runtime performance.
    How can you use ABAP to limit a hit list? First, use a WHERE clause whenever possible. Second, always try to describe the full search condition (not just part of it) within a single WHERE clause. ABAP provides a variety of arithmetical and logical operators to do this. Compared with your application program, the database server is usually the better place to evaluate search conditions.
    Let me give you an example: Run a query against the flight table to produce a list of all flight dates for Lufthansa flight 0300 in 1998. Air carrier and air connection are known and can easily be used within the WHERE clause of the SELECT statement. The relevant year is also given, but at first glance it is difficult to build an appropriate search condition. Faced with this situation, you could be tempted to use the ABAP CHECK statement.
    CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement. CHECK with a negative outcome terminates the current SELECT-ENDSELECT loop to start with the next row of the solution set, if there is one. Considering that fldateis a type D(YYYYMMDD) column of the sflighttable, a correct fragment of an ABAP program could look like this:
    SELECT fldate
      FROM sflight INTO xdate
      WHERE carrid = 'LH'
        AND connid = '0300'.
      CHECK xdate = '1998'.
        WRITE: / xdate.
    ENDSELECT.
    With ABAP in general, CHECK does the job of pattern matching in character variables. But in the WHERE clause of a SELECT statement, pattern matching also can be done easily by applying the LIKE operator. Within the search pattern, two characters have a particular meaning: “_” stands for any one character and “%” stands for any character string. With this in mind, a better solution would be:
    SELECT fldate
      FROM sflight INTO xdate
      WHERE carrid ='LH'
        AND connid ='0300'
        AND fldate LIKE '1998%'.
      WRITE: / xdate.
    ENDSELECT.

  • Query on Transaction Management in MP model

    For a transaction in MP model, if one node where the transaction is happening goes down/crashes for some reason, will the transacation continue onto the alternate node ? or it needs to be initiated again ? If it continues on second node, how this is being handled by tuxedo ?

    Hi,
    Unless a failure can be completely hidden, in general the XA specification indicates that a failure must cause a transaction to be rolled back. This is true in SHM or MP mode. So in MP, if machine SITE1 calls a service on machine SITE2 and that service returns failure for any reason such as the machine died so the caller received an error when blocktime was exceeded, the application code returned an error, the link between the machines failed and wasn't able to be recovered before the blocking time or transaction time expired, or the calling process on SITE 1 (either a client or server) dies before committing the transaction with tpcommit(), the transaction will eventually be rolled back.
    Currently Tuxedo doesn't retry any services or transactions. Part of the reason for this is that for non-idempotent services, executing them more than once is a problem. So for example if I create a TRANSFER service as in the Tuxedo bankapp sample application, and I implement that service as:
    1) tpbegin()
    2) tpcall(withdraw...)
    3) tpcall(deposit...)
    4) tpcommit()And the call to the deposit service fails, re-executing it might cause twice the amount of money to be deposited into the receiving account. The reason for this is that the caller of deposit when it receives an error, can't be certain whether or not the deposit service actually changed the state of the underlying resource manager (RM) which would likely be a database. The failure in the deposit service might have occurred after the database was changed, but before the reply reached the caller of the deposit service. So in a sense, the caller received a false negative outcome. The only guaranteed safe way to retry a request in this scenario is if we know that executing the service once or more than once leaves the system in the exact same state, i.e., the request is idempotent.
    We have considered adding support for idempotent services, but haven't seen much customer demand for it. Can you describe what it is you'd like to see Tuxedo do and why?
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect
    PS There is one scenario where Tuxedo will automatically retry a transaction and service and that is with the TMQFORWARD server. It is a server that is configured to:
    1) tpbegin()
    2) tpdequeue()
    3) tpcall()
    4) tpenqueue()
    5) tpcommit()In this case TMQFORWARD starts a transaction, takes a message off a queue, calls a service of the same name as the queue, then places the reply on another queue, and then commits the transaction. So in the case of success, an request has been processed from the first queue and the reply placed on the second queue. If a failure occurs, the transaction is rolled back, and TMQFORWARD will try the whole sequence again. Since every involved is part of the transaction, it is safe for TMQFORWARD to try again.

  • Is there any harm in upgrading from 10.5.8 to 10.8?

    I'd like to premise this question by saying that I am aware that there is a Downloadable Mountain Lion Recovery Assistant that you can put onto an external hard drive and boot to.  For this question I ask the reader to pretend the 10.8 Recovery Assistant doesn't exist. 
    I also ask that the reader provide a reason why in their answer. 
    If I have an 2009 iMac with 10.5.8 and a 2011 MacBook Pro with 10.8.4 connected to each other with a firewire cable, is there any harm in putting the iMac into Target Disk Mode, booting the MacBook Pro to Recovery 10.8.4 and Reinstalling Mac OS X Mountain Lion onto the iMac's Macintosh HD? 
    I'm wondering if Apple wants people to from Leopard 10.5.8 to Snow Leopard 10.6.8 just for the sake of gaining access to the App Store, or if there is some greater potential for a negative outcome in skipping Snow Leopard 10.6.8 and going straight to Mountain Lion 10.8.4 from Leopard 10.5.8 -- eg. missing filing system prerequisites. 
    Thanks, to anyone who responds, for your input

    If I have an 2009 iMac with 10.5.8 and a 2011 MacBook Pro with 10.8.4
    connected to each other with a firewire cable, is there any harm in
    putting the iMac into Target Disk Mode, booting the MacBook Pro to
    Recovery 10.8.4 and Reinstalling Mac OS X Mountain Lion onto the iMac's
    Macintosh HD? 
    You need the drivers for the hardware on the 2009 machine, then comes the problem of updating, reinstalles etc.
    You need to go the 10.6 retail disk to 10.8 via AppStore method or...
    I'm wondering if Apple wants people to from Leopard 10.5.8 to Snow Leopard 10.6.8 just for the sake of gaining access to the App Store, or if there is some greater potential for a negative outcome in skipping Snow Leopard 10.6.8 and going straight to Mountain Lion 10.8.4 from Leopard 10.5.8 -- eg. missing filing system prerequisites. 
    You can download the 10.8 installer and make one of these
    http://www.techrepublic.com/blog/mac/how-to-create-a-bootable-usb-to-install-os- x/2699
    Problem is of course your 2011 machine is already on 10.8 and if the AppStore won't down it saying "your already on 10.8" then you would have to clone 10.8 on a external drive and disconnect, command option r boot into Internet Recovery to erase the drive and install 10.7, then AppStore download the 10.8 installer to make the USB thumb drive, then upgrade the 2011 machine back to 10.8
    Option/alt key to boot off the clone and reverse clone 10.8 old configuration back on. Then use the 10.8 USB to install on the other machine.
        Most commonly used backup methods
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents#/?p er_page=50

  • CHECK behaviour??

    Hi Experts,
    Pls. clarify my basic doubt that, Wht is CHECK behaviour in the folllowing scenarios?
    1) LOOP
    check not my_itab[] is initial.
    endloop.
    2) form_1
    check not my_itab[] is initial.
    endform.
    3) Main Prog. blocks
    check not my_itab[] is initial.
    logic...
    4) Is END-OF-SELECTION triggers, if CHECK is true i.e. my_itab does hv records?
    1) IF
    check not my_itab[] is initial.
    endif.
    thanq

    CHECK evaluates the subsequent logical expression . If it is true, the processing continues with the next statement.
    In loop structures like
    DO ... ENDDO
    WHILE ... ENDWHILE
    LOOP ... ENDLOOP
    SELECT ... ENDSELECT
    CHECK with a negative outcome terminates the current loop pass and goes back to the beginning of the loop to start the next pass, if there is one.
    In structures like
    FORM ... ENDFORM
    FUNCTION ... ENDFUNCTION
    MODULE ... ENDMODULE
    AT
    CHECK with a negative outcome terminates the routine or modularization unit.
    If CHECK is not in a loop or a routine or a modularization unit, a negative logical expression terminates the current event. In contrast, the statement REJECT terminates the current event, even from loops or subroutines.
    Regards,
    Santosh

  • Activating t:inputText with command link

    I have a situation where I will have an outputText for a field say a name, I have a command link name edit which enables the name field in editable mode i.e an inputText, can some one tell me how can I do this? I guess I can use render, I am not sure, any ideas and suggestions?
    <htm:tr styleClass="h2">
              <htm:td>
                   <h:outputText value="Organization Name Information:" />
              </htm:td>
              <htm:td>
                   <t:commandLink id="EditOrgInformation"
                        forceId="true"
                        value="EDIT"
                         action=""
                         onclick="if(submitFlag){return false;}else{submitFlag=true;return true;}" />
              </htm:td>
         </htm:tr>
         <htm:tr styleClass="oddRow">
              <htm:td>
                   <h:outputText value="Name:" />
              </htm:td>
              <htm:td>
                   <h:outputText value="#{lo.name }" />
              </htm:td>
         </htm:tr>

    If you want to do it synshronously, indeed use the rendered attribute. Use its positive outcome in inputText and its negative outcome in outputText. If you want to do it asynchronously, then use Javascript+DHTML or an Ajaxical JSF component library.

  • Hi gurus what is check and continue

    hi gurus what is check and continue

    Hii!
      CHECK logexp.
    Effect
    CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement.
    CHECK with a negative outcome terminates the current loop pass and goes back to the beginning of the loop to start the next pass, if there is one. Examples of loop structures are:
    DO     ... ENDDO
    WHILE  ... ENDWHILE
    LOOP   ... ENDLOOP
    SELECT ... ENDSELECT
    Note
    Outside loops, a CHECK with a negative outcome will cause you to exit the current processing block (event block, dialog module, procedure). During the reporting event GET, the system terminates the processing of the current entry, read by the logical database, and processes the next entry in the current node of the logical database. Nodes that are subordinate in the hierarchical structure of the logical database are not processed.
    SAP recommends that you only use CHECK within loops. Use the RETURN statement to exit processing blocks.
    You can use the REJECT statement to exit the reporting event GET conditionally.
    CONTINUE.
    Effect
    Within loop structures like
    DO     ... ENDDO
    WHILE ... ENDWHILE
    LOOP ... ENDLOOP
    SELECT ... ENDSELECT
    CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one.
    Example
    DO loop: Omit an area (10 ... 20)
    DO 100 TIMES.
      IF SY-INDEX >= 10 AND SY-INDEX <= 20.
        CONTINUE.
      ENDIF.
    ENDDO.
    Regards
    Abhijeet

  • Hp Dc7900-Win7 32bit-fitted ram rams to pc & red lights came out with beeps.

    Hi
    I accidentally fitted some new rams-Geil 1Gb PC2-6400 DDR2 800 x 4pcs 2.1V which was meant for another Pc into my Hp Dc7900-Win 7 32bit-Core 2 Duo 3.0Ghz-2Gb PC2-5300 DDR2 667 x 4 pcs. When My Hp Dc7900 was switch on, immediately, the red led lights started blinking with beeps. On the start up screen-initialising from ME-Update BIOS or ME, had restarted and reset to factory default-negative outcome, can anyone able to advise or help, thanks very very much.

    Which model do you have and what happened when you put the old memory back in?
    HP Compaq dc7900 - NN133UC#ABB ›
    HP Compaq dc7900 Base Model Convertible Minitower PC ›
    HP Compaq dc7900 Base Model Small Form Factor PC ›
    HP Compaq dc7900 Base Model Ultra-slim Desktop PC ›
    HP Compaq dc7900 Convertible Minitower PC ›
    HP Compaq dc7900 Small Form Factor PC ›
    HP Compaq dc7900 Ultra-slim Desktop PC ›
    Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may click on the white star in the "Kudos" button for any helpful post to give that person a quick thanks. These feedback tools help keep our community active, so you receive better answers faster.

  • Applet security -- accessing files over the Web.

    I guess the topic pretty much sums up my question..
    I have an applet and I want to read a file from over the web.
    After creating a URL, I try to retrieve an inputstream by calling openStream() but I get all the java.security.AccessControlException: access denied rubbish..
    How do I get it working ?

    The applet can only read data from the server where it is saved. For security purposes applets have limited capabilities. They can't write data to a remote hard drive or read data from remote machines. A way around this is to create a "trusted applet". Basically what it does is informs any machine you are trying to access that you wrote this applet and are responsible for any negative outcome. There is a tutorial provided by Sun that can explain this better than I can. Here is the link:
    http://java.sun.com/security/signExample/index.html
    Good luck.

  • N 96 & Car Menu

    After having my CK-300 working perfectly with my 5310 i've decided to upgrade to an N96 to get the nav working, i'm not sure what software the CK-300 is running but on the box there is 1.2 printed so i think that may be a fair guess. As far as i know i have the latest release of software for the N96 and also of car menu, I have some positive and some negative outcomes so far. the biggest plus is that it pairs and opens up car menu with no problems although it is sometimes a bit slow to disconnect, phone calls and the menu interface with car menu works however car menu doesn't seem to have an icon for music player, do you really have to exit car menu and go into the application through the phone to use it?? also i have not yet purchased the licence for nav but wondering if from other peoples experience i will need to update the CK software before this is likely to work
    Cheers

    Thanks Confiture, I had tried pressing the silver button before but only once i was alrady in the "contacts" half of the car menu and so all it had done was take me back to the main blank page, another press and i got where i wanted I have now got the maps navi license and as suspected can only get directions when listening to music player and then it relays the directions over the music and mutes for a second or so after. I guess the hunt for an update cable is on, scoobyman has offered a possible solution so if i have no luck this may be the way to go.
    I am in Tamworth near Birmingham if anyone knows of an accredited installer with the cable nearby.
    Cheers

  • Diff between  stop ,exit ,check ,continue

    abapers

    Hi,
    STOP :This statement terminates a processing block in an excutable
    program.
    The statement is only intended for use in the INITIALIZATION,
    AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It
    terminates the current processing block in an executable
    program and triggers the END-OF-SELECTION event. In all other
    processing blocks, or when you do not want to trigger the
    END-OF-SELECTION event, you must use EXIT.
    EXIT.
    Within a loop structure:
    Terminates looop processing (DO, WHILE, LOOP, SELECT).
    Within subroutines and other modularization units (but not
    in a loop structure):
    Leaves the subroutine or modularization unit (FORM, MODULE,
    FUNCTION, TOP-OF-PAGE, END-OF-PAGE).
    Outside loop structures and modularization units (report
    processing):
    Terminates report processing and triggers list display.
    DATA: SAP_COUNT TYPE I,
    WA_T100 TYPE T100.
    SELECT * FROM T100 INTO WA_T100 WHERE SPRSL = SY-LANGU AND
    ARBGB = 'DS'.
    WRITE / WA_T100-TEXT.
    IF WA_T100-TEXT CS 'SAP'.
    ADD 1 TO SAP_COUNT.
    IF SAP_COUNT = 3.
    EXIT.
    ENDIF.
    ENDIF.
    ENDSELECT.
    CHECK logexp.
    CHECK evaluates the subsequent logical expression. If it is
    true, the processing continues with the next statement.
    In loop structures like
    DO ... ENDDO
    WHILE ... ENDWHILE
    LOOP ... ENDLOOP
    SELECT ... ENDSELECT
    CHECK with a negative outcome terminates the current loop pass
    and goes back to the beginning of the loop to start the next
    pass, if there is one.
    In structures like
    FORM ... ENDFORM
    FUNCTION ... ENDFUNCTION
    MODULE ... ENDMODULE
    AT events
    GET events
    CHECK with a negative outcome terminates the routine or
    modularization unit.
    If CHECK is neither in a loop nor a routine nor a
    modularization unit, a negative logical expression terminates
    the current event. In contrast, the statement REJECT terminates
    the current event, even from loops or subroutines.
    CONTINUE.
    Within loop structures like
    DO ... ENDDO
    WHILE ... ENDWHILE
    LOOP ... ENDLOOP
    SELECT ... ENDSELECT
    CONTINUE terminates the current loop pass, returns the
    processing to the beginning of the loop and starts the nex
    loop pass, if there is one.
    DO loop: Omit an area (10 ... 20)
    DO 100 TIMES.
    IF SY-INDEX >= 10 AND SY-INDEX <= 20.
    CONTINUE.
    ENDIF.
    ENDDO.
    Regards
    Kiran Sure

Maybe you are looking for

  • Linking Dynamic text boxes?

    Hi there, This might be straight forward, but I would like to know how could one link dynamic text boxes so that the information would flow? In a way, the information would flow from: (XML) Input A into BOXA00, BOXA01, BOXA02, BOXA03, etc. (XML) Inpu

  • GRC 10 EAM - Unable to assign Firefighter roles to owners

    Greetings SAP gurus, I am currently on a new GRC 10 installation and having issues with the Emergency Access Management (EAM) component previously known as FireFighter or SPM.  Note: We are trying to implement the Firefighter ''Role-Based" Approach.

  • How do i get my playlist from my windows media player to my creative

    can anyone tell me how to get the playlist I created in my windows media player to sync into my creative zen ?

  • How to delete photos on iphone

    On my iphone 4, I have 40 photos showing under "photos".  However, when I sync my phone to itunes, the phone's memory is almost full, and most of that is attributed to hundreds of photos.  It appears the phone keeps these photos somewhere in memory,

  • After upgrade to Mavericks I have to shutdown using the power button.  Any fix for this?

    I have a mid 2011 iMac, just upgraded to OSX Mavericks.  It will no longer shut down using the menu.  I have to push and hold the power button.  This sometimes results in a very loud "snap" from my machine.  Tried reinstalling but still does the same