New implementations using core java in a project in RMI

hi, M a final year engineering student in Comp science.i wantu do a project of nearly 400hrs,can any one pls tel me the new things tat i can implement in RMI in LAN environment..most of the things i ve thought of ,were found to be pretty old.pls give ur suggestions.its as bit urgent.
Thankyou,

hi, M a final year engineering student in Comp science.i wantu do a project of nearly 400hrs,
can any one pls tel me the new things tat i can implement in RMI in LAN environment..
most of the things i ve thought of ,were found to be pretty old.
pls give ur suggestions.its as bit urgent.
Thankyou,http://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Similar Messages

  • Urgent please send code for this one ( write code by using core java)

    hi sir
    my question
    i am taking one square box .. and i divide that square in again four parts .. now i am placing one object in 1st box now i want to move that object to 2 box or third box... like that only if my object is in 1st box now i want to jump directly to 4th box
    i want that programing code the code will written BY USING CORE JAVA ONLY
    PLEASE HELP FOR THAT

    hi sirWhat if I'm a madam?
    i want that programing code Why did you post here asking for it?
    1) You are the Lead Architect at a world-class company and none of your staff of topnotch developers are able to handle this insidious task. You need to pull in outside resources for this noodler. You would use Dice, Monster, etc., but, by a freak coincidence, you happen to have had illicit trysts with the wives of several high-ranking executives in each of those companies, and as a result, have been blacklisted in perpetuity. You sought help here because you know that the denizens of this particular cyber-community are not only the best of the best of the best in the world of software development, we also happen--by yet another bizarre convergence of the unfahtomable Threads of Fate--to be the handsomest and best-endowed, dude-tube-wise. This is exactly what you need to distract your wife from your many concubines so you can continue with your plan for world dominance, which, of course, is but a small cog in the machina profunda that grinds unfailingly and inexorably toward your ultimate goal of the perfect tofu burrito.
    2) You are a lazy slimeball student who thinks it's acceptable to take credit for somebody else's work. You have no motivation, no ethics, and nothing to contribute to the society upon which you will become a bigger and more loathsome burden daily.

  • Automatically creating database using core java by runnin an application

    hi evryone...
    My question is how to create a database automatically usin core java by runnin an application i mean to say tat Is it possible to create a DSN
    where we can directly create a database when we run a java application... plz... help me by solving dis query...
    Thank 'U'

    Your requirements are vague, but it sounds like you want an embedded database. Here are two:
    http://db.apache.org/derby/derby_downloads.html
    http://hsqldb.org/
    You can't create a database directly using "core" java, unless you equal serializing with real dbs.
    Edited by: Brynjar on Jan 26, 2008 4:49 AM

  • How to find ip address of a PC using Core Java

    Hi guys,
    i would like to find out the ip address of currently running system i.e my PC using Core Java
    Hows that possible,....
    Code if any would be highly appreciable.....

    Deepak_A_L wrote:
    Hi guys,
    i would like to find out the ip address of currently running system i.e my PC using Core Java
    Hows that possible,....
    Code if any would be highly appreciable.....
    String ipAddress = "0.0.0.0";
         String hostName  = "NA";
         String connonicalName = "NA"
          try{
            ipAddress = InetAddress.getLocalHost().getHostAddress(); 
            hostName = InetAddress.getLocalHost().getHostName(); 
            connonicalName = InetAddress.getLocalHost().getCanonicalHostName();
          }catch(Exception exp){
               exp.printStackTrace();
          }Don't forget to import InetAddress Class from java.net package.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Reg, Documentation for a  New Implementation using ASAP  Methodology

    Hello,
    Will you pl, help me in getting complete documentation (Std / Template)for all stages of ASAP methodology, for a new module. If you provide at least URL, it will be of great help.

    Hi Rao,
    The ASAP Methodology has five phases:
    1. Project Preparation – project formally initiated and planning well under way.
    2. Business Blueprint – project team gathers requirements and conducts conceptual design of the solution.
    3. Realization – system solution is built and integration tested, end users trained
    4. Final Preparation – final check before cut over to new system solution
    5. Go Live & Support – solution confirmation, on-going support in place and project closing
    http://media.sdn.sap.com/html/submitted_docs/Implementation_Roadmap_XI/index.htm
    https://websmp105.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000420636&_SCENARIO=01100035870000000202
    http://www.misa.bc.ca/docs/pdfs%2FMISA%20NEWS/Making%20ERP%20Work%20for%20Small%20Government.pdf
    Hope this helps...
    Best Regards,
    DMK
    *Assign points if it serves your purpose...

  • Time constrain in Core Java...not using Threads

    Hi All,
    I m designing a very small practice application in Java. I am running the program thru command prompt. Once the program starts, I want user t respond in certain amount of time, lets say 3 seconds.
    I tried looking for some "TIMER" classes in java api docs.
    most classes are used with Thread or MBean. I dont want to implement it this way.
    Could anyone pls help me identify how can this be implemented in core java without any fency classes like Thread being used.
    Looking forward for response.

    shilpadahiya wrote:
    Hi All,
    I m designing a very small practice application in Java. I am running the program thru command prompt. Once the program starts, I want user t respond in certain amount of time, lets say 3 seconds. You need to be clearer. When the three seconds are over do you want the program to output "times up!" and proceed, or do you want the program to wait for as long as it takes the user to answer and only after they answer the program responds, "you took 7.9 seconds!"
    I tried looking for some "TIMER" classes in java api docs.
    most classes are used with Thread or MBean. I dont want to implement it this way.Why not?

  • Related 2 CORE JAVA

    HAI..... dis is neeraja...
    I hav a question.... I wanna know how to link the HTML page to a frame by clicking on a button or menuItem using CORE JAVA without using servlets,jsp.... If anyone knows the answer plz... reply to dis as soon as possible...
    Thank 'U'

    Can anyone provide some info on this based on your empirical experience or alternate ways

  • How to do implement the FrameAccess.java code in my project

    Iam doing an project in java for inserting the videos into oracle9i and searching the inserted videos using the frames of the videos inserted.I have done the project to insert and search the videos.But i have been asked to put an EXTRACT button to extract all the frames of the video being inserted.Please help me to implement the FrameAccess.java coding in my existing coding.I have pasted my coding(VideoInsert.java) and FrameAccess.java(used to extract frames) coding.
    The VideoInsert.java when executed will contain browse button to choose the video file(only .mpg files) to be inserted into the database.After selecting the file and when we press open button in the Open dialog box,the video will be played in jmf player in a separate window and the filepath of the video will be included in the textbox.Now what i need is,an extract button should be placed and when it is clicked,the frames of the corresponding selected video has to be extracted in the location where the project files are stored i.e.,the FrameAccess.java coding has to be executed.
    Please help me if anyone knows how to implement the above concept.
    VideoInsert.java
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import oracle.sql.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.BLOB ;
    import symantec.itools.multimedia.ImageViewer;
    public class VideoInsert extends javax.swing.JFrame {
        private Connection con;
        private Statement st=null;
        private OracleResultSet rs=null;
        int count=0;
        int count1=0;
        ImageViewer displaywindow = new ImageViewer();
        /** Creates new form VideoInsert */
        public VideoInsert() {
            initComponents();
            imgpane.add(displaywindow);
            try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                con = DriverManager.getConnection("jdbc:oracle:oci:@","scott","tiger");
                  //con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:FIRST","scott","tiger");
                con.setAutoCommit(false);
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(vid) from browsevideo");
                while (rs.next()) {
                    count = (rs.getInt(1) + 1);
                rs.close();
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(imageno) from browseimage");
                while (rs.next()) {
                    count1 = (rs.getInt(1) + 1);
                rs.close();
            } catch (SQLException e) {
                e.printStackTrace();
            txtvid.setText(String.valueOf(count));
             VideoTypeComboBox.addItem("All");
            VideoTypeComboBox.addItem("Entertainment");
            VideoTypeComboBox.addItem("Sports");
            VideoTypeComboBox.addItem("Animation");
            VideoTypeComboBox.addItem("News");
             VideoTypeComboBox.addItem("Others");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {//GEN-BEGIN:initComponents
            jLabel1 = new javax.swing.JLabel();
            txtvid = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            txtvidfile = new javax.swing.JTextField();
            jLabel3 = new javax.swing.JLabel();
            txtvidinfo = new javax.swing.JTextField();
            jLabel4 = new javax.swing.JLabel();
            txtimgfile = new javax.swing.JTextField();
            vidbrowse = new javax.swing.JButton();
            imgbrowse = new javax.swing.JButton();
            jLabel5 = new javax.swing.JLabel();
            txtimgcont = new javax.swing.JTextField();
            insert = new javax.swing.JButton();
            imgpane = new javax.swing.JPanel();
            jLabel6 = new javax.swing.JLabel();
            VideoTypeComboBox = new javax.swing.JComboBox();
            getContentPane().setLayout(null);
            setTitle("VideoInsert");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("Video ID");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(30, 80, 90, 16);
            txtvid.setEditable(false);
            getContentPane().add(txtvid);
            txtvid.setBounds(130, 80, 130, 20);
            jLabel2.setText("VideoFile");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(30, 130, 70, 16);
            getContentPane().add(txtvidfile);
            txtvidfile.setBounds(130, 130, 130, 20);
            jLabel3.setText("VideoInfo");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(30, 180, 80, 16);
            getContentPane().add(txtvidinfo);
            txtvidinfo.setBounds(130, 180, 130, 20);
            jLabel4.setText("TopImage");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(30, 230, 70, 16);
            getContentPane().add(txtimgfile);
            txtimgfile.setBounds(130, 230, 130, 20);
            vidbrowse.setText("Browse");
            vidbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    vidbrowseActionPerformed(evt);
            getContentPane().add(vidbrowse);
            vidbrowse.setBounds(280, 130, 78, 26);
            imgbrowse.setText("Browse");
            imgbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    imgbrowseActionPerformed(evt);
            getContentPane().add(imgbrowse);
            imgbrowse.setBounds(280, 230, 78, 26);
            jLabel5.setText("ImageContent");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(30, 280, 80, 16);
            getContentPane().add(txtimgcont);
            txtimgcont.setBounds(130, 280, 130, 20);
            insert.setText("Insert");
            insert.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    insertActionPerformed(evt);
            getContentPane().add(insert);
            insert.setBounds(150, 400, 81, 26);
            imgpane.setLayout(new java.awt.BorderLayout());
            getContentPane().add(imgpane);
            imgpane.setBounds(410, 120, 350, 260);
            jLabel6.setText("Video Type");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(30, 340, 80, 16);
            getContentPane().add(VideoTypeComboBox);
            VideoTypeComboBox.setBounds(130, 340, 130, 25);
            pack();
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setSize(new java.awt.Dimension(800, 600));
            setLocation((screenSize.width-800)/2,(screenSize.height-600)/2);
        }//GEN-END:initComponents
        private void insertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insertActionPerformed
            BLOB blb= null;
            PreparedStatement stmt = null;
            OutputStream fout=null;
            File f=null;
            FileInputStream fin=null;
            int bufferSize;
            byte[] buffer=null;
            int bytesRead = -1;
            String sfile1 = txtvidfile.getText();
            String sfile2 = txtimgfile.getText();
            String format=null;
            String format1=null;
            String videoinfo=txtvidinfo.getText();
            String imgcontent=txtimgcont.getText();
            String videoType=(String)VideoTypeComboBox.getSelectedItem();
            if(sfile1.endsWith("avi")) {
                format="avi";
            }else if(sfile1.endsWith("mpg")) {
                format="mpg";
            }else {
                format="mpg";
            if(sfile2.endsWith("jpg")) {
                format1="jpg";
            }else if(sfile2.endsWith("gif")) {
                format1="gif";
            }else {
                format1="jpg";
            if((sfile1.length()>0) && (sfile2.length()>0)) {
                try {
                    stmt=con.prepareStatement(" insert into browsevideo values (?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setString(2,format);
                    stmt.setString(3,videoinfo);
                     stmt.setString(4,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select video FROM browsevideo WHERE vid = ? for update of video");
                    stmt.setInt(1,count);
                    rs = (OracleResultSet)stmt.executeQuery();
                    rs.next();
                    blb = rs.getBLOB("video");
                    fout = blb.getBinaryOutputStream();
                    f = new File(sfile1);
                    fin = new FileInputStream(f);
                    bufferSize = blb.getBufferSize();
                    buffer = new byte[bufferSize];
                    while((bytesRead = fin.read(buffer)) != -1) {
                        fout.write(buffer, 0, bytesRead);
                    fout.flush();
                    fout.close();
                    con.commit();
                    rs.close();
                    stmt.close();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt=con.prepareStatement(" insert into browseimage values (?,?,?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setInt(2,count1);
                    stmt.setInt(3,count1);
                    stmt.setString(4,imgcontent);
                    stmt.setString(5,format1);
                    stmt.setString(6,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select image FROM browseimage WHERE imageno = ? for update of image");
                    stmt.setInt(1,count1);
                    rs = (OracleResultSet)stmt.executeQuery();
                    if(rs.next()) {
                        blb = rs.getBLOB("image");
                        fout = blb.getBinaryOutputStream();
                        f = new File(sfile2);
                        fin = new FileInputStream(f);
                        bufferSize = blb.getBufferSize();
                        buffer = new byte[bufferSize];
                        while((bytesRead = fin.read(buffer)) != -1) {
                            fout.write(buffer, 0, bytesRead);
                        fout.flush();
                        fout.close();
                        con.commit();
                        rs.close();
                    stmt.close();
                    count++;
                    count1++;
                    txtimgfile.setText("");
                    txtvidfile.setText("");
                    txtimgcont.setText("");
                    txtvidinfo.setText("");
                    txtvid.setText(String.valueOf(count));
                    JOptionPane.showMessageDialog(this,"Successfuly Completed");
                }catch(Exception e) {
                    e.printStackTrace();
        }//GEN-LAST:event_insertActionPerformed
        private void imgbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imgbrowseActionPerformed
            ExampleFileFilter filter1 = new ExampleFileFilter();
            JFileChooser chooser = new JFileChooser();
            filter1.addExtension("jpg");
            filter1.addExtension("gif");
            filter1.setDescription("JPG,GIF Images");
            chooser.setFileFilter(filter1);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtimgfile.setText(chooser.getSelectedFile().getAbsolutePath());
                try{
                        displaywindow.setImageURL(new java.net.URL("file:"+txtimgfile.getText()));
                        displaywindow.setStyle(ImageViewer.IMAGE_SCALED_TO_FIT);
                    }catch(Exception e){
                        e.printStackTrace();
        }//GEN-LAST:event_imgbrowseActionPerformed
        private void vidbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vidbrowseActionPerformed
           ExampleFileFilter filter2 = new ExampleFileFilter();
           JFileChooser chooser = new JFileChooser();
           filter2.addExtension("avi");
            filter2.addExtension("mpg");
            filter2.setDescription("AVI & MPG Video");
            chooser.setFileFilter(filter2);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtvidfile.setText(chooser.getSelectedFile().getAbsolutePath());
                VideoAudioPlayer vap=new VideoAudioPlayer(txtvidfile.getText());
        }//GEN-LAST:event_vidbrowseActionPerformed
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
            setVisible(false);
            dispose();
        }//GEN-LAST:event_exitForm
         * @param args the command line arguments
        /*public static void main(String args[]) {
            new VideoInsert().show();
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private javax.swing.JButton imgbrowse;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JTextField txtvid;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JTextField txtimgcont;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JPanel imgpane;
        private javax.swing.JButton insert;
        private javax.swing.JComboBox VideoTypeComboBox;
        private javax.swing.JButton vidbrowse;
        private javax.swing.JTextField txtvidfile;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JTextField txtimgfile;
        private javax.swing.JTextField txtvidinfo;
        // End of variables declaration//GEN-END:variables
    FrameAccess.java
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.media.util.*;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean alreadyPrnt = false;
         * Given a media locator, create a processor and use that processor
         * as a player to playback the media.
         * During the processor's Configured state, two "pass-thru" codecs,
         * PreAccessCodec and PostAccessCodec, are set on the video track.
         * These codecs are used to get access to individual video frames
         * of the media.
         * Much of the code is just standard code to present media in JMF.
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
                                } catch (Exception e) {
                   System.err.println(
                        "Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(Processor.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              // So I can use it as a player.
              p.setContentDescriptor(null);
              // Obtain the track controls.
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println(
                        "Failed to obtain track controls from the processor.");
                   return false;
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) videoTrack = tc[i];
                   else     tc[i].setEnabled(false);
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              String videoFormat = videoTrack.getFormat().toString();
              Dimension videoSize = parseVideoSize(videoFormat);
              System.err.println("Video format: " + videoFormat);
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PostAccessCodec(videoSize)};
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(Processor.Prefetched)) {
                   System.err.println("Failed to realise the processor.");
                   return false;
              p.start();
              return true;
         /**parse the size of the video from the string videoformat*/
         public Dimension parseVideoSize(String videoSize){
              int x=300, y=200;
              StringTokenizer strtok = new StringTokenizer(videoSize, ", ");
              strtok.nextToken();
              String size = strtok.nextToken();
              StringTokenizer sizeStrtok = new StringTokenizer(size, "x");
              try{
                   x = Integer.parseInt(sizeStrtok.nextToken());
                   y = Integer.parseInt(sizeStrtok.nextToken());
              } catch (NumberFormatException e){
                   System.out.println("unable to find video size, assuming default of 300x200");
              System.out.println("Image width = " + String.valueOf(x) +"\nImage height = "+ String.valueOf(y));
              return new Dimension(x, y);
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                   || evt instanceof RealizeCompleteEvent
                   || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         * Main program
         public static void main(String[] args) {
    //          if (args.length == 0) {
    //               prUsage();
    //               System.exit(0);
    // System.out.print("masoud");
    String url = new String("file:F:\\AVSEQ01.mpg");
              if (url.indexOf(":") < 0) {
                   prUsage();
                   System.exit(0);
              MediaLocator ml;
              if ((ml = new MediaLocator(url)) == null) {
                   System.err.println("Cannot build media locator from: " + url);
                   System.exit(0);
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         * Inner class.
         * A pass-through codec to access to individual frames.
         public class PreAccessCodec implements Codec {
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Pre: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              * The code for a pass through codec.
              // We'll advertize as supporting all video formats.
              protected Format supportedIns[] = new Format[] { new VideoFormat(null)};
              // We'll advertize as supporting all video formats.
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null)};
              Format input = null, output = null;
              public String getName() {
                   return "Pre-Access Codec";
              //these dont do anything
              public void open() {}
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() {
                   return supportedIns;
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFlags(Buffer.FLAG_NO_SYNC);
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              // We'll advertize as supporting all video formats.
              public PostAccessCodec(Dimension size) {
                   supportedIns = new Format[] { new RGBFormat()};
                   this.size = size;
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   if (!alreadyPrnt) {
                        BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                        Image stopImage = stopBuffer.createImage(frame);
                        try {
                             BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                             Graphics og = outImage.getGraphics();
                             og.drawImage(stopImage, 0, 0, size.width, size.height, null);
                             //prepareImage(outImage,rheight,rheight, null);
                             Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                             ImageWriter writer = (ImageWriter) writers.next();
                             //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                             File f = new File(frame.getSequenceNumber() + ".jpg");
                             ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                             writer.setOutput(ios);
                             //Finally, the image may be written to the output stream:
                             //BufferedImage bi;
                             //writer.write(imagebi);
                             writer.write(outImage);
                             ios.close();
                        } catch (IOException e) {
                             System.out.println("Error :" + e);
                   //alreadyPrnt = true;
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Post: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              public String getName() {
                   return "Post-Access Codec";
              private Dimension size;

    check out the java.lang.Runtime and java.lang.Process classes

  • Using a java project in a web which is part of a ear

    hi
    i have an ear (jspkeepEAR) that includes a web project (jspkeep). The web project uses a java project (common).
    I don't want the EAR to know about the common, so i've added the common as a j2ee module to the web project.
    when publishing, i can see under
    C:\bea92\user_projects\w4WP_workspaces\Untitled\.metadata\.plugins\org.eclipse.core.resources\
    .projects\jspkeepEAR\beadep\workshop\jspkeepEAR
    the .beabuild.txt file:
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeepEAR/EarContent/APP-INF/classes = APP-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/WebContent = jspkeep.war
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/classes = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/jws/.src = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/common = jspkeep.war/WEB-INF/lib/common.jar
    the problem is, when i'm surfing to a servlet in the web, i get NoClassDefFoundError for classes in the common.
    I've also noticed that if i publish the web project by itself (and not as part of the ear), it works fine.
    any idea?
    thanks
    yair
    Edited by reformy at 12/12/2006 2:24 AM

    Hi Yair
    It appears that WLS only supports mapping a directory to a jar in APP-INF/lib/
    C\:/runtime-New_configuration/Common/bin = APP-INF/lib/Common.jar
    but NOT to a jar in WEB-INF/lib.
    Engineering will look into it sometime to fix it.
    Workaround Suggested:
    As a workaround, you can include the Java/Utility project as part of the EAR and set as dependent J2EE module to the Web project.
    Hope this helps.
    Vimala-

  • How advantages of "Call By Reference" can be implemented using Java

    As I know that java doesnot support "Call By Reference" as C++
    does.
    I want to know that how advantages of Call by Reference can be
    implemented using Java.

    There is some misunderstanding here. Method arguments in Java are passed by value. However, if you pass a reference (to an object) by value, you can still modify the object that the (copy of the) reference points to.
    public void method1() {
      StringBuffer buf = new StringBuffer();
      // Here, method2 cannot change the value of the variable buf,
      // but it can modify the object that buf points to.
      method2(buf);
    public void method2(StringBuffer sb) {
      // You can modify the StringBuffer.
      sb.append("hello");
      // But this is useless, it will not change the variable buf
      // in the calling method.
      sb = new StringBuffer();
    }Jesper

  • Opening a project in Eclipse by using a java program from outside..

    Hi friends,
    I have a java program which will open the Eclipse editor..now i want to open a file , in a specifeid path, in that eclipse. I completed opening the eclipse editor and also i m fetching the file which in a particular path..my problem is i couldnt open that file in eclipse by using my java program..
    i donno how to open a particulat file or proj in the eclipse from outside java prog.
    thanks,
    Krishna

    Try this:
    Error "This project contained a sequence that could not be opened" 

  • New to Java Script(Want to open a new window using Java Script)

    Hi all,
    I am new to using Java Script. Now I have a HTML(First.html) page with a ADD button at the end of the page. What I want to know is, if I drag and select some part of the First.html and click on the ADD button a second HTML page(Second.html) should open displaying only the selected contents....
    Please help :-(

    myRef = window.open(self.location,'mywin',
    'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

  • Create .exe file for core java project

    how can i create .exe file or wrapper for my core java project

    cotton.m wrote:
    To be honest with you this is going to be very difficult at best.
    And I'm not sure it's entirely realistic or legal. You'll need to install Tomcat and MySQL and all your stuff...Haven't ever tried doing so, but I think it might be quite possible sollution...
    There's a preconfigured version of Tomcat, that you simply unzip on the drive (so there's no nned of running installator).
    If OP would use some MySQL server's clone, that needs no installation (some time ago i was looking for thing like thatand found couple of those).
    All configuration (installing services etc.) as well as copying JSPs and other stuff to Tomcat dirs can be made with script files (.bat or whatever) or under another java application that will run all the commands...
    As cotton.m wrote... if it works, it's going to be hell lot of work...

  • Using ftp in core java code to transferring a file to other sys

    My mail id:[email protected]
    hi to all
    I am actually using this code for transforing a file from my system to side system of mine.but the code is compiling and when runing this code i am getting an error:
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.sshtools.j2ssh.net.SocketTransportProvider.<init>(Unknown Source)
    at com.sshtools.j2ssh.net.TransportProviderFactory.connectTransportProvider(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at ftpsample1.main(ftpsample1.java:36)
    I am getting this error.
    friend is saying some proxy should should be installed in that other system.
    Plase help me..
    my code is:
    import java.io.File;
    import java.util.List;
    import java.io.*;
    import com.sshtools.j2ssh.SftpClient;
    import com.sshtools.j2ssh.SshClient;
    import com.sshtools.j2ssh.authentication.AuthenticationProtocolState;
    import com.sshtools.j2ssh.authentication.PasswordAuthenticationClient;
    import com.sshtools.j2ssh.sftp.SftpFile;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    class ftpsample1
         public static void main(String[] args) {
         String username="administrator";
         String password="thota1976";
    try{
    // Make a client connection
    System.out.println("Before SSHCLIENT......");
    SshClient ssh = new SshClient();
         System.out.println("After SSHCLIETNT ......");
    // Connect to the host
    System.out.println("Connecting ......");
    System.out.println("ssh.connect ->9.182.54.70*************************......");
         ssh.connect("9.182.54.70");
    System.out.println("Connected***");
         // Create a password authentication instance
    PasswordAuthenticationClient pwd = new PasswordAuthenticationClient();
         // Get the users name
    pwd.setUsername(username);
         // Get the password
    pwd.setPassword(password);
         // Try the authentication
    int result = ssh.authenticate(pwd);
         System.out.println("ssh.authenticate(pwd):::" +result);
    System.out.println("AuthenticationProtocolState.COMPLETE:::***:" +AuthenticationProtocolState.COMPLETE);
              System.out.println("Beforet he AuthenticationProtocolState.COMPLETE ::");
         if (result == AuthenticationProtocolState.COMPLETE) {
              System.out.println("BOTH ARE SAME RESULT AND .COMPLETED*--------------");
    // The connection is authenticated we can now do some real work!
    SftpClient sftp = ssh.openSftpClient();
              sftp.put("c:/temp/Balaji.jpg");
                   System.out.println("after he AuthenticationProtocolState.COMPLETE ::");
    }catch(Exception e)
                        e.printStackTrace();
                        System.out.println("*****");
                        e.getMessage();

    You could use only Java classes without and 3rd party classes (com.sshtools.j2ssh) for doing this:
         * Upload a file to a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
         * @param ftpServer FTP server address (incl. optional port ':portNumber').
         * @param user Optional user name to login.
         * @param pwd Optional password for <i>user</i>.
         * @param fileName Destination file name on FTP server (with optional preceeding relative path, e.g. "one/two/three.txt").
         * @param source Source file to upload.
         * @throws MalformedURLException, IOException on error.
        public void upload(String ftpServer, String user, String pwd, String fileName, File source) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && source != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bos = new BufferedOutputStream(urlc.getOutputStream());
                    bis = new BufferedInputStream(new FileInputStream(source.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//upload()

  • Can I use Java Reporting Component(JRC) in core Java application?

    I want to use JRC in core Java application.
    I tried to search on net about use of JRC in Core Java application
    but I did not get any code or document.
    I have a core Java application in which I want to use JRC.
    So please help me about this.
    Is there any link which help me about use of JRC in Core Java application?
    I don't want to use web server or application server.

    How do you mean "control"?
    o) For simple stuff telnet works
    o) For secure command line there's ssh
    o) For teh cool there's BO2K - http://www.bo2k.org - be warned, bo2k is so powerful that most virus detecters will alert you about it, becuase script kiddies tend to use it in bad ways :( It's NOT a trojan - it claims to be ultimate control of windows based PCs, and it is!
    None are java though, but you could always make a java clone of them...
    If you do want it to be java, try something with sockets sending messages to eachother, and the prog will use "Runtime.getRuntime().exec(yourprogram)" when it is given specific signals. For mouse and keyboard control try java.awt.Robot

Maybe you are looking for

  • Subcontracting- GR issues

    Hai,     When i posting GR for Subcontracting, it showing error msg " The G/L account 891000 does not exist in Company Code".     Then i used Tcode- FS00 and find the 891000 G/L account,     but it shows  No corresponding entry found.    so, how can

  • Impact of HANA in ABAP

    Hi Experts, I was looking at some blogs on HANA and I was searching for some documents/tutorials in the internet. I want to know what will the impact of HANA concet in ABAP programming language. What new features will be added to ABAP if the integrat

  • Encoding ISO-8859-1 String

    I have a code, i want to decode iso88591string, but i got a $=�?=f?se;�rng;�?;� Is any sugestions how to convert iso8859-1 to windows 1257, Thanks public static void main(String[] args) String isoString= new String("$=�Ū=fżse;�rng;�Ż;�"); byte[] stri

  • Not running in background

    How to check whether the pgm is running in background? I have a production Issue :      A Z-Pgm is not running in background.

  • Strange HDD size and loud combo-drive

    Hi there, just one question about my new iBook. I ordered one with 80 GB hard drive and a combo-drive, since I do not need to burn dvds with a laptop. But finder shows just a capacity of 74 gb. I do know that the hard drive vedors use the decimal sys