Don't understand Connector.open timeout parameter

Is setting this timeout parameter = true same as using setSoTimeout(timeout) in java.net? I need to use read() method to read data from inputstream as a nonblocking operation by setting the max. time that allows the read() method to stay blocking. How can I implement this operation with MIDP without generating second thread?

Hi
you could go through file \javax\microedition\io\Connectot.java
it says
* An optional third parameter is a boolean flag that indicates
* if the calling code can handle timeout exceptions. If this
* flag is set, the protocol implementation may throw an
* InterruptedIOException when it detects a timeout condition.
* This flag is only a hint to the protocol handler, and it
* does not guarantee that such exceptions will actually be thrown.
* If this parameter is not set, no timeout exceptions will be
* thrown. The timeout period is not specified in the open call
* because this is protocol specific. Protocol implementors can
* either hardwire an appropriate value or read them from an
* external source such as the system properties.
we can see they do not specify only open could throw
InterruptedIOException though currently the function
prototype means only open will throw checked exception
InterruptedIOException.
anyway timeout should be implemented
interoperateing with protocol.java and native function.OK?

Similar Messages

  • Connector.open, timeouts parameter

    Hi,
    I'm using Connector.open(String name, int mode, boolean timeouts), where the timeouts parameter = true, to return an HttpConnection, which I then use to send and recieve data with.
    On the motorola devices I've used for testing, an IOException is generated when the server takes longer than ~40seconds to respond, is this due to the device closing the connection due to the timeout value?
    I thought an IOInterruptedException should be thrown if a timeout occurs?
    Also, is the length of the timeout specific to the device?
    Any information about how timeouts work would be greatly appreciated!!

    Hi
    you could go through file \javax\microedition\io\Connectot.java
    it says
    * An optional third parameter is a boolean flag that indicates
    * if the calling code can handle timeout exceptions. If this
    * flag is set, the protocol implementation may throw an
    * InterruptedIOException when it detects a timeout condition.
    * This flag is only a hint to the protocol handler, and it
    * does not guarantee that such exceptions will actually be thrown.
    * If this parameter is not set, no timeout exceptions will be
    * thrown. The timeout period is not specified in the open call
    * because this is protocol specific. Protocol implementors can
    * either hardwire an appropriate value or read them from an
    * external source such as the system properties.
    we can see they do not specify only open could throw
    InterruptedIOException though currently the function
    prototype means only open will throw checked exception
    InterruptedIOException.
    anyway timeout should be implemented
    interoperateing with protocol.java and native function.OK?

  • From what I understand RAW photos are supposed to open in raw in photoshop CC.  I don't understand why my RAW photos don't open in RAW in photoshop CC or Lightroom 5

    From what I understand RAW photos are supposed to open in raw in photoshop CC. I don't understand why my RAW photos don't open in RAW in photoshop CC or Lightroom 5

    Has the behavior changed compared to how it used to open ? If so, do you refer to the Camera RAW window similar to this: http://screenshots.en.sftcdn.net/en/scrn/78000/78026/adobe-camera-raw-22.jpg
    What is the file extension of your photos ?
    In Lightroom, there is no special way of opening a RAW file vs. JPEG. They all open the same. What is the Lightroom behavior ? Can you post a screenshot ?

  • I have done the softer update and now this system request a connection with a meanie HD and I connector for iTunes I don't understand why ?

    I have done the softer update and now this system request a connection with a Mini  HDMI  connector for iTunes I don't understand why ?
    DO I HAVE TO HAVE THE MINI HDMI CONNECTOR TO COMPLETE THE SOFTER UPDATE PROCESS ?

    You might be seeing a Micro USB cable (Not HDMI) that is because your Apple Tv is in Recovery Mode due to some reason and it needs to be Restored by connecting it to iTunes on your Computer. So if you have a Micro USB cable ( which comes with Android Smart Phones ) then try to connect your Apple Tv to your computer using the same and with the help of iTunes Restore your Apple Tv to Factory Settings. Go through the below Apple Support kb which says " If your Apple TV still does not respond or if you were unable to follow the above steps "
    http://support.apple.com/kb/ht4367

  • I don't understand what eats my data to give me overage. I don't play games, or use apps, except texting and photos, I have facebook but rarely use it or read it, I try to clear and close anything opened

    I don't understand what gives me data overage, I make calls, text, take photo or video. I don't use any apps maybe once in a blue moon google a question. no games or navigation, don't shop, I do have facebook, but rarely use it.because I look on computer. I try to clear and close after each use. So what else can I do to prevent something eating data? I am a senior and don't understand gigs etc. Maybe  a few times a month I might post from cell to email a pic.

    Just because you do not use an app does not mean it is not doing something in the background.
    Facebook, for example... If you have used it one time it can be uploading any photos/videos you take with your phone on a regular basis even if you don't open it up again. Have you checked your settings in these apps to only sync while on wifi. This can cause a lot of data usage if you did not.
    If you don't feel you need the app, either delete it or disable it.
    Once you open an app the first time, it is activated and unless you make sure the app settings are such that you will not use a lot of data, you should assume they will. Especially apps which have the capability to upload photos/video from your phone.

  • PXE error = PXE-E32: TFTP open timeout

    Hi Everyone,
    I have a switched network using CISCO switches and also CISCO CNR(Cisco Network Register 6.1) acting as DHCP on my network. I modified the policies for the scope where my clients are connected using PXE to obtain the SCCM and WDS images and i'm having the following error
    "PXE error = PXE-E32: TFTP open timeout"
    The networking guy told me that the clients using DHCP never tries to connect to the TFTP server on my SCCM and WDS server that are running on a different box than the CNR 6.1.
    Also i set the following parameters on my scope policy at the CNR 6.1 to the network segment where the clients are connected:
    [011]  resource-location-server                        <ip address of my WDS & SCCM server>
    [067] boot-file                                                     <name of my .WIM image>
    [066] tftp-server                                                  <FDQN of my WDS  & SCCM server>
    If there's more options to set in order to achieve the download of the images from the WDS & SCCM server?
    Could someone help?
    I'll appreciate your comments,
    Cordially,
    Oscar.

    Hello,
    I just accidentally dropped in, searching for the name of the bootfile, that was explained here as SMSBoot\x86\wdsnbp.com. What is important with PXE and tftp is to understand the process, which is actually quite simple. You pass the name of the bootserver and the boot filename bye one of two methods. It is either done through Proxy DHCP, which is implemented on your SCCM server. For this towork, you do not need any changes to your DHCP scope, but you have to add a DHCP helper (also called DHCP relay or BOOTP relay) to the router that you use for the CLIENT segment. The DHCP helper has to point to the WDS/SCCM server. Do not remove any DHCP helpers that are already in the TCP segment.
    If this is not an option, you have to go the way that you currently are, and specify options 66 and 67, which point to the server and the bootloader (not the WIM-file) on your SCCM server. This has to be specified relative to the root path of the tftp service on your machine, so the value Kenneth suggested, SMSBoot\x86\wdsnbp.com seems correct. (I don't really know SCCM, but I really do know PXE :-) )
    To test tftp:
    1. From the client to the server: Download a tftp client (if you run Vista, it can be installed as a feature) and try to download the file. the command should be *similar* to "tftp get SMSBoot\x86\wdsnbp.com"
    2. From the server to the client: Disable Microsoft's tftp server and install a freeware/shareware tftpserver that implements logging. Configure the tftp server to use the same directory that Microsoft's tftp server uses. Start tftp server and check the real-time log to see what is going on
    Using these methods, you should normally find out quite explicitly what is wrong with your setup :-)
    Regards,
    Ole Kristian

  • Why is this an error???  I don't understand why it is... Help Please

    Hi,
    Ok, I'll preface this by saying there's a lotta code pasted in here but it really quite an easy question, I just need to post all the code so you understand where what came from.
    Now.............the question I'm trying to do is to create an applet that has 2 buttons -- each button when clicked opens an application (one is a simple calculator, the other a Mortgage calculation app). When you click one of the buttons (calc or mortgage), that app opens infront of the 2 button menu so its in "focus". The button on the 2 button menu then switches to a "hide app X" button (ie: "Mortgage", changes to "Hide Mortgage"). Thus if you click the hide button, the app that was opened is hidden, and then that "hide" button switches back to the original "app X" button. Pretty simple.
    Now, I have from my text book an example that does exactly this, with the simple calculator already in it, and with another app (a traffic light thing) where the Mortgage should be in my final product. I also already have the Mortgage applet I need to insert from another book example in place of that Traffic Light portion.
    Now, common sense would dictate that I should be able to just copy my code for the Mortgage applet into the example that has the 2 button menu structure, and overwrite the code I want to get rid of (the traffic light) with the mortgage code & rename the menu buttons. Right?? A simple switch of one thing for another... but therein lies my problem.
    I copied all the Mortgage code in correctly over the traffic lights, switched the button names, tried to compile it but I get one error....
    Exercise12_17.java:52: cannot resolve symbol
    symbol  : method pack ()
    location: class MortgageApplet
            mortgageAppletFrame.pack();I don't understand why..... mortgageAppletFrame.pack(); was a simple rewrite from lightsFrame.pack(); like every other line...... it should work. I've gone over it for 2 days......... Anyone know why it comes up as an error???
    Below, in order going down is (1)my code with the 1 error I can't solve, (2)the original menu example I tried to edit, and (3)the Mortgage app code...........
    Does anyone know what my error is?? Help or a hint would be greatly appreciated........ Thanks.
    My erroring app.......
    // Exercise12_17.java: Create multiple windows
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class Exercise12_17 extends JFrame implements ActionListener {
      // Declare and create a frame: an instance of MenuDemo
      MenuDemo calcFrame = new MenuDemo();
      // Declare and create a frame: an instance of RadioButtonDemo
      MortgageApplet mortgageAppletFrame = new MortgageApplet();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtMortgage;
      public static void main(String[] args) {
        Exercise12_17 frame = new Exercise12_17();
        frame.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise12_17() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
         getContentPane().add(jbtMortgage = new JButton("Mortgage"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
         jbtMortgage.addActionListener(this);
      public void actionPerformed(ActionEvent e) {
        String arg = e.getActionCommand();
        if (e.getSource() instanceof JButton)
          if ("Simple Calculator".equals(arg)) {
            //show the MenuDemo frame
            jbtCalc.setText("Hide Simple Calculator");
            calcFrame.pack();
            calcFrame.setVisible(true);
          else if ("Hide Simple Calculator".equals(arg)) {
            calcFrame.setVisible(false);
            jbtCalc.setText("Simple Calculator");
          else if ("Mortgage".equals(arg)) {
            //show the CheckboxGroup frame
            mortgageAppletFrame.pack();
            jbtMortgage.setText("Hide Mortgage");
            mortgageAppletFrame.setVisible(true);
          else if ("Hide Mortgage".equals(arg)) {
            mortgageAppletFrame.setVisible(false);
            jbtMortgage.setText("Mortgage");
      class MortgageApplet extends JApplet
      implements ActionListener {
      // Declare and create text fields for interest rate
      // year, loan amount, monthly payment, and total payment
      private JTextField jtfAnnualInterestRate = new JTextField();
      private JTextField jtfNumOfYears = new JTextField();
      private JTextField jtfLoanAmount = new JTextField();
      private JTextField jtfMonthlyPayment = new JTextField();
      private JTextField jtfTotalPayment = new JTextField();
      // Declare and create a Compute Mortgage button
      private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
      /** Initialize user interface */
      public void init() {
        // Set properties on the text fields
        jtfMonthlyPayment.setEditable(false);
        jtfTotalPayment.setEditable(false);
        // Right align text fields
        jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
        jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
        jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
        jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
        jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
        // Panel p1 to hold labels and text fields
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(5, 2));
        p1.add(new Label("Annual Interest Rate"));
        p1.add(jtfAnnualInterestRate);
        p1.add(new Label("Number of Years"));
        p1.add(jtfNumOfYears);
        p1.add(new Label("Loan Amount"));
        p1.add(jtfLoanAmount);
        p1.add(new Label("Monthly Payment"));
        p1.add(jtfMonthlyPayment);
        p1.add(new Label("Total Payment"));
        p1.add(jtfTotalPayment);
        p1.setBorder(new
          TitledBorder("Enter interest rate, year and loan amount"));
        // Panel p2 to hold the button
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
        p2.add(jbtComputeMortgage);
        // Add the components to the applet
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listener
        jbtComputeMortgage.addActionListener(this);
      /** Handle the "Compute Mortgage" button */
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jbtComputeMortgage) {
          // Get values from text fields
          double interest = (Double.valueOf(
            jtfAnnualInterestRate.getText())).doubleValue();
          int year =
            (Integer.valueOf(jtfNumOfYears.getText())).intValue();
          double loan =
            (Double.valueOf(jtfLoanAmount.getText())).doubleValue();
          // Create a mortgage object
          Mortgage m = new Mortgage(interest, year, loan);
          // Display monthly payment and total payment
          jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
          jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    class MenuDemo extends JFrame implements ActionListener {
      // Text fields for Number 1, Number 2, and Result
      private JTextField jtfNum1, jtfNum2, jtfResult;
      // Buttons "Add", "Subtract", "Multiply" and "Divide"
      private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
      // Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
      private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
      /** Main method */
      public static void main(String[] args) {
        MenuDemo frame = new MenuDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
      /** Default constructor */
      public MenuDemo() {
        setTitle("Menu Demo");
        // Create menu bar
        JMenuBar jmb = new JMenuBar();
        // Set menu bar to the frame
        setJMenuBar(jmb);
        // Add menu "Operation" to menu bar
        JMenu operationMenu = new JMenu("Operation");
        operationMenu.setMnemonic('O');
        jmb.add(operationMenu);
        // Add menu "Exit" in menu bar
        JMenu exitMenu = new JMenu("Exit");
        exitMenu.setMnemonic('E');
        jmb.add(exitMenu);
        // Add menu items with mnemonics to menu "Operation"
        operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
        operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
        operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
        operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
        exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
        // Set keyboard accelerators
        jmiAdd.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
        jmiSub.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        jmiMul.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
        jmiDiv.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
        // Panel p1 to hold text fields and labels
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.add(new JLabel("Number 1"));
        p1.add(jtfNum1 = new JTextField(3));
        p1.add(new JLabel("Number 2"));
        p1.add(jtfNum2 = new JTextField(3));
        p1.add(new JLabel("Result"));
        p1.add(jtfResult = new JTextField(4));
        jtfResult.setEditable(false);
        // Panel p2 to hold buttons
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jbtAdd = new JButton("Add"));
        p2.add(jbtSub = new JButton("Subtract"));
        p2.add(jbtMul = new JButton("Multiply"));
        p2.add(jbtDiv = new JButton("Divide"));
        // Add panels to the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners
        jbtAdd.addActionListener(this);
        jbtSub.addActionListener(this);
        jbtMul.addActionListener(this);
        jbtDiv.addActionListener(this);
        jmiAdd.addActionListener(this);
        jmiSub.addActionListener(this);
        jmiMul.addActionListener(this);
        jmiDiv.addActionListener(this);
        jmiClose.addActionListener(this);
      /** Handle ActionEvent from buttons and menu items */
      public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        // Handle button events
        if (e.getSource() instanceof JButton) {
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
        else if (e.getSource() instanceof JMenuItem) {
          // Handle menu item events
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
          else if ("Close".equals(actionCommand))
            System.exit(0);
      /** Calculate and show the result in jtfResult */
      private void calculate(char operator) {
        // Obtain Number 1 and Number 2
        int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
        int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
        int result = 0;
        // Perform selected operation
        switch (operator) {
          case '+': result = num1 + num2;
                    break;
          case '-': result = num1 - num2;
                    break;
          case '*': result = num1 * num2;
                    break;
          case '/': result = num1 / num2;
        // Set result in jtfResult
        jtfResult.setText(String.valueOf(result));
    Original 2 button menu example....
    // Exercise11_8.java: Create multiple windows
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Exercise11_8 extends JFrame implements ActionListener {
      // Declare and create a frame: an instance of MenuDemo
      MenuDemo calcFrame = new MenuDemo();
      // Declare and create a frame: an instance of RadioButtonDemo
      RadioButtonDemo lightsFrame = new RadioButtonDemo();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtLights;
      public static void main(String[] args) {
        Exercise11_8 frame = new Exercise11_8();
        frame.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise11_8() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
        getContentPane().add(jbtLights = new JButton("Traffic Lights"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
        jbtLights.addActionListener(this);
      public void actionPerformed(ActionEvent e) {
        String arg = e.getActionCommand();
        if (e.getSource() instanceof JButton)
          if ("Simple Calculator".equals(arg)) {
            //show the MenuDemo frame
            jbtCalc.setText("Hide Simple Calculator");
            calcFrame.pack();
            calcFrame.setVisible(true);
          else if ("Hide Simple Calculator".equals(arg)) {
            calcFrame.setVisible(false);
            jbtCalc.setText("Simple Calculator");
          else if ("Traffic Lights".equals(arg)) {
            //show the CheckboxGroup frame
            lightsFrame.pack();
            jbtLights.setText("Hide Traffic Lights");
            lightsFrame.setVisible(true);
          else if ("Hide Traffic Lights".equals(arg)) {
            lightsFrame.setVisible(false);
            jbtLights.setText("Traffic Lights");
         class RadioButtonDemo extends JFrame
      implements ItemListener {
      // Declare radio buttons
      private JRadioButton jrbRed, jrbYellow, jrbGreen;
      // Declare a radio button group
      private ButtonGroup btg = new ButtonGroup();
      // Declare a traffic light display panel
      private Light light;
      /** Main method */
      public static void main(String[] args) {
        RadioButtonDemo frame = new RadioButtonDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 170);
        frame.setVisible(true);
      /** Default constructor */
      public RadioButtonDemo() {
        setTitle("RadioButton Demo");
        // Add traffic light panel to panel p1
        JPanel p1 = new JPanel();
        p1.setSize(200, 200);
        p1.setLayout(new FlowLayout(FlowLayout.CENTER));
        light = new Light();
        light.setSize(40, 90);
        p1.add(light);
        // Put the radio button in Panel p2
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jrbRed = new JRadioButton("Red", true));
        p2.add(jrbYellow = new JRadioButton("Yellow", false));
        p2.add(jrbGreen = new JRadioButton("Green", false));
        // Set keyboard mnemonics
        jrbRed.setMnemonic('R');
        jrbYellow.setMnemonic('Y');
        jrbGreen.setMnemonic('G');
        // Group radio buttons
        btg.add(jrbRed);
        btg.add(jrbYellow);
        btg.add(jrbGreen);
        // Place p1 and p2 in the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners for check boxes
        jrbRed.addItemListener(this);
        jrbYellow.addItemListener(this);
        jrbGreen.addItemListener(this);
      /** Handle checkbox events */
      public void itemStateChanged(ItemEvent e) {
        if (jrbRed.isSelected())
          light.turnOnRed(); // Set red light
        if (jrbYellow.isSelected())
          light.turnOnYellow(); // Set yellow light
        if (jrbGreen.isSelected())
          light.turnOnGreen(); // Set green light
    // Three traffic lights shown in a panel
    class Light extends JPanel {
      private boolean red;
      private boolean yellow;
      private boolean green;
      /** Default constructor */
      public Light() {
        turnOnGreen();
      /** Set red light on */
      public void turnOnRed() {
        red = true;
        yellow = false;
        green = false;
        repaint();
      /** Set yellow light on */
      public void turnOnYellow() {
        red = false;
        yellow = true;
        green = false;
        repaint();
      /** Set green light on */
      public void turnOnGreen() {
        red = false;
        yellow = false;
        green = true;
        repaint();
      /** Display lights */
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (red) {
          g.setColor(Color.red);
          g.fillOval(10, 10, 20, 20);
          g.setColor(Color.black);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
          g.drawRect(5, 5, 30, 80);
        else if (yellow) {
          g.setColor(Color.yellow);
          g.fillOval(10, 35, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 60, 20, 20);
        else if (green) {
          g.setColor(Color.green);
          g.fillOval(10, 60, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
        else {
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
      /** Set preferred size */
      public Dimension getPreferredSize() {
        return new Dimension(40, 90);
    class MenuDemo extends JFrame implements ActionListener {
      // Text fields for Number 1, Number 2, and Result
      private JTextField jtfNum1, jtfNum2, jtfResult;
      // Buttons "Add", "Subtract", "Multiply" and "Divide"
      private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
      // Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
      private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
      /** Main method */
      public static void main(String[] args) {
        MenuDemo frame = new MenuDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
      /** Default constructor */
      public MenuDemo() {
        setTitle("Menu Demo");
        // Create menu bar
        JMenuBar jmb = new JMenuBar();
        // Set menu bar to the frame
        setJMenuBar(jmb);
        // Add menu "Operation" to menu bar
        JMenu operationMenu = new JMenu("Operation");
        operationMenu.setMnemonic('O');
        jmb.add(operationMenu);
        // Add menu "Exit" in menu bar
        JMenu exitMenu = new JMenu("Exit");
        exitMenu.setMnemonic('E');
        jmb.add(exitMenu);
        // Add menu items with mnemonics to menu "Operation"
        operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
        operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
        operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
        operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
        exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
        // Set keyboard accelerators
        jmiAdd.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
        jmiSub.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        jmiMul.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
        jmiDiv.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
        // Panel p1 to hold text fields and labels
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.add(new JLabel("Number 1"));
        p1.add(jtfNum1 = new JTextField(3));
        p1.add(new JLabel("Number 2"));
        p1.add(jtfNum2 = new JTextField(3));
        p1.add(new JLabel("Result"));
        p1.add(jtfResult = new JTextField(4));
        jtfResult.setEditable(false);
        // Panel p2 to hold buttons
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jbtAdd = new JButton("Add"));
        p2.add(jbtSub = new JButton("Subtract"));
        p2.add(jbtMul = new JButton("Multiply"));
        p2.add(jbtDiv = new JButton("Divide"));
        // Add panels to the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners
        jbtAdd.addActionListener(this);
        jbtSub.addActionListener(this);
        jbtMul.addActionListener(this);
        jbtDiv.addActionListener(this);
        jmiAdd.addActionListener(this);
        jmiSub.addActionListener(this);
        jmiMul.addActionListener(this);
        jmiDiv.addActionListener(this);
        jmiClose.addActionListener(this);
      /** Handle ActionEvent from buttons and menu items */
      public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        // Handle button events
        if (e.getSource() instanceof JButton) {
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
        else if (e.getSource() instanceof JMenuItem) {
          // Handle menu item events
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
          else if ("Close".equals(actionCommand))
            System.exit(0);
      /** Calculate and show the result in jtfResult */
      private void calculate(char operator) {
        // Obtain Number 1 and Number 2
        int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
        int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
        int result = 0;
        // Perform selected operation
        switch (operator) {
          case '+': result = num1 + num2;
                    break;
          case '-': result = num1 - num2;
                    break;
          case '*': result = num1 * num2;
                    break;
          case '/': result = num1 / num2;
        // Set result in jtfResult
        jtfResult.setText(String.valueOf(result));
    Mortgage applet code....
    // MortgageApplet.java: Applet for computing mortgage payments
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class MortgageApplet extends JApplet
      implements ActionListener {
      // Declare and create text fields for interest rate
      // year, loan amount, monthly payment, and total payment
      private JTextField jtfAnnualInterestRate = new JTextField();
      private JTextField jtfNumOfYears = new JTextField();
      private JTextField jtfLoanAmount = new JTextField();
      private JTextField jtfMonthlyPayment = new JTextField();
      private JTextField jtfTotalPayment = new JTextField();
      // Declare and create a Compute Mortgage button
      private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
      /** Initialize user interface */
      public void init() {
        // Set properties on the text fields
        jtfMonthlyPayment.setEditable(false);
        jtfTotalPayment.setEditable(false);
        // Right align text fields
        jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
        jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
        jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
        jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
        jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
        // Panel p1 to hold labels and text fields
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(5, 2));
        p1.add(new Label("Annual Interest Rate"));
        p1.add(jtfAnnualInterestRate);
        p1.add(new Label("Number of Years"));
        p1.add(jtfNumOfYears);
        p1.add(new Label("Loan Amount"));
        p1.add(jtfLoanAmount);
        p1.add(new Label("Monthly Payment"));
        p1.add(jtfMonthlyPayment);
        p1.add(new Label("Total Payment"));
        p1.add(jtfTotalPayment);
        p1.setBorder(new
          TitledBorder("Enter interest rate, year and loan amount"));
        // Panel p2 to hold the button
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
        p2.add(jbtComputeMortgage);
        // Add the components to the applet
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listener
        jbtComputeMortgage.addActionListener(this);
      /** Handle the "Compute Mortgage" button */
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jbtComputeMortgage) {
          // Get values from text fields
          double interest = (Double.valueOf(
            jtfAnnualInterestRate.getText())).doubleValue();
          int year =
            (Integer.valueOf(jtfNumOfYears.getText())).intValue();
          double loan =
            (Double.valueOf(jtfLoanAmount.getText())).doubleValue();
          // Create a mortgage object
          Mortgage m = new Mortgage(interest, year, loan);
          // Display monthly payment and total payment
          jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
          jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    }

    Does it have to be an applet?
    If you want the same behaviour as in the code with traffic lights, change
    class MortgageApplet extends JApplet implements ActionListener {
    to
    class MortgageApplet extends JFrame implements ActionListener {
    and change
    public void init() {
    to
    public MortgageApplet() {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • My ipod touch 2nd gen wont connect to the internet. I don't understand how to find out the WEP or anything.

    I've had my ipod touch for a while now but I cannot conect to the internet anywhere except the apple shop. I've been in there and they said it was fine as it connected to their open wi-fi without a problem. I have access at home to wi-fi and I can also get BTopenzone on my laptop. I don't understand the settings things so I need help please  

    Try the following:
    - Reset the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    -Power off and thn back on the router
    - Reset network settings: Settings>General>Reset: Reset Networks Settings
    - The troubleshooting here:
    iPhone and iPod touch: Troubleshooting Wi-Fi networks and connections
    - As a test, configure you network/router to use no security,

  • Slow Macbook Pro- please help, I don't understand previous advice.

    Hello all,
    I have a very slow Macbook Pro running on Lion 10.7.3.
    I looked up this problem on the forums before I sent this message but I didn't quite understand the advice. I have been on something called Disk Utility and Activity Monitor but don't really understand what I'm looking for. It seems a large percentage of my mac is 'idle' if that makes sense. Someone said to look at Page Out but I really don't understand what that means and what sort of numbers are normal.
    I do have some storage left so I don't think it could be that. A lot of my gigabytes seem to be taken up by movies and 'other'. I've tried deleted a load of videos but it hardly made a difference. I have Mac Mail and it seems very slow on my Macbook compared to on my Ipad and iphone. iCal is also very slow on here and it always takes a while to load internet pages. It isnt the wifi connection.
    Please help and bear in mind I am by no means a Mac whizz so you might have to talk in layman's terms!
    Thanks,
    Amy

    If you have more than ten or so files or folders on your Desktop, move them, temporarily at least, somewhere else in your home folder.
    If iCloud is enabled, disable it.
    Disconnect all wired peripherals. Launch the usual set of applications you use when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Activity Monitor in the page that opens.
    Select the CPU tab.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Step 2
    Launch the Console application in the same way as above, and select “kernel.log” from the file list. Post the dozen or so most recent messages in the log — the text, please, not a screenshot.
    If there are runs of repeated messages, post only one example of each. Do not post many repetitions of the same message.

  • Hi, I asked about my WiFi modem? Sorry but I don't understand any of the suggestions given to me. We don't have an Apple Store where I live, the rest of it's over my head. I also don't own a PC. Any other suggestions? What's IPS?

    What I want to know is why did my WiFi modem work just fine for a whole week, now it doesn't. I can't get any Internet access if it's connected, if it's not I can't download apps from AppStore,as I have no Internet access. I'm tech literate, I don't understand what an IPS is, I don't know about ports and numbers, and there is no Apple store where I live. So now what am I supposed to do? My mum bought me the **** thing, it cost her $150, and it's worked for a week, and then excuse my French, **** itself! Can someone please help me, and in English please? I've only had an iPad since Christmas, I don't have a PC and wouldn't know how to do any of that stuff if I did. Very Frusterating!

    You asked about IPS. I believe you mean ISP, or your Internet Service Provider.
    Since you don't have a computer, you won't be able to change the router settings.
    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h tm
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Unable to open file in emulator using Connector.open()

    This is my code (run on emulator) used to open a file located in the dir: C:\WTK25\appdb\DefaultColorPhone\filesystem\root1
    /**************************************CODE***********************************/
    FileConnection fileConn = (FileConnection)Connector.open("file:///root1/" fileName, Connector.READ);
    if(!fileConn.exists())
    System.out.println("File not found");
    else
    System.out.println("File opened");
    /**************************************CODE***********************************/
    I always get the o/p as "File Not Found" although there exists a .txt file in the directory /root1. What is to be done to open file on emulator? Please give suggestions...
    Message was edited by:
    Chintan.Kanal
    Message was edited by:
    Chintan.Kanal

    i m not sure but i hope this one is right 4 u......
    StringBuffer buff = new StringBuffer();
    InputStream istr = getClass().getResourceAsStream("/CLM.txt");
    for(int i=0 ; ; i++) {
    try {
    if(istr != null) {
    someByte = istr.read();
    if(someByte == -1) {
    buff.append("*");
    clmcontent = buff.toString();
    break;
    buff.append((char)someByte);
    } else {
    // do some necessary
    } catch(IOException ioe) {
    }

  • I don't understand Calendar in Leapard

    I just upgraded to Leapard and I don't understand a few things about iCal.
    1. All of my calendars - home, work, etc. - are listed under "calendars" at the upper left corner of the calendar. Then it shows my email address which is a dot mac email with my home calendar under the address and it is a different color square than my home calendar that is listed under calendars. When I try to delete the home calendar under my email address, I get a message that says it is being used to keep my to do's in mail and if I delete it, all of my to do's will be deleted. Why is this? And why is it a different color?
    2. Why is my birthdays calendar now listed in subscriptions? What are subscriptions?
    3. My calendars are published, do they have to be published if I use dot mac to sync with more than one computer?
    4. Since I upgraded to Leapard, when I sync with my iPhone, all of the birthdays in my calendar appear twice in my iPhone. How do I fix this?
    If anyone can answer these questions, I would greatly appreciate it.
    Thanks.

    The following code is exactly the same (I removed the extraneous bit with "o"), but does not use the type parameter when creating the array, so it is allowed. (But type parameters are erased anyway, so effectively it is the same code.) It produces an unchecked warning, and fails at runtime. Can you see why it fails?
    List<String>[] lsa = new List[10];
    Object[] oa = lsa;
    List<Integer> li = new ArrayList<Integer>();
    li.add(new Integer(3));
    oa[1] = li;
    String s = lsa[1].get(0); // run-time error - ClassCastException

  • Wrong codes? or maybe I don't understand the instructions

    The instructions said "Write a procedure that will retrieve an
    existing record in Enrollment usiing the student and section Ids
    and set the grade to a specified value. (use update instead of
    insert) and write another procedure that will assign a given
    student a given advisor" I tried but cause I got a lot of
    errors!!! any help would be appreciated just email me at
    [email protected]. thanks!
    create sequence room_seq increment by 1;
    create sequence faculty_seq increment by 1;
    create sequence student_seq increment by 1;
    create sequence section_seq increment by 1;
    create sequence enrollment_seq increment by 1;
    create sequence room_section_seq increment by 1;
    create table course(
    courseNo varchar2(10),
    name varchar2(30),
    credits number,
    constraint course_pk primary key (courseNo));
    insert into course (courseNo, name, credits) values
    ('CIS405','ADVANCED DATABASE', 5);
    insert into course (courseNo, name, credits) values
    ('CIS349','INTRO TO DATABASE', 5);
    COMMIT;
    create table room(
    roomID number,
    bldg char(1) check (bldg IN ('A','B')),
    roomNo varchar2(10),
    maxCapacity number,
    style varchar2(15) check(style IN
    ('LECTURE','LECTURE/LAB','LAB','OFFICE')),
    constraint room_pk primary key (roomID));
    insert into room (roomID, bldg, roomNo, maxCapacity, style)
    values (room_seq.nextval, 'B', '151A', 50, 'LAB');
    insert into room (roomID, bldg, roomNo, maxCapacity, style)
    values (room_seq.nextval, 'B', '151B', 50, 'LAB');
    commit;
    create table faculty(
    facultyID number,
    lname varchar2(30) not null,
    fname varchar2(20) not null,
    dept varchar2(5),
    officeID number,
    phone varchar2(15),
    email varchar2(75),
    rank char(4) check(rank IN ('INST','ASOC','ASST','FULL','SENR')),
    constraint faculty_pk primary key (facultyID),
    constraint faculty_fk foreign key (officeID) references room
    (roomID));
    insert into faculty(facultyID, lname, fname, dept, officeID,
    phone, email, rank) values
    (faculty_seq.nextval, 'CANNON', 'AMY', 'CIS',
    6, '77052149003252', '[email protected]','FULL');
    commit;
    create table equipment(
    equipmentID varchar2(30),
    roomID number,
    type varchar2(20) check(type IN('OVERHEAD PROJECTOR','PORTABLE
    PROJECTOR','LAPTOP CONNECTION','DESKTOP COMPUTER','INTERNET
    CONNECTION')),
    constraint equipment_pk primary key (equipmentID),
    constraint equipment_fk foreign key (roomID) references room
    (roomID));
    INSERT INTO EQUIPMENT (EQUIPMENTID, ROOMID, TYPE) VALUES ('111',
    5, 'DESKTOP COMPUTER');
    INSERT INTO EQUIPMENT (EQUIPMENTID, ROOMID, TYPE) VALUES ('222',
    5, 'OVERHEAD PROJECTOR');
    commit;
    create table student(
    stuID number,
    lname varchar2(30),
    fname varchar2(20),
    street varchar2(100),
    city varchar2(60),
    state char(2),
    zip varchar2(9),
    major varchar2(5) check(major IN
    ('ACCT','ECT','EET','BIS','BSIT','CIS','TCOM')),
    standing varchar2(10) check(standing IN
    ('FRESHMAN','SOPHOMORE','JUNIOR','SENIOR')),
    gpa number(3,2),
    advisor number,
    constraint student_pk primary key (stuID),
    constraint student_FK foreign key (advisor) references faculty
    (facultyID));
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'SMITH', 'HEATHER', 'CIS', 'JUNIOR', 3.8,
    2);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'ELLIOTT', 'DAVE', 'CIS', 'JUNIOR', 3.65,
    2);
    commit;
    create table section(
    sectionID number,
    sectionNo char(1),
    courseNo varchar2(10),
    facultyID number,
    term char(4),
    curSize number,
    maxSize number,
    constraint section_pk primary key (sectionID),
    constraint section_course_fk foreign key (courseNo) references
    course(courseNo),
    constraint section_faculty_fk foreign key (facultyID) references
    faculty(facultyID));
    INSERT INTO SECTION (SECTIONID, SECTIONNO, COURSENO, FACULTYID,
    TERM, CURSIZE, MAXSIZE)
    VALUES (SECTION_SEQ.NEXTVAL, 'T', 'CIS405', 1, '1001', 17, 30);
    INSERT INTO SECTION (SECTIONID, SECTIONNO, COURSENO, FACULTYID,
    TERM, CURSIZE, MAXSIZE)
    VALUES (SECTION_SEQ.NEXTVAL, 'G', 'CIS405', 2, '1001', 24, 30);
    commit;
    create table enrollment(
    stuSectionID number,
    stuID number,
    sectionID number,
    grade char(1) check(grade IN('A','B','C','D','F','I','W')),
    constraint enrollment_pk primary key (stuSectionID),
    constraint enrollment_stu_fk foreign key (stuID) references
    student(stuID),
    constraint enrollment_section_fk foreign key (sectionID)
    references section(sectionID));
    INSERT INTO ENROLLMENT (STUSECTIONID, STUID, SECTIONID) VALUES
    (ENROLLMENT_SEQ.NEXTVAL, 3, 1);
    INSERT INTO ENROLLMENT (STUSECTIONID, STUID, SECTIONID) VALUES
    (ENROLLMENT_SEQ.NEXTVAL, 3, 8);
    commit;
    create table room_section(
    roomSectionID number,
    sectionID number,
    roomID number,
    day char(3) check(day IN
    ('MON','TUE','WED','THU','FRI','SAT','SUN')),
    hour date,
    term char(4),
    constraint room_section_pk primary key (roomSectionID),
    constraint room_section_section_fk foreign key (sectionID)
    references section(sectionID),
    constraint room_section_room_fk foreign key (roomID) references
    room(roomID));
    INSERT INTO ROOM_SECTION (ROOMSECTIONID, SECTIONID, ROOMID, DAY,
    HOUR, TERM)
    VALUES (ROOM_SECTION_SEQ.NEXTVAL, 1, 3, 'MON', TO_DATE('9:30
    AM', 'HH:MI AM'), '1001');
    INSERT INTO ROOM_SECTION (ROOMSECTIONID, SECTIONID, ROOMID, DAY,
    HOUR, TERM)
    VALUES (ROOM_SECTION_SEQ.NEXTVAL, 1, 3, 'MON', TO_DATE('10:30
    AM', 'HH:MI AM'), '1001');
    commit;
    SQL> DESC ENROLLMENT
    Name Null? Type
    STUSECTIONID NOT NULL NUMBER
    STUID NUMBER
    SECTIONID NUMBER
    GRADE CHAR(1)
    SQL> CREATE OR REPLACE PROCEDURE Enrollment(
    2 p_grade IN CHAR(1),
    3 IS
    4 v_stuid NUMBER,
    5 v_sectionid NUMBER;
    6 BEGIN
    7 SELECT student_seq.NEXTVAL
    8 INTO v_stuid
    9 FROM DUAL;
    10 UPDATE student
    11 (stuid,
    12 sectionid,
    13 grade,
    14 SET (v_stuid,
    15 v_sectionid,
    16 UPPER (p_grade),
    17 COMMIT;
    18 DBMS_OUTPUT.PUT_LINE ('Student added');
    19 EXCEPTION
    20 WHEN OTHERS THEN
    21 DBMS_OUTPUT.PUT_LINE ('An error occurred');
    22 END AddStudent;
    23 /
    I got those errors like above!!! I don't understand what the
    instructions said. any assistance would be appreciated!

    David,
    I am afraid that the
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('An error occurred');
    was my fault. I had intended it as an example to provide only
    minimal syntax where no exception handling whatsoever previously
    existed. Beau is a student and I am trying to guide him in the
    right direction without just writing all of it for him. In
    fact, I am afraid I may have already provided too much code
    without sufficient explanation. For you and others who may wish
    to help, here are the e-mails that provide the background on how
    we got to this point, with the most recent on top, starting with
    the last resonse I sent to him:
    Things that are wrong:
    The instructions say to be sure to use the sequence number for
    the student's ID, so you should not have p_stuID as an input
    parameter. Instead you should create a variable and select the
    student_seq.nextval into the variable from the dual table and
    use that value to populate the stuid column.
    Your input parameters should only have the variable type, not
    the size, so just use varchar2 and number.
    The check constraints only belong in the script that is used to
    create the table, not in your procedure with your input
    parameters, so remove them from the procedure.
    The order and number of your columns you are inserting into and
    values you are inserting must match, so if you insert into fname
    then lname, you need to insert the values p_fname then p_lname.
    You must either have first name then last name in both or last
    name then first name in both, not one way in one and the other
    way in the other.
    The idea is that when you execute the procedure you specify the
    values of the input parameter variable, then use those input
    parameter variables to insert the values into the table. You
    should not be specifying any specific values anywhere in your
    procedure. In other words don't insert 'HEATHER', instead
    insert fname, and so on.
    You should only have one insert statement. Each time the
    procedure is executed, a different set of values will be
    provided, and the same insert statement will be used.
    Additional suggestions:
    Although it is not required, since IN is the default, it is
    generally considered to be a good programming practice to use IN
    with your input parameters. It just makes the code easier to
    read and understand. As you write other code, you will learn to
    use OUT for output parameters and IN OUT for parameters that are
    both input and output parameters.
    It is generally recommended to store all data in upper case,
    that is capital letters, so that it is easier to index and
    search and avoid duplicates and so on. In order to ensure that
    your data is input in upper case, it is a good idea to use the
    UPPER function.
    Different programmers and companies have different standards
    that they use for capitalization, indentation, spacing,
    alignment, and so forth to make their code uniform and easier to
    read. You may want to look at some various styles and see what
    you like or ask what your instructor recommends.
    You should add some sort of exception handling section. For
    example, if someone attempts to insert a value for standing that
    isn't acceptable, then the procedure will fail due to the
    constraints and the student will not be added. You probably
    want to display some sort of message to the user. You might
    also want to display a message if the input is successful.
    When you attempt to compile your program and you receive a
    message that says "Warning: Procedure created with compilation
    errors." or some such thing, then from the SQL> prompt, type
    SHOW ERRORS and it will list the error message number, a brief
    description of the problem, and the line of code that the
    problem occurred on. You can then type LIST and it will list
    the code with line numbers, so that you can tell what line
    number the error message is referring to.
    In the following example, I have fixed the things that were
    wrong, formatted it the way I usually do, and added minimal
    exception handling and messages. There is a lot more that you
    could do. I have also demonstrated how the program can be
    tested and the results of proper input and improper input. In
    the example below, two students are added correctly, then an
    attempt to add another fails because the standing is not valid
    and violates a check constraint, because graduate is not
    acceptable. After each execution of the procedure, I have
    queried the table, so that you can see what was added and what
    was not.
    SQL> CREATE OR REPLACE PROCEDURE AddStudent
    2 (p_fname IN VARCHAR2,
    3 p_lname IN VARCHAR2,
    4 p_major IN VARCHAR2,
    5 p_standing IN VARCHAR2,
    6 p_gpa IN NUMBER)
    7 IS
    8 v_stuid NUMBER;
    9 BEGIN
    10 SELECT student_seq.NEXTVAL
    11 INTO v_stuid
    12 FROM DUAL;
    13
    14 INSERT INTO student
    15 (stuid,
    16 fname,
    17 lname,
    18 major,
    19 standing,
    20 gpa)
    21 VALUES (v_stuid,
    22 UPPER (p_fname),
    23 UPPER (p_lname),
    24 UPPER (p_major),
    25 UPPER (p_standing),
    26 p_gpa);
    27
    28 COMMIT;
    29 DBMS_OUTPUT.PUT_LINE ('Student added');
    30 EXCEPTION
    31 WHEN OTHERS THEN
    32 DBMS_OUTPUT.PUT_LINE ('An error occurred');
    33 END AddStudent;
    34 /
    Procedure created.
    SQL> COLUMN fname FORMAT A15
    SQL> COLUMN lname FORMAT A15
    SQL> SELECT stuid, fname, lname, major, standing, gpa
    2 FROM student
    3 /
    no rows selected
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC AddStudent ('HEATHER', 'SMITH', 'CIS', 'JUNIOR', 3.8)
    Student added
    PL/SQL procedure successfully completed.
    SQL> SELECT stuid, fname, lname, major, standing, gpa
    2 FROM student
    3 /
    STUID FNAME LNAME MAJOR
    STANDING GPA
    1 HEATHER SMITH CIS
    JUNIOR 3.8
    SQL> EXEC AddStudent ('Dave', 'Elliott', 'CIS', 'junior', 3.65)
    Student added
    PL/SQL procedure successfully completed.
    SQL> SELECT stuid, fname, lname, major, standing, gpa
    2 FROM student
    3 /
    STUID FNAME LNAME MAJOR
    STANDING GPA
    1 HEATHER SMITH CIS
    JUNIOR 3.8
    2 DAVE ELLIOTT CIS
    JUNIOR 3.65
    SQL> EXEC AddStudent ('KARL', 'WEBSTER', 'CIS', 'GRADUATE', 3.2)
    An error occurred
    PL/SQL procedure successfully completed.
    SQL> SELECT stuid, fname, lname, major, standing, gpa
    2 FROM student
    3 /
    STUID FNAME LNAME MAJOR
    STANDING GPA
    1 HEATHER SMITH CIS
    JUNIOR 3.8
    2 DAVE ELLIOTT CIS
    JUNIOR 3.65
    SQL>
    I am going home now. Sometimes I get a chance to respond to my
    e-mail daily and sometimes I may not get to it for a week. It
    is better if you post your questions on one of the forums where
    you may get more rapid responses from many people. I have
    provided links to some forums that I browse below. If you have
    internet access, you should be able to just click on them. Some
    may require you to register, but they are all free.
    The following is a link to the Oracle Technology Network forums,
    hosted by Oracle Corporation, where I recommend the SQL and
    PL/SQL discussions.
    http://forums.oracle.com/forums/homepage.jsp
    The following is a link to the PL/SQL forums of the REVEALNET
    site, where noted author Steven Feuerstein is one of the SYSOPS,
    where, for you, I recommend the "Beginner PL/SQL Developer
    Questions" discussions.
    http://PIPETALK.REVEALNET.COM/~PLSQL/LOGIN
    The following is a link to another forum, where I recommend the
    RDBMS, SQL, PL/SQL discussions.
    http://www.orafans.com/cgi-bin/orafans/ubb/Ultimate.cgi?
    action=intro
    I would still like to know where you got my e-mail address, what
    class you are taking, who your instructor is, and so forth.
    Please do let me know.
    Good luck,
    Barbara
    -----Original Message-----
    From:     bseo.ga [SMTP:[email protected]]
    Sent:     Wednesday, December 19, 2001 12:19 AM
    To:     Boehmer, Barbara A.
    Subject:     Re: PL/SQL
    Importance:     High
    what is wrong with the compilation errors?
    CREATE or REPLACE PROCEDURE AddStudent(
    p_stuID number,
    p_lname varchar2(30),
    p_fname varchar2(20),
    p_major varchar2(5) check(major IN
    ('ACCT','ECT','EET','BIS','BSIT','CIS','TCOM')),
    P_standing varchar2(10) check(standing IN
    ('FRESHMAN','SOPHOMORE','JUNIOR','SENIOR')),
    P_gpa number(3,2) IS
    BEGIN
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'SMITH', 'HEATHER', 'CIS', 'JUNIOR', 3.8,
    2);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'ELLIOTT', 'DAVE', 'CIS', 'JUNIOR', 3.65,
    2);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'WEBSTER', 'KARL', 'CIS', 'SENIOR', 3.2,
    2);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'COX', 'STACEY', 'CIS', 'SENIOR', 2.7, 1);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'HOWARD', 'BRIAN', 'CIS', 'JUNIOR', 3.18,
    1);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'DENNIS', 'KELLY', 'CIS', 'SENIOR', 4.0,
    1);
    COMMIT;
    END;
    SQL> /
    Warning: Procedure created with compilation errors.
    ----- Original Message -----
    From: Boehmer, Barbara A. <mailto:[email protected]>
    To: 'bseo.ga' <mailto:[email protected]>
    Sent: Tuesday, December 18, 2001 5:17 PM
    Subject: RE: PL/SQL
    I am not sure what part of it you don't understand.
    The first section that you included is a script that you need to
    copy and run, in order to create the sequences, tables, and data
    that you will need to complete your assignment. You will need
    to edit an empty .sql file, copy the script into the file, save
    the file, then start the file. For example:
    SQL> EDIT test
    Type or copy the script and save the file.
    SQL> START test
    You should see various messages as the items are created. Then
    you can use the following commands to see the tables and
    sequences that you have created:
    SQL> SELECT table_name FROM user_tables;
    SQL> SELECT sequence_name FROM user_sequences;
    To show the structure of an individual table, for example the
    course table:
    SQL> DESC course
    To show the data in an individual table, like the course table:
    SQL> SELECT * FROM course;
    In the second section that you have provided, your instructor is
    asking you to create three different procedures to do three
    different things. To create a procedure, you edit a .sql file,
    type the code to create the procedure, save the file, then start
    the file. I usually make the .sql file name the same as the
    procedure name. So, for example, in number 1, you are asked to
    create a procedure named AddStudent, so you would:
    SQL> EDIT AddStudent
    Type your code.
    Save the file.
    SQL> START AddStudent
    You should receive a message that says:
    Procedure created.
    Then, to execute your procedure:
    SQL> EXEC AddStudent (put your parameter values here)
    The basic syntax for creating a pl/sql procedure is:
    CREATE OR REPLACE PROCEDURE procedure_name
    (put your parameters here)
    AS
    put your variable declarations here;
    BEGIN
    put your code that you want to execute here,
    like insert statements and update statements;
    END procedure_name;
    So, if you are trying to create a procedure to add a new student
    (which means inserting a row into the student table), you will
    need to accept the values (parameters) that you are going to
    insert, then insert them:
    CREATE OR REPLACE PROCEDURE AddStudent
    (p_first .....
    p_last .....
    p_major .....
    p_standing .....
    p_GPA .....)
    AS
    BEGIN
    INSERT INTO student .....;
    END AddStudent;
    I have just given you a starting format and deliberately left
    out a lot, because you will learn more by doing it yourself. I
    hope that makes things a little clearer.
    I would like to know a little more about the class you are
    taking. Please let me know where you are going to school, who
    your instructor is, what is the name of the class you are
    taking, and what book are you using. Also, please let me know
    where you got my e-mail address (from one of the forums?)
    Good luck,
    Barbara
    -----Original Message-----
    From: bseo.ga [mailto:[email protected]]
    Sent: Tuesday, December 18, 2001 5:57 PM
    To: [email protected]
    Subject: PL/SQL
    Importance: High
    I don't understand reading the following instructions from my
    professor and the books. help would be apppreciated.
    -------------create the sequence numbers needed to generate
    primary key values
    create sequence room_seq increment by 1;
    create sequence faculty_seq increment by 1;
    create sequence student_seq increment by 1;
    create sequence section_seq increment by 1;
    create sequence enrollment_seq increment by 1;
    create sequence room_section_seq increment by 1;
    create table course(
    courseNo varchar2(10),
    name varchar2(30),
    credits number,
    constraint course_pk primary key (courseNo));
    insert into course (courseNo, name, credits) values
    ('CIS405','ADVANCED DATABASE', 5);
    insert into course (courseNo, name, credits) values
    ('CIS349','INTRO TO DATABASE', 5);
    COMMIT;
    create table room(
    roomID number,
    bldg char(1) check (bldg IN ('A','B')),
    roomNo varchar2(10),
    maxCapacity number,
    style varchar2(15) check(style IN
    ('LECTURE','LECTURE/LAB','LAB','OFFICE')),
    constraint room_pk primary key (roomID));
    insert into room (roomID, bldg, roomNo, maxCapacity, style)
    values (room_seq.nextval, 'B', '151A', 50, 'LAB');
    insert into room (roomID, bldg, roomNo, maxCapacity, style)
    values (room_seq.nextval, 'B', '151B', 50, 'LAB');
    commit;
    create table faculty(
    facultyID number,
    lname varchar2(30) not null,
    fname varchar2(20) not null,
    dept varchar2(5),
    officeID number,
    phone varchar2(15),
    email varchar2(75),
    rank char(4) check(rank IN
    ('INST','ASOC','ASST','FULL','SENR')),
    constraint faculty_pk primary key (facultyID),
    constraint faculty_fk foreign key (officeID) references room
    (roomID));
    insert into faculty(facultyID, lname, fname, dept, officeID,
    phone, email, rank) values
    (faculty_seq.nextval, 'CANNON', 'AMY', 'CIS',
    6, '77052149003252', '[email protected]','FULL'
    <mailto:'[email protected]','FULL'>);
    commit;
    create table equipment(
    equipmentID varchar2(30),
    roomID number,
    type varchar2(20) check(type IN('OVERHEAD PROJECTOR','PORTABLE
    PROJECTOR','LAPTOP CONNECTION','DESKTOP COMPUTER','INTERNET
    CONNECTION')),
    constraint equipment_pk primary key (equipmentID),
    constraint equipment_fk foreign key (roomID) references room
    (roomID));
    INSERT INTO EQUIPMENT (EQUIPMENTID, ROOMID, TYPE) VALUES ('111',
    5, 'DESKTOP COMPUTER');
    INSERT INTO EQUIPMENT (EQUIPMENTID, ROOMID, TYPE) VALUES ('222',
    5, 'OVERHEAD PROJECTOR');
    commit;
    create table student(
    stuID number,
    lname varchar2(30),
    fname varchar2(20),
    street varchar2(100),
    city varchar2(60),
    state char(2),
    zip varchar2(9),
    major varchar2(5) check(major IN
    ('ACCT','ECT','EET','BIS','BSIT','CIS','TCOM')),
    standing varchar2(10) check(standing IN
    ('FRESHMAN','SOPHOMORE','JUNIOR','SENIOR')),
    gpa number(3,2),
    advisor number,
    constraint student_pk primary key (stuID),
    constraint student_FK foreign key (advisor) references faculty
    (facultyID));
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'SMITH', 'HEATHER', 'CIS', 'JUNIOR', 3.8,
    2);
    INSERT INTO STUDENT (STUID, LNAME, FNAME, MAJOR, STANDING, GPA,
    ADVISOR) VALUES
    (STUDENT_SEQ.NEXTVAL, 'ELLIOTT', 'DAVE', 'CIS', 'JUNIOR', 3.65,
    2);
    commit;
    create table section(
    sectionID number,
    sectionNo char(1),
    courseNo varchar2(10),
    facultyID number,
    term char(4),
    curSize number,
    maxSize number,
    constraint section_pk primary key (sectionID),
    constraint section_course_fk foreign key (courseNo) references
    course(courseNo),
    constraint section_faculty_fk foreign key (facultyID)
    references faculty(facultyID));
    INSERT INTO SECTION (SECTIONID, SECTIONNO, COURSENO, FACULTYID,
    TERM, CURSIZE, MAXSIZE)
    VALUES (SECTION_SEQ.NEXTVAL, 'T', 'CIS405', 1, '1001', 17, 30);
    INSERT INTO SECTION (SECTIONID, SECTIONNO, COURSENO, FACULTYID,
    TERM, CURSIZE, MAXSIZE)
    VALUES (SECTION_SEQ.NEXTVAL, 'G', 'CIS405', 2, '1001', 24, 30);
    commit;
    create table enrollment(
    stuSectionID number,
    stuID number,
    sectionID number,
    grade char(1) check(grade IN('A','B','C','D','F','I','W')),
    constraint enrollment_pk primary key (stuSectionID),
    constraint enrollment_stu_fk foreign key (stuID) references
    student(stuID),
    constraint enrollment_section_fk foreign key (sectionID)
    references section(sectionID));
    INSERT INTO ENROLLMENT (STUSECTIONID, STUID, SECTIONID) VALUES
    (ENROLLMENT_SEQ.NEXTVAL, 3, 1);
    INSERT INTO ENROLLMENT (STUSECTIONID, STUID, SECTIONID) VALUES
    (ENROLLMENT_SEQ.NEXTVAL, 3, 8);
    commit;
    create table room_section(
    roomSectionID number,
    sectionID number,
    roomID number,
    day char(3) check(day IN
    ('MON','TUE','WED','THU','FRI','SAT','SUN')),
    hour date,
    term char(4),
    constraint room_section_pk primary key (roomSectionID),
    constraint room_section_section_fk foreign key (sectionID)
    references section(sectionID),
    constraint room_section_room_fk foreign key (roomID)
    references room(roomID));
    INSERT INTO ROOM_SECTION (ROOMSECTIONID, SECTIONID, ROOMID, DAY,
    HOUR, TERM)
    VALUES (ROOM_SECTION_SEQ.NEXTVAL, 1, 3, 'MON', TO_DATE('9:30
    AM', 'HH:MI AM'), '1001');
    INSERT INTO ROOM_SECTION (ROOMSECTIONID, SECTIONID, ROOMID, DAY,
    HOUR, TERM)
    VALUES (ROOM_SECTION_SEQ.NEXTVAL, 1, 3, 'MON', TO_DATE('10:30
    AM', 'HH:MI AM'), '1001');
    commit;
    The lab notes from my professor said
    1. your system will often need to create a new student. Write
    PL/SQL code for an object named AddStudent that will take values
    for first and last name, major, standing and GPA and add a new
    record in the Student table. Since advisors aren't assigned at
    registration time, we'll add their advisor at a later date.
    Don't worry about the student's address. Be sure to use the
    sequence number for the student's ID.
    2. Write a procedure that will retrieve an existing record in
    Enrollment usiing the student and section Ids and set the grade
    to a specified value. (use update instead of insert)
    3. Write another procedure that will assign a given student a
    given advisor.

  • I don't understand why appear new decimals.

     

    Hi Jorge,
    Instead of using
    Data.SetValue(FormatDouble.DecodeDouble(self.PKg));
    use
    Data.SetValue(FormatDouble.DecodeDecimal(self.PKg,Data.Scale)); //
    This will take the second parameter of scale
    You will see the desired results.
    Thks,
    Sanjay
    -----Original Message-----
    From: Dave Ortman [SMTP:dortmanyahoo.com]
    Sent: Monday, March 05, 2001 12:32
    To: Jorge Bellido; forte-userslists.xpedior.com
    Subject: Re: (forte-users) I don't understand why appear new
    decimals.
    Simply put, the problem stems from the fact that
    floating-point arithmetic is inherently imprecise.
    Rounding errors are common.
    With doubles, you get 16 digits of accuracy. Beyond
    that there is no guarantee.
    If you want more information:
    http://docs.sun.com/htmlcoll/coll.648.2/iso-8859-1/NUMCOMPGD/ncg_goldberg.ht
    ml
    -Dave Ortman
    --- Jorge Bellido <jorge.bellidoeam.es> wrote:
    > I have another problem with numbers. So,
    >
    > Data: DecimalNullable = new;
    > Data.Scale = 20;
    > FormatDouble.Template = TextData(value='#');
    >
    > Dato.SetValue(FormatDouble.DecodeDouble(self.PKg));
    >
    > PKg is a widget DataField, whose mapped type is
    > TextData with input mask float. When I write 1.12
    > into the widget the variable Data is
    > 1.1200000000000001, and I can't understand it. I
    > would like that variable Data was 1.12.
    >
    > Could anybody to explain it?
    >
    > Thank you very much.
    >
    For the archives, go to: http://lists.xpedior.com/forte-users and
    use
    the login: forte and the password: archive. To unsubscribe, send in
    a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com

  • Why is Palm support so clueless? Don't understand what a Touchstone cover is for the Pixi.

    So I have a Touchstone Pixi back cover that the metal sliver has fallen off to keep the usb flap closed. After mutliple crazy glue episodes, it finally fell off, and I can't find it. So I call Palm and get their ESL reps (no slur intended, just the nature of the frustration). So it's bad enough they a) don't know the products and b) don't understand conversational english very well, but I get disconnected twice and their callbacks gave me nothing but dead air. So after going through the third person, I gave up. I then try chat. Things seemed to go better. The guy finally seemed to understand my problem. Says they'll send me a new cover. To my surprise I get a fed ex today  with the new cover. Open it up, and it's the basic cover, not the touchstone cover. Now I'm just peeved. So safe to say they got a bunch of very bad support surveys and now I can't even get their online chat up. I've probably wasted about two hours between the phone and chat trying to get this fixed.
    When their phone reps don't understand I'm talking about the back cover to the Pixi and tell me to  stop calling it a touchstone cover when the word is used in the description of the cover, I just don't know what to do.Why is it the tech support questions seem to go to English first speaking people who have no problem understanding what you're saying and know the products, but other support gets a foreign language first person who only knows what pops up on their screen.
    At least now I know I don't have to send back my defective cover and can just cut the flap off until they rectify the problem and send me the correct one.
    Let's hope HP can improve some of the internal workings as well. Though it won't matter in a month or so as I'll be picking up the Evo. Wish I could use my Pixi as a wifi device, but Palm screwed that one up too. It's a travesty that Sprint users can't get a Plus version by now. They should've stopped making the regular versions the minute they started production on the two Plus versions. But that's another gripe entirely.

    appreciate the post. I think my scathing survey sped up the corporate phone call proceess as I got a phone call from a very nice support person. He was more than helpful and apologetic, and I wouldn't be surprised if the touchstone cover is on my doorstep when I get home. It'll collect dust for awhile as I'm playing with a Pre for a bit. I do realize why I returned my launch day Pre.Man that keyboard makes my fingers hurt.
    looking forward to some new updates soon though. Will be fun to do a comparison against the Evo next month. See how well HTC polished up 2.1.
    Thanks again.

Maybe you are looking for

  • Timezone to IST

    Hi All, How can I convert the standard time zones like EST,MST, EDT in to IST(Indian Standard Format)? Thanks in advance. Regards, Ram.

  • Trimmed clip is not exported; exports whole clip instead

    hi iMovie specialists, I have here a single clip ( 21 minutes) in an iMovie event. What I want to do: - remove some minutes at the end - export the trimmed version What I have done: - create a project - drag the part of the clip i want (7 minutes) ,

  • Standalone DTR download

    I am currently trying out the Visual Composer (VC) tool bundled with NW CE 7.1 trial version. It seems that VC requires DTR, but the trial version of CE 7.1 does not come with DTR. I do not have access to any other DTR. What are my options? Is there

  • Mutiproviders are not transported-Urgent

    Hi, Can you anyone please help me why multoproviders are not getting transported. It is giving error message " Dimeniosn not defined". Can you please help me in this regard. Thanks in advance !

  • Progress bar inside datagrid

    Hi All, I have a datagrid in which i have to display progress bar with the task completed in %. for example i have  two fields in a table source count and completion count. where source count in 100000 rows and 50000 rows have been inserted. in anoth