How to get a formula from the user from a text box in a webpage

Hi. I would like to know how to get the formula from the user who enters in a textbox. This formula can have any number of variables starting with a and goes on.
The complexity of the formula can go upto sin, cos, ln, exp. Also user enters the minimum and maximum values of these variables. Based on a specific algorithm (which I use) I would calculate a *set of values, say 10, for each of these variables, substitute in the formula and based on the result of this formula, I select ONE suitable  value for each of the variables.
I don't know how to get this formula (which most likely to be different each time) and substitute the values *which I found earlier.
Kindly help me out in this issue.
Thanks

The textbox is the easy part. It's no different than getting a String parameter out of an HTTP request.
The hard part is parsing the String into a "formula" for evaluation. You'll have to write a parser or find one.
Google for "Java math expression parser" and see what you get.
Or write your own with JavaCC.
%

Similar Messages

  • How to get personnel number of the user in the wd java code in Leave reques

    Hi all,
    we are using the standard Leave Request Applicatin ESS.
    can any one please tell me how to get the personnel number of the user in the WD java code?
    cause i have pass the pernr number to a bapi and get the details.
    please help me its urgent.
    thanks in advance.

    Hi Madhu,
    Create a model for the particular bapi in wd java and acess it in your component. Then pernr parameter will be available in the context and u can pass value for the parameter (pernr) to the model and get the output.
    If you hav any doubt, please let me know.
    Regards,
    Jithin

  • How to get real size of the JLable with wrapped text

    Hello all,
    I have a JLable, which should display error message or some tips to the user. Text can have different length. Something like this:
    jlblText.setText("<html><body>Error. Please do this and that. </body></html>")
    view.pack();The lable is on the top of the JDialog.
    If user typed wrong data, an error message will be displayed in the lable. If the text is too long, jlable will be wrapped. JDialog should also adjust it's size, so I use pack().
    In this case nothing happens. I wanted to get the height of the component and to increase the size of the JDialog, but
    System.out.println("height = "+view.jlblText().getHeight());returns the same result all time. No matter whether the lable contains 20 lines or just some words.
    Is it possible to automatically adjust the size of the JDialog, if the size of the JLable is changed?
    In this case I can't use JScrollPane.
    Thanks in advance.

    component listener solved the problem.
    Try something like:
    label.setText(....);
    SwingUtilities.invokeLater(new Runnable()
         public void run()
              frame.pack();
    This construction didn't do the trick. I tryed to invoke this.pack() of my JDialog in a run method.
    I am still wonder, why only the component listener get the right (actual) value, and the getHeight() method called after the setText method returns the old value.

  • 0 down vote favorite share [fb] share [tw]        How to hide cut/copy/paste/Replace- menu on the UIWebView when it is being displayed over the keyboard.  Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text b

    How to hide cut/copy/paste/Replace… menu on the UIWebView when it is being displayed over the keyboard.
    Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text box it shows the keyboard. Now If user tap and hold on text box it shows a popup menu. Now while keyboard and pop up are being displayed user scrolls the view. At this time it shows pop up over the keyboard which I need to hide.
    I tried setMenuVisible of UIMenuController when popup rect and keyboard rect intersects each other on viewDidScroll but it didn't help me.
    Any clues will help a lot.
    Thanks.

    You are more likely to get an answer if you post programming problems to the Developer forum. This forum is intended for normal user level problems.

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • I have a Verizon IPhone 4 and i can't figure out how to get my ringtones from an app to my iTunes account, it doesn't have a tab for Ringtones! I have tried unplugging it and checking if would show up but it didn't, how do you enable the ringtone folder?

    I have a verizon IPhone and i can't figure out how to get my ringtones from the app to iTunes, my account doesn't have a ringtone section in the liRingtone Folder?brary, how do you enable the ringtone folder?

    Edit > Preferences.  Select the check box for Ringtones, this will add them to the listing in iTunes. 
    Not sure that really answers your question though.

  • The curser includes a text box from a previous image or link when the curser is positioned on the side of the page. i click and it goes away but only to return again on the next launched page. how do i get rid of this?

    the cursor includes a text box from a previous image or link when the cursor is positioned on the side of the page. it will mainly happen when i hit "back" from the page i was on. i click and it goes away but only to return again on the next launched page. i also keep several tabs open and it will carry over to any one of them i go to. how do i get rid of this?
    == This happened ==
    Every time Firefox opened
    == when i upgraded to most recent version 3.6.8

    A number of extensions can cause that problem, you'll need to do a little troubleshooting to find out which extension is causing that to happen for you.
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • My iPhone was stolen.  How do I retrieve the pictures etc that were on imt.  I know they must be in the iCloud but I don't know how to get into it from my iPad.  Also, I would like to try to locate the phone ...how do I do that from my iPad?

    My iPhone was stolen.  How do I retrieve the pictures etc that were on imt.  I know they must be in the iCloud but I don't know how to get into it from my iPad.  Also, I would like to try to locate the phone ...how do I do that from my iPad?

    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
     Cheers, Tom

  • I excluded iphone from controls in Keynote. How I get it back on the list to use Keynote remote?

    I excluded iphone from controls in Keynote. How I get it back on the list to use Keynote remote?

    Welcome to the Apple Community.
    If you haven't turned find my phone off on the device, it should just reappear next time it is connected to an appropriate network. If you have turned off find my phone, turn it back on.

  • I am using the window xp and firefox 6. I see many videos on youtube. How I get that videos from the catch folder and where is it?

    I am using the window xp and firefox 6.
    I watch the youtube videos online.
    How I get that video from the catch folder and where that catch folder are situated in the window xp.

    ''How can I view or retrieve a video from Firefox's cache''
    To actually view/retrieve the file from the cache and its web address you can use
    the "Cache Viewer" extension 32.8KB
    * https://addons.mozilla.org/firefox/addon/cacheviewer/
    * http://dmcritchie.mvps.org/firefox/firefox.htm#cacheviewer
    For you to be able to view the cached file you would have had to have watched the entire file.
    The latest version of the extension is 0.7b available in all versions you would have to override compatibility by any of these methods
    * checking or pick up one of the xpi versions in the reader comments for Firefox 6.0
    * extensions.checkCompatibility.6.0 set to False
    *: http://kb.mozillazine.org/Extensions.checkCompatibility
    * or with an extension "Add-on Compatibility Reporter" (84.0 KB) seems preferred in this group
    *:https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/
    There are also extensions such as Video downloader 132.8 KB
    * Download YouTube Videos + Flash Video Downloader / Download-Helper
    *:https://addons.mozilla.org/firefox/addon/download-youtube-videos/
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem after you've tried several things.</small>

  • What is a user parameter list in iMovie? I am trying to sent the movie from imovie to idvd and I keep getting an error with the user parameter list. Help?

    What is a user parameter list in iMovie? I am trying to sent the movie from imovie to idvd and I keep getting an error with the user parameter list. Help?

    Can you give more details?   What exactly is the entire error message text?  there should be an error number too.   Are you trying to finalize this to an external disk?

  • Restored my 4S. How to get pictures back from the cloud?

    Background: I had a 3GS and on launchday of the 4S I picked one up. A white 32GB on AT&T to be exact.
    I had been having some issues with the battery, so today I figured I'd try and start fresh. Well, I backed up everything on the cloud, and I also backed up everything onto the computer in iTunes when I did the restore.
    I've got my music back. Cool.
    I've got my apps back. Great.
    I can't seem to figure out how to get my photos from the camera roll back. Nor do I know how or if it is even possible to get the photos and my old text messages back on this new restore. Also, none of my mail is coming back either.
    I can see my most recent backup in the iphone settings under iCloud. And I can also see my most recent computer backup on the computer. But I'm not sure what I need to do.
    Any help would be great. Thanks.

    OK - understood.
    There are a couple of ways of going about this. First, my recommended method:
    Restore from a backup (so your photos, SMS etc are on the phone
    Connect to iTunes
    Set the phone to sync photos to a relevant app on your desktop (what app depends whether you're Windows or Mac) - this gets your pics onto the desktop and safe.
    If you want to save SMS, use PhoneView (Mac) or TouchCopy (Windows) or similar to copy them off the phone
    Restore the phone as a new device
    Get the photos back the way you got music etc back - via iTunes sync
    The second method entails using one of the utuilities around the place that can extract from the backup - I have no experience with them, so I don't know how well they work. That's why I go for the first method - simpler, more robust.
    By the way, I came across this other method for SMS:
    http://hints.macworld.com/article.php?story=20090624022758268
    Hope this helps

  • I just updated the software on my iPhone to the ios5. I've gotten everything to synce but my ringtones. Does anyone know how to get my ringtones from my iTunes onto my iPhone???

    I just updated the software on my iPhone to the ios5. I've gotten everything to synce but my ringtones. Does anyone know how to get my ringtones from my iTunes onto my iPhone???

    Try this thread >  http://www.mac-forums.com/forums/ios-apps/253296-ios-5-not-syncing-purchased-rin gtones.html
    edit by: cs

  • How to get column value from DB grid

    Hi!
    I wander how to get col value from GridControl?
    My app consists of one rowsetinfo with two
    columns CODE and DESCRIPTION and a jbutton
    titled SELECT. When user clicks SELECT button
    the app should show the value of the CODE col
    of the selected row in GridControl.
    I wander how to make this action ?
    XxpsTransTimesMasterIter.setAttributeInfo( new AttributeInfo[] {
    CODEXxpsTransTimesMasterIter,
    DESCRIPTIONXxpsTransTimesMasterIter} );
    XxpsTransTimesMasterIter.setName("XxpsTransTimes");
    XxpsTransTimesMasterIter.setQueryInfo(new QueryInfo(
    "XxpsTransTimesMasterIterViewUsage",
    "lov.XxpsTransTimes",
    "CODE, DESCRIPTION",
    "XXPS_TRANS_TIMES",
    null,
    null
    ));

    Hi,
    You could attach an ActionListener on the JButton, and try the following code :
    NavigationManager fm = NavigationManager.getNavigationManager();
    DataItem dataItem = fm.getFocusedControl().getDataItem();
    ImmediateAccess col_code = null;
    String code = null;
    if (dataItem != null && dataItem instanceof RowsetAccess) {
    RowsetAccess rowset = (RowsetAccess)dataItem;
    try {
    col_code = (ImmediateAccess) rowset.getColumnItem("CODE");
    code = col_code.getValueAsString();
    } catch (DuplicateColumnException de) {
    return;
    } catch (ColumnNotFoundException ce) {
    return;
    } catch (SQLException se) {
    return;
    JTextField tf = new JtextField();
    tf.setText(code);
    I haven't tested this code.
    I am curious to know, the Object type of the dataItem.If it doesnot happen to be RowsetAccess ..try.. ScrollableRowsetAccess OR ImmediateAccess.
    Your code would change accordingly, depending on the instance.Refer to the product documentation for this.
    Do let me know, if this works.
    TIA
    Sandeep

  • How to get selected value from OADefaultListBean.

    Hi All,
    How to get selected value from OADefaultListBean ?
    Thanks,

    Hi,
    To identify the user's selection(s) when the page is submitted, you would add the following logic to your processFormRequest() method:
    OADefaultListBean list =
    (OADefaultListBean)webBean.findChildRecursive("positionsList");
    String name = list.getName();
    String[] selectedValues = pageContext.getParameterValues(name);
    To retrieve all the values in the list box, call list.getOptionsData().
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • N82: Nokia Software Update doesn't find the phone

    Hello, I am trying to update the firmware of my Nokia N82, but I get an error message from Nokia Software Updater saying that it doesn't find the phone. I find that strange as Nokia PC Suite indeed finds the phone. The icon on the taskbar says that "

  • Problem with displaying images belonging to one keyword

    Hi, There seems to be a minor bug in Lightroom (since version 3): If I have no filter enabled and click on the little arrow next to a keyword, I get a result that is unrelated to the keyword. If I click it again, it works. So it seems that the featur

  • Youtube: security sandbox violation

    Does anybody have a recipe for loading the AS3 chromeless player into a Flex application such that you don't get the 'incompatible context' errors constantly? *** Security Sandbox Violation *** SecurityDomain 'http://core-dev.thismoment.com/client/De

  • Hyperion Strategic Finance problem with consolidation

    Hi, I'm currently working with HSF version 11.1.1.1 and i have encountered some problems with the consolidator. I have a group of entities, each one with a different structure (subaccounts, dimensions, etc.) and during the consolidation process there

  • Problems in HelloWorldImp.c compilation

    Hi I'm newbie to this JNI. i wrote a sample program "HelloWorld.java" as guided in sun's jni tutorial. but when i come to creating shared libraries step i'm getting error like [root@B138 JNI]# cc -G -I/opt/j2sdk_nb/j2sdk1.4.2/include -I/opt/j2sdk_nb/