Char arrays is it the right soultion for this problem

I've got enumerated types with each enum constant a different behavior for some method. (+, - , /, *)
I take a string i.e "(5 + 4) * (4 - 2)"
and place each string char into this array
String expression = "(5 + 4) * (4 - 2)" ;
char[] c = express.toCharArray();
I've been trying figure out how inow apply my enums method to the char array. Taking boldBODMAS*bold* in account.
enum Operation {
PLUS { double eval(double x, double y) { return x + y; } }
What fristly was spliting the string at brackets
String[] temp = express.split("[()]");
This trunt out not to work weel for nested mathematical
expressions ie. (4 + (2 * (2 - 1))) * 1.2
I'm quite new to java programming, any ideas/direction on what i should do would be great guys, thanks.

Anthony42 wrote:
A while back I had to write an excel-type spreadsheet application, and we had to evaluate expressions and functions.
The easiest way we found to do it was to use a binary tree created from reverse polish notation.
http://en.wikipedia.org/wiki/Reverse_Polish_notation
It should be fairly easy to do with a stack as well.Reverse Polish is a stack implementation. But first he will need to translate the infix operator precedence based notation into a postfix notation.
If this wasn't homework the OP would be able to choose something other than the traditional grade school arithmetic model he describes as BODMAS.

Similar Messages

  • Is Structured FM12 the right solution for this problem?

    I've been tasked with solving a tricky problem at my office. Briefly: We've got a technical manual that needs to be printed each time we sell a piece of equipment. Currently, the manual is produced using a combination of MS Access DB and a convoluted Word doc that uses Mail Merge to pull data from the Access DB into the appropriate fields. The DB has a hundred tables or so, and some of the tables are "calculated" values - i.e. the value in the fields is calculated based on values entered in other tables within the DB. The Word doc uses some kind of "if-then-else" logic to determine which tables to use for which fields when building the doc. This whole setup is currently maintained by the engineering, sales, and marketing departments.
    We currently use FM11 (unstructured) in the Technical Writing department, and my boss is asking me to figure out a way to migrate the Access/Word doc described above to a format we can use so we can take ownership of the documentation process for this particular line of equipment. I suspect the variables involved here go way beyond what we can do with conditional text and variables within FM, but I'm wondering if Structured FM (either 11 or 12) is more suited to this project, either by using some sort of conduit between FM and an SQL DB, or directly within FM using conditinal text, variables, or some other organizational function present in either FM11 or FM12.
    Any guidance here would be appreciated. I'm not even sure what questions to ask at this point to get a proper shove in the right direction.

    I love this line: Get that SQL queries into XML directly or into CSV and transform the CSV into XML via XSLT. Reminds me of that bit in "Good Morning, Vietnam" where Robin Williams goes through the routine about the Vice President: "Well, sir, since the VP is such a VIP, shouldn't we keep his ETA on the QT? Otherwise, he might get KIA and then we'd all be on KP." And now, back to work...
    I'm going to try to answer all of the questions above, in order, and add a little info where appropriate.
    TW dept may or may not take over all maintenance of the doc. That's one of the recommendations I'm tasked with providing. My current thinking is, engineering should remain in charge of entering relevant tool data to the data repository, sales should provide TW with a "spec sheet" of what was sold, and TW should then use the specs to "build" the document for customer release.
    Will a DB still be used? Unknown. That seems the best way to catalog and access the data, but I'm open to alternatives if there are any that make sense.
    I am totally unfamiliar with structure, XML, DITA, HTML, etc. Literally 100% of my experience with FM has been in the unstructured workspace. This whole structured FM inquiry was inspired by a blurb in my "Unstructured FrameMaker 11" book (from p474: "If you need to use complex combinations of condition tags, consider setting up a workflow in the structured interface of FrameMaker. Structured documents allow you to create versions based on attributes, which are easier to use and more powerful than expressions.") A quick Google of this blurb didn't turn up much useful information, but this seems to jive with Lynne's input above re: attributes.
    Data is not currently in SQL - it's in Access DB. We can migrate to SQL if necessary - that's one of the answers I'm supposed to be providing.
    The reason this is all currently being done in Word is because that's what the Sales & Engineering departments understand, and currently they're responsible for these docs. I'm sure this started out as a simple, nerdy solution to a small problem - some engineer didn't want to maintain two separate Word docs when he could create a database and then use mail merge to automagically build the same thing. Since then, it's grown to hundreds of tables and thousands of possible permutations.
    We already have FrameMaker installations in the department. If we can do this with FM11, great, but if not, no big deal - boss has already said he wants to move to FM12 as soon as possible. In other words, purchasing software - unless it's something additional needed to make all this work - isn't really a budgetary consideration.
    As mentioned, I have no skills with using FM for any kind of structured project, but I'm willing to learn if it seems like a good solution. Just need to figure out how to proceed.
    Thanks for your input - looking forward to hearing what else you folks have to say.

  • When i plug my ipod shuffle 4th generation in a box pops up and says the right files for this ipod isnt on the system?? sooo i re downloaded itunes and it still doesnt work soo i deleted it all and eredownloaded itunes all up to date and it still doesnt !

    when i plug my ipod shuffle 4th generation in a box pops up and says the right files for this ipod isnt on the system?? sooo i re downloaded itunes and it still doesnt work soo i deleted it all and eredownloaded itunes all up to date and it still doesnt ! any help please

    What was the exact error message you received?  When you removed and re-installed iTunes, did you use the precise instructions in this Apple support document to walk you through the process?
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    B-rock

  • Cant find the right forum for this but can i restore my hd from time mch to a year ago and then restore individual files such as logic lprojects that are on same time mchne backup from last week?

    cant find the right forum for this but as i am having problems booting my macbook pro, keep having to reser pram etc and now wont boot at all.....
    aill this theoretically work?
    a. Restore entire macpro hard drive from time machine to a time over a year ago before problems started
    b. Restore more recent individual files such as logic projects individually from same time machine backup
    c. install any programs manually again only couple of vsts
    please answer direct question as i have tried everything else and nonhardware problems just will no longer boot after months of reseting each time
    cheers

    oops.  typo:  "I went ahead and befored the restore."  should be... I went ahead and performed the restore.

  • TA24002 My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know which erase option would be the best solution for this problem.

    My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?

    You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
    Re 1) you need to answer Kappy's questions.
    Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
    Do you not have a backup of the photo files?

  • I have problems in the initiation of the Encore process when opening presents the following error message : "Encore CS6 Cannot Run in Non-Royalty Serialized".... What is the best solution for this problem ?

    Help Me.
    What is the best solution for this problem ?

    Encore is activated when you activate Premiere Pro... so, as Stan asked, how did you install P-Pro?
    Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
    -and a fix for Encore http://forums.adobe.com/thread/1421765?tstart=0 in reply #7
    -plus more Encore http://helpx.adobe.com/encore/kb/cant-write-image-fie-larger1.html

  • Is JavaFX the right solution for this scenario...

    Hi,
    Is JavaFX the right choice for the following implementation choice I have to make? (see below for the requirement)
    Requirements:
    1. Provide a way to visualise within a web application an entity relationship type diagram (i.e. nodes with relationships between them). The backend database will hold the topology relationship. So to visualise this on a web application will need the ability to draw rectangles/lines/text etc.
    2. Provide a way to allow the use to trigger "add a new node", or "edit info in this node". For example a right hand context sensitive menu for example.
    3. Ideally will scale as the user resizes the browser window
    4. Would like the main functionality of the application to remain web based (is a Ruby on Rails application in fact), but have the visualization of the diagram render within the web application as transparently as possible.
    Options / Issues:
    * Issues I've struck with some investigation I've done is that whilst the <canvas> tag looks good for Mozilla/Firefox etc, it does not seem to have support on InternetExplorer. Hence cross-browser compatibility seems to be a real issue for the JavaScript type solutions from what I can see. This is why I thought JavaFX may be good?
    * Options therefore seem to me to be:
    - javascript (e.g. <canvas> tag) => cross-platform issue
    - JavaFX / Applet => (this is what I'm asking about)
    - Microsoft => costs $$ for development environment etc
    - AIR / Flex / Flex => ??? costs $$ again I think
    Regards
    Greg

    thanks - I'm still a little confused re their products and which would fit best so I've sent them some questions (below if you're interested)
    Hello,
    Could you please assist me in understanding which of your products would satisfy my needs. In fact (a) whether JGraph itself would and if not, or if it's not ideal, (b) which other product would.
    REQUIREMENTS:
    1. Provide a way to visualise within a web application a connectivity type diagram (i.e. nodes with relationships between them, a network connectively type of diagram).
    2. The server side (i.e. web application with database) will hold the topology relationship. HTTP type interfaces off the web application can be developed to provide the client side visualizing component with the topology data in the required format (assume this is XML)
    3. As well as just visualizing in the browser there would need to be a way for user to trigger a context sensitive "add a new node", or "edit info in this node". For example a right hand context sensitive menu for example.
    4. Ideally the diagram will scale as the user resizes the browser window
    5. Would like the main functionality of the application to remain web based , but have the visualization of the diagram render within the web application as transparently as possible. The the visualizing component would just take topology data and intelligently display this.
    6. DESIRABLE: Basic automated layout would be nice, or as a desirable (depending on cost) more sophisticated auto-mated layout.
    QUESTIONS:
    As well as your recommendation re which product would suite I had some specific questions which I would appreciate clarification on:
    Q1 - I assume if I have a web backend that can deliver topology inforrmation in an appropriate XML format via a HTTP REST type GET call that this could be used as a the source of data for a jGraph visualisation running within an Applet?
    Q2 - If running within an Applet, can jGraph cater for a right hand menu option off the nodes/links on the graph, that I could use to trigger other calls back to the backend? (e.g. to trigger an Add New Node call)
    Q3 - Following on from Q2 scenario, if I trigger an add new node scenario, if I wanted to visualise the form to type in the attributes for the new node, could this be handled within the applet by jGraph, or would this be a case of just adding your own Swing based dialogs to handle this?
    Q4 - Do the basic JGraph do any basic layout without having to go up to the layout Pro package (which I think costs if using it commercially).
    Q5 - If the answer to Q4 is No, how difficult would it be using the base JGraph library to do a basic layout? Is this doable/recommended? i.e. how would one "layout" the diagram if using only the base JGraph component? (noting from my requirements I'm really after a component I could send my topology information to in XML form and have it just visualise it for me)
    Q6 - Running the visualiation in an Applet in a browser, is the typical usage one where all changes to topology are made as calls to backend? i.e. or is there an approach where one would allow users to make changes to the topology within the applet and build up all the changes here on the client, and then at some point synch these back to the backend? (I'm assuming the keep it simple approach would be not to do this)
    Q7 - Is there a sample application/project with source code that implements a JGraph in applet/browser talking to web backend for data?
    Q8 - How does JGraphPro & mXGraph fit into the picture re solving my requirements in the most cost effective manner

  • Is an array the best solution for this problem?

    Hi there,
    I'm working up a demo where a couple of little games would show up in a  panel. There is a main menu that you bounce around to select things (the  games as well as other apps.)
    When a single game is running, it takes up the whole panel. When two or  more are running, they run in a "mini" format. Also, when a game is  running, a special "return to game" button appears in the main menu.
    This is a click through dog and pony show demo. It's not a production  app, but it has to work well enough to be played around with by internal  clients. So it has to work well.
    Right now I have some variables set up like so:
    var gameActive:Boolean = false;
    var gameDual:Boolean = false;
    In my launch game and menu function, I am checking these (and one or two  other) variables to see if I should do things like show a mini version  of the game or show the return to game button. As I add features though,  this is becoming slightly unwieldy.
    The key issue is the games. Let's say I have only two. I could make an  array, and then load in the game name when a game is launched. I could  check this array in my functions to see not only if games are launched,  but which game is launched so I can use the full or mini games as  appropriate.
    Is this a good approach, or is there a better way? I'm rusty with my  coding and not super comfortable making objects right now. But I could  go that way if it was the best.

    there's not much to it.  here are the only 3 things you're likely to need to do with your associative array:
    var yourAA:Object={};
    function addAAItem(aa:Object,o:DisplayObject){
    aa[o.name]=o;
    function removeAAItem(aa:Object,o:DisplayObject{
    aa[o.name]=null;
    function aaLength(aa:Object):int{
    var i:int=0;
    for(var s:String in aa){
    i++;
    return i;

  • Is this the right forum for this? Using a foot pedal to control apps?

    My girlfriend is doing medical transcription - she listens to audio and she types. People who do this, often use a footpedal to play, pause, rewind, etc. while transcribing. I'm hoping to set her up on the Mac to do this, there are pedals which are Mac compatible, but I don't know what their limitations are, or what is possible.
    I found some typical USB pedals, examples here:
    http://www.altoedge.com/pedals/
    ...and I'm wondering if anyone has had any luck using them? Can they be configured to control certain menu functions in any application? such as using the keyboard shortcuts in the System Preferences to control certain commands in other applications? I'm thinking that I could make great use of a pedal like this to control any audio player - iTunes, Garage Band, or a 3rd party app I bought and love, "The Amazing Slow-Downer" so that I can use this to practice with the guitar, playing along with recordings, similar to how she would do the exact same thing while listening to recordings and typing.
    I hope this is the right forum to bring this up. I don't have the pedal, I'm thinking of getting one, but I was hoping to get input from someone before springing for one. Thanks!!

    Well, this took me a while to get solved, but it is indeed solved.
    I tried USB Overdrive and it could, and perhaps should work, but apparently it will not. When adding a device, it seems that USB Overdrive is not set up to handle any input device that does not register itself as either a Mouse or a Joystick. The VEC USB Footpedal that I'm using is "Device type: Other".
    So, I went for Quickeys. And Quickeys can do it all. It did recognize the device, I was able to assign it to the scope of the particular audio playback app I wanted to use (Amazing Slow Downer OS X - which is truly amazing. Any musicians reading this who are looking for a way to learn pieces by ear, this does it better than anything else I've seen yet).
    I created a shortcut in Quickeys for the ASD app; added the middle button of the foot pedal as the trigger; set one step, entering 'space bar' as the step (which toggles playback, similar to many audio players).
    It all worked.
    Quickeys is very confusing and seemingly featured with an endless array of options. Enter at your own risk. Ask me for help. This was the only way to get it done that I could find. I did write to the author of USB Overdrive asking him to please support additional devices as I did find some traction from gamers who like to use a foot pedal in addition to other input devices. There was a Windows-only management utility for the foot pedal that was intended for custom input, assigning the buttons to any keyboard input or mouse click event. It would be nice to have a simple and easy to use utility like this. But, Quickeys did do the job.
    Thanks for your help, you guys!!!

  • Is Oracle Text the right solution for this need of a specific search!

    Hi ,
    We are on Oracle 11.2.0.2 on Solaris 10. We have the need to be able to do search on data that are having diacritical marks and we should be able to do the serach ignoring this diacritical marks. That is the requirement. Now I got to hear that Oracle Text has a preference called BASIC_LEXER which can bypass the diacritical marks and so solely due to this feature I implemented Oracle Text and just for this diacritical search and no other need.
    I mean I set up preference like this:
      ctxsys.ctx_ddl.create_preference ('cust_lexer', 'BASIC_LEXER');
      ctxsys.ctx_ddl.set_attribute ('cust_lexer', 'base_letter', 'YES'); -- removes diacritics
    With this I set up like this:
    CREATE TABLE TEXT_TEST
      NAME  VARCHAR2(255 BYTE)
    --created Oracle Text index
    CREATE INDEX TEXT_TEST_IDX1 ON TEXT_TEST
    (NAME)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('LEXER cust_lexer WORDLIST cust_wl SYNC (ON COMMIT)');
    --sample data to illustrate the problem
    Insert into TEXT_TEST
       (NAME)
    Values
       ('muller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('müller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MULLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MÜLLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('PAUL HERNANDEZ');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('CHRISTOPHER Phil');
    COMMIT;
    --Now there is an alternative solution that is there,  instead of thee Oracle Text which is just a plain function given below (and it seems to work neat for my simple need of removing diacritical characters effect in search)
    --I need to evaluate which is better given my specific needs -the function below or Oracle Text.
    CREATE OR REPLACE FUNCTION remove_dia(p_value IN VARCHAR2, p_doUpper IN VARCHAR2 := 'Y')
    RETURN VARCHAR2 DETERMINISTIC
    IS
    OUTPUT_STR VARCHAR2(4000);
    begin
    IF (p_doUpper = 'Y') THEN
       OUTPUT_STR := UPPER(p_value);
    ELSE
       OUTPUT_STR := p_value;
    END IF;
    OUTPUT_STR := TRANSLATE(OUTPUT_STR,'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    RETURN (OUTPUT_STR);
    end;
    --now I query for which name stats with  a P%:
    --Below query gets me unexpected result of one row as I am using Oracle Text where each word is parsed for search using CONTAINS...
    SQL> select * from text_test where contains(name,'P%')>0;
    NAME
    PAUL HERNANDEZ
    CHRISTOPHER Phil
    --Below query gets me the right and expected result of one row...
    SQL> select * from text_test where name like 'P%';
    NAME
    PAUL HERNANDEZ
    --Below query gets me the right and expected result of one row...
    SQL>  select * from text_test where remove_dia(name) like remove_dia('P%');
    NAME
    PAUL HERNANDEZMy entire need was only to be able to do a search that bypasses diacritical characters. To implement Oracle Text for that reason, I am wondering if that was the right choice! More so when I am now finding that the functionality of LIKE is not available in Oracle Text - the Oracle text search are based on tokens or words and they are different from output of the LIKE operator. So may be should I have just used a simple function like below and used that for my purpose instead of using Oracle Text:
    This function (remove_dia) just removes the diacritical characters and may be for my need this is all that is needed. Can someone help to review that given my need I am better of not using Oracle Text? I need to continue using the functionality of Like operator and also need to bypass diacritical characters so the simple function that I have meets my need whereas Oracle Text causes a change in behaviour of search queries.
    Thanks,
    OrauserN

    If all you need is LIKE functionality and you do not need any of the complex search capabilities of Oracle Text, then I would not use Oracle Text. I would create a function-based index on your name column that uses your function that removes the diacritical marks, so that your searches will be faster. Please see the demonstration below.
    SCOTT@orcl_11gR2> CREATE TABLE TEXT_TEST
      2    (NAME  VARCHAR2(255 BYTE))
      3  /
    Table created.
    SCOTT@orcl_11gR2> Insert all
      2  into TEXT_TEST (NAME) Values ('muller')
      3  into TEXT_TEST (NAME) Values ('müller')
      4  into TEXT_TEST (NAME) Values ('MULLER')
      5  into TEXT_TEST (NAME) Values ('MÜLLER')
      6  into TEXT_TEST (NAME) Values ('PAUL HERNANDEZ')
      7  into TEXT_TEST (NAME) Values ('CHRISTOPHER Phil')
      8  select * from dual
      9  /
    6 rows created.
    SCOTT@orcl_11gR2> CREATE OR REPLACE FUNCTION remove_dia
      2    (p_value   IN VARCHAR2,
      3       p_doUpper IN VARCHAR2 := 'Y')
      4    RETURN VARCHAR2 DETERMINISTIC
      5  IS
      6    OUTPUT_STR VARCHAR2(4000);
      7  begin
      8    IF (p_doUpper = 'Y') THEN
      9        OUTPUT_STR := UPPER(p_value);
    10    ELSE
    11        OUTPUT_STR := p_value;
    12    END IF;
    13    RETURN
    14        TRANSLATE
    15          (OUTPUT_STR,
    16           'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ',
    17           'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    18  end;
    19  /
    Function created.
    SCOTT@orcl_11gR2> show errors
    No errors.
    SCOTT@orcl_11gR2> CREATE INDEX text_test_remove_dia_name
      2  ON text_test (remove_dia (name))
      3  /
    Index created.
    SCOTT@orcl_11gR2> set autotrace on explain
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('mü%')
      3  /
    NAME
    muller
    müller
    MULLER
    MÜLLER
    4 rows selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('P%')
      3  /
    NAME
    PAUL HERNANDEZ
    1 row selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2>

  • Is JMF the right technology for this...

    Hi All!
    I have a requirement to build a client app that is subscribed to a JMS topic. Based on the published message, the client has to select and play the appropriate video clip from a total of n video clips. Here are my questions:
    1) Is JMF the right technology to play video clips (.AVI format)? What are the alternatives?
    2) Can I have these play in full-screen mode?
    3) During idle time, can I display a default image (.JPEG)?
    4) Does Swing or AWT have to also be used?
    5) How can I cache the video clips (16MB * 6 clips) in memory to make it more performant? Is this even neccessary?
    6) I need this application to run 24*7 with minimum failure rate. Is this a realistic expectation for JMF?
    thanx much!
    - Ravi

    1. yes. depends on what you want to do exactly.
    2. why not?
    3. what is "idle time"? you mean the time where your video pauses? yes, you can..
    4. doesn't matter. The visual component which you'll get from jmf (to show video) is of type java.awt.Component
    5. this is not neccessary. You would reach nothing with caching video in memory. Actually, you didn't say if you are talking about sender, server or recipient side..
    6. no. I generally don't trust Applets very much. I would use Macromedia Flash with FlashCom server then, although it has less features and parameters, but it seems to be more stable.
    Best regards from Germany,
    r.v.

  • Is JSP the right technology for this project?

    I'm heavy into core java, but haven't used JSP before. The project manager suggested JSP for this project, but since I'm writing the spec and the code, I need to determine if it's suitable for the task before committing to it.
    Overly-simplified summary:
    web-based application
    simple form interface, fill in the blanks
    user inputs a filename, and a piece of data or two to find within the file
    application finds the (binary) file on the server, parses it into a known data structure, and finds the data element that contains the specified information.
    application formats the data element and displays it in a web page.
    user has the option to save the data in text format or as a binary file on the local machine
    That's pretty much it. There are a few things that I'm concerned about, and am not sure whether JSPs are capable of handling:
    1. searching the local hard drive (in known directories) for a specific file and opening it
    2. creating, for instance, a MappedByteBuffer of a portion of the file and accessing data within it
    3. saving data in text or binary format on the user's hard drive
    If the JSP can run core java style code on the server, that answers 1 and 2 easily. 3 seems like it should be possible, but like I said, I've never used JSP.
    Of course I'll look up the specifics myself, but perhaps someone who has been using this technology for a while can answer my simple question:
    Is JSP a suitable tool for this job?

    So this project looks like one that could be handled not no roughly using a combination of Servlets and JSP.
    web-based application
    simple form interface, fill in the blanksUse JSP for the displays. Forms, and such...
    user inputs a filename, and a piece of data or two to
    find within the file
    application finds the (binary) file on the server,The file is on the server right? Good. Then use a Servlet to find the file. Better, actually, to use a Servlet to call some other PlainOldJavaObject that finds the file for you. That way you can test and code outside of the web environment then just integrate into Servlets/JSPs when needed...
    parses it into a known data structure, and finds the
    data element that contains the specified
    information.Again, use Servlet, or a POJO object the Servlet calls to do this stuff.
    application formats the data element and displays it
    in a web page.Good thing for JSP to do. Just let the Servlet get the results back from the POJO doing the work, then store them such that the JSP can read results and format an HTML page around them.
    user has the option to save the data in text format
    or as a binary file on the local machineOn the client's local machine? That is doable, I think. Again, use a Servlet to pass what and how to save to a POJO that that does the work. Then the servlet streams the data to the client (using a content type that will ensure the download rather than display...)
    That's pretty much it. There are a few things that
    I'm concerned about, and am not sure whether JSPs are
    capable of handling:
    1. searching the local hard drive (in known
    directories) for a specific file and opening itLocal meaning Server? Yes, best for Servlet/Data Access Object rather than a JSP though. Local as in Client machine: No.
    2. creating, for instance, a MappedByteBuffer of a
    portion of the file and accessing data within itServlets have full access to the normal Java API, but they run on the Server, so again, as long as the file is on the server... no problem.
    3. saving data in text or binary format on the user's
    hard driveYeah, easy. Just a quick download servlet. I believe there are a couple examples here in the forums. Other sites may have better ones...
    If the JSP can run core java style code on the
    server, that answers 1 and 2 easily.It can, but a little repetition here... this is best to do in Servlets rather than JSP. JSPs should be kept to display only.
    3 seems like it
    should be possible, but like I said, I've never used
    JSP.
    Of course I'll look up the specifics myself, but
    perhaps someone who has been using this technology
    for a while can answer my simple question:
    Is JSP a suitable tool for this job?

  • App store billing issue (prob not the right place for this but i couldn't find a better one)

    I have been using the same card for my itunes account for as long as i have had an itunes account and a personal credit card, all of a sudden about a week or so ago while trying to update some applications on my iphone it asked me to sign in and confirm my billing information, from that day on it has refused to recognise the security code for my credit card or any other credit card for that matter, has anyone else had a similar issue with billing for their app store/itunes account and if so is this something that can be fixed easily without sending the device out or going to a repair centre
    the most frustrating thing of all is all of the updates i need to install are free updates for applications that were also free :-/

    go to http://zip4.usps.com/zip4/welcome.jsp, enter your billing address, it will then show you how the USPS recognizes your address. Enter that address EXACTLY how it is shown on the USPS site into your itunes billing address info.

  • Do I have the right software for this?

    I am a longtime user of Macromedia Dreamweaver MX and have just recently upgraded to Adobe CS4. I have an existing webpage that I plan to completely redesign. The website content itself is simple but I would like to make the page design template much more visually appealing and dynamic. My inspiration is http://www.wickedthemusical.com/page.php#, I really like the uneven borders of the page and the turning gears. What I would truly like to do is create my page with appearing and disappearing filagrees surrounding the basic content. Now, the question: I had just begun learning about layers in Dreamweaver MX but see that they are no longer available in CS4. Am I able to achieve the kind of effects I want to with CS4? And if so, can someone give me a headstart? I realize that the actual process will be in depth but if I can just get a general direction, I should be able to figure most of it out myself. I appreciate any help.

    If you are asking how to do something with Dreamweaver CS4, then the Dreamweaver forum is the place to go. If you are asking what software you can use to design something like the website you mention, then this is the right place. People can recommend what is the best software and/or methods to do what you want.

  • Is bgRFC Out-Inbound the right way for this... ?

    Hi guys,
    my scenario is:
    n systems (SAP) send data to ONE server (AS ABAP). The data will delivered via one and the same RFC FM to be stored in exactly ONE file per day.
    I have to ensure quality of service and delivery.
    So my first question is if bgRFC is the right way of doing so...
    MY idea was: I have exactly ONE inbound queue name on server/central system to ensure, that there will be only one unit to write data into file at the same time...
    Second: when the sender system calls one function module several times, how do I have to configure the queue names...
    I'm facing problems regarding this (please see below)
    the error occurs whenever the FM is called more than once per unit and I have only ONE inbound queue name declared...
    (please see coding below)
    Any ideas on that?
    Best -
    Christoph
    coding example....
      DATA:
            my_destination TYPE REF TO if_bgrfc_destination_outbound,
            my_unit        TYPE REF TO if_qrfc_unit_outinbound,
            dest_name      TYPE bgrfc_dest_name_outbound,
            queue_name     TYPE qrfc_queue_name,
          dest_name = 'SID'.
          my_destination = cl_bgrfc_destination_outbound=>create( dest_name ).
    loop... (to split XLarge amounts of data)
    CALL FUNCTION 'MSGRECEIVER'
        IN BACKGROUND UNIT my_unit
    exporting lt_data
    endloop...
    my_unit->add_queue_name_outbound( QUEUE_NAME = '<prefix>_OUT'
    my_unit->add_queue_name_inbound( QUEUE_NAME = '<prefix>_IN'
                                            IGNORE_DUPLICATES = abap_true ).
    Problem:
    the error occurs, when more than one function module is called by the sender system... and having only ONE inbound queue name declared...
    Edited by: Christoph Aschauer on Jul 28, 2011 1:08 PM

    Start here to learn After Effects:
    http://adobe.ly/AE_basics
    This series of videos ends with exporting to H.264 (.mp4):
    https://helpx.adobe.com/creative-cloud/learn/start/aftereffects.html

Maybe you are looking for

  • I need help on standard workflow of Release for payment

    Hello to everyone, I'm trying to use WF WS00400011 standard provided by SAP through the PFTC and I activated it, inform a user that I created called WF different from my user, who will be responsible in the task standand (TS00407862) and also went to

  • How to add LLRP provider for BizTalk RFID Mobile on Motorola MC9090

    I simply need to add LLRP provider on to Motorola MC9090 where BizTalk 2010 RFID Mobile is installed.  I have read other threads regarding to the similar topics, but they all imply that LLRP provider automatically comes with installation of BizTalk M

  • 8i on Linux and Recovery Manager

    Where are the recovery manager rdbms/admin scripts/package code for the 8i distribution? 'catrman.sql' did not install with my 8i EE for Linux.

  • GCCfss for Solaris 8?

    Hi, is there an old version of GCC for Sparc Systems which allows building on Solaris 8? Even an unofficial version would be nice. I need the compiler to provide efficient Sparc binaries for Solaris 8, which is still a supported production version. T

  • Swf movie won't open in dreamweaver

    I created a flv movie in Flash from a avi file, which I then exported as a swf movie. The swf movie plays fine in Flash (file>publish preview), but when I place it into an html page in Dreamweaver the flash icon ( f ) displays on the html page but if