How to handle big number

i am trying to implement wallet applet, there i want to credit 1000 , for this i am passing my apdu like
cla ins p1 p2 lc=2 and 03 e8
1000=03 E8
when i am getting this by
apdu.getBuffer();
its value are change , here e8=232 but here byte array shows different value ,because it support unsigned nature,
how i can get 232 in short variable for E8

Hi,
You could use this:
short amount = Util.getShort(apdu.getBuffer(), ISO7816.OFFSET_CDATA);You can replace ISO7816.OFFSET_CDATA with the offset to the amount if your APDU becomes more complex. You can also validate that the Lc is 2 bytes. I am sure your stored value will not exceed 32,676 (max signed short)?
Cheers,
Shane

Similar Messages

  • How to handle Big FIles in SAP PI Sender file adapter

    Hi all ,
    I have developed a interface , where it is File to Proxy, it is fine when i do with small and normal files
    The structure contain one  Header unbounded  detail and one  Trailer, how to handle when the file size is more than 40 MB
    Thanking you
    Sridhar

    Hi Sridhar Gautham,
    We can set a limit on the request body message length that can be accepted by the HTTP Provider Service on the Java dispatcher. The system controls this limit by inspecting the Content-Length header of the request or monitoring the chunked request body (in case chunked encoding is applied to the message). If the value of the Content-Length header exceeds the maximum request body length, then the HTTP Provider Service will reject the request with a 413 u201CRequest Entity Too Largeu201D error response. You can limit the length of the request body using the tting MaxRequestContentLength property of the HTTP Provider Service running on the Java dispatcher. By default, the maximum permitted value is 131072 KB (or 128MB).You can configure the MaxRequestContentLength property using the Visual Administrator tool. Proceed as follows:
           1.      Go to the Properties tab of the HTTP Provider Service running on the dispatcher.
           2.      Choose MaxRequestContentLength property and enter a value in the Value field. The length is specified in KB.
           3.      Choose Update to add it to the list of properties.
           4.      To apply these changes, choose  (Save Properties).
    The value of the parameter MaxRequestContentLength has to be set to a high value.
    The Visual administartor tool may be accessed using this link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40a08db9-59b6-2c10-5e8f-a4b2a9aaa3d2?quicklink=index&overridelayout=true
    In short  ICM parameters to reset values for this case are
    icm/HTTP/max_request_size_KB
    icm/server_port_ TIMEOUT
    rdisp/max_wprun_time
    zttp/max_memreq_MB
    Please look into this thread to know more about ICM parameters
    http://help.sap.com/saphelp_nw04/helpdata/en/61/f5183a3bef2669e10000000a114084/frameset.htm
    Second solution is that you must split the source file, so that each file is less than 5MB in size, then PI would not cause problem for file size between 1MB-5MB. you can insert header and trailer for individual smaller file obtained after split. All this can be done using scripts or conventional programing provided individual records within file are independent of each other. Finally you have to rename each new file created and put them in PI folder in sequential manner. All this can be achieved by simple shell script/batch file, a C code or java code. If you are going for a C or Java code you need a script to call them from PI communication channel parameter  "run operating system command before message processing".
    regards
    Anupam

  • How to handle a number of records in stored procedure?

    i wanna handle a number of records in a stored procedure one by one.
    what should i do?
    can any one give me some sample about the following question?
    Q:
    tb_main,tb_attach are two tables.
    i want to create a procedure to write off a record in tb_main. before do that, i want to write off all records in tb_attach which is related with the record to be written off in tb_main. and a procedure named pr_write_off_attach for writing off a record in tb_attach has been created already.
    what should i do?
    help!!
    null

    Dg.dataProvider.length is the number of records in the ArrayCollection
    Dg.rowCount is the number of visible rows.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to handle big java source files in JDEV 10.1.3

    Hi,
    I have some .java files that are like over 10,000 lines long. I know this is crazy but I didn't write it but I have to maintain it. I really dont feel like refactoring all these big source files right now.
    JDeveloper has lots of while-editing features that are probably grinding to a halt on this really big file. My CPU usage shows ~97% whenever I do anything in this file.
    Is there some preferences I could set or something I can disable just while editing this big file.
    Thanks,
    Simon.

    The delays between edits and the IDE stalls seemed
    about the same with this change in place.Ah... that's sad. It seems like there's another (un-configurable) timer mechanism for background parsing used by the structure pane.
    I didn't
    really understand what the numbers were controlling
    so I didn't try any other values. They control the frequency of a timer that is reset each time you press a key in the code editor. After the number of ms specified in these parameters has elapsed after the last keypress, the code in the editor is parsed. There are two settings, one for short files and one for long files (I forget what the threshold is between short and long).
    Maybe it isn't the parser since it still goes to 100%
    CPU (just less often) but I can still move the mouse
    around the file - no stalling. Here's something I'd find useful to investigate this problem: Run jdeveloper with jdev.exe so that you have a console. When the CPU hits 100%, switch to the console and press Ctrl+Break. Copy the stack dump (maybe take a couple of them) and email them to me (brian dot duff at oracle dot com).
    Dropping the structure window is a fairly simple work
    around for me. I can live without the structure
    window for this file although it is actually most
    useful as the file's size, and structure, increases.Yes, I can imagine the structure pane would be quite useful with a mammoth java file like the one you're working with :) Incremental find might be your friend in its absence (Ctrl+E, I think).
    If your considering an ER for the structure window
    (:-) then how about this too:
    "Cursur location within the file should be shown in
    the structure window"
    This already happens for Ant (build.xml) files but
    not for Java files - or at least not for me. The
    problem is that it is easy to get lost in a large
    file and the navigation assistance should be the same
    across all structured file types. Funnily enough, I was talking to one of the developers on the team that builds the infrastructure for the xml based parts of the product (including ant) about these kind of inconsistencies between the XML and Java structure panes just a couple of days ago... :) I'll file a bug for this (rather than an ER), since it's a UI inconsistency.
    Thanks,
    Brian

  • How to handle large number (7200+) identical HorizontalRule's

    I have an application where performance is becoming an issue. I have 30 VBoxes that each contain identical HorizontalRules, the number of
    HorizontalRules is unknown until render time but can easily be up to 240 per VBox. As there are 30 VBoxes this results in 7200 HorizontalRules being added to the stage. This results in large memory consumption and poor rendering time on lower specification machines. To speed this up I have tried using Sprites and graphics.draw to render the line, but I think it is the time taken to create the Object that is the problem.
    Is there any way to create one HorizontalRule and add it to the stage multiple times? I know that Flex will remove the child if it is added again with a different [x,y] coordinate so my attempts to do that failed.
    Thanks for any suggestions.

    The VBoxes are typically about 20 pixels wide and each has a line about 4 or 5 pixels apart all the way down their length. That is why there are so many of the little blighters.
    You are probably right, but I had a problem with graphics.draw in that they had to be added as rawChildren. The component is resizable and I found it impossible to move the drawn lines. I could not get a good reference to them, even if I stored each line in a seperate Array before adding it as a rawChild, and so I could not even delete them reliably. I know that the rawChildren and children/elements have things at different indexes, but I didn't manage to find a way to use that information.
    You have given me the idea that I shouldn't draw them all on the screen at once though. With the full 7,200 lines, only about 30% are on the screen, I will look into using an item renderer. Is that the correct way to do it?
    Does anyone know how to relibly access rawChildren so they can be moved? Maybe my app is just a little wierd. I will try building a test case and see if I can add and remove from the rawChild list freely in a simpler application.

  • How to handle large number of Threads !!?

    hello friends,
    i done a program that is digging all files and folders for finding given filename
    in this logic i created one thread per directory and and that thread list out all
    sub files and directory and matches the search filename string , in that if sub
    directory found than it creates new thread and forth ..
    problem is after running program , at point it is creating large thread around
    3000 threads and system goes down ,
    so what should be solution for that?
    requesting you to suggest the good scheduling of thread that give better performance of the system
    logic code is given below:
    import java.io.File;
    class DiggtheFiles implements Runnable
         private File     currentdir     = null;
         private String     search          = "";
         DiggtheFiles(File file, String search)
              this.currentdir = file;
              this.search = search;
         private File     files[]     = null;
         public void run()
              files = currentdir.listFiles();
              if (files != null && files.length > 0)
                   synchronized (this)
                        for (int i = 0; i < files.length; i++)
                             if (files.isDirectory())
                                  data.dircount++;
                                  if(files[i].getName().contains(search))data.filearry.add(files[i].getAbsolutePath());
                                  *new Thread(new DiggtheFiles(files[i],search)).start();*
                             else
                                  if(files[i].getName().contains(search))data.filearry.add(files[i].getAbsolutePath());
                                  data.filecount++;
                   Filechooserpanel.consolearea.setText("DIR:" + data.dircount
                             + " FILE:" + data.filecount + " Thread Completed:"
                             + data.threadcount);
                   data.threadcount++;
                   return;
              else
                   data.threadcount++;
                   return;

    Remove the synchronized and use a work list instead of doing new Thread(), do workList.add() instead and have a threadpooledexceutor take workitem of the list.
    Or go non-parallel and just do a recursion-call?

  • How to handle large images?

    Hi,
    Does anyone know how to handle big jpg images (1280*960) so that they could be presented in a midlet.
    The problem is that the images requires so much memory that they can't be decoded to an Image object with Image.createImage method. One solution would be to extract thumbnail image from exif headers. Unfortunately at least images taken with Nokia 6680 don't contain thumbnail in exif headers.
    So the only solution seems to be to decode the byte presentation of the image and resize it before creating an Image object.
    Do anybody know any library for this or tips where to start?
    Br, Ilpo

    Hi,
    I think it is not possible. My application contains a file browser (which uses jsr-75). User can use the browser to select an image either from phone memory or memory card. After the selection I would like to present the selected image for that user can be sure it is the right image. The selected image will be then sent to the server side with some additional data for further processing (but that is another story).
    Now the problem is that for example with Nokia 6680 user can take images as big as 1280*960 and I can't present them anymore because of the memory restrictions. With 640*480 image there is no problem because I can create an image object and then use a simple algorithm to resize the image for presentation.
    Br, Ilpo

  • Handle big amount of data

    Hello,
    I have to analyse a great amount of data (more than 20MByte), that I read from a logfile. I can't split these data into smaller parts because some of my analysis-methods need all data (regression,....).
    Are there any tricks for LabVIEW (5.0.1), how to handle big amounts of data?
    hans

    You might be able to do as you would like. If analysing process needs
    all amont of data,
    the whole process takes a couple of minutes but no problem. It gives you
    no information
    on the way of process like as hanging, so using "read files", not "read
    from spread
    sheet files", is better to have confirming process including the graphic
    monitor involved
    in the analysing vi that you like to build.
    Thanks in advance,
    Tom
    hans wrote:
    > Hello,
    >
    > I have to analyse a great amount of data (more than 20MByte), that I
    > read from a logfile. I can't split these data into smaller parts
    > because some of my analysis-methods need all data (regression,....).
    >
    > Are there any tricks for LabVIEW (5.0.1), how to handle big amounts of
    > data?
    >
    > hans

  • How to handle a big number of users on our website

    Hello,
    We are working on UCM 10gR3.
    We made a web site with Site Studio and now we are testing the web
    site with a big number of users : the number of users increase one by
    one each interval of time until 500 users.
    For this test, we first set :
    - NumConnections=100 (number of connections to the database)
    - CachedResultRowCount=40000 (number of rows in the cache)
    With this set up, the server became unreachable with 250 users. We
    noticed that at this time, the number of threads were stuck to 100 and
    the cache was full (we saw these information in the "System Audit
    Information page").
    Then we restarted the tests with :
    - NumConnections=100
    - CachedResultRowCount=40000
    - MaxRequestThreadCount=500
    With this configuration we went until 400 users but then, the server
    was unreachable. With this test, the number of threads was still stuck
    to 100 (even if we set 500) and the cache was full when the server failed.
    Does anyone have any tips, knowledge, clue about at least one of this
    variable or about how to handle a lot of connections to a web site
    made by Site Studio ?
    Any little detail could be very helpful to us.
    It is very urgent because we are running the final tests in 9 hours !
    Thank you in advance.
    Julian

    Thank you for this answer.
    However, I am looking for indications about the UCM configuration only.
    Specially the following variables :
    - NumConnections
    - SearchCacheCleanerInterval
    - MaxSearchConnections
    - CachedResultRowCount
    - MaxRequestThreadCount
    Regards,

  • How to find the number of references to an object in a big application

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please don't post the same question multiple times.
    I've answered your question in the other thread here:
    http://forum.java.sun.com/thread.jspa?messageID=4312939

  • How to handle different languages in Illustrator for big clients?

    Hi Guys,
    I need small suggestio for 'How to handle different languages in illustrator for big clients'. For instance; Arabic, this is a language which  needs to be read from right to left instead of left to right. There are  other strange languages as well (Cyrillic, Chinese etc.). It happens  also that when you copy strange languages from a word file it will not  be easy to paste it the correct way in a .ai file. Besides that, it’s  also difficult to do a language check when we are not able to read it!. So,  to make a long story short, I want to figure out how we can deal with multiple language  circles?
    Can you some please give me the solution for this...
    Thanks in advance...
    HARI

    I take it you might come from an arabic background.
    Here is how you can help yourself to some degree.
    Google has a translation feature and service which is at the moment free. It is excellent.
    Secondly if you are working with ME languages you really need the ME version of Illustrator or any other Creative Suites Application in order for it to work properly.
    It, is also best to enable the language and the input for that language for your system on the Mac it is easy you go to the Language and text feature in theSystem Preferences, once enabled you can select the fro the menu bar under the American flag if you are in the US. Thst will appear once you have more than one language selected.
    You select the language input you need and then a font for that language then paste and edit.
    You need fonts on your computer that are of those languages as well.
    How to manage this as a work flow well that is something you will have to work on yourself or hire a consultant who specializes in this area.
    We had a few visit here when they have come across a snafu. So they exists.

  • How to handle a Large number of controls?

    I Want to create an application wich will have to handle a lot of controls on it. I know how to get references of this controls, and how to acces them all programatically, but my problem is that there is just to many of them for Laview to run with no lag. It lags badly even on edit mode when I try to place all the controls I need. I think that ther must be a way to do this, since im going to have a lot of controls (look out in the image, I need 10 tabs of each grup with 5 subgrupsgrups on each tab, = 20tabs x 5subgrups x 40tags per subgrup x around 10 controls per tag = 40000 controls) but only a few of them are going to be showing in the front panel since most of them will be out of view. 
    It's there any way I can handle this number of controls, considering I only need to visualize some of them at a given time ?? I have developed a sistem to expand, collapse, scroll up and down and stuff with the controls and it works fine with just a few tabs and subgrups but... I would prefere to stick up with this number of controls, to offer the capacity to expand the tags handled by the program while running, i could go down to a more situable number of controls like (16 tab control grups x 3 subgrups x 20 tags x 10 controls = 9600) wich is still a lot to be honest but I dont undersand why I cannot just have the controls lying on the fron panel doing nothing lags this much.
    Attachments:
    Desing.png ‏402 KB

    I recently wrote some articles about this very subject:
    Monster Panel I
    Monster Panel II
    Monster Panel III
    Monster Panel IV
    Monster Panel V
    I have almost 13000 controls/indicators on one VI panel (and four such windows in the program).
    Perhaps there are some tips to help you.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How To Handle Stale Stats Scenario.

    hi ,
    I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
          My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
          below is my query:
          select /*+gather_plan_statistics*/* from tab1         
          where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
    Plan hash value: 3167980259
    | Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
    |*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
         Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
         So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AM

    930254 wrote:
    hi ,
    I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
          My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
          below is my query:
          select /*+gather_plan_statistics*/* from tab1         
          where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
    Plan hash value: 3167980259
    | Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
    |*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
         Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
         So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AMUm, refresh the stats on a regular basis?
    Oracle 10 and later has a default job to do that. Runs at 2200 daily.
    If you need an 'on demand' refresh, that's easy enough to set up.

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

Maybe you are looking for

  • Check Payment advice through EDI

    Hi, I need a solution to send the payment advice to bank through EDI. For that i created partner profiles for vendor and bank. I activated EDI in vendor master also. And i attached EDI accompaying sheet also to the FBZP t code. for this we created a

  • UpdateVersion call from VersionManager  throws UnexpectedItemType error

    I tried to use updateVersion to update Comment of an current version. However I got a fault with the following exeption. I have no problem calling listVersions call. The source code is attached after the eror message. What could be problem? here 3 Ax

  • Iphoto screen saver is gone

    I just got my Macbook Pro and migrated from my old powerbook. The screen saver I run is the one that displays iphoto pictures and I had it filtered to show the last 12 months pictures. That is gone now in sys prefs. The only option in screen savers i

  • Can't register APP together with MacbookAir

    I bought the APP for Macbook Air and about to register it together with Thunderbolt Display which I bought the same time with Macbook Air. I can't pass the verification step of entering serial number for Thunderbolt Display. It keeps telling me that

  • How can I hide scrollbars in gui objects?

    Hello, I want to hide the scrollbars of a gui container but I can not find a way to do it. If you know how to do it in gui container or other objects please let me know. Thanks in advanced, Udi dekel.