Archive based on mask size question

I'm going to be working with a client who has a production repository in MDME 4.0. It has a size of about 4.5GB. In order to prep for the interaction with the client next week, I've asked for an archive based on a mask. They've created a mask which contains about 10 records. The file size has been reduced to about 1GB.
What can I do to trim the file size down even further besides reducing the number of records?
Erika
Any other options can you think of for me to access the data?

Hi Erika,
I am just thinking what kind of data is available in repository which takes 1GB for 10 records! As per my knowledge, there is no other to reduce the size of an archive file.
But, based on my experience, I want to share a small information. I faced lot of problems in unarchiving. The reason is original archive file came from MDM running on MySQL(MDM 4.0) and I was trying to unarchive on MDM running on Oracle (MDM 5.5).
All the best.
Regards,
Rajani Kumar K

Similar Messages

  • Set font size based on component size

    Hi everybody,
    This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a component, but still be able to have the whole string visible, if you're using a font other than default?
    For example:
    public static void main( String args[] ){
    try {
              JFrame frame = new JFrame( "Title" );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              int guiWidth = width / 2;
              int guiHeight = height / 2;
              frame.setSize( guiWidth, guiHeight );
              Container pane = frame.getContentPane();
              // Create main label
              String labelString = "Test";
              JLabel label = new JLabel( labelString );
              label.setBackground( new Color( 179, 0, 0 ) );
              label.setForeground( new Color( 235, 191, 16 ) );
              label.setHorizontalAlignment( CENTER );
              label.setOpaque( true );
              label.setFont( new Font( �Old English Text MT�, 0, 48 ) );
              pane.add( label, BorderLayout.NORTH );
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
    } catch( Exception e) {
    e.printStackTrace();
         }As you can see, right now the font needs to be hard coded. I'd like it to be dynamic, based on the size of the screen the user has.
    Sorry if the partial double post annoys anybody; I figured it would be less annoying than resurrecting my old post.
    Any help on this would be great, and thank you!
    Jezzica85
    Message was edited by:
    jezzica85
    Message was edited by:
    jezzica85

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.AffineTransform;
    import javax.swing.*;
    public class DynamicFont {
        private JLabel getNorth() {
            // Create main label
            String labelString = "Test";
            final JLabel label = new JLabel( labelString ) {
                public void paint(Graphics g) {
                    ((Graphics2D)g).setRenderingHint(
                            RenderingHints.KEY_TEXT_ANTIALIASING,
                            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                    super.paint(g);
            label.setBackground( new Color( 179, 0, 0 ) );
            label.setForeground( new Color( 235, 191, 16 ) );
            label.setHorizontalAlignment( JLabel.CENTER );
            label.setOpaque( true );
            label.setFont( new Font( "Old English Text MT", 0, 48 ) );
            label.addComponentListener(new ComponentAdapter() {
                Font font = label.getFont();
                public void componentResized(ComponentEvent e) {
                    int w = label.getWidth();
                    int sw = label.getFontMetrics(font).stringWidth(label.getText());
                    double scale = (double)w/sw;
                    AffineTransform at = AffineTransform.getScaleInstance(scale, 1.0);
                    label.setFont(font.deriveFont(at));
                    label.repaint();
            return label;
        public static void main( String[] args ) {
            JFrame frame = new JFrame( "Title" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            Container pane = frame.getContentPane();
            pane.add( new DynamicFont().getNorth(), BorderLayout.NORTH );
            frame.setSize( 400, 100);
            frame.setLocationRelativeTo( null );
            frame.setVisible( true );
    }

  • RE: CS4 Premiere Pro - what is best to backup/archive video to minimize size

    RE: CS4 Premiere Pro -> what is best to backup/archive video to minimize size?
    I use export>media to adobe media encoder. I am using the avi. the avi file generated seems large. i.e. for 27 minutes the file is 6 gb.
    what is the best format to use to minimize file size?????
    any help will be appreciated and thks in advance.

    >what is best to backup/archive video to minimize size?
    That's the wrong question to ask. Ideally you don't change anything about the original media for backup. It's size it it's size, and you get enough of whatever you nee to accommodate that.

  • Photo Gallery w/ Images adjusting size based on Browser size.

    I'm new to web design but I'm trying to create a photo gallery with images that dynamically size based on the size of the browser window. Similar to this http://pageduke.com/#/Residential/Colonial%20Revival-Nashville1/1. I know th is a flsh site, but is there a way yo do it in HTML in Dreamweaver, maybe using Spry. I don't know Jquery, but is it possible that way.
    Thanks

    Nancy,
    Woo is not a gallery. It's just a slider - a panel widget, which should
    be adaptive/responsive by default. The problem is that for years, the
    typical jQuery plugin writer simply copies stuff done by others so
    someone finally realized you don't have to fix a width and a height if
    you know how to write a stub script
    Galleries are totally different. To do a responsive gallery is not so
    easy and the only ones that come remotely close - using open source
    scripts - do require an initial width. They will not scale both up and down.
    I gusess it depends on what the original poster wants and/or cares about
    in terms of efficiencies and functionality.
    [External commercial link removed]
    Message was edited by: Sudarshan Thiagarajan. Please refrain from posting external links advertising/ promoting products & services.

  • Creating fonts based on pixels size

    Hi i'am still a java beginner and i am switching from .NET so anyone can help on how can I create a font based on Pixels size rather than Point Size

    You can translate between points size and pixels size using the DPI:
    http://java.sun.com/products/java-media/2D/reference/faqs/index.html#Q_Why_does_eg_a_10_pt_font_in_Ja
    Dmitri

  • How to pick the multiples based on file size

    Hi All,
    my sender file adapter needs to pick up 5 files based on file size.
    for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb.
    here my requirement is, my file adapter needs to pick in the below order like 5th file,1st file,3rd file 2nd file and 4th file.
    means based on file size, i need to pick up my file adapter.
    could you please ang inputs on this requirement.
    Thanks & Regards,
    AVR

    Hi AVR,
    for case 2:
    1. At specific time each day  "23:58:00" hours ,count the number of files in directory say "c:\apps\acm".
    2. sort the files on basis of their size.
    3. place the files one by one after definite  time interval (more than polling time of the sender communication channel).
    in target directory say "c:\apps\acm1" from where PI server  picks up the files for further processing. The file with smallest size is placed last.
    4. In this case you need to ensure all files are present in the directory "c:\apps\acm" before "23:58:00" hours.
    for case 2  java code
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class sortFilesOnSpecificTime {
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try
    * In Unix/Linux OS, dir1="/usr/apps/test"  etc
    int pollingInterval=10,sleepTime=1*60;
    String dir1="c:\\apps\\acm";
    String dir2="c:\\apps\\acm1";
    File fread=new File(dir1);
    File fwrite=new File(dir2);
    if(fread.canRead()==false)
    System.out.println("error: "+dir1+" does not have read permission. Program Terminates.");
    return;
    if(fwrite.canWrite()==false)
    System.out.println("error: "+dir2+" does not have write permission. Program Terminates.");
    return;
    String fileNames[],fileNamesOut[];
    long fileSize[];
    int i,j;
    byte b[];
    int t=4;
    Calendar cal;
    int hour24,min,fileCopyHour=23,fileCopyMin=58;
    long waitSeconds=1,currentTime=0;
    while(t>0)
    cal = new GregorianCalendar();
    hour24 = cal.get(Calendar.HOUR_OF_DAY);     // 0..23
    min = cal.get(Calendar.MINUTE);             //0..59
    System.out.println("current time="+hour24+":"+min);
    /*loop unless time reaches a specific predetermined value
    * predetermined values are provided by values
    * fileCopyHour=8,fileCopyMin=30 i.e say 08:30 hours
    currentTime=(hour24*60+min)*60;
    waitSeconds=(fileCopyHour*60+fileCopyMin)*60 - currentTime;
    if(waitSeconds>0)
    * in case you wanna to make this thread sleep for
    * say sleepTime(10) minutes before it checks the files once again
    * because looping continuously causes wastage of CPU cycles.   
    Thread.sleep(waitSeconds*1000);
    //read list of files
    fileNames=fread.list();
    if(fileNames.length;=0)
    * time is up but there are no file
    * in dir1 to copy. Then this program
    * goes to sleep for some time and
    * checks only at 11:55 hours. That is
    * end of the day
    continue;
    fileSize=new long[fileNames.length];
    fileNamesOut=new String[fileNames.length];
    //read their sizes
    for(i=0;i<fileNames.length;++i)
    fileNamesOut<i>=fileNames<i>;
    fileNames<i>=dir1+System.getProperty("file.separator";)+fileNames<i>;
    fileSize<i>=new File(fileNames<i>).length();
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    //sorting on basis of file size descending order
    long value;
    String temp;
    for(i=1;i<fileSize.length;++i)
    value=fileSize<i>;
    temp=fileNames<i>;
    for(j=i-1;j>=0 && fileSize[j]<value;--j)
    fileSize[j+1]=fileSize[j];
    fileNames[j+1]=fileNames[j];
    fileSize[j+1]=value;
    fileNames[j+1]=temp;
    //now copy files to dir2
    b=new byte[512];
    for(i=0;i<fileNames.length;++i)
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    for(i=0;i<fileNames.length;++i)
    File f=new File(fileNames<i>);
    FileInputStream in=new FileInputStream(f);
    FileOutputStream out=new FileOutputStream(dir2+System.getProperty("file.separator";)+fileNamesOut<i>);
    int len=0;
    while(2>1)
    if((len=in.read(b))<0)
    break;
    out.write(b,0,len);
    in.close();
    //delete files after copying from dir1
    f.delete();
    out.close();
    //put each file after polling interval is over
    Thread.sleep(pollingInterval*1000);
    catch(Exception e)
    e.printStackTrace();
    The code runs in infinite loop. You need to run them in command line in DOS environment as you indicated that you OS is WIN XP.  I have a few print statements which I kept for debugging, you can safely remove them and run the codes. This code is independent of the Operating System you are using. Only change is required in values of "dir1","dir2", timings and file count, which I think you can take care easily.
    Hope this solves your problem.
    regards
    Anupam

  • Case For Rotobrush & Mask Keyframe Question

    Hi,
    Just wanted to make sure the below sample is a case for Rotobrush.  Obviously I've never used it before, however I'd like to maintain the color, (excuse the crappy mask), I've created in the water in the first shot, throughout the sequence of cuts.  When the woman moves across the aquarium, I'll need to rotoscope her correct?  Any tips?  I will however be reading the manual!
    http://vimeo.com/39579490
    And the mask question - I should know this but for some reason, (in another comp), my mask changed shape over thime.  It was the same tank you see above, but it was a dolly shot and the tank didn't change shape!  You'll laugh but I ended up resetting the mask points in 291 frames, and it still didn't work as the variations in mask shapes created a flicker after applying color correction, levels etc.
    Shouldn't I be able to go to the end of the comp.  Draw the mask shape I want, keyframe Mask Shape; then go to the beginning of the comp - set the position of the mask and keyframe again.  Please tell me where I'm going wrong!
    And; is there a way to keyframe a "transform" of the mask shape during time?  Essentially changing the size and shape of the mask, I was only able to do this frame-by-frame.
    As always, much gratitude for everyone's guidance, patience and knowledge!
    Best,
    Jesse

    I actually wasn't using auto-trace, I drew the shapes with bezier points as one would in PS.  Not sure what you mean by vertices?  Didn't move the layer.  My apologies for not painting a better picture.  I'd like to post a screen shot, but don't see the camera icon!  How do I do that, is it possible without the hassle of using flikr or photobucket?
    Ok, not quite sure if you answered my question, (and yeah, my 291 frame marathon freaked me out a little.).  How do I maintain the shape of a mask from beginning to end of a comp?  (there will be variations as it comes into frame etc., I think I can handle that), but why wouldn't the mask hold shape when I keyframed beginning and end?
    Now, with the above referenced Vimeo clip, the shot where the artist crosses the aquarium - won't that require multiple mattes on multiple solids, or layers as there are a bunch of spaces where we see the aquarium?  AE will not allow more than one mask on a layer correct?  Unlike PS!!  Or am I wrong about that?
    Would I be linking the solid with the matte(s) to a null object and then tracking that?
    Many thanks again for your time - I hope my questions aren't too convoluted!
    Jesse

  • IMovie 6 HD - Export Movie Size Question

    There is a confusing list of movie export size options that I need to get your clarification about. Some of the selections seem to be similar.
    To see what I am referring to go into iMovie HD 6, under the SHARE menu, go to Save Movie For: Expert Settings Export Settings > Select Movie to QuickTime Movie (then hit the options tab to the right > Under the Video Section, select SIZE - note the Export Size Settings - DImensions drop down list. Note there are two sections. The last two items in the top section listed are (exactly worded as) 1280 x 720 HD and 1920 X 1080 HD. In the bottom section the last three entries are HD 1280 x 720 16:9, HD 1440 x 1080 16:9 and HD 1920 x 1080 16:9. What's the difference, for example, between the 1280 x 780 HD and the bottom one HD 1280 x 780 16:9? I ask because my HD camcorder movie footage (shot at 1080i, 29.97, 16:9) with an HV30 exports smooth at 1280x720 HD but jerky at HD 1280 x 780 16:9. They sound the same, but one is jerky and one smooth.
    The other question I have is 1440x1040 is 4:3 ratio. But it exports at 16:9 aspect ratio. I don't understand why.

    Donna:
    While I have a lot of video editing experience with an SD digital camcorder, the Canon HV30 HDV cam is new to me. So I am experimenting. That said, footage that will be shot will end up in a couple of places. Some of it will be passed onto my company's web master for posting to the web in some kind of Flash video format. Other video will be used in Keynote presentations as full screen video clips. Others will be used as source video for creating 4x3 SD clips for PowerPoint on a PC by others. So, the video will be used in different formats. (In what format to shoot is another question, but I have concluded (I hope correctly) that I should just shoot HDV 1080i since it seems to be the easiest to deal with for uploading to iMovie6 HD.)
    The purpose of my inquiry was to determine what the various selections are used for and what they do. Sometimes the video is jerky, sometimes an identical movie size is smooth (but must be rendered or processed differently). I was only trying to determine why there appeared to be repetative choices in the list of movie sizes as I mentioned in my original post. To be blunt, iMovie 6 HD documentation is spotty at best. The O"Reilly books don't cover the hard parts.

  • File Based Multithreaded Web Server Question

    Hi friends,
    I have the code of a simple File Based Multithreaded Web Server. I have been asked to add proper http/1.1 Keep-Alive behavior to it. As far as I understand it means to use the same socket for the request coming from the same client without opening a new socket for every request by it. I am unable to implement it. Any help would be greatly appreciated. The entire code is as below:
    package multithreadedwebserver.com;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    /** This Class declares the general and HTTP constants
    * and defines general static methods:
    class Constants {
    /** 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 Web server's virtual root directory */
    public static File root;
    static PrintStream log = null;
    /* Configuration information of the Web server is present
    * in this props object
    protected static Properties props = new Properties();
    /* timeout on client connections */
    static int timeout = 0;
    /* maximum number of worker threads */
    static int workerThreads = 5;
    /* General method for printing strings */
    static void printString(String s) {
    System.out.println(s);
    /* print logs to the log file */
    static void log(String s) {
    synchronized (log) {
    log.println(s);
    log.flush();
    /* print to the log file */
    static void printProperties() { 
    printString("\n");
    printString("#####################################################################");
    printString("\n");
    printString("Web server's virtual root directory= "+root);
    printString("Timeout on client connections in milliseconds= "+timeout);
    printString("Number of Worker Threads= "+workerThreads);
    printString("\n");
    printString("#####################################################################");
    printString("\n\n");
    printString("********************WEBSERVER STARTED SUCCESSFULLY********************\n");
    /* load server.properties from java.home */
    static void loadServerConfigurationProperties() throws IOException {
    File f = new File(System.getProperty("java.home")+"\\lib\\"+"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 + " Server Root Directory does not exist");
    r = props.getProperty("timeout");
    if (r != null) {
    timeout = Integer.parseInt(r);
    r = props.getProperty("workerThreads");
    if (r != null) {
    workerThreads = Integer.parseInt(r);
    r = props.getProperty("log");
    if (r != null) {
    log = new PrintStream(new BufferedOutputStream(
    new FileOutputStream(r)));
    /* Assign default values to root, timeout,
    * workerThreads and log if the same have
    * not been specified in the server.propwerties file
    if (root == null) {   
    root = new File(System.getProperty("user.dir"));
    if (timeout <= 1000) {
    timeout = 5000;
    if (workerThreads > 25) {
    printString("\n");
    printString("#####################################################################");
    printString("\n");
    printString("Too many Threads!!!Maximum number of Worker Threads can be 15 only");
    printString("\n");
    printString("#####################################################################");
    workerThreads = 15;
    if (log == null) {
    log = System.out;
    public class WebServer extends Constants {
    /* Specifying Default port for listening the requests */
    static int port = 8080;
    /* The Vector class implements a growable array of objects.
    * Like an array, it contains components that can be accessed using an integer index.
    * The size of a Vector can grow or shrink as needed to accommodate adding and
    * removing items after the Vector has been created.
    * The workerThreads are added to the Vector object threads where the worker threads stand idle
    * Vector is used since it is synchronized
    static Vector threads = new Vector();
    public static void main(String[] userSpecifiedPort) throws Exception {
    if (userSpecifiedPort.length > 0) {
    port = Integer.parseInt(userSpecifiedPort[0]);
    loadServerConfigurationProperties();
    printProperties();
    /* Instantiate ThreadPoool class and call
    * the createThreadPool() method on threadPool object
    ThreadPool threadPool= new ThreadPool();
    threadPool.createThreadPool();
    /* This class implements java.lang.Runnable.
    * It runs in a worker thread to process the request and serve files to the clients.
    class Worker extends WebServer implements Runnable {
    static final byte[] EOL = {(byte)'\r', (byte)'\n' };
    final static int BUFFER_SIZE = 2048;
    /* A byte array buffer to read and write files.
    * Memory is allocated to it once in the construtor of the class Worker
    * and reused thereafter
    byte[] buffer;
    /* Socket for the client being handled */
    private Socket socket;
    Worker() {
    buffer = new byte[BUFFER_SIZE];
    socket = null;
    synchronized void setSocket(Socket socket) {
    this.socket = socket;
    notify();
    public synchronized void run() {
    do {
    if (socket == null) {
    /* Wait */
    try {
    wait();
    } catch (InterruptedException e) {
    continue;
    try {
    handleClientRequest();
    } catch (Exception e) {
    e.printStackTrace();
    socket = null;
    Vector pool = WebServer.threads;
    synchronized (pool) {
    /* When the request is complete add the worker thread back
    * into the pool
    pool.addElement(this);
    }while(true);
    void handleClientRequest() throws IOException {
    InputStream is = new BufferedInputStream(socket.getInputStream());
    PrintStream ps = new PrintStream(socket.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.
    socket.setSoTimeout(WebServer.timeout);
    socket.setTcpNoDelay(true);
    /* Refresh the buffer from last time */
    for (int i = 0; i < BUFFER_SIZE; i++) {
    buffer[i] = 0;
    try {
    /* We will only support HTTP GET/HEAD */
    int readBuffer = 0, r = 0;
    boolean endOfLine=false;
    while (readBuffer < BUFFER_SIZE) {
    r = is.read(buffer, readBuffer, BUFFER_SIZE - readBuffer);
    if (r == -1) {
    /* EOF */
    return;
    int i = readBuffer;
    readBuffer += r;
    for (; i < readBuffer; i++) {
    if (buffer[i] == (byte)'\n' || buffer[i] == (byte)'\r') {
    /* read one line */
    endOfLine=true;
    break;
    if (endOfLine)
    break;
    /*Checking for a GET or a HEAD */
    boolean doingGet;
    /* beginning of file name */
    int index;
    if (buffer[0] == (byte)'G' &&
    buffer[1] == (byte)'E' &&
    buffer[2] == (byte)'T' &&
    buffer[3] == (byte)' ') {
    doingGet = true;
    index = 4;
    } else if (buffer[0] == (byte)'H' &&
    buffer[1] == (byte)'E' &&
    buffer[2] == (byte)'A' &&
    buffer[3] == (byte)'D' &&
    buffer[4] == (byte)' ') {
    doingGet = false;
    index = 5;
    } else {
    /* This method is not supported */
    ps.print("HTTP/1.0 " + HTTP_BAD_METHOD +
    " unsupported method type: ");
    ps.write(buffer, 0, 5);
    ps.write(EOL);
    ps.flush();
    socket.close();
    return;
    int i = 0;
    /* find the file name, from:
    * GET /ATG/DAS6.3.0/J2EE-AppClients/index.html HTTP/1.0
    * extract "/ATG/DAS6.3.0/J2EE-AppClients/index.html "
    for (i = index; i < readBuffer; i++) {
    if (buffer[i] == (byte)' ') {
    break;
    String filename = (new String(buffer, 0, index,
    i-index)).replace('/', File.separatorChar);
    if (filename.startsWith(File.separator)) {
    filename = filename.substring(1);
    File targ = new File(WebServer.root, filename);
    if (targ.isDirectory()) {
    File ind = new File(targ, "index.html");
    if (ind.exists()) {
    targ = ind;
    boolean fileFound = printHeaders(targ, ps);
    if (doingGet) {
    if (fileFound) {
    sendResponseFile(targ, ps);
    } else {
    fileNotFound(targ, ps);
    } finally {  
    // socket.close();
    System.out.println("Connection Close nahi kiya");
    boolean printHeaders(File targ, PrintStream ps) throws IOException {
    boolean ret = false;
    int responseStatusCode = 0;
    if (!targ.exists()) {
    responseStatusCode = HTTP_NOT_FOUND;
    ps.print("HTTP/1.0 " + HTTP_NOT_FOUND + " not found");
    ps.write(EOL);
    ret = false;
    } else {
    responseStatusCode = HTTP_OK;
    ps.print("HTTP/1.0 " + HTTP_OK+" OK");
    ps.write(EOL);
    ret = true;
    log("From " socket.getInetAddress().getHostAddress()": GET " +
    targ.getAbsolutePath()+"-->"+responseStatusCode);
    ps.print("Server: Simple java");
    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 fileNotFound(File targ, PrintStream ps) throws IOException {
    ps.write(EOL);
    ps.write(EOL);
    ps.println("The requested file could not be found.\n");
    void sendResponseFile(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(buffer)) > 0) {
    ps.write(buffer, 0, n);
    } finally {
    is.close();
    /* mapping file extensions to content-types */
    static java.util.Hashtable map = new java.util.Hashtable();
    void listDirectory(File dir, PrintStream ps) throws IOException {
    ps.println("<TITLE>Multithreaded Webserver</TITLE><P>");
    ps.println("<html><body align=center>");
    ps.println("<center><h3><font color=#9999CC>Simple File Based MultiThreaded WebServer</font></h3></center>");
    ps.println("<table border=1 align=center>");
    ps.println("<tr bgcolor=#9999CC><td width=100% height=100% align=center><h3>Directory Listing</h3></td>");
    ps.println("<td width=40% height=40% align=center><h3>Type</h3></td>");
    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("<tr><td>");
    ps.println("<font size=\""+"2"+"\"face=\""+"Verdana"+"\"> <A HREF=\""+list[i]+"/\">"+list[i]+"</A></font><a href=\""+list[i]+"/\"></a>\n<BR></td>");
    ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/folder.jpg"+"\"></img></a>");
    ps.println("</td");
    ps.println("</tr>");
    } else {
    ps.println("<tr><td>");
    ps.println("<font size=\""+"2"+"\" face=\""+"Verdana"+"\"></A> <A HREF=\""+list[i]+"\">"+list[i]+"</A></font><A HREF=\""+list[i]+"\"></A>\n<BR></td>");
    ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/file.gif"+"\"></img></a>");
    ps.println("</tr>");
    ps.println("</table>");
    ps.println("<P><HR><I><font color=blue>"+(new Date())+"</font></I>");
    ps.println("<I><font color=blue>Copyright to HCL Technology Ltd</font></I>");
    ps.println("<I><font color=blue>Author Vivek Kumar Sinha</font></I>");
    ps.println("</body></html>");
    The ThreadPool class contains a Vector of WorkerThread objects.
    These objects are the individual threads that make up the pool.
    The WorkerThread objects will start at the time of their construction.
    If there are more HTTP requests than there are WorkerThreads,
    the extra requests will backlog until WorkerThreads free up.
    class ThreadPool extends WebServer{
    void createThreadPool(){
    for (int i = 1; i <= workerThreads; ++i) {
    Worker w = new Worker();
    Thread t=new Thread(w, "Worker Thread No."+i);
    t.start();
    /* Uncomment to check the number of worker threads running */
    // printString("Worker Thread No."+i+" Started");
    threads.addElement(w);
    try{
    ServerSocket serversocket = new ServerSocket(port);
    do {
    Socket socket = serversocket.accept();
    Worker w = null;
    synchronized (threads) {
    if (threads.isEmpty()) {
    /* Do nothing */
    } else {
    w = (Worker) threads.elementAt(0);
    threads.removeElementAt(0);
    w.setSocket(socket);
    } while (true);
    } catch (IOException e) {
    e.printStackTrace();

    Thank you for Welcoming me!!! I am very new to this forum so din't have this idea.
    I am unable to add the keep alive behavior . I don't have problem with any part of the code. The problem is i don't know how to make that enhancement in the existing code.
    Regards

  • IMac (24-inch, Early 2009) Hard Drive Replacement: Hybrid and Maximum Size Question

    I have a 24-inch iMac, early 2009 model and the internal hard drive has died so am looking to replace it and also upgrade it in the process.
    At the moment the broken internal drive was the standard 1TB model that comes with the computer. I have been doing a little bit of research and I'm liking the sound of a hybrid drive as they seem to be a relatively economical was of achieving close to SSD speeds. I've been looking particularly at 'Seagate ST4000DX001 DESKTOP SSHD 4TB SATA 6GB/s NCQ NAND 8GB 64MB HYBRID' for the replacement. I guess my question is if this drive will work in the iMac. Does a hybrid drive present and problems? Also, is there a limit to the maximum size the replacement drive can be? Will 4TB exceed this limit? Lastly, I understand this drive uses SATA III to connect with the computer, which is backwards compatible (I think?) so I'm presuming this will work in my iMac?
    Thanks in advance.

    The hybrid drive will kinda sorta be as fast as an SSD. The newest Seagate Hybrid is quite intelligent about caching the most often used files in flash and is quite an improvement over the first iteration. I used both the first and second generation drives in my 2007 iMac and was quite impressed with their performance…until I installed an SSD. The problem with the hybrids is that they just don’t have enough flash and no matter how intelligent the drive is it is guesswork so sometimes you’ll find the drive access just as pokey as any other 5400 RPM drive and then other times very fast.
    For about $200 it is a decent upgrade but with SSD prices having dropped nearly 50% in the last 18 months it is worth considering a smallish internal SSD for the OS and applications and an external drive for data.

  • 8600 Premium won't auto-select tray based on page size

    I just bought the 8600 Premium yesterday, and am absolutely flabbergasted to find that this printer, which is TOUTED for its full capability of handling legal-sized paper can't pick different sizes of paper from Tray 1 and Tray 2 in the same print job!!!  The printer recognizes Tray 2.  In fact, if I remove Tray 1, it prints from Tray 2 just fine.  However, I print a lot of .pdf files with a mixture of letter- and legal-sized pages.  I have used other printers where I can select "Choose paper source by PDF page size," and it will print the whole job, pulling letter-sized pages from Tray 1 and legal from Tray 2.  Why MAKE the 8600 Premium with two trays if it CAN'T pull paper from both trays, based on size settings, during the same job?!!

    Seriously?  --That is your "solution?!"
    Sure, if I needed a $1,000 printer only, I guess I could do that.  But I don't.  I need an inexpensive, truly functional dual-tray all-in-one.  I thought the HP8600 Premium was it.  Guess not.

  • How can I show or hide an image based on screen size in CS6?

    I have a web site built using Dreamweaver CS6. I used the fluid grid layout to have different views for each of the 3 types - phone, tablet, desktop. It works well, resizes as it should. I would like to be able to show an image in the desktop version but not the mobile version. How could I do that? I can see in the .css file that different size screens can have their own different settings. Is there code I could add that would hide/show and image based on the users viewport on the same page? Let's say I have a div tag named picture. How could I add a parameter to the picture div tag in the style sheet that would hide the image if it was mobile?
    thanks,
    Marilyn

    Insert image into a container div.
    Desktop CSS:
    #divName {
    height: xxxpx
    width: xxxpx
    Tablet & Mobile CSS:
    #divName {display:none}
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Site that automatically resizes images based on browser size

    Hi. I need to make a site that automatically adjusts the size of the images based on the browser size, but keeps the image quality. Does anyone know how to do this without using flash?
    I basically want the site to perform like [http://www.shotview.com/|http://www.shotview.com/] . Thanks for your help.

    first time accessing website get screen size info using javascript and then redirect to next page and store screen size info into session. then, when requesting pictures from browser use custom servlet, mapped to image extension, that renders images to different resolution.

  • File size questions

    new to Apple MAC and iPhoto...so....I shot my new camera in jpeg, files are roughly 20mb...then I shot in RAW and after editing, the saved jpegs are ~ 5-10mb and up to 15mb....what happens to make this discrepency? how could my RAW converted jpegs be ~ 1/3 the size of straight out of camera jpegs?
    another question...iPhoto is 1.7 gb, my iPhoto Library size it 37gb, but my pictures in iPhoto total 17gb.....is the discrepecy due to stuff like Slideshows I created? Faces just is referring the files right, not making duplicate files?...having trouble wrappping my head around stuff I''m seeing that doesn't add up...
    thanks

    It's all a bit more complex that that. There is no correlation between file size and the quality of a shot. A well exposed shot of 2 or 3 mb will print just as well as a well exposed shot of 25mb. There is no difference in what gets printed. A poorly exposed shot of 25mb will print like garbage.
    It gets worse, we used to suggest a rule of thumb that printing at 300dpi was a reasonable giude to printing quality. Not any more. Printers and cameras have improved, iPhoto books are uploaded at something akin to 150 dpi.
    Again, a 3 mb jpeg will print exactly as well as a 30 mb tiff.
    Remember, the internet is full of high quality images that weigh in at a lot less than 500kb.
    Where file size comes into play is when you're using destructive editing on a lossy format, like Jpeg, and, as I said above, that doesn't come into play in a non-destructive editing system like iPhoto.
    The output from the export will - depending on the settings you use - either be smaller or larger than the jepg from a camera. It means very little - unless you're going to go an an edited destructively.

  • Font size based on screen size

    How to set different fonts for a textblock or for other controls in a page based on the screen resolution

    Additionally, a MSDN documentation for you:
    Supporting multiple screen sizes also
    Scaling to pixel density for your reference.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Down payments u2013 Credit Management, Sales Value FD32.

    Hi, We have a problem with the credit management in Down payments. The down payments requests are not decreasing the Sales Value of the client. I mean when I bill a down payment, the sales value of the client in transaction FD32 keep with the same va

  • Why is there a question mark in the Finder window?

    Why is there a question mark in the finder window that looks like this.     When I click the question mark in displays this message.                                                                                                                      

  • Itunes wont locate the most recent backup of my iPhone

    Hi I was having a few issues with my iphone 4s so synced it in itunes and backed it up then put phone into DFU mode to reinstall the firmware 5.0.1. then went back to itunes and in the drop down list of "restore from backup" i couldnt see the backup

  • Error: The task could not be successfully executed.

    I am working on a project that is using ALBPM 6.0 Studio for local development. During the local (PC) process execution of Interactive items, ComponentExecutionException is encountered sporadically. The details of the error message given in the brows

  • Why doesn't applecare cover the bottom case pads?

    Hi, this is a question I should have just asked at my appointment, but I was in a real rush to get to work, so I just accepted it and went on, but anyway: One of the little black pads the macbook pro rests on to avoid heat collection fell off my comp