Help me in a simple problem

hi my program is on a proxy server it will be lisenting in port 9876
i have configured in a way that all browsers request pass thro this proxy server
so when user request for www.yahoo.com in the browser the
resquest is passed 2 this proxy server. so i got the host name and created a socket.
i read all the request that has come from the browser such as "GET www.yahoo.com HTTP/1.1 ,,"
I got the outputstream for the remote socket and i passed all these request to the remote host.. but i could nt get any response frm server can any one help me out?
i was just testing my program to satisfy a request from only one web browser
===
import java.io.*;
import java.net.*;
class Proxyserver
ServerSocket ser;
Socket myclient;
BufferedReader br;
String cf1="\r\n",cf2="\r\n\n",lf="\n";
OutputStream o_remote;
public Proxyserver()
try
ser=new ServerSocket(9876);
myclient=ser.accept();
// read inital requst from browser
br=new BufferedReader(new InputStreamReader(myclient.getInputStream()));
String req=br.readLine();
String temp=req;
int val=temp.indexOf((int)'/',11);
String host=req.substring(11,val);
//connect 2 host
Socket remote=new Socket(host,80);
System.out.println(remote.toString());
o_remote=remote.getOutputStream();
while(req!=null)
System.out.println(req);
o_remote.write(req.getBytes(),0, req.length());
o_remote.write(cf2.getBytes());
o_remote.flush();
req=br.readLine();
o_remote.write(lf.getBytes());
o_remote.write(lf.getBytes());
o_remote.flush();
// wait for response from remote server
InputStream in=remote.getInputStream();
int response=in.read();
while(response!=-1)
System.out.println((char)response);
response=in.read();
//close all sockets
remote.close();
myclient.close();
ser.close();
}catch(Exception e){}
public static void main(String a[])
new Proxyserver();
===
op i got all the req from the broswer and wrote 2 op stream of remote server but i could nt get the response
==
output"
Socket[addr=javaworld.com/130.94.4.230,port=80,localport=3225]
GET http://javaworld.com/ HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)
Host: javaworld.com
Proxy-Connection: Keep-Alive

Don't do cross posting on public fora. That's worst manner.
See: http://forum.java.sun.com/thread.jspa?threadID=718641
but i could nt get any responseYou can surely get full response. Try my code.

Similar Messages

  • Help to solve this simple problem- please

    Hi !
    Is there any method to resolve this problem.
    In my db there are 2 tables called Employee and Insurance. There fields as follows.
    Employee(empno,name,age,address,phone)
    Insurance(empno,insurName,insurCompany)
    Now I want to do this.In my HTML form,there are textboxes to input all of these data.
    Eg: empno,name,age,address,phone,insurName,insurCompany (All of these enter into 1 form)
    Now my problem is, how to save these data into the 2 seperate tables by using PreparedStatement.See am I right?
    INSERT INTO Employee,Insurance VALUES (?,?,?,?,?,?,?);
    Is it right? I'am confusing about these para's, because how can I tell to insert that first para (empno) into 2 tables.
    I using Java2 SDK,JSP,TOMCAT with MySQL db for this.
    Please anyone can answer this, help me.

    No, you need one INSERT statement for each table.

  • Need help should be a simple problem

    I'm trying to run my first webservice,
    on tomcat/axis, linux java 1.3.1_08
    I'm trying out example2 in $AXIS_HOME/samples/userguide/example2/
    the wsdl comes up as below:
    When I try and run the client
    java samples.userguide.example2.CalcClient -p8080 add 2 5
    In the $AXIS_HOME/samples/userguide/example2/ directory I get the following error
    [Me example2]$ java samples.userguide.example2.CalcClient -p8080 add 2 5
    Exception in thread "main" java.lang.NoClassDefFoundError: samples/userguide/example2/CalcClient
    [Me example2]$
    an ls -l shows there is a CalcClient class at that location
    my classpath is as follows echo $CLASSPATH
    foo/axis-1_1RC2:foo/axis-1_1RC2/lib/axis.jar:foo/axis-1_1RC2/lib/commons-logging.jar:foo/axis-1_1RC2/lib/axis.jar:foo/axis-1_1RC2/lib/commons-logging.jar:foo/axis-1_1RC2/lib/jaxrpc.jar:foo/axis-1_1RC2/lib/log4j-1.2.4.jar:foo/axis-1_1RC2/
    lib/wsdl4j.jar:foo/axis-1_1RC2/lib/xerces.jar:foo/junit3.8.1/junit.jar
    ANY IDEAS PLEASE HELP
    http://127.0.0.1:8080/axis/Calculator.jws?wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://127.0.0.1:8080/axis/Calculator.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://127.0.0.1:8080/axis/Calculator.jws" xmlns:intf="http://127.0.0.1:8080/axis/Calculator.jws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:message name="addRequest">
    <wsdl:part name="i1" type="xsd:int"/>
    <wsdl:part name="i2" type="xsd:int"/>
    </wsdl:message>
    <wsdl:message name="subtractResponse">
    <wsdl:part name="subtractReturn" type="xsd:int"/>
    </wsdl:message>
    <wsdl:message name="addResponse">
    <wsdl:part name="addReturn" type="xsd:int"/>
    </wsdl:message>
    <wsdl:message name="subtractRequest">
    <wsdl:part name="i1" type="xsd:int"/>
    <wsdl:part name="i2" type="xsd:int"/>
    </wsdl:message>
    <wsdl:portType name="Calculator">
    <wsdl:operation name="add" parameterOrder="i1 i2">
    <wsdl:input message="intf:addRequest" name="addRequest"/>
    <wsdl:output message="intf:addResponse" name="addResponse"/>
    </wsdl:operation>
    <wsdl:operation name="subtract" parameterOrder="i1 i2">
    <wsdl:input message="intf:subtractRequest" name="subtractRequest"/>
    <wsdl:output message="intf:subtractResponse" name="subtractResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="CalculatorSoapBinding" type="intf:Calculator">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="add">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="addRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1:8080/axis/Calculator.jws" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="addResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1:8080/axis/Calculator.jws" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="subtract">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="subtractRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1:8080/axis/Calculator.jws" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="subtractResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1:8080/axis/Calculator.jws" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="CalculatorService">
    <wsdl:port binding="intf:CalculatorSoapBinding" name="Calculator">
    <wsdlsoap:address location="http://127.0.0.1:8080/axis/Calculator.jws"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    so I've added .
    like so
    [Me example2]$ setenv CLASSPATH "$CLASSPATH":.
    SO NOW THE CLASSPATH IS
    echo $CLASSPATH
    foo/axis-1_1RC2:foo/axis-1_1RC2/lib/axis.jar:foo/axis-1_1RC2/
    lib/commons-logging.jar:foo/axis-1_1RC2/lib/axis.jar:foo/axis-1_1RC2/
    lib/commons-logging.jar:foo/axis-1_1RC2/lib/jaxrpc.jar:foo/axis-1_
    1RC2/lib/log4j-1.2.4.jar:foo/axis-1_1RC2/lib/wsdl4j.jar:foo/axis-1_1RC2/
    lib/xerces.jar:foo/junit3.8.1/junit.jar:.
    I ran it from Axis_home and got a similar message
    [Me ~]$ cd $AXIS_HOME
    [Me axis-1_1RC2]$ java samples.userguide.example2.CalcClient -p8080 2 5
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/utils/Options
    at samples.userguide.example2.CalcClient.main(CalcClient.java:68)
    Any more ideas Please it's so important that I get this working as soon as possible

  • Please help me with somewhat simple problems

    Hi,
    I'm being asked to produce a 90 second "movie/commercial" that will be put on youtube.  I've used Motion 4 to create using just text and jpg pictures.  I've imported these various scenes into Final Cut Pro and have added transitions and edited.  When I'm not playing the movie from the timeline, the text and pictures are crystal clear.  After rendering, when I play the timeline, all the pictures and text are fuzzy.  I thought that once I exported the video, it would look clear...but it doesn't.  Can somebody give me some direction on what I need to do so that everything looks clear?  It doesn't have to be HD quality...just clear.  I don't have a lot of experience with Final Cut as I have been using Adobe Premiere Elements for the last 5 years.  Its getting very frustrating.
    Thanks
    Greg

    The white background you are selecting is only a tool to help view the image in the canvas. It does not actually place a background in your sequence. To have a white background, click on the Generator Button ( lower right corner of the Viewer window with an "A" on it) and from the drop down menu, choose Matte > Color. This will load a solid color into the viewer. Click on the Controls tab in the viewer and adjust it to the color you want - in this case white.
    Next, on your sequence, if you don't already have an available Video track above your edited clips, then add one by control-clicking on the space above V1 and select Add Track:
    This will add another track:
    Select your video clips on V1, and move them directly up to V2 by selecting them, then clicking down and dragging the selected clips up to V2 so that V1 becomes empty:
    And then edit the color you have in the viewer to V1:
    Now you will have a White background behind what ever is on the higher Video Tracks. If you have a long edit, you may need to edit the white color a couple times to make it run the length of the edit.
    MtD

  • Help me with this simple problem

    class Sample
         static String m(float i)
              return "float";
         static String m(double i)
              return "double";
         public static void main (String[] args)
              int a1 = 1; long b1 = 2;
              System.out.print(m(a1)+","+ m(b1));
    }On running the above program, it responds with float,float .
    Can anyone tell why ???
    Regards,
    Pradhip

    there are specific rules for finding the right type, i think it might be under "conversions" in the JLS? You can find the JLS here:
    http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html

  • Very Simple Problem-- Need help in method selection process

    Hello,
    It's difficult to explain the background of the program I am making-- but I am stuck at a very simple problem, that I can only solve with a very long block of if statements:
    I have 3 possible numbers-- 1, 2, or 3.
    Imagine two numbers are already taken-- say 1 and 2. I want a variable to set itself to the number that's not taken (3).
    So, again: If two numbers were taken say 2 or 3-- I want the variable to be sent to the other one that isn't taken-- 1.
    Thank you for your help,
    Evan.

    Actually, I'll just tell you the context of the program-- here is what I have so far:
    This program is meant to simulate Monty Hall Problem:
    http://en.wikipedia.org/wiki/Monty_Hall_problem
    The program sets up an array of three possible values. Each one of those values represents a door with either a goat or a car behind it. It then randomly sets one of those values to 1 (in order to represent a car as per the Monty Hall problem), and 0's represent goats.
    The user, which is simulated by the program (does not involve actual interaction), chooses a door initially.
    The game show hosts then reveals a door that is not the users initial choice, but IS a goat ( an array value of 0).
    For example if the array was [0][0][1]
    The user could pick door one (array position 0). Which is a goat.
    The game show host then reveals a goat that is not the users choice-- which would be array position 1.
    After the game show host reveals the goat-- I want the user to always switch his decision to the only other remaining door that was not his first choice.
    Then I wanted the computer to test to see if his final choice is the one with a car. And to tally up the amount of times he got it right.
    --Sorry that was long winded:
    import TerminalIO.*;//imports TerminalIO package for system.out.println
    import java.util.*;//import java.util for random
    public class Monty_Problem
         int doors[]= {0,0,0};
         Random rand= new Random();
         double wins,totals=0;
         public void carAssignment()
              int car_door= rand.nextInt(3);
              doors[car_door]=1;
         public int judgesChoice(int judgeDoor, int initialChoice)
              if(judgeDoor != initialChoice && doors[judgeDoor]!=1)
                   return judgeDoor;
              else
                   return judgesChoice(rand.nextInt(3), initialChoice); //infinite loop right here that I cannot remedy.  I want the program to have the judge pick a location that is not occupied by a  '1' and is not the user's choice. 
         public void gamePlaySwitches()
              int initialChoice= rand.nextInt(3);
              int judgeDoor = 0;
              int secondChoice= 0;
              judgeDoor= judgesChoice(rand.nextInt(3), initialChoice);
              //This part is meant to have the user switch choices from his initial choice
                   // to the only other choice that hasn't been revealed by the judge. 
              while(secondChoice == initialChoice || secondChoice== judgeDoor)
                   secondChoice++;
              if(doors[secondChoice]==1)
                   wins++;
                   totals++;
              else
                   totals++;          
         public static void main(String [] args)//creates the main menu
              Monty_Problem a= new Monty_Problem();
              int games=0;
              while(games!=100)
                        a.carAssignment();
                        a.gamePlaySwitches();
                        games++;
              System.out.println(a.wins/a.totals);
    }Edited by: EvanD on Jan 11, 2008 4:17 PM

  • Pls i need help for this simple problem. i appreciate if somebody would share thier ideas..

    pls i need help for this simple problem of my palm os zire 72. pls share your ideas with me.... i tried to connect my palm os zire72 in my  desktop computer using my usb cable but i can't see it in my computer.. my palm has no problem and it works well. the only problem is that, my  desktop computer can't find my palm when i tried to connect it using usb cable. is thier any certain driver or installer needed for it so that i can view my files in my palm using the computer. where i can download its driver? is there somebody can help me for this problem? just email me pls at [email protected] i really accept any suggestions for this problem. thanks for your help...

    If you are using Windows Vista go to All Programs/Palm and click on the folder and select Hot Sync Manager and then try to sync with the USB cable. If you are using the Windows XP go to Start/Programs/Palm/Hot Sync Manager and then try to sync. If you don’t have the palm folder at all on your PC you have to install it. Here is the link http://kb.palm.com/wps/portal/kb/common/article/33219_en.html that version 4.2.1 will be working for your device Zire 72.

  • HELP! i got a problem with my mobo 945GCM7-L

    HELP! i got a problem with my mobo 945GCM7-L
    specs;
    *mobo = MSI 945GCM7-L(MS-7507) driver installed
    *cpu = Intel Pentium E2180, LGA 775
    *BIOS = american megatrends version 3.1
    *sdram = DDR 2 1Gb
    *GPU = sparkle/ nvidia 8500gt ddr2 1Gb128 bit (direct X9.0c and driver installed)
    *HDD = seagate sata 80Gb (3Gb speed enabled 'no jumper')
    *OS = XP PRO SP2
    PROBLEM:
    *sometimes it just hang-up (one application only) like a simple Microsoft word 2007.
    *while playing DOTA (LAN gaming) = in just a couple of minutes you will experience a lagged then suddenly you'll be disconnected from the game
    Isolation:
    change the SDRAM with lower and higher RAM = same problem
    change the GPU with higher and lower model (driver installed) = same problem
    cable connection + good connection = same problem
    take note;
    I GOT 4 UNITS WITH THE SAME SPECS = 4 UNITS WITH THE SAME PROBLEM
    NOW WHAT???

    Does it hang using the onboard VGA?  Try with prime 95 or orthos for stability testing, what spec are your psus?
    You could try the v3.2 BIOS but I'm not sure it will help you.

  • A Simple problem I`m sure BUT ITS DRIViNG ME CRAAAZY!

    Hello,
    I hope someone can help.
    I published a site with the first podcst episode using iweb.It went through onto iTunes bo problem so all`s good... so today I put together the 2nd episode, submit it to itunes as before...up comes the `..please provide the link to the podcast RSS feed ...' etc
    Podcast Feed URL:http://rss.mac.com/jubemeg/iWeb/Bandwagon/podcast/rss.xml is the address I`m given as with the first episode, I press continue and ....Unfortunatly THE FEED HAS ALREADY BEEN SUBMITTED.Course it has! Help!
    I have looked through the tech specs and I cant make head nor tail of it can someone help me in real basic layman language!
    Thank you,
    Jules

    Jules, it's a simple problem with a simple fix. (and it drove me nuts too)
    Publish to .Mac (or your server if it's different)... then PING itunes to let them know to go look for new content on your server (or .Mac). You PING iTunes by cutting and pasting the url addy below into safari and clicking return. You'll get an error message, don't worry, it's supposed to happen. About an hour later, maybe a bit longer, your new episode will be available.
    DONT submit your podcast by selecting the "SUBMIT PODCAST TO ITUNES" menu selection again. That command is for your first submission, not your subsequent ones. Think of your podcast as a book. And each episode is a chapter. When you ping iTunes, they go get the whereabouts of the new chapter and make it available for the world to come and read, hear, or watch.
    the PING url is...
    https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=INSERTYOURFE EDIDHERE
    Your feed ID number is in your original email from the itunes folks when they sent you your acceptance email and said that your podcast was now up and running on the ITMS.
    Hope this helps.
    Jim
    20" Imac 1ghz (lmpstd), Mini, G4 Dual 1.8(upgraded), G4 400, Powerbook,12", eMac   Mac OS X (10.4.4)  

  • A simple problem to solve... I hope.

    $A simple problem to solve... I hope. Hi Guys,
    This is my first post on this forum, and I'm hoping that the problem I'm encountering at the moment is down to my own stupidity rather than technical issues.
    Firstly, I should mention that I have used my X-fi sound blaster xtreme audio card for months now in my old PC which was running XP 32 bit with no problems whatsoever. In the last day I've built a new PC which has the following specs:
    Intel I7 860
    tb HDD
    4gb Ram
    Windows 7 Ultimate 64
    Nvidia GTX280
    Sound was very quiet and of a fairly poor quality to begin with, and I soon realised that I hadn't installed any drivers for the soundcard, so I went ahead and did so. Following this, I enter a **bleep**storm of illogical proportions which to me makes absolutely no sense.
    I get no sound from my speakers or headphones whatsoever. I have a pair of M-Audio AV-40 monitors at the moment, and no matter what I try, I can't get sound to work. When I go to the mixer, it seems odd to me
    http://yfrog.com/7fxfiproblemj
    I thought that there would be options for Line Outs etc, but I may be wrong.
    I've run the diagnostic tests and everything comes back absolutely fine.
    The weirdest thing however is the fact that when I test the speaker configuration, it responds to nothing except from the 7. surround sound, and my speakers react to the bottom left and bottom right speakers. I've tried installing, re-installing drivers no end. Looked for fixes and checked google as well and found nothing that matches the description of my problem.
    Am I missing out on something really obvious here? Or is there a more technical underlying factor ?behind this issue.
    Any help is hugely appreciated, thanks?

    Thanks for all of you help, but I still don't think the problem's solved.
    Here's the problem explained more thouroloy. I have a java program that uses lots of jar files. That means that to run my program, I need to have the CLASSPATH set to pick up all of these jar files. I'd also like to be able to give someone a copy of this program on a cd and have them immediately run it without having to assume anything about their configuration (except that they have java installed).
    So what I did was create a batch file that (at least temporarily) sets up the CLASSPATH to meet my needs. It then calls "java myProgram <all the other parms...>".
    Things run fine, except that the command window that gets opened up stays around while Swing program runs, and doesn't close until I close the Swing program. I'd like that that didn't happen.
    -- echo off
    Not going to do anything to help. It will stop the batch commands from echoing, but that's about it.
    -- javaw
    I tried this and it also doesn't work. It seems that neither java nor javaw return until after the program that it is running actually end.
    -- Executable jar
    Sounds promising, but will it work? How do I make sure the CLASSPATH is properly set before running this?
    Thanks again for all of your hlep.
    Sander Smith

  • Help me sort out the problems with Java 2 SDK SE

    I install Java SDK 2 standard Eddition version 1.4 in my computer (Window NT4). When I test the installation by typing in "java -version", it displays the following message.
    C:\JavaPractice>java -version
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    But, When I compile a simple programme, it doesn't work and displays the following message.
    C:\JavaPractice>javac HelloDan.java
    The name specified is not recognized as an
    internal or external command, operable program or batch file.
    Could anybody help me sort out the problem, Please?

    i might guess that you have j2sdk1.4.0\jre\bin on your PATH, but not j2sdk1.4.0\bin ...
    Larry

  • Xfce4 file associations simple problem

    Can anyone help me with some simple file association problems in xfce4?
    whenever I click a link, it tries to launch the GNOME Web Browser, and I get the following message:
    Could not start GNOME Web Browser
    Startup failed because of the following error:
    Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)
    I've set the preferred application to Opera in the Settings menu, but no difference.
    Additionally, can anyone point to somewhere explaining how to write custom commands for opening files in thunar. For example, it doesn't recognise .torrent files, and I'd like to launch them in Azureus when I click on them.
    Any help appreciated!

    soylent_green_is_hamster wrote:
    run dbus-launch gnome web browser
    this produces the following error
    Couldn't exec web: No such file or directory
    about the thunar question if u right click a .torrent file and open it with azureus theres a tick which is ticked by default to open these files every time with azureus.
    yeah - but azureus isn't listed as one of the  applications I can pick from. Not sure what to do...
    errm ...
    dbus-launch NAME_OF_BROWSER_EXECUTIVE
    edit: u could always edit the menu or make a custom link adding the command for example dbus-launch FOO instead of just FOO
    about azureus: add it manually using a custom command..

  • Help needed with a simple CompareTo sorting method

    This code is supposed to sort through a list of random numbers, dates, and strings to find the largest. The problem is that with the strings it just sets the first string in the array to the largest, and I'm really not sure why it's doing it...Any help would be appreciated. I am aware that this is a very simple problem..No need to tell me. ^_^;
    import java.util.Date;
    public class CompareToSort {
      public static void main(String[] args) {
    String[] strings = {"CS", "Math", "Biol", "Chem", "Phys", "Buss", "Law", "Educ", "Elec Engr", "Mech Engr"} ;
    Integer[] list = new Integer[10] ;
    Date[] dates = new Date[10] ;
    for (int i = 0; i < list.length; i++)
          list[i] = new Integer((int)(Math.random() * 100));
    for (int i = 0; i < list.length; i++)
          dates[i] = new Date();
    System.out.println("Max string is " + max(strings));
    System.out.println("Max integer is " + max(list));
    System.out.println("Max date is " + max(dates));
    public static Object max (Object[] a)
      Object currentMax = null;
      int currentMaxIndex;
      for(int i = a.length - 1; i>=0; i--)
         currentMax = a;
    currentMaxIndex = i;
    for (int j = i - 1; j >=0; j--)
    if (((Comparable)currentMax).compareTo(a[j]) < 0)
    currentMax = a[j];
    currentMaxIndex = j;
    return currentMax;

    I think your ten Dates are all same.
    import java.util.Date;
    public class CompareToSort {
      public static void main(String[] args) {
        String[] strings
         = {"CS", "Math", "Biol", "Chem", "Phys", "Buss", "Law", "Educ",
            "Elec Engr", "Mech Engr"} ;
        Integer[] list = new Integer[10] ;
        Date[] dates = new Date[10] ;
        for (int i = 0; i < list.length; i++){
          list[i] = new Integer((int)(Math.random() * 100));
        for (int i = 0; i < list.length; i++){
          dates[i] = new Date();
        System.out.println("Max string is " + max(strings));
        System.out.println("Max integer is " + max(list));
        System.out.println("Max date is " + max(dates));
      public static <T extends Comparable<T>> T max (T[] a){
        T currentMax = a[0];
        for(int i = 1; i < a.length; ++i){
          if (a.compareTo(currentMax) > 0){
    currentMax = a[i];
    return currentMax;

  • Who can help to make a simple direct change in AP Database (search/replace)

    Hi,
    I wonder if somebody can help me with a simple search and replace direct in the AP Database??
    After the last upgrade to 1.5. our keywords are not exported correctly.
    Is there any easy way to search for ";" and replace with a comma ",".
    I have about 9000 Image in one AP library, which included 3 Projects.
    I really would appreciate help - it would save us a lot of work!
    Thanks

    I believe we found the problem - but could not fix it because I need to search/replace in the Database.
    Here is the problem:
    AP is now confirm with the IPTC guidelines, which limits ONE Keyword to 64 characters.
    Problem is and was for us that we did a work around in AP 1.2. - we exported keywords and phrases separated by a semicolon - so everything was fine till the update - no all it sudden AP exports kw1;kw2;kw3; as ONE Keyword - so the semicolon does not separate the keywords anymore and after 64 characters it cuts of.
    I have to replace all "semicolons" with a "semicolon+empty space" (to get it into our database) or at least replace "semicolon" with "comma+empty space".
    We have several librarys and projects, all keyworded with about 20-40 keywords which we can´t export.
    I need to go direct in the database and do a search and replace - but I never worked direct in the AP Database - any idea how we can do a search/replace???
    Would very much appreciate if you could help!
    Thanks

  • I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you

    Hello, how are you?
    I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you can help me
    I happened to create a movie clip and inside to create a scroll that is two isntancias,
    I mean:
    in the first frame create a button in the 6 to 5 buttons and an action to melleve the sixth frame and another to return. (Elemental truth)
    Now I have a problem. In creating a movie clip instance name to each button and in the average place the next fram as2,
    boton.onRollOver name = function () {
           gotoAndStop ("Scene 1", "eqtiqueta");
    because what I want is that from inside the movie clip, go to the scene proncipal to a frame that is three in the label name.
    however, does not work.
    appreciate your cooperation.
    Escuchar
    Leer fonéticamente
    Diccionario - Ver diccionario detallado

    Hello, I think you need to start a discussion on the Action Script forum. This is the Flash Player forum, the browser plugin.
    Thanks,
    eidnolb

Maybe you are looking for

  • I am not able to connect my icloud from my iphone

    Hi there, I have just updated my IOS to IOS 7, and when it was completed, I was asked to Accept the new Agreement for ICLOUD.. But when i was trying to reach there, it was unavalaible, so, I deleted my icloud account, and try to resign-in.. And until

  • External (outside display clock) will not show

    I upgrade my operating system on Blackberry.com. Now the external display on the flip is the t-mobile logo. I tried fixing it in the "clock settings" under "clock face," but that didn't do it. Does anyone have any ideas how to change it back to the c

  • Service cancellation fee

    I need to cancel our service. We have 4 lines, all being smartphones. How do I do it? I'm SURE Verizon charges a cancellation fee, ha!

  • Content server Migration 7.6 to 7,8

    Hi Experts, we have two SAP content servers: - An old one Win2k3 (32bit) with MaxDB 7.6.00.18 and nearly 200GB of data - A new Win2008R2 server (64bit) with SAP MaxDB 7.8.02.29 and 150GB of data We´d like to move all data from the old 7.6 DB onto the

  • JTA - many tlogs being produced but with 0 bytes

    Hi there, We have an old application running on WebLogic 6.1. At the moment we experiencing hundreds of 'myserver_xxxx.tlog' files (with a zero size) being created every day which is causing disk directory problems. The Weblogic documentation (well 8