Handling unsigned primitives

I have a small problem with Java:
I'm developing a program that processes files in a certain binary format that uses unsigned data types, such as UINT32, UINT64, etc. They have to be read and written back in binary form, displayed as hex or decimal values and used in arithmetic operations.
What is the preferred way to handle such primitive values in Java?
--Dan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

The data in the file is in binary form, Intel byte order (little endian). This prevents using DataInputStream, which, by contract, is big endian. However, the New IO package offers ByteBuffers, with settable byte order and reading methods for all primitive types.
Unfortunately, this doesn't solve my problem. I need to do computation with them. For example, I have an unsigned 32-bit integer representing a positive value between 0 and 0xffffffff. I need to divide this value to other integer values, to convert it into a positive double, etc.
One solution would be to convert somehow the value to long - I'd like to do it with minimal overhead. This still doesn't solve the problem for UNIT64, which must be also used in arithmetic operations.
Other method would be to extend Math.BigInteger for each of my data types - this will work, but I want to be sure there's no other simpler technique to do it.
This lack of unsigned primitive types in Java is quite a drawback, especially for inter-operation in heterogeneous environments. There are operations that can be natively executed in one clock cycle - it's somehow sad to have to use rather complex techniques, involving object allocation, arrays and multiple bit-wise manipulations for doing the same thing.

Similar Messages

  • Should Java introduce new primitive data types??

    In Java SE 5.0, many character- related methods (especially in the class Character) handle code points by using int type, i.e. return (code point) type is int, or receive (code point) int as parameter. This leads several problems. First, the variable used for storing returned result should be carefully stated, otherwise confusion may arise. Second, the parameters of method should be carefully ordered, otherwise conflict of method signature may meet.
    By those reasons, I suggest that Java should introduce new primitive data types for handling characters, they are:
    1. wchar
    this type states the variable stores 32-bit UNSIGNED integer, and it could be used to store either the code point, or the UTF-16 code of a character.
    2. ascii
    this type states the variable stores 8-bit UNSIGNED integer, and it could be used to store the code point of a elemental (ascii) character.

    short char, no. Nononono.
    No.
    wchar, I think I'd pref to see Java version 2 come
    out, and that be wchar by default, but that is not
    going to happen.
    I don't see a great need for it at this time.http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4504839
    Though I do not think that Java developer would like to change too much program code for using proposed (unsigned) primitive data types, I still believe that Java developer will eventually introduce these types, because it is not efficient to pretend signed integer to unsigned integer, and the success of a programming language is determined by how it can meet the programmers' need.

  • Configure array of primitive type for POF

    My impression is that Coherence's POF implementation can handle Java primitive and String by default thus we don't need to provide a customized POF configuration file if the object been put into the cache is Java primitive type.
    How about arrary of primitive type? For example, byte[]. Can Coherence's POF implementation handle byte[] as well?

    Just asking since we plan to move from using Externalizable to POF and not sure if we need special handling for byte[] type.
    Thanks for the reply.
    Regards,
    Chen

  • Where to find topics on unsigned variables?

    One example is this type ones:
    byte etyb = -1 ;
    int johns = 255& etyb ;
    int skirt = etyb &255 ;
    long trousers = johns != skirt ? (short) skirt ++ : (long) johns | --etyb << 1;
    \r\n\r\n :)

    Java has a single unsigned primitive type, char.
    The two uses for unsigned types (AFAIK) are to store larger numbers without incurring storage overheads, or to perform bit operations on.
    As for the former, there are very few situtations nowadays in which storing an extra 4 bytes for a value is unacceptable.
    As for the latter, it can be seen from the example given that bit operations can be performed normally with signed primitives if you are careful. Know the difference between >> and >>> before proceeding.
    is an interesting operator... rather than create unsigned types, Java has chosen to introduce an unsigned operator :-)Having said all that, I don't actually know any topics on unsigned variable types. Perhaps searching the forums for 'unsigned', or the internet for 'java unsigned' or 'java bit operations'. Then ignore hits for unsigned applets :-)
    -T

  • Unsigned types in java

    hi there,
    i was wondering if there is any way to handle unsigned int in java. im making some byte processing and i have a "switch case" statement like below
    so when it comes at 0x80 it does not enter the case because it converts it as -1.
    im using java 1.7
    ByteBuffer record;
    pkgId = record.get();
    switch ((int) pkgId) {
    case 0x75:
    break; /* 117 */
    case 0x7D:
    break; /* 125 */
    case 0x80:
    break; /* 128 */
    case 0x82:
    break; /* 130 */
    case 0x86:
    break; /* 134 */
    case 0x87:
    break; /* 135 */
    }

    user8999602 wrote:
    hi there,
    i was wondering if there is any way to handle unsigned int in java.Use a long.
    im making some byte processing and i have a "switch case" statement like below
    so when it comes at 0x80 it does not enter the case because it converts it as -1.
    im using java 1.7
    ByteBuffer record;
    pkgId = record.get();
    switch ((int) pkgId) {
    case 0x75:
    break; /* 117 */
    case 0x7D:
    break; /* 125 */
    case 0x80:
    break; /* 128 */
    case 0x82:
    break; /* 130 */
    case 0x86:
    break; /* 134 */
    case 0x87:
    break; /* 135 */
    }Looks more like you want an unsigned byte. The usual approach to that is to use an int, but you need to mask it. The byte 0x80 has the value -128, so when you simply cast to an int, it sign extends it, and you get 0xFFFFFF80, which is an int value of -128.
    int pkgIdInt = pkgId & 0xFF;
    switch (pkgIdInt);Alternatively, you could just cast each case value to byte, but that's too cluttered for my taste.

  • Time server 1:55:50 wrong!! how could this be??

    Hello everybody,
    I am develloping an application where I get the time from a time sever and update the (embedded) system time. But I am getting from the server 1h55min minutes earlier than it should be. Most of it I think come from my GMT+0200 location but that would still leave me with a 4/5 minutes advance when corrected!!
    I got the program from somewhere around the net but it's too complex for me (okay okay, you can call me a noob) to find out if any of the byte handling could be the source of the error
    So I have 2 questions:
    1. What could be causing the illogical 11min time difference?? (I think the encodeTimestamp method is not that reliable)...
    2. How do I retrieve GMT related information to such as time zone and daylight savings time??
    This is the code:
    package general;
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import com.siemens.icm.io.*;
    public class Teste27 extends MIDlet
         private ATListener ComList = null;     
         private ATCommand ATCmd = null;
         String gprs = null;
         Calendar cal;
         Date date;
         TimeZone timeZone;
         long milliSeconds = 0;
         class ATListener implements ATCommandListener{
              public void ATEvent(String Event){System.out.println("\rURC-Event: " + Event);}
              public void RINGChanged (boolean SignalState){System.out.println("\rRING-Event: " + SignalState);}
              public void DCDChanged (boolean SignalState){System.out.println("\rDCD-Event: " + SignalState);}
              public void DSRChanged (boolean SignalState){System.out.println("\rDSR-Event: " + SignalState);}
              public void CONNChanged (boolean SignalState){System.out.println("\rCONN-Event: " + SignalState);}
         public Teste27() throws MIDletStateChangeException
              System.out.println("Constructor");
              try{
                   // Create Listener
                   ComList = new ATListener();
                   ATCmd = new ATCommand(false);
                   ATCmd.addListener(ComList);
              }catch(ATCommandFailedException e){System.out.println("\rATCommandFailedException(Teste27)" + e);
              destroyApp(true);}
         protected void startApp() throws MIDletStateChangeException
              // Address
              String address = "datagram://ntp-sop.inria.fr:123";
              System.out.println(address);
              try
                   // Configure GPRS connection
                   gprs = ATCmd.send("at^sjnet=gprs,a2bouygtel.com,\"\",\"\",\"\",0\r");
                   System.out.println(gprs);
                   // Creates Connection
                   System.out.println("Creating connection");
                   DatagramConnection connection = (DatagramConnection)Connector.open(address);
                   // Creates UDP Packet
                   System.out.println("Creating message");
                   byte[] buf = new NtpMessage().toByteArray();
                   // Sends Packet
                   System.out.println("Sending packet");
                   Datagram packet = connection.newDatagram(buf,buf.length,address);        
                   connection.send(packet);
                   // Get response
                   System.out.println("receiving connection");
                   Datagram response = connection.newDatagram(512);
                   connection.receive(response);
                   System.out.println("Obtained");
                   NtpMessage msg = new NtpMessage(response.getData());
                   System.out.println(msg.toString());
                   System.out.println(msg.transmitTimestamp);
                   destroyApp(true);
              } catch(IOException ioe){ioe.printStackTrace();}
              catch(Exception e){System.out.println("Exception(configureSocketService): " + e);}
         protected void pauseApp()
              System.out.println("pauseApp");
         protected void destroyApp(boolean arg0) throws MIDletStateChangeException
              System.out.println("destroyApp");
              this.notifyDestroyed();
    }And this is the NtpMessage Class:
    package general;
    import java.util.Date;
    import java.util.Random;
    * @author Adam Buckley
    public class NtpMessage
         public byte leapIndicator = 0;
         public byte version = 3;
         public byte mode = 0;
         public short stratum = 0;
         public byte pollInterval = 0;
         public byte precision = 0;
         public double rootDelay = 0;
         public double rootDispersion = 0;
         public byte[] referenceIdentifier = {0, 0, 0, 0};
         public double referenceTimestamp = 0;
         public double originateTimestamp = 0;
         public double receiveTimestamp = 0;
         public double transmitTimestamp = 0;
          * Constructs a new NtpMessage from an array of bytes.
          */     public NtpMessage(byte[] array)
              // See the packet format diagram in RFC 2030 for details
              // BYTE 1
              leapIndicator = (byte) ((array[0] >> 6) & 0x3);
              version = (byte) ((array[0] >> 3) & 0x7);
              mode = (byte) (array[0] & 0x7);
              // BYTE 2
              stratum = unsignedByteToShort(array[1]);
              // BYTE 3
              pollInterval = array[2];
              // BYTE 4
              precision = array[3];
              // BYTES 5->8
              rootDelay = (array[4] * 256.0) +
                   unsignedByteToShort(array[5]) +
                   (unsignedByteToShort(array[6]) / 256.0) +
                   (unsignedByteToShort(array[7]) / 65536.0);
              // BYTES 9->12
              rootDispersion = (unsignedByteToShort(array[8]) * 256.0) +
                   unsignedByteToShort(array[9]) +
                   (unsignedByteToShort(array[10]) / 256.0) +
                   (unsignedByteToShort(array[11]) / 65536.0);
              // BYTES 13->16
              referenceIdentifier[0] = array[12];
              referenceIdentifier[1] = array[13];
              referenceIdentifier[2] = array[14];
              referenceIdentifier[3] = array[15];
              // BYTES 17->24
              referenceTimestamp = decodeTimestamp(array, 16);
              // BYTES 25->32
              originateTimestamp = decodeTimestamp(array, 24);
              // BYTES 33-40
              receiveTimestamp = decodeTimestamp(array, 32);
              // BYTES 41-48
              transmitTimestamp = decodeTimestamp(array, 40);
          * Constructs a new NtpMessage in client -> server mode, and sets the
          * transmit timestamp to the current time.
         public NtpMessage()
              // Note that all the other member variables are already set with
              // appropriate default values.
              this.mode = 3;
              this.transmitTimestamp = (System.currentTimeMillis()/1000.0) + 2208988800.0;
          * This method constructs the data bytes of a raw NTP packet.
          */     public byte[] toByteArray()
              // All bytes are automatically set to 0
              byte[] p = new byte[48];
              p[0] = (byte) (leapIndicator << 6 | version << 3 | mode);
              p[1] = (byte) stratum;
              p[2] = (byte) pollInterval;
              p[3] = (byte) precision;
              // root delay is a signed 16.16-bit FP, in Java an int is 32-bits
              int l = (int) (rootDelay * 65536.0);
              p[4] = (byte) ((l >> 24) & 0xFF);
              p[5] = (byte) ((l >> 16) & 0xFF);
              p[6] = (byte) ((l >> 8) & 0xFF);
              p[7] = (byte) (l & 0xFF);
              // root dispersion is an unsigned 16.16-bit FP, in Java there are no
              // unsigned primitive types, so we use a long which is 64-bits
              long ul = (long) (rootDispersion * 65536.0);
              p[8] = (byte) ((ul >> 24) & 0xFF);
              p[9] = (byte) ((ul >> 16) & 0xFF);
              p[10] = (byte) ((ul >> 8) & 0xFF);
              p[11] = (byte) (ul & 0xFF);
              p[12] = referenceIdentifier[0];
              p[13] = referenceIdentifier[1];
              p[14] = referenceIdentifier[2];
              p[15] = referenceIdentifier[3];
              encodeTimestamp(p, 16, referenceTimestamp);
              encodeTimestamp(p, 24, originateTimestamp);
              encodeTimestamp(p, 32, receiveTimestamp);
              encodeTimestamp(p, 40, transmitTimestamp);
              return p;
          * Returns a string representation of a NtpMessage
          */     public String toString()
              return "Leap indicator: " + leapIndicator + "\r\n" +
                   "Version: " + version + "\r\n" +
                   "Mode: " + mode + "\r\n" +
                   "Stratum: " + stratum + "\r\n" +
                   "Poll: " + pollInterval + "\r\n" +
    //               "Precision: " + precision + " (" + precisionStr + " seconds)\r\n" +
    //               "Root delay: " + new DecimalFormat("0.00").format(rootDelay*1000) + " ms\r\n" +
    //               "Root dispersion: " + new DecimalFormat("0.00").format(rootDispersion*1000) + " ms\r\n" +
                   "Reference identifier: " + referenceIdentifierToString(referenceIdentifier, stratum, version) +
    "\r\n" +
                   "Reference timestamp: " + timestampToString(referenceTimestamp) + "\r\n" +
                   "Originate timestamp: " + timestampToString(originateTimestamp) + "\r\n" +
                   "Receive timestamp:   " + timestampToString(receiveTimestamp) + "\r\n" +
                   "Transmit timestamp:  " + timestampToString(transmitTimestamp);
          * Converts an unsigned byte to a short.  By default, Java assumes that
          * a byte is signed.
          */     public static short unsignedByteToShort(byte b)
              if((b & 0x80)==0x80) return (short) (128 + (b & 0x7f));
              else return (short) b;
          * Will read 8 bytes of a message beginning at <code>pointer</code>
          * and return it as a double, according to the NTP 64-bit timestamp
          * format.
         public static double decodeTimestamp(byte[] array, int pointer)
              double r = 0.0;
              for(int i=0; i<8; i++)
    //               r += unsignedByteToShort(array[pointer+i]) * Math.pow(2, (3-i)*8);
                double tmp = unsignedByteToShort(array[pointer+i]);           
                for(int k=0;k<(3-i)*8;k++)
                    tmp *= 2;
                r += tmp;
              return r;
          * Encodes a timestamp in the specified position in the message
         public static void encodeTimestamp(byte[] array, int pointer, double timestamp)
              // Converts a double into a 64-bit fixed point
              for(int i=0; i<8; i++)
                   // 2^24, 2^16, 2^8, .. 2^-32
    //               double base = Math.pow(2, (3-i)*8);
                   double base = 1;      
                   for(int k=0;k<(3-i)*8;k++)
                       base *= 2;
                   // Capture byte value
                   array[pointer+i] = (byte) (timestamp / base);
                   // Subtract captured value from remaining total
                   timestamp = timestamp - (double) (unsignedByteToShort(array[pointer+i]) * base);
              // From RFC 2030: It is advisable to fill the non-significant
              // low order bits of the timestamp with a random, unbiased
              // bitstring, both to avoid systematic roundoff errors and as
              // a means of loop detection and replay detection.
    //          array[7] = (byte) (Math.random()*255.0);
            array[7+pointer] = (byte) (new Random(System.currentTimeMillis()).nextDouble()*255.0);
          * Returns a timestamp (number of seconds since 00:00 1-Jan-1900) as a
          * formatted date/time string.
         public static String timestampToString(double timestamp)
              if(timestamp==0) return "0";
              // timestamp is relative to 1900, utc is used by Java and is relative
              // to 1970
              double utc = timestamp - (2208988800.0);
              // milliseconds
              long ms = (long) (utc * 1000.0);
              // date/time
    //          String date = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss").format(new Date(ms));
            String date = new Date(ms).toString();
              // fraction
    //          double fraction = timestamp - ((long) timestamp);
    //          String fractionSting = new DecimalFormat(".000000").format(fraction);
    //          String fractionString = new
    //          return date + fractionSting;
            return date;
          * Returns a string representation of a reference identifier according
          * to the rules set out in RFC 2030.
         public static String referenceIdentifierToString(byte[] ref, short stratum, byte version)
              // From the RFC 2030:
              // In the case of NTP Version 3 or Version 4 stratum-0 (unspecified)
              // or stratum-1 (primary) servers, this is a four-character ASCII
              // string, left justified and zero padded to 32 bits.
              if(stratum==0 || stratum==1)
                   return new String(ref);
              // In NTP Version 3 secondary servers, this is the 32-bit IPv4
              // address of the reference source.
              else if(version==3)
                   return unsignedByteToShort(ref[0]) + "." +
                        unsignedByteToShort(ref[1]) + "." +
                        unsignedByteToShort(ref[2]) + "." +
                        unsignedByteToShort(ref[3]);
              // In NTP Version 4 secondary servers, this is the low order 32 bits
              // of the latest transmit timestamp of the reference source.
              else if(version==4)
                   return "" + ((unsignedByteToShort(ref[0]) / 256.0) +
                        (unsignedByteToShort(ref[1]) / 65536.0) +
                        (unsignedByteToShort(ref[2]) / 16777216.0) +
                        (unsignedByteToShort(ref[3]) / 4294967296.0));
              return "";
    }   Thank you (if you got this far... =s)

    i forgot to mention one thing in my previous post..
    my server starts up sometimes without giving me any problems. that is, when i face this problem, all i do is shut down the server and then wait for abt 10-15 minutes and try starting it again..sometimes this gap of 15 min helps a lot coz the server starts up properly and the connection exception does not occur. Also,the web app also works perfectly. But this wasnt the case abt 2 months back. prior to this problem, my server would never give me a problem and i could start and stop it at will...i used to start and stop the server almost 3-4 times a day (when i made changes to java files and wanted the server to read the latest class files..).it was only 2 months back that this problem arose and ever since then, all i would do is wait for 10-15 minutes if the server doesnt start up and then try my luck again. Even if i wait for 15 min, there are days when the server doesnt start properly all day long !
    Another issue is that even when the server starts properly(without giving the connection exception) it sometimes does not load the web application correctly. It displays a "Page cannot be found" error. But waiting for abt 10-15 minutes again removes this problem and i am again able to use the application.
    I am a newbie to JAVA and do not know much abt application servers. I had read through the Apache tomcat documentation which told me abt JNDI realm and the 389 port to which connection is made. I could not understand much and thats why i posted the problem on this forum.
    This whimsical behaviour is what has delayed my work and i am not being able to deliver on deadlines.Needless to say, any help would be appreciated. :)
    Regards,
    Shankar

  • How do I pass a void *pointer to a dll in LabView

    I did read previous posts on the matter and tried just about everything, inlcuding defining the pointer as a U32 int.
    What I am trying to do is program FLASH using WindRiver VisionPROBE EST...
    I do have some sucesses... )
    I can open a connection to the EST, initialize it, start & stop the target. No problem here..
    Here are some additional details:
    I can't read memory, write to the target register or program the FLASH, yet. Any advice on how to get further with this? Typically, when doing this using WR's visionClick sw, we need to use a register file which sets up the target. I have not seen any reference to this in their API.
    I can convert to CVI if necessary. I am using the dll's from WindRi
    ver. I'd prefer keeping everything in LV, but LW-CVI is fine.
    My problem is that I am not sure if I am passing void pointers back & forth correctly. For instance, I need to call a function which returns a status, as follows:
    status = EST_WriteTargetRegister (long handle, Unsign int register, void * value)
    How do I pass the "void * value" to the input of a Call Library FUnction Node. I did try "Adapt to type" which does give a "void * value", and I tried both "Handles by Value" & "Pointers to Handles".
    When I change the input value to anything other than "Adpapt To Type", I get a violation error. >(
    Has anyone successfully automated WindRiver's EST?
    - Thanks -
    JLV"

    Hi,
    Have you tried passing a I32, but selecting "Pointer To Value"?
    Is there any description about the "void *pointer"? Could it be a callback
    function?
    Regards,
    Wiebe.
    "JoeLabView" wrote in message
    news:[email protected]..
    > I did read previous posts on the matter and tried just about
    > everything, inlcuding defining the pointer as a U32 int.
    >
    > What I am trying to do is program FLASH using WindRiver VisionPROBE
    > EST...
    >
    > I do have some sucesses... )
    > I can open a connection to the EST, initialize it, start & stop the
    > target. No problem here..
    >
    > Here are some additional details:
    >
    >
    >
    >
    > I can't read memory, write to the target register or program the
    > FLASH, yet. Any advice on how to get f
    urther with this? Typically,
    > when doing this using WR's visionClick sw, we need to use a register
    > file which sets up the target. I have not seen any reference to this
    > in their API.
    >
    > I can convert to CVI if necessary. I am using the dll's from
    > WindRiver. I'd prefer keeping everything in LV, but LW-CVI is fine.
    >
    > My problem is that I am not sure if I am passing void pointers back &
    > forth correctly. For instance, I need to call a function which
    > returns a status, as follows:
    >
    >
    > status = EST_WriteTargetRegister (long handle, Unsign int register,
    > void * value)
    >
    >
    > How do I pass the "void * value" to the input of a Call Library
    > FUnction Node. I did try "Adapt to type" which does give a "void *
    > value", and I tried both "Handles by Value" & "Pointers to Handles".
    >
    > When I change the input value to anything other than "Adpapt To Type",
    > I get a violation error. >(
    >
    > Has anyone successfully automated WindRiver's EST?
    >
    > - Thanks -
    >
    > JLV"

  • Ray Tracing question

    Hi all,
    In Java2D the tracing algorithm can handle effectively primitive shapes, like cubes, spheres etc, mapping the shapes from 3D to 2D. So we can, for example, rotate the whole "scene" and have a 3D illusion of the world. But what about images? The ray tracing algorithm uses the 3D coordinates system, so how can we handle the 2D representation of an image? I know that in Java3D there are special Loaders that load a description of an image and tranform it appropriately in the 3D world. Is there any way to have a 3D representation of an image in Java2D?
    Thanks

    helmik,
    LabVIEW does not do symbolic math.  Once you have the equations solved on paper or reduced to a set which can be solved numerically, tehn you can program it in LV.
    When I look at your math in the first post, I see that in (3) you describe an equation in x and a. However, this is not a quadratic equation but a fourth order polynomial with terms like a^2*x^2 and 2*a^2*x*y_0. So this is not so easily solved.
    Is not the tangent to the sphere at right angles to the radius at that point? The angle of the radius can be calculated from x_0 and y_0 and the center of the sphere. Then add 90 degrees. One arctangent and no complicated equations.
    Lynn

  • How to use array?I am a newer   ------:(

    In C language I can use array this way:
    char array[10][20];
    fread(array[1],20,1,fp);
    but in java,what to do?
    char array[][]=new [10][20];
    and the code below will cause an error:
    binstream.read(array[1]);//error line
    pls help me and tell me what to do,thank you very much

    Hi evilstar007!
    1st) There aren't unsigned primitives in Java, all primitives are signed.
    2nd) The loop in previous message will read an entire line filling the buffer without length contraints. If there are n^z then it will read n^z "chars". This is is for text but I know there is a special one as you need, for bytes (primitive byte). You can also retrieve the bytes from stream:
    data = new byte[dim];
    inp.read(data);
    I'm not sure about, there are a lot of methods and classes.
    You pretend to read from stream and fill the contents of RomBanks array with length 32768L ok ?
    Read the entire line and retrieve bytes.
    Since you are a C programmer will be easy to understand Java.
    Best Regards!

  • IWDDateNavigator: event onDaySelect

    Hi,
    at the moment I'm using developer studio SP4 with WAS 6.40 sneak preview.
    I have implemented the UI element IWDDateNavigator. Of course, if user selects a day in the DateNavigator, I want to handle this event. So, I need to get the selected day. The event onDaySelect should be the right choice. The method I define should have a parameter day of type java.sql.Date (parameter mapping is considered). But if I implement it like this I got an error during execution because of wrong data type. It only works if I define the parameter day of type String. Then I get the date as String: "16.11.2004".
    Is this an error of SP4? Or is it my error?
    regards
    Frank

    Hi Frank,
    Probably this is error of <b>SP4</b>.
    I performed the following steps on <b>SP9</b> and everything works fine:
    1. Add IWDDateNavigator to view
    2. Create Action handler with parameter "day" of type java.sql.Date (actually, I've selected DDIC type rather then Java type)
    3. Assing onDaySelect event to forementioned action
    4. In wdDoModifyView I place the following code:
    if (firstTime)
      final IWDDateNavigator dn = (IWDDateNavigator)view.getElement("MyDateNavigator");
      dn.mappingOfOnDaySelect().addSourceMapping("day", "day");
    5. In action handler enter primitive code to debug value selected:
    wdComponentAPI.getMessageManager().reportSuccess
      "Date: " + day
    Everything works as expected.
    Regards,
    VS

  • Animation program for iMac?

    Hi,
    Does anyone know of an animation program that can be used on Macs? Also, is there a certain program that I should get if I would like to create 3D and 2D animations?
    Thanks to anyone who can help!
    Happy Holidays!

    ToonBoom is always an option.
    http://www.toonboom.com/
    BTW, on the gallery page, you can see some of the animations that are possible. While not specifically geared towards cartoons, kinemac is certainly capable of handling the primitive shapes needed to create toon looking objects in 3d. But, as with anything creative, the right tool really depends on EXACTLY what you're trying to do.

  • EJB to Web Services

    My EJB returns a collection data type or 2 dimension data. How do I convert to webs services?

    Oracle9iAS J2EE Web Services can handle serializing primitive datatypes and abstract datatypes based on Javabeans for Java classes and EJB. If your object is a serializable Javabean, it will also support serialization of single dimension arrays of Javabeans.
    There currently is no support for writing your own custom serializers although that will appear in Oracle9iAS 9.0.3 (the J2EE 1.3 certified version expected to be available in late July/early August).
    While the serialization of Javabean is handled on the server side, the tools support for this also comes in August with Oracle9i JDeveloper 9.0.3. If you happen to be using Oracle9i JDeveloper 9.0.2, there is a handy step by step guide on how to get some free code generation for the Javabean serialization with reasonably little hand coding at:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&file=jar%3Afile%3A/u01/webapps/OHW/ohw-app/jdeveloper/helpsets/jdeveloper/web_services.jar!/ws_custombeanpara.html&linkHelp=false
    (you will have to make this link into a single url - it points to the Oracle9i JDeveloper 9.0.2 online help). A short writeup describing the process should appear in the OTN Web Services Center in about a day or so - another one on the list!
    For information on the exact serialization support in the current production release 9.0.2 of Oracle9i Application Server, follow this URL to the doc:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95453/ejbservices.htm#1029764
    Finally, a fallback in the meantime can be to use what is called Oracle SOAP which is a derivative of Apache SOAP 2.2. This support is to be deprecated going forward in Oracle9iAS favouring the Oracle9iAS J2EE Web Services implementation pointed to above (as that will be what Oracle evolves to J2EE 1.4 compliance with the Java Web Services Developer Pack). If you go that route, serialization capabilities documented in the Apache SOAP 2.2 documentation may help you solve serializing multi-dimensional arrays. For doc on Oracle SOAP, see the end of the J2EE Web Services guide:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95453/oraclesoap.htm#640260
    Mike.

  • JAVA primitive data types - Signed/ unsigned etc.

    1. Are the following data types signed or unsigned in JAVA?
    byte, short, int, long, float, double
    2. I have tried using "Integer" in place of "int" and the program runs perfectly. Why is this so when "Integer" is not a reserved word in JAVA?
    Thanks.

    And to answer your first question, byte, short, int, long, float and double are all signed.
    As a part of the core of the language, Sun developed a series of 'collections' classes; Vector, ArrayList, etc. All of these classes, in the days before generics, were able to store instances of the Object class or anything that derived from it. Therefore, to store an int, a float or a double value into one of these collections classes, it was necessary to wrap it up in an instance of one of those classes that derived from Number. These are the wrapper classes that the previous poster alluded to. Typically, the wrapper class has a similar name to the primitive data type but with a capital latter; int - Integer, double - Double, etc.

  • 64bit unsigned int - j????

    I have a 64bit unsigned int in a datastructure generated by a native method.
    What would be the best java type to cast it to, before returning the value?
    Thanks,
    Than

    BigInteger is the only java "datatype" that can handle this if you need to access the unsigned value within your Java code. None of the primitive datatypes will work as they are all signed.
    The other alternative is to split the integer into 2 4 byte words and store them both in jlongs

  • Unsigned data types

    I have been using java for many years and never really needed this (which is probably why it's not in java by default), but I am porting a C++ library to java and the C++ code uses quite a bit of WORD (16 bit unsigned) and DWORDs (32 bit unsigned) and a great amout of shifting.
    This is kind of a lame question, but I can't get it to work and I think it is due to the uncontrolable sign bit - does anyone have any resources that can point me in the right direction? Everything on the web just talks about java primitive data type - which I know already - but there is little about using unsigned types or how to port them. Links, books, whatever.
    The project is to get a windows library to work on linux (any everything else) - I have ported it into a gcc C++ and will do JNI if it gets down to it, but I would like to get a native java class going. -- I can't post the code because it's NDAed :(
    Any info, links, books, tips, anything is highly welcome
    Thank you much,
    Rob

    You don't understand my concern (or I misunderstand
    you). A char solution for the 16 bit unsigned type
    (word) is great, but if you're gonna write methods to
    shift a 32 bit dword as a long (ignoring the sign
    bit), why not use that for the 16 bit version as well?I agree, promoting from 16->32 bits or 32-->64 bits sounds like a temporary solution. For "unsigned int"
    I'd just use int and shift with >>> and handle comparisons with either promotion to long or a case analysis
    on sign, which ever works better.
    Let me add, as an old C/C++ programmer I'm glad >99% of the time that Java doesn't have the
    plethora of unsigned types of C/C++ (not to method the ambiguity of 'char' in those languages!).
    And I don't miss those languages dubious promotion rules. Every C book has the puzzler:
    unsigned u = 1;
    if (u < -1) {
       //always true!

Maybe you are looking for

  • Check concordance between the package database and the filesystem

    Hello, I'd like to write this down : To list the packages installed in the database, I use pacman -Qsq -Q because it's a query on the local database, s to search and q for quiet. If you would like to list the files installed by pacman on your compute

  • Iphone 4 Display opens app by himself after 6.1.2. Update

    After the Update to 6.1.2. on my Iphone 4 the display opens App by himself without touching it - made several reinstallation incl. DFU Mode and manual update without any success. The Iphone mostly starts to open favorites and notices and video app -

  • Behavior of a Non "TB Last" member underneath a TB Last Parent

    <p>Can some one explain values for months : Jan , Feb and Mar ,Quarters: Qtr1 get affected with a Non-TB last member rolling up toits TB last Parent?</p><p> </p><p>There are 2 Non TB Last Members with + cosolidation operatorrolling upto their parent

  • Expiring Ghost !

    Hi  Guys ! I have a role that gets expired on users ! I thats to say  without any user intervention of " valid to date" change -- the role gets deleted. let me clarify again.. 1.even if the role has a "valid to ' date as 12/31/9999 the role gets dele

  • My Skype not working on Windows XP Pro 2002

    Salve a tutti, ho un Windows Professional 2002 XP aggiornato SP3, dalla pagina di Skype ho scaricato ieri 27/02/2014, la versione per l'XP; la schermata del sito Skype mi dice  cerca il file  'SkypeSetupFull' clicca 2 volte per farlo istallare. Io es