Question about typecast to more generic Class

I have controls refnum and pages refnum and I want to know which way is better:  
1) let LabVIEW doing the job
or 2) use "typecast to more generic Class". 
In both case the VI works properly. 
Thanks
Jean-Marc
Jean-Marc
LV2009 and LV2013
Free PDF Report with iTextSharp
Solved!
Go to Solution.
Attachments:
Test LV86.zip ‏153 KB

Thanks for your reply Ben.
I need the controls refnum in the visible part of the pane (for the translation english to french and french to english ).
Jean-Marc
Jean-Marc
LV2009 and LV2013
Free PDF Report with iTextSharp
Attachments:
Translation LV86.zip ‏235 KB

Similar Messages

  • Design question about when to use inner classes for models

    This is a general design question about when to use inner classes or separate classes when dealing with table models and such. Typically I'd want to have everything related to a table within one classes, but looking at some tutorials that teach how to add a button to a table I'm finding that you have to implement quite a sophisticated tablemodel which, if nothing else, is somewhat unweildy to put as an inner class.
    The tutorial I'm following in particular is this one:
    http://www.devx.com/getHelpOn/10MinuteSolution/20425
    I was just wondering if somebody can give me their personal opinion as to when they would place that abstracttablemodel into a separate class and when they would just have it as an inner class. I guess re-usability is one consideration, but just wanted to get some good design suggestions.

    It's funny that you mention that because I was comparing how the example I linked to above creates a usable button in the table and how you implemented it in another thread where you used a ButtonColumn object. I was trying to compare both implementations, but being a newbie at this, they seemed entirely different from each other. The way I understand it with the example above is that it creates a TableRenderer which should be able to render any component object, then it sets the defaultRenderer to the default and JButton.Class' renderer to that custom renderer. I don't totally understand your design in the thread
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=680674
    quite yet, but it's implemented in quite a bit different way. Like I was saying the buttonClass that you created seem to be creating an object of which function I don't quite see. It looks more like a method, but I'm still trying to see how you did it, since it obviously worked.
    Man adding a button to a table is much more difficult than I imagined.
    Message was edited by:
    deadseasquirrels

  • A question about a method with generic bounded type parameter

    Hello everybody,
    Sorry, if I ask a question which seems basic, but
    I'm new to generic types. My problem is about a method
    with a bounded type parameter. Consider the following
    situation:
    abstract class A{     }
    class B extends A{     }
    abstract class C
         public abstract <T extends A>  T  someMethod();
    public class Test extends C
         public <T extends A>  T  someMethod()
              return new B();
    }What I want to do inside the method someMethod in the class Test, is to
    return an instance of the class B.
    Normally, I'm supposed to be able to do that, because an instance of
    B is also an instance of A (because B extends A).
    However I cannot compile this program, and here is the error message:
    Test.java:16: incompatible types
    found   : B
    required: T
                    return new B();
                           ^
    1 errorany idea?
    many thanks,

    Hello again,
    First of all, thank you very much for all the answers. After I posted the comment, I worked on the program
    and I understood that in fact, as spoon_ says the only returned value can be null.
    I'm agree that I asked you a very strange (and a bit stupid) question. Actually, during recent months,
    I have been working with cryptography API Core in Java. I understood that there are classes and
    interfaces for defining keys and key factories specification, such as KeySpec (interface) and
    KeyFactorySpi (abstract class). I wanted to have some experience with these classes in order to
    understand them better. So I created a class implementing the interface KeySpec, following by a
    corresponding Key subclass (with some XOR algorithm that I defined myself) and everything was
    compiled (JDK 1.6) and worked perfectly. Except that, when I wanted to implement a factory spi
    for my classes, I saw for the first time this strange method header:
    protected abstract <T extends KeySpec> T engineGetKeySpec
    (Key key, Class<T> keySpec) throws InvalidKeySpecExceptionThat's why yesterday, I gave you a similar example with the classes A, B, ...
    in order to not to open a complicated security discussion but just to explain the ambiguous
    part for me, that is, the use of T generic parameter.
    The abstract class KeyFactorySpi was defined by Sun Microsystem, in order to give to security
    providers, the possibility to implement cryptography services and algorithms according to a given
    RFC (or whatever technical document). The methods in this class are invoked inside the
    KeyFactory class (If you have installed the JDK sources provided by Sun, You can
    verify this, by looking the source code of the KeyFactory class.) So here the T parameter is a
    key specification, that is, a class that implements the interface KeySpec and this class is often
    defined by the provider and not Sun.
    stefan.schulz wrote:
    >
    If you define the method to return some bound T that extends A, you cannot
    return a B, because T would be declared externally at invocation time.
    The definition of T as is does not make sense at all.>
    He is absolutely right about that, but the problem is, as I said, here we are
    talking about the implementation and not the invocation. The implementation is done
    by the provider whereas the invocation is done by Sun in the class KeyFactory.
    So there are completely separated.
    Therefore I wonder, how a provider can finally impelment this method??
    Besides, dannyyates wrote
    >
    Find whoever wrote the signature and shoot them. Then rewrite their code.
    Actually, before you shoot them, ask them what they were trying to achieve that
    is different from my first suggestion!
    >
    As I said, I didn't choose this method header and I'm completely agree
    with your suggestion, the following method header will do the job very well
    protected abstract KeySpec engineGetKeySpec (Key key, KeySpec key_spec)
    throws InvalidKeySpecException and personally I don't see any interest in using a generic bounded parameter T
    in this method header definition.
    Once agin, thanks a lot for the answers.

  • Questions about ABAP Unit (Integrate in class / encapsulate DB access)

    Hi,
    i have allready done some Unit Tests. Till this post i have created a report and put my test class definition / implementation there. The report is just a wrapper for testing. The functionallity is impelemented in classes.
    My first Question is how to integrate the test code in my class. In all examples they put the code beneath the class implementation. How do i get there? In se80 i can only see the public definition.
    The other question is about testing methods, which contains database access. How can i encapsulate the db access for tests. I read abput implementing a seperate class, which handles all db related actions.
    Bye Richard.

    Hello Richard,
    it is recommended to keep the domain code and the test code within the same program. Depending on the release in use a Class-Pool (program) offers an implementation include (for any local class) or possibly also a dedicaded test class include.
    Put the definition and the implementation of your unit test into one of this includes.
    In case your code under test has hard to test dependencies you need to break them. After the hard to test dependency (such as repository access) is separated it can be replaced by use of test doubles (see also http://www.xunitpatterns.com).
    Propably the following approach is the easiest one:
    - put any db access into a separate method
    - create a local subclass as test double that overwrites exactely the db access methods with test friendly code
    - run your unit test logic against this local test double
    The say "cleaner" way is to:
    - separate the db access to a dedicated repository service class (with instance methods of course).
    - create a test double of this repository class
    - use the technique "dependency injection" and run your test
    Best Regards
      Klaus

  • What is branding all about, make it more generic a...

    Nokia and other manufacturers produced great phones. But branding the phones has allowed service providers the opportunity to modify or even disable great features that the phones are capable of.
    (N95)
    Some service providers are still only offering V11.0.0.xxx or V12.0.0.xxx. ( bit out of date )
    I have an unbranded N95, which works with any UK operator and have upgraded to V20.0.0.15 (Battery life and usability greatly improved)
    The Nokia forums Are full of "Why Can I not upgrade Blaa Blaa Blaa"
    I fully understand why they are P***ed off.
    Why do the SP's not understand this, and stop the branding, and allow the consumer the ability to chose??
    #This is only a very personal point of view, but may make a lot off "p***ed off people very happy if SPs odopted this option??
    LoL, dona wana
    dona wana by a branded phone!!
    Any comments welcome
    Some things in life are guaranteed, but can you claim on them?

    The operator's primary tools for trying to "encourage" customer to stick with them are:
    - long-term contracts
    - SIM locks on devices they subsidize (sell or donate below cost, for them)
    If you get a long-term contract with a subsidized device, and do not use it, you're a customer that causes them to lose money. The SIM lock is there to make that less likely (more difficult).
    The main reason operators do more than that - branding, customization - is differentiation; they want to promote/advertise their own brand and services over their competition and "generic" services by the device manufacturers or anyone on the Internet.
    Those are their tools to get people to sign up for the contracts and their tariffs (to get back the money they already "lost" on customer acquistion, device subsidy, and to make a profit, too.)
    They want users to think that the operator brand and services are what people really want, and not the device (device manufacturer's name.
    And of course they have to believe that their services are so much better than their competitors, and also "generic" or indepdendent services. (Of course, sometimes, the operator can have really good, first-class services that are better than anyone else's. Most of them probably aren't.)
    In other words, their browser homepage - or "portal" - has everything people should use, their email is better than any other you can find on the Internet, their VoIP service is best (or if they don't have such a service, they'd rather see it disabled entirely on the device), etc.
    As long as enough consumers go for this, and sign up for the long-term contracts and customized/branded devices, the operators will continue at it. When it is no longer worth it (when it starts to make them lose money overall - not just in the case of specific individuals - rather than making money, they'll stop).
    Message Edited by petrib on 09-Dec-200701:13 PM

  • New to Arch(64), with a few questions about Xorg and more

    Hello and Happy New Year everyone,
    I'm a user that has just recently decided to try and switch to Linux as the main OS for all things that don't concern gaming. I've been using the "server side" of Linux at work for a couple years now, but when it comes to its desktop part I consider myself not fully competent yet. Under recommendation of a friend I decided to give Arch a shot, and I can say that it really suits my philosophy on how an OS should be like.
    I have a few issues I'm currently struggling with that I couldn't seem to solve by looking on my own: as they are mostly minor and shortly described, I thought about packing them up in one single thread to avoid making too many. I've used i686 as testing grounds and am now using x86_64, but most of my problems apply to both.
    Here's my hardware, for reference:
    - Intel E8400 CPU (3GHz, dual core)
    - Asus P5Q-E motherboard
    - 2 GB DDR2 800 RAM.
    - nVidia 8800GT video card with 512MB memory
    - Samsung SyncMaster 713BM flat panel, connected via DVI cable
    - Creative SBLive! 5.1 OEM card (dug up for the occasion since it has hardware mixing)
    I'm using the latest Xorg from the repos, nvidia proprietary drivers, ALSA, Xfce4 + compiz-fusion, and SLIM as my login manager.
    And here are my headaches:
    - (32/64) A similar issue to the one I just mentioned: compiz-fusion doesn't seem to stick around as my window manager, even though I manually set it as per Method 2 from this wiki page. Although it did work for a while, after some time (perhaps after installing some package? but I didn't really install anything X related) it simply stopped working. To get my windows, I have to manually run fusion-icon after login.
    - (32/64) I'm using MPlayer with libass to watch my favourite anime, but sometimes MPlayer freezes up, forcing me to xkill it. Disabling ASS embedded subs yields error message 11, something about unsufficient resources. Disabling subs entirely prevents MPlayer from crashing. Oh, the errors only happen on specific points of certain videos, and all the videos work just fine under WinXP with MPC or VLC.
    - (32/64) Why do anti-aliased fonts under Linux still look so bad, even though I installed the appropriate packages suggested in the wiki? I don't mind disabling anti-aliasing entirely and just using Verdana, but is there some trick to it besides setting sub-pixel hinting under rclick->settings->user interface?
    - (32/64) My SBLive might be 5.1, but I'm only using the front connector as I use either two stereo speakers or headphones all the time. But the volume setting in applications (such as MPlayer) seems to affect the PCM meter of ALSA's mixer, putting it over 0 dB gain and generating sound distortion.
    - (64/don't know if 32 too) Why does Compiz's framerate drop so badly when I push alt-tab? I'm using the default application shifter, hardware acceleration, and there should be no reason why the framerate should drop like that (expecially considering that wobbly windows or cube rotating don't affect my performance at all). I've read around the net about very similar occourances with the task switcher, but I've found no real solution.
    - [SOLVED] (32/64) The first obstacle I came across was that I couldn't set my screen refresh any higher than 60Hz when I actually wanted 75Hz: I solved this by setting the vertical refresh to 76.0-76.0 in xorg.conf. However, for some reason this setting doesn't stick on reboot: I have to log in and manually run rclick->System->NVIDIA X Server Settings for it to apply.
    - [SOLVED] (64 only) The 32 version of Xorg was fine, but for some reason I'm not getting the correct keyset (Italian) under X, while everything works in vc. I think I read something about disabling a module called "keydev", but is this really the way to go?
    - [SOLVED] (64 only) Although I can hear sound in just about every application, the 64 bit version of Pidgin doesn't "ring" on received messages even though the associated option is enabled.
    I kindly thank you in advance for your assistance: I will provide any configuration files that might be needed to help me out
    Last edited by Akaraxle (2009-01-03 21:25:43)

    xisal wrote:
    Take a look into /etc/hal/fdi/policy/10-keymap.fdi. This works with portuguese layout:
    <snip>
    The file did not exist, so I created it and changed "pt" to "it". Thanks a bunch, that fixed it!
    Try SMPlayer.
    Ah, I'd rather not involve Qt. Besides, isn't SMPlayer simply a frontend to Mplayer (who already has GMplayer integrated into it, IIRC)?
    Mikko777 wrote:
    Why would you want to use 75Hz with lcd display?
    Does it make a difference?
    On my monitor, from my point of view, it appears to make a difference. It's that simple
    azleifel wrote:In gmplayer Preferences -> Audio -> (assuming alsa selected) -> Configure driver and change the mixer channel to something other than PCM, e.g. Master.
    For all the three combos, I have "driver default" selected. The other option is "default"; I tried to manually type "Master" into the mixer channel field, but then gmplayer's windows and my Xfce taskbar started blinking, so I knew I had just "crossed streams".
    Regarding NVIDIA X Server Settings, running "usr/bin/nvidia-settings --load-config-only" at login is the only way to apply the settings "automatically".
    I've slapped that on my ~/.xinitrc before "exec startxfce4". Thanks in advance, going to test it now!
    About the refresh and non-decorated windows issues (which *appears* to be solved after I've wiped the xfce-session cache), I've been thinking: could they somehow be related the login manager I've chosen, SLIM?
    P.S. New question: is there any way to enable the ALT+num126 for ~ keyboard behaviour I'm used to under M$ environments?
    Last edited by Akaraxle (2009-01-03 09:43:02)

  • Question about writeObject/readObject and descendants classes

    Hello to all,
    I have a doubt about how class serialization is done that I'd like to remove.
    I wrote a class (called "A") that implements Serializable interface and, according to java documentation, I implemented the methods read/writeObject and all seem work well.
    Now I would know if I have to copy and paste the same methods also in classes that are instantiated into my A class or it is not necessary.
    This is an example code:
    public class A implements Serializable {
    private B Bclass;
    private void writeObject(ObjectOutputStream out) throws IOException {...}
    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {...};
    public A() {
    B = new Bclass(1,2,3);
    public class B implements Serializable {
    private int a,b,c;
    private C Cclass;
    public B(int a, int b, int c) {
    this.a = a;
    this.b = b;
    this.c = c;
    C = new Cclass(a,b);
    public class C implements Serializable {
    private int a,b;
    public C(int a, int b) {
    this.a = a;
    this.b = b;
    this.c = c;
    }Is it necessary add read/writeObject methods also in "B" and "C" classes?
    Thank you in advance for your answers.
    Kind Regards,
    Antonio.

    Antonio.A wrote:
    The only thing that I do is (d)encrypt in a special manner the (In|Out)put object Stream (and all works well).
    The problem is not the method's implementation, but if I have to copy and paste read/writeObject also in the classes initialized into the root class of serialized tree.if i understand correctly, you want to serialize some graph of objects, encrypt that, and then write the encrypted data to the actual ObjectOutputStream. so, assuming you always know the root object of your graph, then this special behavior only needs to exist on these root objects. if any object could be the root of the graph, you would need it on every object. of course, then every object would be independently re-encrypted. this seems like behavor which would be better to handle outside of the objects themselves. unless of course you have some wrapper class whose only purpose is to encrypt the actual data.
    *If read/writeObject methods are correctly implemented in the root class that I would serialize, Are they automatically used to serialize also other classes that I initialize and save into the DataStruct of my root class?* i would say the documentation on the Serializable interface is pretty clear and concise.

  • Question about static context when using classes

    hey there.
    i'm pretty new to java an here's my problem:
    public class kreise {
         public static void main (String[] args) {
             //creating the circles
             create a = new create(1,4,3);
             create b = new create(7,2,5);
             System.out.println(a);
             System.out.println(b);
             //diameters...unimportant right now
             getDiameter a_ = new getDiameter(a.radius);
             getDiameter b_ = new getDiameter(b.radius);
             System.out.println(a_);
             System.out.println(b_);
             //moving the circles
             double x = 2;
             double y = 9;
             double z = 3;
             a = create.move();
             System.out.println(a);
    }creating a circle makes use of the class create which looks like this:
    public class create {
        public double k1;
        public double k2;
        public double radius;
        public create(double x,double y,double r) {
            k1 = x;
            k2 = y;
            radius = r;
        public create move() {
            k1 = 1;
            k2 = 1;
            radius = 3;
            return new create (k1,k2,radius);
        public String toString() {
        return "Koordinaten: "+k1+" / "+k2+". Radius: "+radius;
    }now that's all totally fine, but when i try to usw create.move to change the circles coordinates the compiler says that the non-static method move() can't be referenced from a static context. so far i've seen that my main() funktion MUST be static. when declaring the doubles k1, k2, and radius in create() static it works, but then of course when having created the second circle it overwrites the first one.
    i pretty much have the feeling this is very much a standard beginner problem, but searching for the topic never really brought up my problem exactly. thanks in advance!

    You can't access a non-static method from within a static context. So, you have to call move() from outside of the main method. main has to be static because, in short, at least one method has to be static because there haven't been any objects initialized when the program is started. There are more fundamental problems than with just the static context issue.
    I'm confused by your code though. You call create.move(), but this would only be possible if move() was static, and from what I see, it's not. Now that's just one part of it. My second issue is that the logic behind the move() method is very messy. You shouldn't return a newly instantiated object, instead it should just change the fields of the current object. Also as a general rule, instance fields should be private; you have them as public, and this would be problematic because anything can access it.
    Have you heard of getters and setters? That would be what I recommend.
    Now, also, when you are "moving" it, you are basically creating a new circle with completely differently properties; in light of this, I've renamed it change(). Here would be my version of your code:
    public class CircleTester {
        public static void main (String[] args)
             //Bad way to do it, but here's one way around it:
             new CircleTester().moveCircle();
        private void moveCircle()     //really a bad method, but for now, it'll do
            Circle a = new Circle(1,4,3);
            Circle b = new Circle(7,2,5);
            System.out.println(a);
            System.out.println(b);
            //diameters. Don't need to have a new getDiameter class
            double a_ = a.getRadius() * 2;     //Instead of doing * 2 each time, you could have a method that just returns the radius * 2
            double b_ = b.getRadius() * 2;
            System.out.println(a_);
            System.out.println(b_);
            //move the circle
            a.change(2,9,3);
            System.out.println(a);
    public class Circle {
        private double k1;
        private double k2;
        private double radius;
        public Circle(double x,double y,double r)
            k1 = x;
            k2 = y;
            radius = r;
        public void change(int x, int y, int r)
            k1 = x;
            k2 = y;
            radius = r;
        public String toString()
             return "Koordinaten: "+k1+" / "+k2+". Radius: "+radius;
        public double getRadius()
             return radius;
    }On another note, there is already a ellipse class: http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/Ellipse2D.html

  • Two questions about the methods in InputStream class.

    1, close() method
    the API says when the method is invoked, the input stream and its associateive channels are closed to release system resources.
    What does it mean by "associative channels"?
    2, read(byte[] b) method
    the API says it reads b bytes of data and returns b.length as an Integer, however, I dont think what can this method do, because unlike normal read(), which returns the actual byte of data read, but returns the no of byte read, which I cant find a way to mainpulate with the data read.
    Any help??
    please help
    thanks

    while(true){
    int lim = in.read(bufferArray);
    if(lim == -1)break;
    buffer.limit(lim);
    buffer.flip();
    channel.write(buffer);
    buffer.clear();
    while (true)
    int lim = in.read(buffer);//No such method in InputStream
    if (lim < 0) break;
    buffer.flip();
    channel.write(buffer);
    buffer.compact();
    My guess is that you didn�t read my original post properly. The variable in is an InputStream and it doesn�t have a read method that takes a ByteBuffer as an argument.
    In my code I am using a byte array, which is backed by the buffer, I don�t believe that when writing to this byte array , the InputStream will try to update the internal accounting system of the buffer, that�s why I have done this manually by setting the limit of the buffer (the number of bytes actually read are set as the limit).
    Correct me if I am a wrong thanks for your feedback .

  • A question about non-static inner class...

    hello everybody. i have a question about the non-static inner class. following is a block of codes:
    i can declare and have a handle of a non-static inner class, like this : Inner0.HaveValue hv = inn.getHandle( 100 );
    but why cannot i create an object of that non-static inner class by calling its constructor? like this : Inner0.HaveValue hv = Inner0.HaveValue( 100 );
    is it true that "you can never CREATE an object of a non-static inner class( an object of Inner0.HaveValue ) without an object of the outer class( an object of Inner0 )"??
    does the object "hv" in this program belong to the object of its outer class( that is : "inn" )? if "inn" is destroyed by the gc, can "hv" continue to exist?
    thanks a lot. I am a foreigner and my english is not very pure. I hope that i have expressed my idea clearly.
    // -------------- the codes -------------------
    import java.util.*;
    public class Inner0 {
    // definition of an inner class HaveValue...
    private class HaveValue {
    private int itsVal;
    public int getValue() {
    return itsVal;
    public HaveValue( int i ) {
    itsVal = i;
    // create an object of the inner class by calling this function ...
    public HaveValue getHandle( int i ) {
    return new HaveValue( i );
    public static void main( String[] args ) {
    Inner0 inn = new Inner0();
    Inner0.HaveValue hv = inn.getHandle( 100 );
    System.out.println( "i can create an inner class object." );
    System.out.println( "i can also get its value : " + hv.getValue() );
    return;
    // -------------- end of the codes --------------

    when you want to create an object of a non-static inner class, you have to have a reference of the enclosing class.
    You can create an instance of the inner class as:
    outer.inner oi = new outer().new inner();

  • HT201303 hi just got my new apple ipod touch i need to update my security information other wise it wont let me download apps it says to enter three questions about myself and i get to the third question and it wont let me enter the third question

    hi just got my new apple ipod touch and to download apps it wants to add questions about myself for more sercurity information. i get up to question 3 and it wont let me select a question but it will let me write an answer so i just pressed done and then it says i cant carry on because ive mised out information when it wont let me do a question!

    Welcome to the Apple community.
    You might try to see if you can change your security questions. Start here, change your country if necessary and go to manage your account > Password and Security.
    I'm able to do this, others say they need to input answers to their current security questions in order to make changes, I'm inclined to think its worth a try, you don't have anything to lose.
    If that doesn't help you might try contacting Apple through Express Lane (select your country, navigate to iCloud help and enter the serial number of one of your devices)

  • Some question about sqlserver2008 sqljdbc4.jar

    hi,thank for read.
    I have a question about  sqljdbc4j.jar's PreparedStatement class.
    When i use PreparedStatement to deal a 'like ? ' query , like this sql (select * from(select ROW_NUMBER() Over(order by id) as rownum,* from t_word ) t where 1=1 and name like ?)
    then i set the like param for '%param%' or '%param' or '%param' , the program return
    different results, why ?
    Is there other way to deal this problem?
    Thanks again for the reading. And I hope to get your asap

    Hello,
    WHERE title LIKE '%param%' will return all name with the word 'param' anywhere in the name; '%param' will return names end with "param";'param%' with return start with "param".
    Referece:
    LIKE (Transact-SQL)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Few questions about Calendar / SimpleDateFormat classes

    Hi.
    I have few questions about Calendar class:
    1. How can I get only date representation (without the time)?
    after doing:
    Calendar cal = Calendar.getInstance();
    I tried to clear unecessary fields:
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.HOUR_OF_DAY);
    But after printing the time, it seems that the HOUR was not cleared:
    SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    System.out.println(sdf1.format(cal.getTime()));
    ---> 03/11/2004 17:00:00
    Am I missing somthing?
    2. I want to make sure that two different formats couldn't be compared. i.e., if I'll try to parse one String according to different format -- ParseException will be thrown.
    String date = "19/04/2004 13:06:10";
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    Date dateObj = sdf.parse(date);
    However, even though that formats are different, no exception is thrown and the return Date is 19/04/2004 00:00:00.
    How can I cause to exception to be thrown if formats are not identical?
    Thanks in advanced

    The Calendar class has a few of what Microsoft would call 'features'. :^)
    To clear the time, call:
    calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY), 0, 0, 0);
    If you want 'pessimistic' rather than 'optimistic' date parsing, you have two options:
    1) Call calendar.setLenient(false);
    See if that is strict enough for your needs, otherwise:
    2) Write code to ensure a stricter parsing of the string passed in. For example, you could very simply check the length of the string to determine if time data is also present.
    When parsing, a string like '02/29/02' would parse to the date '03/01/02'. Setting lenient to false may fix this, but the surest way is to do some testing and then make the parsing more pessimistic where it suits your needs.
    - Saish
    "My karma ran over your dogma." - Anon

  • Some generic  questions about JMF

    Hi, as new to JMF, I would like to ask some generic questions about JMF from this community
    Though including RTP stack, JMF is only compatible to old RTP draft, RFC1889. I know that Sun stopped developing/supporting JMF. What is the alternative solution for JAVA RTP implementation suitable for a serious SERVER project, not just a school-term project? Has anyone thought about that or may have already moved forward? Is that any commercial or more updated Java based RTP stack currently? I searched with google. Besides jrtp, a school project, and I could not find a nice one. Majority of RTPstack implementation is C/C++.
    My second question is if there is the performance analysis and comparison of JMF. I know that some client applications such as SIP-Communicator adopt JMF for media delivery. But it is for one user in one machine. I wonder if any server application has adopt JMF as media relaying layer.
    I appreciate any input from this community.

    erwin2009 wrote:
    Hi, as new to JMF, I would like to ask some generic questions about JMF from this communitySure/
    Though including RTP stack, JMF is only compatible to old RTP draft, RFC1889. I know that Sun stopped developing/supporting JMF. What is the alternative solution for JAVA RTP implementation suitable for a serious SERVER project, not just a school-term project? Has anyone thought about that or may have already moved forward? Is that any commercial or more updated Java based RTP stack currently? I searched with google. Besides jrtp, a school project, and I could not find a nice one. Majority of RTPstack implementation is C/C++. There is one active project out there, Freedom for Media in Java, that has RTP capabilities. It's obviously not from Sun, but it's the only other RTP-capable project I am aware of, other than FOBS4Java, I believe is the name of it.
    What they are suitable for is beyond my scope of knowledge, I only know of the 2 projects.
    My second question is if there is the performance analysis and comparison of JMF. I know that some client applications such as SIP-Communicator adopt JMF for media delivery. But it is for one user in one machine. I wonder if any server application has adopt JMF as media relaying layer. None that I have seen, except for various projects I've helped people with on this forum. But, if someone is asking for help on a forum with his/her server application, it probably doesn't meet the guidelines you just laid out ;-)
    I appreciate any input from this community.Sorry I don't have more to add to your inquires...

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

Maybe you are looking for