Plzzzzzzzzzzzz help

Display dept id along with name of all employees in that department
The output will be as such:
Dept ID Employee
10 Michael, Arnold
20 Bob,Maria,Peter
2) Display name, salary and running total salary.
The output will be as such:
Name Salary Running Total Salary
Bob 8000 8000
Maria 12000 20000
Peter 16000 36000
3) Display name of first employee, third employee, and so forth.
plzzzzzzzzzzzzz i hav no idea how to solve this query......................plz do the needful asap

Hi,
Welcome to the forum!
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
If you can show the problem using commonly available tables (such as those in the scott or hr schemas) then you don't need to post any sample data; just the results and the explanation. For example, the scott.emp table has deptno, ename and sal columns. They're not exactly the same as your table, but if you see a soltuion that works for scott.emp, adapting it to your table will be trivial.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ {message:id=9360002}
982800 wrote:
Display dept id along with name of all employees in that department
The output will be as such:
Dept ID Employee
10 Michael, Arnold
20 Bob,Maria,Peter
......This does look a lot like homework, so I'll try not to ruin it for you.
This problem involves String Aggregation . Oracle-Base has a very good page showing several ways to do this, appropriate for different Oracle versions (what is yours?) and different requirements (what are yours?).
2) Display name, salary and running total salary.
The output will be as such:
Name Salary Running Total Salary
Bob 8000 8000
Maria 12000 20000
Peter 16000 36000
.......Whenever you hear "running" think "analytic".
This is a job for the analytic SUM function. All the built-in functions, including SUM, are documented in the SQL Language manual.
3) Display name of first employee, third employee, and so forth.I'm not sure I understand what you want here. This is one reason why you need to post some sample data, and the results you want from that data.
Perhaps you need the analytic ROW_NUMBER function to tell you that this is row 1, 2, 3, .... Given that number, the MOD function can tell you if it's an even or odd number, and you can use a WHERE clause to show only odd-numebred rows.
plzzzzzzzzzzzzz i hav no idea how to solve this queryDo you mean "these queries"? That is, do you want 3 different queries, or 1 big query that answers all 3 questions? If you want 1 big query, what is the exact output you want?
If you'd like help for any of these, post your best attempt, and a specific question.
......................plz do the needful asapIt's quite rude to say things like that to the people who are volunteering to help you. Don't use words (or abbreviations) like "asap" or "urgent" on this forum. (Be careful using them anywhere.)

Similar Messages

  • MDB Help needed.......Plzzzzzzzzzzzz help me

    I am working on a message driven bean (MDB).
    Purpose of bean-- This bean is going to read messages from a JMS topic that is a database topic and through it into JMS Queue.
    Both the topic and Queue are in same database.I am working on oracle application server with J developer IDE
    I have written code that is reading from the topic i am successful in doing so but the problem is putting message from Bean to the Queue. Messages are not going into Queue.I can see the message in my server logs taht Bean class is reading from Topic but unable to put it into Queue.
    I have provided the details of topic in ejb-jar.xml and orion-ejb.xml
    Below is the my code for Bean Class.
    public class CustomReadAIAErrorTopicMDB implements javax.ejb.MessageDrivenBean,
    javax.jms.MessageListener {
    private transient MessageDrivenContext mdbCtx = null;
    public CustomReadAIAErrorTopicMDB() {
    public void setMessageDrivenContext(MessageDrivenContext mdc) {
    this.mdbCtx = mdc;
    public void ejbCreate() throws Exception {
    public void ejbRemove() {
    public void onMessage(Message msg) {
    TextMessage textMsg = null;
    try {
    /* This message was created as a JMS BytesMessage. */
    if (msg instanceof TextMessage) {
    textMsg = (TextMessage)msg;
    String text = textMsg.getText();
    System.out.println("Message received=" + text);
    InitialContext jndiContext;
    jndiContext = new InitialContext();
    QueueConnectionFactory factory;
    factory = (QueueConnectionFactory)jndiContext.lookup("aiaErrorQueue/AIATCF");
    Queue queue;
    // queue = (Queue)jndiContext.lookup("java:comp/resource/aiaRP/AIA_CUSTOM_ERROR_Q");
    queue = (Queue)jndiContext.lookup("AIAOJMS/Queue/jms/queue/AIA_CUSTOM_ERROR_Q");
    QueueConnection connect;
    connect = factory.createQueueConnection();
    QueueSession session;
    session = connect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    QueueSender sender;
    sender = session.createSender(queue);
    TextMessage message;
    message = session.createTextMessage();
    message.setText(text);
    System.out.println("This mesage is from CustomMDB: " + message.getText());
    sender.send(message);
    connect.close();
    session.close();
    } catch (Exception e) {
    //throw new RuntimeException("onMessage throws exception");
    e.printStackTrace();
    --------------------------------ejb-jar.xml-----------------------------------------------
    <enterprise-beans>
    <message-driven>
    <description>Message Driven Bean</description>
    <display-name>CustomReadAIAErrorTopicMDB</display-name>
    <ejb-name>CustomReadAIAErrorTopicMDB</ejb-name>
    <ejb-class>mdb.CustomReadAIAErrorTopicMDB</ejb-class>
    <messaging-type>javax.jms.MessageListener</messaging-type>
    <transaction-type>Container</transaction-type>
    <activation-config>
    <activation-config-property>
    <activation-config-property-name>ConnectionFactoryJndiName</activation-config-property-name>
    <activation-config-property-value>aiaErrorTopic/AIATCF</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>DestinationName</activation-config-property-name>
    <activation-config-property-value>AIAOJMS/Topics/jms/topic/AIA_ERROR_TOPIC</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>DestinationType</activation-config-property-name>
    <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>messageSelector</activation-config-property-name>
    <activation-config-property-value></activation-config-property-value>
    </activation-config-property>
    </activation-config>
    </message-driven>
    <enterprise-beans>
    ------------------------------------------------------------ orion-ejb-jar.xml----------------------------------------
    <enterprise-beans>
    <message-driven-deployment name="CustomReadAIAErrorTopicMDB"
    resource-adapter="AIAOJMS">
    <config-property>
    <config-property-name>DestinationType</config-property-name>
    <config-property-value>javax.jms.Topic</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>DestinationName</config-property-name>
    <config-property-value>java:comp/resource/aiaRP/Topics/AIA_ERROR_TOPIC</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>messageSelector</config-property-name>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <config-property-name>ConnectionFactoryJndiName</config-property-name>
    <config-property-value>aiaErrorTopic/AIATCF</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>SubscriptionDurability</config-property-name>
    <config-property-value>Durable</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>ClientID</config-property-name>
    <config-property-value>aia</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>SubscriptionName</config-property-name>
    <config-property-value>aia</config-property-value>
    </config-property>
    </message-driven-deployment>
    </enterprise-beans>
    Any help appreciated
    Thanks in advance

    I worked some time back, using OC4J, and Oracle AQ.
    i created a AQJMS Adapter using OC4J console, and wrote an AQ Message Sender for sending messages.
    you can below the code snippet:
    InitialContext ctx = new InitialContext();*
    queueConnectionFactory = (QueueConnectionFactory)ctx.lookup("AQJmsAdapter/MyQCF");*
    sendQueue = (Queue)ctx.lookup("AQJmsAdapter/AutoWrap/Queues/LOCAL_Q");*
    queueConnection = queueConnectionFactory.createQueueConnection();*
    queueSession = queueConnection.createQueueSession(false, 0);*
    queueConnection.start();*
    queueSender = queueSession.createSender(sendQueue);*
    TextMessage TextMsg = queueSession.createTextMessage("***"));*
    queueSender.send(lTextMsg);*
    Code looks similar to the code you wrote, but there might be some jar missing.
    Also, is your Queue Connection factory and Queue bind to the jndi name.
    What exception you are getting.
    Edited by: shekup on Mar 1, 2010 8:01 AM
    Edited by: shekup on Mar 1, 2010 8:02 AM

  • Customizing Time Stamp In Receiver File Adapter

    Hi,
    I am working in a XI to file adapter scenario.
    The default time stamp in receiver file adapter is yyyyMMdd-HHmmss-SSS.
    I want to time stamp as "ABC_MM_DD_YYYY_HH_MM_SS".
    i searched SDN,but not getting an end to end approach.
    Like...I developed a UDF ,but when I map it to receiver root node..I am getting error.
    Please help.
    Just request for a step by step procedure.
    Also,ASMA is not v clear to me......
    Plzzzzzzzzzzzz help!!
    Regards.

    Hi sriparna,
    The timestamp used by the File Receiver Adapter is a default pattern, to achieve that you have to use a UDF in the middle of the MM and set the receiver file name with the ASMA, read this for further information:
    ´´´´ Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name
    /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
    It really helps,
    regards,
    Juan.

  • URGENT REPLY

    hi guys
    great forums thnx 4 ur help
    i know it is been discussed alot but iam having problem running my report from form (10g)
    1-i created a report.rdf
    2-created a form and added the report to it and modified properties in property palette
    name
    server name
    destype
    desformat
    3-then i created a procedure PROCEDURE cal_report(report_id report_object) IS
    reportserverjob varchar2(100);
    v_job_id varchar2(40);
    v_rep_status varchar2(40);
    v_server_name varchar2(20);
    vc_url varchar2(100);
    BEGIN
         v_server_name:='Rep_ORACLE_SERVER';
         set_report_object_property (report_id,report_server,'REP_ORACLE_SERVER');
         set_report_object_property(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'HTMLCSS');
    reportserverjob:=run_report_object(report_id);
         v_job_id:=substr(reportserverjob,length(v_server_name)+2,length(reportserverjob));
         v_rep_status:=report_object_status(reportserverjob);
         /*WHILE v_rep_status in
              ('RUNNING','OPENING_REPORT','ENQUEUED', null)
         LOOP
         v_rep_status:=REPORT_OBJECT_STATUS(reportserverjob);
         END LOOP;*/
         IF v_rep_status='FINISHED' THEN
              web.show_document('/reports/rwservlet/getjobid'||v_job_id||'?server='||v_server_name,'_blank');
         else      message('Report failed with error message'||v_rep_status);
              end if;
    END;
    4-i added a button and then added to it this code
    declare
         report_id report_object;
         v_rep varchar2(20);
    begin
         report_id:=find_report_object('Report5');
         v_rep:=run_report_object(report_id);
         cal_report(report_id);
         end;     
    5-i installed the server activated it and it is running
    6-now when i run the form error message appear FRM-41214 unable to run report
    am really late in handing this task and am going nuts
    plzzzzzzzzzzzz help me so soon

    Hello,
    Take a look to the thread :
    frm-41214
    Regards

  • Want textarea to be displayed on the image

    Hello,
    I am stuck up with a problem,
    I have a JPaaplet which displays an image,
    and i want a textarea to appear whereever i click on the image.
    and i dono how to get this.
    it would be kindful if anyone could help me out with this. It is very urgent n i need to do it today itself
    Regards
    Sanam

    Hello,
    once again thanks for ur reply,
    ur code works fine but when i try to implement it in mine it is not working, is it becoz u have used label
    n i am using buffered image.
    iam really stuck up with this. plzzzzzzzzzzzz help . this is the code i have written there is 1 main class (zoominApplet1) it has the main mtd .
    1 more class(AppletZoomPanel) which basically performs zoomin n zoom out operation,
    1 more calss(ZoomAction) which has buutons n operations performed on them.
    now when i click on Auto Fit button i want the image to be resized to screen size.
    could u plz tell what is the mistake n how to do it.
    n i did not understand the 1st line of ur previous mail.
    actually i am new this forum so i dono abt those duke dollars
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.util.Vector;     
    //ZoominApplet1 class
    public class ZoominApplet1 extends JApplet
         public static JFrame f;
         public AppletZoomPanel zoomPanel;
         public static Container cp;
         public BufferedImage image;
         JTextArea textArea;
         public void init()
              zoomPanel = new AppletZoomPanel();
              ZoomAction action = new ZoomAction(zoomPanel);
              cp = getContentPane();
              cp.setLayout(new BorderLayout());
              //cp.setLayout(null);
              cp.add(action, "North");
              cp.add(new JScrollPane(zoomPanel));
              txtArea();
         public void txtArea()
              zoomPanel.addMouseListener(new MouseAdapter()
                   public void mousePressed(MouseEvent e)
                        textArea = new JTextArea();
                        textArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
                        zoomPanel.add(textArea);
                        textArea.setBounds(e.getX(), e.getY(), 100,50);
              SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        f.pack();
                        f.show();
         public static void main(String[] args)
              JApplet applet = new ZoominApplet1();
              f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.getContentPane().add(applet);
              f.setSize(300,300);
              //f.setLocation(100,100);
              applet.init();
              f.setVisible(true);
    //AppletZoompanel class
    class AppletZoomPanel extends JPanel
         public BufferedImage image;
              double scale, scaleInc;
         public boolean autofit = false;
         public AppletZoomPanel()
              loadImage();
              scale = 1.0;
              scaleInc = 0.01;
              setBackground(Color.white);
              //Set to null
              setLayout(null);
         protected void paintComponent(Graphics g)
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D)g;
              g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                        RenderingHints.VALUE_INTERPOLATION_BICUBIC);
              int w = getWidth();
              int h = getHeight();
              System.out.println("width : " +w);
              System.out.println("height : " +h);
              double imageWidth = scale * image.getWidth();
              double imageHeight = scale * image.getHeight();
              double x = (w - imageWidth)/2;
              double y = (h - imageHeight)/2;
              AffineTransform xform = AffineTransform.getTranslateInstance(x, y);
              xform.scale(scale, scale);
              g2.drawRenderedImage(image, xform);
         public Dimension getPreferredSize()
              Dimension d = new Dimension();
              d.width = (int)(scale * image.getWidth());
              d.height = (int)(scale * image.getHeight());
              return d;
         public void autoFit()
         public void setScale (int inc)
              scale += inc * scaleInc;
              revalidate();
              repaint();
         private void loadImage()
              String fileName = "sampleimg.jpg";
              try
              URL url = getClass().getResource(fileName);
              image = ImageIO.read(url);
              catch(MalformedURLException mue)
              System.out.println("url: " + mue.getMessage());
              catch(IOException ioe)
              System.out.println("read: " + ioe.getMessage());
    //ZoomAction Class
    class ZoomAction extends JPanel
         static final String[] fontStyleString = new String[] {"Font.PLAIN", "Font.ITALIC", "Font.BOLD", "Font.ITALIC+Font.BOLD"};
         static final int[] fontStyleInt = new int[] { Font.PLAIN ,  Font.ITALIC ,  Font.BOLD ,  Font.ITALIC+Font.BOLD };
         AppletZoomPanel zoomPanel;
         public ZoomAction(AppletZoomPanel azp)
              zoomPanel = azp;
              final JButton zoomIn = new JButton("zoom in"), zoomOut = new JButton("zoom out"), autoFit = new JButton("Auto Fit"), txtButton = new JButton("Text Area");
              JComboBox fontCombo;
              JComboBox styleCombo;
              String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
              //final JButton autoFit = new JButton("Auto Fit");
              /*add(new JButton(new AbstractAction("Auto Fit")
                   public void actionPerformed(ActionEvent e)
                        System.out.println("autofit");
                        zoomPanel.setBounds(new Rectangle(zoomPanel.getSize()));
                        repaint();
    //                    ResizableImage resizableImage = new ResizableImage();
                        //resizeableImage.autoFit();
                        //resizableImage.setBounds(new Rectangle(zoomPanel.getSize()));
    //                    resizableImage.setBounds(new Rectangle(resizableImage.getPreferredSize()));
    //                    resizableImage.repaint();
         //               repaint();
              Vector visFonts = new Vector(fontNames.length);
              for(int i=0; i<fontNames.length; i++)
                   Font f = new Font(fontNames, Font.PLAIN, 12);
                   if (f.canDisplay('a'))
                        visFonts.add(fontNames[i]);
                   else
                        //System.out.println("No alphabetics in " + fontNames[i]);
              fontCombo = new JComboBox(visFonts);
              styleCombo = new JComboBox(fontStyleString);
              ActionListener l = new ActionListener()
                   int inc;
                   public void actionPerformed(ActionEvent e)
                        JButton button = (JButton)e.getSource();
                        if(button == zoomIn)
                        inc = 5;
                        if(button == zoomOut)
                        inc = -5;
                        zoomPanel.setScale(inc);
              zoomIn.addActionListener(l);
              zoomOut.addActionListener(l);
              ActionListener m = new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        JButton button = (JButton)e.getSource();
                        if(button == autoFit)
                             System.out.println("autofit");
                             //zoomPanel.setBounds(new Rectangle(zoomPanel.getSize()));
                             //repaint();
                             ResizableImage     resizableImage = new ResizableImage();
                             resizableImage.repaint();
                             System.out.println("repaint");
                             //zoomPanel.setBounds(new Rectangle(zoomPanel.getSize()));
         //                    final AppletZoomPanel resizableImage = new ResizableImage(new                               ImageIcon(imageUrl).getImage());
                        if(button == txtButton)
                                  //AppletZoomPanel azp1 = new AppletZoomPanel();
                                  //azp1.setTextArea();
                                  //ZoominApplet1 za1 = new ZoominApplet1();
                             //za1.txtArea();
              autoFit.addActionListener(m);
              txtButton.addActionListener(m);
              add(txtButton);
              add(zoomIn);
              add(zoomOut);
              add(autoFit);
              add(fontCombo);
              add(styleCombo);
         public Dimension getPreferredSize()
              return new Dimension(ap.image.getWidth(null), ap.image.getHeight(null));
         AppletZoomPanel ap = new AppletZoomPanel();
         protected void paintComponent(Graphics g)
              Graphics2D g2D = (Graphics2D)g;
              System.out.println("grahics :" +g2D);
              Dimension dim = getSize();
              System.out.println("dim : " +dim);
              int imageWidth = ap.image.getWidth(null);
              System.out.println("width : " +imageWidth);
              int imageHeight = ap.image.getHeight(null);
              System.out.println("height : " +imageHeight);
              double scaleX = (double)dim.width / (double)imageWidth;
              System.out.println("scalex : " +scaleX);
              double scaleY = (double)dim.height / (double)imageHeight;
              System.out.println("scaley : " +scaleY);
              g2D.drawImage(ap.image, AffineTransform.getScaleInstance(scaleX, scaleY), null);
    class ResizableImage extends JComponent
         AppletZoomPanel ap = new AppletZoomPanel();
         public Dimension getPreferredSize()
              return new Dimension(ap.image.getWidth(null), ap.image.getHeight(null));
         public void paintComponent(Graphics g)
              super.paintComponent(g);
              Graphics2D g2D = (Graphics2D)g;
              System.out.println("grahics :" +g2D);
              Dimension dim = getSize();
              System.out.println("dim : " +dim);
              int imageWidth = ap.image.getWidth(null);
              System.out.println("width : " +imageWidth);
              int imageHeight = ap.image.getHeight(null);
              System.out.println("height : " +imageHeight);
              double scaleX = (double)dim.width / (double)imageWidth;
              System.out.println("scalex : " +scaleX);
              double scaleY = (double)dim.height / (double)imageHeight;
              System.out.println("scaley : " +scaleY);
              g2D.drawImage(ap.image, AffineTransform.getScaleInstance(scaleX, scaleY), null);

  • X2-02 screen flickering

    hi
    i purchased nokia x2-02 on 27fab,2013 and since the date its screen flicker once to twice in 3 to 4 hour, i submitted my phone 4 times it takes approx 45 days but problem not solved, then the care replaced my phone with the new one but problem persists plzzz give me suggestion what to do,,is it normal for nokia x2-02 device plzzzzzzzzzzzz help me
    Solved!
    Go to Solution.

    no use it as it is because if the device gets disassembled then you will gonna see dust on display after 1 or 2 months.all nokia s40 and s60 devices have same kind of problem.at first it will exist for 1 or 2 weeks.then it will occur only  1 or 2 time in 1 month.and some time it dosent occur.i was also facing same problems with my x2 01 at first but afterwords it worked fine.my friend also faced problems with c2 01 now  that device is also working fine. but this flickering will occur mostly if you download themes from outside.use official nokia themes then you will never face any problems.and dont make your device with full of themes and games.and always use signed applications.all signed applications and games are on ovi store. and dont download themes at all.if you are not facing problems with my post then reply me. this was just my opinion do what you want.

  • Oracle 10g installation on xp sp2....plzzzzzzzzzzzz anyone help me

    hi ....
    im trying to install oracle 10g on my system(hp dv6231 eu, 1.56ghz,980mb ram 80gb hard disk) i installed xp came with vista.
    when i try to install oracle , after clicking run exe....first page displays in that the option is disabled(basic installation or advanced installation). after giving password wn i click next ....thats it screen disappeared.
    so i booted in safe mode with networking...... in this case different.. in first page the basic and advanced installation is enabled. so i selected basic installation and filled password.
    installation started , gave me one warning abt networking parameters. i skiped that one . it went to smooth untill database creation.
    in that im getting error...ORA-12560.--TNS PROTOCAL ERROR.
    thats it my oracle installation over.. i been trying for last one week. i cant able to suceed . i formated my system 3 times. even i tryed with loop back adapter .
    could any help me onthis plzzzzzzzzzzzzzzzzzzzz
    thanking you

    If you install this locally in your machine, you can try to delete the file with hosts name to resolve the error ORA-12560.
    This file is located in C:\Windows\System32\Drivers.
    Best Regards
    Douglas Paiva

  • Itunes 7.5 does not open, but it shows up in task manager please help?

    please help its been 2 months already and i cant sync my ipod cuz itunes does not open but it shows up on task manager.
    i have tried every thing but still it does not work. i have reintall my itunes and quicktime like 20 times i've gone to older version but still does not work.
    PLZZZZZZZZZZZZ HELPPPPP. im desperate and tired of liseting to the same songs for 2 months

    Let's try to get an idea of what might be going on with some preliminary questions from b noir's "smack" for iTunes launch failures:
    Is there an error message associated with the launch failure?
    If so, what does it say and what (if any) error numbers are there?
    If there's not an error message, let's check your QuickTime (its well-being is a requirement for a functioning iTunes).
    Go to the XP Start menu > All Programs and try running QuickTime.
    Does it start?
    If not, then the same question as for iTunes - is there an error message?
    If so, what does it say and what (if any) error numbers are there?
    Do you notice any other peculiar behavior with QuickTime?

  • Problem with threads and simulation: please help

    please help me figure this out..
    i have something like this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DrawShapes extends JApplet{
         private JButton choices[];
         private String names[]={"line", "square", "oval"};
         private JPanel buttonPanel;
         private DrawPanel drawingArea;
         private int width=300, height=200;
         public void init(){
              drawingArea=new DrawPanel(width, height);
              choices=new JButton[names.length];
              buttonPanel=new JPanel();
              buttonPanel.setLayout(new GridLayout(1, choices.length));
              ButtonHandler handler=new ButtonHandler();
              for(int i=0; i<choices.length; i++){
                   choices=new JButton(names[i]);
                   buttonPanel.add(choices[i]);
                   choices[i].addActionListener(handler);
              Container c=getContentPane();
              c.add(buttonPanel, BorderLayout.NORTH);
              c.add(drawingArea, BorderLayout.CENTER);
         }//end init
         public void setWidth(int w){
              width=(w>=0 ? w : 300);
         public void setHeight(int h){
              height=(h>=0 ? h : 200);
         /*public static void main(String args[]){
              int width, height;
              if(args.length!=2){
                   height=200; width=300;
              else{
                        width=Integer.parseInt(args[0]);
                        height=Integer.parseInt(args[1]);
              JFrame appWindow=new JFrame("An applet running as an application");
              appWindow.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              DrawShapes appObj=new DrawShapes();
              appObj.setWidth(width);
              appObj.setHeight(height);
              appObj.init();          
              appObj.start();
              appWindow.getContentPane().add(appObj);
              appWindow.setSize(width, height);
              appWindow.show();
         }//end main*/
         private class ButtonHandler implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   for(int i=0; i<choices.length; i++){
                        if(e.getSource()==choices[i]){
                             drawingArea.setCurrentChoice(i);
                             break;
    }//end class DrawShapes
    class DrawPanel extends JPanel{
         private int currentChoice=-1;
         private int width=100, height=100;
         public DrawPanel(int w, int h){
              width=(w>=0 ? w : 100);
              height=(h>=0 ? h : 100);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              switch(currentChoice){
                   case 0:     g.drawLine(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 1: g.drawRect(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 2: g.drawOval(randomX(), randomY(), randomX(), randomY());
                             break;
         public void setCurrentChoice(int c){
              currentChoice=c;
              repaint();          
         private int randomX(){
              return (int) (Math.random()*width);
         private int randomY(){
              return (int) (Math.random()*height);
    }//end class drawPanel
    That one's from a book. I used that code to start with my applet. Mine calls different merthod from the switch cases. Say I have:
    case 0: drawStart(g); break;
    public void drawStart(Graphics g){
      /* something here */
    drawMain(g);
    public void drawMain(graphics g){
    g.drawString("test", x, y);
    //here's where i'm trying to pause
    //i've tried placing Thread.sleep between these lines
    g.drawLine(x, y, a, b);
    //Thread.sleep here
    g.drawRect(x, y, 50, 70);
    }I also need to put delays between method calls but I need to synchronize them. Am I doing it all wrong? The application pauses or sleeps but afterwards, it still drew everything all at once. Thanks a lot!

    It is. Sorry about that. Just answer any if you want to. I'd appreciate your help. Sorry again if it caused you anything or whatever. .n_n.

  • Query Help

    Table1:
    ou store point
    LS LIB1 50
    LS LIB1 200
    LS LIB1 100
    LS LIB1 79
    I have to insert table1 to table2 by splitting into every 143point and assing serial number for every 143 from parameter.
    in aboce example we can split 3 time 143 like below table2 sample.
    Table2
    ou store point serial_number
    LS LIB1 50 101
    LS LIB1 93 101
    LS LIB1 107 102
    LS LIB1 36 102
    LS LIB1 64 103
    LS LIB1 79 103
    i tried below procedure its not working.
    table may have any order like below.
    Table1:
    ou store point
    LS LIB1 200
    LS LIB1 50
    LS LIB1 100
    LS LIB1 79
    then table2
    ou store point serial_number
    LS LIB1 143 101
    LS LIB1 57 102
    LS LIB1 50 102
    LS LIB1 36 102
    LS LIB1 64 103
    LS LIB1 79 103
    create or replace procedure assign_serial(from_num number,to_num number) is
    bal number(10);
    begin
    bal := 0;
    for c1 in(select * from table1)
    loop
    if c1.point <=143 then
    if bal=0 then
    bal=143-used;
    insert int0 table2 values(c1.ou,c1.store,used);
    elsif used > 0 then
    used=used-bal;
    insert int0 table2 values(c1.ou,c1.store,bal);
    bal=0;
    if used > 0 then
    insert int0 table2 values(c1.ou,c1.store,used);
    end if;
    bal:=143-used;
    end if;
    end loop;
    end;
    How to split and assign serial number,please hELP.

    .after giving serial num i have to change points in table1 to 0.The problem for SUm and split for every 143 is ,different OU and store is there.we have to know for which store points we earned serial number.
    i hope this below logic little satisfy except assign cardnum,please........ check and currect the logic
    LS LIB1 50
    LS LIB1 200
    LS LIB1 100
    LS LIB1 79
    --variable used and bal
    for c1 in(select * from table1)
    loop
    used := c1.points;
    if c1.point <=143 then
    if bal=0 then
    bal=143-used;
    insert int0 table2 values(c1.ou,c1.store,used);
    elsif used > 0 then
    used=used-bal;
    insert int0 table2 values(c1.ou,c1.store,bal);
    bal=0;
    if used > 0 then
    insert int0 table2 values(c1.ou,c1.store,used);
    end if;
    bal:=143-used;
    end if;
    end loop;

  • Help my safari doesnt open and gives me a crash report

    help my safari doesn't open and gives me a crash report ever since i downloaded a file from the internet. I have a macbook air (early 2014) with running os x yosemite version 10.10.1

    There is no need to download anything to solve this problem.
    You may have installed the "Genieo" or "InstallMac" ad-injection malware. Follow the instructions on this Apple Support page to remove it.
    Back up all data before making any changes.
    Besides the files listed in the linked support article, you may also need to remove this file in the same way:
    ~/Library/LaunchAgents/com.genieo.completer.ltvbit.plist
    If there are other items with a name that includes "Genieo" or "genieo" alongside any of those you find, remove them as well.
    One of the steps in the article is to remove malicious Safari extensions. Do the equivalent in the Chrome and Firefox browsers, if you use either of those. If Safari crashes on launch, skip that step and come back to it after you've done everything else.
    If you don't find any of the files or extensions listed, or if removing them doesn't stop the ad injection, then you may have one of the other kinds of adware covered by the support article. Follow the rest of the instructions in the article.
    Make sure you don't repeat the mistake that led you to install the malware. Chances are you got it from an Internet cesspit such as "Softonic" or "CNET Download." Never visit either of those sites again. You might also have downloaded it from an ad in a page on some other site. The ad would probably have included a large green button labeled "Download" or "Download Now" in white letters. The button is designed to confuse people who intend to download something else on the same page. If you ever download a file that isn't obviously what you expected, delete it immediately.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates
    if it's not already checked.

  • Apple Mini DVI to Video Adapter is not working. Please Help...

    I bought an Apple Mini DVI to Video Adapter to connect my Macbook to a TV using normal video cable. When I connect the cable, my Laptop DIsplay gives a flickr once and then it shows nothing. I checked Display in the system preference where I don't get a secondary monitor option. My TV is panasonic and it's an old one. I work on Final Cut Pro and it's very very important to see my videos on a TV. What am I doing wrong with the connection? Anyone Please Please help...

    Your probably not doing anything wrong. There are thousands of users with Similar issues and it seems to be with many different adapters.
    We have Mini DP to VGA (3 different brands) and they all fail most of the time. This seems more prevalent with LCD Projectors. I've tested some (50+) with VGA Monitor (HP) and they all worked, LCD Projector (Epson, Hitachi, and Sanyo) and they all fail, DLP Projector (Sanyo) and one worked.
    My Apple Mini DP to DVi works most of the time. My Mini DP to HDMI (Generic non Apple) works every time.
    The general consensus is that Apple broke something in the OS around 10.6.4 or 10.6.5 and its not yet fixed. As we are a school we have logged a case with the EDU Support group so will see what happens.
    Dicko

  • Mini dvi to video adapter help pleaseeeeeeeeeeeeeeeeeeeeeeeeee

    right,
    ive got a 20" intel imac. i bought a mini dvi to video adapter.it said it works with the intel macs.
    i maybe being a bit thick here but the end of the dvi seems to be a different size to the port on the mac.
    please help....................

    You might find relief in the iMac Forum. Perhaps they will appreciate your distinctive thread header style more fully.
    good luck.
    x

  • PSE icons instead of the photo. I need to view photos at a glance. Please help me????

    Please help, this is driving me crazy.  I have downloaded my free PSE #9, it came with my Leica Camera.  I cannot view at a glance any of my photos.  There is only an icon that reads, PSE.  To view any of my photos, I must click select and then preview.  This gets old, and I am doing 4 times the work. I am having to use the dates to guess where my photos might be.  I hate this!  My old Photo Shop #5 didn't do this.  When you went to my pictures, you could see every photo.
    I have tried the right click and open as any program.  What ever program I choose, that is the icon that appears.  No photo. Still no good.
    Please help.
    Thanking anyone in advance,
    Leica

    Hi,
    Are you using Windows Explorer to view the files?
    If so, load Explorer, go to the Tools menu and select Folder Options.
    Click on the View tab and make sure the first option (Always show icons, never thumbnails) is not checked.
    Click on OK and see if that is any better.
    Brian

  • IPOD NO LONGER RECOGNIZED BY ITUNES - HELP!!!!!!!!!!!!!!!!!

    When connecting to I-Tunes my Ipod now appears only as 'IPOD'
    The Windows 'Autoplay' box appears on the left hand side of my screen.
    Everything then freezes for a short while then an error message says that I-Tunes has detected an Ipod that is corrupted.
    My Ipod itself is fine so I'm reluctant to restore if that will not solve the problem.
    Is something to do with an automatic software update?
    Please help......................
    Advent   Windows XP  

    iOS: Device not recognized in iTunes for Mac OS X
    Do not omit the additional information pararaph.

Maybe you are looking for

  • Oracle functions in universe

    Hi Experts , I have created a set of user defined functions in oracle .I included these functions in Oracleen.PRM file . I restarted all the servers . Still i did not see my function in the universe .  My functions has two parameters . I need to pass

  • Where can I download an older version of desktop manager

    The new update renders syncing impossible

  • DV6-1030US paint coming off left touchpad button

    A small rice-sized irregular piece of the chrome paint has come off the plastic left button after only two months. It's not a nice smooth wear spot but with rough edges and is annoying. I know it's just a cosmetic problem but it seems that the coatin

  • Auditing DML actions on multiple databases

    I am using Oracle 10g Database on Solaris . I need to audit the complete DML statement issued on a table which exists in multiple schemas(same name with different data from other schemas) in multiple databases ie Consider the table ito be audited is

  • Whenever the idoc triggers its contains two lines of record,

    Hi Experts, In my IDOC INFREC.INFRECMASS01 has two segments E1E1NAM and E1E1NEM.Both the Segments has some fields.In that E1E1NEM segment-WERKS contains two valuse, First its coming with 1010. Second its coming with 1014.So its Second line.So wheneve