Suture techniques have been used to close open wounds for more than 5,000 years.[@R1] Suturing can induce primary and spontaneous wound healing by approximating the wound edges generally with a needle and a thread. Despite significant advances in medical technologies including surgical techniques, suturing materials, and perioperative managements, unhealed wounds including dehiscence are still critical issues. In recent decades, the incidence of abdominal wound dehiscence and mortality associated with it have not been improved.[@R2] Wound dehiscence can occur in any surgery, but its occurrence following open-heart operation or spinal implant surgery is particularly devastating. Also, abdominal, chest, and extremity wounds after bone surgery have high incidence rate of wound dehiscence and mortality related to it.[@R2]--[@R5]

Negative pressure wound therapy (NPWT) is a dressing technique used globally for treating mainly open wounds by expediting the healing rate as a secondary intention. The mechanism is to promote angiogenesis, increase perfusion, and reduce edema.[@R6]--[@R8] Using this mechanism to improve healing in closed incisional wounds, whether from clean surgery or trauma, has shown to be clinically effective by reducing infection and other related complications.[@R9]--[@R12] However, detailed explanation of the possible mechanism or physiology behind this approach has been lacking. Thus, we designed an animal study aimed to test the use of NPWT over incisional wounds with dead space and to provide further evidence for this approach.

MATERIALS AND METHODS
=====================

Animal Model
------------

Six Yorkshire pigs (XP Bio, Seoul, Korea) weighing 20 to 22 kg were used after approval of the animal protocols of Asan Medical Center Animal Care Committee (approval document 2011-11-129). All animals were acclimated for 1 week before surgery, kept in isolated cages at room temperature (28.5°C), and fed with commercial food. Before anesthesia, the pigs were fasted for at least 12 hours. Anesthesia began by intramuscular injection of atropine 0.1 mg/kg, Zoletil 50 (tiletamine/zolazepam; Virbac, France) 0.1 mL/kg, and Rompun (xylazine; Bayer Korea, Korea) 2.2 mg/kg followed by inhalation of enflurane 2 to 5 volume percent by an orotracheal tube.

The back and posterior neck of the animals were prepared for surgery. In prone position, 2 symmetrical areas (left and right) with 6-cm distance in between were designed over the back. One side was designated as control group where gauze dressing was used and the other as experimental group where NPWT was applied. A 25-cm incision was made on each area of the loin bilaterally and the loin and shoulder muscles beneath the incision were excised to create the dead space between the rib cage and vertebra (Fig. [1](#F1){ref-type="fig"}). The average weight of the excised muscle was 259 g \[standard deviation (SD) = 47.8\] for the experimental group and 266 g (SD = 33.1) for the control group without statistical significance between the two. After bleeding control with a bipolar coagulator, a closed suction drain (Sewoon Medical, Cheonan, Korea) was placed on each wound. The skin was closed with 3-0 nylon (Ailee, Busan, Korea) in a vertical mattress technique every centimeter resulting in 24 stitches for each site. The animal was free to move in the cage after the procedures. All animals were euthanized on day 21 after harvesting the tissue samples and observation of the wound.

![Gross appearance of the swine's back after the operation. The wounds were closed with a nylon 3-0 vertical mattress suture. Note that there is an underlying dead space beneath the repaired skin.](spa-76-717-g001){#F1}

Device Application and Wound Dressing
-------------------------------------

The experimental group was treated with CuraVAC (Daewoong Pharmaceutical, Co., Ltd., Seoul, Korea) according to the manufacturer's instruction. A sponge foam (CuraVAC) of 25 × 5 cm and 3 cm thickness was applied over the closed incisional wound. Then a suction head was placed over the foam and covered together with an adhesive film drape (Daewoong) with a 3-cm border not crossing the midline. The suction head was connected to a tube from a portable negative pressure device (Curasys; Daewoong). A cyclic negative pressure oscillating between −50 and −125 mm Hg was applied.[@R8],[@R13] The NPWT was changed on the fourth day and reapplied for three more days. After the 7-day application, the wound was dressed with gauze for the remaining 2 weeks. In the control group, the wound was dressed with packed gauzes after applying ointment and petroleum jelly gauze. After dressing both sides, an elastic bandage (Peha-haft; Hartmann AG, Heidenheim, Germany) was applied with its original tension.

Visual Analysis
---------------

Condition of the dressing and the amount discharge through the closed suction drain and the canister from the NPWT device were monitored every 24 hours until removal. Wound characteristics including hematoma or fluid collection were observed on days 4, 7, 14, and 21.

Drainage Through Closed Suction Drain and NPWT Canister
-------------------------------------------------------

Volume and quality of drainage through the suction drain and the canister from the NPWT device was checked daily. Monitoring was continued until the drainage amount reduced to less than 5 mL per day.

Blood Flow Evaluation
---------------------

Skin perfusion was measured using a PeriScan PIM 3 System with 785 nm, 70 mW laser (Perimed AB, Stockholm, Sweden) at the following time points: before the operation; right after the operation; and on postoperative days 4, 7, and 21. The laser Doppler imaging system calculates blood perfusion as perfusion unit by counting the number, density, and speed of blood cells. The animals were sedated and anesthetized during evaluation. The animals were placed on standard prone position and room temperature (23.5--25°C), and the surface blood flow for a marked 3 × 3 cm on the middle of the incision wound was measured.

Histological Assessments
------------------------

Histological examinations were performed at days 7 and 21. A full-thickness skin section with a size of 1 × 2 cm was symmetrically harvested from both incision sites. After initial processing, the fresh tissue specimens were embedded in paraffin and sectioned with 5-μm thickness. The sections were deparaffinized in xylene, rehydrated, and subjected to standard hematoxylin and eosin (H&E) staining, Masson's trichrome staining, or CD31 antibody staining. Pathologist in a single blinded evaluation reviewed the specimens.

Tensile Strength
----------------

On postoperative days 7 and 21, a full-thickness section including both fatty layer with a size of 5 × 1 cm was excised for the tensile strength test. The incision was located in the center of the specimen. The long axis of the harvested skin was perpendicular to the incision line. After removing the stitches, the specimen was wrapped in foil and stored at 4°C for 3 hours. The skin strips underwent a standard tensile strength test using a DTU-900 MH tensiometer (Daekyung Tech, Incheon, Korea) at room temperature. The technician performed a single blinded evaluation.

Statistical Analysis
--------------------

The data regarding gross and histological observations were not statistically analyzed because of the descriptive nature of the data. All quantified values were represented as mean ± SD. The average blood perfusion of the surgical wound, drainage amount, and tensile strength were compared between the 2 groups using the Wilcoxon signed-rank test. The tensile strength (N) was analyzed using the linear mixed model. Values of *P* less than 0.05 were considered statistically significant.

RESULTS
=======

Gross Morphology
----------------

There were no apparent infections or instances of wound dehiscence in both groups. A minor blood clotting was observed on the margin of the sutured incisions in one wound of the control group (Fig. [2](#F2){ref-type="fig"}). There was no difference in color or skin texture between the 2 groups.

![Gross appearance at day 4. A small amount of blood clot is seen at the margin of the sutured incision of the control group (right side).](spa-76-717-g002){#F2}

Drainage Through Closed Suction Drain and NPWT Canister
-------------------------------------------------------

The closed suction drain was removed when the amount of drainage was less than 5 mL per day. Average time taken to remove the closed suction drainage was 3.0 days (SD = 1.095) for the experimental group and 3.3 days (SD = 1.033) for the control group. There was no significant difference between the groups (*P* = 0.317). However, the total drainage amount was 49.8 mL (SD = 35.7) in the experimental group and 86.2 mL (SD = 40.81) in the control group revealing statistical significance (*P* = 0.046) (Fig. [3](#F3){ref-type="fig"}). There was no fluid collected in NPWT canister and the tube. On day 7, while collecting tissue samples, one wound from the control group had collection of hematoma (10 mL) underneath the incision.

![Averaged total drainage through the suction drain from each group. The values of the experimental group and the control group were 49.8 mL (SD = 35.7) and 86.2 mL (SD = 40.81), respectively. Significantly less amount of drainage was collected from the experimental group (*P* = 0.046).](spa-76-717-g003){#F3}

Perfusion Analysis
------------------

There was no significant difference between the 2 groups in perfusion level measured before and immediately after the operation (data not shown). On postoperative days 4, 7, and 21, the experimental group showed significantly higher levels of perfusion unit compared to the control group (*P* = 0.0175) (Table [1](#T1){ref-type="table"} and Fig. [4](#F4){ref-type="fig"}).

######

Average Value of Skin Perfusion

![](spa-76-717-g004)

![Images of surface perfusion unit of the experimental group (left) and the control group (right). Red color represents the areas with high perfusion unit and black color indicates the parts with less perfusion. The images of skin perfusion scan was taken immediately after the operation (above), postoperative day 4 (center), and postoperative day 7 (below).](spa-76-717-g005){#F4}

Histological Assessments
------------------------

H&E-stained specimens were observed by light microscopy for assessment of inflammatory and regenerative properties including tissue congestion, neutrophil infiltration, granulation tissue formation, and neovascularization. The collagen and collagen fibers were observed through Masson's trichrome staining. At day 7, inflammatory responses were evaluated by monitoring intravascular engorgement, perivascular leakage of red blood cells, and leakage of neutrophils and lymphocytes. The experimental group showed increased findings for inflammation and tissue regeneration compared to the control group (Fig. [5](#F5){ref-type="fig"}A). At day 21, the inflammatory cells disappeared and number of collagen fibers was increased (Fig. [6](#F6){ref-type="fig"}). The experimental group showed denser collagen fibers compared to the control group. The incision site of the experimental group was hard to distinguish from the surrounding area. On day 21, the experimental group showed increased CD31 antibody staining, suggesting higher level of newly formed vessels within the scar tissue compared to the control group (Fig. [7](#F7){ref-type="fig"}).

![Histological staining results of the experimental group (A) and the control group (B) on postoperative day 7. H&E staining of the experimental group shows inflammatory response, such as intravascular engorgement and leakage of neutrophils and lymphocyte, between the fibroblast and collagen fibers with tissue edema (original magnification ×200). Masson's trichrome staining of the experimental group (C) shows denser presentation of collagens compared to the control group (D) (original magnification ×200).](spa-76-717-g006){#F5}

![Histological staining results of the experimental group (left) and the control group (right) on Postoperative day 21. H&E and the Masson's trichrome staining the of the experimental group shows a dense and compact appearance compared to the control group. Also, note the pale and loose incision line of the control group. H&E staining---A and B: original magnification ×40; C and D: original magnification ×100. Masson's trichrome staining---E and F: original magnification ×200.](spa-76-717-g007){#F6}

![CD31 antibody staining of the experimental group on postoperative day 21 (original magnification ×100). Several newly formed vessels (arrow) were shown at the incision margin within collagen fibers in the experimental group.](spa-76-717-g008){#F7}

Tensile Strength
----------------

During the break-load test, the peak stress at the point of breakage of the incision site was interpreted as a tensile strength. The tensile strengths of the experimental and control groups are presented in Table [2](#T2){ref-type="table"}. In both groups, the tensile strength steadily increased on day 21 compared to day 7. When comparing between the groups, the experimental group represented significantly greater tensile strength than the control group on both days 7 and 21 (*P* = 0.02). The specimen with the hematoma from the control group showed the lowest strength level (7.056 N). Thickness of excised tissue ranged from 6.3 to 7.8 mm by digital vernier caliper. There were no relevance between the use of negative pressure dressing and thickness of the skin and between tensile strength and thickness of excised skin. The animals were relatively thin and had small fatty component under the dermis compare to the thickness of the dermis.

######

Tensile Strength of the Wounds

![](spa-76-717-g009)

DISCUSSION
==========

Despite proper wound closure, certain surgeries or patient conditions are at risk for higher rate of wound breakdown. The orthopedic operations including tibial plateau reduction and pilon and calcaneus fractures are associated with the increased risk of wound dehiscence.[@R10],[@R11] The incidences of sternal wound infection after coronary artery bypass graft and abdominal wound dehiscence involving all layers of abdominal wall are 1% to 10% and 0.2% to 0.6%, respectively.[@R2]--[@R5],[@R14]--[@R20] Besides the surgical causes, there are several local and systemic factors favoring development of wound dehiscence.[@R2]--[@R5],[@R14],[@R15] The risk factors include obesity, diabetes mellitus, smoking, hypertension, congestive heart failure, acute myocardial infarction, use of the internal mammary artery, and poor perfusion.[@R15],[@R17],[@R18],[@R20],[@R21] Furthermore, wound dehiscence following major operations cause significant increase in postoperative cost and hospital stay, directly affecting the patient's life and the quality of life.[@R2]--[@R4],[@R14],[@R15] The effort to minimize wound breakdown in complicated or in clean incision wounds continues and remains to be a challenge.

One option to decrease wound dehiscence after surgical incision in patients with systemic and surgical risk factors can be the clinical use of NPWT. Numerous reports on the clinical use to prevent wound complication and breakdown were shown to be beneficial.[@R10],[@R11],[@R22],[@R23] Although the NPWT was initially developed to accelerate healing of open wounds as a secondary intention by inducing increased blood flow, granulation tissue formation, and re-epithelialization, it was hypothesized that the same mechanism should reduce wound dehiscence when applied to high-risk patients after surgical closure.[@R8],[@R24]--[@R26] Currently, clinical reports have shown decreased incidence of wound dehiscence by reducing hematoma/seroma collection, increasing lymphatic drainage, and decreasing acute infection.[@R9]--[@R11],[@R27],[@R28] To further understand the mechanism of applying NPWT on closed incision, we designed an animal model to mimic the clinical situation. By making a wide dead space and forming a flap-like lesion on the back, we considered that this wound would be similar to a complex wound such as avulsed wound or a post-surgical wound after retraction or elevation of the skin to maximize exposure. Using this model, we evaluated skin perfusion, hematoma/seroma drainage, wound tensile strength, and histology.

The application mode of the NPWT can be various. We chose the cyclic mode as it oscillates between −50 and −125 mm Hg to increase the mechanical stretch and minimize the pressure on the wound.[@R13],[@R29]--[@R31] Among many mechanisms behind the positive effect of NPWT over incision, we first looked at the change in perfusion of the skin after application. The wounds treated with NPWT showed greater perfusion. When measuring, we removed the NPWT foam dressing to focus on the actual change beneath the foam including the incision wound. Although factors regarding physical irritation from the dressing cannot be ruled out when evaluating perfusion, we fixed the dressing to minimize the irritation. There was a significantly increased level of perfusion on the NPWT applied wounds. This tendency is similar with the study by Timmers et al reviewing the result from healthy forearm skin of 10 volunteers.[@R32] These results indicate that the physical stimulation by negative pressure transmits through skin barrier and increases the cutaneous blood flow not only during the application but persists even after removal of the negative pressure. The prolonged increase in blood perfusion is thought to be a result of angiogenesis around the incisional margin. We were able to confirm this phenomenon by observing the increasing tendency of CD31 antibody staining compared to the control group. During the wound healing process, wounds are sensitive to hypoxia. In the early inflammatory phase, neutrophils provide nonspecific immunity to prevent infection and this nonspecific immunity of neutrophils depends on a high content of tissue oxygen.[@R33] Increased angiogenesis may explain the effect of reduced infection in the previous clinical reports.[@R10],[@R11] High oxygen pressure also promotes superoxide availability, which favors increased bacterial killing capacity.[@R34],[@R35] In the proliferative phase, collagen production also requires oxygen.[@R36] Reversely, the increased amount of collagen observed in the experimental group supports the positive role of NPWT to increase the delivery of oxygen by increased angiogenesis. We also measured the thickness of the skin specimen between the groups after the application but did not find any statistical difference despite the increased tendency of collagen formation. Perhaps if we would have taken specimens before the application and shown the difference in thickness after the application, it might have shown different results.

When wound breaks down after repair, it generally happens on 5 to 10 postoperative days, thus early application of NPWT can promote successful healing by increasing tissue perfusion and tissue oxygen pressure. Hence, to simulate the clinical setting, the NPWT was applied for 7 days.

Incisional closures can lead to various complications. Among them, formation of hematoma and seroma can lead to delayed healing and wound dehiscence.[@R37] As shown in one of the wounds from the control group that had hematoma collection, the tensile strength recorded the lowest among all specimens. With low force, this wound may easily lead to breakdown. Consistent with other clinical case series, the use of NPWT significantly reduced the amount of suction drainage and resulted in no subcutaneous hematoma or seroma formation.[@R9],[@R10],[@R23],[@R38] Based on this finding, we assumed that the increased pressure from the application of NPWT effectively compressed the wound to eliminate the dead space underneath the skin. Another assumption was that it acted as a splinting device to minimize sheering over the dead space allowing early vascularization from the wound bed to the skin flap as seen from histology.

NPWT also had the tendency to increase collagen fiber synthesis and significantly increase tensile strength on postoperative days 7 and 21. One interesting observation is early application of NPWT not only leads to statistically higher tensile strength immediately after application but this phenomenon is continued up to 3 weeks. This may allow early ambulation in the clinical setting with decreased risk for dehiscence and stable recovery. Currently, a long-term study is planned to evaluate the effect over closed incision wounds to have a better idea about the final wound tensile strength and the effect on scarring.

The application of NPWT on the closed incision wound with dead space was effectively supported by statistically increased perfusion, tensile strength, and reduced drainage. The observation of increased CD31 and increased collagen synthesis further supports this effect. This animal study provides understanding on the application of NPWT on closed incision wounds and warrants clinical studies to treat high-risk patients prone to wound dehiscence after surgical repair.

Conflicts of interest and sources of funding: The senior author is a consultant to Daewoong Pharmaceutical Company. The NPWT system was a gift from Daewoong Pharmaceutical company for this experiment.


/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.ip;

import static android.net.util.NetworkConstants.IPV6_MIN_MTU;
import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH;
import static android.net.util.TetheringUtils.getAllNodesForScopeId;
import static android.system.OsConstants.AF_INET6;
import static android.system.OsConstants.IPPROTO_ICMPV6;
import static android.system.OsConstants.SOCK_RAW;
import static android.system.OsConstants.SOL_SOCKET;
import static android.system.OsConstants.SO_SNDTIMEO;

import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.TrafficStats;
import android.net.util.InterfaceParams;
import android.net.util.SocketUtils;
import android.net.util.TetheringUtils;
import android.system.ErrnoException;
import android.system.Os;
import android.system.StructTimeval;
import android.util.Log;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.TrafficStatsConstants;

import java.io.FileDescriptor;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Basic IPv6 Router Advertisement Daemon.
 *
 * TODO:
 *
 *     - Rewrite using Handler (and friends) so that AlarmManager can deliver
 *       "kick" messages when it's time to send a multicast RA.
 *
 * @hide
 */
public class RouterAdvertisementDaemon {
    private static final String TAG = RouterAdvertisementDaemon.class.getSimpleName();
    private static final byte ICMPV6_ND_ROUTER_SOLICIT = asByte(133);
    private static final byte ICMPV6_ND_ROUTER_ADVERT  = asByte(134);
    private static final int MIN_RA_HEADER_SIZE = 16;

    // Summary of various timers and lifetimes.
    private static final int MIN_RTR_ADV_INTERVAL_SEC = 300;
    private static final int MAX_RTR_ADV_INTERVAL_SEC = 600;
    // In general, router, prefix, and DNS lifetimes are all advised to be
    // greater than or equal to 3 * MAX_RTR_ADV_INTERVAL.  Here, we double
    // that to allow for multicast packet loss.
    //
    // This MAX_RTR_ADV_INTERVAL_SEC and DEFAULT_LIFETIME are also consistent
    // with the https://tools.ietf.org/html/rfc7772#section-4 discussion of
    // "approximately 7 RAs per hour".
    private static final int DEFAULT_LIFETIME = 6 * MAX_RTR_ADV_INTERVAL_SEC;
    // From https://tools.ietf.org/html/rfc4861#section-10 .
    private static final int MIN_DELAY_BETWEEN_RAS_SEC = 3;
    // Both initial and final RAs, but also for changes in RA contents.
    // From https://tools.ietf.org/html/rfc4861#section-10 .
    private static final int  MAX_URGENT_RTR_ADVERTISEMENTS = 5;

    private static final int DAY_IN_SECONDS = 86_400;

    private final InterfaceParams mInterface;
    private final InetSocketAddress mAllNodes;

    // This lock is to protect the RA from being updated while being
    // transmitted on another thread  (multicast or unicast).
    //
    // TODO: This should be handled with a more RCU-like approach.
    private final Object mLock = new Object();
    @GuardedBy("mLock")
    private final byte[] mRA = new byte[IPV6_MIN_MTU];
    @GuardedBy("mLock")
    private int mRaLength;
    @GuardedBy("mLock")
    private final DeprecatedInfoTracker mDeprecatedInfoTracker;
    @GuardedBy("mLock")
    private RaParams mRaParams;

    private volatile FileDescriptor mSocket;
    private volatile MulticastTransmitter mMulticastTransmitter;
    private volatile UnicastResponder mUnicastResponder;

    /** Encapsulate the RA parameters for RouterAdvertisementDaemon.*/
    public static class RaParams {
        // Tethered traffic will have the hop limit properly decremented.
        // Consequently, set the hoplimit greater by one than the upstream
        // unicast hop limit.
        //
        // TODO: Dynamically pass down the IPV6_UNICAST_HOPS value from the
        // upstream interface for more correct behaviour.
        static final byte DEFAULT_HOPLIMIT = 65;

        public boolean hasDefaultRoute;
        public byte hopLimit;
        public int mtu;
        public HashSet<IpPrefix> prefixes;
        public HashSet<Inet6Address> dnses;

        public RaParams() {
            hasDefaultRoute = false;
            hopLimit = DEFAULT_HOPLIMIT;
            mtu = IPV6_MIN_MTU;
            prefixes = new HashSet<IpPrefix>();
            dnses = new HashSet<Inet6Address>();
        }

        public RaParams(RaParams other) {
            hasDefaultRoute = other.hasDefaultRoute;
            hopLimit = other.hopLimit;
            mtu = other.mtu;
            prefixes = (HashSet) other.prefixes.clone();
            dnses = (HashSet) other.dnses.clone();
        }

        /**
         * Returns the subset of RA parameters that become deprecated when
         * moving from announcing oldRa to announcing newRa.
         *
         * Currently only tracks differences in |prefixes| and |dnses|.
         */
        public static RaParams getDeprecatedRaParams(RaParams oldRa, RaParams newRa) {
            RaParams newlyDeprecated = new RaParams();

            if (oldRa != null) {
                for (IpPrefix ipp : oldRa.prefixes) {
                    if (newRa == null || !newRa.prefixes.contains(ipp)) {
                        newlyDeprecated.prefixes.add(ipp);
                    }
                }

                for (Inet6Address dns : oldRa.dnses) {
                    if (newRa == null || !newRa.dnses.contains(dns)) {
                        newlyDeprecated.dnses.add(dns);
                    }
                }
            }

            return newlyDeprecated;
        }
    }

    private static class DeprecatedInfoTracker {
        private final HashMap<IpPrefix, Integer> mPrefixes = new HashMap<>();
        private final HashMap<Inet6Address, Integer> mDnses = new HashMap<>();

        Set<IpPrefix> getPrefixes() {
            return mPrefixes.keySet();
        }

        void putPrefixes(Set<IpPrefix> prefixes) {
            for (IpPrefix ipp : prefixes) {
                mPrefixes.put(ipp, MAX_URGENT_RTR_ADVERTISEMENTS);
            }
        }

        void removePrefixes(Set<IpPrefix> prefixes) {
            for (IpPrefix ipp : prefixes) {
                mPrefixes.remove(ipp);
            }
        }

        Set<Inet6Address> getDnses() {
            return mDnses.keySet();
        }

        void putDnses(Set<Inet6Address> dnses) {
            for (Inet6Address dns : dnses) {
                mDnses.put(dns, MAX_URGENT_RTR_ADVERTISEMENTS);
            }
        }

        void removeDnses(Set<Inet6Address> dnses) {
            for (Inet6Address dns : dnses) {
                mDnses.remove(dns);
            }
        }

        boolean isEmpty() {
            return mPrefixes.isEmpty() && mDnses.isEmpty();
        }

        private boolean decrementCounters() {
            boolean removed = decrementCounter(mPrefixes);
            removed |= decrementCounter(mDnses);
            return removed;
        }

        private <T> boolean decrementCounter(HashMap<T, Integer> map) {
            boolean removed = false;

            for (Iterator<Map.Entry<T, Integer>> it = map.entrySet().iterator();
                    it.hasNext();) {
                Map.Entry<T, Integer> kv = it.next();
                if (kv.getValue() == 0) {
                    it.remove();
                    removed = true;
                } else {
                    kv.setValue(kv.getValue() - 1);
                }
            }

            return removed;
        }
    }

    public RouterAdvertisementDaemon(InterfaceParams ifParams) {
        mInterface = ifParams;
        mAllNodes = new InetSocketAddress(getAllNodesForScopeId(mInterface.index), 0);
        mDeprecatedInfoTracker = new DeprecatedInfoTracker();
    }

    /** Build new RA.*/
    public void buildNewRa(RaParams deprecatedParams, RaParams newParams) {
        synchronized (mLock) {
            if (deprecatedParams != null) {
                mDeprecatedInfoTracker.putPrefixes(deprecatedParams.prefixes);
                mDeprecatedInfoTracker.putDnses(deprecatedParams.dnses);
            }

            if (newParams != null) {
                // Process information that is no longer deprecated.
                mDeprecatedInfoTracker.removePrefixes(newParams.prefixes);
                mDeprecatedInfoTracker.removeDnses(newParams.dnses);
            }

            mRaParams = newParams;
            assembleRaLocked();
        }

        maybeNotifyMulticastTransmitter();
    }

    /** Start router advertisement daemon. */
    public boolean start() {
        if (!createSocket()) {
            return false;
        }

        mMulticastTransmitter = new MulticastTransmitter();
        mMulticastTransmitter.start();

        mUnicastResponder = new UnicastResponder();
        mUnicastResponder.start();

        return true;
    }

    /** Stop router advertisement daemon. */
    public void stop() {
        closeSocket();
        // Wake up mMulticastTransmitter thread to interrupt a potential 1 day sleep before
        // the thread's termination.
        maybeNotifyMulticastTransmitter();
        mMulticastTransmitter = null;
        mUnicastResponder = null;
    }

    @GuardedBy("mLock")
    private void assembleRaLocked() {
        final ByteBuffer ra = ByteBuffer.wrap(mRA);
        ra.order(ByteOrder.BIG_ENDIAN);

        final boolean haveRaParams = (mRaParams != null);
        boolean shouldSendRA = false;

        try {
            putHeader(ra, haveRaParams && mRaParams.hasDefaultRoute,
                    haveRaParams ? mRaParams.hopLimit : RaParams.DEFAULT_HOPLIMIT);
            putSlla(ra, mInterface.macAddr.toByteArray());
            mRaLength = ra.position();

            // https://tools.ietf.org/html/rfc5175#section-4 says:
            //
            //     "MUST NOT be added to a Router Advertisement message
            //      if no flags in the option are set."
            //
            // putExpandedFlagsOption(ra);

            if (haveRaParams) {
                putMtu(ra, mRaParams.mtu);
                mRaLength = ra.position();

                for (IpPrefix ipp : mRaParams.prefixes) {
                    putPio(ra, ipp, DEFAULT_LIFETIME, DEFAULT_LIFETIME);
                    mRaLength = ra.position();
                    shouldSendRA = true;
                }

                if (mRaParams.dnses.size() > 0) {
                    putRdnss(ra, mRaParams.dnses, DEFAULT_LIFETIME);
                    mRaLength = ra.position();
                    shouldSendRA = true;
                }
            }

            for (IpPrefix ipp : mDeprecatedInfoTracker.getPrefixes()) {
                putPio(ra, ipp, 0, 0);
                mRaLength = ra.position();
                shouldSendRA = true;
            }

            final Set<Inet6Address> deprecatedDnses = mDeprecatedInfoTracker.getDnses();
            if (!deprecatedDnses.isEmpty()) {
                putRdnss(ra, deprecatedDnses, 0);
                mRaLength = ra.position();
                shouldSendRA = true;
            }
        } catch (BufferOverflowException e) {
            // The packet up to mRaLength  is valid, since it has been updated
            // progressively as the RA was built. Log an error, and continue
            // on as best as possible.
            Log.e(TAG, "Could not construct new RA: " + e);
        }

        // We have nothing worth announcing; indicate as much to maybeSendRA().
        if (!shouldSendRA) {
            mRaLength = 0;
        }
    }

    private void maybeNotifyMulticastTransmitter() {
        final MulticastTransmitter m = mMulticastTransmitter;
        if (m != null) {
            m.hup();
        }
    }

    private static byte asByte(int value) {
        return (byte) value;
    }
    private static short asShort(int value) {
        return (short) value;
    }

    private static void putHeader(ByteBuffer ra, boolean hasDefaultRoute, byte hopLimit) {
        /**
            Router Advertisement Message Format

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |     Code      |          Checksum             |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            | Cur Hop Limit |M|O|H|Prf|P|R|R|       Router Lifetime         |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                         Reachable Time                        |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                          Retrans Timer                        |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |   Options ...
            +-+-+-+-+-+-+-+-+-+-+-+-
        */
        ra.put(ICMPV6_ND_ROUTER_ADVERT)
                .put(asByte(0))
                .putShort(asShort(0))
                .put(hopLimit)
                // RFC 4191 "high" preference, iff. advertising a default route.
                .put(hasDefaultRoute ? asByte(0x08) : asByte(0))
                .putShort(hasDefaultRoute ? asShort(DEFAULT_LIFETIME) : asShort(0))
                .putInt(0)
                .putInt(0);
    }

    private static void putSlla(ByteBuffer ra, byte[] slla) {
        /**
            Source/Target Link-layer Address

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |    Length     |    Link-Layer Address ...
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        */
        if (slla == null || slla.length != 6) {
            // Only IEEE 802.3 6-byte addresses are supported.
            return;
        }

        final byte nd_option_slla = 1;
        final byte slla_num_8octets = 1;
        ra.put(nd_option_slla)
            .put(slla_num_8octets)
            .put(slla);
    }

    private static void putExpandedFlagsOption(ByteBuffer ra) {
        /**
            Router Advertisement Expanded Flags Option

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |    Length     |         Bit fields available ..
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ... for assignment                                              |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */

        final byte nd_option__efo = 26;
        final byte efo_num_8octets = 1;

        ra.put(nd_option__efo)
            .put(efo_num_8octets)
            .putShort(asShort(0))
            .putInt(0);
    }

    private static void putMtu(ByteBuffer ra, int mtu) {
        /**
            MTU

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |    Length     |           Reserved            |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                              MTU                              |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        */
        final byte nd_option_mtu = 5;
        final byte mtu_num_8octs = 1;
        ra.put(nd_option_mtu)
            .put(mtu_num_8octs)
            .putShort(asShort(0))
            .putInt((mtu < IPV6_MIN_MTU) ? IPV6_MIN_MTU : mtu);
    }

    private static void putPio(ByteBuffer ra, IpPrefix ipp,
                               int validTime, int preferredTime) {
        /**
            Prefix Information

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |    Length     | Prefix Length |L|A| Reserved1 |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                         Valid Lifetime                        |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                       Preferred Lifetime                      |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                           Reserved2                           |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                                                               |
            +                                                               +
            |                                                               |
            +                            Prefix                             +
            |                                                               |
            +                                                               +
            |                                                               |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        */
        final int prefixLength = ipp.getPrefixLength();
        if (prefixLength != 64) {
            return;
        }
        final byte nd_option_pio = 3;
        final byte pio_num_8octets = 4;

        if (validTime < 0) validTime = 0;
        if (preferredTime < 0) preferredTime = 0;
        if (preferredTime > validTime) preferredTime = validTime;

        final byte[] addr = ipp.getAddress().getAddress();
        ra.put(nd_option_pio)
            .put(pio_num_8octets)
            .put(asByte(prefixLength))
            .put(asByte(0xc0)) /* L & A set */
            .putInt(validTime)
            .putInt(preferredTime)
            .putInt(0)
            .put(addr);
    }

    private static void putRio(ByteBuffer ra, IpPrefix ipp) {
        /**
            Route Information Option

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |    Length     | Prefix Length |Resvd|Prf|Resvd|
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                        Route Lifetime                         |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                   Prefix (Variable Length)                    |
            .                                                               .
            .                                                               .
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */
        final int prefixLength = ipp.getPrefixLength();
        if (prefixLength > 64) {
            return;
        }
        final byte nd_option_rio = 24;
        final byte rio_num_8octets = asByte(
                (prefixLength == 0) ? 1 : (prefixLength <= 8) ? 2 : 3);

        final byte[] addr = ipp.getAddress().getAddress();
        ra.put(nd_option_rio)
            .put(rio_num_8octets)
            .put(asByte(prefixLength))
            .put(asByte(0x18))
            .putInt(DEFAULT_LIFETIME);

        // Rely upon an IpPrefix's address being properly zeroed.
        if (prefixLength > 0) {
            ra.put(addr, 0, (prefixLength <= 64) ? 8 : 16);
        }
    }

    private static void putRdnss(ByteBuffer ra, Set<Inet6Address> dnses, int lifetime) {
        /**
            Recursive DNS Server (RDNSS) Option

             0                   1                   2                   3
             0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |     Type      |     Length    |           Reserved            |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                           Lifetime                            |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                                                               |
            :            Addresses of IPv6 Recursive DNS Servers            :
            |                                                               |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */

        final HashSet<Inet6Address> filteredDnses = new HashSet<>();
        for (Inet6Address dns : dnses) {
            if ((new LinkAddress(dns, RFC7421_PREFIX_LENGTH)).isGlobalPreferred()) {
                filteredDnses.add(dns);
            }
        }
        if (filteredDnses.isEmpty()) return;

        final byte nd_option_rdnss = 25;
        final byte rdnss_num_8octets = asByte(dnses.size() * 2 + 1);
        ra.put(nd_option_rdnss)
            .put(rdnss_num_8octets)
            .putShort(asShort(0))
            .putInt(lifetime);

        for (Inet6Address dns : filteredDnses) {
            // NOTE: If the full of list DNS servers doesn't fit in the packet,
            // this code will cause a buffer overflow and the RA won't include
            // this instance of the option at all.
            //
            // TODO: Consider looking at ra.remaining() to determine how many
            // DNS servers will fit, and adding only those.
            ra.put(dns.getAddress());
        }
    }

    private boolean createSocket() {
        final int send_timout_ms = 300;

        final int oldTag = TrafficStats.getAndSetThreadStatsTag(
                TrafficStatsConstants.TAG_SYSTEM_NEIGHBOR);
        try {
            mSocket = Os.socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
            // Setting SNDTIMEO is purely for defensive purposes.
            Os.setsockoptTimeval(
                    mSocket, SOL_SOCKET, SO_SNDTIMEO, StructTimeval.fromMillis(send_timout_ms));
            SocketUtils.bindSocketToInterface(mSocket, mInterface.name);
            TetheringUtils.setupRaSocket(mSocket, mInterface.index);
        } catch (ErrnoException | IOException e) {
            Log.e(TAG, "Failed to create RA daemon socket: " + e);
            return false;
        } finally {
            TrafficStats.setThreadStatsTag(oldTag);
        }

        return true;
    }

    private void closeSocket() {
        if (mSocket != null) {
            try {
                SocketUtils.closeSocket(mSocket);
            } catch (IOException ignored) { }
        }
        mSocket = null;
    }

    private boolean isSocketValid() {
        final FileDescriptor s = mSocket;
        return (s != null) && s.valid();
    }

    private boolean isSuitableDestination(InetSocketAddress dest) {
        if (mAllNodes.equals(dest)) {
            return true;
        }

        final InetAddress destip = dest.getAddress();
        return (destip instanceof Inet6Address)
               && destip.isLinkLocalAddress()
               && (((Inet6Address) destip).getScopeId() == mInterface.index);
    }

    private void maybeSendRA(InetSocketAddress dest) {
        if (dest == null || !isSuitableDestination(dest)) {
            dest = mAllNodes;
        }

        try {
            synchronized (mLock) {
                if (mRaLength < MIN_RA_HEADER_SIZE) {
                    // No actual RA to send.
                    return;
                }
                Os.sendto(mSocket, mRA, 0, mRaLength, 0, dest);
            }
            Log.d(TAG, "RA sendto " + dest.getAddress().getHostAddress());
        } catch (ErrnoException | SocketException e) {
            if (isSocketValid()) {
                Log.e(TAG, "sendto error: " + e);
            }
        }
    }

    private final class UnicastResponder extends Thread {
        private final InetSocketAddress mSolicitor = new InetSocketAddress(0);
        // The recycled buffer for receiving Router Solicitations from clients.
        // If the RS is larger than IPV6_MIN_MTU the packets are truncated.
        // This is fine since currently only byte 0 is examined anyway.
        private final byte[] mSolicitation = new byte[IPV6_MIN_MTU];

        @Override
        public void run() {
            while (isSocketValid()) {
                try {
                    // Blocking receive.
                    final int rval = Os.recvfrom(
                            mSocket, mSolicitation, 0, mSolicitation.length, 0, mSolicitor);
                    // Do the least possible amount of validation.
                    if (rval < 1 || mSolicitation[0] != ICMPV6_ND_ROUTER_SOLICIT) {
                        continue;
                    }
                } catch (ErrnoException | SocketException e) {
                    if (isSocketValid()) {
                        Log.e(TAG, "recvfrom error: " + e);
                    }
                    continue;
                }

                maybeSendRA(mSolicitor);
            }
        }
    }

    // TODO: Consider moving this to run on a provided Looper as a Handler,
    // with WakeupMessage-style messages providing the timer driven input.
    private final class MulticastTransmitter extends Thread {
        private final Random mRandom = new Random();
        private final AtomicInteger mUrgentAnnouncements = new AtomicInteger(0);

        @Override
        public void run() {
            while (isSocketValid()) {
                try {
                    Thread.sleep(getNextMulticastTransmitDelayMs());
                } catch (InterruptedException ignored) {
                    // Stop sleeping, immediately send an RA, and continue.
                }

                maybeSendRA(mAllNodes);
                synchronized (mLock) {
                    if (mDeprecatedInfoTracker.decrementCounters()) {
                        // At least one deprecated PIO has been removed;
                        // reassemble the RA.
                        assembleRaLocked();
                    }
                }
            }
        }

        public void hup() {
            // Set to one fewer that the desired number, because as soon as
            // the thread interrupt is processed we immediately send an RA
            // and mUrgentAnnouncements is not examined until the subsequent
            // sleep interval computation (i.e. this way we send 3 and not 4).
            mUrgentAnnouncements.set(MAX_URGENT_RTR_ADVERTISEMENTS - 1);
            interrupt();
        }

        private int getNextMulticastTransmitDelaySec() {
            boolean deprecationInProgress = false;
            synchronized (mLock) {
                if (mRaLength < MIN_RA_HEADER_SIZE) {
                    // No actual RA to send; just sleep for 1 day.
                    return DAY_IN_SECONDS;
                }
                deprecationInProgress = !mDeprecatedInfoTracker.isEmpty();
            }

            final int urgentPending = mUrgentAnnouncements.getAndDecrement();
            if ((urgentPending > 0) || deprecationInProgress) {
                return MIN_DELAY_BETWEEN_RAS_SEC;
            }

            return MIN_RTR_ADV_INTERVAL_SEC + mRandom.nextInt(
                    MAX_RTR_ADV_INTERVAL_SEC - MIN_RTR_ADV_INTERVAL_SEC);
        }

        private long getNextMulticastTransmitDelayMs() {
            return 1000 * (long) getNextMulticastTransmitDelaySec();
        }
    }
}


Q:

Assigning values to attributes in the BUILD phaser for an object

When a BUILD phaser is called, it overrides default attribute assignment in Perl6. Suppose we have to use that BUILD phaser, like we do in this module (that's where I met this problem). What's the way of assigning values to attributes in that phase?
I have used this
class my-class {
    has $.dash-attribute;

    submethod BUILD(*%args) {
        for %args.kv -> $k, $value {
            self."$k"( $value );
        }
    }
};

my $my-instance = my-class.new( dash-attribute => 'This is the attribute' );

And I get this error
Too many positionals passed; expected 1 argument but got 2

Other combinations of $!or $., direct assignment, declaring the attribute as rw (same error) yield different kind of errors. This is probably just a syntax issue, but I couldn't find the solution. Any help will be appreciated.

A:

There are two things wrong in your example, the way I see it.  First of all, if you want an attribute to be writeable, you will need to mark it is rw.  Secondly, changing the value of an attribute is done by assignment, rather than by giving the new value as an argument.
So I think the code should be:
class my-class {
    has $.dash-attribute is rw;

    submethod BUILD(*%args) {
        for %args.kv -> $k, $value {
            self."$k"() = $value;
        }
    }
};

my $my-instance = my-class.new( dash-attribute => 'attribute value' );
dd $my-instance;
# my-class $my-instance = my-class.new(dash-attribute => "attribute value")

A:

You could do it the same way the object system normally does it under the hood for you.
(not recommended)
class C {
  has $.d;

  submethod BUILD ( *%args ){
    for self.^attributes {
      my $short-name = .name.substr(2); # remove leading ｢$!｣
      next unless %args{$short-name}:exists;
      .set_value( self, %args{$short-name} )
    }
  }
}

say C.new(d => 42)

C.new(d => 42)


Tomato yellow leaf curl virus: a whitefly-transmitted geminivirus with a single genomic component.
The genome of the tomato yellow leaf curl virus (TYLCV), a Bemisia tabaci-transmitted geminivirus, was cloned. All clones obtained were of one genomic molecule, analogous to DNA A of African cassava mosaic virus. Nucleotide sequence analysis of the TYLCV genome showed that it comprises 2787 nucleotides, encoding six open reading frames, two on the virion strand and four on the complementary strand. All of them have counterparts in other geminiviruses. Dimeric copies of the cloned viral genome were introduced into tomato plants by agroinoculation. Severe yellow leaf curl disease symptoms developed in all of them. Effective whitefly-mediated transmission of the virus from agroinoculated plants to test plants demonstrated that the cloned molecule carries all the information needed for virus replication, systemic infection, and transfer by whiteflies. Restriction and hybridization analyses of viral DNA forms in infected plants and viruliferous whiteflies did not support the presupposed existence of a second genomic component. This is the first report of a whitefly-transmitted geminivirus that possesses a single genomic molecule.


Capillary electrophoresis-based heteroduplex analysis with a universal heteroduplex generator for detection of point mutations associated with rifampin resistance in tuberculosis.
Slab gel heteroduplex analysis (HDA), a popular scanning method for genetic mutations, uses DNA fragments typically generated by PCR to create homo- and heteroduplex molecules with conformational differences and sequence-dependent electrophoretic profiles. Use of a universal heteroduplex generator (UHG) enhances the subtle variations caused by single-base substitutions. The HDA-UHG slab gel format was modified for an efficient capillary-based method. The effect of staining dyes TOPRO5 and YOPRO1 on the analysis of heteroduplexes was studied, as well as ultraviolet absorbance and laser-induced fluorescence (LIF) detection methods. In addition, the entangled polymers hydroxyethyl cellulose, methyl cellulose, and linear polyacrylamide were evaluated as separation matrices. This assay was able to detect the presence of Mycobacterium tuberculosis and its rifampin susceptibility directly from clinical specimens in dramatically reduced analysis time (30 min vs 2.5 h). Optimized conditions included 0.3% methyl cellulose as the separation matrix, on-line staining using 1 micromol/L YOPRO1, and LIF detection for quantitative and reproducible analysis of single-base substitutions in the rifampin resistance-determining region of rpoB that give rise to the rifampin-resistant phenotype of M. tuberculosis. We generated 95% confidence limits using the wild-type sequence and used these limits to determine rifampin susceptibility in samples. Capillary electrophoresis, combined with the HDA-UHG technique, may be of value for rapid and efficient clinical diagnosis of rifampin-resistant tuberculosis strains.


Gift Certificates

Photo Greeting Cards

Any photograph in my collection can be ordered as 5×7 photocards with an original 4×6 print suitable for framing. They are available with a blank inside or can be custom designed with your contact information, logo, etc. Cards are $3.50 each or $2.75 each for orders of six or more. There is a 200 card minimum for custom designed cards. Some of my clients order custom cards and select a range of photographs for different occasions.

I have used Kathy’s cards for years. To a person, they tell me how delighted they are to receive cards with her amazing photos. I especially love that I can select any photo in her collection to fit the occasion. I also turn pictures from her calendars into postcards and have framed some of them. So have my friends!


Doris Matthews

Pianist Doris Matthews is a graduate of UCSB and was a public school music teacher. Upon retirement, she decided to pursue a lifelong love of the piano and now presents recitals in North County venues. She will perform music of the Romantic period by Chopin and Schubert, plus a rarely heard Sonata by Edvard Grieg.


india

Updated: Apr 11, 2019 23:11 IST

A comment by Bharatiya Janata Party (BJP) president Amit Shah that one cannot make out whether Wayanad is in India or Pakistan triggered a controversy in Kerala with the ruling Left Democratic Front (LDF) seeking action against him by the Election Commission (EC) for creating communal divisions.

At a rally in Nagpur on Wednesday, Shah said: “When a procession is taken out there, it is difficult to make out whether it is India or Pakistan,” Shah said.

Shah was referring to the green flags of the Indian Union Muslim League (IUML), a Congress ally in Kerala’s United Democratic Front. Some social media users had mistaken the flag to be Pakistan’s national flag.

Slamming Shah’s speech, Kerala chief minister Pinarayi Vijayan said, “He insulted the people of Kerala and Wayanad. Wayanad has a glorious past.”

LDF’s Wayanad constituency convener C K Sasindran submitted a complaint to the state chief electoral officer and the chief election commissioner on Thursday, seeking action against

Shah.

“He has divided people on communal lines and tried to create animosity between different religions. It is part of a hate campaign and against the poll code of conduct,” the petition said.


---
abstract: 'We show the pulse matching phenomenon can be obtained in the general multi-level system with electromagnetically induced transparency (EIT). For this we find a novel way to create tightly localized stationary pulses by using counter-propagating pump fields. The present process is a spatial compression of excitation so that it allows us to shape and further intensify the localized stationary pulses, without using standing waves of pump fields or spatially modulated pump fields.'
author:
- 'Xiong-Jun Liu$^{a}$[^1], Xin Liu$^{b}$, Zheng-Xin Liu$^{c}$, L. C. Kwek$^{a,d}$ and C. H. Oh$^{a}$[^2]'
title: '**Tightly Localized Stationary Pulses in Multi-Level Atomic System**'
---

Recently, an important progress in electromagnetically induced transparency (EIT) [@EIT; @exp1; @6; @exp2; @4; @5; @wu] is that experimental realization for the coherent control of stationary pulses was achieved by using standing waves of pump fields in the three-level system [@nature; @three-level]. The creation of stationary pulses can enhance the nonlinear couplings between photons or collective excitations corresponding to stored photons, both of which are useful for deterministic logic operations. The key point in the creation of stationary pulses is expressed by the pulse matching phenomenon between the forward (FW) and backward (BW) propagating probe fields [@nature; @three-level; @four]. For a three-level system, the technique to generate tightly localized stationary pulses involves the use of standing waves of pump fields with a frequency-comb or spatially modulated pump fields [@three-level]. However, such tight localization is created by a filtering process rather than a compression of excitation. Thus the three-level technique cannot be applied directly to applications in quantum nonlinear optics.

On the other hand, coherent manipulation of probe lights has been studied in the four-level double $\Lambda$-type system [@exp3; @liu] and also in the general multi-level atomic system that interacts with many probe and pump fields [@multi-level; @level2]. It has also been shown in Ref. [@multi-level] that, one can convert different probe lights into each other by manipulating the external pump fields based on such general EIT method, indicating a sort of pulse matching phenomenon between all applied probe fields. This observation also motivates us to probe into a new technique of creating localized stationary pulses based on multi-level atomic system. In this rapid communication, we shall show the tightly localized stationary pulses can be obtained through a spatial compression of excitation the general multi-level EIT system.

![(color online) (a) General $m$-level atomic system coupled to $m-2$ quantized probe and classical pump fields which propagate in $+z$ or $-z$ directions. (b) No. $1$ to No. $m-3$ pump/probe pulses propagate in the $+z$ direction, while No. $m-2$ pump/probe pulse propagates in the $-z$ direction.[]{data-label="1"}](fig1.eps){width="1.0\columnwidth"}

We consider the quasi-one dimensional system shown in Fig. 1(a) for an ensemble of $m$-level atoms interacting with $m-2$ quantized probe fields which couple the transitions from the ground state $|b\rangle$ to excited state $|e_{\sigma}\rangle$ $(1\leq \sigma\leq m-2)$ with coupling constants $g_{\sigma}$, and $m-2$ classical pump fields which couple the transitions from the state $|c\rangle$ to excited ones $|e_{\sigma}\rangle$ with Rabi-frequencies $\Omega_{\sigma}(z,t)$. All probe and pump fields are co-propagating in the $+z$ or $-z$ direction (Fig. 1(b)), and $$\begin{aligned}
\label{eqn:field1}
E_{\sigma}(z,t)&=&\sqrt{\frac{\hbar\nu_{\sigma}}{2\epsilon_0V}}\hat{\cal
E}_{\sigma}(z,t)e^{i(k_{p{\sigma}}z-\nu_{\sigma}t)},\nonumber\\
\\
\Omega_{\sigma}(z,t)&=&\Omega_{\sigma0}e^{i(k_{c{\sigma}}z-\omega_{\sigma}t)}\nonumber\end{aligned}$$ where $\sigma=1,2,...,m-2$, $\hat{\cal E}_{\sigma}$ and $\Omega_{{\sigma}0}$ are slowly-varying amplitudes, $k_{p{\sigma}}$ and $k_{c{\sigma}}$, respectively $z$-component wave vectors of probe and pump fields, can be positive or negative. For $k_{p{\sigma}}>0$ and $k_{c{\sigma}}>0$ ($k_{p{\sigma}}<0$ and $k_{c{\sigma}}<0$), it means the ${\sigma}$th pair of probe and pump fields propagate in the $+z$ ($-z$) direction. We consider all transitions to be at resonance. Under the rotating-wave approximation, the interaction Hamiltonian can be written as: $$\begin{aligned}
\label{eqn:H1}
\hat{\mathcal V}&=&-\int\frac{dz}{L}\bigr(\hbar
N\sum_{\sigma=1}^{m-2}
g_\sigma\widetilde\sigma_{e_{\sigma}b}(z,t)\hat {\cal
E}_\sigma(z,t)+\nonumber\\
&&+\hbar N\sum_{\sigma=1}^{m-2}\Omega_{\sigma0}(t)
\widetilde\sigma_{e_{\sigma}c}(z,t)+h.c.\bigr),\end{aligned}$$ where $N$ is the total atom number, $L$ is the length of the medium in the $z$ direction, and the continuous atomic variables $\widetilde\sigma_{\mu\nu}(z,t) =\frac{1}{N_z}\sum_{z_j\in
N_z}{\hat\sigma}_{\mu\nu}^j(t)$ are defined by a collection of $N_z\gg 1$ atoms in a very small length length interval $\Delta z$ [@6]. $\hat\sigma_{e_{\sigma}b}^j=|e_{\sigma}^j\rangle\langle
b^j| \, {\rm e}^{-i(k_{p{\sigma}}z-\omega_{e_{\sigma}b}t)}$ and $\hat\sigma_{e_{\sigma}c}^j=|e_{\sigma}^j\rangle\langle c^j| \,
{\rm e}^{-i(k_{c{\sigma}}z-\omega_{e_{\sigma}c}t)}$ are the slowly-varying parts of the $j$th atomic flip operator. We note that an essential difference between our model and the three-level case is that for the case of multi-frequency optical pulses, here the one- and two-photon detunings can be avoided for all optical transitions, and no standing waves of pump fields or spatially modulated pump fields are used.

The evolution of the slowly-varying amplitudes $\hat{\cal
E}_\sigma(z,t)$ can be described by the propagation equations $$\begin{aligned}
\label{field equation}
\left(\frac{\partial}{\partial
t}+\frac{\nu_\sigma}{k_{p\sigma}}\frac{\partial}{\partial
z}\right) \hat {\cal E}_\sigma(z,t)= ig_\sigma
N\widetilde\sigma_{be_\sigma}(z,t),\end{aligned}$$ where we note $\nu_\sigma/k_{p\sigma}=\pm c$ for the $\pm z$ directional propagation field. Under the condition of low excitation, i. e. $\widetilde\sigma_{bb}\approx1$, the atomic evolution governed by the Heisenberg-Langevin equations can be obtained by $$\begin{aligned}
\label{eqn:1}
\dot{\widetilde\sigma}_{be_\sigma}=-\gamma_{be_\sigma}
{\widetilde\sigma}_{be_\sigma} +ig_\sigma\hat{\cal
E}_\sigma+i\Omega_{\sigma0}{\widetilde\sigma}_{bc} +F_{be_\sigma},\end{aligned}$$ $$\begin{aligned}
\label{eqn:2}
\dot{\widetilde\sigma}_{bc}=
i\sum_{\sigma=1}^{m-2}\Omega_{\sigma0}{\widetilde\sigma}_{be_\sigma}
-i\sum_{\sigma=1}^{m-2}g_\sigma\hat {\cal
E}_\sigma{\widetilde\sigma}_{e_\sigma c}+F_{bc},\end{aligned}$$ $$\begin{aligned}
\label{eqn:3}
\dot{\widetilde\sigma}_{ce_\sigma}=-\gamma_{ce_\sigma}
{\widetilde\sigma}_{ce_\sigma}
+i\sum_{\sigma=1}^{m-2}g_\sigma\hat{\cal
E}_\sigma{\widetilde\sigma}_{cb} +F_{ce_\sigma},\end{aligned}$$ where $\gamma_{\mu\nu}$ are the transversal decay rates that will be assumed $\gamma_{be_\sigma}=\Gamma$ in the following derivation and $F_{\mu\nu}$ are $\delta$-correlated Langevin noise operators. From the Eq. (\[eqn:1\]) we find in the lowest order: ${\widetilde\sigma}_{be_\sigma}=(ig_\sigma\hat{\cal
E}_\sigma+i\Omega_{\sigma0}{\widetilde\sigma}_{bc}
+F_{be_\sigma})/\Gamma$. Substitute this result into Eq. (\[eqn:2\]) yields $\dot{\widetilde\sigma}_{bc}=
\Gamma^{-1}\Omega_0^2{\widetilde\sigma}_{bc}
-\Gamma^{-1}\sum_{\sigma=1}^{m-2}g_\sigma\Omega_{\sigma0}\hat
{\cal E}_\sigma-i\sum_{\sigma=1}^{m-2}g_\sigma\hat {\cal
E}_\sigma{\widetilde\sigma}_{e_\sigma c}$, where $\Omega_0=\sqrt{\sum_{\sigma=1}^{m-2}\Omega^2_{\sigma0}}$. The Langevin noise terms are neglected in the present results, since under the adiabatic condition the Langevin noise terms have no effect on EIT quantum memory technique [@6]. For our purpose we shall calculate $\widetilde\sigma_{bc}$ to the first order, neglecting the small time derivatives of $\Omega_{\sigma0}$, thus $$\begin{aligned}
\label{eqn:coherence4}
\widetilde\sigma_{bc}&\approx&-\frac{1}{\Omega_0^2}\sum_{\sigma=1}^{m-2}g_\sigma\Omega_{\sigma0}\hat
{\cal E}_\sigma
-\frac{1}{\Omega_0^4}\sum_{jk\sigma}g_jg_kg_\sigma\Omega_{\sigma0}\hat{\cal
E}_j^{\dag}\hat{\cal E}_k\hat{\cal
E}_\sigma+\nonumber\\
&&+\frac{\Gamma}{\Omega_0^4}\sum_{\sigma=1}^{m-2}g_\sigma\Omega_{\sigma0}\partial_t\hat
{\cal E}_\sigma.\end{aligned}$$ The second term in the right hand side of above equation represents the nonlinear couplings between the probe pulses.

The dark-state polaritons (DSPs) in the general multi-level EIT system is first obtained in [@multi-level], where the single-mode probe pulses are considered. Accordingly, the dark- and bright-state polaritons (BSPs) in the present general multi-level system can be defined by: $$\begin{aligned}
\label{eqn:DSP}
\hat\Psi(z,t)&=&\cos\theta\prod_{j=1}^{m-3}\cos\phi_j\hat {\cal
E}_1\nonumber\\
&&+\cos\theta\sum_{l=2}^{m-2}\sin\phi_{l-1}\prod_{j=l}^{m-3}\cos\phi_j\hat
{\cal E}_l\nonumber\\
&&-\sin\theta(t)\, \sqrt{N}\, \widetilde\sigma_{bc}(z,t),\end{aligned}$$ $$\begin{aligned}
\label{eqn:BSP}
\hat\Phi(z,t)&=&\sin\theta\prod_{j=1}^{m-3}\cos\phi_j\hat {\cal
E}_1\nonumber\\
&&+\sin\theta\sum_{l=2}^{m-2}\sin\phi_{l-1}\prod_{j=l}^{m-3}\cos\phi_j\hat
{\cal E}_l\nonumber\\
&&+\cos\theta(t)\, \sqrt{N}\, \widetilde\sigma_{bc}(z,t),\end{aligned}$$ which are superpositions of the atomic coherence and the $m-2$ probe fields. The mixing angles $\theta$ and $\phi_j$ in the new quantum fields are defined through $$\label{eqn:10}
\tan\theta=\frac{g_1g_2...g_{m-2}\sqrt{N}}{\bigr[\sum_{j=1}^{m-2}\bigr(\Omega_{j0}^2\prod_{l=1,l\neq
j}^{m-2}g_l^2\bigr)\bigr]^{1/2}}\nonumber$$ and $$\label{eqn:11}
\tan\phi_j=\frac{\prod_{l=1}^{j}g_l\Omega_{j+1,0}}{\bigr[\sum_{l=1}^{j}\bigr(\Omega^2_{l0}\prod_{s=1,s\neq
l}^{j+1}g^2_s\bigr)\bigr]^{1/2}}.\nonumber$$

Using the definitions above, one can transform the equations of motion for the probe fields and the atomic variables into the new field variables. With the low-excitation approximation and neglecting the nonlinear effects we find that the DSP field satisfies

$$\begin{aligned}
\label{eqn:DSP1}
\bigr(\partial_t +c\cos^2\theta\cos\alpha_{m-2}
\partial_z\bigr)\, \hat\Psi
&=&-\dot\theta\, \hat\Phi+\sum_{j=1}^{m-2}\dot\phi_j\cos\theta \,
\hat s_j-\frac{c}{2}\sin2\theta\cos\alpha_{m-2}\,
\partial_z\hat\Phi,
+\nonumber\\
&&+c\cos\theta\sum_{j=1}^{m-2}\prod_{l=j}^{m-3}\cos\phi_l\sin2\phi_{j-1}\bigr(\frac{1}{2c}\frac{\nu_j}{k_{pj}}
+\frac{\cos\alpha_{j-1}}{2}\bigr)\partial_z\hat s_j,\end{aligned}$$

where we have defined $$\cos\alpha_\sigma=c\frac{\sum_{j=1}^{\sigma}\frac{k_{pj}}{\nu_j}\Omega_{j0}^2\prod_{l=1,l\neq
j}^{\sigma}g_l^2}{\sum_{j=1}^{\sigma}\Omega_{j0}^2\prod_{l=1,l\neq
j}^{\sigma}g_l^2}, \ \sigma=1,2,...,m-3$$ and $\hat
s_j=\partial_{\phi_j}\hat\Psi/\cos\theta$. It then follows that $\hat s_1=\prod_{j=2}^{m-3}\cos\phi_j(-\sin\phi_1{\cal
E}_1+\cos\phi_1{\cal E}_2)$, $\hat
s_2=\prod_{j=3}^{m-3}\cos\phi_j(-\sin\phi_2{(\cos\phi_1\cal
E}_1+\sin\phi_1{\cal E}_2)+\cos\phi_2{\cal E}_3)$, and generally $$\begin{aligned}
\label{eqn:s1}
\hat s_k=\prod_{j=k+1}^{m-3}\cos\phi_j\hat{\cal s}_k, \ \
k=1,2,...,m-3,\end{aligned}$$ with $$\begin{aligned}
\label{eqn:s2}
\hat{\cal s}_k&=&\cos\phi_k{\cal
E}_{k+1}-\sin\phi_k\sum_{m=2}^k\bigr(\prod_{l=m}^{k-1}\cos\phi_l\bigr)\sin\phi_{m-1}{\cal
E}_m\nonumber\\
&-&\sin\phi_k\prod_{l=1}^{k-1}\cos\phi_l{\cal E}_1.\end{aligned}$$ On the other hand, the equation of BSP field can be obtained as

$$\begin{aligned}
\label{eqn:BSP1}
\Phi=\frac{\Gamma}{\sqrt{N}}\biggl(\sum_{j=1}^{m-2}\bigr(\frac{\Omega_{j0}/\Omega_0}{g_j}\bigr)^2\biggl)^{1/2}
\frac{\cos\theta}{\Omega_0}\partial_t(\sin\theta\Psi-\cos\theta\Phi)+\cos\theta\bigr(g_1\Omega_{01}\sin\phi_1\hat
s_1-\sum_{l=2}^{m-3}g_l\Omega_{l0}\cos\phi_{l-1}\hat
s_{l-1}\bigr).\end{aligned}$$

By comparing Eqs. (\[eqn:DSP1\]) and (\[eqn:BSP1\]) with the corresponding DSP and BSP fields in the three-level system, one can see a key difference is the appearance of $\hat s_j(z,t)$ from the probe fields in our model. The adiabatic condition in the present case can be fulfilled only if $\hat s_j(z,t)=0$ for all $j$. However, the input probe pulses are generally independent of each other so that the fields $\hat s_j$ need not be zero. To study the dynamics of the DSP field, we should therefore investigate first the pulse matching between all the probe fields needed for adiabatic condition. Bearing these ideas in mind, we next explore the evolution of a set of normal fields by introducing $$\begin{aligned}
\label{eqn:probe1}
\hat G_{j,j+1}=-\sin\phi_{j,j+1}\hat{\cal
E}_j(z,t)+\cos\phi_{j,j+1}\hat{\cal E}_{j+1}(z,t),\end{aligned}$$ where $j=1, 2, ..., m-3$ and $\tan\phi_{j,j+1}=g_j\Omega_{j+1,0}/g_{j+1}\Omega_{j0}$. From the Eq. (\[field equation\]) and together with the results of ${\widetilde\sigma}_{be_\sigma}$ and ${\widetilde\sigma}_{bc}$ one can verify that the field $\hat G_{j,j+1}$ satisfies the equation

$$\begin{aligned}
\label{eqn:field3}
(\partial_t-c\cos^2\beta\cos2\phi_{j,j+1}\partial_z)\hat
G_{j,j+1}=-\frac{(g_j^2\Omega_{j+1}^2+g_{j+1}^2\Omega_j^2)N}{\Gamma}\frac{\cos^2\beta}{\Omega_0^2}\hat
G_{j,j+1}-\nonumber\\
-\frac{1}{2}g_jg_{j+1}\sqrt{N}\sin2\beta\partial_t\hat {\cal
E}_{j,j+1}+c\cos^2\beta\sin2\phi_{j,j+1}\partial_z\hat {\cal
E}_{j,j+1} +F(\hat {\cal E}_\sigma, \sigma\neq j,j+1)\end{aligned}$$

with $$\begin{aligned}
\label{eqn:mix3}
\tan^2\beta=\frac{N\Omega_j^2\Omega_{j+1}^2}{g_j^2\Omega_{j+1}^2+g_{j+1}^2\Omega_j^2}
\frac{(g_j^2-g_{j+1}^2)^2}{\Omega_0^4},\nonumber\end{aligned}$$ and $\hat {\cal E}_{j,j+1}=\cos\phi_{j,j+1}\hat{\cal
E}_j(z,t)+\sin\phi_{j,j+1}\hat{\cal E}_{j+1}(z,t)$. $F(\hat {\cal
E}_\sigma)$ includes no $\hat {\cal E}_j$ or $\hat {\cal
E}_{j+1}$. The first term in the right hand side of Eq. (\[eqn:field3\]) reveals a very large absorption of $\hat
G_{j,j+1}$, which results in a large decay in the field $\hat
G_{j,j+1}$ and then the system satisfies the pulse matching condition [@match; @match2; @multi-level]: $\hat {\cal
E}_{j+1}\rightarrow\tan\phi_{j,j+1}\hat {\cal E}_j$. For an explicit numerical estimation, we set some typical values [@exp1; @exp2]: $g_j\approx g_{j+1}\sim10^5s^{-1},
N\approx10^8$, $\Gamma\approx10^8s^{-1}$, so that the life time of field $\hat G_{j,j+1}(z,t)$ is about $\Delta t<10^{-8}s$ which is much smaller than the storage time [@exp2]. Furthermore, by introducing the adiabatic parameter $\tau\equiv(\sum_j(1/g_j)^2)^{1/2}/\sqrt{N}T$ where $T$ is the characteristic time scale, we can calculate the lowest order in Eq. (\[eqn:BSP1\]) and obtain $\hat\Phi\approx0, \hat
G_{j,j+1}\approx0$. On the other hand, under the condition of pulse matching, one can verify that $\hat s_j(z,t)\propto\hat
G_{j,j+1}=0$. Thus equation (\[eqn:DSP1\]) is reduced to the shape- and state-preserving case $$\begin{aligned}
\label{eqn:DSP2}
\bigr(\partial_t +c\cos^2\theta\cos\alpha_{m-2}
\partial_z\bigr)\, \hat\Psi(z,t)=0.\end{aligned}$$

The formula (\[eqn:DSP2\]) is the main result of the present work. The group velocity of the DSP field is $$\begin{aligned}
\label{eqn:group}
V_g=\cos^2\theta\frac{\sum_{j=1}^{m-2}\frac{\nu_j}{k_{pj}}\Omega_{j0}^2\prod_{l=1,l\neq
j}^{m-2}g_l^2}{\sum_{j=1}^{m-2}\Omega_{j0}^2\prod_{l=1,l\neq
j}^{m-2}g_l^2}.\end{aligned}$$ One should bear in mind that the wave vectors $k_{pj}$ can be positive (in the $+z$ direction) or negative (in the $-z$ direction). So, by adjusting the Rabi-frequencies for external pump fields properly under the adiabatic condition so that $\cos\alpha_{m-2}=0$, we can obtain a zero velocity for the DSP field. In particular, one may set No. $1$ to No. $m-3$ pump/probe pulses in the $+z$ direction, while No. $m-2$ pump/probe pulse in the $-z$ direction (Fig. 1(b)) and $\Omega_{m-2,0}=\sum_{j=1}^{m-3}\frac{g_{m-2}^2}{g_j^2}\Omega_{j0}^2$, in an experiment so that the group velocity $V_g=0$. In this way, we create the multi-frequency stationary pulses with each component: $$\begin{aligned}
\label{eqn:stationary}
\hat{\cal E}_1&=&\cos\theta\prod_{j=1}^{m-3}\cos\phi_j\Psi(z,t),\nonumber\\
\hat{\cal
E}_l&=&\cos\theta\sin\phi_{l-1}\prod_{j=l}^{m-3}\cos\phi_j\Psi(z,t),\\
l&=&2,...,m-2.\nonumber\end{aligned}$$ These components interfere to create a sharp spatial envelope. It is helpful to present a comparison of our results with those obtained for a three-level system [@three-level; @nature]: i) In the present system, all optical pulses can couple in resonance to the corresponding atomic transitions, thus all the applied probe fields with different frequencies contribute to the generation of stationary pulses. This means the present process is a spatial compression of excitation, which allows us to shape and intensify the localized stationary pulses. Our technique can therefore be expected to enhance further nonlinear couplings and be applied in the most straightforward manner, e.g. to applications in quantum nonlinear optics [@nonlinear]. Numerical results in Fig. 2 show how tight localization of stationary pulses can be readily obtained when the multi-level system is applied.

![(color online) Localization of created stationary pulses for 5-level (red solid line) cases, where three input probe lights are used and the parameters are set as $\omega_{e_3e_2}=\omega_{e_2e_1}\approx\nu_2/100$ (a). As a comparison, blue dashed line shows the stationary pulses created in 3-level system (b) by employing one standing wave of pump fields. The probe lights are used with the envelop $\exp(-z^2)$.[]{data-label=""}](fig_2.eps){width="0.9\columnwidth"}

In contrast, for a three-level system, a frequency-comb is used to create a localized pulse, filtering the off-resonant input probe pulses and retaining only the resonant one for creation [@three-level]. Generally, the total number of probe photons created by a frequency-comb in a three-level system is much less than in the current model; ii) The present technique can be freely controlled. For example, based on our results, we see that the pulse matching in the present case is between all of the probe pulses with different frequencies, say, $\hat {\cal
E}_{\sigma}=\prod_{j=l}^{\sigma}\tan\phi_{j,j+1}\hat {\cal E}_l \
(l\geq1, \sigma\leq{m-2})$. Thus, in principle, one can use just one pump field to achieve the stationary pulse by adjusting its intensity to match those of the other pump fields; iii) It requires no standing waves in the pump fields or spatially modulated pump fields to create localized stationary pulses.

![(color online) (a)(b) Schematic of experimental realization of stationary pulses with four-level double-$\Lambda$-type $^{87}$Rb atoms coupled to two single-mode quantized and two classical pump fields that propagate in $+z$ and $-z$ directions, respectively.[]{data-label=""}](fig_3.eps){width="0.8\columnwidth"}

Experimentally, the simplest multi-level system is an ensemble of four-level double $\Lambda$-type $^{87}$Rb atoms. The schematic diagram for experimental realization is shown in Fig.3. All the atoms first are trapped in state $|b\rangle$ ($5^2S_{1/2}$) and only the $\pm z$ directional propagation pump fields ($\Omega_1$ and $\Omega_2$) are applied to couple the transitions from $|c\rangle$ ($5^2S_{1/2}$) to $|e_1\rangle$ ($5^2P_{1/2} (F=1)$) and $|e_2\rangle$ ($5^2P_{3/2} (F=1)$) respectively. We then input the probe pulses ($\hat{\cal E}_{1,2}$) and allow the system to achieve adiabatic condition. Finally, by adjusting $\Omega_1$ or $\Omega_2$ so that $g_1\Omega_{20}=g_2\Omega_{10}$, we can create the stationary pulses for probe fields $\hat {\cal
E}_1(z,t)=\cos\theta\cos\phi\hat \Psi, \hat {\cal
E}_2(z,t)=\cos\theta\sin\phi\hat \Psi$, where $\hat\Psi$ is determined by the Eq. (\[eqn:DSP\]) with $m=4$. It can be expected that when the level number $m$ becomes larger, the more tightly localized stationary pulses can be created. According to the numerical results in Fig. 2, the effect becomes substantial when $m\geq5$.

In conclusion, we have shown the tightly localized stationary pulses can be obtained in the general multi-level EIT system. We have examined the dynamics of DSPs in detail and found that, all the applied probe pulses with different frequencies contribute to the stationary pulses. The present process is therefore a spatial compression of excitation, which may be able to enhance further nonlinear optical couplings and will have interesting applications in quantum nonlinear optics [@nonlinear]. In particular, our technique may open up a novel way towards the spatial compression of many probe photons with small losses. According to the results in [@multi-level], if initially input is a non-classical probe pulse, e.g. a quantum superposition of coherent states, we may also generate entangled stationary pulses within our model.

We thank Dr. Y. Zhao (Heideberg University) for the helpful discussions. This work is supported by NUS academic research Grant No. WBS: R -144-000-172-101, US NSF under the grant DMR-0547875, and by NSF of China under grants No.10275036.

[99]{} S. E. Harris, J. E. Field and A. Kasapi, Phys. Rev. A 46, R29 (1992); M. O. Scully and M. S. Zubairy, Quantum Optics (Cambridge University Press, Cambridge 1999). L. V. Hau et al., Nature (London) 397, 594 (1999). M. Fleischhauer and M. D. Lukin, Phys. Rev. Lett. 84, 5094 (2000); Phys. Rev. A 65, 022314 (2002). C. Liu et al., Nature (London) 409, 490 (2001); D. F. Phillips, et al., Phys. Rev. Lett. 86,783(2001). M. D. Lukin and A. Imamoglu, Phys. Rev. Lett. 84, 1419 (2000); M. Fleischhauer and S. Q. Gong, Phys. Rev. Lett. 88, 070404 (2002); Y. Wu, J. Saldana and Y. Zhu, Phys. Rev. A 67, 013811 (2003); L. M. Kuang and L. Zhou, Phys. Rev. A 68, 043606 (2003); X. J. Liu, H. Jing and M. L. Ge, Phys. Rev. A 70, 055802 (2004). Y. Wu and L. Deng, Phys. Rev. Lett. 93, 143904 (2004); Y. Wu, Phys. Rev. A, 71, 053820 (2005). M. Bajcsy, A. S. Zibrov and M. D. Lukin, Nature (London), 426, 638 (2003). F. E. Zimmer et al., e-print: quant-ph/0602197 (2006). A. Andre and M. D. Lukin, Phys. Rev. Lett. 89, 143602 (2002); H. Kang, G. Hernandez and Y. Zhu, Phys. Rev. Lett. 93, 073601 (2004). A. S. Zibrov A. B. Matsko, O. Kocharovskaya, Y.V. Rostovtsev, G. R. Welch and M. O. Scully, Phys. Rev. Lett. 88, 103601, (2002); I. Friedler, G. Kurizki and D. Petrosyan, Europhys. Lett. 68, 625 (2004). X. J. Liu, H. Jing, X. T. Zhou and M. L. Ge, Phys. Rev. A, 70,015603(2004); X. J. Liu, H. Jing and M. L. Ge, Euro. Phys. J. D, In press. X. J. Liu, H. Jing, X. Liu and M. L. Ge, Phys. Lett. A 355, 437 (2006). e-print: quant-ph/0410131 (2004). J. Appel, K.-P. Marzlin, and A. I. Lvovsky, Phys. Rev. A 73, 013804 (2006). S. E. Harris, Phys. Rev. Lett. 70, 552 (1993); S.E. Harris, Phys. Rev. Lett. 72, 52 (1994). M. Fleischhauer and A.S. Manka, Phys. Rev. A 54, 794 (1996). A. André et al, Phys. Rev. Lett. 94, 063902 (2005); M. Mašlas and M. Fleischhauer, Phys. Rev. A 69, 061801(R) (2004); I. Friedler, G. Kurizki and D. Petrosyan, Phys. Rev. A 71, 023803 (2005).

[^1]: Electronic address: phylx@nus.edu.sg

[^2]: Electronic address: phyohch@nus.edu.sg


<?php

$a = $b++;

$a = ++$b;

$a = $b--;

$a = --$b;

$a = ++ $b;

$a = -- $b;

$a = $b ++;

$a = $b --;

$a->b++;

$a->b--;

++$a->b;

--$a->b;

$a->b ++;

$a->b --;

++ $a->b;

-- $a->b;

$a[0]++;

$a[0]--;

++$a[0];

--$a[0];

$a[0] ++;

$a[0] --;

++ $a[0];

-- $a[0];

++Class::$v;

--Class::$v;

Class::$v++;

Class::$v--;

++ Class::$v;

-- Class::$v;

Class::$v ++;

Class::$v --;

++self::$v;

--self::$v;

self::$v++;

self::$v--;

++ self::$v;

-- self::$v;

self::$v ++;

self::$v --;