Problem in adjusting the range of long value

Hi all
I have problem
I have application running in C language which sends data to other application which is running in java .. Its through socket communication
My doubt is in C the size of long is 4bytes and in java 8bytes
my C application is sending a negative long value
so with C long has 32 bit in which the last bit is for signed/unsigned
but the value when i convert in java will i get postive value or negative value
In java long is 64 bits and last is for signed/unsigned
So when i convert that C long value which is a negative value to Java long value it come under the range of postive java long value
How to solve this

Well I think you need to make up your mind what the problem is. In your OP you said this:
my C application is sending a negative long valueand now you're saying this:
but C is sending only positive long value.In any case all you have to do is convert the 4 bytes to a Java integer correctly, which is just a few shifts and masks.
But it would be both easier and clearer to use the methods of DataInputStream directly on the input stream to give you the appropriate datatypes as they arrive, without using the byte[] array at all.

Similar Messages

  • Error occurred in deployment step 'Add Solution': Specified argument was out of the range of valid values.

    I was trying to deploy my solution thru Visual studio then  iam getting an eror saying "error occurred in deployment step 'Add Solution': Specified argument was out of the range of valid values." but its not displaying which argument is out
    of range. I am not getting any error when i buil the solution. Build was succussfull.  I am able to succussfully deploy manually if take the .WSP from bin folder and deploy manually using stsadm command. the issue with that is if i want to dubug
    i am not able to do that.
    what could be the issue and where.

    what is the content of that feature ? is that a master page? just a normal feature?
    is there any dependencies on that feature ? did u get any errors in the event viewer ? 
    Subhash

  • Problem in adjusting the brightness manually

    Hi, 
    I have purchased HP Pavilion 15-n205TX with win 8.1 recently.
    I have problem in adjusting the brightness of my screen. When i do it manually by pressing the keys f2 and f3, there is no change in the brightness of the sreen. 
    Even when i try to change it from Settings-Brightness, there is no change in the brightness 
    This question was solved.
    View Solution.

    Hi AG_8055,
    Thank you for visiting the HP Support Forums and Welcome. I have read your thread on your HP Pavilion 15-n205tx Notebook and brightness not working correctly.  You could try a refresh on Windows 8 stops anything that has not closed correctly. You could try a BIOS update. The HP Support Assistant will help you install the drivers and software for your machine. It will locate the correct driver update for the brightness. Here is a link download  the HP Support Assistant if you need it.
    Hope this helps you out.
    Thanks.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • How can I edit iCal server addresses in Mountain Lion? I keep getting an error with regards to my google calendar and I understand that the way to fix the problem is adjust the server address, but I cannot access it because the preferences are restrictive

    How can I edit iCal server addresses in Mountain Lion?
    I keep getting an error message with my google calendar, and I heard that if I delete the extra slash at the end of the address the problem will be fixed. But the iCal account preferences take me to system preferences > accounts every time I want to edit the account.
    Does anyone know where I can edit the server address?

    You should ask in the iCloud forum, this is for iMacs. https://discussions.apple.com/community/icloud/icloud_on_my_mac

  • PROBLEMS WITH THE RANGE OF THE ROUTER

    I have a router in my home, but i just can get connected to the internet only in the livingroom. The problem became by the range of the router. So i would like to know if buying the "Airport ExtendAIR Omni de Dr Bott" i should have internet in my little house . . . THANKS !

    I purchased this Dr. Bott antenna and it didn't do anything for the range of the AirPort. In actuallity, if your base station is close to intererence sources (i.e. satellite dish) the antenna actually makes the signal worse.
    I've tried extending the range using 2 Airport Express, but the signal continues to be pretty weak. My iMac and PowerBook are within 15 feet of the base station and the max signal strength I get is in the 40's.
    I gave up on the AirPort and bought myself a Netgear RangeMax. It's a pain to set-up (you gotta give credit to Apple's simplicity that everything just works well together), poor documentation, but when it's up and running the signal strength is great: My signal averages in the 60-70's. I live in a four story townhouse and on the fourth floor, I get a signal in the 40's!

  • ORA-01461: can bind a LONG value ... Please hlep ASAP

    In my java code I try to update a table in the db like this:
    "ps = conn.prepareStatement("update dg_log set ISUPDATED=1,CAUser=?
    where qnum =? and cid !=3"); "
    and when i tried to bind a variables to one of the fields like that:
    " ps.setString(1,"32");
    ps.setString(2,"3");"
    On my local Oracle 8.1.5 db these statement work fine.
    When I conncted to Oracle 8.1.6 I encountered this problem :
    "ORA-01461: can bind a LONG value only for insert into a LONG
    column"
    This is caused because the binded variable is of type :NUMBER.
    I do not wont to use setInt()
    Is there any way to config the Oracle the he will do the translation string to number?
    null

    Nop, it didn't make any difference.
    "Sree Bodapati" <[email protected]> wrote in message
    news:3d2edd39$[email protected]..
    Can you try to turn off the PreparedStatement cache by placing
    PreparedStatementCacheSize=0
    in the properties of the pool and see if it helps.
    sree
    "erj" <[email protected]> wrote in message
    news:[email protected]..
    Hi guys,
    I am trying to use a prepared statemnt to insert into a table that has
    two
    fields. One is Char(3) -From field- and the second is Varchar2(8) -user
    field.
    My code looks like :
    lstrSQL = "INSERT INTO Table1( ID, From, DateAdded, USer) VALUES
    (TheInsertSeq.nextVal,? , sysdate, ?) ";
    ps = con.prepareCall(lstrSQL);
    String Temp1 = "dee";
    ps.setString(1, Temp1);
    String Temp2="abcde";
    ps.setString(2, Temp2);
    retVal = ps.executeUpdate();
    But after the execute statement I get the error:
    ORA-01461: can bind a LONG value only for insert into a LONG column
    I am using Weblogic Server 6.1 SP2 and Oracle 8.1.7. The database is in
    AMERICAN_AMERICA.WE8ISO8859P9 and in the startweblogic.cmd file I use:
    set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P9
    The connection pool has properties of:
    weblogic.codeset=ISO8859_9
    weblogic.oci.min_bind_size=660
    weblogic.oci.ncodeset=WE8ISO8859P9
    server=OracleServer
    user=testUsert
    I have tried to run the code over and over, with and without theNLS_LANG
    and connection pool settings. I even set NLS_LANG as a systemenvironment
    variable. But nothing changed, could someone please give me a hand?
    Thanx.
    Ercu

  • How to limit the range of counter using rotary encoder

    Hello all!
    I'm new user of labview..
    I've problem to limit the range of counter by using rotary encoder..
    I use DAQmx 6024e in my project..
    Actually i am designing the controller for both dyno & throttle for engine testing..
    The idea is, i want to vary the output of 0-10V from ni card to control the dyno & throttle..
    I'm already manage to get the output from the analog output..
    The problem is due to my software..
    When i rotate the encoder shaft cw or ccw, it increase or decrease the voltage respectively just like i want..
    But, when the counter hit minimum (0 value) it jump to the maximum count which is 16.772M (for koyo encoder that i used)..
    In that case the output voltage is increase to 10V directly..
    So , the question is how can i limit the range of encoder so that it only count certain minimum or maximum value even the shaft is rotate cw or ccw over it standard limit which is 0 to 16.772M count..
    Tq

    You'll need to do a little software workaround on the values you read from your counter.   But first a little tutorial to explain *why*.
    The E-series boards use 24-bit counters.  When LabVIEW requests an integer count value, the count is returned in a 32-bit unsigned integer datatype, where the 24 lowest bits represent the value in the board's count register.  The upper 8 bits are *always* 0's.
    The count register can increment from 0 to 16 million plus (2^24 - 1), then it must "roll over" back to 0 again just like an odometer.  Similarly, when it decrements past 0, it next goes to the max value of 2^24 -1 as you observed.
    So we need a little software workaround that'll convert (2^24 -1) to (-1) and (2^24 -2) to (-2), etc.  The way to do it is to first detect whether the highest bit is a 1.  One way is to compare whether the count value is >= 2^23, making sure to use integers to do the comparison.  Whenever the value is >= 2^23, subtract 2^24 from it to create your new count value which will then decrement 3,2,1,0,-1,-2,-3, etc. as desired.
    Here's a link to a similar explanation.  Couple more notes too.  First, if this is a continuously rotating encoder, you may still encounter a discontinuity when the revised count value crosses the +/- 2^23 boundary.   Second, direct connection of a quadrature encoder to an E-series board isn't recommended because of unrepeatability when measureing direction changes.
    -Kevin P.

  • RE:Compare the range

    hi,
      I have one value like EN35430202. I have value range like EN35450201 to EN35450210.I am trying to find whether this value EN35430202 falls in the range of above values like between EN35430201 and EN35430210.How to put this in the select statement as it is alpha numeric ?
    I have tried like this which is not working:
    data wa(10) type c.
    wa = 'EN35430202'.
    select single * from hierarchy table where EN35430200 < wa and EN35430210 > wa.
    I donot know why this is not working. Please let me know if you have any idea.
    Thanks in advance.

    Rao,
    why dont you compare jusy the numeric part alone.... it might work...
    something like wa = 'XX12345'.
    wa1 = wa+2.
    select.....
    Hope this helps...
    Arun

  • Media Encoder: where is the "range" box?

    Hey there,
    I was just tweaking some properties in the media encoder when I tried to switch to "only export a preselected range of my clip". In Premiere CS3 there was this box right below format called 'RANGE'. Where'd that go???
    Thanks
    FAZ

    While the output range will default to the work area you can adjust the range using the triangles shown on the left hand lower portion of the export settings dialog box just below the preview screen.  Move the top indicator to the desired “in” timecode position and then press the left triangle next to the screen size pull down menu – repeat for the out point only use the right triangle.

  • Improve the range of my wrt320N router?

    Hellu,
    How can I improve the range of the WRT320N router that is operating on 5Ghz?
    The router is fixed and will not be moved. 
    Can I adjust the range capacity through firmware? or add antenna's?, bandwidth... etc...

    As your Router is an Dual Band Router, and It can work on 2.4GHz Wireless Network or on 5GHz network.However different wireless channels has different significance to improve the wireless performance of your Router. Once you set the different channels on your Wireless Router, then you can set the security mode to WPA persoanl, as if you have  Windows XP OS installed on your Computer, As most of the XP Computer dosent work on your WPA2 Security, and Disable the Wireless MAC filter on your Router and check if you are getting connected to your Wireless Network using the 5GHz Network.Follow the settings bellow and i think this might improve the signal strength on your Wireless Computer.
    Open an Internet Explorer browser page on a computer hard wired to the router...In the address bar type - 192.168.1.1...Leave the Username blank & in Password use admin in lower case...
    For Wireless Settings, please do the following : -
    Click on the Wireless tab
    - Here select manual configuration...And select 5GHz Channel...... Wireless Network mode should be mixed...
    - Set the Radio Band to Wide-40MHz and change the Wide channel to 9 and Standard Channel to 11-2.462GHz...
    SSID Broadcast should be Enable and Click on Save Settings... 
    For Wireless Security : -
    Click on the Sub tab under Wireless > Wireless Security...
    Change the Wireless security mode to WPA, For Encryption, select TKIP...For Passphrase input your desired WPA Key. For example , MySecretKey , This will serve as your network key whenever you connect to your wireless network. Do NOT give this key to anyone.
    NOTE : Passphrase should be more that 8 characters...
    Click on Advanced Wireless Settings
    Change the Beacon Interval to 50 >>Change the Fragmentation Threshold to 2200 Change the RTS Threshold to 2200 >>Click on "Save Settings"...
    Now see if you can locate your Wireless Network and attempt to connect...
    Message Edited by binky on 08-16-2009 01:51 PM

  • Extract arrays according the number of consecutive values

    Hello I would need some help on one problem to search the
    number of consecutive values in an array. I am using Labview 8.1
    First I have a 2D array with 3 columns: Col (A)  Col (B) 
    Col (C). I would like to plot points from Col( B)=f(ColC) at Constant
    value in Column A. The problem is that in Column A the values changes. My
    problem is to extract arrays when the values in column A are the same and when
    the number of values is higher than a number that I can choose. In my case I
    chosse this number by the threshold function on the peak detector.
    Let ‘s take an exemple:
    Col (A)            Col(B)              Col(
    C)
    12                    343                  45
    654                  65                    33                               
    121                  65                    65                   
    18                    31                    45                   
    12                    456                  98       
    787                  361                  787
    121                  156                  123     
    12                    32                    545
    Let ‘s say I want to plot Col(B)=f( Col(C)) at constant value in
    Column A when I have more than 2 constant values in Column A
    The aim would be to have different arrays to plot 2
    different graphs for different constant value in Col( A).
    Col (A)            Col
    (B) Col( C)                        Col (A)            Col(B)              Col(C)
    12                    343                  45                       121                  65                    65       
    12                    456                  98           &          121                  156                  123
    12                    32                    545
     What I do with the VI is:
    1)      sort
     the 2D arrays accordind the values in
    the Col (A) and extract Col(A)
    2)      Search
    the index of elements in Column A when they I do not have consecutive values
    3)      Subtract
    each new indexes indexes 2 by 2: this gives me the number of consecutive values
    in a new array.
    4)      Detect
    the indexes of the peak (number of consecutive values) that I want (in the
    exemple= 2)
    My problem is now to come back in
    the initial array and extract the arrays that has more than n  consecutive values
    (n=2 in the exemple) according to the index found by the peak values.
     I am sure that there is a simpler
    and better way to do this (maybe by a for loop or by using an histogram);
    Thank in advance for the help
    Olivier
    Attachments:
    extract values.vi ‏33 KB

    First, I wanted to thank you, Kumar for the quick answer: 5
    stars for the answer, this is exactly what I was looking for. I would not have
    found it by myself.
    I have an other problem to plot now Col( B)=f (Col( C))
    What I would like to do is plot Col (B)=Col (C) with
    different plots (colour) on a same graph when the value in column A changes.
    I managed to have 2 arrays (thanks to the forum with some
    modifications):
    -One to tell me each first indexes when the value changes
    -One to tell me each last indexes when the values changes
    My idea would be to use theses indexes to split the initial
    array by  a loop when the value in Column
    A changes and then in an other loop  (or
    in the same) connect the XY graph to the build arrays.
    The only problem is that before running Labview I do not
    know how many different values in column A I have so I do not know how many
    arrays will be created when I will try to split the initial array.
    Is someone know if this solution is possible?
    Thank you in advance for the help.
    Olivier

  • Error 13641 - The Subnet prefix must be between the starting and ending values

    Hi All,
    I can honestly say hand on heart that this is the first time I have ever asked for help in a forum in over 15 years but this is doing my head in..
    I have a Sys Center 2012 R2 deployment..  VMM R2 up to RU3, Edge Cluster (2 hosts), Management Cluster (2 hosts), 2 x Production Compute Clusters (total of 20 hosts).  I have a HA Network Virt Gateway deployed on the edge cluster.
    All Hosts have the new DHCP install done and the RU3 SQL patch is completed as outlined in deployment manual.
    Everything had been running fine for some time after RU3 update...  I am experiencing an issue whereby I get the following error anytime I try and attach a NVGRE VM network to a VM, or when I try and migrate a VM with a NVGRE network attached to another
    host.
    Error (13641)
    The specified subnet prefix must be between the starting and ending values for the range.
    Starting value: 4
    Ending value: 30
    Recommended Action
    Specify a suitable subnet prefix.
    All subnets in the entire network are /24's so prefix isn't an issue.
    I can successfully attach a standard vm network but get the above error when working with NVRGE networks.. 
    Further to this, if I restart VMM the DHCP function to VM's with NVGRE networks doesn't get picked up until I trigger a change in config on the VM, then it will get IP and function as expected.
    I have checked all logs, there aren't any errors that I can see.
    get-netvirtualizationlookuprecord throws out VM's and PA's as expected, but again not until I manually interfere with the VM in question.
    Have any of you come across this before??  I want to check before I go rebuilding the PA network entirely and having to cleanup all existing VM networks to do it..
    Any help or guidance would be appreciated..
    Cheers
    Nathan

    I have seen this message before, "specify a suitable subnet prefix".
    In my case, the NVGRE policies were out of sync due to HW issues on several hosts.
    Here's some steps in order to troubleshoot/fix:
    run the following cmdlet: Get-SCVMHost | Read-SCVMhost -RunAsynchronously
    Check for any errors in the job log that refers to "Network Virtualization".
    If this doesn't help, a recycle of the VMM Management server should do a "hard refresh" of the NVGRE policies, and it might include a reboot of the nvgre hosts too.
    This solved the case in my situation.
    -kn 
    Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com )

  • I have macbook 5,2 mac osx 10.5 leopard, my problem is every  60 sec. there is pop up on desktop ,restart, sleep, cancel, and shut down and desktop dim also like sleep mood or hibernate mood, i try already to adjust the screen saver to longer minute but

    i have macbook 5,2 mac osx 10.5 leopard, my problem is every 60 sec. a pop up on desktop restart, sleep, cancel, and shut down and the desktop dim also i already adjust the sleep time to longer time but nothing happen, and every time i shut down my laptop he go restart again i canot of my laptop, i shut down and before he restart again i push the power botton the laptop is off and if i start my laptop not start 2 to 5 time i remove the battery again fix then laptop start. any body can help me about this problem may only the setting but i dont have idea..... please help thanks

    i think i find solution.
    after instal baytrail driver, without restart i instal gpu driver direct from intel
    https://downloadcenter.intel.com/search?keyword=Intel%C2%AE+HD+Graphics+for+Intel%C2%AE+Atom%E2%84%A...
    work fine for now...

  • Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.   Is th

    Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.
    Is there another way to adjust tempo of loops the faster way, any other technique?

    No clue why the final processes have suddenly started to take so long. Two things I'd try: a) capture from an older tape to see if some problem with the new tape is at fault.  And b) check the health of your RAM and the hard drive.
    The red frame sounds a bit like a glitch we used to have in OnLocation (actually in its predecessor HDV Rack) which was caused by a partial GOP. But that was a product of HDV Rack recording from the live video stream. It turned out that HDV cameras intentionally interrupt the data stream for an instant upon starting to record--specifically to avoid recording a partial GOP to tape. So my gut says that the tape has partial GOPs at the points where you stopped/started recording.

  • Number Overflow when it is within the range (Long)

    Hi,
    I am using Oracle JDBC Drivers to write a CMP (Container Managed Persistance) beans which has a CMP Field of long value in
    the table it is Number(14) which is well under the limits of long datatype, the value is also currentmillis which is millis
    from 1-1-1970, the value is also 1046836194640L which is withing long datatypes limits but gives the overflow exception,
    please help me with the same. try to use the oracle.sql.NUMBER.toLong which expects a byte[] on the value it gives an error.
    simple way to test this is get the above value from dual table get the rs.getBytes and take the byte[] and pass it to the
    oracle.sql.NUMBER.toLong it will give the error. and one more strange observation i found is when this number is stored in the table and you try to just perform a select in SQL Query Manager or SQLPlus in windows 2000 you will receive an windows Excepton telling that program tried to refer to memeory outside and you have to quit the client app.
    Database is oracle 8i on windows 2000 advanced Server
    Expired Commands Not Found javax.ejb.FinderException: Exception in 'findExpiredCommandsOfThisMaster' while using result set:
    'weblogic.jdbc.rmi.SerialResultSet@7d78ce'
    java.sql.SQLException: Overflow Exception
    java.sql.SQLException: Overflow Exception
    at oracle.sql.NUMBER.toLong(NUMBER.java:371)
    at oracle.jdbc.dbaccess.DBConversion.NumberBytesToLong(DBConversion.java:2915)
    at oracle.jdbc.driver.OracleStatement.getLongValue(OracleStatement.java:4373)
    at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:529)
    at weblogic.jdbc.pool.ResultSet.getLong(ResultSet.java:107)
    at weblogic.jdbc.rmi.internal.ResultSetImpl.getLong(ResultSetImpl.java:216)
    at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getLong(ResultSetStraightReader.java:62)
    at weblogic.jdbc.rmi.SerialResultSet.getLong(SerialResultSet.java:204)
    at
    net.devicesWorld.deviceServer.server.device.command.InstructionalUnit_7krj5v__WebLogic_CMP_RDBMS.ejbFindExpiredCommandsOfThis
    Master(Instruc
    tionalUnit_7krj5v__WebLogic_CMP_RDBMS.java:1877)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:278)
    at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:670)
    at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:643)
    at weblogic.ejb20.internal.EntityEJBHome.finder(EntityEJBHome.java:448)
    at
    net.devicesWorld.deviceServer.server.device.command.InstructionalUnit_7krj5v_HomeImpl.findExpiredCommandsOfThisMaster(Instruc
    tionalUnit_7kr
    j5v_HomeImpl.java:267)
    at
    net.devicesWorld.deviceServer.server.device.command.CommandsToSendBean.getCommandToSend(CommandsToSendBean.java:97)
    at
    net.devicesWorld.deviceServer.server.device.command.CommandsToSendBean_uqhqrf_EOImpl.getCommandToSend(CommandsToSendBean_uqhq
    rf_EOImpl.java
    :413)
    at net.devicesWorld.deviceServer.server.device.command.PollOnline.process(PollOnline.java:110)
    at net.devicesWorld.deviceServer.server.device.command.CmdMessageBean.onMessage(CmdMessageBean.java:267)
    at weblogic.ejb20.internal.MDListener.execute(MDListener.java:268)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Regards
    LJS Narayana

    Hi Abrami,
    Thank you for your reply. It is like this i am storing System.currentMillies() which gives Millis in long data type into a table having a number column with (14). Now i wrote a CMP bean which uses this table, for almost a year and half it is in production with no problem but from few days back when we try to use a finder method to query data SQL returns Exception telling that Number Overflow, a sample number for getting this overflow is 1046836194640L which represents 'Wed Mar 05 11:49:54 SGT 2003' this date. I found that the CMP which got generated is using oracle.sql.NUMBER.toLong(byte[] inputNumber) and thus giving the error. I try to use your suggested way, if we can directly work on the long it would be more convenient.
    Regards
    LJS Narayana

Maybe you are looking for