Help needed- Check hardware with java

Hi everyone:)
I'm working on a colledge project and i need to know if anybody knows a way to check hardware's capabilities using java, i.e. i want to use java to check if a machine can play a sound clip, or has enough free space, etc...
Can someone please point me some clues on how to get there (prefeberably using J2ME)?
Thanks in advance,
Pedro

Download the SAP Java connector (JCo).
This has documentation and sample code to get you started.

Similar Messages

  • Help needed, segmentation fault with java 1.6

    Hey, I would very much appreciate help with this problem.
    It began a while ago, while I was using Netbeans 6.5 to do some Java Server testing stuff, I was running Adobe Flash on top (working on some WSDL stuff), and the computer was understandable running a bit slowly. However, it got to the point where the computer stopped responding, even with me killing apps as often as possible to conserve memory (1 GB on this machine) and I was forced to kill the machine by holding down the power button (using a white MacBook). When I started up once more, java 1.6 was dead, no amount of re-installs seemed to be helping when I tried downloading the Java Updates from Apple, though java 1.5 seemed to be working at that time. However, poking around in the console and looking at the logs, I noticed that launchd[1] was failing every 10 seconds to start something up, it looked like it was the apache http server, therefore I went to System Preferences to turn of Web Sharing, and that particular problem disappeared. However, whenever I would attempt to run java, even using the Terminal, I would get this Console log, or at least one very similar (this one was generated with java 1.5 I believe)
    Process: java [7217]
    Path: /usr/bin/java
    Identifier: java
    Version: ??? (???)
    Code Type: X86-64 (Native)
    Parent Process: bash [7208]
    Date/Time: 2008-12-13 10:41:23.197 -0500
    OS Version: Mac OS X 10.5.5 (9F33)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGSEGV)
    Exception Codes: 0x000000000000000d, 0x0000000000000000
    Crashed Thread: 0
    Thread 0 Crashed:
    0 libSystem.B.dylib 0x00007fff80e57164 strcmp + 84
    1 libobjc.A.dylib 0x00007fff8000b23f _selregisterName + 49
    2 libobjc.A.dylib 0x00007fff8000ab46 map_images + 3757
    3 dyld 0x00007fff5fc04130 dyld::notifyBatchPartial(dyldimagestates, bool, char const* (*)(dyldimagestates, unsigned int, dyldimageinfo const*)) + 416
    4 dyld 0x00007fff5fc048fd dyld::registerImageStateBatchChangeHandler(dyldimagestates, char const* (*)(dyldimagestates, unsigned int, dyldimageinfo const*)) + 525
    5 libSystem.B.dylib 0x00007fff80e56472 dyldregister_image_state_changehandler + 88
    6 libobjc.A.dylib 0x00007fff8000954f objcinit + 38
    7 dyld 0x00007fff5fc11257 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 279
    8 dyld 0x00007fff5fc0d16c ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 268
    9 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    10 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    11 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    12 dyld 0x00007fff5fc0d254 ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 52
    13 dyld 0x00007fff5fc038b4 dyld::initializeMainExecutable() + 132
    14 dyld 0x00007fff5fc06eb1 dyld::main(machheader const*, unsigned long, int, char const**, char const**, char const**) + 2209
    15 dyld 0x00007fff5fc01695 dyldbootstrap::start(mach_header const*, int, char const**, long) + 693
    16 dyld 0x00007fff5fc0103a dyldstart + 42
    Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x00000000000008a0 rbx: 0x00007fff80018760 rcx: 0x0000000000005722 rdx: 0x000000000000008a
    rdi: 0x00007fff80018760 rsi: 0x0c00004806000038 rbp: 0x00007fff5fbfdbc0 rsp: 0x00007fff5fbfdba8
    r8: 0x00000000c5a8037d r9: 0x0000000068e33de7 r10: 0x00000000bcafe771 r11: 0x0000000000000001
    r12: 0x0c00004806000038 r13: 0x0000000000000001 r14: 0x0000000000000001 r15: 0x000000000000001d
    rip: 0x00007fff80e57164 rfl: 0x0000000000010202 cr2: 0x00007fff7002f9f0
    Binary Images:
    0x100000000 - 0x10000afe0 +java ??? (???) <53c91321e79d660f62c011f5d8625a7f> /usr/bin/java
    0x100010000 - 0x100018ffd com.apple.JavaVM 12.2.0 (12.2.0) <2b178e8d4bbcc0aa427c2f3f71bb2fcb> /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
    0x7fff5fc00000 - 0x7fff5fc2e593 dyld 96.2 (???) <b0570939de4a19f478c8eabab95aaaee> /usr/lib/dyld
    0x7fff80003000 - 0x7fff800f7fff libobjc.A.dylib ??? (???) <118dc1ae05e685ad64290352fc94f1f0> /usr/lib/libobjc.A.dylib
    0x7fff80199000 - 0x7fff801aaffd libz.1.dylib ??? (???) <f260db32dd97a14108a5e04184785ded> /usr/lib/libz.1.dylib
    0x7fff801ab000 - 0x7fff801e8ff7 com.apple.SystemConfiguration 1.9.2 (1.9.2) <3e058b95c78dc2f54ec3f9781bd86e1c> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x7fff801e9000 - 0x7fff80239fe7 com.apple.Metadata 10.5.2 (398.22) <1fc60b4568a7ffbec4273f656d61ab58> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x7fff808c2000 - 0x7fff80957ffb com.apple.LaunchServices 290 (290) <b5b494e44b291a782bee370a046d5727> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/LaunchServices
    0x7fff80a31000 - 0x7fff80a39ffa libbsm.dylib ??? (???) <4d838c0d8a74fe61c781a53a8723303d> /usr/lib/libbsm.dylib
    0x7fff80a3a000 - 0x7fff80a6cff7 libauto.dylib ??? (???) <cc8eece8c0097b254c758bd4e8df9537> /usr/lib/libauto.dylib
    0x7fff80e4d000 - 0x7fff80fd1ffb libSystem.B.dylib ??? (???) <8e3de87ccdf6c4606b9bcb9da3a33eda> /usr/lib/libSystem.B.dylib
    0x7fff80fd2000 - 0x7fff81046fe7 libstdc++.6.dylib ??? (???) <565ee6f798f7fef6f804c60682787280> /usr/lib/libstdc++.6.dylib
    0x7fff81075000 - 0x7fff81106fff com.apple.SearchKit 1.2.1 (1.2.1) <e2a25e04f281fe8ff7088a08a549020f> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x7fff81107000 - 0x7fff8119bfe3 com.apple.CFNetwork 339.5 (339.5) <6e912954955e0af0e0defb59cc2c348a> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x7fff814b5000 - 0x7fff814dcfff libxslt.1.dylib ??? (???) <22a74e7859cfbf63ae7fc310b0a669a4> /usr/lib/libxslt.1.dylib
    0x7fff82112000 - 0x7fff82249fff com.apple.CoreFoundation 6.5.4 (476.15) <4b970007410b71eca926819f3959548f> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff8224a000 - 0x7fff8224affa com.apple.CoreServices 32 (32) <c12e589173b697ce88050a6f736549eb> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff830ae000 - 0x7fff830edfef com.apple.framework.IOKit 1.5.1 (???) <56d5528f3623ad4d9c68751018e658c3> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff832b0000 - 0x7fff83360fef com.apple.CoreServices.OSServices 226.5 (226.5) <4461ef69cec249de2315c88e83d4c904> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x7fff83465000 - 0x7fff835d3fff libicucore.A.dylib ??? (???) <25557e76cafa3f8a97ca7bffe42e2d97> /usr/lib/libicucore.A.dylib
    0x7fff835d8000 - 0x7fff835dcfff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib
    0x7fff835f5000 - 0x7fff8360dfff com.apple.DictionaryServices 1.0.0 (1.0.0) <78ea11e9a92120f76d69efa24b8d1f95> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Diction aryServices.framework/Versions/A/DictionaryServices
    0x7fff836a5000 - 0x7fff8379afff libxml2.2.dylib ??? (???) <8226d1180354f493954c5fa1fc0e1154> /usr/lib/libxml2.2.dylib
    0x7fff8379b000 - 0x7fff837a1fff com.apple.DiskArbitration 2.2.1 (2.2.1) <e75fe224700767869227cc903bef8ed9> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff8387a000 - 0x7fff83a80ffb com.apple.security 5.0.4 (34102) <e0b73ab106139601404f2666ce1b9d65> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff83ecb000 - 0x7fff84165fe3 com.apple.Foundation 6.5.6 (677.21) <8995b3185ca91d3508c7580794d40813> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff84166000 - 0x7fff841a1fff com.apple.AE 402.2 (402.2) <b03583e0747f82199e0d9604014faa34> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.fram ework/Versions/A/AE
    0x7fff842ed000 - 0x7fff842f9ff1 libgcc_s.1.dylib ??? (???) <23fa31a628c1ea8a62ac529fa333b6e1> /usr/lib/libgcc_s.1.dylib
    0x7fff842fa000 - 0x7fff84382fe7 libsqlite3.0.dylib ??? (???) <3c7ab3523b816dbd3e039ee7e6e2c580> /usr/lib/libsqlite3.0.dylib
    0x7fff84383000 - 0x7fff8467efe3 com.apple.CoreServices.CarbonCore 786.6 (786.6) <7048aee00133f19029108600e9ede844> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x7fffffe00000 - 0x7fffffe01780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib
    0xfffffffffffec000 - 0xfffffffffffeffff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib
    As I said, java 1.5 worked for a while, however recently it too has stopped working and spits out Segmentation Faults like these. Any clues as to why, and how to fix?
    Much thanks.

    I have no answers, but strongly suggest posting to an appropriate forum under OS X Technologies, where Unix and developer gurus hang out.

  • Help in getting started with java 3d

    Hi everyone,
    I am very new to java3d and I started learning it from few books and online tutorial.
    However, in my very first program that I trying to code, I get error when I try to import following:-
    import com.sun.j3d.utils.universe.SimpleUniverse;
    The compilation error that I am getting is that "com.sun.j3d cannot be resolved". I have already installed java 3d. I can see java3d package in the Program Files/java directory.
    Any suggestions would be greatly appreciated.
    Thanks!

    On the instalation you have to use the default location, or the location where your SDK is installed.
    Also, check if the CLASSPATH is defined correctly in your Environment Variables for JAVA_HOME and PATH.
    You can also try to define the Java 3D jar files in you classpath before you try to run your file. Or can also try to use an IDE like NetBeans or Eclipse, it will help you a lot with your import declarations.

  • Help needed for JDBC with RMI plz reply

    Dear fellows
    i have a problem which is making me circle in hell :( i mean i m trying to get strings from a database class which connects and returns the data as a string to the RMI server mthod, and then the client can call on this to get that String passed on to it for processing.
    when wever i run it it gives me error
    Exception : com.mysql.jdbc.Driver
    when i run that database class alone it runs fine, but when i call it from RMI server method it gives exception?
    can anybody help?
    code is
    Database.java
    import java.sql.*;
    import java.io.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Driver;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.net.InetAddress;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class DatabaseConn {
    String s;
    String roomno;
    DatabaseConn(String roomno){
    //super();
    this.roomno= roomno;
    connect(roomno);
    public String connect(String roomno) {
    Connection con = null;
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection("jdbc:mysql:///pais",
    "koitohay", "ayesha79");
    }catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    try{
    String qs = "SELECT * FROM room where roomid='"+roomno+"'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( qs );
    while (rs.next()) {
    String s1 = rs.getString("roomId");
    int i = rs.getInt("floorId");
    s = rs.getString("Location");
    System.out.println("Location:"+s);
    if(!con.isClosed())
    System.out.println("Successfully connected to " +
    "MySQL server using TCP/IP...");
    }catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    } finally {
    try {
    if(con != null)
    con.close();
    } catch(SQLException e) {}
    return s;
    /*public static void main(String args[]) {
    DatabaseConn rmm= new DatabaseConn("3.15");
    RMI Server
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.LocateRegistry;
    import java.util.*;
    import java.util.Vector;
    import java.sql.*;
    import java.io.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Driver;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.net.InetAddress;
    //import compute.*;
    public class PAISServer extends UnicastRemoteObject
    implements PAIS
    LOCPAIS Loc;
    PositionVal pos;
    String str, CLIENT_IP;
    private static String X,Y,Floor,Room;
    String room;
    JdbcExample2 coon;
    DatabaseConn con;
    public PAISServer() throws RemoteException {
    super();
    public String getPosition(String CLIENT_IP){
    //this.CLIENT_IP = CLIENT_IP;
    LOCPAIS Loc = new LOCPAIS(CLIENT_IP);
    System.out.println("****"+Loc);
    String str = Loc.getLocation();
    //int str2= Loc.getX();
    System.out.println("hi"+str);
    return str; //the original code is here
    //PositionObject pos = new PositionObject("fdf","gdf","rdgdf","fdf") ;
    // process string
    /* pos.X = "10";
    pos.Y = "20";*/
    //return posString;
    //PositionObject str =Loc.getLocation();
    //System.out.println("****"+str);
    //PositionObject posi= (PositionObject)(Loc.getLocation());
    //System.out.println("****"+posi);
    // return str;
    /* Loc.gosietX();
    Loc.getY();
    Loc.getFloor()
    //Tokenize(Loc);
    //return Loc;
    public String getData( String roomno ) {
    try{
    DatabaseConn con= new DatabaseConn(roomno);
    String room= con.connect(Room);
    System.out.println("Data:"+room);
    }catch(Exception e) {
    System.err.println("Exception for: " + e.getMessage());
    return room;

    Hi
    If you start rmiregistry on the side don't include the JDBC driver to the classpath, use CODEBASE when you start the server.
    But again, please give more info.... how you start, how you compile... more traces... etc

  • Need help, I am terrible with Java, can someone help.

    Please can someone help me with this program. I am in a JAVA programming class and I am having a heck of a time. I am still having a problem with the basic concepts of JAVA but the teacher continues to give us difficult assignments with out any help. Here is the assignment:
    Write a class named 'Player' that has two attributes, 'name' (which has to be a 'Sting') and 'rating' (which has to be a 'int'). Then write an application class named "PlayerRating" that first creates an array consisting of 5 player objects, then display the list three times; first unsorted, then sorted by Name and finally sorted by rating.
    Must use the Bubble Sort Program and do NOT use Array.sort.
    Example output:
    Unsorted
    Name: Rating:
    Mickey Mantle 5
    Ty Cobb 3
    Babe Ruth 4
    Pete Rose 3
    Sammy Sosa 1
    Sorted by Name
    Name: Rating:
    Babe Ruth 4
    Mickey Mantle 5
    Pete Rose 3
    Sammy Sosa 1
    Ty Cobb 3
    Sorted by Rating
    Name: Rating:
    Sammy Sosa 1
    Pete Rose 3
    Ty Cobb 3
    Babe Ruth 4
    Mickey Mantle 5
    Here is what I have and it is not much, cause I am so lost:
    1 import java.io.*;
    2 import javax.swing.*;
    3 import java.text.*;
    4 import java.lang.*;//String[][];
    5 import java.util.*; //ArrayList;
    6
    7
    8 public class Player
    9 {
    10 public static void main (String [][]args)
    11 {
    12
    13 int maxSize = 100; //array size
    14 // String[][] s = new String[100][100]; //Default values: null
    15 boolean [] b = new boolean[4]; //default values: false
    16 int[][] i = new int[10][10]; //default values: 0
    17
    18
    19 PlayerRating arr; //reference to array
    20 //arr = new PlayerRating(maxSize);
    21 Sting player[]={"Mickey Mantle 5","Ty Cobb 3"
    22 ,"Babe Ruth 4","Pete Rose 3","Sammy Sosa 1"};
    23
    24
    25 }
    26 }
    Here is all I have on the second program:
    public class PlayerRating
    public void PlayerRating (int Max)
    int[][] i = new int[10][10];
    Please help I am totally lost.

    You repeat code, you should do a generic bubble sort with comparators, or declare class as Comparable. You can see how String class is Comparable, furthermore it has a final static Comparator for CASE_INTENSENSITIVE_ORDER.
    class User implements Comparable<User>{
      public static final java.util.Comparator<Cliente> RATING_COMPARATION=new java.util.Comparator<Cliente>(){
        public int compare(User u1,User u2){
               int comp=u1.rating-u2.rating;
               return comp==0?u1.name.compareTo(u2.name):comp;
         private String name;
         private int rating;
         public User(String name, int rating){
              setName(name);
              setRating(rating);
         public String getName(){
              return name;
         public void setName(String name){
              this.name = name;
         public int getRating(){
              return rating;
         public void setRating(int rating){
              this.rating = rating;
            // Compare users first by name and last by rating;
            public int compareTo(User anotherUser){
               int comp=name.compareTo(anotherUser.name);
               return comp==0?rating-anotherUser.rating:comp;
             public void equals(Object o){
              if(this==o)
                return true;
              if(o instanceof User){}
                 User anotherUser=(User)o;
                 return name.equals(anotherUser.name)&&rating==anotherUser.rating;
              return false;
               public int hashCode(){
                  return name.hashCode()+rating<<16;
    public class Sorting{
         public <E extends Comparable<E>>static void bubleSort(E[] arr){
              for(int i = 0; i < arr.length - 1; i++){
                   for(int j = arr.length - 1; j > i; j--){
                        if(arr[j].compareTo(arr[j - 1])<0)
                                     swap(arr,j,j-1);
         public static<E> void bubleSort(E[] arr,Comparator<E> cmp){
              for(int i = 0; i < arr.length - 1; i++){
                   for(int j = arr.length - 1; j > i; j--){
                        if(cmp.compare(arr[j],arr[j-1]) < 0)
                                      swap(arr,j,j-1);
            private static void swap(Object[] arr,int x,int y){
               Object tmp=arr[x];
               arr[x]=arr[y];
               arr[y]=tmp;
         public static void main(String[] args){
              User[] arr = new User[5];
              arr[0] = new User("Mickey Mantle", 5);
              arr[1] = new User("Ty Cobb", 3);
              arr[2] = new User("Babe Ruth", 4);
              arr[3] = new User("Pete Rose", 3);
              arr[4] = new User("Sammy Sosa", 1);
              System.out.println("Sorting by Name : ");
              bubleSort(arr)
              System.out.println(Arrays.toString(arr));
              System.out.println("Sorting by Rating : ");
              bubleSort(arr,User.RATING_COMPARATION);
              System.out.println(Arrays.toString(arr));
    }

  • Help needed please.. with JPG file

    Hi all,
    I am a Forms developer that DOES NOT use Jdeveloper so go easy on me!
    I have with the help of this forum amended the Java Bean Forms graph to create a JPG from the Graph bean. Our original problem was the need to print the graphs that were displayed, the forum very helpfully guided me through creating a JPG and i used Forms to open this and therefore user can then print it.
    I have used the following:
    File f = new File((String) _object,"img.gif");
    FileOutputStream fos = new FileOutputStream(f);
    m_graph.exportToGIF(fos);
    I then use Forms to Pass the clients temp location and save the file to the local PC temp location as img.gif.
    Unforunately this came up with user rights problems and in order to make this work we needed to sign the certificate. BUT by signing the certificate it meant EVERY one of our customers has to approve the changes once we give them the new JAR. Unforunately we use (as per Oracle Certification) JRE 1.4.2_13 and when the customers go to approve the changes it crashes JAVA (if they have previousely used the system). The only way to get round this (that we have found) is to clear all signitures and clear cache on the JRE. This is something that our customers will not accept doing.
    I posted that initial JRE problem but not had any comeback so my next question is. Is there a way to do what we need to do without the need of signing the JAR?
    The graph pre these changes did not need the approvals. So im assuming its the fact we want to place something on the Client PC is what is requiring the approval. Can we do what were doing but place the JPG on the Server and use something like webutil to get the file over. Meaning we dont need to use a different JAR?
    Any help would be most appreciated

    Hi,
    I cannot help you much on the issue, but I can confirm some of your thought. Signing is indeed required because you're trying to access the user's PC, which is a potential security breach hence why Java requires that the user agrees to it when the application goes out of the normal sandbox. You can check out http://www.securingjava.com/chapter-two/ as an introduction on the subject.
    I don't really get your use case though, you simply want to print the generated gif file right, so why do you write it on the user's hard drive?
    Regards,
    ~ Simon

  • Help needed for Time Calc Java Script

    Hi,
    I am trying to create a timesheet in PDF and have hit a speed bump. Is there anyone there who could provide me with a script that calculated the difference between 2 times? (Field2 time)-(Feild 1 Time) = Duration.I am desperate and have tried everything.
    I proccess the payroll for a company and all of the 500 or so timesheets that I received each fortnight are paper copies and I am pulling my hair out. I need to use Adobe forms (We have Adobe Pro 9 and I am using the XML forms, not live cycle) as the serach engine that we use for emails cannot search on excel documents.
    I have no Java script experience and I am getting completely lost in the subject. Any help would be greatly appreciated.
    Thanks anyone who can help at all.
    -Sohnia

    hi friend here example for time calulation start and end time example..<br />just copy and paste then run it ur browser.<br /><br /><HTML><br /><script language="JavaScript"><br /><!--<br /><br />var h1 = 1;<br />var h2 = 2;<br />var days = 0;<br />var m1 = 1;<br />var m2 = 2;<br />var am1 = 1;<br />var am2 = 2;<br />function findtime(h1,h2,days,m1,m2,am1,am2)<br />{<br />var answer = "why";<br />var mdiff = 1;<br />var hdiff = 2;<br />pdays = parseInt(days);<br />ph1 = parseInt(h1);<br />ph2 = parseInt(h2);<br />pm1 = parseInt(m1);<br />pm2 = parseInt(m2);<br />if(am1 == 2 & ph1 < 12) ph1 = ph1 + 12;<br />if(am2 == 2 & ph2 < 12) ph2 = ph2 + 12;<br />if(am1 == 1 & ph1 == 12) ph1 = 24;<br />if(am2 == 1 & ph2 == 12) ph2 = 24;<br />if(am1 == 2 & am2 == 1 & ph2 < 24) ph2 = ph2 + 24;<br />if(am1 == am2 & ph1 > ph2) ph2 = ph2 + 24;<br />if(pm2 < pm1){<br />pm2 = pm2 + 60;<br />ph2 = ph2 - 1;<br />}<br />mdiff = pm2 - pm1;<br />hdiff = (ph2 - ph1) + (pdays * 24);<br />if(hdiff == 0) answer = mdiff + ' minutes';<br />else if(hdiff == 1) answer = '1 hour and ' + mdiff + ' minutes'<br />else answer = hdiff + ' hours and ' + mdiff + ' minutes'<br />return answer<br />}<br /><br />//--><br /></script><br /></HEAD><br /><br /><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><br /><BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080><br /><br /><div align="center"><table width="950" border="0" cellpadding="0" bgcolor="#899194" cellspacing="0"><br /><br />  <br /><tr><td valign="middle" width="33%"><br /><br /><center><br /><form><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR=#FFFFFF><br /><!--ROW 1--><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR="#B6D4D2"><br /><!--ROW 1--><br /><td colspan=4><br /><center>Time Between Times Calculations - Multiple Days</center><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Required Data Entry<br /></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><br /><td align="center">Start time</td><br /><td align="center"><input type="text" name="hour1" size="5"></td><br /><td align="center"><input type="text" name="minute1" size="5"></td><br /><td align="center"><select name="period1"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><tr><br /><td colspan="3">    Add Complete Interim Days</td><td align="center"><input type="text" name="adays" size="5" value="0"></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><td align="center">End time</td><br /><td align="center"><input type="text" name="hour2" size="5"></td><br /><td align="center"><input type="text" name="minute2" size="5"></td><br /><td align="center"><select name="period2"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan=4 BGCOLOR="#B6D4D2"><br /><input type="button" value="Calculate" <br />onclick="h1=form.hour1.value;<br />h2=form.hour2.value;<br />m1=form.minute1.value;<br />m2=form.minute2.value;<br />days=form.adays.value;<br />am1=form.period1.options[period1.selectedIndex].value;<br />am2=form.period2.options[period2.selectedIndex].value;<br />if(h1 < 0 | h1 > 12) alert('Your start hour is not valid');<br />else if(h2 < 0 | h2 > 12) alert('Your end hour is not valid');<br />else if(m1 < 0 | m1 > 59) alert('Your start minute is not valid');<br />else if(m2 < 0 | m2 > 59) alert('Your end minute is not valid');<br />else form.answer.value=findtime(h1,h2,days,m1,m2,am1,am2);"><br />   <br /><input type="reset" value="Clear Values"><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Calculated Results<br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan="4"><br />Time Difference <input type="text" name="answer" size="40"><br /><tr><td>[email protected]</td></tr><br /></td><br /></tr><br /></table><br /></form><br /></td><br /></tr><br /></table><br /><br /></center><br /></td><br /></tr><br /></table><br /></center><br /><br /></TD><br /></TR><br /></TABLE><br /></BODY> <br /></HTML>

  • Help needed on a TicTacToe java program

    I am very new to java and our teacher has given us a program
    that i am having quite a bit of trouble with. I was wondering if anyone could help me out.
    This is the program which i have bolded.
    {You will write a Java class to play the TicTacToe game. This program will have at least two data members, one for the status of the board and one to keep track of whose turn it is. All data members must be private. You will create a user interface that allows client code to play the game.
    The user interface must include:
    �     Boolean xPlay(int num) which allows x to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    �     Boolean oPlay(int num) which allows o to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    �     Boolean isEmpty(int num) will check to see if the square labeled by num is empty.
    �     Void display() which displays the current game status to the screen.
    �     Char whoWon() which will return X, O, or C depending on the outcome of the game.
    �     You must not allow the same player to play twice in a row. Should the client code attempt to, xPlay or oPlay should print an error and do nothing else.
    �     Also calling whoWon when the game is not over should produce an error message and return a character other than X, O, or C.
    �     Client code for the moment is up to you. Assume you have two human players that can enter the number of the square in which they want to play.
    Verifying user input WILL be done by the client code.}

    Hi,
    This forum is exclusively for discussions related to Sun Java Studio Creator. Please post your question at the Java Programming forum. The URL to this forum is:
    http://forum.java.sun.com/forum.jspa?forumID=31
    Cheers
    Giri

  • Href and target tags tutorial/help needed for use with an existing website

    I have a website, (built through iweb), and an intro movie. I have spent a lot of time trying to understand the proper tags and how to use them without much luck. My goal is to have the homepage associated with my domain name load in a browser while at the same time have my intro movie open in a Quicktime Player window, play, and automatically close leaving the webpage visible. If anyone can point me to a tutorial or walk my through the process I would appreciate it.

    Poster movie style. Requires QuickTime Pro:
    Create an image (or a frame from your movie). This becomes the "poster". You could add text to it (Click to Play) in a graphic editor app to help your viewers or add text to the page under the image with these instructions.
    Save this new file as poster.mov
    It becomes the src="poster.mov" (source tag in the html code). Set its dimensions to fit your page layout.
    Your "intro movie" will be your href="intro.mov" (href tag in the html code).
    Open it with QuickTime Pro and then open the Movie Properties window. Click on the Presentation tab to see the choices. Automatically close option will close the QuickTime window. Automatically quit option will quit the running QuickTime Player app. This would be a better option as the browser should come back as the "front" application. You also want to check "auto play".
    Use Save As (preserves fast start feature) and name this file intro.mov
    In your html code for the QuickTime files you need to set target="quicktimeplayer" (this launches the QuickTime Player app instead of using the browser plug-in). It may also help if you use the full URL to both files in each tag (http://myserver.com/foldername/intro.mov).
    One of mine as an example. It uses automatically close window:
    http://homepage.mac.com/kkirkster/mycareerfuture/
    View the source code to see the tag structure. My page uses javascript instead of the older object/embed tag code.
    More useful links:
    http://developer.apple.com/internet/ieembedprep.html
    http://www.qtbridge.com/pageot/pageot.html

  • Help needed, possible problem with HDD

    In the last few weeks, my iMac has become quite slow and tends to freeze fairly often. The other day I turned it on and was met with a kernel panic screen and could not access my desktop or any of my files. To find the source of the problem I ran an Apple Hardware Test which gave me the following error:
    4HDD/11/40000004:SATA (0,0)
    After searching on the internet, I decided to boot from my OSX install disc and run Disk Utility. After verifying the disc, and repairing the disc, the scan revealed that there was no problem with the HDD. However, I was still being met with the kernel panic screen whenever I tried to turn on the computer.
    After booting from the install disc again, I did an Archive and Install, which finally let me get to my desktop, however the computer was once again running slowly and after another Apple Hardware Test it resulted in the same error as above.
    After more searching on the internet, I decided to remove the 3rd party RAM from my iMac and replace it with the original RAM. No success again.
    More searching brought Disk Warrior to my attention. After purchasing the program, I ran the included scans and once again was given the result that there was nothing wrong with the HDD.
    After this I decided to run Tech Tools Deluxe which came up with a Directory fail, even though the Disk Utility and Disk Warrior scans found no such problem.
    So what procedure can I take now, I am hesitant to perform a System Restore as I do not want to lose my files, but this may be my only option.
    Please help.

    Okay, I ended up installing OSX to my external HD and booted from that. Ran Disk Warrior from the external and used it to rebuild the internal HD. After the rebuild DW gave me the message that it could not replace the new directory with the old directory as there was a disk malfunction. I managed to copy all of my important data to the external.
    I'm guessing that the internal needs to be replaced? I'd rather start fresh with a new one than risk this happening again anyways.
    In any case thank you very much for your help, it was much appreciated .

  • Help needed in printing in java

    hello everyone, i m in grave need of a solution of printing a java page. I have a page designed in Java swings which contains mainly labels and textareas. And i need to print this page. The problem is that I have no clue how to go ahead. Cud neone arnd pls help me on this matter asap as this is very urgent. I shall be highly obliged to all the takers on this issue. Please email me at [email protected]
    Thanks and kind regards,
    Rahul.

    http://java.sun.com/docs/books/tutorial/2d/printing/index.html

  • Help needed in executing the java/jsp program from UCM .

    Hi ,
    I have a .jsp program running in my Jdeveloper which when executed pops a window to browse and select files and with few custom options .
    But i want to execute that Program from within UCM (create a new jsp page in UCM OR provide link ? i am not sure .... ) , could anyone help on how i can execute/run the program from UCM ?
    thanks in Advance
    Plaxman

    If your jsp makes use of jars you may want to look into using a WAR instead. You can check the WAR into content server and there is even a link on the administration page for JSP Web App Admin. Treating the JSP(s) and jar(s) as an entity may be a more successful path for you.
    You can find some jsp examples and ever a war example in this directory: <install root>\samples\JspServer
    And the briefest of help about that stuff here: [http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm|http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm]

  • Help needed in working with Excel

    i have a ms excel template with n number of columns.
    I need to add a new column using sql code. Can anyone tell me what is the code??? thx in advance...

    Erm i tink the final db is excel and no more.
    the db given to me is in excel and i can do whatever with it but the final output have to be in excel.
    ( i initially imported the excel db to access and everything is out running fine. But as i wont be using the application after i had it out. So i thought it would be better to allow it to work on excel thus saving the trouble of importing and exporting)
    I have to work with a few db(all excel) and they each contains 40 000 - 80 000 records...(i dun knw if that is considered small or large)
    I have limited knowledge on access macros and sql and the knowledge i had on them does not permit me to carry out the operations i wan.(and im required to develop an application with GUI)
    thx for all helps and comments guyz...

  • Help needed in voice enabled java app on LINUX OS

    I have problem in capturing voice from mic on Linux m/c with in java application. I tried that by using native app on linux. It is working fine, but when i tried to make it work with a java application, it is not working.
    Any help is appreciated. Thanks in Advance...
    -Bhaskar

    I have the same problem, I'm able to receive RTP audio, but not send, I have Red Hat linux 9

  • HELP needed in working with established InDesign catalog

    I have just inherited the job of up keep and editing of our catalog. The entire catalog is on InDesign cs5. I have never worked with any InDesign programs. It looks to me like the entire thing was done in individual text boxes, I am at a loss as to were to begin, can anyone recommend a tutorial to get me started. I have looked and did not find what I needed.

    I like the Visual Quickstart Guides to get to know a new program - lots of pics, captions and tips - besides wordy explanations.
    Also indesignsecrets.com for tips once you know the program better - and their pdf magazine - they are quite happy to point out bugs and workarounds. I always find Adobe resources hide the shortcomings and tell you everything is perfect - until the next version of the software where they tell you it wasn't but have now fixed it!
    (I have no ties to the above)
    This forum seems the most active (and helpful) for sorting individual problems.

Maybe you are looking for