XAML Namespaces - Why Oh Why Is it "using:" Instead of "clr-namespace"?

Something's been bugging me for awhile now. I'm writing an application with both a Windows Runtime version as well as a WPF version for legacy users (sorry, but Win8 just doesn't have enough marketshare yet!)
Thanks to PCL and MVVM, I can re-use 90% of the C# code. Yippiee!
But the XAML is another story, and a HUGE part of that is the fact that in Windows Apps, identifying a XAML namespace requires "using:namespace.name" whereas in WPF, it's "clr-namespace:namespace.name"
I would be able to share a huge proportion of my XAML files between my two app versions if not for this seemingly arbitrary difference between the two platforms.
Why oh why was this done this way? Is there some technical reason MS does not wanting us sharing XAML files between platforms? Is there some best practice I'm violating by trying to do this? 
By the way, for those who are interested, there is somewhat of a workaround. On the WPF side, if you keep your user-controls entirely in a different module (and they never refer to each other in their own XAML files), you can use XmlnsDefinition to
define your module's XAML namespace as anything you want. So I can actually then refer to the uc's namespace as "using:namespace.name." That way it compiles properly both in the WPF and Windows App projects. That is indeed what I've been doing and
now I'm sharing 90% of XAML as well. 
Still, why oh why? Really, I'm not just trying to troll here. If there's a technical reason this was done and more importantly if there's a good reason I should not be attempting to share XAML code between WPF and App projects, I'd definitely like to know
Thanks much.
Peter

The thread I was thinking of is at
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/7f492c62-4844-40e6-960c-27cbf076b812/how-do-we-file-a-change-request-on-the-xmlns-in-winrt-xaml?forum=winappswithcsharp
The UI design of WPF and of Windows Store apps is generally different enough that there wouldn't be a large overlap in Xaml. You'll generally want different layouts, many of the standard controls are different, and there are several other Xaml
features which differ between WPF and Windows.UI.Xaml.
It would be very useful to be able to share Xaml for custom controls and UserControls, and conditional compilation (#ifdef) for Xaml is a frequently heard request (although I don't see that obviously on
http://wpdev.uservoice.com , but I may just be failing at search).
I know some people do pre-processor tricks to fake this at the expense of being able to use the designer, but it's neither supported nor something I've looked into deeply.

Similar Messages

  • Why can't I just use my debit card for adding my child to family share?!

    I want to use my child on family share but can't because I don't need or want a credit card, my bank has fraud protection, who actually just called me about fraud because I purchased the newest iPhone! I don't like credit cards. Why can't I just use my debit card as usual? Kids can get credit cards just as easily as they can debit cards! This is ridiculous. Why isn't there another option to verify I am the parent?! I am so beyond angry right now. Like I am being punished for not owning a credit card!! Otherwise there will be another way to do this. A person should have the freedom to use their chosen form of payment without missing out on all the options available. Honestly even if I wanted a credit card I haven't enough credit because of past mistakes. So this is not making me happy at all.

    Mad Parent,
    I feel your pain. We refuse to have credit cards, too; yet it's required in order to create a child's apple id. I will most definitely be leaving feedback with Apple. This is absolutely ridiculous that we can't just use our debit cards! Mine is a VISA. I use it to make CREDIT CARD transactions everywhere else, why not be able to use it the same way here!?
    I just had to restore my sons phone because he forgot his 4-digit password and got it disabled. I didn't have it already on my itunes so my only option was to restore it. I wanted to create his own apple id so he didn't have to keep using mine. Because every time he downloads a new game it automatically ends up on MY device as well, not just his. Anyway, he needs his own apple id. But, apparently, that won't be happening until Apple gets their heads out of their butts and figures out how to serve ALL of their customers!
    Signed,
    Equally Mad Parent

  • I uploaded the giftcard money to my itunes account. and now when i try and buy a song it keeps saying that it has to charge my card. why wont it let me use the giftcard money? how can i fix this?

    i put money to my itunes account. and now when i try and buy a song it keeps saying that it has to charge my card. why wont it let me use the giftcard money? how can i fix this?

    If you still have your old card listed on your account then try selecting the 'none' option and remove it and then try entering the card's details from scratch. If that doesn't work then what is the full error message that you are getting, and the card is registered to the same name and address (including format and spacing) that you have on your iTunes account ?

  • Why can't I just use DreamWeaver?

    I purchased a subscription to DreamWeaver nearly a year ago, but every time I try to open the program, it tells me that my trial period has expired. When I follow the instructions to "License this Software," it tells me to log in and asks me for a serial number. When I key in the serial number--the exact serial number that's listed with my username and password--it tells me the serial number is invalid. Why can't I just use the software? I've been paying a monthly fee for 11 months now, and I have to go through this charade every time I triy to use the software. Been using computers for 30 years and never experienced anything like this. Any advice?

    Hi JohnLynnBob,
    You should delete all the Adobe entries from the 'hosts' file in your computer.
    The location of hosts file is
    For windows :-- C:\Windows\System32\drivers\etc\hosts (Open it with notepad)
    For Mac :-- Open finder window ---> click on Go on the top ---> Go to folder --->Type '/etc' ---> Press enter --- hosts ( open it with text edit)
    If you see any Adobe entries in the hosts file delete them, save the file, and then launch the product ---> license this software ---> sign in ---> the subscription will be activated.
    Thanks
    Kapil

  • HT1665 There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    I have always found spell check to be "buggy" in every version of all of the iOS's that I have run on my original model iPad and my new iPad - especially when replying and typing posts in these forums. It works perfectly in every other application on my iPad but it has never worked perfectly in any web browser that I have used on my iPad - no matter what I have done to try to correct it. That is what MY experience has been with spell check on my iPads.
    As for the crashes on your iPad try these basic troubleshooting steps.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Quit all apps and restart. Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • Why can I no longer use an image for my signature on forms?  The only option I have now is "use a certificate".  It was never like this until today.

    Why can I no longer use an image for my signature on forms?  The only option I have now is "use a certificate".  It was never like this until today.

    Hi,
    I had never heard of someone using the iPhone Number as the ID in the iMessages account in the Mac version.
    i.e without adding an Apple ID
    iMessages does allow iPhone numbers and mine lists mine.
    I would try this.
    Sign Out of the iMessages account and Quit Messages
    On the iPhone in Settings > Messages remove the Apple ID
    Set the iPhone to Airplane mode for a few minutes (to break with the  Server)
    On starting the phone up again check the iPhone Number  is ticked for iMessages.
    If it is add the Apple ID
    On the Mac restart Messages
    Add the Apple ID
    At this point you should get a pop up or two saying the iPhone is using the Number and Apple ID.
    Accept these and they get added to the Receive At list and Send From drop down.
    9:41 pm      Monday; October 28, 2013
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Why can I no longer use my headphones remote to fast forward or rewind music videos on iPhone since upgrading to ios7?

    Why can I no longer use my headphones remote to fast forward or rewind music videos on iPhone since upgrading to ios7?

    The YouTube app is not included in iOS 6 (I think because the licensing agreement with google ended). You will either need to try one of the YouTube apps from the store (there is an iPhone optimised app from google, and other people have said that they are working on an iPad version), or (if this isn't the version that you have tried) try accessing the mobile version via Safari : http://m.youtube.com (you can create a home screen shortcut for the site)

  • Why can I no longer use AirPlay with my Slingbox?  New updates break complatibility?

    Why can I no longer use AirPlay with my Slingbox?  New updates break complatibility?

    You already seem to know what the issue is, it is the parallax feature that was added to iOS 7.  From your rant, it appears that your attempt to work around this was not successful.  According to the Apple documents I've seen, they recommend that you enlarge your image (not reduce it).  Make your image have excess space on all sides, which is not displayed on the screen.  This way, when you tilt your device one direction or another, it can shift the image to give the appearance of 3D. 
    As a photographer, I like to use the full frame of my images, but I also know that I need to leave room around the image as well.  I have some photos I have taken that I can't use because I have them cropped too tightly too, but I have others that work just fine.  Just remember that part of the image file is "off screen" so that if iOS has to shift the image up it has some image that can scroll onto the screen.  It needs this space on all sdes, so just make youre images larger, and keep in mind that a portion on each side will be outside the normally visible screen...  If you don't like this feature, you can always go into the settigns and turn it off.

  • Why is this query not using the index?

    check out this query:-
    SELECT CUST_PO_NUMBER, HEADER_ID, ORDER_TYPE, PO_DATE
    FROM TABLE1
    WHERE STATUS = 'N'
    and here's the explain plan:-
    1     
    2     -------------------------------------------------------------------------------------
    3     | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    4     -------------------------------------------------------------------------------------
    5     | 0 | SELECT STATEMENT | | 2735K| 140M| 81036 (2)|
    6     |* 1 | TABLE ACCESS FULL| TABLE1 | 2735K| 140M| 81036 (2)|
    7     -------------------------------------------------------------------------------------
    8     
    9     Predicate Information (identified by operation id):
    10     ---------------------------------------------------
    11     
    12     1 - filter("STATUS"='N')
    There is already an index on this column, as is shown below:-
         INDEX_NAME INDEX_TYPE     UNIQUENESS     TABLE_NAME     COLUMN_NAME     COLUMN_POSITION
    1     TABLE1_IDX2 NORMAL     NONUNIQUE     TABLE1      STATUS     1
    2     TABLE1_IDX NORMAL     NONUNIQUE     TABLE1     HEADER_ID     1
    So why is this query not using the index on the 'STATUS' Column?
    I've already tried using optimizer hints and regathering the stats on the table, but the execution plan still remains the same, i.e. it still uses a FTS.
    I have tried this command also:-
    exec dbms_stats.gather_table_stats('GECS','GEPS_CS_SALES_ORDER_HEADER',method_opt=>'for all indexed columns size auto',cascade=>true,degree=>4);
    inspite of this, the query is still using a full table scan.
    The table has around 55 Lakh records, across 60 columns. And because of the FTS, the query is taking a long time to execute. How do i make it use the index?
    Please help.
    Edited by: user10047779 on Mar 16, 2010 6:55 AM

    If the cardinality is really as skewed as that, you may want to look at putting a histogram on the column (sounds like it would be in order, and that you don't have one).
    create table skewed_a_lot
    as
       select
          case when mod(level, 1000) = 0 then 'N' else 'Y' end as Flag,
          level as col1
       from dual connect by level <= 1000000;
    create index skewed_a_lot_i01 on skewed_a_lot (flag);
    exec dbms_stats.gather_table_stats(user, 'SKEWED_A_LOT', cascade => true, method_opt => 'for all indexed columns size auto');Is an example.

  • Why is the Star Transformation using two indexes for the same dimension?

    Hi,
    Recently, I have made an investigation about the Star Transformation feature. I have found a strange test case, which plays an important role in my strategy for our overall DWH architecture. Here it is:
    The Strategy:
    I would like to have the classical Star Transformation approach (single column Bitmap Indexes for each dimension foreign key column in the fact table), together with additional Bitmap Join Indexes for some of the dimension attributes, which would benefit from the materialization of the join (bitmap merge operation will be skipped/optimized).
    The query:
    select dp.brand, ds. region_name, dc.region_name
         , count(*), sum(f.extended_price)
      from fact_line_item  f
         , dim_part       dp
         , dim_supplier   ds
         , dim_customer   dc
    where dp.mfgr        = 10                 -- dimension selectivity = 1/10 --> acttual/fact selectivity = 6/10
       and f.part_dk      = dp.dk
       and ds.region_name = 'REGION #1' -- dimension selectivity = 1/9
       and f.supplier_dk  = ds.dk
       and dc.region_name = 'REGION #1' -- dimension selectivity = 1/11
       and f.customer_dk  = dc.dk
    group by dp.brand, ds. region_name, dc.region_name
    The actual plan:
    | Id  | Operation                              | Name                        | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT                       |                             |      1 |        |  3247 (100)|      1 |00:01:42.05 |     264K|    220K|
    |   1 |  HASH GROUP BY                         |                             |      1 |      2 |  3247   (1)|      1 |00:01:42.05 |     264K|    220K|
    |*  2 |   HASH JOIN                            |                             |      1 |  33242 |  3037   (1)|    217K|00:01:29.67 |     264K|    220K|
    |*  3 |    TABLE ACCESS FULL                   | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      4 |
    |*  4 |    HASH JOIN                           |                             |      1 |  33245 |  2934   (1)|    217K|00:01:29.10 |     264K|    220K|
    |*  5 |     TABLE ACCESS FULL                  | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.08 |     316 |      8 |
    |*  6 |     HASH JOIN                          |                             |      1 |  33248 |  2831   (1)|    217K|00:01:28.57 |     264K|    220K|
    |*  7 |      TABLE ACCESS FULL                 | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |   8 |      PARTITION RANGE ALL               |                             |      1 |  36211 |  2827   (1)|    217K|00:01:28.01 |     264K|    220K|
    |   9 |       TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM              |      6 |  36211 |  2827   (1)|    217K|00:01:33.85 |     264K|    220K|
    |  10 |        BITMAP CONVERSION TO ROWIDS     |                             |      6 |        |            |    217K|00:00:07.09 |   46980 |   3292 |
    |  11 |         BITMAP AND                     |                             |      6 |        |            |     69 |00:00:08.33 |   46980 |   3292 |
    |  12 |          BITMAP MERGE                  |                             |      6 |        |            |    193 |00:00:02.09 |    2408 |   1795 |
    |  13 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   4330 |00:00:04.66 |    2408 |   1795 |
    |  14 |            BUFFER SORT                 |                             |      6 |        |            |     60 |00:00:00.01 |       6 |      0 |
    |* 15 |             TABLE ACCESS FULL          | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |* 16 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_PART_DIM_KEY_BIX |     60 |        |            |   4330 |00:00:02.11 |    2402 |   1795 |
    |* 17 |          BITMAP INDEX SINGLE VALUE     | FACT_LI__P_PART_MFGR_BJX    |      6 |        |            |   1747 |00:00:06.65 |     890 |    888 |
    |  18 |          BITMAP MERGE                  |                             |      6 |        |            |    169 |00:00:02.78 |   16695 |    237 |
    |  19 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   5460 |00:00:01.56 |   16695 |    237 |
    |  20 |            BUFFER SORT                 |                             |      6 |        |            |   5460 |00:00:00.02 |     316 |      0 |
    |* 21 |             TABLE ACCESS FULL          | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     316 |      0 |
    |* 22 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_CUST_DIM_KEY_BIX |   5460 |        |            |   5460 |00:00:02.07 |   16379 |    237 |
    |  23 |          BITMAP MERGE                  |                             |      6 |        |            |    170 |00:00:03.65 |   26987 |    372 |
    |  24 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   6672 |00:00:02.23 |   26987 |    372 |
    |  25 |            BUFFER SORT                 |                             |      6 |        |            |   6672 |00:00:00.01 |     316 |      0 |
    |* 26 |             TABLE ACCESS FULL          | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      0 |
    |* 27 |            BITMAP INDEX RANGE SCAN     | FACT_LI__S_SUPP_DIM_KEY_BIX |   6672 |        |            |   6672 |00:00:02.74 |   26671 |    372 |
    The Question:
    Why is the Star Transformation using both indexes FACT_LI__P_PART_DIM_KEY_BIX and FACT_LI__P_PART_MFGR_BJX for the same dimension criteria (dp.mfgr = 10)?? The introduction of the additional Bitmap Join Index actually make Oracle to do the work twice !!!
    Anybody, any idea ?!?

    Dom, here it is the plan with the predicates:
    | Id  | Operation                              | Name                        | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT                       |                             |      1 |        |  3638 (100)|      1 |00:06:41.17 |     445K|    236K|
    |   1 |  HASH GROUP BY                         |                             |      1 |      2 |  3638   (1)|      1 |00:06:41.17 |     445K|    236K|
    |*  2 |   HASH JOIN                            |                             |      1 |  33242 |  3429   (1)|    217K|00:08:18.02 |     445K|    236K|
    |*  3 |    TABLE ACCESS FULL                   | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.03 |     319 |    313 |
    |*  4 |    HASH JOIN                           |                             |      1 |  33245 |  3326   (1)|    217K|00:08:17.47 |     445K|    236K|
    |*  5 |     TABLE ACCESS FULL                  | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     319 |    313 |
    |*  6 |     HASH JOIN                          |                             |      1 |  33248 |  3223   (1)|    217K|00:08:16.63 |     445K|    236K|
    |*  7 |      TABLE ACCESS FULL                 | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |   8 |      PARTITION RANGE ALL               |                             |      1 |  36211 |  3219   (1)|    217K|00:08:16.30 |     445K|    236K|
    |   9 |       TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM              |      6 |  36211 |  3219   (1)|    217K|00:08:40.89 |     445K|    236K|
    |  10 |        BITMAP CONVERSION TO ROWIDS     |                             |      6 |        |            |    217K|00:00:32.00 |   46919 |  19331 |
    |  11 |         BITMAP AND                     |                             |      6 |        |            |     69 |00:00:34.50 |   46919 |  19331 |
    |  12 |          BITMAP MERGE                  |                             |      6 |        |            |    193 |00:00:00.58 |    2353 |      1 |
    |  13 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   4330 |00:00:00.10 |    2353 |      1 |
    |  14 |            BUFFER SORT                 |                             |      6 |        |            |     60 |00:00:00.01 |       6 |      0 |
    |* 15 |             TABLE ACCESS FULL          | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |* 16 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_PART_DIM_KEY_BIX |     60 |        |            |   4330 |00:00:00.07 |    2347 |      1 |
    |* 17 |          BITMAP INDEX SINGLE VALUE     | FACT_LI__P_PART_MFGR_BJX    |      6 |        |            |   1747 |00:01:23.64 |     882 |    565 |
    |  18 |          BITMAP MERGE                  |                             |      6 |        |            |    169 |00:00:09.14 |   16697 |   7628 |
    |  19 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   5460 |00:00:02.19 |   16697 |   7628 |
    |  20 |            BUFFER SORT                 |                             |      6 |        |            |   5460 |00:00:00.01 |     316 |      0 |
    |* 21 |             TABLE ACCESS FULL          | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     316 |      0 |
    |* 22 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_CUST_DIM_KEY_BIX |   5460 |        |            |   5460 |00:00:08.78 |   16381 |   7628 |
    |  23 |          BITMAP MERGE                  |                             |      6 |        |            |    170 |00:00:21.46 |   26987 |  11137 |
    |  24 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   6672 |00:00:10.29 |   26987 |  11137 |
    |  25 |            BUFFER SORT                 |                             |      6 |        |            |   6672 |00:00:00.01 |     316 |      0 |
    |* 26 |             TABLE ACCESS FULL          | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      0 |
    |* 27 |            BITMAP INDEX RANGE SCAN     | FACT_LI__S_SUPP_DIM_KEY_BIX |   6672 |        |            |   6672 |00:00:20.94 |   26671 |  11137 |
    Predicate Information (identified by operation id):                                                                                                  
       2 - access("F"."SUPPLIER_DK"="DS"."DK")                                                                                                           
       3 - filter("DS"."REGION_NAME"='REGION #1')                                                                                                        
       4 - access("F"."CUSTOMER_DK"="DC"."DK")                                                                                                           
       5 - filter("DC"."REGION_NAME"='REGION #1')                                                                                                        
       6 - access("F"."PART_DK"="DP"."DK")                                                                                                               
       7 - filter("DP"."MFGR"=10)                                                                                                                        
      15 - filter("DP"."MFGR"=10)                                                                                                                        
      16 - access("F"."PART_DK"="DP"."DK")                                                                                                               
      17 - access("F"."SYS_NC00017$"=10)                                                                                                                 
      21 - filter("DC"."REGION_NAME"='REGION #1')                                                                                                        
      22 - access("F"."CUSTOMER_DK"="DC"."DK")                                                                                                           
      26 - filter("DS"."REGION_NAME"='REGION #1')                                                                                                        
      27 - access("F"."SUPPLIER_DK"="DS"."DK")                                                                                                           
    Note                                                                                                                                                 
       - star transformation used for this statement                                                                                                     

  • Why does my printe say "used supply in use" 1217nfw

    Why does my printe say "used supply in use" model m1217nfw

    Hello,
    The "Used Supply in Use" means that the printer believes the toner cartridges installed in the printer have been previously used in another printer.
    Have you recently changed the toner cartridge on this printer? Are you having issues printing?
    Remember if you find any of my post helpful or want to say thanks make sure to click the white star under my name to give me Kudos.
    I really appreciate it!
    You should be able to still print without problems even though the message comes up.
    THX

  • Why does my printe say "used supply in use/:

    why does my printer say used supply in use?  And I can't print anything

    Pretty sure its to make sure you don't get good use out of your cartridges... basically this company trying to get 10 cents a print out of you
    After 1100 prints, regardless of how much ink used, if you take it out (the genuine 85a) at this point and put it back in, say after a jam or you want to shake it, it tells you have a used cartridge, i have tested continually using this, and got 500 more prints, with an annoying nag that you cant stop from every page printed. you have to take it out because this printer is notorious for a section ink don't get too, even though there probably is over 50% of ink left in it.. you take it out and shake it and can print, hundreds and hundreds of more pages... but after the 1100 point mark, since the printer tracks statistics it goes into this "used mode" so averages of prints won't go up... im pretty sure its devious code... but what do i know.. i just wont be getting new HP printers.. they claim it can cause damage.... the heads are on the toner cartridge... if its damaged the cartridge is replaced and thats that... so their warnigs are smoke and mirrors..

  • Why and when can I use the "NotBoundException" in my RMI?

    why and when can I use the "NotBoundException" in my RMI?

    The answer to this is contained in the documentation which you should have read before posting to this forum.

  • Why do i have to use nextLine() when there is an InputMismatchException

    I dont understand why do i have to use this line of code to avoid an infinite loop here...help appreciated.
    import java.util.Scanner;
    import java.util.InputMismatchException;
    public class InputTest {
         public static void main(String [] args){
         Scanner in = new Scanner(System.in);
         int n = 0;
         while(true){
              try{
                   System.out.println("Input a number:");
                   n = in.nextInt();
                   break;
              }catch(InputMismatchException exc){
                   System.out.println("Error, non-valid input.");
                   //in.nextLine(); <--If i use this line of code it doesn't get into an infinite loop
                             System.out.println("Integer read is: " + n);
    }

    Rix87 wrote:
    When i run the program if i input something that triggers the exception, it infinitely loops through the question and the catch method block outputs, weirdest thing of all is that i can't even input again after the exception is thrown, but with nextLine() it avoids that, but i still dont understand why do i have to use nextLine().Exactly what I said.
    You enter "A". The exception is thrown. The "A" is not consumed. It calls nextInt on "A" again... and again... and again...
    If you do nextLine, the "A" and the newline are consumed.
    Even on good input, I don't think nextInt consumes the EOL.

  • Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

    Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

    Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

Maybe you are looking for