Printing Source Code

Hello,
I know this question is not exactly an actionscript 3.0
coding question, but its related to it and I didn't see the point
in posting in the general flash forum because a lot of people there
not ever use actionscript, so by putting it here I thought everyone
doing actionscript would see it.
Anyway enough jibberish....
I am needing to print out my source code for a university
submission which requires that I print hard copies of my source
code to hand in along with my portfolio.
I have searched flash high and low and even tried the help
docs but I don't seem to be able to do this.
I know I could copy and paste the code into something like
Scite or Notepad but I either lose the code colouring which I have
set or the text looks very very ugly.
Does anyone know how I can do this direct from flash?
Any help would be greatly appreciated.
Thank you and sorry if this post should not be put in this
forum.
Lee

In your actions panel, top right corner, just below where you
close there is a little 'button' with 3 lines and a tiny arrow
pointing down. Click that, and you'll see the Print option in the
drop down.

Similar Messages

  • Best way to print source code and relationsh​ips

    I am the IT director for a medical technology company - we use Labview for our proprietary software.
    We have need to print all of our VIs, source code/block diagrams and the relationships between the modules. I know how to do this and the options which are available (for complete documentation, using as a sub vi, etc).
     I have found that printing to PDF is great for an electronic copy as everything can be zoomed in on and read; but I need paper printouts as well.  When printing from windows onto paper many of the diagrams are printed so small it is hard to read notations, etc.but my question is as follows:
    I am wondering how other people/companies have tackled this when there is a need to document everything within labview on paper?  Ideally we could end up with a book which has enlarged sections and could relate one page to another with metadata (sort of like those guide book maps - EG on the edges of the pages other pages are referenced for a continuation of the view). 
    I am open to other suggestions though. I guess I am wondering if there is a better way because the way I am considering doing this will be quite time consuming.

    When I was in the Air Force tech orders (manuals) typically had drawings that were too large to fit on a single page. The way they handled it was to have pages that folded out. Obviously you couldn't print these pages on a standard printer, but you could show diagrams without a lot of rescaling.
    Of course no printing scheme will work if the code is written badly (i.e. in adequate modularization, using sequence structures, wires running every which way, bad layout, etc.).
    Mike...
    Message Edited by mikeporter on 07-13-2007 08:07 PM
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Printer source code.

    Where do I go to get the source code used for the printer? I know the Photosmart Premium c309g-m and others run Linux and other open source software, but I cannot find where the source is.

    Do you mean the source code for Linux drivers?  The HP Linux Imaging and Printing Site has drivers for 2000+ HP printers and may have the information you are looking for.
    If you are looking for the source code for the actual printer firmware - that is not written using open source tools and the code is proprietary.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • How to print source code

    Hi
    I know will sound a stupid question but i do not know how to do it
    i need to add to a Word document the source code of a university project
    i want to maintain the different colors of the code as in a IDE
    any advice?
    thanks in advance

    If you have NetBeans, there's a menu selection File --> Print to HTML... which allows you to save your code, with formatting, as an HTML file.
    The HTML file can be opened in MS Word and saved as .doc.
    db

  • How can I print source code with connecting lines on control structures?

    Anyone know of any programs that will format source code printouts and print connecting lines from the start to the end of control structures (such as: if--"end if", while-"end while" etc.)?

    Indentations and comments do help read source code. However, when you have a large program with many levels of nesting of control structures the readability of the code (even with indentations) becomes very difficult.

  • Sapscript - print a list with all source code of the windows in layout

    hi all,
    i need a way to print all source code of the layout (include the source of all windows in the layout).
    thanks,
    dany

    Hi Dany
    From SE71, you can go to FORM INFO: Utilities->Form Info
    Max

  • Debugger stopped on uncompilable source code.

    Dear Friends,
    I got the Error as like
    Debugger stopped on uncompilable source code.
    The code is down!!!
    I could not figure out the reason, why it comes. !!! I read data from a txt file and generate an XML file.
    please any 1 help me to solve this
    Priya
    package java.Associations;
    import java.io.*;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Scanner;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Text;
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    public class XMLCreatorExample {
    //No generics
    List myData;
    Document dom;
    public XMLCreatorExample() {
    //create a list to hold the data
    myData = new ArrayList();
    //initialize the list
    loadData();
    //Get a DOM object
    createDocument();
    public void runExample(){
    System.out.println("Started .. ");
    createDOMTree();
    printToFile();
    System.out.println("Generated file successfully.");
    * Add a list of books to the list
    * In a production system you might populate the list from a DB
    private void loadData(){
    Scanner inputFile = null;
    try {
    inputFile = new Scanner(new File("C:\\coding\\weka\\1.txt"));
    while(inputFile.hasNext()) {
    myData.add(inputFile.next());
    catch(FileNotFoundException fNFE) {
    System.out.println("The file was not found");
    finally {
    inputFile.close();
    //myData.add(new Book("Head First Java", "Kathy Sierra .. etc","Java 1.5"));
    //myData.add(new Book("Head First Design Patterns", "Kathy Sierra .. etc","Java Architect"));
    * Using JAXP in implementation independent manner create a document object
    * using which we create a xml tree in memory
    private void createDocument() {
    //get an instance of factory
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    try {
    //get an instance of builder
    DocumentBuilder db = dbf.newDocumentBuilder();
    //create an instance of DOM
    dom = db.newDocument();
    }catch(ParserConfigurationException pce) {
    //dump it
    System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
    System.exit(1);
    * The real workhorse which creates the XML structure
    private void createDOMTree(){
    //create the root element <Books>
    Element rootEle = dom.createElement("Books");
    dom.appendChild(rootEle);
    //No enhanced for
    Iterator it  = myData.iterator();
    while(it.hasNext()) {
    Book b = (Book)it.next();
    //For each Book object  create <Book> element and attach it to root
    Element bookEle = createBookElement(b);
    rootEle.appendChild(bookEle);
    * Helper method which creates a XML element <Book>
    * @param b The book for which we need to create an xml representation
    * @return XML element snippet representing a book
    private Element createBookElement(Book b){
    Element bookEle = dom.createElement("Book");
    bookEle.setAttribute("Subject", b.getSubject());
    //create author element and author text node and attach it to bookElement
    Element authEle = dom.createElement("Author");
    Text authText = dom.createTextNode(b.getAuthor());
    authEle.appendChild(authText);
    bookEle.appendChild(authEle);
    //create title element and title text node and attach it to bookElement
    Element titleEle = dom.createElement("Title");
    Text titleText = dom.createTextNode(b.getTitle());
    titleEle.appendChild(titleText);
    bookEle.appendChild(titleEle);
    return bookEle;
    * This method uses Xerces specific classes
    * prints the XML document to file.
    private void printToFile(){
    try
    //print
    OutputFormat format = new OutputFormat(dom);
    format.setIndenting(true);
    //to generate output to console use this serializer
    //XMLSerializer serializer = new XMLSerializer(System.out, format);
    //to generate a file output use fileoutputstream instead of system.out
    XMLSerializer serializer = new XMLSerializer(
    new FileOutputStream(new File("C:\\coding\\book.xml")), format);
    serializer.serialize(dom);
    } catch(IOException ie) {
    ie.printStackTrace();
    public static void main(String args[]) {
    //create an instance
    XMLCreatorExample xce = new XMLCreatorExample();
    //run the example
    xce.runExample();/**/
    package java.Associations;
    public class Book {
    private String title;
    private String author;
    private String subject;
    public Book(String subject) {
    this.subject = subject;
    public Book() {
    public Book(String title, String author, String subject) {
    this.title = title;
    this.author = author;
    this.subject = subject;
    public String getAuthor() {
    return author;
    public void setAuthor(String author) {
    this.author = author;
    public String getTitle() {
    return title;
    public void setTitle(String title) {
    this.title = title;
    public String getSubject() {
    return subject;
    public void setSubject(String subject) {
    this.subject = subject;
    public String toString() {
    StringBuffer sb = new StringBuffer();
    sb.append(" { Book Details --");
    sb.append("Title:" + getTitle());
    sb.append(", ");
    sb.append("Author:" + getAuthor());
    sb.append(", ");
    sb.append("Subject:" + getSubject());
    sb.append(". } \n");
    return sb.toString();
    }

    One of your .java files doesn't compile (has compilation errors.). Make sure there are no compilation errors before you attempt to run/debug the program.
    P.S Why are you posting this across multiple forums?

  • How to find the Web Dnpro component from the Source code ?

    Hi Gurus,
    Please help me to find out the WD Component Name from the Source Code?
    Regards
    Anil

    Hi Thomos,
    When i right clik on the screen i see the following line by line.
    -Back
    -forward
    -save background as
    -set as background
    -copy background
    -set as desktop item
    -select all
    -Paste
    -create shotcut
    -add to favorites
    -view source
    -encoding
    -print
    -refresh
    -export to microsoft excel
    -properties
    I have mentioned every thing i see when ever i right click on the screen.
    --Anil

  • How to get Source code of a Schedular Java concurrent program in Payments

    Hi Experts,
    I am very new to Java Concurrent program.
    I need java source code of a schedule java concurrent program.Following are the details of Executable.
    Executable :Format Payment Instructions
    Short Name :IBY_FD_PAYMENT_FORMAT
    Application : Payments
    Execution Method :Java Concurrent Program
    Execution File Name:FDExtractAndFormatting
    Execution File Path : oracle.apps.iby.scheduler
    I searched in execution file path,but i am unable to find required java source.
    Please someone help regarding this issue..
    It's Urgent Issue.
    Regards
    Amar

    Hi Srini,
    Thanks for reply...
    In the attached template of concurrent program "Format Payment Instructions", i need to add voucher number in the template.
    How can i do this?how to decompile the executable?
    It is a check printing.
    Please give me suggestions..
    Regards
    Amar

  • How to display the source code for this friggin' file.

    Below is a rather lengthy bit of code that provides the behavior and attributes of a web server for OpenCyc. I need to know if I can enter some java to have the HTML source code displayed in a separate text file whenever this class returns some resulting webpage. If you have any ideas it will be greatly appreciated.
    -"Will code for foo."
    package org.opencyc.webserver;
    * Class WebServer is simple multithreaded HTTP server
    * with CGI limited to a Cyc connection on default port 3600.
    * <p>
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.jar.*;
    import java.text.*;
    import org.opencyc.util.*;
    public class WebServer extends Thread {
         * Singleton WebServer instance.
        public static WebServer current;
         * Default HTTP port.
        protected static int DEFAULT_PORT = 80;
         * Default Cyc base port.
        protected static int DEFAULT_CYC_PORT = 3600;
         * Default directory to serve files from on non-Windows OS.
        protected static String DEFAULT_DIR = "/";
         * Default directory to serve files from on Windows.
        //protected static String DEFAULT_WIN_DIR = "C:\\";
        protected static String DEFAULT_WIN_DIR = "k:\\opencyc\\run\\httpd\\htdocs";
         * File cache capacity.
        protected static final int CACHE_CAPACITY = 100;
         * File cache to improve file serving performance.
        protected static Hashtable fileCache = new Hashtable(CACHE_CAPACITY);
         * Number of files served from this web server.
        protected static long nbrFilesServed = 0;
         * Number of files served from this web server that were found in the cache.
        protected static long nbrCacheHits = 0;
         * Server socket for accepting connections.
        protected ServerSocket server;
         * Directories to serve files from.
        protected ArrayList dirs;
         * Map from String (jar root) to JarFile[] (jar class path).
        protected HashMap map;
         * Webserver HTTP port.
        protected int port;
         * Cyc HTML host.
        protected String cycHost = "localhost";
         * Cyc HTML port.
        protected int cycPort;
         * Expand jar tress.
        protected boolean trees;
         * Requests flag.
        protected boolean traceRequests;
         * Constructs a WebServer object.
         * @param port the port to use
         * @param directories the directory to serve files from
         * @param trees true if files within jar files should be served up
         * @param traceRequests true if client's request text should be logged.
         * @exception IOException if the listening socket cannot be opened, or problem opening jar files.
        public WebServer() throws IOException {
            getProperties();
            server = new ServerSocket(port);
            processDirectories();
         * Class Task processes a single HTTP request.
        protected class Task extends Thread {
             * Socket for the incoming request.
            protected Socket sock;
             * Client socket to the Cyc KB HTML server.
            protected Socket cycHtmlSocket;
             * Output tcp stream.
            protected DataOutputStream out;
             * Contains the file request path for a not-found error message.
            protected String notFoundPath;
             * Contains the first line of a request message.
            protected String methodLine;
             * Contains the body of a POST method.
            protected String bodyLine;
             * Constructs a Task object.
             * @param sock the socket assigned for this request.
            public Task(Socket sock) {
                this.sock = sock;
             * Processes the HTTP request.
            public void run() {
                if (traceRequests)
                    Log.current.println("connection accepted from " + sock.getInetAddress());
                notFoundPath = "";
                try {
                    out = new DataOutputStream(sock.getOutputStream());
                    try {
                        getBytes();
                    catch (Exception e) {
                        Log.current.println("file not found: " + notFoundPath);
                        try {
                            out.writeBytes("HTTP/1.1 404 Not Found\r\n");
                            out.writeBytes("Server: Cyc WebServer\r\n");
                            out.writeBytes("Connection: close\r\n");
                            out.writeBytes("Content-Type: text/html\r\n\r\n");
                            out.writeBytes("<HTML><HEAD>\n");
                            out.writeBytes("<TITLE>404 Not Found</TITLE>\n");
                            out.writeBytes("</HEAD><BODY>\n");
                            out.writeBytes("<H1>404 - Not Found</H1>\n");
                            out.writeBytes("</BODY></HTML>");
                            out.flush();
                        catch (SocketException se) {
                catch (Exception e) {
                    Log.current.printStackTrace(e);
                finally {
                    try {
                        sock.close();
                    catch (IOException e) {
             * Reads the HTTP request and obtains the response.
             * @exception IOException when HTTP request has an invalid format.
            private void getBytes() throws IOException {
                // Below logic is complex because web browsers do not close the
                // socket after sending the request, so must parse message to find
                // the end.
                BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                ArrayList inBytes = new ArrayList(200);
                int ch = 0;
                boolean postMethod;
                methodLine = in.readLine();
                //if (traceRequests)
                //    Log.current.println("methodLine=" + methodLine);
                bodyLine = "";
                if (methodLine.startsWith("POST /"))
                    postMethod = true;
                else
                    postMethod = false;
                //if (traceRequests)
                //    Log.current.println("postMethod=" + postMethod);
                int ch1 = -1;
                int ch2 = -1;
                int ch3 = -1;
                int ch4 = -1;
                // Read the HTTP request headers.
                while (true) {
                    ch = in.read();
                    inBytes.add(new Integer(ch));
                    ch1 = ch2;
                    ch2 = ch3;
                    ch3 = ch4;
                    ch4 = ch;
                    if (ch1 == '\r' && ch2 == '\n' && ch3 == '\r' && ch4 == '\n')
                        break;
                    if ((! postMethod) &&
                        (! in.ready()) &&
                        ch1 == -1 &&
                        ch2 == -1 &&
                        ch3 == '\r' &&
                        ch4 == '\n') {
                        inBytes.add(new Integer('\r'));
                        inBytes.add(new Integer('\n'));
                        break;
                byte[] byteArray = new byte[inBytes.size()];
                for (int i = 0; i < inBytes.size(); i++) {
                    Integer ich = (Integer) inBytes.get(i);
                    byteArray[i] = ich.byteValue();
                String headers = new String(byteArray);
                if (postMethod) {
                    String lcHeaders = headers.toLowerCase();
                    int i = lcHeaders.indexOf("content-length: ");
                    String contentLength = lcHeaders.substring(i + 16);
                    int j = contentLength.indexOf("\r\n");
                    contentLength = contentLength.substring(0, j);
                    int bodyLen = (new Integer(contentLength)).intValue();
                    for (int k = 0; k < bodyLen; k++) {
                        bodyLine = bodyLine + (new Character((char) in.read())).toString();
                String line = methodLine + "\r\n" + headers + bodyLine;
                if (traceRequests)
                    Log.current.println(line);
                if (postMethod)
                    processHttpPost();
                else
                    if (line.startsWith("GET /"))
                        processHttpGet(line.substring(4));
                    else {
                        Log.current.println("Invalid request = " + line);
                        throw new IOException();
             * Processes an HTTP GET method.
             * @param httpGetPath the path of the file to get.
             * @exception IOException if the file is not found.
            private void processHttpGet(String httpGetPath) throws IOException {
                int i = httpGetPath.indexOf(' ');
                if (i > 0)
                    httpGetPath = httpGetPath.substring(0, i);
                Log.current.println(methodLine + " from " + sock.getInetAddress().getHostName());
                i = httpGetPath.indexOf("cg?");
                if (i > 0) {
                    cycHtmlRequest(httpGetPath.substring(i + 3));
                    return;
                notFoundPath = httpGetPath;
                i = httpGetPath.indexOf('/');
                if (i < 0 || map == null) {
                    if (map == null || httpGetPath.endsWith(".jar")) {
                        for (int j = 0; j < dirs.size(); j++) {
                            String dir = (String) dirs.get(j);
                            String nativePath = dir + httpGetPath;
                            nativePath = nativePath.replace('/', File.separatorChar);
                            if (fileCache.containsKey(nativePath)) {
                                writeDataBytes((byte[]) fileCache.get(nativePath));
                                Log.current.println("...cached");
                                nbrCacheHits++;
                                nbrFilesServed++;
                                return;
                            try {
                                File f = new File(nativePath);
                                byte[] fileBytes = getBytes(new FileInputStream(f), f.length());
                                writeDataBytes(fileBytes);
                                if (fileCache.size() >= CACHE_CAPACITY)
                                    fileCache.clear();
                                fileCache.put(nativePath, fileBytes);
                                Log.current.println("...from " + nativePath);
                                nbrFilesServed++;
                                return;
                            catch (IOException e) {
                    throw new IOException();
                String jar = httpGetPath.substring(0, i);
                httpGetPath = httpGetPath.substring(i + 1);
                JarFile[] jfs = (JarFile[]) map.get(jar);
                if (jfs == null)
                    throw new IOException();
                for (i = 0; i < jfs.length; i++) {
                    JarEntry je = jfs.getJarEntry(httpGetPath);
    if (je == null)
    continue;
    writeDataBytes(getBytes(jfs[i].getInputStream(je), je.getSize()));
    nbrFilesServed++;
    return;
    throw new IOException();
    * Processes an HTTP POST method.
    * @exception IOException if the file is not found.
    private void processHttpPost() throws IOException {
    Log.current.println("POST " + bodyLine + " from " + sock.getInetAddress().getHostName());
    cycHtmlRequest(bodyLine);
    * Reads the specified number of bytes and always close the stream.
    * @param in the file to be read for subsequent downloading.
    * @param length the number of bytes to read from the file.
    * @return An array of bytes from the file.
    * @exception IOException if an error occurs when processing the file.
    private byte[] getBytes(InputStream in, long length) throws IOException {
    DataInputStream din = new DataInputStream(in);
    byte[] bytes = new byte[ (int) length];
    try {
    din.readFully(bytes);
    finally {
    din.close();
    return bytes;
    * Sends the HTML request to Cyc.
    * @param cycPath the portion of the URL which is given to the Cyc HTML server.
    private void cycHtmlRequest(String cycPath) {
    String request = sock.getInetAddress().getHostName() + "&" + cycPath + "#";
    System.out.println("request=" + request);
    ArrayList bytes = new ArrayList(10000);
    try {
    cycHtmlSocket = new Socket(cycHost, cycPort);
    System.out.println("cycHost=" + cycHost + " cycPort=" + cycPort);
    BufferedReader cycIn = new BufferedReader(new InputStreamReader(cycHtmlSocket.getInputStream()));
    PrintWriter cycOut = new PrintWriter(cycHtmlSocket.getOutputStream(), true);
    cycOut.println(request);
    cycOut.flush();
    int ch = 0;
    while (ch >= 0) {
    ch = cycIn.read();
    bytes.add(new Integer(ch));
    catch (Exception e) {
    Log.current.printStackTrace(e);
    byte[] byteArray = new byte[bytes.size()];
    for (int i = 0; i < bytes.size() - 1; i++) {
    Integer ich = (Integer) bytes.get(i);
    byteArray[i] = ich.byteValue();
    try {
    writeTextBytes(byteArray);
    catch (Exception e) {
    Log.current.println(e.getMessage());
    * Responds to the HTTP client with data content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeDataBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    String prefix = (new String(bytes)).toLowerCase();
    if (prefix.indexOf("<html>") > -1)
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    else
    out.writeBytes("Content-Type: application/java\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Respond to the HTTP client with text content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeTextBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Gets properties governing the web server's behavior.
    private void getProperties() {
    port = DEFAULT_PORT;
    String portProperty = System.getProperty("org.opencyc.webserver.port", "");
    if (! portProperty.equalsIgnoreCase(""))
    port = (new Integer(portProperty)).intValue();
    Log.current.println("Listening on port " + port);
    cycPort = DEFAULT_CYC_PORT;
    String cycPortProperty = System.getProperty("org.opencyc.webserver.cycPort", "");
    if (! cycPortProperty.equalsIgnoreCase(""))
    cycPort = (new Integer(cycPortProperty)).intValue();
    Log.current.println("Cyc connections directed to port " + cycPort);
    String dirsProperty = System.getProperty("org.opencyc.webserver.dirs", "");
    dirs = new ArrayList(3);
    StringTokenizer st = new StringTokenizer(dirsProperty, ";", false);
    while (st.hasMoreTokens()) {
    String dir = st.nextToken();
    dirs.add(dir);
    trees = false;
    String treesProperty = System.getProperty("org.opencyc.webserver.trees", "");
    if (! treesProperty.equalsIgnoreCase(""))
    trees = true;
    traceRequests = false;
    String traceRequestsProperty = System.getProperty("org.opencyc.webserver.traceRequests", "");
    if (! traceRequestsProperty.equalsIgnoreCase("")) {
    traceRequests = true;
    Log.current.println("tracing requests");
    * Adds transitive Class-Path jars to jfs.
    * @param jar the jar file
    * @param jfs the list of jar files to serve.
    * @param dir the jar file directory.
    * @exception IOException if an I/O error has occurred with the jar file.
    private void addJar(String jar, ArrayList jfs, String dir) throws IOException {
    Log.current.println("Serving jar files from: " + dir + jar);
    JarFile jf = new JarFile(dir + jar);
    jfs.add(jf);
    Manifest man = jf.getManifest();
    if (man == null)
    return;
    Attributes attrs = man.getMainAttributes();
    if (attrs == null)
    return;
    String val = attrs.getValue(Attributes.Name.CLASS_PATH);
    if (val == null)
    return;
    dir = dir + jar.substring(0, jar.lastIndexOf(File.separatorChar) + 1);
    StringTokenizer st = new StringTokenizer(val);
    while (st.hasMoreTokens()) {
    addJar(st.nextToken().replace('/', File.separatorChar), jfs, dir);
    * Administrative accessor method that obtains list of directories from which files are served.
    public ArrayList getDirs() {
    return dirs;
    * Administrative method that updates the list of directories from which files are served.
    public synchronized void setDirs(ArrayList dirs) throws IOException {
    this.dirs = dirs;
    fileCache.clear();
    processDirectories();
    * Administrative accessor method that obtains number of files served.
    * @return The number of files served.
    public long getNbrFilesServed() {
    return nbrFilesServed;
    * Administrative accessor method that obtains number of files served from cache.
    * @return The number of files served from the cache.
    public long getNbrCacheHits() {
    return nbrCacheHits;
    * Administrative method that clears the file cache.
    public synchronized void clearFileCache() {
    Log.current.println("Clearing file cache");
    fileCache.clear();
    nbrFilesServed = 0;
    nbrCacheHits = 0;
    * Processes the directories from which files are served, expanding jar trees if
    * directed.
    * @exception IOException if problem occurs while processing the jar files.
    private void processDirectories() throws IOException {
    if (dirs.size() == 0)
    if (File.separatorChar == '\\')
    dirs.add(DEFAULT_WIN_DIR);
    else
    dirs.add(DEFAULT_DIR);
    Iterator directories = dirs.iterator();
    while (directories.hasNext())
    Log.current.println("Serving from " + directories.next());
    if (trees) {
    map = new HashMap();
    for (int j = 0; j < dirs.size(); j++) {
    String dir = (String) dirs.get(j);
    String[] files = new File(dir).list();
    for (int i = 0; i < files.length; i++) {
    String jar = files[i];
    if (!jar.endsWith(".jar"))
    continue;
    ArrayList jfs = new ArrayList(1);
    addJar(jar, jfs, dir);
    map.put(jar.substring(0, jar.length() - 4), jfs.toArray(new JarFile[jfs.size()]));
    * Provides the command line interface for creating an HTTP server.
    * The properties are:
    * <pre>
    * org.opencyc.webserver.port=<HTTP listening port>
    * </pre>
    * which defaults to 80.
    * <pre>
    * org.opencyc.webserver.cycPort=<Cyc connection port>
    * </pre>
    * which defaults to 3600.
    * <pre>
    * org.opencyc.webserver.dirs=<path>;<path> ... ;<path>
    * </pre>
    * with the argument enclosed in quotes if any path contains an
    * embedded space.
    * The default directory on Windows is C:
    * and the default on other systems is / the default
    * can be overridden with this property. By default, all files
    * under this directory (including all subdirectories) are served
    * up via HTTP. If the pathname of a file is <var>path</var> relative
    * to the top-level directory, then the file can be downloaded using
    * the URL
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>path</var>
    * </pre>
    * Caching of file contents is performed.
    * <pre>
    * org.opencyc.util.log=all
    * </pre>
    * If the all value is given, then all attempts to download files
    * are output.
    * <pre>
    * org.opencyc.webserver.traceRequests
    * </pre>
    * If this property has any value, then the client HTTP requests are
    * output.<p>
    * <pre>
    * org.opencyc.webserver.trees
    * </pre>
    * This property can be used to serve up individual files stored
    * within jar files in addition to the files that are served up by
    * default. If the property has any value, the server finds all jar files
    * in the top-level directory (not in subdirectories). For each
    * jar file, if the name of the jar file is <var>name</var>.jar, then any
    * individual file named <var>file</var> within that jar file (or within
    * the jar or zip files referenced transitively in the Class-Path manifest
    * attribute, can be downloaded using a URL of the form:
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>name</var>/<var>file</var>
    * </pre>
    * When this property has any value, an open file descriptor and cached
    * information are held for each jar file, for the life of the process.
    * @param args an unused array of command line arguments.
    public static void main(String[] args) {
    Log.makeLog();
    System.out.println("OpenCyc Web Server");
    try {
    // Launch thread to accept HTTP connections.
    current = new WebServer();
    current.start();
    catch (IOException e) {
    e.printStackTrace();
    * Just keep looping, spawning a new thread for each incoming request.
    public void run() {
    try {
    while (true) {
    // Launch thread to process one HTTP request.
    new Task(server.accept()).start();
    catch (IOException e) {
    e.printStackTrace();

    JLundan,
    I want to thank you for responding to the thread I started on the forum at java.sun.com. Your solution to my problem of needing to print the code of the html pages that the file I included generates was just what I was looking for. However, I have some further questions to ask, if you don't mind. To clarify my task I should say that your rephrasing of the problem is accurate: "You wan't to display the contents of the HTML file that the web server produces in response of client's request?"
    Yes, this is what I need to do, but also it needs to display the source code of that html file that the server produces in response to the client's request. Also, in this case, I am the client requesting that the server return some html file, and I'm not sure where the server is. But the webserver.java file that I shared on the forum is on my local machine. I was wondering if I could modify this webserver.java file at my home so that any html file the server returns to me would automatically display the source code. This is a school project of mine and I am stuck on this one thing here.
    Further, where would I put the "foo.html" file so it can be written to?
    FileOuputStream fos = new FileOutputStream("foo.html");
    fos.write(bytes);
    fos.close();
    Thanks so much for your help. I look forward to your response, at your convenience.
    Regards

  • Problem file xls with jasper (source code mixed in the content XLS file)

    i´m writing xls file with jasper, the problem is that is mixed the source code of the JSP (where doing request) in the content of the file xls, do not import the API thah use.
    The java code whit JASPER is like:
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext ectx = ctx.getExternalContext();
    JRDataSource dataSource = ......
    InputStream inputStream = ectx.getResourceAsStream(parametro);
    JasperReport jasperReport = (JasperReport) JRLoader.loadObject(inputStream);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,new HashMap(), dataSource);
    JRXlsExporter exporter = new JRXlsExporter();
    ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport);
    exporter.exportReport();
    byte[] bytes2 = xlsReport.toByteArray();
    response.setContentType("application/vnd.ms-excel");
    response.setContentLength(bytes2.length);
    response.setHeader("Content-disposition", "attachment; filename="" + "MI_EXCEL_JR" + ".xls"");
    ServletOutputStream outputStream = response.getOutputStream();
    outputStream.write(bytes2, 0, bytes2.length);
    outputStream.flush();
    outputStream.close(); whay is printed the response in the xml file?
    tnk for your help....

    hoham wrote:
    byte[] bytes2 = xlsReport.toByteArray();
    Not related to the actual problem, but this line is not very efficient. What if the report is bigger than the available server memory? Or if there are many simultaneous requests which does all the same?
    It would result in an OutOfMemoryError. Rather obtain it as an InputStream and write it in a loop to the OutputStream using a byte block as buffer. Or wrap the both streams by BufferedInputStream/BufferedOutputStream and write in a simple loop. Consult the basic Java IO tutorials for details and code examples.

  • How to retrieve the source code navigation sidebar

    Hi,
    I'm trying to build a site following the tutorials on the dreamweaver software.  I get in the part where i have to do the columns but i lost the navigation sidebar where the source code tab and the check_cs5.css are under the index.html tab, and have to use this one to be able to continue with the setup.  I would like to know if it possible to retrieve this side bar and how?  Or what to do to fix it, especially i'm far away for this step, do I have to start over?  Please, I need an ASAP answer.
    Thanks,

    I get in the part where i have to do the columns but i lost the
    navigation sidebar where the source code tab and the check_cs5.css are
    under the index.html tab, and have to use this one to be able to
    continue with the setup.  I would like to know if it possible to
    retrieve this side bar and how?
    I'm assuming you're doing this tutorial by David Powers:
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt2.html
    DW Menu > Window > Files or CSS Styles.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Creating a copy of an existing JTable that does not have source code.

    Hi
    I am working on a java swing based application. We used a third party API for JTable for showing some data in a table format and also for printing function. As of now print button is printing the whole table being shown in the application. Our new requirement of printing is �Users don�t want to print all the columns being shown in the application and they wanted to have print of columns whatever they would like to see�.
    The above requirement can be fulfilled if I can have a copy of the existing table. Unfortunately we don�t have the source code of the table being shown in the application as we are using 3rd party libraries. Had the source code been there I could have implemented cloneable interface or proto type pattern.
    Can some body help me how can I create a copy of the existing table? Basically the high level approach I thought of is create a new object of the table class and copy the properties/attributes of the existing table to the new table object. But I don�t know what attributes should be copied so that I can have the copy of the original table and how to construct (code) this new table.
    I would be very grateful if some one could help me with this.
    Thanks & Regards
    Srini

    I understood your suggestion. But it would be very difficult to migrate as it requires lot of changes across different tabs of the existing application. This application was developed around 6 years ago. And this change would require lot of regression testing too.
    Do you have any idea of creating the copy of the available JTable object?

  • Problem with printing the code

    Hi ,
    I m having problems in printing my source code . I use emacs as a text editor. Is there any settings that need to be made before printing . Because when i try to print it didn't print my whole code. And when i try to print it from some where else it gives me error saying printer not found on LPT1. Is it something about the port or what. Plz tell me about it ASAP , because i need to submit my project.
    Bye
    Waiting for reply

    Hello gotchya11,
    If you are using a Unix environment, you can use the "lp" print command to send a document to printer. The "-d <device name>" flag is where you specify which printer to sent the document to. You can do a
    "man lp"
    from the command line to get more info on how to print. Perhaps you need to specify the destination where the file is to be printed. What you can do if you need to print the doc is to just copy and paste your code into a text editor and print from some other program if you are running Solaris CDE or Windows.
    Hope this helps,
    Ming
    Developer Technical Support
    http://www.sun.com/developers/support

  • Printing QR codes and Barcodes together

    Dear All,
    I have referred the following link to print QR code as a post script:
    http://scn.sap.com/people/robert.russell/blog/2010/10/25/barcodes-in-sap-with-the-barcode-writer-in-pure-postscript
    While printing my SAP Script/ SMARTFORM output on any printer, if I specify output device as ZBWIPP then QR code is being printed perfectly, but barcodes (Which are already there in script and are expected to be there) are not being printed at all. When the output is printed without specifying any output device, then only barcodes are being printed and not the QR code.
    I have tried adding print controls ZBW01, ZBW02, ZBW09 and ZBW91 to the output type of printer, even then QR code is not being printed.
    I request your advice and help on how to get QR code and barcodes printed together. Thank you.
    Regards,
    Kartik
    P.S. These existing barcodes are of type BC_CD39, not post script barcodes.

    Hi Karthik,
    I have a requirement to
    1) Output data from an internal table into excel, and
    2) Create a chart from the data in excel
    So far I have been able to export the data using OLE calls, created a chart object,.
    My question:
    1. How to put Data Lables
    2. How to put Data Table under the Chart
    3. How to rename the series names.
    Below is the recorded Macro. I don't know how to convert it to ABAP.
    Sub Macro1()
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.ChartType = xlColumnClustered
    Application.CutCopyMode = False
    ActiveChart.SetSourceData Source:=Range("B1:E4")
    ActiveChart.SeriesCollection(1).Name = "=Sheet2!$A$2"
    ActiveChart.SeriesCollection(2).Name = "=Sheet2!$A$3"
    ActeChart.SeriesCollection(3).Name = "=Sheet2!$A$4"
    ActiveChart.SetElement (msoElementDataLabelOutSideEnd)
    ActiveChart.SetElement (msoElementDataTableWithLegendKeys)
    End Sub
    I have attached the current output and expected output.
    I have searched about this in google but i could not find any solution for this.
    Your help is greatly appreciated.
    Current Output:
    Expected Output:
    I hope that I have explained my query clearly.
    Thanks,
    Lakshmi.

Maybe you are looking for

  • How can i see the posts that i answered?

    How can i see the posts that i answered? Actually i some others post for a VLAN.. now i need that post ... but i'm unable to find it... Can someone please help me in this ? Regards, Chandu

  • Horizontal scroll bar jumps

    Hi When you execute the following code , you will see a table , drag or extend the column size of column D such that , you get a horizontal scroll pane Now when you click on first,second or third column ( i.e row selection ) no problem but if u selec

  • Need 3.01 update to Homesite 3.0 REG

    Hello, I need to locate a copy of the 3.01 update for my registered copy of Homesite 3.0 due to recent, and numerous, computer/backup problems. I've done a web search and all references I can find are to warez and cracked/hacked sites but no official

  • Can extension numbers be added to phone numbers?

    Is there was a way to include an extension to a phone number in 'Contacts'? For example, (202) 555-1212 x2232.

  • [Help] How to check the object locks held by a specific thread?

    As the title I want to check locks held by a specific thread. How can I do this? In Java lock is acquired and release automatically by stating synchronized keyword. I have no idea on how to check the lock status and who owns whick lock. Regards, Skee