Translation from JMF Code

http://team-bbs.com/plugins/smf/smf.php?topic=51.0
Contains some code I wish to format into regular Java Sound API, can anybody help me?

Another PC got the site data from remote server and it doesn't work correct. <navi> and linked image are broken.
This implies your site is not properly defined in DW.  Go to Site > Manage Sites.
Or simply go to your other installation of DW and export the site definition file from Manage Sites.
Save it to a flash stick or other removable drive.  Then import the STE file into your 2nd installation of  DW.
Nancy O.

Similar Messages

  • When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Translating from COBOL copybook format to XML

    Hi folks,
    A student asked me this question today: Does WLI provide any support for translating
    from COBOL copybook format to XML?
    The discussion had to do with adapters. I presume that you would have to do this
    sort of translation yourself, but I didn't know if something like this were in
    the product, somehow.
    Also, is there any reference code to an SAP adapter out there that I could take
    a look at?
    Thanks -
    Paul Loefstedt

    Hi Paul,
    Long time no see. I know BEA's WebLogic Java Adaptor for Mainframe has a utility
    to take Cobol copybook and converted to Java Object. Not sure about WLI.
    Jim Zhou.
    "Paul Loefstedt" <[email protected]> wrote:
    >
    Hi folks,
    A student asked me this question today: Does WLI provide any support
    for translating
    from COBOL copybook format to XML?
    The discussion had to do with adapters. I presume that you would have
    to do this
    sort of translation yourself, but I didn't know if something like this
    were in
    the product, somehow.
    Also, is there any reference code to an SAP adapter out there that I
    could take
    a look at?
    Thanks -
    Paul Loefstedt

  • Help translating a servlet code to bean

    hi all
    i'd like to translate a servlet code to bean code
    the servlet, called from the <img src""> tag in my web page retrieves an images from a database and, setting the response content-type to "image" returns the image.
    i'd like to do it through the common getXxx/setXxx methods of a bean
    how to do it?
    that's the servlet's code:
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {
            response.setContentType("text/html");
            ServletOutputStream out = response.getOutputStream();
            try
                Connection connection=(Connection)getServletContext().getAttribute("connection");
                Statement s=connection.createStatement();
                response.setContentType("image/jpeg");           
                ResultSet rs=s.executeQuery("select "+request.getParameter("col")+" from products where id="+request.getParameter("id"));           
                while(rs.next())
                    out.write(rs.getBytes(request.getParameter("col")));
            catch(SQLException s)
                response.setContentType("text/html");           
            catch(NullPointerException n)
            out.close();
        } thanx in advance
    sandro

    try this:
    <%
    response.setContentType("text/html");
    try {
    Connection connection=(Connection)application.getAttribute"connection");
       Statement s=connection.createStatement();
       response.setContentType("image/jpeg");
       ResultSet rs=s.executeQuery("select "+
                  request.getParameter("col")+
                 " from products where id="+
                  request.getParameter("id"));
       while(rs.next()) {
    %>
          <%= rs.getBytes(request.getParameter"col"))) %>
    <%
    } catch(SQLException s) {
       response.setContentType("text/html");
    } catch(NullPointerException n) {
    %>

  • Currency Translation from local to group currency in AP /AR

    Hi Gurus,
             I have reporting requiremtents where in i need to show KF;s in local and group currency. I am using standard extractor AP_4 and AR_4. These extractors does not bring KF's in Group currency but only in local and document currency.
    Can anyone tell me what is the best way to go about carrying out the currency translation from local to glocal currency for AP and AR.
    Thanks in advance and yeah points guranteed for helpful answers...
    Cheers..
    Sam

    I take it you mean the extra currency in the company code config (ie group reporting)
    Just unhide the fields DMBE2 and HWAE2 from the extract structure and allocate a new infoobject to them - then add to eith your transformation or transfer rules/update rules and add to the cube

  • Generation of xml file from java code

    hi,
    I want to manipulate data in a xml file with java code.I have read data from xml file and also changed it. But i am unable to covert it again in xml file from java code. Can you please tell me how i can do this?

    Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html

  • How to delete protlet from the code?

    Hi All,
    I want to delete the portlet at runtime (means from code) so does anyone has any idea how to do it?
    Scenario - I have home page, there I have 5-8 portlets so I want to provide functionality to end user so they can delete and add the same portlet. So, for that I have created one more portlet which is on another page, from that portlet I am deleting one specific portlet by passing it's portlet instance ID.
    I have written following code to delete it but it doesn't work out. I am not getting any exception while executing below code but it doesn't delete the portlet , so when I go back to home page I can see that portlet. FYI, It prints all SOPs.
    I have written following code in backing file which is at page level (not on Home page).
    String LOOKUP_NAME = com.bea.p13n.management.ApplicationHelper.getApplicationName() +"."+
         com.bea.netuix.application.manager.persistence.PortalCustomizationManagerHome.LOOKUP_NAME;
         Object obj = JndiHelper.lookup(LOOKUP_NAME, com.bea.netuix.application.manager.persistence.PortalCustomizationManager.class);
         System.out.println("=========="+obj.getClass().getName());
         com.bea.netuix.application.manager.persistence.PortalCustomizationManagerHome home = (com.bea.netuix.application.manager.persistence.PortalCustomizationManagerHome)obj;
         System.out.println("[HomePageBacking][Home]"+home);
         com.bea.netuix.application.manager.persistence.PortalCustomizationManager portalCustomizationManager = home.create();
         System.out.println("[HomePageBacking][portalCustomizationManager]"+portalCustomizationManager);
         com.bea.netuix.application.manager.CustomizationContext customizationContext = new com.bea.netuix.application.manager.CustomizationContext(request);
         System.out.println("[HomePageBacking][customizationContext]"+customizationContext);
         customizationContext.setVisitorMode(true);
         System.out.println("-------getParameter--------"+request.getParameter("instanceID"));
         String instanceID = request.getParameter("instanceID");
         if(instanceID != null)
              com.bea.netuix.application.identifier.PortletInstanceId portletInstanceId = com.bea.netuix.application.identifier.PortletInstanceId.createPortletInstanceId(Integer.parseInt(instanceID));
              //portletInstanceId.setId(Integer.parseInt(instanceID));
              System.out.println("[HomePageBacking][customizationContext.isVisitorMode()]"+customizationContext.isVisitorMode());
              System.out.println("[HomePageBacking][portletInstanceId.getId()]"+portletInstanceId.getId());
    portalCustomizationManager.deletePortletInstance(customizationContext, portletInstanceId);
    with the last line of above code it should delete that portlet for that user but it doesn't work.
    So, any one has any idea on this?? I appreciate your help.
    Thanks,
    HJ

    Following is the code to delete the portlet at runtime of from your code.
    String webApp = ApplicationHelper.getWebAppName(request);
    ResourceContext resourceContext = ResourceContext.createResourceContext(request, true);
    String deletePortletId = "XXXXXX"; // This you can get it from request or from session
    List<ControlAction> actions = new ArrayList<ControlAction>();
    com.bea.netuix.application.identifier.Id id = new PortletInstanceId(Integer.valueOf(deletePortletId).intValue());
    actions.add(PageInstanceAction.removePlaceableFromPageInstance(pageControl, (PlaceableInstanceId) id, webApp,
                             new PortalPath(portalPath), new DesktopPath(desktopPath)));
    portalControl.executeActions(actions, resourceContext);
    I hope this will help someone who wants to delete portlet at runtime fron code.
    Thanks,
    HJ

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to change Crystal Reports XI database name at run time from ASP code using ADO

    Dear All,
    I need advises regarding to my problem below
    I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page.
    The problem is how can I change a database from TEST01 to LIVE01 at the run time from ASP code as I already using TEST01 database on Crystal Reports and I do not want to set a new database location inside crystal for each reports
    Thanks and wait for your reply soon.
    Below is my code, which has no effect to crystal reports although I've change the database from TEST01 to LIVE01:
    <%
    Dim oADOConnection, oRptTable, oADORecordset, sql
    Dim struser, strpwd, strdriver, dblocation, dbname, strConnect
    struser = "sa"
    strpwd = ""     
    strdriver = "{SQL SERVER}" 
    dblocation = "SQL200501"     
    dbname = "LIVE01"    ' Changed from TEST01 to LIVE01
    strConnect = "User Id=" & strUser & ";"
    strConnect = strConnect & "PWD=" & strPwd & ";"
    strConnect = strConnect & "DRIVER=" & StrDriver & ";"
    strConnect = strConnect & "SERVER=" & DBLocation & ";"
    strConnect = strConnect & "DATABASE=" & dbName
    sql="Select * from Employee"
    Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
    Set session("oRpt") = session("oApp").OpenReport("C:\REPORTS\RPT01.RPT", 1) 'USING TEST01 DATABASE
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
    Set oADOConnection = Server.CreateObject("ADODB.Connection")
    oADOConnection.Open (strConnect)
    Set oADORecordset = Server.CreateObject("ADODB.Recordset")
    Set oRptTable = session("oRpt").Database.Tables.Item(1)
    oRptTable.SetDataSource oADORecordset, 3
    session("oRpt").SQLQueryString = CStr(sql)
    session("oRpt").ReadRecords
    %>

    Did you ever find a solution to this problem?  I have the same problem when moving reports from development to Test to Production environments.  If the DBName is not the same the report ignores the name provided at runtime.

  • When I use Explored, ussually I diplay my pages in english, but Explore has a feature that you can point any word and it is translated from english to spanish (one one word at the time, not the complete page), does it is available in firefox?

    When I use Explored, usually I display my pages in English, but Explore has a feature that you can point any word and it is translated from English to Spanish (one one word at the time, not the complete page), does it is available in Firefox?

    I do not know the answer but if you look through the Add-ons under [https://addons.mozilla.org/en-US/firefox/search/?q=translation translate] you may find something suitable. There is of course also the well known Google translate [http://translate.google.com/#es|en|choose%20the%20language%20combinations%2C%20and%20can%20handle%20single%20words%0Awith%20some%20odd%20results service]

  • How to pass arguments to a batch file from java code

    Hi
    I have a batch file (marcxml.bat) which has the following excerpt :
    @echo off
    if x==%1x goto howto
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; %1 %2 %3
    goto end
    I'm calling this batch file from a java code with the following line of code:
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat");
    so ,that invokes the batch file.Till that point its ok.
    since the batch file accpets arguments(%1 %2 %3) how do i pass those arguments to the batch file from my code ...???
    %1 is a classname : for ex: gov.loc.marcxml.MARC21slim2MARC
    %2 is the name of the input file for ex : C:/Downloads/Marcxml/source.xml
    %3 is the name of the output file for ex: C:/Downloads/Marcxml/target.mrc
    could someone help me...
    if i include these parameters too along with the above line of code i.e
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat gov.loc.marcxml.MARC21slim2MARC C:\\Downloads\\Marcxml\\source.xml C:\\Downloads\\Marcxml\\target.mrc") ;
    I get the following error :
    Exception in thread main java.lang.Noclassdef foundError: c:Downloads\marcxml\source/xml
    could some one tell me if i'm doing the right way in passing the arguments to the batch file if not what is the right way??
    Message was edited by:
    justunme1

    1 - create a java class (Executer.java) for example:
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    public class Executer {
         public static void main(String[] args) {
              try {
                   for (int i = 0; i < args.length; i++) {
                        System.out.println(args);
                   Class<?> c = Class.forName(args[0]);
                   Class[] argTypes = new Class[] { String[].class };
                   Method main = c.getDeclaredMethod("main", argTypes);
                   // String[] mainArgs = Arrays.copyOfRange(args, 1, args.length); //JDK 6
                   //jdk <6
                   String[] mainArgs = new String[args.length - 1];
                   for (int i = 0; i < mainArgs.length; i++) {
                        mainArgs[i] = args[i + 1];
                   main.invoke(null, (Object) mainArgs);
                   // production code should handle these exceptions more gracefully
              } catch (ClassNotFoundException x) {
                   x.printStackTrace();
              } catch (NoSuchMethodException x) {
                   x.printStackTrace();
              } catch (IllegalAccessException x) {
                   x.printStackTrace();
              } catch (InvocationTargetException x) {
                   x.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
    2 - create a .bat file:
    @echo off
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; Executer %TARGET_CLASS% %IN_FILE% %OUT_FILE%3 - use set command to pass variable:
    Open MS-DOS, and type the following:
    set TARGET_CLASS=MyTargetClass
    set IN_FILE=in.txt
    set OUT_FILE=out.txt
    Then run your .bat file (in the same ms dos window)
    Hope that Helps

  • Running a jar file from java code

    Hi!
    Im trying to run a jar file from my code.
    I've tried Classloader, but that doesnt work because it doesnt find the images (also embedded in the 2nd jar file).
    WHat I would like to do is actually RUN the 2nd jar file from the first jar file. There must be a way to do this right?
    any ideas?

    ok, I found some wonderful code (see below) that will try to start the jar. But it doesn't. What it does is produce the following error when my application runs...
    So it's not finding the images in the jar file that I am trying to run? Strange. I checked the URL that sending, but it seems ok....
    I think I will check the url again to make sure......
    any ideas?
    Uncaught error fetching image:
    java.lang.NullPointerException
         at sun.awt.image.URLImageSource.getConnection(Unknown Source)
         at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
         at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
         at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
         at sun.awt.image.ImageFetcher.run(Unknown Source)
    the code....
    /* From http://java.sun.com/docs/books/tutorial/index.html */
    import java.io.IOException;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.lang.reflect.Modifier;
    import java.net.JarURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.util.jar.Attributes;
    * Runs a jar application from any url. Usage is 'java JarRunner url [args..]'
    * where url is the url of the jar file and args is optional arguments to be
    * passed to the application's main method.
    public class JarRunner {
      public static void main(String[] args) {
        URL url = null;
        try {
          url = new URL(args[0]);//"VideoTagger.jar");
        } catch (MalformedURLException e) {
          System.out.println("Invalid URL: ");
        // Create the class loader for the application jar file
        JarClassLoader cl = new JarClassLoader(url);
        // Get the application's main class name
        String name = null;
        try {
          name = cl.getMainClassName();
        } catch (IOException e) {
          System.err.println("I/O error while loading JAR file:");
          e.printStackTrace();
          System.exit(1);
        if (name == null) {
          fatal("Specified jar file does not contain a 'Main-Class'"
              + " manifest attribute");
        // Get arguments for the application
        String[] newArgs = new String[args.length - 1];
        System.arraycopy(args, 1, newArgs, 0, newArgs.length);
        // Invoke application's main class
        try {
          cl.invokeClass(name, newArgs);
        } catch (ClassNotFoundException e) {
          fatal("Class not found: " + name);
        } catch (NoSuchMethodException e) {
          fatal("Class does not define a 'main' method: " + name);
        } catch (InvocationTargetException e) {
          e.getTargetException().printStackTrace();
          System.exit(1);
      private static void fatal(String s) {
        System.err.println(s);
        System.exit(1);
    * A class loader for loading jar files, both local and remote.
    class JarClassLoader extends URLClassLoader {
      private URL url;
       * Creates a new JarClassLoader for the specified url.
       * @param url
       *            the url of the jar file
      public JarClassLoader(URL url) {
        super(new URL[] { url });
        this.url = url;
       * Returns the name of the jar file main class, or null if no "Main-Class"
       * manifest attributes was defined.
      public String getMainClassName() throws IOException {
        URL u = new URL("jar", "", url + "!/");
        JarURLConnection uc = (JarURLConnection) u.openConnection();
        Attributes attr = uc.getMainAttributes();
        return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
       * Invokes the application in this jar file given the name of the main class
       * and an array of arguments. The class must define a static method "main"
       * which takes an array of String arguemtns and is of return type "void".
       * @param name
       *            the name of the main class
       * @param args
       *            the arguments for the application
       * @exception ClassNotFoundException
       *                if the specified class could not be found
       * @exception NoSuchMethodException
       *                if the specified class does not contain a "main" method
       * @exception InvocationTargetException
       *                if the application raised an exception
      public void invokeClass(String name, String[] args)
          throws ClassNotFoundException, NoSuchMethodException,
          InvocationTargetException {
        Class c = loadClass(name);
        Method m = c.getMethod("main", new Class[] { args.getClass() });
        m.setAccessible(true);
        int mods = m.getModifiers();
        if (m.getReturnType() != void.class || !Modifier.isStatic(mods)
            || !Modifier.isPublic(mods)) {
          throw new NoSuchMethodException("main");
        try {
          m.invoke(null, new Object[] { args });
        } catch (IllegalAccessException e) {
          // This should not happen, as we have disabled access checks
    }

  • Starting exetutable java file from java code

    Hi I was wondering how I can start a executable java file from java code?
    thanks

    Hi Mkaveli,
    Yes, it's possible. If you have a JAR executable, you've just to call the main method of its starter class. For a simple executable class, just call its main method.
    This way :
    SomeStarter.main(null); // if there's no argumentSmall precision : the executable JAR or class must be specified in the classpath of your application.

  • How to modify an existing xml file from java code.

    Hi
    I have worked on creating a new xml file from java code using xmlbeans.But if i try to modify an already existing file using java code I am unable to get errorfree xmlfile.
    For example if xml file(studlist.xml) is as below:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    Now suppose i have set name to victor using student.setName,
    and set age to 20 using setAge from javacode,
    the new xml file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    <Student>
              <Name>victor</Name>
              <Age>20</Age>
         </Student>
    As observed this is not a valid xml file.But how can i modify without any errors?

    I know it's an old post, but I found this while doing a google search for something else, and don't like to leave it un-aswered
    Just in case anyone has a similar problem... In this case the new elements have been appended outside of the root element
    What you need to do is first get the root element and then append the new children to that, there are several ways of getting the root element, which depend on what you want to do with the elements you get back here's a simple (incomplete) way.
    // gets the root element of the specified file (code not shown)
    Element rootElement= new SAXReader().read(file).getRootElement();Then just append the new elements as below (this is non-generic code and would need to be modified for your situation)
    // write a new student element
    Element student = document.createElement("Student");  // creates the new student
    rootElement.appendChild(student); // ***appends it to the root element***
    Element name = document.createElement("Name"); // creates the name element
    name.appendChild(document.createTextNode("Fred")); // adds the name text to the name element
    student.appendChild(name); // appends the name to the student
    Element age= document.createElement("Age"); // creates the age element
    age.appendChild(document.createTextNode("26")); // adds the age text to the age element
    student.appendChild(age); // appends the name to the studentThen flush ya buffers or whatever and write the file
    Edited by: Dream-Scourge on Apr 23, 2008 11:10 AM

  • Translation from CS5 to Cloud doesn't  work correct, navi and linked images are broken.

    Translation from CS5 to Cloud doesn't  work correct, <navi> and linked images are broken.
    The data of CS5 was created at another PC. I installed Cloud version into two different PC. One has had the site data since dreamweaver CS5 and it works correct in Cloud version. Another PC got the site data from remote server and it doesn't work correct. <navi> and linked image are broken.

    Another PC got the site data from remote server and it doesn't work correct. <navi> and linked image are broken.
    This implies your site is not properly defined in DW.  Go to Site > Manage Sites.
    Or simply go to your other installation of DW and export the site definition file from Manage Sites.
    Save it to a flash stick or other removable drive.  Then import the STE file into your 2nd installation of  DW.
    Nancy O.

Maybe you are looking for