User Created Equations and program Variables

Is there a way that I can take a user entered equation and apply it as the equation for a value? How can I make a String entered by the user to act as an equation insted of a string?
I've created a part in my program with various mathematic operators as well as user friendly variables. The user selects the operators as well as variables from JComboBoxes. The user-friendly variables are converted to actual variables via a hash and another string is created to represent an equation.
Example:
User selects variables and operators to create:
String UserEquation="(Average Tip)-(Total Fares *.10)";
The above isn't much helpful if it doesn't reference real varaibles. The real equation after applying the hash is:
String RealEquation = "(numbers.get(1) - (numbers.get(3)*.1)";
Note: numbers is a vector of doubles.
How can I get the program to evaluate the "Real Equation" instead of treating it like String?
I would like to do somthing like the following:
double total=RealEquation;
Make Sense?? Is there a way to accomplish this? anyone have any idea how I could do this? Thanks in advance!!!

Or, if speed isnt an issue, search the forum for using J6's scripting support
to use JavaScript for equation evaluation. I posted an example just a couple weeks ago.
Here it is:
http://forum.java.sun.com/thread.jspa?threadID=5228772&messageID=9933551
Reply #8

Similar Messages

  • How to get the user created at and modified at properties for a site collection using powershell

    Hi guys, I Know how to get the list of users of a site collection by Get-SPUser cmdlet but hte problem is that this cmdlet doesnt give me the user Created at and modifed at properties 
    can any one tell me how to get these values via powershell???? 
    ps: ignore the 2013 screenshot.. i just want a way to get those values .. if you provide me solution in either 2010 or 2013 , i will crack the other..
    plz guys help me ...

    Get the User Information list and then get the user from that list
    $web = Get-SPWeb "siteUrl"
    $userInfoList = $web.SiteUserInfoList
    $userItem = $userInfoList.Items[0]; #0 here is just for demonstration. You take the user you want here or loop through all users.
    $created = $userItem["Created"]
    $modified = $userItem["Modified"]

  • Premission settings for users creating files and folder on my XServe

    I am setting up a new Xserve and we are basically using it as a file server. I have a user that logs on creates and new folder and a file. When any one else opens that file it is READ ONLY. What do I need to do to make it so when any of my users create a file or folder on the server any one of my users can have READ/WRITE permission to the files?

    Can you elaborate?  I am not aware of any m3u playlist being present but maybe there is.  I have done this many times before.  I move tons of files around in my music folder, add/delete/change, and rather than have iTunes try to figure it all out again, I just remove everything out of iTunes and add my entire folder back.  I've done it probably 50 times in the past and now, when I do it, it's creating playlists for every single folder or album or something, just as the original poster has described.  I do not like the behavior and would like to turn it off now!  I'm on Mac so iTunes Folder Watch will not work for me.  Any suggestions?

  • How to make an interface between user  created  screen and dxtools table

    Hi friends,
                   I created  my own selection-screen using module pool .I need help about how to join my screen to
    the fields of  DXTOOLS  TABLE .
    This DXTOOLS is a function module for FILE UPLOAD/DOWNLOAD in SAP.
    ie. i have  joined the screens
                      1. OBJECT, PROGRAM TYPE,PROGRAM NAME SCREEN and
                      after clickin COPY BUTTON a screen with these fields appear...
                      2.TARGET/SOURCE - APPLICAITON SERVER,PRESENTATION SERVER..   
    please  help me  about how to join my screen with the table DXTOOLS..
    Thanks,
    Kassim.

    I would try catch block code with [Alert.setCommandListener|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Alert.html#setCommandListener(javax.microedition.lcdui.CommandListener)], roughly like below:
      downloadAlert2 = new Alert("Download error !");
      downloadAlert2.setType(AlertType.ERROR);
      downloadAlert2.setString("Download error : "+e.toString())
      downloadAlert2.setTimeout(Alert.FOREVER);
      downloadAlert2.setCommandListener(new CommandListener() {
        public void commandAction(Command c, Displayable d) {
          if (c == Alert.DISMISS_COMMAND) {
            midlet.platformRequest(downloadURL);
            midlet.notifyDestroyed();
      display.setCurrent(downloadAlert2);//show the Alert  
    }

  • Create Jars and programs for windows environments

    Now I do not really need to make an exe file if I do not have to, but really I am just trying to be able to get my program to work in windows. I can compile and run the program fine in netbeans 5.5 . However I have been looking through documentation on actually creating a program that people can execute and run within a windows environment.
    I have added some jar (java mail api ) files to my lib directory within my project in case that makes a difference for the following.
    I used the build fnc within netbeans to create the jar file of my program, however double clicking the jar file does nothing and I am not able to load up the jar file in any way. What did I do wrong or how should I be doing this as this program is not meant for people to use in netbeans all day.
    I did create a bin file and used the java -jar Email.jar, however I get the following error:
    C:\Documents and Settings\JJBROW4\Desktop>java -jar Email.jar
    Exception in thread "main" java.lang.UnsupportedClassVersionError: email/Main (U
    nsupported major.minor version 50.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    However it compiles fine in netbeans. Is this because of the jar files I added in the lib within netbeans, or is it just not working in general? Any hhelp would be greatly appreciated.

    C:\Documents and Settings\JJBROW4>java -version
    java version "1.3.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
    Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
    So I just need a newer runtime envronment? becuase I checked in the add or remove programs and I have the se Runtime Environment 6 installed as well as the update 1 for it. So I thought that would be ok.

  • How to create,read and update variables in application scope in ejb

    In my project currently i am using three layers
    1. Struts for the presentation web layer(jsp, form beans and action class)
    2. Business logic using ejb.(uses other classes for storing business logic)
    3. Dao for data base object
    I need to implement caching using hashmap in the business logic (ejb). I am getting a path link everytime my business logic access a file. What I need to do is that as many users use the same link , i want to cache it into a hashmap, so that if the same file link is accessed again it can directly got from the hashmap and hence the processing time decreases.
    Please help me how to implement this?
    I have tried the following
    1. get servlet context in the struts action class and pass it to the ejb
    2. Using of static hashmap for storing that....which i cant use coz that hasmap needs to be updated in some other java class
    Awaiting ur reply eagerly

    use CTAS method in your requirement, first before read [b]this
    venki
    http://venki-hb.blogspot.com/

  • How to use create by and modified by

    how to use create by and modified by ?
    when some one create row it will stamp who create
    and when some one edite row it will stamp who edit row
    i ever user create on and modified on
    but creay by and modified by i never use it.

    Howard,
    If you are not using JAZN you can still register created by and modified by user and date info in a "backdoor-wise" way:
    1. Get the user login string by using System.getProperty("user.name")
    2. Get the current datetime using java.util.Date
    3. In the backing bean for the page and the action method for your submit button, set the values for the components containing the created by or updated by values to the values obtained in points 1 and 2.
    Hope this is somehow useful,
    AG

  • User-created Dictionary entries getting ignored

    I have several entries in my user-created dictionary, and while they initially worked fine, now my phone has begun totally ignoring them and trying to turn them into other words. How can I make the user-created dictionary entries trump autocorrect? It's so frustrating when my personally created entries are there and they don't do a single thing useful. It's really frustrating.

    Hi
    Could you pl let me know how to check the error in SM13 entry ?
    I could get following info if i double click on the line
    Number Module name (function)         Type                 Status
        1  ADRESSE_WRITE_DOCUMENT         V2                   Initial
        2  ADDR_SAVE_INTERN               V1                   Initial
        3  VENDOR_INSERT                  V1                   Initial
        4  KRED_WRITE_DOCUMENT            V1                   Initial
    thank you
    bhakti

  • How to create groups and assign users thru program

    Hi,
    I am planning to create groups by program and assign users to them based on some condition.Once users are assigned to those groups we need to change the Language value for those users in User profile
    We are using Central User Administration.
    Please let me know the solution
    Thanks
    Bala Duvvuri

    probably you can use this code to create a group
    IGroupFactory groupFact = UMFactory.getGroupFactory();  
    IGroup group = groupFact.newGroup(wdContext.currentContextElement().getGroup()); 
       group.commit();
    for this required com.sap.security.api.jar

  • How to create a program that accepts 5 digits from the user between 0 and 9

    how to create a program that accepts 5 digits from the user between 0 and 9 then put them in ascending order using link-list method..

    You can use a scanner to get user input from the command line.
    import java.util.*;
    public class Test {
        private List<Integer> list;
        private Scanner in;
        public static void main (String... args) {
            new Test ();
        public Test () {
            list = new LinkedList<Integer> ();
            in = new Scanner (System.in);
            for (int i = 0; i < 5; i ++) {
                System.out.format ("Please enter a number (%d more): ", (5 - i));
                list.add (in.nextInt ());
            Collections.sort(list, new Comparator<Integer> () {
                public int compare (Integer i1, Integer i2) {
                    return i2 - i1;
            System.out.println (list);
    }

  • User created text variables don't work anymore...What's going on?  Help!  Captivate 4.

    Captivate 4 issue.
    Okay, I use Captivate 4 almost every day for eLearning development, so I know the program pretty well.
    As our LMS is horribly difficult to use, I typically create a certificate at the end of the course I am working on that will display the user's name on it that they can print and give to their supervisor.
    On the first page of the course, I put a text entry box in where they key in their name, and I capture that in a user variable (typically called staff_name) that I then drop into a text caption on the certificate.
    This has worked successfully numerous times.
    Now, for some reason, it doesn't.  One of two things happen:
    1.  The entire text caption with the variable in it does not display....it's just a blank space where that caption should be, and that includes any other text in the caption.
    2.  The caption appears with all of the other words...just not the variable. 
    Is there anything that I might have overlooked?  Some strange captivate bug where user created text variables disappear over time.
    Oh yea, that reminds me...system variables don't work either.  I put the date string on the certificate as well, and that wasn't showing up either.
    It's like all of a sudden, the ability of Captivate 4 to drop a variable into a text caption just doesn't work anymore.
    Ideas?
    Thanks so much.
    Rob

    Hi Lilybiri.
    It's been awhile since this post...I ended up just re-installing Captivate onto my system, and that cleared up the problem.
    It has since, however, reared its ugly head again. 
    I had a lesson set up that had a page counter at the bottom.  Simply said "Page 1 of 25" then "2 of 25" etc. on each page using the current slide info and slide count variables.
    It worked perfectly up until today when a reviewer suggested changing the caption text to simply "2/25"
    So, I edited the caption with the variable, and the exact same symptoms described above came to pass again....any text captions with variables in it will not show up in the running .swf file.  I tried deleting the .dat file, and that didn't help.  In addition, the variable length is not 0. 
    As I work remotely and re-installing captivate would take hours upon hours (or a trip to the office) I don't see re-installing it as a viable option at this point.
    Anyway, it's pretty frustrating, and an obvious bug.  I wish my company would just upgrade to 6 already...
    Other ideas, though?
    Rob

  • Developing maths wave equation and make the equation variable.

    Hi expert..
    i am having difficulties to create  a program using mathematical wave equation and make the equation variable in 2 wave. e.g
    square wave=2*a/pi*atan(tan(pi*t/period)) or sine wave= a*sin(2*f*t).i need to change the frequency and amplitude between 2 wave together separately.can anyone help me please..
    Attachments:
    Draft pgm1.JPG ‏29 KB

    Sorry I didn't attach the VI. I have now attached the VI and a screenshot of the block diagram.
    Good Luck!
    Tom
    NIUK
    Attachments:
    forforum.JPG ‏88 KB
    example2.vi ‏13 KB

  • HT5621 I bought my iMac from someone. Everything was changed over to my name however when I try to update programs it only shows the old users apple ID and I can't update. How do I change this so I can update the applications and have everything fully und

    I bought my iMac from someone. Everything was changed over to my name however when I try to update programs it only shows the old users apple ID and I can't update. How do I change this so I can update the applications and have everything fully under me?

    The first thing to do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. You — not the previous owner — must do that. How you do it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    1. You don't own another Mac.
    If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller — not from eBay or anything of the kind. If the machine has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for some MacBook Air models. For early MBA models, you may need a USB optical drive or Remote Disc. You should have received the media from the previous owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To boot from an optical disc or a flash drive, insert it, then reboot and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    If the machine shipped with OS X 10.7 or later, you don't need media. It should boot into Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    2. You do own another Mac.
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to create a bootable USB device and boot the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can boot from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    Once booted in Recovery, launch Disk Utility and select the icon of the internal drive — not any of the volume icons nested beneath it. In the Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    After partitioning, quit Disk Utility and run the OS X Installer. You will need the Apple ID and password that you used to upgrade. When the installation is done, the system will automatically reboot into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    Then run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the previous owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed — you have to repurchase them.
    3. Other issues
    If you see a lock screen when trying to boot from installation media or in Recovery mode, then a firmware password was set by the previous owner, or the machine was remotely locked via iCloud. You'll either have to contact the owner or take the machine to an Apple Store or another authorized service provider to be unlocked. You may be asked for proof of ownership.
    If the previous owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Mac App Store Customer Service has sometimes issued redemption codes for these apps to second owners who asked.
    If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.
    When trying to create a new iCloud account, you might get a failure message: "Account limit reached." Apple imposes a limit of three iCloud account setups per device. Erasing the device does not reset the limit. You can still use an account that was created on another device, but you won't be able to create a new one. Contact iCloud Support for more information.

  • Environment variables (user) created at OS level dont show up in BIDS 2008

    Environment variables (user) created at OS level don't show up in BIDS 2008.
    I had a variable ConfigLocation created and it is not showing up when I am trying to configure it in BIDS
    Is this a known issue or a bug?
    Now in BIDS it doesnt show up
    Mudassar

    Yes it shows up after restart of BIDS .
    But during design time this is a bug I hope Microsoft fixes this bug in the future releases
    Mudassar
    It's not really a bug. Visual Studio loads the environment variables when starting up.
    In future releases you use projects and parameters instead of environment variables, so the issue goes away ;)
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • How difficult to create a user login area, and where to start?

    I have a website which I created in Microsoft Expression Web 4. I would like to add a user login area and tie it to an existing SQL database which is updated frequently. I am not sure where to start or how likely I am to succeed. It is for a client's
    website, so I am willing (and hopefully able) to learn, but do not want it to turn into a long drawn out project.
    I can code in html and css and use java scripts. I don't know visual basic or how to work within the database (it will be provided by the client). I'm open to any advice on how easy or difficult this will be without other forms of coding knowledge, and would
    love any advice on the best place to start.  I have found some tutorials and downloaded MS Visual Studio Express 2013, since it was coming up as the best program for this. 
    Thank you for any advice!

    You want to create a login in SQL? any way you need one to access the database. You may need to contact your DBA to do it as you maynot be authorized to do it. Use below link to know creating SQL logins/Users.
    http://www.blackthornesw.com/robo/projects/blackthornepro/HOWTO_-_Creating_a_SQL_Server_Database_Login_Account.htm
    Thanks
    Swapna

Maybe you are looking for

  • Wlan problem with iMac yosemite

    When opening iMac it has difficulties to find WLAN network. I have to use network assistant several times and shut down the computer. Sometimes there are no difficulties, sometimes i have to try half a dozen times. My new iMac Yosemite was created by

  • How to resolve Nokia C6-00 touch Pad problem?

    I have bougt Nokia C6-00  two months ago from our local store.One day I drop   it on floor and then its touch pad is hanging  freequently . Now What should I do for that.Thanks for your suggestions. Gtec Media Solved! Go to Solution.

  • Why doesn't my compact field point file handle files as expected

    Before I add this to my LV2011 Whinge Thread I thought I would give the forum a go at this one. This is a 3 step challenge: Challenge 1, Spot the difference in the 2 pieces of code Challenge #2 Explain why this is happening Challenge #3 Find me a wor

  • Business rules storage location / directory ? Essbase server?

    Do you know where the Business Rules in EAS are stored ? in what format?

  • XI MATERIAL LINKS

    Hi, i am new to XI.please can anyone forward the links of XI material and any books regading this. Thanks, venkat.