A normal question on programming

When programming, samples are very important. When I get a new function of java,
how can I find some samples of it. The java language specification is very useful, but
it doesn't include code samples.
Please recommend a good way or a good place to solve this problem.
Thanks.

Thanks for your reply.
It is very useful.
Is there something like a sample code search engineering?
For example, I have a method, and I want some sample code for it?
Is that possible?

Similar Messages

  • I cannot download a working version of Firefox at all. Downloads seem normal but No Program in "Add or Delete programs"and NO ICON

    I kept getting a mssg "update did not download. make sure there are no other copys of Firefox on your computer". That was on the user account I use strictly for the internet. I keep 3 user accounts, One is the administrator for security, a sort of 3 card monty for security purposes. The one I use for the internet kept repeating that mssg (I sure do miss the firefox spellcheck. I dont like Internet Explorer at all).
    In frustration I deleted firefox from all three user accounts and attempted to download a fresh browser. All things seemed to download as normal but after the restart there was no Firefox Icon or any evidence of the program in the "Add or Delete Programs". It simply seems to disappear.
    I tried downloading on the administrator account and the other two to the same effect.
    I tried to do over and began to notice on the File Download-Security Warning Dialox Box that there were several different addresses beside "From;" from several different countrys, including halifax which didnt appear in the following examples
    For exampl the dialog box I have up now says
    File Download-Security Warning
    Name: Firefox setup 6.0. exe
    Type: Application, 13.3MB
    From: mirror.informatik.uni-mannheim.de
    Now I am going to delete this one and click the download from Firefox homepage again and it should be another;
    It is. Same Dialog Box but
    FROM: mirror.team-cymru.org
    I delete and do that again...and also a different
    FROM: mozilla.mirror.ac.za
    try again..and yes it is different too;
    FROM: mirror.metrocast.net
    try again...the same result
    FROM: mirror.Istn.net
    try again...
    FROM: www.mirrorservice.org
    try again...
    and for the first time this session I get a repeat of the last result.
    My intuition tells me this cant be normal in conjunction with the fact that after going through a normal download process any of these possibilities needs to restart and then after rebooting there is no firefox icon or any evidence the program downloaded at all.
    Perhaps I could do a check of the math on remaing MB space, but there has to be something wrong here.

    Using "System Restore" can cause your Firefox installation to get corrupted because not all files are restored (only files in a white-list), so be cautious with using System Restore.<br />
    You need to (re)install software that was affected.<br />
    Remove the Firefox program folder (C:\Program Files\Mozilla Firefox\) before reinstalling a freshly downloaded Firefox copy to do a clean install.
    You can find the latest Firefox release in all languages and for all Operating Systems here:
    *Firefox 11.0.x: http://www.mozilla.org/en-US/firefox/all.html
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • JFrame (extended) state, iconified/maximized/normal question

    Greetings and salutations,
    I've been removing some rough edges from my last application and I noticed the
    following: before an application quits every location/size of the top level components
    is written to a file. When the application starts again everything is read back in
    again and the application shows itself just as it was before it closed the last time.
    There's one little quirck though:
    A JFrame can be in one of three states when an application quits:
    1) iconified; nothing is wrong here, i.e. the application comes back on in the same
    iconified state and after de-iconification the JFrame shows up the same as
    before the previous quiting.
    2) 'normal': same as above: the JFrame shows up identical as before quiting
    the application the previous time.
    3) maximized: the new incarnation shows up as a maximized JFrame, but after
    'demaximalization' (sorry) the JFrame keeps its maximum size, i.e. if still fills up
    the entire screen.
    Before quiting I save the bounds, the state and the extended state of a JFrame
    and reinstate these values after a new incarnation of the application. I think I've
    tried all 2^3 == 8 possible permutations of this all, but option 3) keeps giving
    me trouble, i.e. the bounds don't work after 'demaximalization'.
    Ideas anyone?
    kind regards,
    Jos

    Here's a test program for people who want to experiment around a bit, but are reluctant to create a test class:import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class Test extends JFrame {
        public Test () {
            setDefaultCloseOperation (WindowConstants.DISPOSE_ON_CLOSE);
            setTitle ("Test");
            WindowInfo windowInfo;
            try {
                windowInfo = read ();
            } catch (Exception exception) {
                System.err.println ("couldn't read window.info");
                windowInfo = new WindowInfo ();
            setLocation (windowInfo.location);
            setSize (windowInfo.size);
            setExtendedState (windowInfo.extendedState);
            addWindowListener (new WindowAdapter () {
                public void windowClosing (WindowEvent event) {
                    try {
                        write (new WindowInfo (getLocation (), getSize (), getExtendedState ()));
                    } catch (Exception exception) {
                        System.err.println ("couldn't write window.info");
            setVisible (true);
        public static void main (String... parameters) {
            new Test ();
        private WindowInfo read () throws ClassNotFoundException, IOException {
            ObjectInputStream in = null;
            try {
                in = new ObjectInputStream (new FileInputStream ("window.info"));
                return (WindowInfo) in.readObject ();
            } finally {
                if (in != null) {
                    try {
                        in.close ();
                    } catch (IOException exception) {}
        private void write (WindowInfo windowInfo) throws IOException {
            ObjectOutputStream out = null;
            try {
                out = new ObjectOutputStream (new FileOutputStream ("window.info"));
                out.writeObject (windowInfo);
            } finally {
                if (out != null) {
                    try {
                        out.close ();
                    } catch (IOException exception) {}
        private class WindowInfo implements Serializable {
            public Point location;
            public Dimension size;
            public int extendedState;
            public WindowInfo () {
                size = new Dimension (600, 400);
                Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
                location = new Point (screenSize.width / 2 - size.width / 2, screenSize.height / 2 - size.height / 2);
                extendedState = NORMAL;
            public WindowInfo (Point location, Dimension size, int extendedState) {
                this.location = location;
                this.size = size;
                this.extendedState = extendedState;
    }Note that I fooled around myself a bit too.

  • Basic questions about programing for J9 VM

    I need to create a java application to run on a Pocket PC 2003 OS and I'm limited to using IBM's Websphere J9 Virtual Machine. I'm new to using java in this capacity and therefore have lots of questions which I'm guessing are pretty basic. Despite my best efforts, I've found very little to help me online. Below are a couple questions I have that I'm hoping someone can help me with. Even better, if you know of any resources that could help me with these and other questions, I'd love to have them. Thanks in advance.
    1. I'm using standard AWT for the GUI but I'm having problems getting frames, dialogs, etc., to come up in anything less then full screen. setSize() and resize() have no effect, even if I extend the frame and override the setMinimumSize, setPreferredSize, setMaximumSize methods. What do I need to do to get a child window to appear in something less than full screen?
    2. I'd like to be able to add menu's to the buttom toolbar (with the keyboard) but have no idea how I would add something to it. Can someone point me in the right direction?
    3. When my application gets an iconified event I go ahead and call a System.exit() to exit the application. This doesn't kill the java VM though, which continues to run in the background (taking up plenty of memory). If I run my application using the J9w.exe so that it runs without the console, then not only does the VM continue to run, but I have no way to stop it (the running program list can't see it). Since each time I run my application it starts a new VM, it only takes a couple of times before I'm out of memory and have to do a soft reset of the PDA to make things right. Can I kill the VM when I kill my application?
    4. I learn best by looking at example code, but have been unable to find any code people are running on J9. I have the GolfScoreTracker installed and running on my PDA, but the jar file contains only the classes. Since it's supposed to be a demo, I had hoped that the source code would be included, is that hoping too much or is the source code available somewhere? In addition, if you know of any applications out there with available source code that are known to run well on a PocketPC J9 environment I'd appreciate the link.

    Hi there, I saw your questions, im currently developing a java pocket pc application as well and here's what i go so far:
    AWT seem to be hard to use on pocket pc, instead i recommend that you use SWT, which is a technology developed by eclipse. It's already installed on the eclipse plugins, you just need to download the jar and dll files for the pocket pc. They are available at: http://www.eclipse.org/downloads/index.php
    I assume that you already have the J9 working on your device. So you only need to copy the SWT.jar file and the swt-win32-3064.dll to the folder containing the .class files on your device.
    Now, on your java IDE(im using eclipse) Add the SWT.jar library to your project which should be on C:/eclipse/plugins/org.eclipse.swt.win32_3.0.2/ws/win32/swt.jar or something like taht depending on your eclipse root.
    Now you are ready to code some SWT, here is a sample program from Carolyn MacLeod, i modified a few things so it could run on the pocket pc but it's almost the same. Once you coded in eclipse run it, then copy the class file from your desktop to your device(There should be like 4 or 5 classes like sample.class, sample$1.class etc. copy all of them) where you put the jar and dll files(If program does not run you may try to rename the dll file for swt-win32-3050.dll instead of 3064.dll). Now after you have everything set up you need to create the lnk file in order to run the program. On your desktop create a new textfile and write the following on it:
    255#"\Archivos de Programa\J9\PPRO10\bin\j9w.exe" "-jcl:PPRO10" "-cp" "\My
    Documents\Java\swt.jar" ;\My Documents\Java" sample
    Paths depend on your install, and the place where you put your classes and jar file. path for j9w is usually "\Program Files\J9\PPRO10\bin\j9w.exe", and the last word should be the classname.
    Currently this form only displays an image on a canvas, click on the browse button and choose a pic and it will display on the canvas. Im trying to connect the form to an oracle database but no success yet on the device.
    Hope it helps, if you have any questions about the code or something, and I know the answer, please feel free to ask.
    See ya
    import org.eclipse.swt.*;
    import org.eclipse.swt.widgets.*;
    import org.eclipse.swt.layout.*;
    import org.eclipse.swt.events.*;
    import org.eclipse.swt.graphics.*;
    public class sample {
    static Shell shell;
    static Display display;
    static Text dogName;
    static Text textdb;
    static Combo dogBreed;
    static Canvas dogPhoto;
    static Image dogImage;
    static List categories;
    static Text ownerName;
    static Text ownerPhone;
    static String[] FILTER_EXTS = {"*.jpg"};
    public static void main(String[] args) {
    display = new Display();
    shell = new Shell(display, SWT.RESIZE | SWT.CLOSE);
    Menu menu = new Menu(shell, SWT.BAR);
    shell.setText("Dog ShowS Entry");
    shell.setMenuBar(menu);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    shell.setLayout(gridLayout);
    new Label(shell, SWT.NONE).setText("Dog's NameS:");
    dogName = new Text(shell, SWT.SINGLE | SWT.BORDER);
    GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 2;
    gridData.widthHint = 60;
    dogName.setLayoutData(gridData);
    new Label(shell, SWT.NONE).setText("Breed:");
    dogBreed = new Combo(shell, SWT.NONE);
    dogBreed.setItems(new String [] {"Collie", "Pitbull", "Poodle", "Scottie"});
    dogBreed.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    Label label = new Label(shell, SWT.NONE);
    label.setText("Categories");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    new Label(shell, SWT.NONE).setText("Photo:");
    dogPhoto = new Canvas(shell, SWT.BORDER);
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.widthHint = 60;
    gridData.verticalSpan = 3;
    dogPhoto.setLayoutData(gridData);
    dogPhoto.addPaintListener(new PaintListener() {
    public void paintControl(final PaintEvent event) {
    if (dogImage != null) {
    event.gc.drawImage(dogImage, 0, 0);
    categories = new List(shell, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
    categories.setItems(new String [] {
    "Best of Breed", "Prettiest Female", "Handsomest Male",
    "Best Dressed", "Fluffiest Ears", "Most Colors",
    "Best Performer", "Loudest Bark", "Best Behaved",
    "Prettiest Eyes", "Most Hair", "Longest Tail",
    "Cutest Trick"});
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
    gridData.widthHint = 60;
    gridData.verticalSpan = 4;
    int listHeight = categories.getItemHeight() * 12;
    Rectangle trim = categories.computeTrim(0, 0, 0, listHeight);
    gridData.heightHint = trim.height;
    categories.setLayoutData(gridData);
    Button browse = new Button(shell, SWT.PUSH);
    browse.setText("BrowsePic");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gridData.widthHint = 60;
    browse.setLayoutData(gridData);
    browse.addSelectionListener(new SelectionAdapter() {
         public void widgetSelected(SelectionEvent event) {
              FileDialog dialog = new FileDialog(shell, SWT.OPEN);
              dialog.setFilterExtensions(new String[] {"*.*"});
              String fileName = dialog.open();
    if (fileName != null) {
    dogImage = new Image(display, fileName);
    shell.redraw();
    Button delete = new Button(shell, SWT.PUSH);
    delete.setText("No action");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
    gridData.widthHint = 60;
    delete.setLayoutData(gridData);
    delete.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent event) {
    Button enter = new Button(shell, SWT.PUSH);
    enter.setText("No action");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gridData.horizontalSpan = 3;
    enter.setLayoutData(gridData);
    enter.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent event) {
         shell.open();
         while (!shell.isDisposed()) {
              if (!display.readAndDispatch())
                   display.sleep();
         display.dispose();
    if (dogImage != null) {
    dogImage.dispose();
    }

  • How to write Question paper program in jsp....

    Hi..,
    This is sure from india. I would like to develop online examination project. Everything is ok. But i have a problem at deveop of question paper. I have 10 questions in my database. I would like display those questions one by one. How can i done this job. Please any one guide me. Because, i am new to this concept.
    with regards
    sure..)-

    First you need to extract all the question from database..
    Then put all of those questions in any of collection object...
    Then set this collection object in request as attribute..
    Keep this object in request till all question are not shown(you can eliminate questions after the have been asked)..
    Code might be like this.
    HashMap result = new HashMap();
    connection = .......;
    Statement stmt=connection.createStatement();
    rs = stmt.executeQuery("Your query");
    int count=0;
    while(rs.next())
    count++;
    String question = rs.getString("colName");
    result.put(""+count,question); //( ""+count)>>>>>means converting int to String
    request.setAttribute("questions",result);
    ====================================================
    now in every JSP which is intended to display a question will have to get this result object..
    Lets assume we are about to display first question()....
    ===========================================
    //////// First get result map from request
    HashMap questions = (HashMap)request.getAttribute("questions");
    String count;
    count = request.getAttribute("count");
    if(count==null)
    count="1";
    String question = questions.get(count);
    count = new String(""+(Integer.parseInt(count).intValue()+1));
    ///Now do what you have to do with this questionresult
    questions.remove();
    request.setAttribute("count",count);////setting question no in request
    request.setAttribute("questions",questions);////setting rest of questions in request
    ===================================================
    hope this might be helpful........
    if there is any problem you can consult me anytime

  • Question about Programming Notes for WD Abap / Context

    http://help.sap.com/saphelp_nw04s/helpdata/en/03/0048413e466e24e10000000a155106/frameset.htm
    Since an instance of the follow-on view has not yet been created, you must now decide whether to configure a component controller context with an appropriate mapping, or whether to fetch and check the data in an auxiliary class first and only pass it to the context of the follow-on view after navigation is completed. An application developer would, of course, prefer to use the context mapping method; using an auxiliary class, however, improves performance significantly.
    Hello all,
    If a fetch the data with auxiliary class, in which method do i fill the context of view after view is shown? The context of controller is mapped to view. Must it be done in supply function? But supply function is only one and i want to use a single context node for different views.
    Another question. Does it make sense to fetch the data for a certain follow-on view
    although navigation to this view will be definied late in a window?
    Thanks
    Regards
    Paul

    Hi Phil,
    <b>Ideally, on a custom method on the Component controller. or secondary controller.
    This method should call an Auxiliary ABAP class that actually gets data.
    Your Comp controller method would be triggered by an Event on you view.
    EG Button to navigate, a check button whatever.</b>
    If i call the method of component controller in a method of my view, check the return code and only then do the navigation by firing an event. I think, it will work. What advantages will i get by calling a method of component controller  via an Event?
    <b>generally I avoid that if at all possible.
    but it's been done before. Main reason is to avoid unnecessary
    navigation. Through the errors and perform the checks as close to source
    as possible. in mots cases you should be able to check data, and even load
    info before actually doing the navigation.
    ie Avoid firing plug till the last moment.</b>
    For example, if have a "Next"-Button in a view. How can i decide in Method for "Next" what data must be filled for next view if in one case it could be one view, and in another case other? I thought, follow-up view must get data on his own. My question was, which method can be used for filling the data in this case. It is not wddoinit and not wddomodify.
    Regards
    Paul

  • Question on program logic using SKC1A

    Account -     Using SAKNR and selected company code (BUKRS) get alternative account using table SKB1
    Description - To be obtained from SKA1 using account number found above in chart of accounts  CEFR
    Carry-forward debit - UMSAV
    Debit period from 1 to n - ii=01 to pp UMiiS
    Credit period from 1 to n - ii=01 to pp UMiiH
    In order to obtain this text file, an ABAP program should be written. The extraction program should use structure SKC1A to obtain data and use the following selections:
    BUKRS : Company code
    SAKNR : no selection
    GJAHR : Fiscal Year
    GSBER : no selection
    CURTP : 10 (can be hardcoded and displayed)
    HWAER : EUR (can be hard-coded and displayed)
    Period : pp (from 01 to special period 13)
    I wrote the program using the function 'FOR_ALL_SKC1A'. I have attached it below.
    after the final specs came from the user, this following line was included
    An example of the use of this structure can be found in program RFSSLD00
    I looked at the program RFSSLD00 and it's logic is nowhere near mine. It uses a statement GET SKC1A. after looking at this program,
    I am not I have the program coded correctly based on the specs.
    can somebody let me know if I am doing this correctly or if I need to mirror my program after the RFSSLD00.
    *& Report  ZFI_FR_ETAFI
    REPORT  ZFI_FR_ETAFI.
      TABLES
    TABLES:
        skat.    "G/L Account Master Record (Chart of Accounts: Description)
      TYPES
    TYPES:  BEGIN OF ty_skat,
            saknr TYPE skat-saknr, "Account Number
            txt50 TYPE skat-txt50, "account Description
            END OF ty_skat.
      DATA
    data: begin of itab occurs 0,
          filler1(5)      TYPE C,
          account(6)      TYPE C,
          filler2(4)      TYPE C,
          description(35) TYPE c,
          filler3(39)     TYPE c,
          carryfwdamt(21) TYPE c,
          filler4(70)     TYPE c,
          totdeb(18)      TYPE c,
          filler5(63)     TYPE c,
          totcred(18)     TYPE c,
          end of itab.
    data: iskc1a  TYPE TABLE          of skc1a   with header line.
    data: it_skat TYPE STANDARD TABLE OF ty_skat with header line.
    data: w_totcred   like skc1a-um01s.
    data: w_totdeb    like skc1a-um01s.
    data: w_cramount  like skc1a-um01s.
    data: w_dbamount  like skc1a-um01s.
    *SELECT-OPTIONS:
    PARAMETERS                                                           *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_ktopl TYPE skat-ktopl    OBLIGATORY,
                p_bukrs TYPE skb1-bukrs    OBLIGATORY,
                p_year  TYPE payr-gjahr    OBLIGATORY,
                p_poper TYPE bkpf-monat    OBLIGATORY.
    SELECTION-SCREEN END   OF BLOCK b1.
    *START-OF-SELECTION                                                    *
    START-OF-SELECTION.
    SELECT saknr txt50
      FROM skat INTO TABLE it_skat
    WHERE ktopl = p_ktopl.
    loop at it_skat.
      CLEAR iskc1a. REFRESH iskc1a.
      call function 'FOR_ALL_SKC1A'
        exporting
          xbukrs = p_bukrs
          xsaknr = it_skat-saknr
        tables
          xskc1a = iskc1a
        exceptions
          key_incomplete = 1
          not_authorized = 2
          not_found      = 3.
    loop at iskc1a.
        if iskc1a-gjahr = p_year.
          w_cramount = 0.
          w_dbamount = 0.
          w_totcred  = 0.
          w_totdeb   = 0.
          do p_poper times
            varying w_cramount from iskc1a-um01s next iskc1a-um02s.
            w_totcred = w_totcred + w_cramount.
          enddo.
          do p_poper times
            varying w_dbamount from iskc1a-um01h next iskc1a-um02h.
            w_totdeb  = w_totdeb  + w_dbamount.
         enddo.
        if it_skat-saknr(4) = '0000'.
          itab-account      = it_skat-saknr+4.
        else.
          itab-account      = it_skat-saknr.
        endif.
        itab-description  = it_skat-txt50.
        itab-carryfwdamt  = iskc1a-umsav.
        shift itab-carryfwdamt right deleting trailing space.
        itab-totdeb       = w_totdeb.
        shift itab-totdeb right deleting trailing space.
        itab-totcred      = w_totcred.
        shift itab-totcred right deleting trailing space.
        if itab-carryfwdamt <> 0 or
           itab-totdeb      <> 0 or
           itab-totcred     <> 0.
            append itab.
         endif.
       endif.
      endloop.
    endloop.
    call function 'GUI_DOWNLOAD'
      exporting
        filename = 'C:\ETAFI.txt'
      tables
        data_tab = itab
      EXCEPTIONS
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         OTHERS                          = 22.
    IF sy-subrc <> 0.
       write: / ' process unsuccessful'.
    ELSE.
       write: / 'process successful'.
    ENDIF.
    *END-OF-SELECTION                                                      *

    That program uses a logical database to get the data.  This is why it looks different.  Don't worry, as long as you can verify the data against something else, you can do it the way that you are.  Personally, I never use logical databases. 
    REgards,
    Rich Heilman

  • Question about program structure.

    hi, I am trying to write a GUI program like MSN messenger. right now, I am really confused about my program structure.
    Should I put all the things in one class or separate them into GUI class, services class..etc? for example, right now, I have a class responsible for connecting to the server. Should I put it into the GUI class as a nested class or .......? Basically, what is the best structure for GUI program?

    new_java-sun wrote:
    thank you very much. Do you know why the mvc pattern is called mvc pattern instead of DGC(data-gui-controller) pattern?Because a view need not be a GUI, or even a UI, and a model need not be data

  • UDLD Normal Question

    Hi all,
    I need some clarification on UDLD please.  I have always used UDLD aggressive mode and understand that with no issues.  What I am not clear on is exactly what UDLD does in normal mode.  According to the Cisco documentation,
    "In normal mode, if the link state of the port was determined to be bi-directional and the UDLD information times out, no action is taken by UDLD. The port state for UDLD is marked as undetermined.  The port behaves according to its STP state."
    If no action is taken in normal mode, is there any value in using it?
    Thanks,
    Bill

    Hi Bill,
    The UDLD is sadly underdocumented in several sources, and even the informational RFC does not contain all the necessary information to properly understand UDLD modes.
    The truth is, according to U.S. Patent 6765877, that there are two ways in UDLD of detecting an unidirectional link: an explicit and an implicit method. To understand the explicit method, it is important to keep in mind that each switch indicates its own [Device ID, Port ID] tuple as the sender information in an UDLD message, and echoes back the [Device ID, Port ID] tuples received from its neighbors in an echo portion of the message. In other words, each UDLD message carries a device and port identity of its sender, and contains an echo list of all neighbors and their ports whose UDLD messages have been received on the port that sends out this UDLD message itself.
    An unidirectional link is detected explicitly if one or more of the following events occur during the neighbor detection and linkup phase:
    UDLD messages received from a neighbor do not contain the tuple that matches the receiving switch and port in their echo portion. This would indicate a split fiber or a truly unidirectional link.
    UDLD messages received from a neighbor contain the same sender as the receiving switch and its port. This would indicate a self-looped port.
    UDLD message received from a neighbor contain a different list of entries in the echo portion (i.e. a different set of neighbors) than the set of neighbors heard by this switch on this port. This would indicate a shared segment with a partial impaired connectivity between connected switches.
    Whenever any of these three events is observed during an UDLD neighborship buildup with a neighboring switch, the link is declared unidirectional and subsequently disabled. Once again, this is called explicit unidirectional link detection. The setting of aggressive or normal mode has no effect on explicit detection.
    An implicit unidirectional link detection refers to the event when UDLD messages arriving from the neighbor device suddenly cease to be received, without the port actually going down. This is where the aggressive or normal UDLD modes make a difference. In the normal mode, you simply age out the neighbor and do nothing, hoping that if there was a physical unidirectional fault on the link, the physical and link-layer mechanism would have brought the link down anyway. In aggressive mode, you assume that the physical layer has no capability of detecting and dealing with the unidirectional link condition itself, and when UDLD messages stop arriving, you err-disable the port just to be safe.
    So the difference between the normal and aggressive modes relates to the difference in handling an implicit uni-directional link event. If an uni-directional link is detected explicitly, the port will always be err-disabled, regardless of the normal/aggressive mode.
    The related U.S. Patent is a good, albeit tiresome, reading on this, especially the Figure 7 with the decision diagram; check out this thread:
    https://supportforums.cisco.com/thread/2179927
    Best regards,
    Peter

  • IPad 2 Question - Graphics Program Automatically Opens???

    Hello!
    Whenever I connect my iPad 2 to my computer, iTunes opens, but it also causes my graphic program to open, which is very annoying. I looked thru preferences in iTunes with no luck. Any ideas??
    Thanks!
    ~~Shari

    Resolved Issue . . . Posting Resolution in case someone has same issue
    I found where to specify by going to My Computer which showed my iPad icon, then I right clicked to get Properties, and it allowed me to change the option to Open With Specific Program, which was PhotoImpact, or Take No Action, which is what I change it to.
    Thanks for everyones help!!!
    ~~Shari

  • Questions on programs that will run on macbook?

    I was just wondering about programs like msn messenger or like file sharing programs like "bearshare" that are available to download like, you know the little programs here and there...will that stuff run on the macbook

    most of those kinds of programs should run fine with rosetta untill they come out with the universal versions.

  • Simple Question : ( EXIT PROGRAM )

    Hi All !
    I have an abap program that make a submit to another abap program ; i need to break the esecution of this second program and come back in the first program .
    For the return in the first program there are no problems , but i need a command that break the esecution of the second . . .
    Any ideas ?
    Bye

    The EXIT you use will take you out of the current bolck of execution. Also, EXIT has a predefined set of behaviors based on where it is invoked. So, if you give an exit at the end-of-selection event then it will take you out of the program.
    LEAVE PROGRAM is also an option

  • Quick Question Java Program

    Hi all. Basically im trying to get a program to do this...
    A user inputs any random integer. If the integer is even is divides it by 2. If it is odd it multiplys it by 3 and adds one.
    This is supposed to bring you a sequence as it is supposed to always come down to the number 1.
    My code just runs consistently. Can anyone tell me why?
    import java.util.Scanner;
    public class MathTheory
         public void testTheory()
              Scanner keyboard = new Scanner(System.in);
              System.out.println("Please enter any integer");
              int number = keyboard.nextInt();
              System.out.println("Sequence: ");
              while(number>1)
                   if(number%2==0)
                        number = number/2;
                        System.out.print(" " + number + " ");
                   if(number%2 != 0)
                        number = (number*3) + 1;
                        System.out.print(" " + number + " ");
    class mathTheoryTester {
      public static void main(String[] arg) {
         MathTheory X = new MathTheory();
         X.testTheory();
    }

    Lets trace through the code with an input of 2
              while(number>1)
                   if(number%2==0)// this comes out true
                        number = number/2;//So number becomes =1
                        System.out.print(" " + number + " ");
                   if(number%2 != 0)  //Since number is = 1, this evaluates true
                        number = (number*3) + 1; // So number is set to 4
                        System.out.print(" " + number + " ");
                   // So the loop never exits
              }

  • Question about programs installed from AUR by pkgbuild vs. repo

    Hi,
    Do programs that get installed from the AUR through pkgbuild's get updated on a pacman -Syu also?
    Thanks.
    EDIT: i.e. unsupported software like gnome global-menu
    Last edited by playdafunkimuzic (2009-04-10 14:53:07)

    and you don't /just/ use the PKGBUILD in AUR. You use all the files in the tarball. i.e: download *.tar.gz and then extract it.

  • Question about program/database design

    Hello,
    I have to redesign an application originally developped in a SP2010 Std environnement.
    The developpement involve data link to people, their owning entities (compagny, departement, etc..)
    Today, the design is out ouf date, especially because the program couldnt handle relationship in the data model.
    There is many dependancies between the data model and as far as i know, SharePoint couldnt handle complexe relationships.
    I try to reproduce a design with SharePoint ProjectedFields with Joins in CAML but im puzzled.
    What could be the best way to develop a program hosted in SharePoint (2010) which acces/update a data model like SQL Databases ? Is it possible to reproduce a .Net/webforms developpment ?
    Wich Component to use ? Where to store them ?
    Could someone give me a hint ?
    Thank you.

    Hi,
    Per my understanding, you might want to handle different data models which has complex relationships in SharePoint 2010.
    In SharePoint, we can handle data with relationship using the OOTB feature, the
    Lookup column:
    https://support.office.com/en-au/article/Create-list-relationships-by-using-unique-and-lookup-columns-80a3e0a6-8016-41fb-ad09-8bf16d490632
    For more sophisticated need, it is recommended to store the data in SQL Server. On SharePoint side, we can use
    Business Connectivity Services(BCS) “to read and write data from external systems”:
    https://msdn.microsoft.com/en-us/library/office/ee556826(v=office.14).aspx
    Thanks
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • Windows 8.1 system with new Office 2013 install not pulling down any Office 2013 updates from my SCCM 2012 SP1 server

    Hi, I've just setup a new Windows 8.1 system and added to my SCCM 2012 SP1 server and all is good and it pulled down all the correct Windows updates and pulls down automatically the FEP updates that are distributed from SCCM 2012 daily.  I just insta

  • IPhone to iPhone Bleutooth problem

    Hello, I cannot connect my two iPhones to each other via Bluetooth: they don't appear in the discoverable devices list if the phones. Each of the two easily connects to other devices like headsets, keyboard, iPad etc. What csan I try to connect my tw

  • My iPod touch won't pair with other devices

    While trying to pair with another iPod device using Bluetooth the device said " sherry's device not supported" how do I fix this problem so I can b able o pair with other devices.? Help please

  • Calander getTime() display problems...

    I'm connected to an oracle database and there is a date_reception column that has the time in miliseconds: 992023833 which is 06/08/2001 2:12:34 PM. When try to get that same number fromm java I get a long integer that is: 992023954881 which is longe

  • Applying relative curve changes to multiple photos

    Is there a way to apply same changes to the tonal curve to multiple photos while keeping their curve shapes relatively intact? For example, I want to make all Darks and Shadows 20 points lower. I know I can't make it with a preset as it contains abso