My code is destroyed

Hello.
After downloading my files from a FTP account my files is
getting destroyed. When I open them in Dreamweaver I get extra line
breaks after every line.
The code is opened as usual if I open them in notepad or some
other text programs.

Is your host server a Windows or *nix server? What is your
Preferences
setting for PREFERENCES | Code Format > Line Break type,
in DW?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"KittyBox" <[email protected]> wrote in
message
news:fevj1v$mt1$[email protected]..
>I do know about the word wrap, but that's not the
problem. The code has 50
> lines of code (example), but when I open it in DW every
line gets a new
> line
> after, so the document is than on 100 lines.
>
> The problem is not the design, but the readiness of my
code. Some of my
> documents has 500-1000 lines of code, so when every line
has a blank line
> after
> it gets messed up and hard to read.
>

Similar Messages

  • Dreamweaver FluidGrid code gets destroyed by BC editor.

    I'm trying to move a website over to HTML5, so I created a new template in Dreamweaver New > Fluid Grid Layout
    The resulting html5 code is below, however when I paste it into a blank template in BC, the conditional statements (lines 2-7):
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    get deleted by the editor. I know I could directly upload the template from Dreamweaver but if the BC editor is going to mess with it or any other HTML5 code then it's going to be a real headache. Any suggestions? Does BC not handle HTML5 or conditional statements?
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Untitled Document</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="css/fluidgridlayout.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="respond.min.js"></script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="div1" class="fluid">Use Insert Panel for additional Fluid Grid Layout Elements. Note: All Fluid Layout tags must be contained within the "gridContainer" div tag.</div>
    </div>
    </body>
    </html>

    None, You should not be having those when you go into editors.
    Your not coding your site through the admin WYSIYG are you?
    IF you are a partner at the top there is the "Developer" tab but if your not then you just get your prefered coding application, code your site and FTP your templates and layouts.
    If your in a blog post and you got html head and body etc in there your not implenting your BC site correctly. You should have that in your template and apply the template to the blog itself and modify your layouts to get the layouts you want.

  • Problem to read an external file in a web application

    Hello everybody.
    I'd like to know a method for reading a file (how I may connect to it?) This file is in a directory is in an external computer. I don't want to use a client/server application. I think that I must to use JNDI but I'm not sure. I think so becouse when I connect my application to external LDAP server, I use JNDI.
    I'm using Tomcat.
    Thanks a lot.
    Sorry for my English.
    I hope in your solution.
    Alessandro from Italy

    A quick Google found this:
    try
    Runtime rt = Runtime.getRuntime() ;
    Process p = rt.exec("Program.exe") ;
    InputStream in = p.getInputStream() ;
    OutputStream out = p.getOutputStream ();
    InputSream err = p,getErrorStram() ;
    //do whatever you want
    //some more code
    p.destroy() ;
    }catch(Exception exc){/*handle exception*/}Then of course you should realize that the path to the exe file must be in relation to the server.

  • Java API - PublicReportServiceClient.class

    I have a BI Publisher API, publicreportserviceclient.class, that was created by a contractor in 2007 that needs to be reengineered. Code anomolies appear when opening the class in Oracle JDeveloper 11g Release 2. The code follows. What is the purpose of the _mthclass$(String s) methode.  There are many occurances of $, why?  How can I remove these unnecessary $ characters in the code without destroying the code?  Kinda lost, please help! Thanks.
    package oracle.apps.xdo.webservice;
    import java.io.FileOutputStream;
    import java.util.Properties;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ParameterMode;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    // Referenced classes of package oracle.apps.xdo.webservice:
    //      ParamNameValue, ReportRequest, ReportResponse
    public class PublicReportServiceClient
    Couldn't fully decompile method _mthclass$
    Couldn't resolve all exception handlers in method _mthclass$
      private static Service service = null;
      private static Call call = null;
      private static Class class$oracle$apps$xdo$webservice$ReportRequest; /* synthetic field */
      private static Class class$org$apache$axis$encoding$ser$BeanSerializerFactory; /* synthetic field */
      private static Class class$org$apache$axis$encoding$ser$BeanDeserializerFactory; /* synthetic field */
      private static Class class$oracle$apps$xdo$webservice$ParamNameValue; /* synthetic field */
      private static Class class$oracle$apps$xdo$webservice$ReportResponse; /* synthetic field */
      public static void main(String args[])
        throws Exception
        callRunReport("Report", "pdf", "11-NOV-2009", "19-NOV-2009", "4", "13", "13-NOV-2009");
      public static void callRunReport(String reportName, String reportType, String a_DATE, String b_DATE, String c_NUMBER, String d_NUMBER, String e_DATE)
        throws Exception
        Properties props = new Properties();
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        java.io.InputStream in = loader.getResourceAsStream("connInfoCHANGEME.properties");
        props.load(in);
        String url = props.getProperty("BIPubWebServiceURL");
        service = new Service();
        call = (Call)service.createCall();
        call.setTargetEndpointAddress(url);
        call.setTimeout(new Integer(0x36ee80));
        QName reportReq = new QName("http://xmlns.oracle.com/oxp/service/PublicReportService", "ReportRequest");
        Class cls = class$oracle$apps$xdo$webservice$ReportRequest == null && (class$oracle$apps$xdo$webservice$ReportRequest = _mthclass$("oracle.apps.xdo.webservice.ReportRequest")) == null ? class$oracle$apps$xdo$webservice$ReportRequest : class$oracle$apps$xdo$webservice$ReportRequest;
        call.registerTypeMapping(cls, reportReq, class$org$apache$axis$encoding$ser$BeanSerializerFactory == null && (class$org$apache$axis$encoding$ser$BeanSerializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanSerializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanSerializerFactory : class$org$apache$axis$encoding$ser$BeanSerializerFactory, class$org$apache$axis$encoding$ser$BeanDeserializerFactory == null && (class$org$apache$axis$encoding$ser$BeanDeserializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanDeserializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanDeserializerFactory : class$org$apache$axis$encoding$ser$BeanDeserializerFactory);
        QName nmvals = new QName("http://xmlns.oracle.com/oxp/service/PublicReportService", "ParamNameValue");
        cls = class$oracle$apps$xdo$webservice$ParamNameValue == null && (class$oracle$apps$xdo$webservice$ParamNameValue = _mthclass$("oracle.apps.xdo.webservice.ParamNameValue")) == null ? class$oracle$apps$xdo$webservice$ParamNameValue : class$oracle$apps$xdo$webservice$ParamNameValue;
        call.registerTypeMapping(cls, nmvals, class$org$apache$axis$encoding$ser$BeanSerializerFactory == null && (class$org$apache$axis$encoding$ser$BeanSerializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanSerializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanSerializerFactory : class$org$apache$axis$encoding$ser$BeanSerializerFactory, class$org$apache$axis$encoding$ser$BeanDeserializerFactory == null && (class$org$apache$axis$encoding$ser$BeanDeserializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanDeserializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanDeserializerFactory : class$org$apache$axis$encoding$ser$BeanDeserializerFactory);
        QName reportRespqn = new QName("http://xmlns.oracle.com/oxp/service/PublicReportService", "ReportResponse");
        cls = class$oracle$apps$xdo$webservice$ReportResponse == null && (class$oracle$apps$xdo$webservice$ReportResponse = _mthclass$("oracle.apps.xdo.webservice.ReportResponse")) == null ? class$oracle$apps$xdo$webservice$ReportResponse : class$oracle$apps$xdo$webservice$ReportResponse;
        call.registerTypeMapping(cls, reportRespqn, class$org$apache$axis$encoding$ser$BeanSerializerFactory == null && (class$org$apache$axis$encoding$ser$BeanSerializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanSerializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanSerializerFactory : class$org$apache$axis$encoding$ser$BeanSerializerFactory, class$org$apache$axis$encoding$ser$BeanDeserializerFactory == null && (class$org$apache$axis$encoding$ser$BeanDeserializerFactory = _mthclass$("org.apache.axis.encoding.ser.BeanDeserializerFactory")) == null ? class$org$apache$axis$encoding$ser$BeanDeserializerFactory : class$org$apache$axis$encoding$ser$BeanDeserializerFactory);
        call.setOperationName(new QName("http://xmlns.oracle.com/oxp/service/PublicReportService", "runReport"));
        call.addParameter("ReportRequest", reportReq, ParameterMode.IN);
        call.addParameter("userID", XMLType.XSD_STRING, ParameterMode.IN);
        call.addParameter("password", XMLType.XSD_STRING, ParameterMode.IN);
        call.setReturnClass(class$oracle$apps$xdo$webservice$ReportResponse == null && (class$oracle$apps$xdo$webservice$ReportResponse = _mthclass$("oracle.apps.xdo.webservice.ReportResponse")) == null ? class$oracle$apps$xdo$webservice$ReportResponse : class$oracle$apps$xdo$webservice$ReportResponse);
        ParamNameValue paramNmVals[] = new ParamNameValue[5];
        paramNmVals[0] = new ParamNameValue("a_date", new String[] {
          a_START_DATE
        paramNmVals[1] = new ParamNameValue("b_date", new String[] {
          b_END_DATE
        paramNmVals[2] = new ParamNameValue("c_volume", new String[] {
          c_NUMBER
        paramNmVals[3] = new ParamNameValue("d_number", new String[] {
          d_NUMBER
        paramNmVals[4] = new ParamNameValue("e_date", new String[] {
          e_DATE
        String reportPath = props.getProperty("BIPubReportsFolder");
        reportPath = reportPath + "/" + reportName + "/" + reportName + ".xdo";
        ReportRequest req = new ReportRequest(reportPath, paramNmVals, reportType, null, null);
        String bi_username = props.getProperty("BIPubUser");
        String bi_pass = props.getProperty("BIPubPass");
        ReportResponse reportResp = (ReportResponse)call.invoke(new Object[] {
          req, bi_username, bi_pass
        String bip_location = props.getProperty("BIPLOCATION");
        byte baReport[] = reportResp.getReportBytes();
        FileOutputStream fio = new FileOutputStream(bip_location);
        fio.write(baReport);
        fio.close();
      public PublicReportServiceClient()
      static Class _mthclass$(String s)
        s;
        Class.forName();
        return;
        JVM INSTR new #8   <Class NoClassDefFoundError>;
        JVM INSTR dup_x1 ;
        JVM INSTR swap ;
        getMessage();
        NoClassDefFoundError();
        throw ;
    }

    To get this to work, I added every file defined in OWB_HOME\owb\bin\admin\owb.classpath to my classpath. So far it is working.
    You could also look at OWB_HOME\owb\bin\win32\setowbenv.bat to see how all the environment variables are set before starting OWB.

  • JNI for C and computer freezes

    I have C code that uses JNI to create a JavaVM and calls my GUI class that creates a Java Swing GUI. This is the code that I use to invoke the JVM:
    JNIEnv *env;
    JavaVM *jvm;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    int nbOptions;
    jint res;
    jclass myJavaClass;
    jmethodID javaGUI, libraryID;
    jmethodID constructorID, guiID;
    vm_args.version = JNI_VERSION_1_2;
    vm_args.nOptions = 1;
    options[0].optionString = "-Djava.class.path=/root/pV3/FinalpV3";
    vm_args.options = options;
    vm_args.ignoreUnrecognized = JNI_FALSE;
    res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
    if (res < 0) printf("can't create Java VM\n");
    myJavaClass = (*env)->FindClass(env, "Starter");
    if(myJavaClass == 0) printf("can't find Java Class\n");
    guiID = (*env)->GetStaticMethodID(env, myJavaClass, "start", "()V");
    if(guiID == 0) printf("can't find start() ID\n");
    (*env)->CallStaticVoidMethod(env, myJavaClass, guiID);
    However, when I run the C code and (in turn) it creates the Java Swing GUI, if I mess around with the GUI my entire linux machine stalls. Just from experimenting, however, if I don't touch the GUI (i.e. click the buttons and stuff) the program will not freeze my machine. I am not sure the cause of this. I noticed that there is code to destroy the JVM, but do I need to call this?
    Does anyone know what's going on?

    JNI is to call C.
    JNI can call functions written in C++ if the functions are specified as having C linkage.
    Any other language can be called if you can write a C "wrapper" which in turn calls into the other language.

  • Any problem with wandering breakpoints?

    Does anyone have a problem with wandering/moving breakpoints? Let's say I set some break points at various places, then exit JDeveloper. When I restart, some of my breakpoints are at the same place, but some have wandered or moved a line or so. I might find breakpoints set at the comment line adjacent to where I actually set the breakpoint. Now I know I never set a breakpoint on a comment line! Has anyone else observed this behavior?
    Mark Hayworth
    Windows 98
    Oracle9i JDeveloper (build 9.0.2.829)

    Hello
    One thing that I realize is, that breakpoints and execution bars loose their correspondence to the executed code, if changes are made to the source code during execution. Look at the following code snippet for an example:
    40 // just a comment
    41
    42 while (true){
    43 if (false)
    44 System.out.println("not executed");
    45 } // end while
    - Assuming, the breakpoint is on line 44, that is, it will never be executed.
    - Now start the program, which will hang in the endless loop.
    - While running the code remove line 40. The code will now look like the following:
    40
    41 while (true){
    42 if (false)
    43 System.out.println("not executed");
    43 } // end while
    - JDeveloper corrects the Breakpoint to line 43.
    - Now the virtual machine stops! Line 43 is the "if" statement in the executed code.
    That's the situation now:
    IDE: Breakpoint on "43 System.out.println("not executed");"
    JVM: Breakpoint on "43 if (false)"
    Changing the source while running the code has destroyed the correspondence from breakpoint to running code.
    I'd suggest the following enhancement to JDeveloper:
    JDeveloper should try to keep track of the changes made on the source code while executing code (at least inserts and deletes should be monitored) and try to adjust breakpoints and execution-bars so they match from executed code to modified source code. Of course this is only possible to some extent, but inserts and deletes should be possible. There are other IDEs which just do that.
    regards
    Frank

  • MDM Java Api Releasing sessions

    Hi,
    I am working on a Web App. I want to create connections to MDM using userSessionContext. The problem is that when
    i use the code:
    SessionManager.getInstance().destroySession(UsrCxt, SessionTypes.USER_SESSION_TYPE);
              SessionManager.getInstance().destroySession(UsrCxt, SessionTypes.REPOSITORY_SESSION_TYPE);
    for releasing the session, everytime i hit the application URL, i see 3 connections piling up in the MDM Console.
    If i use destroySession then its fine, but i don't want to do this. Using destroysession, multiple users will not be able to work on the same app.
    Please Help.
    Regards
    Harsh

    Hi Harsh,
    It is advised by SAP to destroy each session that you create and infact if you dont destroy the sessions it will affect your system performance because it is not guaranteed that the sessions will e Garbage collected and if collected then after what time of inactivity. You can put code for destroying the session in the wdDoExit of your application.
    You need to use the DestroySessionCommand as there is no other alternative available as such.
    Hope this helps!!
    Cheers,
    Arafat

  • Adobe Spry validation : Remove Field

    I have use Adobe spry validation .
    I have the following situation where i want to remove some fields from validation depending on the choice.
    like on one radio button click i have 5 fields and on submit button press i validate the fields.
    now i switch the radio button and i want to remove those 5 field validation at that time and allow to submit the form even if the 5 fields on first radio button.
    i am creating the validation like
    DIVExpYear= new Spry.Widget.ValidationSelect("DIVExpYear",{validateOn:["change"]});
    and when the radio is switch to second radio , i
    I have the following code to destroy the object.
    if(DIVExpYear){
                        DIVExpYear.reset();
                         DIVExpYear.destroy();
    but no success
    i also tried with
         if(DIVExpYear){
                 Spry.Widget.Utils.destroyWidgets("DIVExpYear");
    but still it do not allow me to submit the page and when i switch back to first radio , it shows me this fields as Red fields (i.e un validated fields)
    please help me.
    it can fix my most of the validation issues.
    thanks

    Do you have a online url? reset() and than doing destory() just work fine.
    So there might be something else going on here

  • Writing a web server.

    i am trying to write a tiny web server, with a gui, and want the gui to be a able to stop and start the server, the server is in a separate class called web server, and i need some code to destroy the instance of the class. thx in advance.

    web server code
    package tinywebserver;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class WebServer implements HttpConstants {
        /* static class data/methods */
        /* print to stdout */
        protected static void p(String s) {
            GUI.main.append(s + "\n");
            System.out.println(s);
        /* our server's configuration information is stored
         * in these properties
        protected static Properties props = new Properties();
        /* Where worker threads stand idle */
        static Vector threads = new Vector();
        /* the web server's virtual root */
        static File root;
        /* timeout on client connections */
        static int timeout = 0;
        /* max # worker threads */
        static int workers = 5;
        //port to serve from
        static int port = 8080;
        /* load www-server.properties from java.home */
        static void loadProps() throws IOException {
            File f = new File("server.properties");
            if (f.exists()) {
                InputStream is =new BufferedInputStream(new
                               FileInputStream(f));
                props.load(is);
                is.close();
                String r = props.getProperty("root");
                if (r != null) {
                    root = new File(r);
                    if (!root.exists()) {
                        throw new Error(root + " doesn't exist as server root");
                r = props.getProperty("timeout");
                if (r != null) {
                    timeout = Integer.parseInt(r);
                r = props.getProperty("workers");
                if (r != null) {
                    workers = Integer.parseInt(r);
                r = props.getProperty("serverPort");
                if (r != null) {
                    port = Integer.parseInt(r);
            /* if no properties were specified, choose defaults */
            if (root == null) {
                root = new File(System.getProperty("user.dir")+File.separator+"html");
            if (timeout <= 1000) {
                timeout = 5000;
            if (workers < 25) {
                workers = 5;
        static void printProps() {
            p("Tiny Web Server Starting on " + System.getProperty("os.name") +" "+System.getProperty("os.arch"));
            p("root="+root);
            p("timeout="+timeout);
            p("workers="+workers);
            p("port="+port);
        public static void start() throws Exception{
            loadProps();
            printProps();
            /* start worker threads */
            for (int i = 0; i < workers; ++i) {
                Worker w = new Worker();
                (new Thread(w, "worker #"+i)).start();
                 threads.addElement(w);
            ServerSocket ss = new ServerSocket(port);
            while (true) {
                Socket s = ss.accept();
                Worker w = null;
                synchronized (threads) {
                    if (threads.isEmpty()) {
                        Worker ws = new Worker();
                        ws.setSocket(s);
                        (new Thread(ws, "additional worker")).start();
                    }else {
                        w = (Worker) threads.elementAt(0);
                        threads.removeElementAt(0);
                        w.setSocket(s);
    class Worker extends WebServer implements HttpConstants, Runnable {
        final static int BUF_SIZE = 2048;
        static final byte[] EOL = {(byte)'\r', (byte)'\n' };
        /* buffer to use for requests */
        byte[] buf;
        /* Socket to client we're handling */
        private Socket s;
        Worker() {
            buf = new byte[BUF_SIZE];
            s = null;
        synchronized void setSocket(Socket s) {
            this.s = s;
            notify();
        public synchronized void run() {
            while(true) {
                if (s == null) {
                    /* nothing to do */
                    try {
                        wait();
                    } catch (InterruptedException e) {
                        /* should not happen */
                        continue;
                try {
                    handleClient();
                } catch (Exception e) {
                    e.printStackTrace();
                /* go back in wait queue if there's fewer
                 * than numHandler connections.
                s = null;
                Vector pool = WebServer.threads;
                synchronized (pool) {
                    if (pool.size() >= WebServer.workers) {
                        /* too many threads, exit this one */
                        return;
                    } else {
                        pool.addElement(this);
        void handleClient() throws IOException {
            InputStream is = new BufferedInputStream(s.getInputStream());
            PrintStream ps = new PrintStream(s.getOutputStream());
            /* we will only block in read for this many milliseconds
             * before we fail with java.io.InterruptedIOException,
             * at which point we will abandon the connection.
            s.setSoTimeout(WebServer.timeout);
            s.setTcpNoDelay(true);
            /* zero out the buffer from last time */
            for (int i = 0; i < BUF_SIZE; i++) {
                buf[i] = 0;
            try {
                /* We only support HTTP GET/HEAD, and don't
                 * support any fancy HTTP options,
                 * so we're only interested really in
                 * the first line.
                int nread = 0, r = 0;
    outerloop:
                while (nread < BUF_SIZE) {
                    r = is.read(buf, nread, BUF_SIZE - nread);
                    if (r == -1) {
                        /* EOF */
                        return;
                    int i = nread;
                    nread += r;
                    for (; i < nread; i++) {
                        if (buf[i] == (byte)'\n' || buf[i] == (byte)'\r') {
                            /* read one line */
                            break outerloop;
                /* are we doing a GET or just a HEAD */
                boolean doingGet;
                /* beginning of file name */
                int index;
                if (buf[0] == (byte)'G' &&
                    buf[1] == (byte)'E' &&
                    buf[2] == (byte)'T' &&
                    buf[3] == (byte)' ') {
                    doingGet = true;
                    index = 4;
                } else if (buf[0] == (byte)'H' &&
                           buf[1] == (byte)'E' &&
                           buf[2] == (byte)'A' &&
                           buf[3] == (byte)'D' &&
                           buf[4] == (byte)' ') {
                    doingGet = false;
                    index = 5;
                } else {
                    /* we don't support this method */
                    ps.print("HTTP/1.0 " + HTTP_BAD_METHOD +
                               " unsupported method type: ");
                    ps.write(buf, 0, 5);
                    ps.write(EOL);
                    ps.flush();
                    s.close();
                    return;
                int i = 0;
                /* find the file name, from:
                 * GET /foo/bar.html HTTP/1.0
                 * extract "/foo/bar.html"
                for (i = index; i < nread; i++) {
                    if (buf[i] == (byte)' ') {
                        break;
                String fname = (new String(buf, 0, index,
                          i-index)).replace('/', File.separatorChar);
                if (fname.startsWith(File.separator)) {
                    fname = fname.substring(1);
                File targ = new File(WebServer.root, fname);
                if (targ.isDirectory()) {
                    File ind = new File(targ, "index.html");
                    if (ind.exists()) {
                        targ = ind;
                boolean OK = printHeaders(targ, ps);
                if (doingGet) {
                    if (OK) {
                        sendFile(targ, ps);
                    } else {
                        send404(targ, ps);
            } finally {
                s.close();
        boolean printHeaders(File targ, PrintStream ps) throws IOException {
            boolean ret = false;
            int rCode = 0;
            if (!targ.exists()) {
                rCode = HTTP_NOT_FOUND;
                ps.print("HTTP/1.0 " + HTTP_NOT_FOUND + " not found");
                ps.write(EOL);
                ret = false;
            }  else {
                rCode = HTTP_OK;
                ps.print("HTTP/1.0 " + HTTP_OK+" OK");
                ps.write(EOL);
                ret = true;
            p("\nRequest from " +s.getInetAddress().getHostAddress()+": GET " + targ.getAbsolutePath()+"-->"+rCode);
            ps.print("Server: Simple java, Tiny Web Server");
            ps.write(EOL);
            ps.print("Date: " + (new Date()));
            ps.write(EOL);
            if (ret) {
                if (!targ.isDirectory()) {
                    ps.print("Content-length: "+targ.length());
                    ps.write(EOL);
                    ps.print("Last Modified: " + (new
                                  Date(targ.lastModified())));
                    ps.write(EOL);
                    String name = targ.getName();
                    int ind = name.lastIndexOf('.');
                    String ct = null;
                    if (ind > 0) {
                        ct = (String) map.get(name.substring(ind));
                    if (ct == null) {
                        ct = "unknown/unknown";
                    ps.print("Content-type: " + ct);
                    ps.write(EOL);
                } else {
                    ps.print("Content-type: text/html");
                    ps.write(EOL);
            return ret;
        void send404(File targ, PrintStream ps) throws IOException {
            ps.write(EOL);
            ps.write(EOL);
            ps.println("404 error, the requested object was not found\n\n"+
                       "The requested resource was not found.\n\n\nTiny Web Server has encountered an error.");
        void sendFile(File targ, PrintStream ps) throws IOException {
            InputStream is = null;
            ps.write(EOL);
            if (targ.isDirectory()) {
                listDirectory(targ, ps);
                return;
            } else {
                is = new FileInputStream(targ.getAbsolutePath());
            try {
                int n;
                while ((n = is.read(buf)) > 0) {
                    ps.write(buf, 0, n);
            } finally {
                is.close();
        /* mapping of file extensions to content-types */
        static java.util.Hashtable map = new java.util.Hashtable();
        static {
            fillMap();
        static void setSuffix(String k, String v) {
            map.put(k, v);
        static void fillMap() {
            setSuffix("", "content/unknown");
            setSuffix(".uu", "application/octet-stream");
            setSuffix(".exe", "application/octet-stream");
            setSuffix(".ps", "application/postscript");
            setSuffix(".zip", "application/zip");
            setSuffix(".sh", "application/x-shar");
            setSuffix(".tar", "application/x-tar");
            setSuffix(".snd", "audio/basic");
            setSuffix(".au", "audio/basic");
            setSuffix(".wav", "audio/x-wav");
            setSuffix(".gif", "image/gif");
            setSuffix(".jpg", "image/jpeg");
            setSuffix(".jpeg", "image/jpeg");
            setSuffix(".htm", "text/html");
            setSuffix(".html", "text/html");
            setSuffix(".text", "text/plain");
            setSuffix(".c", "text/plain");
            setSuffix(".cc", "text/plain");
            setSuffix(".c++", "text/plain");
            setSuffix(".h", "text/plain");
            setSuffix(".pl", "text/plain");
            setSuffix(".txt", "text/plain");
            setSuffix(".java", "text/plain");
        void listDirectory(File dir, PrintStream ps) throws IOException {
            ps.println("<TITLE>Directory listing</TITLE><P>\n");
            ps.println("<A HREF=\"..\">Parent Directory</A><BR>\n");
            String[] list = dir.list();
            for (int i = 0; list != null && i < list.length; i++) {
                File f = new File(dir, list);
    if (f.isDirectory()) {
    ps.println("<A HREF=\""+list[i]+"/\">"+list[i]+"/</A><BR>");
    } else {
    ps.println("<A HREF=\""+list[i]+"\">"+list[i]+"</A><BR");
    ps.println("<P><HR><BR><I>Tiny Web Server on "+ port + " at " + (new Date()) + "</I>");
    interface HttpConstants {
    /** 2XX: generally "OK" */
    public static final int HTTP_OK = 200;
    public static final int HTTP_CREATED = 201;
    public static final int HTTP_ACCEPTED = 202;
    public static final int HTTP_NOT_AUTHORITATIVE = 203;
    public static final int HTTP_NO_CONTENT = 204;
    public static final int HTTP_RESET = 205;
    public static final int HTTP_PARTIAL = 206;
    /** 3XX: relocation/redirect */
    public static final int HTTP_MULT_CHOICE = 300;
    public static final int HTTP_MOVED_PERM = 301;
    public static final int HTTP_MOVED_TEMP = 302;
    public static final int HTTP_SEE_OTHER = 303;
    public static final int HTTP_NOT_MODIFIED = 304;
    public static final int HTTP_USE_PROXY = 305;
    /** 4XX: client error */
    public static final int HTTP_BAD_REQUEST = 400;
    public static final int HTTP_UNAUTHORIZED = 401;
    public static final int HTTP_PAYMENT_REQUIRED = 402;
    public static final int HTTP_FORBIDDEN = 403;
    public static final int HTTP_NOT_FOUND = 404;
    public static final int HTTP_BAD_METHOD = 405;
    public static final int HTTP_NOT_ACCEPTABLE = 406;
    public static final int HTTP_PROXY_AUTH = 407;
    public static final int HTTP_CLIENT_TIMEOUT = 408;
    public static final int HTTP_CONFLICT = 409;
    public static final int HTTP_GONE = 410;
    public static final int HTTP_LENGTH_REQUIRED = 411;
    public static final int HTTP_PRECON_FAILED = 412;
    public static final int HTTP_ENTITY_TOO_LARGE = 413;
    public static final int HTTP_REQ_TOO_LONG = 414;
    public static final int HTTP_UNSUPPORTED_TYPE = 415;
    /** 5XX: server error */
    public static final int HTTP_SERVER_ERROR = 500;
    public static final int HTTP_INTERNAL_ERROR = 501;
    public static final int HTTP_BAD_GATEWAY = 502;
    public static final int HTTP_UNAVAILABLE = 503;
    public static final int HTTP_GATEWAY_TIMEOUT = 504;
    public static final int HTTP_VERSION = 505;
    the gui is just normal gui stuff, it contains the main method

  • Data transfer using dblink

    I am transfering the data from Mysql database to Oracle 11gR2. I using a control table( here temp_tab ) to maintain the details of the source and target table and dblink info.
    Also p1 is the procedure used for data transfer. My problem is
    1) I am not able to move data for some of the MSQL tables as they have text columns. The text columns cannot be queried and inserted in oracle database. tables The whole insert
    fails. The work around can be to use column names in select through which i am inserting data ( i can give null as <columnname> ) so that i can get text field as null for now.
    But the problem is if i hard code the values in select dynamic character of code is destroyed.
    2) I wanna use bulk collect in my code so that if one records fails the whole data of table doesnot fail. So that save exception can be used for record failure.
    Can anyone suggest a work aroung in this code.
    temp_tab
    ================================
    source_tab     target_tab          dblink
    aaa@dblink     aaa1               dblink name
    bbb@dblink     bbb1               dblink name
    ccc@dblink     ccc1               dblink name
    procedure p1 is
         cursor cursor_tab is select * from temp_tab;
    begin
         for cur in cursor_tab
         loop
              begin
                   EXECUTE IMMEDIATE 'insert into ' || cur.target_tab || ' select * from ' || cur.source_tab;
              exception
                   when other then
                        dbms_output.put_line(' the error is :: ' || sqlerrm(sqlcode));
              end;
         end loop;
    end p1;

    What in your code is dynamic and requires native dynamic SQL?
    Cursor FOR Loops have been obsolete in the Oracle database for more than 12 years ... why are you using one and why are you using a loop at all?
    It appears that all you have, and require, is INSERT INTO ... SELECT * FROM.
    You source table definition does not reference or use a database link. Why?

  • Flash file breaks when moved to PC

    I created several flash files on a Mac using Flash CS3 and then recently moved them to my PC. I tried to open them up on the PC and when I run the code, my .load no longer works. It doesn't make any sense because the AS should work the same no matter what. I also no longer have assess to my Mac, so I can't go back and change anything.
    My codes goes a little like this:
    testingXML = new XML ();
    testingXML.onLoad = loadingAction;
    testingXML.load ("http://www.google.com");
    Thanks!

    In my case, this exception was due to a defect in some timeout code I'd written. I didn't want to wait forever for the command to complete, so after an appropriate amount of time, the code would destroy the process. That invalidated the data streams however, causing the bad file number exception in the reader threads.
    So you may look for ways in which the executed process might be getting destroyed.

  • Firefox should save session when only popup windows is open

    When I have some window with multiple tabs open and I click close button on top, it saves the session and quits. Thats ok. But when there is some hidden popup window open (or source code) it destroys the session and leaves the popup open!!!! So the menu is gone and you lose your session. When i restart FF tabs are gone. So it should save session when only some popup windows are open.
    Also it should ask what to do when i click close window, when it's unclear what to do

    It is always a good idea to close a Firefox session by clicking File > Exit or Firefox button > Exit for proper shutdown.
    Those pop-up windows are produced by JavaScript. JavaScript can disable certain features in the pop-up window. You can set some preferences using '''about:config''' so that those features are not disabled in the pop-up window. See:
    *How to use '''about:config''': http://kb.mozillazine.org/About:config
    #type '''''about:config''''' in the URL/Location bar and press the Enter key
    #if you see a warning, accept it (promise to be careful)
    #Filter = '''dom. disable_window_open_feature.'''
    #reset preferences you want to '''''false''''' by double-clicking on that preference in the lower panel on the '''about:config''' tab
    #Preferences you can reset in this case: http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features
    <br />
    <br />
    '''You need to update the following.''' The Plugin version(s) shown below was/were submitted with your question and is/are out of date. You should update to avoid known security issues with the version(s) you have installed. Click on "More system info..." to the right of your question to see what was included with your question.
    *Adobe PDF Plug-In For Firefox and Netscape "9.4.3"
    *Shockwave Flash 10.2 r159
    *Next Generation Java Plug-in 1.6.0_24 for Mozilla browsers
    #'''''Check your plugin versions''''' on either of the following links':
    #*http://www.mozilla.com/en-US/plugincheck/
    #*https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #*There are plugin specific testing links available from this page:
    #**http://kb.mozillazine.org/Testing_plugins
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**SAVE the installer to your hard drive (save to your Desktop so that you can find it after the download). Exit/Close Firefox. Run the installer you just downloaded.
    #**Use either of the links below:
    #***https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox ''(click on "Installing and updating Adobe Reader")''
    #***''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''.
    #**http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    #**Note separate links for:
    #***Plugin for Firefox and most other browsers
    #***ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #**'''''Be sure to <u>un-check the Yahoo Toolbar</u> option during the install if you do not want it installed.
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org/Firefox_:_FAQs_:_Install_Java#Multiple_Java_Console_extensions
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • IOException :Bad file number

    Hi All
    I have written a program which writes into the file and reads from the file.
    I encounter bad file number error whenever I create new jar and replace it with old one.
    Actually file handle writes into the file correctly initially but after 5-6 operations I get bad file number error.
    Whenever I get this error then I close my application and start it again.after that I never face any issue.
    I am using solaris 9 OS and jdk1.6.
    I am using FileOutputStream to write into the File.
    Please let me know If you need more info?

    In my case, this exception was due to a defect in some timeout code I'd written. I didn't want to wait forever for the command to complete, so after an appropriate amount of time, the code would destroy the process. That invalidated the data streams however, causing the bad file number exception in the reader threads.
    So you may look for ways in which the executed process might be getting destroyed.

  • Stopping the Process Forcefully.....

    Kindly let me know, how to get the ProcessId of the Currently running Process in java. I want to get the processId and need to stop that particular process. I am trying this by using <code>proc.destroy();</code> method in my application. but the problem is not solved. The process is running yet. Can any one let me know how to forcily destory or stop the currently running process. If possible kindly give me the code for this....
    Regards,

    If you are talking about a java Thread then you can't forcefully stop
    it (we'll not safely anyway).
    If you are using a unix you can do
    int pid = ??????;
    Process p = Runtime.getRuntime().exec("kill -9 "+pid);
    p.waitFor();
    System.out.println(pid +" killed");If you are using windows you will have to delve deep and use JNI. Another
    option for windows is to get a unix style suite of software for it
    www.sysinternals.org (or com or something) and call the equivelent of
    kill.
    matfud

  • Suggestion for forum improvement

    Recently, when I tried to execute some code at home which I had posted in this forum at work I noticed that it did not work and trying to find out, what happened I saw that two code lines like
    field1||' &lt; '||field2,
    field3||', '||field4||'('||field5||')',were shortened to a single line
    field1||' < ', '||field4||'('||field5||')',and some days later I had an example where several line of code disappeared after a &lt; sign and I noticed that also other user of the forum posted code that was somehow "broken" because they used characters like &lt; and &gt;. I think this happens because the forum software tries to find html tags in the code, but in my opinion this it not always a good idea. If I copy and paste some code from my "real world" here, it is annoying to check, whether there occurs a problem because of the html interpretation of some characters in this code.
    A possible solution for this could be, that there is a setting in the user profile like "I want to use html tags in my postings" and in my opinion this should be switched off as a default for new users of the forum. And if this setting is not checked any code in a posting will be shown exactly as it was pasted into the box.
    What do you think about my idea?

    I don't know what was disabled in the past but I still can use things like &lt;font color="red"&gt;<font color="red">red</font>&lt;/font&gt; here in the forum and that's what I mean.
    And maybe you misunderstood my intention. I don't want more html as there is today. I want less, at least for unexperienced users. If users want they can switch it on immediately but than they should know what they do and be aware of the side effects.
    I personally would prefer to keep html off totally. I don't need the possibility to use <font color="red">red code</font> but I would like to copy and paste my SQL and PLS/SQL code without checking if there are any characters in my code which get interpreted as html code and destroy the functionality of the code.

Maybe you are looking for