Should I use ResourceBundle for this?

I have an app that displays some static data (Earthquakes in California from 1970 to 1980). Right now this data in the form of an ASCII CSV file is read in using a hard coded location /javaprojects/EQ/data/CA.1970-1980.txt.
I am wondering if Resource bundle is a better way to do this. Any suggestions? I am assuming that the app and the data will eventually be put in a jar for distribution, in which case should I do something different?
Thanks

ResourceBundles are used to handle localization issues which isn't what you described.
You asked for any suggestions so here's one. Since the data is never going to change you could consider creating a class to access its contents and put the data right in the code. Something like this:
public class EarthquakeData {
  static List data = new ArrayList();
  double mag;
  Date when;
  String where;
  public EarthquakeData(double mag, Date when, String where) {
    this.mag = mag;
    // and so on
  public double getMagnitude() {
    return mag;
// then load the data right into the program statically:
  static {
    data.add(new EarthquakeData(4.5, new Date("June 2 1977"), "Los Angeles");
}This example uses a List. You might want an array or Map or whatever.

Similar Messages

  • Should I USe ColdFusion For This?

    I need to build a simple web form for data entry into a
    database table. The form is to be located on my company website. It
    doesn't have to be fancy at all, just functional. What I'm
    wondering is- is ColdFusion the best tool for this job? Should I be
    using DreamWeaver? And also- if I use either of these technologies
    to build this form, will it only work on a server that has these
    technologies installed?

    quote:
    Originally posted by:
    serat
    The free version of Blue Dragon CFML Engine is for testing
    and development only, and is only partly compatible with ColdFusion
    MX 6 functionality and has none of the CFMX 7 functionality.
    From the New Atlanta website:
    BlueDragon Server is free for non-commercial deployment.
    ie: not
    just testing & development.
    Although since this user is doing this for their company
    website, it probably doesn't fit into non-commercial use.
    However, there is another CFML server option, free for
    development and community (non-commercial) use, and is
    much cheaper than CFMX and BlueDragon, at only €200
    for the professional version. (that's under 1/3rd the price of BD,
    and under 1/5th the price of CFMX7)
    It aims for CFMX6 compatibility, and achieves it well enough
    - I've only found one MX7 function I've needed so far, and I was
    able to fix that with a custom function easily enough. And it also
    has several sensible enhancements to CFML.
    I am of course referring to
    Railo
    Even if you don't need a low-cost CFML server, I'd recommend
    giving it a try - it has a
    Live version
    so you don't need to install it - just download, extract the zip,
    run a batch file and you have an instant CFML server.

  • SHould I use keynote for this?

    We will exhibit at the Frankfurt ProLight+Sound this year and the task of producing the picture slideshow with promotional material has fallen on to my desk.
    Plan is to have three plasma screens connected in to one giant screen so that images move from one screen to another, to the third, and so on.
    Should I use keynote to produce this? Or is it better to do something in iMovie/FCE/FCP? Or is Director the software to use?
    The other thing is that this will run either on a PC or off a DVD player and it has to be looped.
    Thanks in advance.

    I would suggest using FCP because I don't think iMovie can show 3 pictures at the same time. FCP does cost a lot and is used by many to edit movies (Like any movie you would see in a theater). I wouldn't suggest buying it if your not going to use it a lot. Then use Keynote. Make the pictures move with each slide. Loop it and make it a QuickTime (.mov). Click 'Manual Advance' and change it to 'Fixed Timing'. Click 'None' and change it to 'Loop'. Check 'Enter full screen mode when opened'. Click on 'Full Quality, Large' and change it to 'CD-ROM Movie, Medium'. Check 'Include transparency'. That should make it easy to burn to CD/DVD and play back on a Windows Machine. On a VCR I have no idea.

  • Should I use RMI for this??

    Hi:
    I am a complete newbie on RMI, I want to know whether the following task should be achieved by using RMI. Basically, I have a java application sitting on a server machine (unix machine), and I want to be able to call that application from another client machine using the command line prompt (client machine is WIN2000). I was told to open a TCP port to do this. Umm, basically, does this task involve RMI at all?
    Please give me some general direction on this problem, thanx a lot.

    You could perform the communication as mentioned, having a process open a server socket on the server machine and wait for information to be sent from a client. You will end up defining the format and protocols used in the communications over the socket, but if sufficiently simple, this approach would work fine.
    If you want to send more complex data or commands, or invoke methods on the server from the client, RMI is a good avenue to explore. It requires some infrastructure, however: you must be running an RMIRegistry process on the server, you must properly put your stubs and interfaces somewhere they can be dynamically downloaded (or packaged up with the client), and you must work through various RMI Security issues.
    These things are not hard to pick up, however, and the RMI path in the Java Tutorial is a good place to start learning about such things.

  • Why doesn't SAP use SAPUI5 for this and that

    This is my personal opinion about this topic! Again and again I stumble about this and now I want to share some of my thoughts about this topic. I want to share this from a point of view, when I was not a SAP Employee - I worked at a SAP Partner company - because this best reflects the view from the outside.
    1. SAP "wants" us to use SAPUI5
    I don't think that "wants" is the right word - the right word is offers! In terms of: hey now even included in your license and open sourced (because you wanted it so). Look - we build sooo many Fiori apps with it - and put in some great enterprise features (right to left, accessibility, translation, ...) and it is responsive. So if you want to build Fiori-like "apps" - there you go - this is your technology to go! This is what I understood.
    I was very very very happy that it was build with open standards. But the main point for me another thing - (because I worked with Sybase Unwired Platform and SAP Mobile Platform) OMG an open data protocol!!! OData FTW! I could use ANY front-end technology and consume SAP data - the protocol is REST based - a dream came true. And so I did - yes I played around with Sencha Touch and OData, I used data.js and used it in a standard HTML5 application. We played around with an iOS application we already had and consumed the data. I feed the data into d3.js. I prototyped around with SAPUI5 and I have build apps with it. Brilliant, so I could choose whatever UI technology I wanted.
    I always had the feeling, that SAPUI5 was meant for B2E applications - and building many of that - and they should look and feel the same and I can theme the apps. I can use it when I want to make my applications SAP like - so that the user thinks the apps are all the same and everything fits nicely into the Fiori launchpad - great if you want to build partner apps. In my ex company we won a SAP Pinnacle Award - for a native iOS app, no SAPUI5 in sight - but we have received an award, so SAP did not "want us" to use SAPUI5 ;-)
    2. Is it the right UI technology for everything?
    At my ex-company I was dealing with mobile applications and web apps. I always knew that I get the best user experience when I write a real native application and if you want it to look like in a very specific way with awesome UI --> you would not do it with a write-once-run-everywhere HTML5 super-styled wrapped (phone gap/cordova) app - you would write the apps for the specific platform and it should feel like it was written for the platform. SAP offered us the SAP Fiori Client that I could enhance the user experience for the Fiori apps, but I was never told to use SAPUI5 it for everything.
    The same discussion goes on with: why was the new SAP website not build with SAPUI5, or the UX Explorer (eat your own dog food), or a useful internal app - why Angular, or the other way around why do we even use SAPUI5 and not Angular JS itself. Back to the past - SAP did never tell me to build a website with it, or to build something tiny and small with it (a widget) - or to enhance parts of a website with it - or to build something super-specific with it.
    And yes maybe the UI in a mobile app was not SAPUI5 but do you know if it uses Gateway with OData or the SAP Mobile Platform, was the API managed with Apigee, was HCI involved in getting the data from different sources, was it maybe wrapped with SAP Mobile Secure, did it maybe use a HANA backend or some of its features (predictions, text analytics, ...) - are some backend parts maybe hosted on HCP - who knows? So yeah, maybe other SAP technology was involved which you don't see, but in the end it made your life simpler.
    Instead of arguing around why this and that was used for this and that - can we save our energy and instead look at the result - which is all what counts - that it was the right UI technology with the right user interface which makes the user happy? I stated something like - does Google use AngularJS for everything? Nope. They offer us something great we can use. Right, maybe AngularJS is not as important for Google like SAPUI5 is for us. But we have something with which we can build our day-to-day business apps with and we do so.
    3. We missed great opportunity in not using SAPUI5 for this and that
    Let's think about how projects are going: you want something, you look at the costs, you choose most efficient option. Yes this could mean reusing an existing native application which was written long ago and you pimped it up. Or you had outsourced it to a company which wrote a similar app. Or you bought the source code. Or you have some cheap internal staff which could do it (students, trainee), or you could outsource it cheaply. Or all you have is people with experience in this and that technology. Or it must look in a very very specific way (because marketing says so) and you go native. Or it maybe should even differentiate itself and should look NOT like a Fiori app. And no - I don't think - this is my employees view - we are not for example an event app producer. We normally build business applications. And I don't think that we can write an app from scratch "just" for an event in a certain technology. Yes it would be nice if this and that would use SAPUI5, I think if it would be possible in terms of time and costs and UI wishes and hundreds of other factors we would do it with SAPUI5.
    Working at the partner SAP showed me over 50 Fiori apps, now hundreds of Fiori apps are released. SAP now showed that SAPUI5 is going big with S/4HANA. We have seen the Simple Finance solution. I was walking around at the CeBIT this year and I was impressed myself which cool apps and screens have been shown with SAPUI5. I used the SAPUI5 app on a Samsung Smart Watch myself. The SAP Web IDE itself is built with SAPUI5 in its heart. I don't need any other "proves" that SAPUI5 is great. I have seen great use cases for it, but I also know myself when I would use other stuff.
    4. My conclusion
    There is never every anything which can cover all different use cases. One-size-fits-all clothes also does not fit for everyone even if it says so. If someone creates something great don't judge it by the UI technology. Judge it by the experience and the value it creates. There are reasons why this and that was chosen. Use what fits your needs best with your requirements. Make the end user happy!

    Hey Denise,
    Thanks for pulling this discussion into SCN. Makes it much easier to discuss compared to Twitter. But I also have to apologize in the beginning that my answer now exceeds 140 characters by 50 times.
    Let me share my thoughts and personal opinion as well. I will try to look at it from a strategic point of view, as you – as the technical UI5 expert - have already covered the technical perspective.
    SAP recommends using SAPUI5 where it fits to customers’ requirements
    Let me begin with a clear statement from my perspective: It makes no sense that SAP takes customer decisions.
    Of course, customers expect SAP to help them with their strategies and decisions and of course we are helping. But at the end, the decisions have to be taken by the customer who needs to take the specific conditions of the company into account. The most important condition in the context of UX is the end user. But we shouldn't forget the business strategy as the most important influence factor. I’m not saying that technical decisions are completely unimportant, but I would like to point out that other things are more important for a company.
    As a result, it wouldn't make a lot of sense if SAP would just want every customer to use SAPUI5. To me, customers need recommendations leading to solutions that satisfy their needs and requirements.
    There is not that one UI technology that serves all needs
    This headline might be a challenging statement and I can already imagine reactions to it. But in fact I can confirm this sentence easily. You always have to combine different technologies. Some of them are from SAP others not. The selection and combination of these technologies is different from customer to customer because the requirements are different. There are still reasons to use Web Dynpro ABAP and I’m still recommending SAP NetWeaver Business Client, POWL (Power Lists), WDA Chips, FPM based on the given environment of the customer. And obviously there are also reasons for UI5.
    SAP already proves the usage of SAPUI5
    In general, I see two different use cases here: Developing custom applications vs. adopting applications from SAP.
    In the one case, customers want recommendations on development environments and UI technologies that consider their development requirements and existing conditions (e.g. existing skills, given implementations). SAPUI5 is a great UI technology and there are some special aspects that make the decision obviously easy. If I want to create simple business applications that can be connected with my SAP system easily, especially in combination under responsive conditions on multiple devices and targeted for casual and/or occasional users UI5 might be the right choice for many.  Exactly this pattern is what many customers are searching for these days. So, the recommendation for UI5 comes quite often.
    Whether or not SAP proves the usage of SAPUI5 in their own world is to me more connected to the use case where customers want to adopt SAP applications. And in deed, SAP is using SAPUI5. There are hundreds of SAP Fiori applications that have been built with SAPUI5 and there have been a lot of other applications developed using SAPUI5, too. And again, there is a huge need for applications for casual and/or occasional users, so that’s a big reason for SAP to create such applications.
    Websites vs. Business Applications
    This discussion was triggered by some statements in twitter, that SAP sites such as sap.com, SAP UX Explorer or the latest mobile conference app are not developed using UI5. Actually I see these to be websites but not business applications. I have never told a customer to build a website in UI5 and I would continue to do so.
    Maybe we need to discuss the difference between a website and a business application. I guess it is not easy to find a common understanding here, as the borderlines between several worlds have disappeared in the last years.
    Some years ago it was more or less easy to differ between:
    Native desktop applications running on a specific desktop OS
    Native mobile applications running on a specific mobile OS
    Browser-based applications running in specific browsers
    Websites, basically running on many browsers
    In the first three categories we saw business applications. 1 and 2 were selected especially when specific functions of the device and OS where needed to be accessed (for example the camera of the mobile device, the fast rendering capability of the desktop). 3 was also used for business applications but in most cases on desktop browsers.
    Today, one can develop browser-based applications that look like native applications and even can access the devices like native applications. Responsive design breaks the borderlines even more. Now, browser-based content can be rendered perfectly on a desktop browser as well as on a mobile phone and a user might even not be able to judge whether it was originally intended to be developed for the one or the other.
    So maybe there is no big difference anymore between websites and browser-based applications. But there is still a difference between browser-based applications and browser-based business applications, where additional requirements such as integration into business systems are drivers. Here I see SAPUI5 as a very cool UI technology.
    That’s just my 2 (personal) cents,
    JJ

  • Can I use DMU for this database?

    Hi everyone,
    I am snippeting a CSSCAN ( i know..) so that will reveal the amount of convertible data we have to tackle and wanted everyone's opinion if we can use DMU for this database.
    [Data Dictionary Conversion Summary]
    Datatype Changeless Convertible Truncation Lossy
    VARCHAR2 7,805,484 202 0 0
    CHAR 1,573 0 0 0
    LONG 220,073 0 0 0
    CLOB 91,227 15,718 0 0
    VARRAY 23,479 0 0 0
    Total 8,141,836 15,920 0 0
    Total in percentage 99.805% 0.195% 0.000% 0.000%
    The data dictionary can not be safely migrated using the CSALTER script
    [Application Data Conversion Summary]
    Datatype Changeless Convertible Truncation Lossy
    VARCHAR2 68,382,337 350,836 39 84
    CHAR 322,930 0 0 0
    LONG 0 0 0 0
    CLOB 32,522 13,257 0 0
    VARRAY 1,552 0 0 0
    Total 68,739,341 364,093 39 84
    Total in percentage 99.473% 0.527% 0.000% 0.000%
    I think it should be fine.
    Please let me know.
    thanks

    Hello,
    the amount of convertible has no relation to if you can use dmu or not.
    of course, the less convertible, the less time the conversion process itself will take, but that's about it
    Regards,
    Gunther

  • Should I use flex for my website

    Hey, I am having trouble figuring out if I should be using
    flex for a site similar to the BBC site:
    http://www.bbc.co.uk. I have
    started the site in flex but I am running into a lot of problems.
    It could be that I am a newbie to Flex, but wanted to make sure if
    I should still be going a head with this in Flex. Any advice would
    be appreciated.
    Thank you,
    Vinny

    "vinny31187" <[email protected]> wrote in
    message
    news:goaup9$9ta$[email protected]..
    > Hey, I am having trouble figuring out if I should be
    using flex for a site
    > similar to the BBC site:
    http://www.bbc.co.uk. I have
    started the site in
    > flex
    > but I am running into a lot of problems. It could be
    that I am a newbie to
    > Flex, but wanted to make sure if I should still be going
    a head with this
    > in
    > Flex. Any advice would be appreciated.
    I would say that if you don't know the answer to that
    question, then the
    answer is probably no. You need to have a pretty firm
    understanding of how
    sites like that work under the hood before trying to build
    one in Flex.

  • Why should we use WSDL for developing webservices

    I need to develop Webservice Application for our Client .
    I dont know anything about WSDL4J
    Hi from the net i found this
    "The Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents.
    Is the reference implementation for JSR110 'JWSDL' (jcp.org)."
    But anybody please tell me why should we use WSDL for developing webservices ??
    Is there any specific advantage we will get ??
    And Can body please point me a link where to start for working with WSDL4j ?
    Thank you very much

    i seriously doubt you want to use wsdl4j unless you are doing really advanced webservice work. assuming you are developing this webservice from scratch, you basically want to use JAXWS: define an appropriate interface and your value classes, and let JAXWS do the rest. metro is the JAXWS implementation included in the oracle jdk and it has great tutorials and reference documentation online. i'd suggest you start here: http://metro.java.net/getting-started/

  • Everything i tried to buy Mountain Lion, i receive a message on my app store that i should contact apply support for this purchase, why?

    everything i tried to buy Mountain Lion, i receive a message on my app store that i should contact apply support for this purchase, why?

    Use the email form to contact Apple here >  Apple - Support - Mac App Store - Contact Support

  • Hey, my iPhone 5 gets switched off on its own. Couldn't switch it on immediately. Have to put it for charging and gets switched on... What should i do now for this???

    Hey, my iPhone 5 gets switched off on its own. Couldn't switch it on immediately. Have to put it for charging and gets switched on... What should i do now for this??? when evr i go out this is one big problem i get... Couldn't use my fone.... Have to wait until i go back home...

    Start here www.apple.com/ca/support/ or call 1-800-263-3394.

  • ORA-10631: SHRINK clause should not be specified for this object

    Hi
    I was trying to shrink table to reset the high water mark but some unknown reason it failed.
    Please help me
    SQL> declare
    stmt varchar2(100);
    cursor cur is
    select object_name from user_objects where substr(object_name,1,1)='A'
    and object_type='TABLE';
    begin
    for i in cur loop
    stmt :='alter table '||i.object_name ||' shrink space';
    execute immediate stmt;
    end loop;
    END;
    declare
    ERROR at line 1:
    ORA-10631: SHRINK clause should not be specified for this object
    ORA-06512: at line 9
    Regards
    Jewel

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#CJA
    The shrink clause lets you manually shrink space in a table, index-organized table or its overflow segment, index, partition, subpartition, LOB segment, materialized view, or materialized view log. This clause is valid only for segments in tablespaces with automatic segment management. By default, Oracle Database compacts the segment, adjusts the high water mark, and releases the recuperated space immediately.
    Compacting the segment requires row movement. Therefore, you must enable row movement for the object you want to shrink before specifying this clause. Further, if your application has any rowid-based triggers, you should disable them before issuing this clause.

  • Disable most recently used items for this field in CRM 2013

    Hi,
    I have checked "Disable most recently used items for this field " property option for lookup filed in CRM 2013. But it still displaying MRU items on the lookup filed. Can someone please help to fix this ?
    Regards,
    Thanga

    did you try to clean your browser cache? use a different browser?
    My blog: www.crmanswers.net -
    Rockstar 365 Profile

  • Using QuB for this database problem

    Hi, I have a problem of trying to list links on a website I am creating and if I am correct, I need to link 2 tables on the database. I was trying to use QuB for this but am tearing my hair out.
    Here is my problem:
    I have a list of links on a website and each one belongs to a category for eg:
    Category: Biomass
    Comapny Name: AN Other
    WebLink: http:abc.com
    Now how can I show all the Biomass links together under the one heading and all the others under their own heading eg, Windpower, Boilers etc.
    Can I use QuB for this?
    The tables I have are:
    Table 1:
    id
    Category
    Table 2:
    id
    Category
    Client
    Weblink
    That's it, hope I haven;t confused everyone, because I'm confused enough!
    Thanks in advance.

    Unfortunately, this is a common problem with serialization : If an obj which does not implement Serializable is a non-transient member of an object that is Serialized, Java throws a NotSerializableException.
    Therefore, you have to walk through the chain of objs to make each one of them serializable, which is not always practical.
    Below is a link that presents a solution to this problem, by using a SerializableAdapter (using the Adapter design pattern) :
    http://www.javageeks.com/Papers/SerializableAdapter/SerializableAdapter.html

  • Can I use JMS for this?

    User logs into our administrative console, selects a job, clicks run.
    Behind the scenes, the run command actually creates a job and returns XML which provides a long list of commands that need to be executed in order for that "job" the user triggered to be complete. This XML contains everything from shell scripts that need to be triggered to PL/SQL functions and stored procedures that need to be called...and they're listed in this XML file in the order they need to be executed and the next process in the list can only be executed when the process before it is finished. This all needs to go on behind the scenes, uninhibiting the user's experience on the website...so that's why I thought I might be able to use JMS but it seems everything needs to be written in java for this to work, which is a problem being I need to trigger runtime processes on the Linux box to execute shell scripts, which are not written in java...how would those shell scripts communicate with the JMS?
    Anyone doing anything like this? Examples somewhere? It's kind of like a job management console...the jobs are pretty complex and can take up to 45 minutes or more to complete, which is why we need to come up with a way to run them from the app server, but in the background, asynchronously from the user's website utilization. This obviously, because of the time some of these take to complete, can't be a request/response architecture...
    Thoughts? Help? Anything greatly appreciated.
    Thanks!
    rlb

              poorni wrote:
              > Hello everyone,
              > I need to send an alert message from the client to a server(which is
              > remote). Can I use JMS for this?.
              Yes.
              If so can anyone please suggest me
              > an open source JMS provider.
              WebLogic has JMS built-in.
              > Thank you,
              > poornima
              

  • Should I use TimesTen for unstable table

    Hi all,
    I have a table that there are a lot of accessing operations to it, include: select, insert, update, delete. My table has 80 columns, about 1M rows, one primary key (2 cols), 5 indexes in other cols.
    I want to increase select speed.
    Should I use TimesTen Cache for this table? Which cachegroup type (read-only, awt, swt,...) I should use?
    Thanks!

    Sure you could use TimesTen to cache this table from the Oracle database. As you are performing DML against it I would recommend you look at the Asynchronous Write-Through (AWT) Cache Group.
    Start here -> http://docs.oracle.com/cd/E21901_01/doc/timesten.1122/e21634/concepts.htm#BABFBIEC
    Info on AWT -> http://docs.oracle.com/cd/E21901_01/doc/timesten.1122/e21634/define.htm#CHDJAJAC

Maybe you are looking for

  • XML File from SQL Query

    I have created XML File from Query using below function:- select dbms_xmlgen.getxml(' select * from tblreports where rownum<=1') from dual; "(CLOB) <?xml version="1.0"?> <ROWSET> <ROW> <REPORTID>preRES0011</REPORTID> <ALIAS>Date wise Summary of pins

  • I am running firefox 5.0 on my mac OS X leopard powerbook G4. Is this the latest firefox?

    what is the latest version of firefox I can run on my mac computer which is a powerbook G4 laptop with OS X leopard Operating system.

  • MacbookPro connected to projector messes up trtackpad

    There are several of us at school that have experienced this problem. Whenever we connect to a projector using the Mini display port dongle, the trackpad is very jumpy and not very functional. If we plug in a mouse it works, but who wants to do that?

  • Assign Role to Users

    Hi, I am trying to give the user access to limited profit centers in a particular Business Area Suppose Bus Area ABCD and profit center AB0001 to AB0099 when there are profit center till AB0501.I Defined the same in the SU01 and assigned the role to

  • SAP Transcation Iview

    HI, I want to access SAP ECC System outside the network and we don't have authorization to install SAP GUI software as well. For this i tried to create a SAP Transcation iview with SAP GUI for HTML.This is not working? Is this right way what iam doin