text:
/*
 *                 Sun Public License Notice
 *
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 *
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
 * Microsystems, Inc. All Rights Reserved.
 */
package edu.duke.cabig.catrip.gui.control;

import org.netbeans.graph.api.control.GraphHelper;
import org.netbeans.graph.api.control.IGraphLinkRenderer;
import org.netbeans.graph.api.control.editor.IGraphEditor;
import org.netbeans.graph.api.model.IGraphLink;
import org.netbeans.graph.api.model.ability.IDirectionable;
import org.netbeans.graph.api.model.ability.IDisplayable;
import org.openide.util.Utilities;

import java.awt.*;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import org.netbeans.graph.api.model.builtin.GraphPort;

/**
 * This class is responsible to render the link between two ports on the Graph.
 * The color of the Link is set as Blue if the link is drawn between two CDEs.
 *
 * @author Sanjeev Agarwal, David Kaspar
 */
public class AttributeLinkRenderer implements IGraphLinkRenderer {

    private static final boolean disableAntialiasing = Utilities.isWindows()  &&  System.getProperty("java.version", "").startsWith("1.4");

//    private static final Color colorLink = new Color(230, 139, 44);  // sanjeev
    private static Color colorLink = new Color(230, 139, 44); // color of the link.
    private static final Color colorLinkSelected = SimpleDocumentRenderer.getSelectionForegroundColor();
    private static final Color colorLinkHighlighted = new Color(0x4B, 0x79, 0xBF);
//    private static final Color colorLinkShadow = Color.WHITE;

    private static final double CORNER_SIZE = 5;

    static Color relinkingColor = Color.GRAY;

    private static final float ARROW_SIZE = 12;
//    private static final float ARROW_SIZE_MID = 9;
    private static final float ARROW_ANGLE = (float) Math.PI / 10;
//    private static final int LINK_LINE_WIDTH = 1;

    private static final int LAYER_LINK = 200;
    private static final int LAYER_SELECTED_PORTS = 350;
    private static final int LAYER_ALT_MODE = 500;
    private final int[] layers = new int[] { LAYER_LINK, LAYER_SELECTED_PORTS, LAYER_ALT_MODE };

    private GraphHelper helper;
//    private IGraphLink link;

//    public static Color getLinkColor () {
//        return colorLink;
//    }

    public AttributeLinkRenderer(GraphHelper helper, IGraphLink link) {
        this.helper = helper;
//        this.link = link;
    }

    public void layoutLink(IGraphLink link, Graphics2D gr) {
        Point[] controlPoints = helper.getControlPoints(link);
        Rectangle bounds = new Rectangle();
        if (controlPoints != null && controlPoints.length > 0) {
            bounds.setLocation(controlPoints[0]);
            Rectangle rect = new Rectangle();
            for (int i = 1; i < controlPoints.length; i++) {
                rect.setLocation(controlPoints[i]);
                Rectangle.union(bounds, rect, bounds);
            }
            bounds.grow(8, 8); // lines and arrow size
        }

        layoutLinkHook(link, bounds);
        helper.setLinkBounds(link, bounds);
    }

    protected void layoutLinkHook(IGraphLink link, Rectangle bounds) {
    }

    public int[] getLayers(IGraphLink link) {
        return layers;
    }

    /** Render the link. Change the color of the link based on the SourcePort direction. */
    public void renderLink(IGraphLink link, Graphics2D gr, int layer) {
        // sanjeev
        // Change the color of the Link base on the SourcePort Type to draw a Blue colored CDE link.
        if (((GraphPort)link.getSourcePort()).getDirection() == IDirectionable.BOTTOM_LEFT){
            colorLink = Color.BLUE;//new Color (230, 139, 44); // sanjeev
        } else {
            colorLink = new Color (230, 139, 44);
        }
        // sanjeev

        final boolean hightlighted = helper.isComponentSelected(link)  ||  helper.isComponentMouseOver(link);
        if (layer == LAYER_LINK) {
            renderLinkHook(link, gr);
            gr.setColor(hightlighted ? colorLinkSelected : (helper.isComponentHighlighted(link) ? colorLinkHighlighted : colorLink));
            paintLink(link, gr);
        } else if (layer == LAYER_SELECTED_PORTS) {
            if (hightlighted) {
                final Point[] controlPoints = helper.getControlPoints(link);
                if (controlPoints != null) {
                    final int length = controlPoints.length;
                    if (length > 0)
                        paintSelectedPoint(gr, controlPoints[0]);
                    if (length > 1)
                        paintSelectedPoint(gr, controlPoints[length - 1]);
                }
            }
        } else if (layer == LAYER_ALT_MODE  &&  helper.isAltMode()) {
            final Point[] controlPoints = helper.getControlPoints(link);
            if (controlPoints != null)
                for (int i = 0; i < controlPoints.length; i++)
                    paintAltPoint(gr, controlPoints[i]);
        }

    }

    protected void renderLinkHook(IGraphLink link, Graphics2D gr) {
    }

    public boolean isInActiveAreaOfControlPoint(IGraphLink link, Point controlPoint, Point location) {
        return new Rectangle(controlPoint.x - 3, controlPoint.y - 3, 7, 7).contains(location);
    }

    /** Can be used to change/set the role name by clicking on the link. */
    public IGraphEditor getEditor(IGraphLink link, Point position) {
        return null;
    }

    /** Can be helpful in displaying the association Role Name on the graph. */
    public String getToolTipText(IGraphLink link, Point position) {
        IDisplayable displayable = (IDisplayable) link.getLookup().lookup(IDisplayable.class);
        return displayable != null ? displayable.getTooltipText() : null;
    }

    private void paintLink(IGraphLink link, Graphics2D gr) {
        Point[] points = helper.getControlPoints(link);
        paintLinkWithCorners(gr, points);
//        final int length = points.length;
//        int[] xs = new int[length];
//        int[] ys = new int[length];
//        for (int i = 0; i < length; i++) {
//            xs[i] = points[i].x;
//            ys[i] = points[i].y;
//        }
//        paintLink (gr, xs, ys, length);
    }

    private static void paintLinkWithCorners(Graphics2D gr, Point[] points) {
        if (points == null  ||  points.length <= 0)
            return;
        final int maxnewpoints = points.length * 2 - 2;
        final int maxpoints2 = points.length - 2;

        int[] newpointsX = new int[maxnewpoints];
        int[] newpointsY = new int[maxnewpoints];
        int newpointspos = 0;

        for (int a = 0; a < points.length - 1; a++) {
            Point p1 = points[a];
            Point p2 = points[a + 1];
            double len = p1.distance(p2);

            if (a > 0) {
                Point p0 = points[a - 1];
                double ll = p0.distance(p1);
                if (len < ll)
                    ll = len;
                ll /= 2;
                double cll = CORNER_SIZE;
                if (cll > ll)
                    cll = ll;
                double direction = Math.atan2(p2.y - p1.y, p2.x - p1.x);
                if (!Double.isNaN(direction)) {
                    newpointsX[newpointspos] = p1.x + (int) (cll * Math.cos(direction));
                    newpointsY[newpointspos] = p1.y + (int) (cll * Math.sin(direction));
                    newpointspos ++;
                }
            } else {
                newpointsX[newpointspos] = p1.x;
                newpointsY[newpointspos] = p1.y;
                newpointspos ++;
            }

            if (a < maxpoints2) {
                Point p3 = points[a + 2];
                double ll = p2.distance(p3);
                if (len < ll)
                    ll = len;
                ll /= 2;
                double cll = CORNER_SIZE;
                if (cll > ll)
                    cll = ll;
                double direction = Math.atan2(p2.y - p1.y, p2.x - p1.x);
                if (!Double.isNaN(direction)) {
                    newpointsX[newpointspos] = p2.x - (int) (cll * Math.cos(direction));
                    newpointsY[newpointspos] = p2.y - (int) (cll * Math.sin(direction));
                    newpointspos++;
                }
            } else {
                newpointsX[newpointspos] = p2.x;
                newpointsY[newpointspos] = p2.y;
                newpointspos++;
            }
        }
        assert newpointspos == maxnewpoints;
        paintLink(gr, newpointsX, newpointsY, newpointspos);
    }

    static void paintLink(Graphics2D gr, int[] xs, int[] ys, int length) {
        if (length <= 1)
            return;

        // WARNING - because the bug in jdk 1.4.2 (rendering gr.draw (new Line2D()) cause PRException), disabling antialiasing as a workaround
        Object originalAntialiasingRenderingHint = null;
        if (disableAntialiasing) {
            originalAntialiasingRenderingHint = gr.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
            gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
        }

        double direction = Double.NaN;
        for (int i = length - 2; i >= 0; i--) {
            final int x = xs[i + 1] - xs[i];
            final int y = ys[i + 1] - ys[i];
            if (x == 0 && y == 0)
                continue;
            direction = Math.atan2(y, x);
            break;
        }

//        Stroke previousStroke = gr.getStroke ();
//        if (strokeWidth > 1)
//            gr.setStroke (new BasicStroke (strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
        GeneralPath line = new GeneralPath();
        line.moveTo(xs[0] + 0.5f, ys[0] + 0.5f);
        for (int i = 1; i < length; i ++) {
            line.lineTo(xs[i] + 0.5f, ys[i] + 0.5f);
//            floatLine.x2 = xs[i] + 0.5f;
//            floatLine.y2 = ys[i] + 0.5f;
//            gr.draw (floatLine);
//            floatLine.x1 = floatLine.x2;
//            floatLine.y1 = floatLine.y2;
        }
        gr.draw(line);
        if (! Double.isNaN(direction)) {
            float xend = (float) xs[length - 1] + 0.5f - 3.0f * (float) Math.cos(direction);
            float yend = (float) ys[length - 1] + 0.5f - 3.0f * (float) Math.sin(direction);
            float xleft = xend - ARROW_SIZE * (float) Math.cos(direction + ARROW_ANGLE);
            float yleft = yend - ARROW_SIZE * (float) Math.sin(direction + ARROW_ANGLE);
//            float xmid = xend - ARROW_SIZE_MID * Math.cos (direction + ARROW_ANGLE);
//            float ymid = yend - ARROW_SIZE_MID * Math.sin (direction + ARROW_ANGLE);
            float xright = xend - ARROW_SIZE * (float) Math.cos(direction - ARROW_ANGLE);
            float yright = yend - ARROW_SIZE * (float) Math.sin(direction - ARROW_ANGLE);

//            gr.fillPolygon (new int[]{xend, xleft, xmid, xright}, new int[]{yend, yleft, ymid, yright}, 4);

//            line = new GeneralPath ();
//            line.moveTo (xleft, yleft);
//            line.lineTo (xend, yend);
//            line.lineTo (xright, yright);
//            gr.draw (line);

            Line2D.Float floatLine;

            floatLine = new Line2D.Float();
            floatLine.x1 = xend;
            floatLine.y1 = yend;
            floatLine.x2 = xleft;
            floatLine.y2 = yleft;
            gr.draw(floatLine);

            floatLine = new Line2D.Float();
            floatLine.x1 = xend;
            floatLine.y1 = yend;
            floatLine.x2 = xright;
            floatLine.y2 = yright;
            gr.draw(floatLine);
        }
//        if (strokeWidth > 1)
//            gr.setStroke (previousStroke);

        // WARNING - because the bug in jdk 1.4.2 (rendering gr.draw (new Line2D()) cause PRException), disabling antialiasing as a workaround
        if (disableAntialiasing) {
            gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, originalAntialiasingRenderingHint);
        }
    }

    private void paintSelectedPoint(Graphics2D gr, Point point) {
        if (point != null)
            SimpleDocumentRenderer.renderSelectedRect(gr, new Rectangle(point.x - 3, point.y - 3, 7, 7));
    }

    private void paintAltPoint(Graphics2D gr, Point point) {
        if (point != null)
            SimpleDocumentRenderer.renderAltRect(gr, new Rectangle(point.x - 3, point.y - 3, 7, 7));
    }

}

redpajama_set_name: RedPajamaGithub


Fun and Functional, this MopTopper pen with an American flag designed tie is just what you need to show off your business pride.
Stars and stripes designed Tie!
Set-up charge: $40, includes one-color, one location.
Imprint Size: Barrel; 1.375" x 0.3125"


The modern estate plan consists of a revocable living trust; pour-over will; durable powers of attorney for property, healthcare and mental health care. Together these estate planning instruments constitute a basic estate plan that is vital for the protection of your family. Each of these instruments is explained in-depth within.


text:
using namespace std;
using namespace asio;

namespace eprosima {
namespace fastdds {
namespace rtps {

using IPFinder = fastrtps::rtps::IPFinder;
using IPLocator = fastrtps::rtps::IPLocator;
using Log = fastdds::dds::Log;

static void get_ipv4s(
        std::vector<IPFinder::info_IP>& locNames,
        bool return_loopback = false)
{
    IPFinder::getIPs(&locNames, return_loopback);
    auto new_end = remove_if(locNames.begin(),
                    locNames.end(),
                    [](IPFinder::info_IP ip)
                    {
                        return ip.type != IPFinder::IP4 && ip.type != IPFinder::IP4_LOCAL;
                    });
    locNames.erase(new_end, locNames.end());
    std::for_each(locNames.begin(), locNames.end(), [](IPFinder::info_IP& loc)
            {
                loc.locator.kind = LOCATOR_KIND_UDPv4;
            });
}

static void get_ipv4s_unique_interfaces(
        std::vector<IPFinder::info_IP>& locNames,
        bool return_loopback = false)
{
    get_ipv4s(locNames, return_loopback);
    std::sort(locNames.begin(), locNames.end(),
            [](const IPFinder::info_IP&  a, const IPFinder::info_IP& b) -> bool
            {
                return a.dev < b.dev;
            });
    auto new_end = std::unique(locNames.begin(), locNames.end(),
                    [](const IPFinder::info_IP&  a, const IPFinder::info_IP& b) -> bool
                    {
                        return a.type != IPFinder::IP4_LOCAL && b.type != IPFinder::IP4_LOCAL && a.dev == b.dev;
                    });
    locNames.erase(new_end, locNames.end());
}

static asio::ip::address_v4::bytes_type locator_to_native(
        const Locator& locator)
{
    if (IPLocator::hasWan(locator))
    {
        return{ { IPLocator::getWan(locator)[0],
            IPLocator::getWan(locator)[1],
            IPLocator::getWan(locator)[2],
            IPLocator::getWan(locator)[3] } };
    }
    else
    {
        return{ { IPLocator::getIPv4(locator)[0],
            IPLocator::getIPv4(locator)[1],
            IPLocator::getIPv4(locator)[2],
            IPLocator::getIPv4(locator)[3] } };
    }
}

UDPv4Transport::UDPv4Transport(
        const UDPv4TransportDescriptor& descriptor)
    : UDPTransportInterface(LOCATOR_KIND_UDPv4)
    , configuration_(descriptor)
{
    mSendBufferSize = descriptor.sendBufferSize;
    mReceiveBufferSize = descriptor.receiveBufferSize;
    if (!descriptor.interfaceWhiteList.empty())
    {
        const auto white_begin = descriptor.interfaceWhiteList.begin();
        const auto white_end = descriptor.interfaceWhiteList.end();

        std::vector<IPFinder::info_IP> local_interfaces;
        get_ipv4s(local_interfaces, true);
        for (const IPFinder::info_IP& infoIP : local_interfaces)
        {
            if (std::find(white_begin, white_end, infoIP.name) != white_end)
            {
                interface_whitelist_.emplace_back(ip::address_v4::from_string(infoIP.name));
            }
        }

        if (interface_whitelist_.empty())
        {
            logError(TRANSPORT, "All whitelist interfaces were filtered out");
            interface_whitelist_.emplace_back(ip::address_v4::from_string("192.0.2.0"));
        }
    }
}

UDPv4Transport::UDPv4Transport()
    : UDPTransportInterface(LOCATOR_KIND_UDPv4)
{
}

UDPv4Transport::~UDPv4Transport()
{
    clean();
}

UDPv4TransportDescriptor::UDPv4TransportDescriptor()
    : UDPTransportDescriptor()
{
}

TransportInterface* UDPv4TransportDescriptor::create_transport() const
{
    return new UDPv4Transport(*this);
}

bool UDPv4TransportDescriptor::operator ==(
        const UDPv4TransportDescriptor& t) const
{
    return (UDPTransportDescriptor::operator ==(t));
}

bool UDPv4Transport::getDefaultMetatrafficMulticastLocators(
        LocatorList& locators,
        uint32_t metatraffic_multicast_port) const
{
    Locator locator;
    locator.kind = LOCATOR_KIND_UDPv4;
    locator.port = static_cast<uint16_t>(metatraffic_multicast_port);
    IPLocator::setIPv4(locator, DEFAULT_METATRAFFIC_MULTICAST_ADDRESS);
    locators.push_back(locator);
    return true;
}

bool UDPv4Transport::getDefaultMetatrafficUnicastLocators(
        LocatorList& locators,
        uint32_t metatraffic_unicast_port) const
{
    Locator locator;
    locator.kind = LOCATOR_KIND_UDPv4;
    locator.port = static_cast<uint16_t>(metatraffic_unicast_port);
    locator.set_Invalid_Address();
    locators.push_back(locator);

    return true;
}

bool UDPv4Transport::getDefaultUnicastLocators(
        LocatorList& locators,
        uint32_t unicast_port) const
{
    Locator locator;
    locator.kind = LOCATOR_KIND_UDPv4;
    locator.set_Invalid_Address();
    fillUnicastLocator(locator, unicast_port);
    locators.push_back(locator);

    return true;
}

void UDPv4Transport::AddDefaultOutputLocator(
        LocatorList& defaultList)
{
    Locator locator;
    IPLocator::createLocator(LOCATOR_KIND_UDPv4, DEFAULT_METATRAFFIC_MULTICAST_ADDRESS,
            configuration_.m_output_udp_socket, locator);
    defaultList.push_back(locator);
}

bool UDPv4Transport::compare_locator_ip(
        const Locator& lh,
        const Locator& rh) const
{
    return IPLocator::compareAddress(lh, rh);
}

bool UDPv4Transport::compare_locator_ip_and_port(
        const Locator& lh,
        const Locator& rh) const
{
    return IPLocator::compareAddressAndPhysicalPort(lh, rh);
}

void UDPv4Transport::endpoint_to_locator(
        ip::udp::endpoint& endpoint,
        Locator& locator)
{
    locator.kind = kind();
    IPLocator::setPhysicalPort(locator, endpoint.port());
    auto ipBytes = endpoint.address().to_v4().to_bytes();
    IPLocator::setIPv4(locator, ipBytes.data());
}

void UDPv4Transport::fill_local_ip(
        Locator& loc) const
{
    loc.kind = kind();
    IPLocator::setIPv4(loc, "127.0.0.1");
}

const UDPTransportDescriptor* UDPv4Transport::configuration() const
{
    return &configuration_;
}

asio::ip::udp::endpoint UDPv4Transport::GenerateAnyAddressEndpoint(
        uint16_t port)
{
    return ip::udp::endpoint(ip::address_v4::any(), port);
}

ip::udp::endpoint UDPv4Transport::generate_endpoint(
        const Locator& loc,
        uint16_t port)
{
    asio::ip::address_v4::bytes_type remoteAddress;
    IPLocator::copyIPv4(loc, remoteAddress.data());
    return ip::udp::endpoint(asio::ip::address_v4(remoteAddress), port);
}

ip::udp::endpoint UDPv4Transport::generate_endpoint(
        const std::string& sIp,
        uint16_t port)
{
    return asio::ip::udp::endpoint(ip::address_v4::from_string(sIp), port);
}

ip::udp::endpoint UDPv4Transport::generate_endpoint(
        uint16_t port)
{
    return asio::ip::udp::endpoint(asio::ip::udp::v4(), port);
}

ip::udp::endpoint UDPv4Transport::generate_local_endpoint(
        const Locator& loc,
        uint16_t port)
{
    return ip::udp::endpoint(asio::ip::address_v4(locator_to_native(loc)), port);
}

asio::ip::udp UDPv4Transport::generate_protocol() const
{
    return ip::udp::v4();
}

void UDPv4Transport::get_ips(
        std::vector<IPFinder::info_IP>& locNames,
        bool return_loopback)
{
    get_ipv4s(locNames, return_loopback);
}

const std::string& UDPv4Transport::localhost_name()
{
    static const std::string ip4_localhost = "127.0.0.1";
    return ip4_localhost;
}

eProsimaUDPSocket UDPv4Transport::OpenAndBindInputSocket(
        const std::string& sIp,
        uint16_t port,
        bool is_multicast)
{
    eProsimaUDPSocket socket = createUDPSocket(io_service_);
    getSocketPtr(socket)->open(generate_protocol());
    if (mReceiveBufferSize != 0)
    {
        getSocketPtr(socket)->set_option(socket_base::receive_buffer_size(mReceiveBufferSize));
    }

    if (is_multicast)
    {
        getSocketPtr(socket)->set_option(ip::udp::socket::reuse_address(true));
#if defined(__QNX__)
        getSocketPtr(socket)->set_option(asio::detail::socket_option::boolean<
                    ASIO_OS_DEF(SOL_SOCKET), SO_REUSEPORT>(true));
#endif // if defined(__QNX__)
    }

    getSocketPtr(socket)->bind(generate_endpoint(sIp, port));
    return socket;
}

bool UDPv4Transport::OpenInputChannel(
        const Locator& locator,
        TransportReceiverInterface* receiver,
        uint32_t maxMsgSize)
{
    std::unique_lock<std::recursive_mutex> scopedLock(mInputMapMutex);
    if (!is_locator_allowed(locator))
    {
        return false;
    }

    bool success = false;

    if (!IsInputChannelOpen(locator))
    {
        success = OpenAndBindInputSockets(locator, receiver, IPLocator::isMulticast(locator), maxMsgSize);
    }

    if (IPLocator::isMulticast(locator) && IsInputChannelOpen(locator))
    {
        std::string locatorAddressStr = IPLocator::toIPv4string(locator);
        ip::address_v4 locatorAddress = ip::address_v4::from_string(locatorAddressStr);

#ifndef _WIN32
        if (!is_interface_whitelist_empty())
        {
            // Either wildcard address or the multicast address needs to be bound on non-windows systems
            bool found = false;

            // First check if the multicast address is already bound
            auto& channelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator));
            for (UDPChannelResource* channelResource : channelResources)
            {
                if (channelResource->interface() == locatorAddressStr)
                {
                    found = true;
                    break;
                }
            }

            // Create a new resource if no one is found
            if (!found)
            {
                try
                {
                    // Bind to multicast address
                    UDPChannelResource* p_channel_resource;
                    p_channel_resource = CreateInputChannelResource(locatorAddressStr, locator, true, maxMsgSize,
                                    receiver);
                    mInputSockets[IPLocator::getPhysicalPort(locator)].push_back(p_channel_resource);

                    // Join group on all whitelisted interfaces
                    for (auto& ip : interface_whitelist_)
                    {
                        p_channel_resource->socket()->set_option(ip::multicast::join_group(locatorAddress, ip));
                    }
                }
                catch (asio::system_error const& e)
                {
                    (void)e;
                    logWarning(RTPS_MSG_OUT, "UDPTransport Error binding " << locatorAddressStr << " at port: (" << IPLocator::getPhysicalPort(
                                locator) << ")"
                                                                           << " with msg: " << e.what());
                }
            }
        }
        else
#endif // ifndef _WIN32
        {
            // The multicast group will be joined silently, because we do not
            // want to return another resource.
            auto& channelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator));
            for (UDPChannelResource* channelResource : channelResources)
            {
                if (channelResource->interface() == s_IPv4AddressAny)
                {
                    std::vector<IPFinder::info_IP> locNames;
                    get_ipv4s_unique_interfaces(locNames, true);
                    for (const auto& infoIP : locNames)
                    {
                        auto ip = asio::ip::address_v4::from_string(infoIP.name);
                        try
                        {
                            channelResource->socket()->set_option(ip::multicast::join_group(locatorAddress, ip));
                        }
                        catch (std::system_error& ex)
                        {
                            (void)ex;
                            logWarning(RTPS_MSG_OUT, "Error joining multicast group on " << ip << ": " << ex.what());
                        }
                    }
                }
                else
                {
                    auto ip = asio::ip::address_v4::from_string(channelResource->interface());
                    try
                    {
                        channelResource->socket()->set_option(ip::multicast::join_group(locatorAddress, ip));
                    }
                    catch (std::system_error& ex)
                    {
                        (void)ex;
                        logWarning(RTPS_MSG_OUT, "Error joining multicast group on " << ip << ": " << ex.what());
                    }
                }
            }
        }
    }

    return success;
}

std::vector<std::string> UDPv4Transport::get_binding_interfaces_list()
{
    std::vector<std::string> vOutputInterfaces;
    if (is_interface_whitelist_empty())
    {
        vOutputInterfaces.push_back(s_IPv4AddressAny);
    }
    else
    {
        for (auto& ip : interface_whitelist_)
        {
            vOutputInterfaces.push_back(ip.to_string());
        }
    }

    return vOutputInterfaces;
}

bool UDPv4Transport::is_interface_allowed(
        const std::string& interface) const
{
    return is_interface_allowed(asio::ip::address_v4::from_string(interface));
}

bool UDPv4Transport::is_interface_allowed(
        const ip::address_v4& ip) const
{
    if (interface_whitelist_.empty())
    {
        return true;
    }

    if (ip == ip::address_v4::any())
    {
        return true;
    }

    return find(interface_whitelist_.begin(), interface_whitelist_.end(), ip) != interface_whitelist_.end();
}

bool UDPv4Transport::is_interface_whitelist_empty() const
{
    return interface_whitelist_.empty();
}

bool UDPv4Transport::is_locator_allowed(
        const Locator& locator) const
{
    if (!IsLocatorSupported(locator))
    {
        return false;
    }
    if (interface_whitelist_.empty() || IPLocator::isMulticast(locator))
    {
        return true;
    }
    return is_interface_allowed(IPLocator::toIPv4string(locator));
}

LocatorList UDPv4Transport::NormalizeLocator(
        const Locator& locator)
{
    LocatorList list;

    if (IPLocator::isAny(locator))
    {
        std::vector<IPFinder::info_IP> locNames;
        get_ipv4s(locNames);
        for (const auto& infoIP : locNames)
        {
            auto ip = asio::ip::address_v4::from_string(infoIP.name);
            if (is_interface_allowed(ip))
            {
                Locator newloc(locator);
                IPLocator::setIPv4(newloc, infoIP.locator);
                list.push_back(newloc);
            }
        }
        if (list.empty())
        {
            Locator newloc(locator);
            IPLocator::setIPv4(newloc, "127.0.0.1");
            list.push_back(newloc);
        }
    }
    else
    {
        list.push_back(locator);
    }

    return list;
}

bool UDPv4Transport::is_local_locator(
        const Locator& locator) const
{
    assert(locator.kind == LOCATOR_KIND_UDPv4);

    if (IPLocator::isLocal(locator))
    {
        return true;
    }

    for (const IPFinder::info_IP& localInterface : currentInterfaces)
    {
        if (IPLocator::compareAddress(locator, localInterface.locator))
        {
            return true;
        }
    }

    return false;
}

void UDPv4Transport::set_receive_buffer_size(
        uint32_t size)
{
    configuration_.receiveBufferSize = size;
}

void UDPv4Transport::set_send_buffer_size(
        uint32_t size)
{
    configuration_.sendBufferSize = size;
}

void UDPv4Transport::SetSocketOutboundInterface(
        eProsimaUDPSocket& socket,
        const std::string& sIp)
{
    getSocketPtr(socket)->set_option(ip::multicast::outbound_interface(asio::ip::address_v4::from_string(sIp)));
}

void UDPv4Transport::update_network_interfaces()
{
    UDPTransportInterface::update_network_interfaces();
    for (auto& channelResources : mInputSockets)
    {
        for (UDPChannelResource* channelResource : channelResources.second)
        {
            if (channelResource->interface() == s_IPv4AddressAny)
            {
                std::vector<IPFinder::info_IP> locNames;
                get_ipv4s_unique_interfaces(locNames, true);
                for (const auto& infoIP : locNames)
                {
                    auto ip = asio::ip::address_v4::from_string(infoIP.name);
                    try
                    {
                        channelResource->socket()->set_option(ip::multicast::join_group(
                                    ip::address_v4::from_string(DEFAULT_METATRAFFIC_MULTICAST_ADDRESS), ip));
                    }
                    catch (std::system_error& ex)
                    {
                        (void)ex;
                        logWarning(RTPS_MSG_OUT, "Error joining multicast group on " << ip << ": " << ex.what());
                    }
                }
            }
            else
            {
                auto ip = asio::ip::address_v4::from_string(channelResource->interface());
                try
                {
                    channelResource->socket()->set_option(ip::multicast::join_group(
                                ip::address_v4::from_string(DEFAULT_METATRAFFIC_MULTICAST_ADDRESS), ip));
                }
                catch (std::system_error& ex)
                {
                    (void)ex;
                    logWarning(RTPS_MSG_OUT, "Error joining multicast group on " << ip << ": " << ex.what());
                }
            }
        }
    }
}

} // namespace rtps
} // namespace fastrtps
} // namespace eprosima


Follow the link to read the rest of the post about mandrake.
Hey Buddy!, I found this information for you: "A Penny for Poison: How I Coaxed the Mandrake By David Salisbury". Here is the website link: http://paganbloggers.com/blog/2017/04/14/a-penny-for-poison-how-i-coaxed-the-mandrake-by-david-salisbury/. Thank you.


Beautiful house Inma, built in 2002. In the district of Monte Pego, in a quiet, sunny position, 8 km from the sea. Private: garden 800 m2 (fenced) with lawn and wildlife garden, swimming pool angular (4 x 9 m, depth 150 - 220 cm, 01.01.-31.12.) with internal staircase. Outdoor shower, parking (for 2 cars). Shop 5 km, supermarket 5 km, shopping centre 12 km, restaurant, bar 600 m, sandy beach 8 km. Golf course (18 hole) 10 km, tennis 600 m.


text:
Game Day Notes: Mayhem vs. Knoxville (Game #14, Home Game #6)
by dbarker
LAST GAME'S ACTION: For the second straight home game, the Mayhem would end up 2-1 winners in overtime. This time, it was Mason Baptista who rifled home the game-winner past Knoxville goaltender Peter Di Salvo in the extra session to send the season-high crowd of 1,749 home happy. Ray Brice scored the regulation goal for the Mayhem, who took sole possession of first place in the SPHL standings with the victory. Jake Theut had his shutout streak of 110 minutes and 14 seconds snapped with a third period Knoxville goal but still picked up his league-best eighth win of the season, stopping 23 of 24 shots. Di Salvo made 40 saves on 42 shots in the regulation tie and overtime loss for the Ice Bears. Macon was 0 for 3 on the power play while Knoxville failed to convert on its only chance with the man advantage.
FINALLY IN FIRST: While Macon has had the best winning percentage in the league for most of the season, last night's game officially put them in first place in terms of standing points. The Mayhem are the first team this season to reach the 20-point plateau and can be the first team in the league to hit double digits in wins with a victory today over Knoxville, both remarkable feats given the 20-day layoff last month due to SPHL health and safety protocols. Parity is still the name of the game in the SPHL as just five points separate the Mayhem from last-place Knoxville in the standings; however, Macon still has at least two games in hand on every other team in the league coming into today's game.
NEWCOMERS NO SPHL STRANGERS: Besides Nick Minerva's return from the ECHL's Tulsa Oilers, the two newest acquisitions on the team, forward Mike Gornall and Andrew Romano, come to Macon from stints with other SPHL clubs earlier in the season. Gornall, who played in his first game with the Mayhem last night, previously skated with Knoxville earlier in the year, logging a goal in five games. Romano played in 11 games with Huntsville prior to coming to Macon last week, tallying five points with the Havoc; he made an instant splash with the Mayhem, notching an assist in each of his first two games last weekend in the pair of wins in Pensacola.
Baptista's OT Game Winner Sends Mayhem into First Place
Brice's Shorthanded Goal Helps First-Place Mayhem to 4th Straight Home Win

redpajama_set_name: RedPajamaCommonCrawl


Please fill your details in this form to schedule a test drive.
All our cars come with our peace of mind guarantees, just what you would expect from a family business small enough to care and big enough to give you the service you would expect from a main dealer.
Jeremy Round Cars Limited is a company registered in England and Wales with company number 05629869.


text:
What We're Watching & What We're Ignoring ›
What We're Watching & What We're Ignoring
Ukraine and Russia – In October, the Orthodox Christian Church patriarch in Istanbul announced he would recognize a new Ukrainian church that's independent of Russia. This news has triggered intense debate within the Ukrainian church and angered the Kremlin.
Tomorrow, Ukrainian religious leaders are set to hold a "unification assembly" to establish the new church and choose its leader. Watch for provocations, even confrontation, in coming days between Russia and Ukraine in breakaway regions of Ukraine and in the Black Sea.
A "Cyber-attack" on China – Despite encouraging signs of compromise in the US-China trade war, we're watching for a possible US escalation against suspected Chinese hacking after revelations of a massive Beijing-sponsored infiltration of the US hotel chain Marriott. In coming days, the US may claim China has violated the cyber-espionage agreement Chinese President Xi Jinping made with former president Barack Obama. That might lead to an indictment of hackers accused of working for Chinese security services, a significant escalation in the broader US-China standoff over cyber-security.
WHAT WE'RE IGNORING
Russian Robots – During its coverage of a technology forum held each year to celebrate "future intellectual leaders of Russia," a Russian state television channel praised the highly modern design of "Robot Boris," which demonstrated a few interesting dance moves in front of a live audience and bragged that it "knows mathematics well." Turns out "Robot Boris" was a guy in a robot suit.
Chicken logs – On Thursday, US fast-food chain KFC announced the grand unveiling of the "KFC 11 Herbs and Spices firelog." Light this thing up, and it smells like fried chicken. Reaction in our office ranged from "Where can I get one?" to "That's the most disgusting thing I've ever heard." Your Friday author considers this "firelog" an affront to human dignity, but I'm ignoring this debate because my time is better spent watching for fake robots and trying to figure out Brexit.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Interface org.apache.fop.fonts.FontConfigurator (Apache FOP 2.1 API)
</TITLE>

<META NAME="date" CONTENT="2016-01-07">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

fop 2.1

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.apache.fop.fonts.FontConfigurator

Packages that use FontConfigurator

org.apache.fop.fonts
Classes for font handling.

org.apache.fop.render
Generic renderer interface.

Uses of FontConfigurator in org.apache.fop.fonts

Classes in org.apache.fop.fonts that implement FontConfigurator

 class
DefaultFontConfigurator

          The default configurator for fonts.

Uses of FontConfigurator in org.apache.fop.render

Constructors in org.apache.fop.render with parameters of type FontConfigurator

PrintRendererConfigurator(FOUserAgent userAgent,
                          RendererConfig.RendererConfigParser rendererConfigParser,
                          FontConfigurator<EmbedFontInfo> fontInfoConfigurator)

          Default constructor

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

fop 2.1

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.


text:
Q: Understanding of a C code required int Size(struct node* node)
{
   if(node == NULL)
   {
      return 0;
   }
   else if(node != NULL)
   {
      return (Size(node->left) + 1 + Size(node->right));
   }
}

Hi, can anybody please post the stack trace for the following piece of code.
Lets say if we insert the values 2, 1, 10, 5...
Then what could be the stack representation during the recursion process.. Please, its very urgent, and its very confusing too...

A: Why not simply use printf? One when entering and one when leaving the function:
int Size(struct node* node)
{
    printf("Enter %d\n", ( node ? node->value : -1 ));
    ...
    printf("Leave %d\n", ( node ? node->value : -1 ));
}

A: Try using gdb and see the backtrace/bt command for gdb.

redpajama_set_name: RedPajamaStackExchange


text:
Today in History: Satyendranath Bose | इतिहास के पन्नों में | 21 November, 2022
Sansad Television is the Parliamentary channel of India. It was created in 2021 by merging Lok Sabha Television and Rajya Sabha Television.
-FB: https://www.facebook.com/SansadTelevi…
Subscribe to Sansad TV YouTube Channel: https://www.youtube.com/c/SansadTV
Visit Sansad TV website: https://sansadtv.nic.in/
Today in History | France Nuclear Test | इतिहास के पन्नों में | 29 January, 2023
Today in History | Mahatma Gandhi | इतिहास के पन्नों में | 30 January, 2023
Today in History | इतिहास के पन्नों में | Lala Lajpat Rai | 28 January 2023
Today in History | Apolo-1 Spacecraft | इतिहास के पन्नों में | 27 January, 2023
Today in History | Republic Day | इतिहास के पन्नों में | 26 January, 2023
Today in History: Election Commission | इतिहास के पन्नों में | 25 January 2023
Today in History: National Anthem | इतिहास के पन्नों में | 24 January 2023
Today in History: Netaji Subhash Chandra Bose | इतिहास के पन्नों में | 23 January 2023
Today in History | Roshan Singh | इतिहास के पन्नों में | 22 January, 2023
Today in History: Statehood of Manipur, Meghalaya & Tripura | इतिहास के पन्नों में | 21 January 2023
Today in History | Khan Abdul Ghaffar Khan | इतिहास के पन्नों में | 20 January 2023
Today in History | Maharana Pratap | इतिहास के पन्नों में | 19 January 2023
Today in History | First Time X-Ray | इतिहास के पन्नों में | 18 January 2023
Today in History | First Summit of UNSC | इतिहास के पन्नों में | 17 January 2023
Today in History | Sarat Chandra Chattopadhyay | इतिहास के पन्नों में | 16 January 2023
Today in History | First Indian Olympic Medal in Individual Competition | 15 January, 2023
Today in History | Third Panipat War | इतिहास के पन्नों में | 14 January 2023
Today in History| इतिहास के पन्नों में | 13 January 2023
Today in History: Swami Vivekanand | इतिहास के पन्नों में | 12 January 2023
Today in History: Lal Bahadur Shastri | Today in History | इतिहास के पन्नों में | 11 January 2023