Parsing expressions back and forth

I'm using JEP ( http://www.singularsys.com/jep/ ) to parse expressions and calculate values from bytes. I'm trying to avoid having to have my users create an expression to calculate the real value and back to the byte.
Right now, I'm looping through (while i < 255) and for a single byte, that seems to be fine. However, there are times I have to test two bytes (65536) and perhaps more, and its way too slow. I was just wondering if there is another option.
Below is an example of the relevent code -- it's really ugly and it's not quite working properly for multiple bytes, but I'd like to find a better solution rather than messing with this. Thanks for the help!
        double previousValue = 0;
        int input = Integer.parseInt(inputString);
        boolean isInverse = false;
        // check whether expression is division
        if (table.getScale().getIncrement() < 0) {
            isInverse = true;
            previousValue = calcDisplayValue(2);
        for (int i = 0; i < Math.pow(256, table.getStorageType()); i += Math.pow(256, table.getStorageType() - 1)) {
            if (!(isInverse && i == 0)) {
                double nextValue = calcDisplayValue(i);
                if (input <= Math.max(previousValue, nextValue) && input >= Math.min(previousValue, nextValue)) {
                    if (i < Math.pow(256, table.getStorageType() - 1)) {                       
                        if (input - nextValue < input - previousValue) setBinValue(i - 1);
                        else setBinValue(i);
                        break;                   
                    } else {
                        for (int z = 0; z < 256; z++) {                          
                            nextValue = calcDisplayValue(i + z);             
                            if (input <= Math.max(previousValue, nextValue) && input >= Math.min(previousValue, nextValue)) {                     
                                if (input - nextValue < input - previousValue) setBinValue(i * 256 + z - 1);
                                else setBinValue(i * 256 + z);
                                break;          
                            } else previousValue = nextValue;
                } else previousValue = nextValue;
    }

I found a library called XJEP which will apparantly parse complete equations instead of just expressions, but this will double the size of my application. Are there any other options?

Similar Messages

  • On my imac, All of a sudden I am unable to send original emails with any attachments.  I can attach the file but when I try to send it, it won't send.  Also, if I am emailing back and forth as it gets longer, it no longer transmits

    On my imax, all of a sudden I am unable to send original emails with attachments of any size.  I can attached the file but when I try to transmit, it will not go.
    Also, if I am emailing back and forth, once there gets to be several threads, it will no longer transmit.  Any suggestions. I am using gmail in the apple mail system

    Mike,
    Are any of your other applications going wonky, or is it just Logic?
    I'm afraid I've never heard of this particular problem before, but if it were happening to me the first thing I would do is delete my "com.apple.logic.express.plist" file in Library>Preferences, then repair permissions in Disc Utility, and finally restart my computer.  Then I would launch Logic and see if the problem has been corrected.  It's amazing how much these two steps can accomplish.
    If that doesn't resolve the issue I would launch Logic and go to Preferences>Audio Units Manager to see if all my plug-ins are properly validated.

  • Back and Forth Logic in process-controlled (BRF) workflows in SRM 7.0

    Hi all,
    I am using the process-controlled workflow in SRM 7.0.
    The approval itself works ok, but now I am trying to set up the back-and-forth functionality (similar to how it worked for the Badi in SRM 5.0) as default:
    This is what happens:
    Requester creates shopping cart.
    Shopping cart goes for approval.
    Approver rejects SC.
    Back at the requester the SC can only be displayed, but not changed.
    As far as I can tell this happens for any kind of decision set (as long as all items are rejected).
    This is what I am trying to set up.:
    Once the SC is back at the requester, he can either accept the rejection OR change the SC and 're-order' it ie send it back to approver again.
    I know if the requester checks the flag 'Work Item to Requester at Process End' this can be done, but I need the system to have this functionality automatically without setting a flag manually.
    I really appreciate any suggestions on this issue.
    Cheers
    Ulrike

    Dear Masa,
    thanks for your helpful answer. I have an better idea now, but I am still not quite able to set it up.
    I have applied note 1296209.
    When i tried to set up this step I did the following:
    level type of that step I used 'Approval with completion'.
    Created Expression of type SAP Formula Interpreter, with return type Boolean, and use formula:
    0V_WF_CURRENT_DECISI = 'REJECTED'
    linked the evaluation id to above expression.
    Task id for the step is: 40007994 - Accept Decision / Adjust Document
    When i do this and create a SC, my system dumps after clicking on describe requirement::
      The following error text was processed in the system SR7 :  The method could not be found at dynamic call.
    The error occurred on the application server SAP01_SR7_07 and in the work process 1 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
          Method: CALL_RFW of program /SAPSRM/CL_WF_RULE_CONTEXT====CP
          Function: /SAPSRM/WF_BRF_0EXP000 of program /SAPSRM/SAPLWF_BRF_DATA
          Method: PROCESS_SPECIFIC of program CL_CALL_FUNC_METHOD_BRF=======CP
          Method: IF_RULE_COMPONENT_BRF~PROCESS of program CL_EXPRESSION_BASE_BRF========CP
          Method: GET_RESULT of program CL_EXPRESSION_POOL_BRF========CP
          Method: IF_EXPRESSION_BRF~GET_SUBEXPRESSION of program CL_EXPRESSION_BASE_BRF========CP
          Method: IF_FOEV_CONNECTOR~EVALUATE of program CL_FORMULA_BRF================CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
    What I don't understand about your explanation is what you mean by "Acceptance by Contact person". I don't have that option anywhere in my BRF? Is that supposed to show up under Resp. Resolver Name (like RR_MANAGER)?
    Also where did you add that step in Process level configuration? I have 2 approval steps (just approval, without completion) and then i wanted to enter this step after those levels before the automatic system decision.  But i wasn't able as the system doesn't allow you to add a completion step after a 'normal' approval step.
    Cheers for your help
    Ulrike

  • Need multiple 'MAIL' Icons.   Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain

    Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain the butt.  This has been a request from Apple users for many years.    it's great you can now combine all emails into one, but some people want them kept separate and have separate icons on the main page.   They could easily do this by having one "MAIL" account as white and another red.  Or put MAIL 1 and MAIL 2.    Or an actual label that the mail accounts are called on the ICONS!!  
    Help!

    eshghoolak wrote:
    ...I could switch back and forth between accounts while in the mailbox, with one button.  I think that is what you are referring to?  Whoever said it's just a simple switching - you obviously haven't had the pleasure of using an Android device.  It's not that quick to go back and forth - definitely not efficient...
    Not that it matters a lot, Android vs iPhone interface is largely a matter of personal preference and what you know... I'm not sure which one you're saying is not efficient...
    In any event...
    I currently have two email accounts setup.  My iPhone main page Mailbox settings reads:
    Mailboxes
    Inboxes
    All Inboxes
    Gmail
    [email protected]
    Accounts
    Gmail
    [email protected]
    I wish there an efficient way to move back and forth while in the "Inbox" between accounts.  Also, Why does one gmail account show as "Gmail" and another as the actually address?
    The names are based on the names you gave the accounts when you set them up.
    Settings>Mail, Contacts, Calendars.
    Tap the account you want to re-name. Go to the "Description" field and put in what ever you want.
    Second, there is no way to quickly choose a bunch of emails to delete. I have to manually go into each one and move it to the Trash folder.
    If you tap the edit button in the upper right while in mail, you can select multiple items to move, delete or mark (flag).
    I don't want any of the condescending remarks, that I've read here and in other forums.  I'm honestly looking for a solution, which I think you are too!  One thing I realized is that iPhone users in these forums are really defensive and quick to say "that's how it is, live with it, if you don't like it go away"  Um...the only thing that tells me is you are pretty bitter and have kept telling yourself that, to force yourself to like your device.  I prefer to express my issues, and find solutions.  There is ALWAYS a solution...
    I think what you will find is that many people here, myself included, tend to get a bit short with people who start off with attacks or whining about how something has been asked for for years and should be easy, rant about things that have already been beaten to death multiple times in the forums, talk about how much better Android or BB are at something (really... if it's that much better, why did they buy an iPhone to begin with?), etc., or continue to ask questions that could easily be answered with a simple search, or even just by looking back at the last dozen posts to the forum, half of which probably asked the EXACT SAME question.
    I don't think any of us go out of our way to be rude or uncivil.  That said, attacking the people who are attempting to help you is much more likely to generate a response of 'if you don't like it, go away', than it is to generate something that will be truly helpful.

  • I use my ipod for audible books downloads. In the past I have been able to move books back and forth from library to ipod according to what I was listening to.  I can no longer retreive books in the library. Any suggestions?

    I use  my 6th generation Ipod strictly for Audible downloads.  In the past, I have been able to move titles back and forth from the Ipod and my Itunes library, to control the amount books on the ipod. Recently, an exclamation mark has appeared next to the titles as I try to transfer to the ipod, and the book does not transfer.  Any suggestions on how to regain access to my purchased library? 

    1. You did not get an error message telling you that your iPhoto library was getting full. You got a message telling you that your HD was getting full, right?
    OS X needs about 10 gigs of hard drive space for normal OS operations - things like virtual memory, temporary files and so on.
    Without this space your Mac will slow down as the OS hunts for space on the disk, files will be fragmented, also slowing things down, apps will crash and the risk of data corruption - that is damage to your files, photos, music - increases exponentially.
    Your first priority is to make more space on that HD. Nothing else can be done until you do.
    Purchase an external HD and move your Photos and Music to it. Both iPhoto and iTunes can run perfectly well with the Library on an external disk.
    Your Library has been damaged from being run on an overfull disk.
    How much free space on it now?

  • Can you move files back and forth between an iPad and a PC using iTunes?

    If I read this article correctly, http://support.apple.com/kb/ht4094 I should be able to connect my iPad to my PC, fire up iTunes and then on the Apps tab in iTunes I should be able to click on an app, Pages for example and then just drag files onto the Pages Documents column from a Windows Explorer window.
    This is great.  I was hoping to use DropBox but it is such a hassle I don't know why people are so thrilled with DropBox on iPad.  If I can just move files back and forth using iTunes that should be fairly easy.  I wish there was a way to just upload my files to iCloud from my PC but the iCloud control panel app for Windows only seems to connect Outlook, Photostream and Bookmarks. I want to be able to just carry my iPad and not have to deal with a computer. 
    I thought that they said that you didn't need to have a computer to have an iPad.  I guess if you have a computer and then GET an iPad its a different story, unless you have a Mac of course.
    Anyway my question is: can you move files back and forth between a PC and an iPad using just iTunes?

    I still need to do some trial and error testing with DropBox and my iPad.  But can I link my iPad to my DropBox account so that I can always see the files on DropBox when I open Pages on my iPad?  I just want one place to store my documents, and iCloud doesn't seem to be up to the task when it comes to opening a fil;e, editing it and then saving it back to iCloud.  I just want a networked storage location that works like a networked drive on my LAN.
    I realize that hollywood and the music industry are up in arms about file sharing on the Cloud which is why so many things are made more difficult than they need to be. 

  • How can I toggle back and forth from a main pdf to its attachments?

    I have a main document that I created in word and inserted hypertext to either link to 1) websites 2) a series of appendices, 3) 6 large format pdf maps or 3) a series of reference documents.
    In Word, I have everything in a thumbdrive directory with the main file and three folders holding the individual files of the maps, appendices and references. All the links work but the file can't be copied to another drive without redoing all the links to the files (there are about 40 files all together).
    I saved the word main document as a pdf. All the auxiliary files are also pdfs. All the weblinks came through in the pdf of the main document but the links to files need to be re-established.
    1. I tried to create an acrobat portfolio with the main file and the folders of maps, references and appendices but I can't seem to make links in the main document to open up specific files in the folders.
    2. I compiled all the files together into a binder and tried to use bookmarks to link the main part of the document to the first page of the 40 supporting files but at 700 pages the document is just too cumbersome to recreate the ~100 bookmarks I would need to add.
    3. I tried adding everything as attachments and created links but once the link is activated from the main document and the new window opens, the main document has closed up. I need the reader to be able to toggle back and forth between the screen with the main document and the supporting documents.
    What I am trying to create is one main document with links to the maps, appendices and references that will open a new window when each link is activated. Then the new window can be closed and the reader is back at the screen of the main document on the page with the link they just used.
    This doesn't seem to me like it should be difficult since it almost works in Word except for the file structure.
    I would really appreciate any guidance on how to make this work. The document and supporting files have already taken more than a year to put together and I'm stuck at this last step.

    I think that the number of clicks to open a file is a rather shortsighted way to compare two operating systems.<<</div>
    Well excuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuse ME!
    I happen to think it's a pain to click twice on files when I'm used to clicking just once.
    But Tiger is a nice operating system. I enjoy that it has much more capabilities than the OS9. I mean, Tiger keeps up with the advancing internet. My beef is really against OS9. I can open OS9 in Tiger but not Tiger in OS9.

  • Is there a way to have Safari not reload the page when moving back and forth?

    I really like being able to swipe back and forth in Safari, however when I do this, it reloads the page. Why? Can't it just used the cached content? I understand that my view my be 'outdated', but I could always manually refresh if I wanted to.
    The reason I want this is because when you swipe back, it takes a few seconds before you can actually scroll the page while you wait for it to load, which is annoying

    Might be a cache issue ...
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following:
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.

  • My iPod touch 4 is not operating. Whenever I try to type in my pssword, the logo shows up. And this just goes back and forth. What should I do??

    This started a week ago, I turned off my ipod, and it could not be turned back on again. So I held the sleep button and the home button simultaneously for ten seconds, and my iPod responded, the logo appeared. And my iPod worked perfectly for a week, when the same problem appeared last night, I tried to use the tip which I used last week. But a new problem appeared. The logo showed up, and when I tried to type in my password, the logo appear on the screen again, and this just goes back and forth. I can't type in my password. This is driving me crazy, Pleeeeaze, someone please help me!!!!

    Have you tried connecting the iPod to your computer and restoring the iPod?

  • How can I use Mac OS 10.4.11 and 10.5.5 back and forth?

    I installed Mac OS 10.5.5 onto my G4 Sawtooth, which is running on an upgrade processor at 1.3 GHz and 2 GB RAM. The machine also has been running with Mac OS 10.4.11. I love both Mac OSs. But it is cumbersome to restart the machine back and forth. Is there anyway that I do not have to restart the machine for switching the Mac OSs?
    Thanks.
    Robert

    I'll check with OWC and see what they say. I have an ACARD 6880M AEC Controller attached to two internal HD. It caused two Maxtor HD,on e after the other, click-to-death. Since that, I removed the ACARD and have been using one HD without any more "clicking" noise. I posted in the thread below about my experience. Nobody had similar experience. Nevertheless, if OWC feels that ACARD can work with both Mac OS 10.5 and 10.4 at same time, I may consider to put the ACARD back and place another HD in and see if it works.
    http://discussions.apple.com/thread.jspa?threadID=1127045
    Thanks.
    Robert

  • I have an IPod 2nd generation I bought from a pawn shop.  It worked for a day but now when I try to charge it, it keeps switching back and forth from the large full screen icon of a low battery and a lighting bolt below to the blue screen with the apple s

    I have an IPod 2nd generation I bought from a pawn shop.  It worked for a day but now when I try to charge it, it keeps switching back and forth from the large full screen icon of a low battery and a lighting bolt below to the blue screen with the apple symbol in the middle.  I had it on charge all night but still dead.

    Try here.
    iPod touch: Hardware troubleshooting
    You may have a hardware problem.

  • Can photos be transferred back and forth from/to iPhoto and an external drive? If so, how?

    Can photos be transferred back and forth from/to iPhoto and an external drive? If so, how?

    When in iPhoto for iOS you can share your photo to iTunes and then connect your iPad to your computer and use the file sharing window to move the photo to any connected hard disk. Sharing to iTunes is the only way to maintain original file size when sharing a photo in iPhoto for iOS.

  • IPhoto 8.1.2 - on a teacher's iBook: Worked flawlessly 2 weeks ago. Now it continues to lock up, it often will not import scans, I can not rotate a picture - it just flips back and forth. HELP I need to get a project out!

    I created a beautiful Keepsake book a week or so ago. It worked flawlessly. Since - I've had several problems (nothing has changed on the computer/system). iPhoto will frequently lock up causing me to force quit. Other times, upon opening, it says that I don't have permission or something to open it. It often is not importing a scan saying it is an unrecognizable format (it's what I used before). When trying to rotate a photo it keeps flipping back and forth and wont stay put.
    iPhoto 8.1.2
    I've run Disk Utilities multiple times - fixes for about 1-2 scans/launches of iPhoto
    I've restarted the computer.
    I've tried to update - but can't locate a version my computer will allow me to update to.
    Using an HP C3180 scanner/printer --- that is also recently not working ---- locks up, takes FOREVER to scan and then show up on the desktop.
    HELP ME!!!! We're trying to get 2 books out for our students before the end of the school year.
    Thanks

    Sounds like your Library is corrupted to me. Simple solution: restore form your back up.
    Other than that:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Can I make a second libary on a second hard drive and how do I switch back and forth

    I woud like to creat a second libary for itunes on a second hard drive.  I am using the latest itunes and lion on my imac and how do I switch back and forth.

    Yes. You can.
    Start iTunes with the Option depressed and that will allow you to select the library.
    Allan

  • Once bootcamp is installed on my Mac, how easy is it to go back and forth from windows to Mac? Just a press of button or do I have to completely log off of one to go to the other?

    Once bootcamp is installed on my Mac, how easy is it to go back and forth from windows to Mac? Just a press of button or do I have to completely log off of one to go to the other?

    Using vitual machine programs (VirtualBox, Parallels, VMWare Fusion) you can run both at the same time.
    Load Windows under BootCamp.  Then load the VM software and select the existing BootCamp partition as the "virtualized space".
    But ... BootCamp first, following Csound1's advice about backups.  And you will wantto boost RAM most likely because you need to allocate certain amount of system RAM to each "virtual machine", as well as leaving some for OSX.
    But ... BootCamp first.

Maybe you are looking for