How can i perform operations on a string written as an algebraic expression

i need help...how can i have a program that a string like this ---"1 + 2 + 3"---could be read as integers and you can actually come to a single result using the precedence of operations...

epoy wrote:
i need help...how can i have a program that a string like this ---"1 + 2 + 3"---could be read as integers and you can actually come to a single result using the precedence of operations...That's not as easy as it sounds.
If you only have fairly simple mathematical expressions have a look at:
- if you have JDK 1.6, see reply #7 [http://forums.sun.com/thread.jspa?threadID=5144807]
- or if you have JDK 1.5 (or less), have a look at reply #12 from the same thread.
If you need more fancy math functions, Google for "JEP", or "mathematical expression parser".
Good luck.

Similar Messages

  • How can I perform a bulk assignment to one Task

    Hi All,
    I would like to allow all resources to assign some of their time to a cProjects Task (XXXX Implementation plan). How can I perform a bulk assignment to this task, instead of performing individual assignments?
    Please help.
    Thanks,
    Srini

    Not quite sure I fully understand your question. When you go to the "roles" tab of a task you are allowed to assign multiple resources to a task either from the same role or different roles. The total work or effort for the task can be distributed accross the multiple assignments.

  • I am using i 4 phone. recently I had a problem with my lap top and had formatted hard disk of it. Now I want to use sync data in my iphone back to itune n my lap top. how can I perform this task with out loosing data in my i phone.

    I am using i 4 phone. recently I had a problem with my lap top and had formatted hard disk of it. Now I want to sync data in my iphone back to itune on my lap top. how can I perform this task with out loosing data in my i phone.

    Hey floridiansue,
    Do you have an installed email program such as Microsoft Outlook?  If your email is through an online login, such as Gmail, etc, then one will have to create an email association with a program such as Microsoft Outlook on the PC for this Scan to Email system to function.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

  • How can i perform a search on my external hard drive on my mac pro os x 10.9.2 ?

    how can i perform a search on my external hard drive on my mac pro os x 10.9.2 ?

    Mac OS X 10.9.2 is 12 years newer than 9.2.x.    You need to make sure that Spotlight has indexed the external hard drive by adding it and removing it from Apple menu -> System Preferences -> Spotlight -> Privacy.   Check the menu for it:
    to determine if indexing is still going on, as it will say indexing.
    Alternatively, you can use a non-Spotlight tool, such as:
    http://apps.tempel.org/FindAnyFile/
    http://www.devontechnologies.com/products/freeware/ - EasyFind
    http://www.osxbytes.com/ - iFileX (note the MacUpdate link provided on osxbytes page has a Malware advertisement for MacKeeper, do not download).
    http://www.barebones.com/ Textwrangler has a Search file for content, which works on any Text file.

  • How can I perform this kind of range join query using DPL?

    How can I perform this kind of range join query using DPL?
    SELECT * from t where 1<=t.a<=2 and 3<=t.b<=5
    In this pdf : http://www.oracle.com/technology/products/berkeley-db/pdf/performing%20queries%20in%20oracle%20berkeley%20db%20java%20edition.pdf,
    It shows how to perform "Two equality-conditions query on a single primary database" just like SELECT * FROM tab WHERE col1 = A AND col2 = B using entity join class, but it does not give a solution about the range join query.

    I'm sorry, I think I've misled you. I suggested that you perform two queries and then take the intersection of the results. You could do this, but the solution to your query is much simpler. I'll correct my previous message.
    Your query is very simple to implement. You should perform the first part of query to get a cursor on the index for 'a' for the "1<=t.a<=2" part. Then simply iterate over that cursor, and process the entities where the "3<=t.b<=5" expression is true. You don't need a second index (on 'b') or another cursor.
    This is called "filtering" because you're iterating through entities that you obtain from one index, and selecting some entities for processing and discarding others. The white paper you mentioned has an example of filtering in combination with the use of an index.
    An alternative is to reverse the procedure above: use the index for 'b' to get a cursor for the "3<=t.b<=5" part of the query, then iterate and filter the results based on the "1<=t.a<=2" expression.
    If you're concerned about efficiency, you can choose the index (i.e., choose which of these two alternatives to implement) based on which part of the query you believe will return the smallest number of results. The less entities read, the faster the query.
    Contrary to what I said earlier, taking the intersection of two queries that are ANDed doesn't make sense -- filtering is the better solution. However, taking the union of two queries does make sense, when the queries are ORed. Sorry for the confusion.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I copy and forward a string of text messages from a Iphone 5s to an email address

    How can I copy and forward a string of text messages from an IPhone 5S to an Email address?

    You can find my blog post on the same.
    http://www.pointtobenoted.com/blog/technology/mobile/how-to-copy-messages-from-i message/
    The 6 steps process is listed step by step.
    Hope this helps.
    http://www.pointtobenoted.com/

  • How can I perform the conversion of pdf files in Cyrillic script to Word files in Cyrillic script. The pdf file is too small for me to read right now. Julyan Watts

    How can I perform the conversion of .pdf files in Cyrillic script to Word files in Cyrillic script. The .pdf file is too small for me to read without a magnifying glass, and the document is more than one thousand pages.

    This answer was not helpful. First of all, I could not find "tech specs"
    anywhere on the Acrobat 11 homepage. And secondly I purchased this software
    for the specific purpose of converting .pdf files to Word. It was only
    after I had completed the purchase that I learnt that Acrobat does not
    permit the conversion of .pdf files in Cyrillic to Word files  in Cyrillic.
    I feel that Acrobat should have provided this crucial information before I
    allowed my credit card to be debited. That is why I  am now asking for my
    money back. But thanks for your attempt to solve my problem, even if it was
    not successful.
    Julyan Watts

  • HT1766 I have the latest version of iTunes. When I plug my iPhone into the computer, it never comes up under the "Devices" tab in iTunes.  How can I perform a restore/backup if it won't come up under "Devices" ?

    I have the latest version of iTunes. When I plug my iPhone into the computer, it never comes up under the "Devices" tab in iTunes.  How can I perform a restore/backup if it won't come up under "Devices" ?

    See:
    iPhone not recognized in iTunes for Mac
    iPhone not recognized in iTunes for Windows

  • I have about 10000 images of different persons with dimension of 640*480. I wan to crop face from these images to dimension of 200*280. The location of face varies in differnt pics. So, please let me know step by step how can I perform this using the Ligh

    I have about 10000 images of different persons with dimension of 640*480. I wan to crop face from these images to dimension of 200*280. The location of face varies in differnt pics. So, please let me know step by step how can I perform this using the Lightroom software. Also I wan to know what should be the aspect ratio to do so.Thank you in advance

    The aspect ratio should be set to 200x280, or equivalently 5x7.
    I don't think it is possible to do the cropping automatically in Lightroom, you'd have to do this image by image to crop the faces correctly.

  • In sqlserver 2005 there short cut ctrl+N, how can i perform same thing in sqlserver 2008 r2

    In sqlserver 2005 there was short cut ctrl+N, how can i perform same action in sqlserver 2008 r2

    In sqlserver 2005 there short cut ctrl+N, how can i perform same action in sqlserver 2008 r2
    ctrl+N still available in SQL Server 2008 R2, please refer below article for list of shortcut keys.
    http://technet.microsoft.com/en-us/library/ms174205.aspx
    Also refer below article for how to customize shortcut keys.
    http://technet.microsoft.com/en-us/library/ms174178(v=sql.105).aspx
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • HT2518 I migrated from a PC to a Mac Book Pro.  The contacts transferred over to the Mac along with many contacts that I had deleted sometime ago. Also some contacts did not transfer at all.  How can I perform a correct and up to date migration of my cont

    I migrated from a PC to a Mac Book Pro.  The contacts transferred over to the Mac along with many contacts that I had deleted sometime ago.  Also some contacts did not transfer at all. How can I perform a correct and up to date migration of my contacts? 

    well no reply from the community. sniff- do i stink!? - probably a little bit. If i have lost all that data then I'm gonna really really pong.
    Any ways i have purchased a 1tb usb HDD and have managed to duplicate the dmg file onto it. however still unable to mount the **** thing. so now i have ordered disk warrior which will be in my possession tomorrow.
    fingers toes eyes crossed.

  • Hi sir,Please how can i ask operation system for my MacBookPro 15 inch from Appel website ?

    Hi sir,Please how can i ask operation system for my MacBookPro 15 inch from Appel website ?

    Thank you for response , the question is : How can i download operation system from Apple website ?

  • How can I know which clients are connected to my network through express and which are connected through extreme?

    I have an airport express extending, through wireless, a network provided by an airport extreme. How can I know which clients are connected to my network through express and which are connected through extreme?
    Here you can see both routers:
    I would expect to some clients connected to the express, other than the extreme. And that's all I see: only the airport extreme appears as client of the airport express.
    Below, one can see the summary of the config for both routers.
    Would somebody explain it?
    Thanks,
    Marcelo
    Message was edited by: Marcelão

    please disregard this answer.
    Message was edited by: Marcelão

  • I used part of my name in my home network.  Now I understand this was stupid security error.  How can i change the name of my home wifi network, airport express?  Thanks.

    I used part of my name in my home network.  Now I understand this was stupid security error.  How can i change the name of my home wifi network, airport express?  Thanks.

    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click on the picture of the AirPort Express
    Click Edit in the smaller window that appears
    Click the Wireless tab at the top of the next window
    Edit the Wireless Network Name
    Keep it short.....maximum 10-12 characters or so. No blank spaces or punctuation marks in the name
    Click Update at the lower right of the window to save the new setting and wait a full minute for the AirPort to restart

  • How can I turn off the green light indicator on my AirPort Express?

    How can I turn off the green light indicator on my AirPort Express? It really annoys me.

    The Zed,
    You have two options and you probably won't like any of them.
    Using the Airport Utility, click on the AE then "Base Station", then "Options". That will bring up two options for you AE green light, either keep it green at all times or only light up when it is being used.
    The second option is put some tape over it.
    Hope this helps.

Maybe you are looking for

  • [SOLVED] Sluggish perfomance with ATi Rage 128

    Currently I have multiple issues with the following hardware CPU - Intel Pentium III (Katamai) 500Mhz 00:00.0 Host bridge [0600]: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] [1106:0691] (rev 42) 00:01.0 PCI bridge [0604]: VIA Technologies,

  • 2 types of communication method assigned to 1 Vendor Master Record?

    Hi, Do you know if it is possible to have 2 different types of communication methods assigned to 1 vendor master record?  i.e. I want to be able to send out remittance advices via email but send the purchase orders via XML?  The XML is the primary co

  • Bridge CC crashes when opened in Premiere Pro CC

    Bridge CC tends to crash regularly when open in Premiere Pro CC. Sometimes it takes longer to crash than other times. sometimes it doesn't crash at all but it appears if I leave both programs open for an hour and then come back to work on a job it wi

  • Reliable Iteration over a changing queue

    Hello, I have a queue of messages. New messages may be added to the end of the queue and messages may be removed from the begining of the queue on a communications thread. The user may view the messages in a window. I want to implement two buttons fo

  • Encore CS3 crashes when importing Blu-Ray timeline

    In Premiere Pro CS3 I ad the chapter markers and then export to Encore.  In an hour and a half Encore opens says it is importing M2V file and crashes. I tried to import into a new project and it failed also. Sadly it worked perfectly once. Any workar