detection of peak with two thresholds

Dear colleagues!

Excuse me, but I need example or any help for the detection of peaks with two thresholds. Namely two adjustable thresholds with detector standard Ridge for the creation of a detection bandwidth or range.

Detector of crete have only one threshold of... But why only one...


Tags: NI Software

Similar Questions

  • Only one CPU is getting detected on HP Prolian DL580 with two processors

    Hello

    I have a HP Proliant DL580 server with two physical processors.

    Connected to the ILO and I see two processors detected. Please see screen Capture 1

    Installed ESXi 5.5 and allowed Enterprose plus on my server. But I only see a single CPU detcted. Please see screen shot 2

    Is it possible that I can get the two processors detected in ESXi?

    -Thank you

    Suresh

    Your Dell r.620 has 2 processors as well.

    2 processors to 6 cores per processor, up to 12 physical cores. With Hyperthreading, it comes to 24 logical cores

  • Two threshold analog to digital

    I was asked to develop a code which would take a signal an analog mode, convert it to a digital camera, then perform the frequency, duty cycle and test on that signal integrity.  Built in OR functions to perform these tasks were inadequate, because we need to be able to detect a single drop out of a cycle.  With a real-world signal I realize it may be noise and one with a single threshold of convert from an analogue to a digital camera may show transitions that do not exist and so I was planning on the development of certain types of debounce code.

    Someone said instead using two thresholds, one for the bottom and one for the top and don't take into account that the signal of the transition if it exceeds the top after going below the bass.

    My attempt at this method is attached.  This VI simulates a sine wave with a lot of noise, then made a single threshold for show how imperfect, it can be.  Then using signal that there is a threshold of two level which works much better, but has a slight change in the time domain, and start will contain unknown values because no transition has occurred with the first sample.

    Pointers or suggestions to improve my implementation is appreciated.  Thank you.

    EDIT: This uses an OpenG function in the Array palette.

    I've done some destruction to your code and converted for you in 2012.  Added the upcoming indeices.

  • Detect the shift in two consecutive low contrast images

    Hello

    To determine how fast a sample of ice sliding USB camera (rate of about of 30 mm/min) I head to align an image every 5 ~ 10 sec and then compare the two images. I'm fighting to get a robust method to determine the displacement. The main displacement will be that in a sense however ice may move a few pixel widths in the other direction as it slides in front of the camera.
    Currently I am comparing the two images taking a large (400 x 800 pixels) KING of the second picture, then taking the pixel values average of all the columns in the two images that then allows me to subtract 1 d arrays that result and find the position where the difference is minimal.
    This works very well for the "perfect" images but no longer reliable with less then perfect images.
    Because the images are samples of ice with very little "features" (not counting the odd are bubbles) and low contrast, I feel that I have to rely on profiles in levels of medium gray rather then a 'function' follow-up or detect an edge etc..

    The berries average grayscale of the King plotted in the graph to see the clear peaks and valleys, so another method would be to match the data but I don't know how to do it again.

    Any suggestions on how I can better determine the displacement between the images? The method should relatively quickly because it must be in 'real time', i.e. within seconds.

    Thanks as always for all of your help.

    Jack

    Hi again

    Advice of Follwing Mike subtract images I've played around with this feature and have now the principle works well.
    In case someone else I would try something similar please see attached the VI and two images of the example that I used to experience.

    Well yet, which doesn't seem to work, it's the method of detection of peak/Valley. Any width I put may not find the Valley... suggestions welcome!

    Have a great day.

    Jack

  • Problem of election after split-drain repeated with two nodes

    Hello

    I use a custom source based on BDB - 5.1.19 (excxx_repquote)

    with two site-MASTER and SLAVE on the other...

    NSite = 2
    ACK = quorum

    -the master is written at the rate of 10 txn quotedb per second
    -l' test is to isolate the customer from the master (brain) and reconnect after a random time include 1 sec to 10 sec

    the test run of about 10 times, but at some point, the slave to process receive DB_EVENT_REP_ELECTION_FAILED
    and the captain enter the mode of election and never leave the CLIENT mode. I have to say that I decided to freeze the client to kill me (kill-9 my pid) when I get this event...


    Here is the log in light on the master...

    [1307872770:871621] [6510/47655809107168] MASTER: rep_send_function returned: 110
    [1307872770:973655] [6510/47655809107168] MASTER: bulk_msg: Send copy due to PERM after buffer
    [1307872770:973667] [6510/47655809107168] MASTER: send_bulk: send 266 bytes of the buffer in bulk (0x10a)
    [1307872770:973672] [6510/47655809107168] MASTER: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 68 eid - 1, type bulk_log, LSN [21] [986648] perm
    [1307872770:973693] [6510/47655809107168] MASTER: wait for the acknowledgement of receipt: need 1
    [1307872771:26623] [6510/47655809107168] MASTER: rep_send_function returned: 110
    [1307872771:126380] [6510/1162996032] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, Journal type, LSN [21] [946345]
    [1307872771:126407] [6510/1162996032] MASTER: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 68 eid - 1, type dupmaster, LSN [0] [0] nobuf
    [1307872771:126695] [6510/1162996032] MASTER: rep_start: old version 17 journal found
    [1307872771:126753] [6510/1162996032] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 68 eid - 1, type newclient, LSN [0] [0] nobuf
    [1307872771:126833] [6510/1183975744] CUSTOMER: from the election thread
    [1307872771:126876] [6510/1183975744] CLIENT: Start election Europe 2, ack 1, priority 100
    [1307872771:126890] [6510/1183975744] CLIENT: Election thread has egen 69
    [1307872771:127423] [6510/1173485888] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, type newclient, LSN [0] [0]
    [1307872771:130079] [6510/1183975744] CLIENT: count VOTE1 [0] (2147483647, 69)
    [1307872771:130113] [6510/1183975744] CLIENT: count an election
    [1307872771:130134] [6510/1183975744] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 68 eid - 1, type vote1, LSN [21] [986728] nobuf
    [1307872771:130147] [6510/1173485888] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 68 eid - 1, type master_req, LSN [0] [0] nobuf
    [1307872771:130438] [6510/1152506176] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, type vote1, LSN [21] [946437]
    [1307872771:130460] [6510/1162996032] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, living type, LSN [21] [986728]
    [1307872771:130467] [6510/1152506176] CLIENT: update of gen from 68 to 70
    [1307872771:130482] [6510/1162996032] CLIENT: received egen ALIVE of 71, 69 mine
    [1307872771:130503] [6510/1162996032] CLIENT: Election completed in 0.003602000 sec
    [1307872771:130515] [6510/1162996032] CLIENT: Election; Egen 70
    [1307872771:130534] [6510/1152506176] CLIENT: received vote1 egen egen 71, 71
    [1307872771:130581] [6510/1152506176] CLIENT: count VOTE1 [0] (0, 71)
    [1307872771:130593] [6510/1089075520] CUSTOMER: from the election thread
    [1307872771:130619] [6510/1152506176] CLIENT: Vote Incoming: (eid) 0 (pri) 100 ELECTABLE (gen) 70 (egen) 71 [21,946437]
    [1307872771:130642] [6510/1152506176] CLIENT: not in election, but receipts vote1 0x282c 0x8
    [1307872771:130674] [6510/1089075520] CLIENT: Start election Europe 2, ack 1, priority 100
    [1307872771:130692] [6510/1089075520] CLIENT: Election thread has 71 egen
    [1307872771:130704] [6510/1194465600] CUSTOMER: from the election thread
    [1307872771:130733] [6510/1194465600] CLIENT: Start election Europe 2, ack 1, priority 100
    [1307872771:132922] [6510/1089075520] CLIENT: count VOTE1 [1] (2147483647, 71)
    [1307872771:132949] [6510/1089075520] CLIENT: accept the new vote
    [1307872771:132958] [6510/1089075520] CLIENT: count an election
    [1307872771:132973] [6510/1089075520] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid - 1, type vote1, LSN [21] [986728] nobuf
    [1307872771:132985] [6510/1194465600] CLIENT: fate of election thread
    [1307872771:133012] [6510/1089075520] CLIENT: count VOTE2 [0] (2147483647, 71)
    [1307872771:133037] [6510/1089075520] CLIENT: counted my vote 1
    [1307872771:133048] [6510/1089075520] CLIENT: jump phase2 waiting: already had 1 vote
    [1307872771:133060] [6510/1089075520] CLIENT: got enough votes to win. election of fact; Gen (prev) 70
    [1307872771:133071] [6510/1089075520] CLIENT: Election completed in 0.002367000 sec
    [1307872771:133084] [6510/1089075520] CLIENT: Election; Egen 72
    [1307872771:133111] [6510/1089075520] CLIENT: flag of election ending in 0, e_th 1, egen 72, 0x2a2c, e_fl, 0x0, lo_fl 0 x 6
    [1307872771:133170] [6510/1173485888] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, living type, LSN [0] [0]
    [1307872771:133187] [6510/1173485888] CLIENT: Racing replication msg lockout, ignore the message.
    [1307872771:173744] [6510/1162996032] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, type vote2, LSN [0] [0]
    [1307872771:173769] [6510/1162996032] CLIENT: Racing replication msg lockout, ignore the message.
    [1307872771:231593] [6510/1183975744] CLIENT: flag of election ending in 0, e_th 0, egen 72, 0x2a2c, e_fl, 0x0, lo_fl 0x1c
    [1307872771:231629] [6510/1183975744] CLIENT: fate of election thread
    [1307872777:443794] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307872971:644194] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307873165:844583] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307873360:44955] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307873554:245347] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307873748:445736] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307873942:646117] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init
    [1307874136:846509] [6510/1131526464] CLIENT: connect to 2.0.0.210:12345 site with result 115 init

    ... and stay infinite this situation



    My question is why the master is suddenly transformed into CUSTOMER and why he never returns to the MASTER



    Thanks in advance...



    Here is the log for the customer

    [1307872315:455113] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, Journal type, LSN [21] [984396]
    [1307872315:455134] [1282/1160603968] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, Journal type, LSN [21] [984483] perm
    [1307872315:609962] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [984733] perm
    [1307872315:764958] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [984986] perm
    [1307872315:919962] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [985238] perm
    [1307872316:75018] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [985491] perm
    [1307872316:229959] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [985741] perm
    [1307872316:384949] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [985993] perm
    [1307872316:499899] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [986141] perm
    [1307872316:539895] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, Journal type, LSN [21] [986221]
    [1307872316:540078] [1282/1171093824] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, Journal type, LSN [21] [986307]
    [1307872316:540100] [1282/1160603968] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, Journal type, LSN [21] [986394] perm
    [1307872316:694950] [1282/1171093824] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type bulk_log, LSN [21] [986648] perm
    [1307872316:847349] [1282/1129134400] MASTER: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid - 1, Journal type, LSN [21] [946345]
    [1307872316:847698] [1282/1171093824] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, dupmaster, LSN type [0] [0]
    [1307872316:847999] [1282/1181583680] MASTER: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type newclient, LSN [0] [0]
    [1307872316:848168] [1282/1171093824] MASTER: rep_start: old version 17 journal found
    [1307872316:848222] [1282/1181583680] CLIENT: Racing replication msg lockout, ignore the message.
    [1307872316:848398] [1282/1171093824] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid - 1, type newclient, LSN [0] [0] nobuf
    [1307872316:848504] [1282/1192073536] CUSTOMER: from the election thread
    [1307872316:848542] [1282/1192073536] CLIENT: Start election Europe 2, ack 1, priority 100
    [1307872316:848566] [1282/1192073536] CLIENT: Election thread has 71 egen
    [1307872316:849634] [1282/1192073536] CLIENT: count VOTE1 [0] (2147483647, 71)
    [1307872316:849654] [1282/1192073536] CLIENT: count an election
    [1307872316:849680] [1282/1192073536] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid - 1, type vote1, LSN [21] [946437] nobuf
    [1307872316:851403] [1282/1160603968] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, type vote1, LSN [21] [986728]
    [1307872316:851448] [1282/1160603968] CLIENT: received vote1 egen egen 69, 71
    [1307872316:851470] [1282/1160603968] CLIENT: received the old vote egen 69, 71, ignoring vote1
    [1307872316:851481] [1282/1160603968] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid 0, living type, LSN [21] [986728] nobuf
    [1307872316:851538] [1282/1171093824] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 68 eid 0, master_req, LSN type [0] [0]
    [1307872316:851558] [1282/1171093824] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid 0, living type, LSN [0] [0] nobuf
    [1307872316:854254] [1282/1160603968] CLIENT: / opt/bdb/rep_process_message: msgv = 5 logv 17 gen = 70 eid 0, type vote1, LSN [21] [986728]
    [1307872316:854275] [1282/1160603968] CLIENT: received vote1 egen egen 71, 71
    [1307872316:854317] [1282/1160603968] CLIENT: count VOTE1 [1] (0, 71)
    [1307872316:854339] [1282/1160603968] CLIENT: Vote Incoming: (eid) 0 (pri) 100 ELECTABLE (gen) 70 (egen) 71 [21,986728]
    [1307872316:854353] [1282/1160603968] CLIENT: Vote existing: (eid) 2147483647 (pri) 100 (gen) 70 (sites) 2 [21,946437]
    [1307872316:854369] [1282/1160603968] CLIENT: accept the new vote
    [1307872316:854379] [1282/1160603968] CLIENT: Election of phase 1 done
    [1307872316:854395] [1282/1160603968] CLIENT: vote for 0
    [1307872316:854407] [1282/1160603968] CLIENT: / opt/bdb/rep_send_message: msgv = 5 logv 17 gen = 70 eid 0, type vote2, LSN [0] [0] nobuf
    [1307872317:960344] [1282/1192073536] CLIENT: after the phase 2: votes 0, nvotes 1, Europe 2
    [1307872317:960389] [1282/1192073536] CLIENT: Election completed in 1.111809000 sec
    [1307872317:960401] [1282/1192073536] CLIENT: Election; Egen 72
    [1307872317:960412] [1282/1192073536] CLIENT: flag of completed election with-30974, e_th 0, egen 72, 0x282c, e_fl, 0x0, lo_fl 0x0
    Kill me!



    -my source

    on the master, I executed manually:

    txn_rate 1
    loop_rate 10
    loop 1 20000

    ------
    /*-
    * See the file LICENSE for redistribution information.
    *
    * Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved.
    *
    * $Id$
    */

    /*
    * In this application, specify us all communications via the command line. In
    * a real application, one would expect that the information on other sites
    * in the system would be maintained in a sort of configuration file. The
    * most of this interface, it is that we assume at the start that we can
    * knowledge
    (* 1) what is our environment home Berkeley DB,.
    (* 2) which host/port we want to hear about the connections. and
    (* 3) an optional list of other sites, we should try to connect to.
    *
    * These items of information are expressed by the following indicators.
    * h House (required; h means home directory)
    *-l host: port (required; l means local)
    * - C or - M (optional; will start as customer or master)
    * r - host: port (optional; r mean distance; no matter how many of them may be)
    * specified)
    * R - host: port (optional; R stands for the remote peer; only one of them can
    * to be specified)
    * - an all the | quorum (optional; a is synonymous with the ACK policy)
    * b (optional; b means in bulk)
    * Europe - n (optional, number of sites in the replication group; default is 0)
    * to try to dynamically calculate Europe)
    * priority Pei (optional; default is 100)
    * - v (optional; v means verbose)
    */

    #include < cstdlib >
    #include < a > cstring

    #include < iostream >
    #include < String >
    #include < sstream >

    #include < sys/types.h >
    #include < signal.h >


    #include < db_cxx.h >
    #include "RepConfigInfo.h".
    #include "dbc_auto.h".

    using std::cout;
    using std::cin;
    using std::cerr;
    using std::endl;
    using std::ends;
    using std::flush;
    using std::istream;
    using std::istringstream;
    using std::ostringstream;
    using std::string;
    using std::getline;

    #include < stdio.h >
    #include < readline/readline.h >
    #include < readline/history.h >

    #define CACHESIZE (10 * 1024 * 1024)
    #define of DATABASE 'quote.db '.
    #define «quote2.db» base2

    const char * progname = "excxx_repquote";

    #include < errno.h >
    #ifdef _WIN32
    #define WIN32_LEAN_AND_MEAN
    #include < windows.h >
    #define _snprintf snprintf
    #define sleep (s) sleep (1000 * (s))

    extern "C" {}
    extern int getopt (int, char * const *, const char *);
    extern char * optarg;
    }

    typedef HANDLE thread_t;
    typedef DWORD thread_exit_status_t;
    #define thread_create (thrp, attr, func, arg).
    (((* (thrp) = CreateThread (NULL, 0,-))))
    (LPTHREAD_START_ROUTINE) ((((func), (arg), 0, NULL)) == NULL)? (1: 0)
    #define thread_join (thr, statusp).
    ((WaitForSingleObject ((THR), Infinite) == WAIT_OBJECT_0) & & \)
    GetExitCodeThread ((thr), (LPDWORD) (statusp))? 0: - 1).
    #else / *! _WIN32 * /.
    #include < pthread.h >

    typedef pthread_t thread_t;
    typedef void * thread_exit_status_t;
    #define thread_create (thrp, attr, func, arg).
    pthread_create ((thrp), (attr), (func), (arg))
    #define (thr, statusp) thread_join pthread_join ((thr), (statusp))
    #endif

    Struct used to store information in the field of app_private Db.
    typedef struct {}
    bool app_finished;
    bool in_client_sync;
    bool is_master;
    bool no_dummy_wr;
    } APP_DATA.

    public static void log(const char *);
    void checkpoint_thread (Sub );
    void log_archive_thread (Sub );
    void dummy_write_thread (Sub );

    Class RepQuoteExample {}
    public:
    RepQuoteExample();
    void init (RepConfigInfo * config);
    void doloop();
    terminate() int;

    public static void event_callback (DbEnv * dbenv, u_int32_t, void * info);
    void print_stocks_size(Db *dbp);

    private:
    disable the copy constructor.
    RepQuoteExample(const RepQuoteExample &);
    void operator = (const RepQuoteExample &);

    internal data members.
    APP_DATA app_data.
    RepConfigInfo * app_config;
    DbEnv cur_env;
    thread_t ckp_thr;
    thread_t lga_thr;
    thread_t dmy_thr;

    private methods.
    void print_stocks(Db *dbp);
    void print_env(DbEnv *dbenv);

    prompt() Sub;
    };

    RepQuoteExample * g_runner = NULL;
    RepConfigInfo * g_config = NULL;

    Class DbHolder {}
    public:
    DbHolder ( env, const char _dbname DbEnv): env (env)
    {
    DBP = 0;
    If (_dbname) dbname = _dbname;
    else dbname = database;
    }

    {~ DbHolder()}
    try {}
    Close();
    } catch (...) {
    Ignore: this may mean that another exception is waiting
    }
    }

    bool ensure_open (bool creation) {}
    If (dbp)
    return (true);
    DBP = new Db (env, 0);

    u_int32_t flags = DB_AUTO_COMMIT;
    If (creation)
    flags | = DB_CREATE;
    try {}
    DBP-> open (NULL, NULL, DB_BTREE, DATABASE, flags, 0);
    DBP-> open (NULL, dbname, NULL, DB_BTREE, flags, 0);
    DBP-> open (NULL, NULL, dbname, DB_BTREE, flags, 0);
    return (true);
    } catch (DbDeadlockException e) {}
    } catch (DbRepHandleDeadException e) {}
    } catch (DbException e) {}
    If (e.get_errno () == DB_REP_LOCKOUT) {}
    Just fall through.
    } ElseIf (e.get_errno () == ENOENT & &! creation) {}
    Provide a little extra explanation.
    //
    Log ("Stock DB is not still exist");
    } else
    throw;
    }

    (All renewable errors pass here).
    //
    Log ("Please try again");
    Close();
    Return (false) End Function
    }

    {} void close()
    If {(dbp)
    try {}
    DBP-> close (0);
    Remove dbp;
    DBP = 0;
    } catch (...) {
    Remove dbp;
    DBP = 0;
    throw;
    }
    }
    }

    operator Db * () {}
    return of dbp;
    }

    DB * operator-> () {}
    return of dbp;
    }

    private:
    DB * dbp;
    DbEnv * env;
    const char * dbname;
    };

    Class StringDbt: public {Dbt
    public:
    #define GET_STRING_OK 0
    #define GET_STRING_INVALID_PARAM 1
    #define GET_STRING_SMALL_BUFFER 2
    #define GET_STRING_EMPTY_DATA 3
    int get_string (char * buf, size_t buf_len)
    {
    size_t copy_len;
    int ret = GET_STRING_OK;
    If (buf == NULL) {}
    ECRR < < "Invalid entry to get_string stamp" < < endl;
    Return GET_STRING_INVALID_PARAM;
    }

    Make sure that the string is null terminated.
    Memset (* buf, 0, buf_len);

    If there is no string, simply return.
    If (get_data() == NULL | get_size() == 0)
    Return GET_STRING_OK;

    If (get_size() > = buf_len) {}
    RET = GET_STRING_SMALL_BUFFER;
    copy_len = buf_len - 1; save room for a terminator.
    } else
    copy_len = get_size();
    memcpy (* buf, get_data(), copy_len);

    return ret;
    }
    size_t get_string_length()
    {
    If (get_size() == 0)
    return 0;
    Return strlen ((char *) get_data());
    }
    Sub set_string(char *string)
    {
    SET_DATA (String);
    set_Size ((u_int32_t) strlen (String));
    }

    StringDbt(char *string):
    DBT (string, (u_int32_t) strlen (string)) {};
    StringDbt(): Dbt() {};
    ~ StringDbt() {};

    Do not add additional data to this subcategory because we want to keep it
    compatible with objects Dbt created in-house by Berkeley DB.
    };

    DB * g_repquote = NULL;

    RepQuoteExample::RepQuoteExample(): app_config (0), cur_env (0) {}
    App_Data.app_finished = 0;
    App_Data.in_client_sync = 0;
    App_Data.is_master = 0; Suppose I have as a customer initially
    App_Data.no_dummy_wr = 0; prevent to run dummy writing
    }

    /*
    int (* old_rep_process_message)
    __P ((DB_ENV *, DBT *, DBT *, int, DB_LSN *));

    int my_rep_process_message __P ((DB_ENV DBT, arg1 , arg2, arg3, arg4 int, DB_LSN $arg5 DBT))
    {
    printf ("EZ-> > > my_rep_process_message:%p\n",arg5 ");
    old_rep_process_message (Arg1, Arg2, Arg3, Arg4, $arg5);
    }
    */

    void RepQuoteExample::init(RepConfigInfo *config) {}
    app_config = config;

    cur_env.set_app_private (& App_Data);
    cur_env.set_errfile (stderr);
    App_Data.no_dummy_wr = config-> no_dummy_wr;
    If (app_data.no_dummy_wr)
    printf ("no dummy! \n");

    EZ-> cur_env.set_errpfx (progname);
    cur_env.set_event_notify (event_callback);

    Configure the transfer block to send groups of documents to customers
    When a single network transfers. This is useful for sites of masters
    and customers participating in the synchronization from client to client.
    //
    If (app_config-> in bulk)
    cur_env.rep_set_config (DB_REP_CONF_BULK, 1);

    Set the total number of sites in the replication group.
    It is used by the treatment of election internal repmgr.
    //
    If (app_config-> totalsites > 0)
    cur_env.rep_set_nsites (app_config-> totalsites);

    Turn on the output of debugging and application information.
    If (app_config-> verbose)
    cur_env.set_verbose (DB_VERB_REPLICATION, 1);

    cur_env.set_verbose (DB_VERB_REPMGR_MISC, 1);
    cur_env.set_verbose (DB_VERB_RECOVERY, 1);
    cur_env.set_verbose (DB_VERB_REPLICATION, 1);
    cur_env.set_verbose (DB_VERB_REP_ELECT, 1);
    cur_env.set_verbose (DB_VERB_REP_LEASE, 1);
    cur_env.set_verbose (DB_VERB_REP_SYNC, 1);
    cur_env.set_verbose (DB_VERB_REPMGR_MISC, 1);

    Set the priority of replication for this environment group election.
    An election first selects the site with the most recent log
    documents such as the new master. If several sites are the most
    recent log records, the site with the highest priority value
    is selected as the master.
    //
    cur_env.rep_set_priority (app_config-> priority);

    Set the policy that determines how master and client sites
    treat the acknowledgment of replication messages required for
    permanent record. The default policy of "quorum" requires only
    a quorum of the likely to be elected peers sufficient to ensure a permanent
    record remains durable if the election is held. The option 'all '.
    requires that all clients to recognize a permanent replication
    message instead.
    //
    cur_env.repmgr_set_ack_policy (app_config-> ack_policy);

    Set the threshold for the minimum and maximum of the client time
    wait before asking the retransmission of a missing message.
    These core values on the characteristics of performance and load
    host master and client as well as the tower platforms
    message trigger time.
    //
    cur_env.rep_set_request (20000, 500000);

    Configure the detection of blockages to ensure that blockages of locks?
    are broken by the presence of one of the queries of locks in conflict
    has rejected. DB_LOCK_DEFAULT uses the specified lock strategy
    at the time of the creation environment or DB_LOCK_RANDOM if none has been
    specified.
    //
    cur_env.set_lk_detect (DB_LOCK_DEFAULT);

    The following features of the basic replication can also be useful to your
    request. See Berkeley DB documentation for more details.
    -Master leases: strict consistency for data reads
    on a main site.
    -Delivery time: Customize the amount of time that waiting for Berkeley DB
    for such things as the election must be concluded or a master
    lease to be granted.
    -Client synchronization delay: managing the main site
    resources by spreading intensive customer resources
    synchronizations.
    -Blocked customer operations: return immediately with an error
    rather than wait indefinitely if a customer is operation
    blocked by a current client synchronization.

    cur_env.repmgr_set_local_site (app_config-> this_host.host,
    app_config-> this_host.port, 0);

    for (REP_HOST_INFO * cur = app_config-> other_hosts; cur! = NULL;)
    Cur = cur-> next) {}
    cur_env.repmgr_add_remote_site (cur-> host, cur-> port,
    NULL, cur-> peers? DB_REPMGR_PEER: 0);
    }

    Configure heartbeat timeouts so that repmgr monitors the
    health of the TCP connection. Master sites disseminate a heartbeat
    at the frequency specified by the timeout DB_REP_HEARTBEAT_SEND.
    Customer sites waiting for activity of the messages of the length of the
    DB_REP_HEARTBEAT_MONITOR timeout before concluding that the
    connection to the master is lost. The DB_REP_HEARTBEAT_MONITOR
    timeout must be longer than the time-out DB_REP_HEARTBEAT_SEND.
    //
    cur_env.rep_set_timeout (DB_REP_HEARTBEAT_SEND, 5000000);
    cur_env.rep_set_timeout (DB_REP_HEARTBEAT_MONITOR, 10000000);

    The following features of repmgr can also be useful to your
    request. See Berkeley DB documentation for more details.
    -Regulates two sites of strict majority - in a two-site replication
    the group, to ask the two sites are available to elect a new
    master.
    -Timeout - customize the amount of time repmgr awaits
    for things as pending or try thanks
    to reconnect to other sites.
    -The site list - returns a list of currently known sites at repmgr.

    Now we can open our environment, although we are not ready to
    start replication. However, we want to have a dbenv autour
    so that we can send it in one of our message handlers.
    //
    cur_env.set_CacheSize (0, CACHESIZE, 0);
    cur_env.set_flags (DB_REP_PERMANENT, 1);
    cur_env.set_flags (DB_TXN_WRITE_NOSYNC, 1);

    / * u_int32_t maxlocks = 300000;
    If (maxlocks! = 0)
    cur_env.set_lk_max_locks (MAXLOCKS);

    u_int32_t maxlocks_o = 300000;
    If (maxlocks_o! = 0)
    cur_env.set_lk_max_objects (maxlocks_o);

    u_int32_t maxmutex = 300000;
    If (maxmutex! = 0)
    cur_env.mutex_set_max (maxmutex);
    */

    DbEnv * m_env = & cur_env;
    m_env-> set_flags (DB_TXN_NOSYNC, 1);
    m_env-> set_lk_max_lockers (60000);
    m_env-> set_lk_max_objects (60000);
    m_env-> set_lk_max_locks (60000);
    m_env-> set_tx_max (60000);

    m_env-> repmgr_set_ack_policy (DB_REPMGR_ACKS_NONE);

    m_env-> rep_set_timeout (DB_REP_ACK_TIMEOUT, 50 * 1000); 50ms
    m_env-> rep_set_timeout (DB_REP_CHECKPOINT_DELAY, 0);
    m_env-> rep_set_timeout (DB_REP_CONNECTION_RETRY, 30 * 1000 * 1000); 30 seconds
    m_env-> rep_set_timeout (DB_REP_ELECTION_TIMEOUT, 1 * 1000 * 1000); 5 seconds
    m_env-> rep_set_timeout (DB_REP_FULL_ELECTION_TIMEOUT, 5 * 1000 * 1000); 5 seconds
    m_env-> rep_set_timeout (DB_REP_CONNECTION_RETRY, 5 * 1000 * 1000);
    m_env-> rep_set_timeout (DB_REP_ELECTION_RETRY, 10 * 1000 * 1000); 10 seconds

    m_env-> rep_set_timeout (DB_REP_HEARTBEAT_MONITOR, 80 * 1000 * 1000); 80 seconds
    m_env-> rep_set_timeout (DB_REP_HEARTBEAT_SEND, 500 * 1000); 500 milliseconds

    The minimum number of microseconds that a client will wait before requesting a retransmission
    u_int32_t rep_req_min = 40000; 40 000 microsec = 40 mili
    The maximum number of milliseconds that a client will wait before requesting a retransmission
    u_int32_t rep_req_max = 1280000. / / 1 280 000 microsec = 1.28 sec

    u_int32_t rep_limit_gbytes = 0;
    u_int32_t rep_limit_bytes = 100 * 1024 * 1024; 100 MB
    m_env-> rep_set_request (rep_req_min, rep_req_max);
    m_env-> rep_set_limit (rep_limit_gbytes, rep_limit_bytes);


    cur_env. Open (app_config-> homepage, DB_CREATE |) DB_RECOVER |
    DB_THREAD | DB_INIT_REP | DB_INIT_LOCK | DB_INIT_LOG |
    DB_INIT_MPOOL | DB_INIT_TXN, 0);

    keep the old string function
    old_rep_process_message = cur_env.get_DB_ENV ()-> rep_process_message;
    deviant
    cur_env.get_DB_ENV ()-> rep_process_message = my_rep_process_message;

    / * int _i;
    cur_env.log_get_config (DB_LOG_DIRECT & _i); printf ("DB_LOG_DIRECT = %d\n",_i);
    cur_env.log_get_config (DB_LOG_DSYNC & _i); printf ("DB_LOG_DSYNC = %d\n",_i);
    cur_env.log_get_config (DB_LOG_AUTO_REMOVE & _i); printf ("DB_LOG_AUTO_REMOVE = %d\n",_i);
    cur_env.log_get_config (DB_LOG_IN_MEMORY & _i); printf ("DB_LOG_IN_MEMORY = %d\n",_i);
    cur_env.log_get_config (DB_LOG_ZERO & _i); printf ("DB_LOG_ZERO = %d\n",_i);
    */

    Start checkpoint and newspaper archive support threads.
    (void) thread_create (& ckp_thr, NULL, checkpoint_thread, & cur_env);
    (void) thread_create (& lga_thr, NULL, log_archive_thread, & cur_env);
    (void) thread_create (& dmy_thr, NULL, dummy_write_thread, & cur_env);

    cur_env.repmgr_start (3, app_config-> start_policy);
    }

    The detailed output shows that the site has won the election and the
    RepMgr code calls rep_start to become the master, but he is stuck
    waiting for a txn or a cursor to be resolved before this change of State
    may occur. I have not studied your application code. But if you have a
    cursor or txn, underway at the time, then you must resolve before
    the site may change the State.

    If you can reproduce this, it would be useful to see the stack traces
    the threads. That could confirm or deny that, in my view, I see.

    Sue LoVerso
    Oracle

  • Detect the PEAK, mount and average

    I use a loop in LabVIEW 8.5 to capture the signals emitted continuously by a card, peak detector.VI is used to detect the signal peaks, then fit.VI nonlinear curve is used to climb the summits, signal now capture, detection of peaks, mount and display pics are all works very well permanently, but there are still some problems annoying me.
    1. the received signals is not very stable, so editing results expected on average for 100 times, then how can I averaged the results of fitting on the condition that the capture of signal is not interrupted, this is the time loop does not stop, when the average is made this time, average is reset for the next 100 fitting results can be average again?
    2. There is another way, that's 100 results of fitting is automatically saved to excel, then the results is an average manually in excel, then how to store results like this: the first 100 results of connection are stored in an excel file and the next 100 results for other excel connector or they are stored in an excell , but in different columns? Of course the thses are subject to the capture of signal is not interrupted.
    3. There is a threshold for the detector.VI peak, but the captured signals entry isn't very stable, so the number of peaks detected is not the same every time, like this time, the number of vertices is 40, next will be 39, this will affect the results of fitting slightly, then how do to detect the same number of vertices every time such as the number is 40 each time?

    Any advice will be appreciated!

    Maybe the pic attached detect.vi 'test' can help you. "medium signal.vi" is a sub VI on average the signal in a way online.

    There are three methods using the input signal:

    1. no average.

    2. average exponential.

    3. linear average.

    Your problem is when the input signal is damaged by some noise, and you want the input signal before the detection of peaks on average. I use white noise to simulate a noisy environment.

    By default, the average mode is 'Linear', and the number of averages is 50. The more averages, the best on the result, but more time to update.

    Swith mode between 'Linear' and 'No way' to compare the difference before average and average.

    Average exponential is not appropriate in your case.

    Let me know if it works for you.

  • VMware device with 2 network cards claiming the same IP address with two MAC addresses

    Hello.

    I see messages intermittent my gateway network two MAC addresses associated with a virtual machine running on a 5.5 ESXi host for the same IP address.

    The virtual machine is a MiTel 3300 controller for a VOIP system. the system is configured with two IP addresses, one on the local network and another with a public IP address in the DMZ. In the network configuration of the 3300, I assigned the address LAN IP at 00: 0C: 29:30:B2:B2 and the DMZ IP at 00: 0C: 29:30:B2:BC (Mac for network devices presented by the ESXi host virtual machine).

    On the host, I configured a vSwitch with exclusive access to two physical network adapters on the host machine. The vSwitch is configured with two machine virtual port groups, LAN and DMZ, with access to the physical network interface cards. Tab grouping of groups vSwitch port NIC, I replaced the order of failover of the switch to activate an active NETWORK card only for the Group of LAN ports and the other card NETWORK only for the DMZ port group. (I don't know how the content of the column of networks is determined. Neither is correct for the traffic on the physical switch. If these are configurable, please advise and I'll change the settings). The relevant parameters of vSwitch, groups of ports and VM are distinguished below.

    On the virtual machine itself, through the VMWare host, I assigned 00: 0C: 29:30:B2:B2 for the Group of LAN ports and 00: 0C: 29:30:B2:BC to the DMZ group port (best I can tell, anyway, since the MAC address field annoyingly obscures the last two digits of the MAC address - break if I invert the mapping) (, but all seems OK).

    The goal here is to make sure that MACs of ports vSwitch the 3300 is listening and sending always correspond to the physical ports that are VLAN Tag by the physical switch to ensure the routing. Generally speaking, it seems that what is happening but, intermittently, we cross one-way calls that suggests a problem of routing between us and our SIP trunk provider; coinciding with these incidents, I get an email along the lines of "the security in the network device has detected a conflict of IP address with two or more devices. The period of INVESTIGATION "DMZ. DMZ. DMZ. DMZ' is claimed by the following clients with MAC addresses: ' 00: 0C: 29:30:B2:B2' ' 00: 0C: 29:30:B2:BC'. »

    I did something in the configuration that would lead to this kind of collision intermittent? Have a hacked together a way to do something that could be accomplished in a way that is simpler and more reliable?

    Thanks for any idea that you can offer.

    Kind regards

    J.

    I probably don't fully understand your configuration, but it seems that you are not interested in using the collection of NETWORK adapters in the virtual switch of the VM MiTel 3300.

    If it is correct, why not create two virtual switches, each with a group of port (LAN and DMZ) unique and with a separate connection of (vmnic2 and vmnic1)?

    In general, collection of NETWORK adapters may be used to share traffic between uplinks and ensure that if one of the uplinks connect fails, a virtual machine still has access to the network.

  • JComboBox with two columns

    Hello

    I found a nice piece of code in the forum, which extends a JComboBox to display
    two columns.
    Now I am trying to add my own demands, namely the combo should be editable
    and only the first column should appear in the edit field and become the
    selected value.

    I thought to write an own editor that "catches" the posting process for
    manipulate the text that will be displayed. Because the rendering engine uses a
    JPanel to display columns, I expect this Panel must be passed in the
    setItem method (...) the editor. But it isn't, and I can't even detect
    what object is passed.

    I wonder if this approach is advisable at all. If comments or ideas
    are welcome.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
     
    public class Main extends JFrame {        
        public static final long serialVersionUID= 70L;
    
        public Main() {        
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            final JComboBox<Object> priceList = new JComboBox<>(new Object[] {
                new Object[] { "Lemon", 0.5 },
                new Object[] { "Cherry", 3 },
                new Object[] { "Apple", 1 },
            });
            priceList.setEditable(true);
         priceList.setEditor(new MyEditor());
            priceList.setRenderer(new MyRenderer());
            add(priceList, BorderLayout.CENTER);
    
         JButton b= new JButton("OK");
         b.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
             System.out.println(priceList.getSelectedItem());
           }
         });
            add(b, BorderLayout.SOUTH);
            pack();
        }
        
        public static void main(String... args) 
        throws Exception {                
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
                }
            });
        }
    
    
    
      class MyEditor extends JTextField implements ComboBoxEditor {
        public static final long serialVersionUID= 71L;
    
        public Component getEditorComponent() {
          return this;
        }
    
        public Object getItem() {
          return getText();
        }
    
        public void setItem(Object obj) {
          System.out.println("Setting item");
          System.out.println(obj);
          if (obj instanceof JPanel) System.out.println("Panel");
          if (obj instanceof JLabel) System.out.println("Label");
          if (obj instanceof String) System.out.println("String");
          setText("Hello");
        }
      }
    
     
    /** 
     * This class uses panel with two labels to render the list (combobox) cell.
     */
      class MyRenderer extends JPanel implements ListCellRenderer<Object> {
        public static final long serialVersionUID= 72L;
        JLabel labels[] = { new JLabel(), new JLabel() };
    
        public MyRenderer() {
            setLayout(new GridBagLayout());
            // Add labels
            GridBagConstraints c = new GridBagConstraints();
            c.fill = GridBagConstraints.HORIZONTAL;
            c.weightx = 0.1;
            add(labels[0],c);
            add(labels[1]);
        }
    
        public Component getListCellRendererComponent(JList<?> list, Object value,
                   int index, boolean isSelected, boolean cellHasFocus) {
            Object rowData[] = (Object[])value;
            // Prepare colors
            Color foreground = isSelected? 
                list.getSelectionForeground(): list.getForeground();
            Color background = isSelected?
                list.getSelectionBackground(): list.getBackground();
            // Set panel colors
            setForeground(foreground);
            setBackground(background);
            int col = 0;
            for(JLabel label : labels) {
                label.setBackground(background);
                label.setForeground(foreground);
                label.setText( String.valueOf(rowData[col++]) );
            }
            return this;
        }
      }
    
    }

    As an alternative, I thought that usiing a JComboBox 'ordinary' with the strings in column 1 as elements and you try to change the popup so that it displays and column 2.

    You can render the comboBox and the popup differently. Just check for an index of-1 for the drop-down list box.

    Different examples of how you can restore more than one column in a combo box. The example of "text pane" has been changed so that the drop-down list box shows only one column while the popup shows the two columns:

    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.text.*;
    
    public class ComboBoxMultiColumn extends JFrame
    {
         public ComboBoxMultiColumn()
         {
              getContentPane().setLayout( new GridLayout(0, 2) );
    
              Vector items = new Vector();
              items.addElement( new Item("123456789", "Car" ) );
              items.addElement( new Item("23", "Plane" ) );
              items.addElement( new Item("345", "Train" ) );
              items.addElement( new Item("4567", "Nuclear Submarine" ) );
    
              //  Use a JTextArea as a renderer
    
              JComboBox comboBox1 = new JComboBox( items );
              comboBox1.setRenderer( new TextAreaRenderer(5) );
    
              getContentPane().add( new JLabel("TextArea Renderer") );
              getContentPane().add( comboBox1 );
    
              //  Use a JTextPane as a renderer
    
              JComboBox comboBox2 = new JComboBox( items );
              comboBox2.setRenderer( new TextPaneRenderer(10) );
    
              getContentPane().add( new JLabel("TextPane Renderer") );
              getContentPane().add( comboBox2 );
    
              //  Use a JPanel as a renderer
    
              JComboBox comboBox3 = new JComboBox( items );
              comboBox3.setRenderer( new PanelRenderer(50) );
    
              getContentPane().add( new JLabel("Panel Renderer") );
              getContentPane().add( comboBox3 );
    
              //  Using HTML
    
              JComboBox comboBox4 = new JComboBox( items );
              comboBox4.setRenderer( new HTMLRenderer() );
    
              getContentPane().add( new JLabel("HTML Renderer") );
              getContentPane().add( comboBox4 );
         }
    
         class Item
         {
              private String id;
              private String description;
    
              public Item(String id, String description)
              {
                   this.id = id;
                   this.description = description;
              }
    
              public String getId()
              {
                   return id;
              }
    
              public String getDescription()
              {
                   return description;
              }
    
              public String toString()
              {
                   return description;
              }
         }
    
         public static void main(String[] args)
         {
              JFrame frame = new ComboBoxMultiColumn();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible( true );
         }
    
         /*
         **  Tabs are easier to use in a JTextArea, but not very flexible
         */
         class TextAreaRenderer extends JTextArea implements ListCellRenderer
         {
              public TextAreaRenderer(int tabSize)
              {
                   setTabSize(tabSize);
              }
    
              public Component getListCellRendererComponent(JList list, Object value,
                   int index, boolean isSelected, boolean cellHasFocus)
              {
                   Item item = (Item)value;
                   setText(item.getId() + "\t" + item.getDescription());
                   setBackground(isSelected ? list.getSelectionBackground() : null);
                   setForeground(isSelected ? list.getSelectionForeground() : null);
                   return this;
              }
         }
    
         /*
         **  Tabs are harder to use in a JTextPane, but much more flexible
         */
         class TextPaneRenderer extends JTextPane implements ListCellRenderer
         {
              public TextPaneRenderer(int tabColumn)
              {
                   setMargin( new Insets(0, 0, 0, 0) );
    
                   FontMetrics fm = getFontMetrics( getFont() );
                   int width = fm.charWidth( 'w' ) * tabColumn;
    
                   TabStop[] tabs = new TabStop[1];
                   tabs[0] = new TabStop( width, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE );
                   TabSet tabSet = new TabSet(tabs);
    
                   SimpleAttributeSet attributes = new SimpleAttributeSet();
                   StyleConstants.setTabSet(attributes, tabSet);
                   getStyledDocument().setParagraphAttributes(0, 0, attributes, false);
              }
    
              public Component getListCellRendererComponent(JList list, Object value,
                   int index, boolean isSelected, boolean cellHasFocus)
              {
                   Item item = (Item)value;
    
                   if (index == -1)
                        setText( item.getDescription() );
                   else
                        setText(item.getId() + "\t" + item.getDescription());
    
                   setBackground(isSelected ? list.getSelectionBackground() : null);
                   setForeground(isSelected ? list.getSelectionForeground() : null);
                   return this;
              }
         }
    
         /*
         **  Use a panel to hold multiple components
         */
         class PanelRenderer implements ListCellRenderer
         {
              private JPanel renderer;
              private JLabel first;
              private JLabel second;
    
              public PanelRenderer(int firstColumnWidth)
              {
                   renderer = new JPanel();
                   renderer.setLayout(new BoxLayout(renderer, BoxLayout.X_AXIS) );
    
                   first = new JLabel(" ");
                   Dimension d = first.getPreferredSize();
                   d.width = firstColumnWidth;
                   first.setMaximumSize(d);
                   second = new JLabel();
                   renderer.add(first );
                   renderer.add(second );
              }
    
              public Component getListCellRendererComponent(JList list, Object value,
                   int index, boolean isSelected, boolean cellHasFocus)
              {
                   Item item = (Item)value;
    
                   first.setText( item.getId() );
                   second.setText( item.getDescription() );
    
                   renderer.setBackground(isSelected ? list.getSelectionBackground() : null);
                   renderer.setForeground(isSelected ? list.getSelectionForeground() : null);
    
                   return renderer;
              }
         }
    
         /*
         **  Use HTML to format the text
         */
         class HTMLRenderer extends DefaultListCellRenderer
         {
              private static final String START = "
    "; private static final String MIDDLE = ""; private static final String END = "
    "; public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); Item item = (Item)value; setText(START + item.getId() + MIDDLE + item.getDescription() + END); return this; } } }
  • How can I associate a button with two slices?

    Hello
    I need help please. How can I associate a button with two slices? or combine the two slices to make one cut or make a form of true polygon on the edges, it will make to the polygon, but it leaves the red lines and I cannot work under this installment... If you understand. Someone help please. Thank you very much.

    Two points.

    First of all, I see that you have forms stars in your image, but that does not mean that you need a star-shaped slice. You can use a little square that is centered on your star. That could make it easier to create your slices. All you have to do is drag lines of leaders in the left seat and superior, two pairs around each star and then drag a slice from one end to the other.

    Noting that brings me to my second point: images must be rectangular. If you want to change the L-shaped area, then you need to swap two images, not one only. This is perhaps why you cannot have the buttons under the threshold of upper sliding of your L shaped section. Because Fireworks needs to make a rectangular image, it is by default in an area that encompasses the range - area you can not the buttons in. It is the lock area non cut which still need to be part of the image, since the part will swap, too.

  • My computer with two hard drives and 2 starting systems has the car crash in the solid state. When I got the new drive and tried to restore from time capsule, I lost some data. How can I see what backups are on the time capsule? My laptop is also backed u

    My computer with two hard drives and 2 starting systems has the car crash in the solid state. When I got the new drive and tried to restore from time capsule, I lost some data. How can I see what backups are on the time capsule? My laptop is also saved to the time capsule. Everything is in 'Data' when I look through the Airport utility. I think that the information that I've lost are still there since I was a Capsule 3 to.

    Time Machine backup to a sparsebundle.

    The sparsebundle will use the share name of computer. So, it should be obvious who is your Macbook and that is your Macpro.

    Open the sparsebundle in Finder and keep open the subfolders until you get to the backup of each separate hard drive...

    You has of course set the exclusion in Time Machine?

    By default, Time Machine will exclude your second drive unless you have included it. Did you?

    Once you get to this level during the backup, you can do a full restore manually whenever you want.

  • How do I pair iwatch with two phones? I have updated to 3.0

    How do I pair iwatch with two phones? I have updated to 3.0

    Hello

    More than one Apple Watch can be coupled to a single iPhone, but a single Apple Watch cannot be combined with more than an iPhone at some point.

  • Can I use separate iCloud for accts Windows on a pc win10 with two accounts?

    CCan I use iCloud separate for Windows accounts on a pc win10 with two accounts?

    You can, but it will be a bit heavy on your part, juggling two accounts, because you will have to a connection, and then connect to another, etc.

  • variable with two digits after the point

    Hi all

    How can I specify variable to work with two numbers (one, three) after the point?

    e.q.

    Set one to 3.14159265358 like (lack of knowledge here)

    return a

    3.14 returned must

    It is a two-step process:

    Set A to 3.14159265358

    Set A (round (A * 100)) / 100

    The 100 can be changed as needed.

    (144176)

  • How I find myself with two passwords to iCloud for the same account?

    How I find myself with two passwords to iCloud for the same account?

    For security reasons, I only use iCloud for Contacts and "find my iPhone".

    Several months ago Apple forced me to change my password to iCloud.  So I did this.   In the last months, I used successfully the new password to 10 or 12 times when asked without problem.

    However, I received a notification of a software update for my Apple Watch. I did the update without problem. However, after completing the update my iPhone asked me to connect to my iCloud account. When I did this, she rejected my password. I made 4 attempts typing very slowly and with care for you sure I did it right.

    Then, operating under a hunch, I decided to enter my old password to iCloud. It worked?  I'm confused about this, any ideas would be appreciated.

    I had a similar problem last year. I had to call Apple. Contact is a bottom of this page.

  • Using a remote control or the remote with two Apple TV app?

    1 can a remote AppleTV, is the most recent or a last generation we use with two different AppleTV (one is the most recent and is the older generation)?

    2. an iPhone Remote APP can be used with two different Apple TV?

    Thank you.

    1 not easily. There is no way to select the device to control, you end up control both. You could get a programmable remote control and lead to control different devices, but this would require a deception.

    2. no doubt. The Remote app offers a grid of all ATVS, he knows, and you choose the one to control. It has the advantage of a keyboard for searches, passwords, etc. Do you need a remote pair with each ATV.

Maybe you are looking for