What is the best way to handle collections that contains different object

Hi
Suppose i have two class as below
class Parent {
       private String name;
class Child extends Parent {
      private int childAge;
}I have a list that can contains both Child and Parent Object but in my jsp i want to display a childAge attribute ( preferrably not to use scriplet )
what is the best way to achieve this?

Having a collection containing different object types is already a bad start.
How are parent and child related to each other? Shouldn't Child be a property of Parent?
E.g.public class Parent {
    private Child child;
}In any way, you could in theory just check Object#getClass()#getName(), but this is a nasty design.

Similar Messages

  • What's the best way to handle new versions of software?

    So we have an Application setup for Adobe Reader (just using Reader as a general example) which is part of our Task Sequence.  When Adobe releases a new version of Reader, what's the best way to handle getting the new version into our SCCM setup.
    I know I can create a new application and do it all over and select the new file, but can I simply replace the files that the application is pointing to and then somehow tell it to update the DPs with the new files?  I'd rather not have to create new
    applications every time if I don't have to.
    Thanks.

    I think continue the way you are doing right now by creating a new application each time there is a version change. Its a clean way to do and this helps with Application life cycle mgmt aswell where you keep track of versions across the environments and
    eventually retire an application. Specially where no changes are made without a change control. This is completely process specific and may not be applicable.
    i do agree with above posted comments about using supercedence option.
    However most of the apps comes with upgrade capabilities from previous versions. So you can upgrade existing version with new one if you do not wish to use supercedence. 
    Thanks 

  • What is the best way to handle input parameter

    When writing sub-vi's, what is the best way to handle input parameter range checking? On the front panel I can choose to have numeric values coerced to be within range, but this does not affect constants or controls wired to the vi when used as a sub-vi. I can build range checking into the vi, but this can result in a cluttered looking vi. Do you have any suggestions.

    As you discovered, the Range and Coercion properties of controls do not work when used in sub-vis.
    Your best option is to go ahead and build your range checking into your sub-vis. If it�s something you will be doing a lot, just make your range checking a sub-vi and drop it where needed. This will keep the clutter to a minimum. You may end up with more than one range checking VI if you need different functionality, but this will still make less clutter and easier re-use.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • HT3275 what is the best way to retreive photos that were in the trash & it was emptied

    What is the best way to retreive photos that were in the trash & were emptied

    Look to the right on this page under 'More like this'.

  • What is the best way to be sure that there is no virus

    Hi guys,
    thanks for your responds,
    I believe my laptop has a virus or spyware. It is slow and take ages to comes up. Also during using internet exploring it is very slow in internet browsing.
    During use of msn chat voice sometime it freeze.
    What is the best way to be sure that there is no virus.
    I already have Norton 2007 with the latest update.
    thanks

    Hi
    > What is the best way to be sure that there is no virus?
    The best way is to use an Antivirus application and some Anti malware and Trojan applications.
    You use already the Norton Antivirus program. This is great. Be sure that this application is always up-to-date.
    Additional you could install Adaware. This is freeware tool and it scans your OS for malware.
    But the virus or malware is not always a reason for an OS freezing.
    Please check your processes which are running in the OS background. You can use additionally the application called CClean.
    It scans you OS for troubles and repair the registry.
    Maybe it helps

  • (workflow question) - What is the best way to handle audio in a large Premiere project?

    Hey all,
    This might probably be suitable for any version of Premiere, but just in case, I use CS4 (Master Collection)
    I am wrestling in my brain about the best way to handle audio in my project to cut down on the time I am working on it.
    This project I just finished was a 10 minute video for a customer shot on miniDV (HVX-200) cut down from 3 hours of tape.
    I edited my whole project down to what looked good, and then I decided I needed to clean up all the Audio using Soundbooth, So I had to go in clip by clip, using the Edit in SoundBooth --> Render and Replace method on every clip. I couldn't find a way to batch edit any audio in Soundbooth.
    For every clip, I performed similar actions---
    1) both tracks of audio were recorded with 2 different microphones (2 mono tracks), so I needed only audio from 1 track - I used SB to cut and paste the good track over the other track.
    2) amplified the audio
    3) cleaned up the background noise with the noise filter
    I am sure there has to be a better workflow option than what I just did (going clip by clip), Can someone give me some advice on how best to handle audio in a situation like this?
    Should I have just rendered out new audio for the whole tape I was using, and then edit from that?
    Should I have rendered out the audio after I edited the clips into one long track and performed the actions I needed on it? or something entirely different? It was a very slow, tedious process.
    Thanks,
    Aza

    Hi, Aza.
    Given that my background is audio and I'm just coming into the brave new world of visual bits and bytes, I would second Hunt's recommendation regarding exporting the entire video's audio as one wav file, working on it, and then reimporting. I do this as one of the last stages, when I know I have the editing done, with an ear towards consistency from beginning to end.
    One of the benefits of this approach is that you can manage all audio in the same context. For example, if you want to normalize, compress or limit your audio, doing it a clip at a time will make it difficult for you to match levels consistently or find a compression setting that works smoothly across the board. It's likely that there will instead be subtle or obvious differences between each clip you worked on.
    When all your audio is in one file you can, for instance, look at the entire wave form, see that limiting to -6 db would trim off most of the unnecessary peaks, triim it down, and then normalize it all. You may still have to do some tweaking here and there, but it gets you much farther down the road, much more easily.Same goes for reverb, EQ or other effects where you want the same feel throughout the entire video.
    Hope this helps,
    Chris

  • What's the best way to handle this?

    I'm not sure what APIs/setup to use for this situation:
    A company wants to store data projects they do for clients. Each year, the data fields are set (as a result of gov't requirements) and they won't change for any client project for that year. however, the fields required can (and usually do) change every year. So things they require this year, might not be needed the next year and new fields might be introduced.
    While there are likely to be many common fields from year to year, there's no way to guarantee which ones will remain consistent. They also want to be able to do searches on the data and fields, for projects within a year and across years.
    What's the best framework/API/configuration to handle this? EJB? Simple JDBC? If so, how should the database be handled? Won't it have to constantly create new fields in a table? Or is there another way to handle this?
    What's the best way from a "clean architecture" standpoint?

    dang, I really have to start over? I finally got all this stuff working again.  well, hopefully it won't be as big a pain this time since the data won't be coming from a different machine.   After completing the Migration Assistant process, I had to reinput a bunch of serial numbers for apps, reinstall print and mouse drivers, etc...  I've finally got the new machine up and running smoothly and now I gotta start over? Sigh.
    I was hoping that either I could rename the current account after deleting the other one, or just move everything from one account to the other and then delete the 'RJM' account.
    ok, so it sounds like here are the steps I need to take:
    - make another full cloned backup of this current machine in Super Duper
    - reboot this machine using the advice in the first post, wipe everything clean and reinstall the OS
    - create a new account like 'user1' and re-do software update (which is like 2.5 gig worth of stuff) and takes like an hour even on a high speed connection
    - then re-do the migration assistant process to the properly named account
    - then delete the 'user1' account
    does that sound right?

  • What is the best way to handle .mod files in premiere pro cs4?

    I recently got a JVC Everio GZ-MG130u and as I'm sure many of you are aware, it saves footage in the .mod format.
    I have googled this and found quite a few different solutions, but I'm just wondering if anything has changed since some of these solutions were posted, or in other words, what is the best way at this current point in time to handle .mod files in premiere pro cs4?
    As far as I know, the best thing to do is convert the .mod to .avi and then import it into premiere so it can be edited.. Is there a better way to do it than this? Also, by doing it this way, will I have separate audio and video tracks?
    Thanks.

    I have just done a bit of reading, here. All of the quotes that follow are from users who have posted in that thread.
    It seems that there isn't one solid answer on this subject. The thread that I linked to was started 2 years ago, and replied to just 4 ago, so it's relatively current.
    I noticed a couple different interesting statements:
    posted by mmontgomery:
    In the case of .MOD, you are actually getting a MPEG-2 file. The way
    video files work is that there is a codec (COmpressor/DECompressor)
    algorithm and a file wrapper (or extension). A JVC .MOD file is a
    MPEG-2 encoded file, with a .MOD extension.
    You're faced with two
    challenges, first the .MOD file type is only recognized and support by a
    few applications. I think we covered some of those already. The
    interesting thing about wrappers and extensions is that they can be
    dealt with in a variety of ways. Sometimes all you need to do to convert
    the video file to a compatible video file is to change the extension.
    In the case of .MOD files that's not enough. The .MOD wrapper apparently
    does a few more things than just bare a unique extension name. It
    requires a slightly more complicated method to convert that file. That
    is why there is supplied software and that certain third party
    applications have .MOD support.
    (posted 2 years ago)
    This seems to indicate that Ann's solution of simply re-naming the extension is not good enough, unless I am mis-interpreting what she meant.
    However, another user said:
    posted by futball8:
    I edit with Adobe Premiere Pro CS3. All I have to do is simply rename
    the .MOD files as .MPG and then import into PP CS3. It takes a small
    amount of time to conform the audio, but no file conversion is
    necessary. It's a pretty slick workflow and I've never encountered any
    problems editing them this way.
    (posted 5 months ago)
    One can only assume that simply re-naming the extension from .mod to .mpg works in some circumstances, and doesn't work in others. I assume it depends largely on the editing software being used. Perhaps there are still issues that futball8 was simply unaware of or never encountered.
    That said, there seems to be a couple of different real solutions to this problem that I have found:
    1. Simply use an editing program that supports .mod file format. While pe7 and pe8 supposedly support the .mod format, the following should be noted:
    posted by macksgarage:
    While Elements 'supports' these files, it is markedly unstable and  frequently crashes while using the files, though the application is otherwise reliable.  The solution I have arrived at is to repair the  container using ffmpeg. (see #3)
    (posted 5 months ago)
    2. Use a file conversion utility of your choice that will covert .mod to .avi, or another desired format. Import the resulting .avi file into premiere pro cs4.
    3. Use FFmpeg. This seems to be the best solution as it does not convert any audio or video:
    posted by macksgarae:
    If you are not familiar with ffmpeg, it may be a bit of a bear to
    learn, but it's not only useful for this, but functions as a video swiss
    army knife useful for splicing, muxing/demuxing, and rendering just
    about any format into just about any other format.
    ffmpeg is an open source project from the linux world, but it has
    been ported and is supported on windows.  Fetch it here and place it somewhere handy
    on your system.
    To rewrite the container into a nice, standards compliant .mpg file
    that doesn't make applications die, WITHOUT rerendering video or audio
    itself, I use this command.
    ffmpeg -i INFILE.MOD  -acodec copy - vcodec copy OUTFILE.mpg
    This not only renames the file, but actually rebuilds the container
    around unmodified video and audio data, yielding a file which works much
    more stably with Adobe applications, and presumably others as well, as
    ffmpeg's open source development goals result in very standards
    compliant files.
    (posted 5 months ago)
    Now, this seems to properly address the issues that can arise from simply renaming .mod to .mpg, as suggested by Ann. So from this point, I assume you can simply import the .mpg into Premiere Pro cs4 (or any other .mpg compliant program) and edit without issue, but it seems like I remember hearing something about Premiere not liking mpegs or something like that, so in that case, maybe it'd be better to skip this and go with option #2. But, it's been awhile since I've touched any NLE, much less premiere pro cs4, so I could be completely wrong and it may have no problems handling mpegs.
    All of the things that I've quoted here came from the same thread, so I don't know how accurate any of this is, but the people that have posted these things seem fairly knowledgeable. If someone reads all of this and can confirm or deny any of it, it would be much appreciated.
    Option 1 is not really an option for me, because I am sticking with premiere pro cs4 -- I'm not going to get another editor just because it has .mod support. That leaves me with options 2 and 3: Convert to avi, or change the file wrapper/extension properly with FFmpeg and then simply import the resulting .mpg file... Which is better? Or is there yet another solution that I am unaware of that would be even better?

  • What's the best way to handle all my data?

    I have a black box system that connects directly to a PC and sends 60 words of data at 10Hz (worse case scenario). The black box continuously transmits these words, which contain a large amount of data that is continuously updated from up to 50 participants (again worst case scenario) 
    i.e. 60words * 16bits * 10Hz * 50participants = 480Kbps.  All of this is via a UDP Ethernet connection.
    I have LabVIEW reading the data without any problem. I now want to manipulate this data and then distribute it to other PCs on a network via TCP/IP.
    My question is what is the best way of storing my data locally on the interface PC so that I can then have clients request the information they require via TCP/IP. Each message that comes in via the Ethernet will relate to one of the participants, so I need to be able to check if I already have data about that participant - if I do then I can just update it, if I don't I need to create a record for the participant, and if I havn't heard from one for a while I will need to delete it. I don't want to create unnecessary network traffic. I also want to avoid global variables if possible - especially considering that I may have up to 3000 variables to play with.
    I'm not after a solution, just some ideas about how to tackle this problem... I thought I could perhaps create a database and have labview update a table with the data, adding a record for each participant. Alternatively is there a better way of storing all the data in memory besides global variables?
    Thanks in advance.

    Hi russelldav,
    one note on your data handling:
    When  each of the 50 participants send the same 60 "words" you don't need 3000 global variables to store them!
    You can reorganize those data into a cluster for each participant, and using an array of cluster to keep all the data in one "block".
    You can initialize this array at the start of the program for the max number of participants, no need to (dynamically) add or delete elements from this array...
    Edited:
    When all "words" have the same representation (I16 ?) you can make a 2D array instead of an array of cluster...
    Message Edited by GerdW on 10-26-2007 03:51 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • What is the best way to handle very large images in Captivate?

    I am just not sure the best way to handle very large electrical drawings.
    Any suggestions?
    Thanks
    Tricia

    Is converting the colorspace asking for trouble?  Very possibly!  If you were to do that to a PDF that was going to be used in the print industry, they'd shoot you!  On the other hand, if the PDF was going online or on a mobile device – they might not care.   And if the PDF complies with one of the ISO subset standards, such as PDF/X or PDF/A, then you have other rules in play.  In general, such things are a user preference/setting/choice.
    On the larger question – there are MANY MANY ways to approach PDF optimization.  Compression of image data is just one of them.   And then within that single category, as you can see, there are various approaches to the problem.  If you extend your investigation to other tools such as PDF Enhancer, you'd see even other ways to do this as well.
    As with the first comment, there is no "always right" answer.  It's entirely dependent on the user's use case for the PDF, requirements of additional standard, and the user's needs.

  • What is the best way to make a program fit different monitor resoultions?

    In our lab all our test stations have 1280x1024 resoultion monitors. In the "other lab" all the test station monitors are 1440x900 resoultion.
    Now I am tasked with making my programs run on the test stations in the other lab. I have tried setting the options "maintain proportions of windows for different monitor resoultions" and "Scale all object on front panel as the windows resizes" and of course neither one of these options really does what I would expect it to do.
    What is the best way to make programs fit different monitor resoultions?

    J-M wrote:
    I resize the Front Panel when the program start to fit the monitor resolution.  After that, I use the "SBE_Determine If Screen Resized.vi" from TomBrass (http://forums.ni.com/t5/LabVIEW/Resizing-controls-on-a-tab-control-within-a-pane/td-p/1520244 ).  This vi is very useful if you don't want to monopolize the CPU with the "Panel Resize" event.
    I don't like this function for a couple reasons.  First for the example you don't need any custom code to handle the window resizing, just use a couple splitters.  Even if you did need to handle the resize, you only resize after the mouse is up after the resize which is not how normal Windows programs work they resize as the mouse moves.  So I modified the VI to resize objects as you resize the window.  Then because doing this can generate 100 events very quickly, I use a boolean in a shift register to make sure that we only handle the resize event if there is no new resize events after 0ms.  This essentially makes a lossy queue and handles the last resize event.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Resizable_Graph.vi ‏22 KB

  • What is the best way to handle duplicate in an XML document?

    I have an XML document that may contain duplicated nodes. I want to insert it to the DBXML database, so that the duplicated nodes are eliminated.
    What would be the best way (in term of performance) to do it?
    I thought of enforcing the uniqueness constraint and then insert the nodes one by one, so that I will get an exception from the database if the node is duplicated, but I may have more than 50000 nodes in the worst case, so I'm not sure if this is still a good way to do it.
    Can someone give me some suggestion on this?
    Thanks!

    Hi,
    I would suggest to reconsider building of your document so that it doesn't contain duplicates if you don't need them. And it doesn't have much to do with DB XML then.
    Also you could insert your document with duplicates and use XQuery Update facilities to delete undesirable nodes.
    Vyacheslav

  • What is the best way to handle executing multiple packages from the Agent?

    I have several packages that have to be executed in sequence. I thought the best way to do that was by creating a job for each package then have a master job that executes the other packages. In my master job,  I'm using sp_start_job to call the other
    jobs. The problem is, the master job moves from step to step without waiting for the child jobs to finish; basically they all execute together.
    That is the way I've seen it done in other places so I feel like I'm doing something wrong. In the alternative, I know it's possible to set the individual steps up so they execute the packages directly without calling an external job. I prefer the first
    way though.
    Which way should I jump on this?

    So basically what I'm hearing is just call the packages in a mulit step job. Creating a master package and calling child packages sounds a little crazy and unscaleable especially considering that the packages have master child relationships
    within themselves. It's SSIS Package Inception. 
    Sorry whats the issue with that?
    Provided you're setting the package sequence correctly based on your dependency it will work fine as loop gets iterated based on how you set the package list.
    What we have is a audit and control mechanism which even have details on the dependency so based dependency set only the packages gets ordered and listed for the loop to iterate through and executing. Also tomorrow if a new package comes into being, all
    it takes for us is to tweak the audit table to add a new entry for the package and set the dependency and it will continue to work fine including the new package without touching the existing job for any modification whatsoever.
    Another advantage of this table is we also capture audit details in it like date when package got last executed, its status of execution,rows processed (insert,modified, deleted) etc which can be used for easy monitoring of the data processing tasks as well.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • What is the best way to deploy application that uses web services?

    Hi all,
    I'm having some problems figuring out the best way to deploy our app now that we've switched over to using web services.
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like.
    Here's a little background:
    We have a large PowerBuilder/Oracle application. The db consists of over 500 tables and the client consists of several thousand PB components. A user creates "transactions" which contain a series of "sub-transactions" within. Most of the data is collected and stored locally in the client in a series of datastores. When the "finalize" happens, the records are validated and sent to the database.
    We are in the process of moving each of the subtransactions (currently in the PB client) into subPROCESSES on a java project. We are using the JAX-WS framework to develop the web services in Netbeans. These web services aren't much more than remote xml as the messaging technology. For writing data back to the database, we are using the Java Persistence API to function outside of an EJB container but will shortly be migrating to the Glassfish application server to use several of the EJB container frameworks including the EntityManager.
    We haven't attempted any type of deployment and are unsure of where to start. Any suggestions would be so helpful and appreciated!
    Thanks!
    Edited by: doubleEspresso on Jan 10, 2008 8:06 AM

    >
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like. >Correct, while Java Web Start has 'web' in the name, it has little if anything to do with web applications - certainly not providing much toward their installation. It is for launching rich client GUI based (AWT, Swing, SWT..) applications onto the end-user's desktop.
    There are some parts of JWS that might seem peripherally useful to the installation of a web-app., but it is really not a 'good fit'.
    >
    ..Any suggestions would be so helpful and appreciated!>You might try the forums for the 'web tier' APIs.
    <http://forum.java.sun.com/category.jspa?categoryID=20>
    Or perhaps the forum 'Java Technologies for Web Services' (under 'enterprise technologies')
    <http://forum.java.sun.com/forum.jspa?forumID=331>
    This one in 'BigAdmin' seems particularly relevant, 'Set up and Deploy'
    <http://forum.java.sun.com/forum.jspa?forumID=550>

  • What's the best way to ID machines that need Jave SE 6 Update 14?

    I've just read the update release notes ( http://java.sun.com/javase/6/webnotes/6u14.html ) for the Java SE 6 Update 14 and I want to deploy it to our systems. I've never been real good at knowing just how to identify what version of Java a machine had. Because we're all Windows here, we usually look for products that are registered in Add / Remove Programs and that does the job for us. However, I'm not sure what the versioning should be for this update. Does anyone have the answer to this?

    Yes, that looks like the best way to identify the verison. I just get confused about the various versions and how they may or may not be related. For example, in the release notes, they talk about the 6u14 baseline and they mention other related version numbers
    Security Baseline
    6u14 specifies the following security baselines for use with Java Plug-in technology: JRE Family Version Java SE
    Security Baseline Java SE for Business
    Security Baseline
    5.0 1.5.0_18 1.5.0_18
    1.4.2 1.4.2_19 1.4.2_20
    I guess my question should have been worded, what "numbers" should I be searching for in Add/Remove Programs? 6.0, 5.0, 1.5.x or 1.4x?

Maybe you are looking for

  • Losing the ability to drag objects after 30 minutes. What's going on?

    Hi, I'm having a very strange problem. In InDesign, I'm losing the ability to drag objects around with the mouse after about 30 minutes of using the program. Everything else works fine, but I simply cannot perform this function. The box highlights, b

  • Color correction with third party options

    I have been shopping and researching for a third party plugin for FCPX for color correction/grading. Specifically, I have been looking at options like HyColor Pro and Hawaiki AutoGrade ... I asume, these options are utilizing the built in color contr

  • What are all the different account types?

    What are all the different account types? What is variance reporting? Where you create exchange rate table?

  • Great Training opportunity  - ODTUG

    There are a ton of threads on this and other forums about training. Better than going to an individual training class is to attend the ODTUG Kaleidoscope conference. Not only is it cheaper, but you will get more out if it. As of today, more has been

  • Sound Blaster 5.1 or Sound Blaster Live

    can enybody help me to find the right driver for Creative Sound Blaster 5. please note that its not Creative Sound Blaster Li've 5. Creative Sound Blaster 5. and Creative Sound Blaster Li've 5. ARE THEY SAME? OR WHAT?can anybody help me?thanks in adv