text:
<?php

class ezcReflectionExtensionExternalTest extends ezcReflectionExtensionTest
{
    public function setUp() {
        $this->phpExtRef = new ReflectionExtension('Reflection');
        $this->phpExtSpl = new ReflectionExtension('Spl');
        $this->extRef = new ezcReflectionExtension($this->phpExtRef);
        $this->extSpl = new ezcReflectionExtension($this->phpExtSpl);
    }

    public static function suite()
    {
         return new PHPUnit_Framework_TestSuite( "ezcReflectionExtensionExternalTest" );
    }
}
?>


text:
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004-2020 musikcube team
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//    * Redistributions of source code must retain the above copyright notice,
//      this list of conditions and the following disclaimer.
//
//    * Redistributions in binary form must reproduce the above copyright
//      notice, this list of conditions and the following disclaimer in the
//      documentation and/or other materials provided with the distribution.
//
//    * Neither the name of the author nor the names of other contributors may
//      be used to endorse or promote products derived from this software
//      without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////

#include "Transcoder.h"
#include "BlockingTranscoder.h"
#include "TranscodingAudioDataStream.h"
#include "Constants.h"
#include "Util.h"
#include <musikcore/sdk/IBlockingEncoder.h>

#include <thread>
#include <set>

#pragma warning(push, 0)
#include <boost/filesystem.hpp>
#pragma warning(pop)

using namespace musik::core::sdk;
using namespace boost::filesystem;

std::mutex transcoderMutex;
std::condition_variable waitForTranscode;
std::set<std::string> runningBlockingTranscoders;

static IEncoder* getEncoder(Context& context, const std::string& format) {
    std::string extension = "." + format;
    return context.environment->GetEncoder(extension.c_str());
}

template <typename T>
static T* getTypedEncoder(Context& context, const std::string& format) {
    IEncoder* encoder = getEncoder(context, format);
    if (encoder) {
        T* typedEncoder = dynamic_cast<T*>(encoder);
        if (typedEncoder) {
            return typedEncoder;
        }
        encoder->Release();
    }
    return nullptr;
}

static std::string cachePath(Context& context) {
    char buf[4096];
    context.environment->GetPath(PathType::Data, buf, sizeof(buf));
    std::string path = std::string(buf) + "/cache/transcoder/";
	boost::filesystem::path boostPath(path);
    if (!exists(boostPath)) {
        create_directories(boostPath);
    }

    return path;
}

static void iterateTranscodeCache(Context& context, std::function<void(path)> cb) {
    if (cb) {
        directory_iterator end;
        directory_iterator file(cachePath(context));

        while (file != end) {
            if (!is_directory(file->status())) {
                cb(file->path());
            }
            ++file;
        }
    }
}

void Transcoder::RemoveTempTranscodeFiles(Context& context) {
    iterateTranscodeCache(context, [](path p) {
        if (p.extension().string() == ".tmp") {
            boost::system::error_code ec;
            remove(p, ec);
        }
    });
}

void Transcoder::PruneTranscodeCache(Context& context) {
    std::map<time_t, path> sorted;

    boost::system::error_code ec;
    iterateTranscodeCache(context, [&sorted, &ec](path p) {
        sorted[last_write_time(p, ec)] = p;
    });

    int maxSize = context.prefs->GetInt(
        prefs::transcoder_cache_count.c_str(),
        defaults::transcoder_cache_count);

    int extra = (int) sorted.size() - (maxSize - 1);
    auto it = sorted.begin();
    while (extra > 0 && it != sorted.end()) {
        auto p = it->second;
        boost::system::error_code ec;
        if (remove(p, ec)) {
            --extra;
        }
        ++it;
    }
}

static void getTempAndFinalFilename(
    Context& context,
    const std::string& uri,
    size_t bitrate,
    const std::string& format,
    std::string& tempFn,
    std::string& finalFn)
{
    finalFn = std::string(
        cachePath(context) +
        std::to_string(std::hash<std::string>()(uri)) +
        "-" + std::to_string(bitrate) +
        "." + format);

    do {
        tempFn = finalFn + "." + std::to_string(rand()) + ".tmp";
    } while (exists(tempFn));
}

IDataStream* Transcoder::Transcode(
    Context& context,
    const std::string& uri,
    size_t bitrate,
    const std::string& format)
{
    if (context.prefs->GetBool(
        prefs::transcoder_synchronous.c_str(),
        defaults::transcoder_synchronous))
    {
        return TranscodeAndWait(context, getEncoder(context, format), uri, bitrate, format);
    }

    /* on-demand is the default. however, on-demand transcoding is only available
    for `IStreamingEncoder` types.  */
    IStreamingEncoder* audioStreamEncoder = getTypedEncoder<IStreamingEncoder>(context, format);
    if (audioStreamEncoder) {
        return TranscodeOnDemand(context, audioStreamEncoder, uri, bitrate, format);
    }

    return TranscodeAndWait(context, nullptr, uri, bitrate, format);
}

IDataStream* Transcoder::TranscodeOnDemand(
    Context& context,
    IStreamingEncoder* encoder,
    const std::string& uri,
    size_t bitrate,
    const std::string& format)
{
    /* the caller can specify an encoder; if it is not specified, go ahead and
    create one here */
    if (!encoder) {
        encoder = getTypedEncoder<IStreamingEncoder>(context, format);
        if (!encoder) {
            return nullptr;
        }
    }

    /* see if it already exists in the cache. if it does, just return it. */
    std::string expectedFilename, tempFilename;
    getTempAndFinalFilename(context, uri, bitrate, format, tempFilename, expectedFilename);

    if (exists(expectedFilename)) {
        boost::system::error_code ec;
        last_write_time(expectedFilename, time(nullptr), ec);
        return context.environment->GetDataStream(expectedFilename.c_str(), OpenFlags::Read);
    }

    /* if it doesn't exist, check to see if the cache is enabled. */
    int cacheCount = context.prefs->GetInt(
        prefs::transcoder_cache_count.c_str(),
        defaults::transcoder_cache_count);

    TranscodingAudioDataStream* transcoderStream = nullptr;

    if (cacheCount > 0) {
        PruneTranscodeCache(context);

        transcoderStream = new TranscodingAudioDataStream(
            context, encoder, uri, tempFilename, expectedFilename, bitrate, format);

        /* if the stream has an indeterminite length, close it down and
        re-open it without caching options; we don't want to fill up
        the storage disk */
        if (transcoderStream->Length() < 0) {
            transcoderStream->Release();
            delete transcoderStream;
            transcoderStream = new TranscodingAudioDataStream(context, encoder, uri, bitrate, format);
        }
    }
    else {
        transcoderStream = new TranscodingAudioDataStream(context, encoder, uri, bitrate, format);
    }

    return transcoderStream;
}

IDataStream* Transcoder::TranscodeAndWait(
    Context& context,
    IEncoder* encoder,
    const std::string& uri,
    size_t bitrate,
    const std::string& format)
{
    /* the caller can specify an encoder; if it is not specified, go ahead and
    create one here */
    if (!encoder) {
        encoder = getEncoder(context, format);
        if (!encoder) {
            return nullptr;
        }
    }

    std::string expectedFilename, tempFilename;
    getTempAndFinalFilename(context, uri, bitrate, format, tempFilename, expectedFilename);

    /* already exists? */
    if (exists(expectedFilename)) {
        boost::system::error_code ec;
        last_write_time(expectedFilename, time(nullptr), ec);
        return context.environment->GetDataStream(expectedFilename.c_str(), OpenFlags::Read);
    }

    IStreamingEncoder* audioStreamEncoder = dynamic_cast<IStreamingEncoder*>(encoder);
    if (audioStreamEncoder) {
        TranscodingAudioDataStream* transcoderStream = new TranscodingAudioDataStream(
            context, audioStreamEncoder, uri, tempFilename, expectedFilename, bitrate, format);

        /* transcoders with a negative length have an indeterminate duration, so
        we disallow waiting for them because they may never finish */
        if (transcoderStream->Length() < 0) {
            transcoderStream->Release();
            delete transcoderStream;
            return nullptr;
        }

        char buffer[8192];
        while (!transcoderStream->Eof()) {
            transcoderStream->Read(buffer, sizeof(buffer));
            std::this_thread::yield();
        }

        transcoderStream->Release();
        PruneTranscodeCache(context);
        return context.environment->GetDataStream(uri.c_str(), OpenFlags::Read);
    }
    else {
        IBlockingEncoder* blockingEncoder = dynamic_cast<IBlockingEncoder*>(encoder);
        if (blockingEncoder) {
            bool alreadyTranscoding = false;
            {
                /* see if there's already a blocking transcoder running for the specified
                uri. if there is, wait for it to complete. if there's not, add it to the
                running set */
                std::unique_lock<std::mutex> lock(transcoderMutex);
                alreadyTranscoding = runningBlockingTranscoders.find(uri) != runningBlockingTranscoders.end();
                if (alreadyTranscoding) {
                    while (runningBlockingTranscoders.find(uri) != runningBlockingTranscoders.end()) {
                        waitForTranscode.wait(lock);
                    }
                }
                else {
                    runningBlockingTranscoders.insert(uri);
                }
            }

            if (!alreadyTranscoding) {
                BlockingTranscoder blockingTranscoder(
                    context, blockingEncoder, uri, tempFilename, expectedFilename, bitrate);

                bool success = blockingTranscoder.Transcode();

                {
                    /* let anyone else waiting for a resource to be transcoding that we
                    finished. */
                    std::unique_lock<std::mutex> lock(transcoderMutex);
                    auto it = runningBlockingTranscoders.find(uri);
                    if (it != runningBlockingTranscoders.end()) {
                        runningBlockingTranscoders.erase(it);
                    }
                    waitForTranscode.notify_all();
                }

                if (!success) {
                    return nullptr;
                }
            }
        }

        PruneTranscodeCache(context);
        return context.environment->GetDataStream(expectedFilename.c_str(), OpenFlags::Read);
    }
}

int Transcoder::GetActiveCount() {
    return BlockingTranscoder::GetActiveCount() + TranscodingAudioDataStream::GetActiveCount();
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';
moduloSistema.controller('LogoutController', ['$scope', '$routeParams', '$location', 'sessionServerCallService', 'sessionService', '$route',
    function ($scope, $routeParams, $location, sessionServerCallService, sessionService, $route) {
        $scope.title = "Bye";
        $scope.icon = "fa-sign-out";
        $scope.session_info = sessionService.getSessionInfo();
        $scope.isSessionActive = sessionService.isSessionActive();
        sessionServerCallService.logout().then(function (response) {
            if (response.status == 200) {
                if (response.data.status == 200) {
                    sessionService.setSessionInactive();
                    $scope.session_info = sessionService.getSessionInfo();
                    $scope.isSessionActive = sessionService.isSessionActive();
                    $scope.status = "Has salido del sistema";
                    $route.reload();
                    //$location.path('home');
                } else {
                    $scope.status = "Error en la recepción de datos del servidor";
                }
            } else {
                $scope.status = "Error en la recepción de datos del servidor";
            }
        }).catch(function (data) {
            $scope.status = "Error en la recepción de datos del servidor";
        });
    }]);


text:
namespace Kvasir {
//Analog to digital converter
    namespace Adc3Sr{    ///<status register
        using Addr = Register::Address<0x40013c00,0xffffffe0,0x00000000,unsigned>;
        ///Regular channel start flag
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> strt{};
        ///Injected channel start              flag
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> jstrt{};
        ///Injected channel end of              conversion
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> jeoc{};
        ///Regular channel end of              conversion
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> eoc{};
        ///Analog watchdog flag
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> awd{};
    }
    namespace Adc3Cr1{    ///<control register 1
        using Addr = Register::Address<0x40013c04,0xff3f0000,0x00000000,unsigned>;
        ///Analog watchdog enable on regular              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> awden{};
        ///Analog watchdog enable on injected              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,unsigned> jawden{};
        ///Discontinuous mode channel              count
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,13),Register::ReadWriteAccess,unsigned> discnum{};
        ///Discontinuous mode on injected              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> jdiscen{};
        ///Discontinuous mode on regular              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> discen{};
        ///Automatic injected group              conversion
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> jauto{};
        ///Enable the watchdog on a single channel              in scan mode
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> awdsgl{};
        ///Scan mode
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> scan{};
        ///Interrupt enable for injected              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> jeocie{};
        ///Analog watchdog interrupt              enable
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> awdie{};
        ///Interrupt enable for EOC
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> eocie{};
        ///Analog watchdog channel select              bits
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> awdch{};
    }
    namespace Adc3Cr2{    ///<control register 2
        using Addr = Register::Address<0x40013c08,0xff0106f0,0x00000000,unsigned>;
        ///Temperature sensor and VREFINT              enable
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> tsvrefe{};
        ///Start conversion of regular              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,unsigned> swstart{};
        ///Start conversion of injected              channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,unsigned> jswstart{};
        ///External trigger conversion mode for              regular channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,unsigned> exttrig{};
        ///External event select for regular              group
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,17),Register::ReadWriteAccess,unsigned> extsel{};
        ///External trigger conversion mode for              injected channels
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> jexttrig{};
        ///External event select for injected              group
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> jextsel{};
        ///Data alignment
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> align{};
        ///Direct memory access mode
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> dma{};
        ///Reset calibration
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> rstcal{};
        ///A/D calibration
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> cal{};
        ///Continuous conversion
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cont{};
        ///A/D converter ON / OFF
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> adon{};
    }
    namespace Adc3Smpr1{    ///<sample time register 1
        using Addr = Register::Address<0x40013c0c,0xff000000,0x00000000,unsigned>;
        ///Channel 10 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,0),Register::ReadWriteAccess,unsigned> smp10{};
        ///Channel 11 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,3),Register::ReadWriteAccess,unsigned> smp11{};
        ///Channel 12 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,6),Register::ReadWriteAccess,unsigned> smp12{};
        ///Channel 13 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,9),Register::ReadWriteAccess,unsigned> smp13{};
        ///Channel 14 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> smp14{};
        ///Channel 15 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,15),Register::ReadWriteAccess,unsigned> smp15{};
        ///Channel 16 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,18),Register::ReadWriteAccess,unsigned> smp16{};
        ///Channel 17 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,21),Register::ReadWriteAccess,unsigned> smp17{};
    }
    namespace Adc3Smpr2{    ///<sample time register 2
        using Addr = Register::Address<0x40013c10,0xc0000000,0x00000000,unsigned>;
        ///Channel 0 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,0),Register::ReadWriteAccess,unsigned> smp0{};
        ///Channel 1 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,3),Register::ReadWriteAccess,unsigned> smp1{};
        ///Channel 2 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,6),Register::ReadWriteAccess,unsigned> smp2{};
        ///Channel 3 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,9),Register::ReadWriteAccess,unsigned> smp3{};
        ///Channel 4 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> smp4{};
        ///Channel 5 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,15),Register::ReadWriteAccess,unsigned> smp5{};
        ///Channel 6 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,18),Register::ReadWriteAccess,unsigned> smp6{};
        ///Channel 7 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,21),Register::ReadWriteAccess,unsigned> smp7{};
        ///Channel 8 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(26,24),Register::ReadWriteAccess,unsigned> smp8{};
        ///Channel 9 sample time              selection
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(29,27),Register::ReadWriteAccess,unsigned> smp9{};
    }
    namespace Adc3Jofr1{    ///<injected channel data offset register          x
        using Addr = Register::Address<0x40013c14,0xfffff000,0x00000000,unsigned>;
        ///Data offset for injected channel              x
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> joffset1{};
    }
    namespace Adc3Jofr2{    ///<injected channel data offset register          x
        using Addr = Register::Address<0x40013c18,0xfffff000,0x00000000,unsigned>;
        ///Data offset for injected channel              x
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> joffset2{};
    }
    namespace Adc3Jofr3{    ///<injected channel data offset register          x
        using Addr = Register::Address<0x40013c1c,0xfffff000,0x00000000,unsigned>;
        ///Data offset for injected channel              x
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> joffset3{};
    }
    namespace Adc3Jofr4{    ///<injected channel data offset register          x
        using Addr = Register::Address<0x40013c20,0xfffff000,0x00000000,unsigned>;
        ///Data offset for injected channel              x
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> joffset4{};
    }
    namespace Adc3Htr{    ///<watchdog higher threshold          register
        using Addr = Register::Address<0x40013c24,0xfffff000,0x00000000,unsigned>;
        ///Analog watchdog higher              threshold
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> ht{};
    }
    namespace Adc3Ltr{    ///<watchdog lower threshold          register
        using Addr = Register::Address<0x40013c28,0xfffff000,0x00000000,unsigned>;
        ///Analog watchdog lower              threshold
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,0),Register::ReadWriteAccess,unsigned> lt{};
    }
    namespace Adc3Sqr1{    ///<regular sequence register 1
        using Addr = Register::Address<0x40013c2c,0xff000000,0x00000000,unsigned>;
        ///Regular channel sequence              length
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,20),Register::ReadWriteAccess,unsigned> l{};
        ///16th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,15),Register::ReadWriteAccess,unsigned> sq16{};
        ///15th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,10),Register::ReadWriteAccess,unsigned> sq15{};
        ///14th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,5),Register::ReadWriteAccess,unsigned> sq14{};
        ///13th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> sq13{};
    }
    namespace Adc3Sqr2{    ///<regular sequence register 2
        using Addr = Register::Address<0x40013c30,0xc0000000,0x00000000,unsigned>;
        ///12th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(29,25),Register::ReadWriteAccess,unsigned> sq12{};
        ///11th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,20),Register::ReadWriteAccess,unsigned> sq11{};
        ///10th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,15),Register::ReadWriteAccess,unsigned> sq10{};
        ///9th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,10),Register::ReadWriteAccess,unsigned> sq9{};
        ///8th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,5),Register::ReadWriteAccess,unsigned> sq8{};
        ///7th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> sq7{};
    }
    namespace Adc3Sqr3{    ///<regular sequence register 3
        using Addr = Register::Address<0x40013c34,0xc0000000,0x00000000,unsigned>;
        ///6th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(29,25),Register::ReadWriteAccess,unsigned> sq6{};
        ///5th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,20),Register::ReadWriteAccess,unsigned> sq5{};
        ///4th conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,15),Register::ReadWriteAccess,unsigned> sq4{};
        ///3rd conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,10),Register::ReadWriteAccess,unsigned> sq3{};
        ///2nd conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,5),Register::ReadWriteAccess,unsigned> sq2{};
        ///1st conversion in regular              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> sq1{};
    }
    namespace Adc3Jsqr{    ///<injected sequence register
        using Addr = Register::Address<0x40013c38,0xffc00000,0x00000000,unsigned>;
        ///Injected sequence length
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,20),Register::ReadWriteAccess,unsigned> jl{};
        ///4th conversion in injected              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,15),Register::ReadWriteAccess,unsigned> jsq4{};
        ///3rd conversion in injected              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,10),Register::ReadWriteAccess,unsigned> jsq3{};
        ///2nd conversion in injected              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,5),Register::ReadWriteAccess,unsigned> jsq2{};
        ///1st conversion in injected              sequence
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> jsq1{};
    }
    namespace Adc3Jdr1{    ///<injected data register x
        using Addr = Register::Address<0x40013c3c,0xffff0000,0x00000000,unsigned>;
        ///Injected data
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> jdata{};
    }
    namespace Adc3Jdr2{    ///<injected data register x
        using Addr = Register::Address<0x40013c40,0xffff0000,0x00000000,unsigned>;
        ///Injected data
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> jdata{};
    }
    namespace Adc3Jdr3{    ///<injected data register x
        using Addr = Register::Address<0x40013c44,0xffff0000,0x00000000,unsigned>;
        ///Injected data
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> jdata{};
    }
    namespace Adc3Jdr4{    ///<injected data register x
        using Addr = Register::Address<0x40013c48,0xffff0000,0x00000000,unsigned>;
        ///Injected data
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> jdata{};
    }
    namespace Adc3Dr{    ///<regular data register
        using Addr = Register::Address<0x40013c4c,0xffff0000,0x00000000,unsigned>;
        ///Regular data
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> data{};
    }
}


text:
package main

import (
	"github.com/robfig/cron"
	"log"
)

type Scheduler struct {
	Instance *cron.Cron
}

var Skeddy *Scheduler

func NewScheduler() *Scheduler {
	return &Scheduler{Instance: cron.New()}
}

func (s *Scheduler) Start(entries []*Entry) {
	log.Println("Starting scheduler ...")
	s.Instance.Start()
	for _, e := range entries {
		s.AddEntry(e)
	}
}

func (s *Scheduler) AddEntry(e *Entry) {
	log.Println("Adding entry", e)
	s.Instance.AddFunc(e.Expression, func() { Dispatch(e.Endpoint, e.Payload) })
}

func (s *Scheduler) ReStart(entries []*Entry) {
	log.Println("Restarting scheduler ...")
	s.Instance.Stop()
	s.Instance = cron.New()
	s.Instance.Start()
	for _, e := range entries {
		s.AddEntry(e)
	}
}

func StartScheduler() {
	Skeddy = NewScheduler()
	entries := Store.AllEntries()
	Skeddy.Start(entries)
}

func ParseExpression(expression string) error {
	_, err := cron.Parse(expression)
	return err
}


text:
@Vetoed
package org.jboss.weld.bean.builtin;
import javax.enterprise.inject.Vetoed;


text:
import { FactionModel } from './../../shared/models/faction.model';
import { SuperheroModel } from './../../shared/models/superhero.model';
import { UserModel } from './../../shared/models/user.model';

let superheroes: SuperheroModel[] = [
    { name: 'Batman', secretIdentity: 'Bruce Wayne', powers: ['Utility belt', 'Martial arts', 'Intelligence'] },
    { name: 'Dr. Strange', secretIdentity: 'Dr. Stephen Strange', powers: ['Magic', 'Martial arts'] },
    { name: 'Spiderman', secretIdentity: 'Peter Parker', powers: ['Web', 'Agility', 'Super strength'] }
];

let factions: FactionModel[] = [
    { name: 'Avengers' },
    { name: 'Justice League' },
    { name: 'The Bat Family' },
    { name: 'Fantastic Four' },
    { name: 'Guardians of the Galaxy' }
];

export class DataService {
    findUserByCredentials(username: string, password: string): Promise<UserModel> {
        return Promise.resolve(null);
    }

    findUserById(id: string): Promise<UserModel> {
        return Promise.resolve(null);
    }

    getFractionByName(name: string): Promise<FactionModel> {
        return Promise.resolve(factions.find(f => f.name === name));
    }

    getFractions(): Promise<FactionModel[]> {
        return Promise.resolve(factions);
    }

    getSuperheroByName(name: string): Promise<SuperheroModel> {
        return Promise.resolve(superheroes.find(f => f.name.toLowerCase() === name));
    }

    getSuperheroes(): Promise<SuperheroModel[]> {
        return Promise.resolve(superheroes);
    }
};


text:
package com.amazonaws.services.apigateway.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Updates an existing documentation part of a given API.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateDocumentationPartRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * [Required] The identifier of an API of the to-be-updated documentation part.
     *

     */
    private String restApiId;
    /**
     *

     * [Required] The identifier of the to-be-updated documentation part.
     *

     */
    private String documentationPartId;
    /**
     *

     * A list of update operations to be applied to the specified resource and in the order specified in this list.
     *

     */
    private java.util.List<PatchOperation> patchOperations;

    /**
     *

     * [Required] The identifier of an API of the to-be-updated documentation part.
     *

     *
     * @param restApiId
     *        [Required] The identifier of an API of the to-be-updated documentation part.
     */

    public void setRestApiId(String restApiId) {
        this.restApiId = restApiId;
    }

    /**
     *

     * [Required] The identifier of an API of the to-be-updated documentation part.
     *

     *
     * @return [Required] The identifier of an API of the to-be-updated documentation part.
     */

    public String getRestApiId() {
        return this.restApiId;
    }

    /**
     *

     * [Required] The identifier of an API of the to-be-updated documentation part.
     *

     *
     * @param restApiId
     *        [Required] The identifier of an API of the to-be-updated documentation part.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateDocumentationPartRequest withRestApiId(String restApiId) {
        setRestApiId(restApiId);
        return this;
    }

    /**
     *

     * [Required] The identifier of the to-be-updated documentation part.
     *

     *
     * @param documentationPartId
     *        [Required] The identifier of the to-be-updated documentation part.
     */

    public void setDocumentationPartId(String documentationPartId) {
        this.documentationPartId = documentationPartId;
    }

    /**
     *

     * [Required] The identifier of the to-be-updated documentation part.
     *

     *
     * @return [Required] The identifier of the to-be-updated documentation part.
     */

    public String getDocumentationPartId() {
        return this.documentationPartId;
    }

    /**
     *

     * [Required] The identifier of the to-be-updated documentation part.
     *

     *
     * @param documentationPartId
     *        [Required] The identifier of the to-be-updated documentation part.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateDocumentationPartRequest withDocumentationPartId(String documentationPartId) {
        setDocumentationPartId(documentationPartId);
        return this;
    }

    /**
     *

     * A list of update operations to be applied to the specified resource and in the order specified in this list.
     *

     *
     * @return A list of update operations to be applied to the specified resource and in the order specified in this
     *         list.
     */

    public java.util.List<PatchOperation> getPatchOperations() {
        return patchOperations;
    }

    /**
     *

     * A list of update operations to be applied to the specified resource and in the order specified in this list.
     *

     *
     * @param patchOperations
     *        A list of update operations to be applied to the specified resource and in the order specified in this
     *        list.
     */

    public void setPatchOperations(java.util.Collection<PatchOperation> patchOperations) {
        if (patchOperations == null) {
            this.patchOperations = null;
            return;
        }

        this.patchOperations = new java.util.ArrayList<PatchOperation>(patchOperations);
    }

    /**
     *

     * A list of update operations to be applied to the specified resource and in the order specified in this list.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setPatchOperations(java.util.Collection)} or {@link #withPatchOperations(java.util.Collection)} if you
     * want to override the existing values.
     *

     *
     * @param patchOperations
     *        A list of update operations to be applied to the specified resource and in the order specified in this
     *        list.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateDocumentationPartRequest withPatchOperations(PatchOperation... patchOperations) {
        if (this.patchOperations == null) {
            setPatchOperations(new java.util.ArrayList<PatchOperation>(patchOperations.length));
        }
        for (PatchOperation ele : patchOperations) {
            this.patchOperations.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of update operations to be applied to the specified resource and in the order specified in this list.
     *

     *
     * @param patchOperations
     *        A list of update operations to be applied to the specified resource and in the order specified in this
     *        list.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateDocumentationPartRequest withPatchOperations(java.util.Collection<PatchOperation> patchOperations) {
        setPatchOperations(patchOperations);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getRestApiId() != null)
            sb.append("RestApiId: ").append(getRestApiId()).append(",");
        if (getDocumentationPartId() != null)
            sb.append("DocumentationPartId: ").append(getDocumentationPartId()).append(",");
        if (getPatchOperations() != null)
            sb.append("PatchOperations: ").append(getPatchOperations());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof UpdateDocumentationPartRequest == false)
            return false;
        UpdateDocumentationPartRequest other = (UpdateDocumentationPartRequest) obj;
        if (other.getRestApiId() == null ^ this.getRestApiId() == null)
            return false;
        if (other.getRestApiId() != null && other.getRestApiId().equals(this.getRestApiId()) == false)
            return false;
        if (other.getDocumentationPartId() == null ^ this.getDocumentationPartId() == null)
            return false;
        if (other.getDocumentationPartId() != null && other.getDocumentationPartId().equals(this.getDocumentationPartId()) == false)
            return false;
        if (other.getPatchOperations() == null ^ this.getPatchOperations() == null)
            return false;
        if (other.getPatchOperations() != null && other.getPatchOperations().equals(this.getPatchOperations()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getRestApiId() == null) ? 0 : getRestApiId().hashCode());
        hashCode = prime * hashCode + ((getDocumentationPartId() == null) ? 0 : getDocumentationPartId().hashCode());
        hashCode = prime * hashCode + ((getPatchOperations() == null) ? 0 : getPatchOperations().hashCode());
        return hashCode;
    }

    @Override
    public UpdateDocumentationPartRequest clone() {
        return (UpdateDocumentationPartRequest) super.clone();
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<fileResource exportedWithPermissions="true" dataFile="operators.svg.data">
    <folder>/organizations/organization_1/themes/default/fonts</folder>
    <name>operators.svg</name>
    <version>0</version>
    <label>operators.svg</label>
    <creationDate>2015-05-27T15:05:00.752-07:00</creationDate>
    <updateDate>2015-05-27T15:05:00.752-07:00</updateDate>
    <fileType>img</fileType>
</fileResource>


text:
<?php

namespace s9e\TextFormatter\Configurator\Exceptions;

use DOMNode;
use RuntimeException;
use s9e\TextFormatter\Configurator\Helpers\TemplateHelper;

class UnsafeTemplateException extends RuntimeException
{
	/**
	* @var DOMNode The node that is responsible for this exception
	*/
	protected $node;

	/**
	* @param string  $msg  Exception message
	* @param DOMNode $node The node that is responsible for this exception
	*/
	public function __construct($msg, DOMNode $node)
	{
		parent::__construct($msg);
		$this->node = $node;
	}

	/**
	* Return the node that has caused this exception
	*
	* @return DOMNode
	*/
	public function getNode()
	{
		return $this->node;
	}

	/**
	* Highlight the source of the template that has caused this exception, with the node highlighted
	*
	* @param  string $prepend HTML to prepend
	* @param  string $append  HTML to append
	* @return string          Template's source, as HTML
	*/
	public function highlightNode($prepend = '', $append = '')
	{
		return TemplateHelper::highlightNode($this->node, $prepend, $append);
	}

	/**
	* Change the node associated with this exception
	*
	* @param  DOMNode $node
	* @return void
	*/
	public function setNode(DOMNode $node)
	{
		$this->node = $node;
	}
}


text:
class Editorial < ApplicationRecord
  belongs_to :contest
end


text:
package xacml

import (
	"errors"
	"strconv"
)

func resolveAttributeValue(attributeValueMap map[string]interface{}, request Request) (interface{}, error) {
	attributeValueString, ok := attributeValueMap["#text"].(string)
	if !ok {
		return nil, errors.New("attributeValueString not ok")
	}
	attributeValueDataType, ok := attributeValueMap["-DataType"].(string)
	if !ok {
		return nil, errors.New("attributeValueDataType not ok")
	}
	return convertAttributeToDataType(attributeValueString, attributeValueDataType)
}

func resolveAttributeDesignator(attributeDesignatorMap map[string]interface{}, request Request) (interface{}, error) {
	attributeDesignatorMustBePresentString, ok := attributeDesignatorMap["-MustBePresent"].(string)
	if !ok {
		attributeDesignatorMustBePresentString = "false"
	}
	attributeDesignatorMustBePresent, err := strconv.ParseBool(attributeDesignatorMustBePresentString)
	if err != nil {
		return nil, err
	}
	attributeDesignatorAttributeId, ok := attributeDesignatorMap["-AttributeId"].(string)
	if !ok {
		return nil, errors.New("attributeDesignatorAttributeId not ok")
	}
	attributeDesignatorCategory, ok := attributeDesignatorMap["-Category"].(string)
	if !ok {
		return nil, errors.New("attributeDesignatorCategory not ok")
	}
	attributeDesignatorDataType, ok := attributeDesignatorMap["-DataType"].(string)
	if err != nil {
		return nil, errors.New("attributeDesignatorDataType not ok")
	}
	return request.GetAttribute(attributeDesignatorCategory, attributeDesignatorAttributeId, attributeDesignatorDataType, attributeDesignatorMustBePresent)
}

func convertAttributeToDataType(attributeValue, dataType string) (interface{}, error) {
	switch dataType {
	case DataTypeString:
		return attributeValue, nil
	case DataTypeBoolean:
		return strconv.ParseBool(attributeValue)
	case DataTypeInteger:
		return strconv.ParseInt(attributeValue, 10, 64)
	case DataTypeDouble:
		return strconv.ParseFloat(attributeValue, 64)
	default:
		return attributeValue, errors.New("Unknown or Unsupported DataType")
	}
}

func defaultValueForDataType(dataType string) interface{} {
	switch dataType {
	case DataTypeString:
		return ""
	case DataTypeBoolean:
		return false
	case DataTypeInteger:
		return int64(0)
	case DataTypeDouble:
		return float64(0)
	default:
		return ""
	}
}


text:
title: 'HP Virtual Connect Domain Setup – Part 4: Server Profiles'
date: 2011-01-07
type: post
classes: wide
published: true
status: publish
categories:
- HP
- Networking
- Virtualization
tags:
- HP
- HP BladeSystem
- networking
- VC server profiles
- VCEM
- VCM
- Virtual Connect
- Virtual Connect Manager
author: juan_manuel_rey
comments: true
image:
  feature: banner-blades.png
---

This is the fourth and last part of this series of posts about Virtual Connect, the first three were:

-   [**HP Virtual Connect Domain Setup - Part 1: Domain Setup Wizard**]({% post_url 2010-12-20-hp-virtual-connect-domain-setup-part-1-domain-setup-wizard %} "HP Virtual Connect Domain Setup – Part 1: Domain Setup Wizard")
-   [**HP Virtual Connect Domain Setup - Part 2: Networking Setup**]({% post_url 2010-12-21-hp-virtual-connect-domain-setup-part-2-network-setup %} "HP Virtual Connect Domain Setup – Part 2: Network Setup")
-   [**HP Virtual Connect Domain Setup - Part 3: Storage Setup**]({% post_url 2011-01-05-hp-virtual-connect-domain-setup-part-3-storage-setup %} "HP Virtual Connect Domain Setup – Part 3: Storage Setup")

In this final post I will discuss **Server Profiles**, what are they and how to create. As in the rest of the series I'm using **Virtual Connect 3.10**.

So, what is a Server Profile? We can define a Virtual Connect server profile as a logical grouping of attributes related to server connectivity that can be assigned to a server blade. You can see it as the connectivity personality of the server.

The server profile includes:

-   MAC address.
-   Pre-boot Execution Environment (PXE) enablement.
-   Network connection setting for each NIC port and WWN.
-   SAN fabric connection.
-   SAN boot parameter setting for each Fibre Channel HBA port.

Once the server profile is created you can apply it to any server within the VC Domain. There is a maximum of 64 fully populated VC Server Profiles in a VC Domain.

As we saw in the network and storage posts the VCM can be configured so that blade servers use their factory-default MACs/WWNs and serial numbers or Virtual Connect provided and administered ranges of MACs and WWNs. These MACs and WWNs will override the default MAC and WWN values when a server profile is applied to the server and appear to pre-boot environments and host operating systems as the hardware addresses.

When a server profile is assigned to a Device Bay the **Virtual Connect Manager** securely connects to the blade in the bay and configures the NIC ports with profile provided MAC addresses and PXE settings and the FC HBA ports with the appropriate WWNs and SAN boot settings. Additionally the VCM automatically connects the server to the specified networks and SAN fabrics.

This server profile can then be copied or reassigned to another server as needed without interrupting the server connectivity to the network and SAN.

Once a blade server has been assigned a server profile and as long as it remains in the same device it does not require further VC Manager configuration during server or enclosure power cycle. They boot and access the network and fabric as long as soon as the server and interconnect modules are ready. If a server is inserted into a device bay that has already been assigned a server profile VCM automatically updates the configuration of that server before it is allowed to power on and connect to the network.

If a blade server is moved from a Virtual Connect managed enclosure to a non VC managed one all the ports automatically returns to their original factory values and settings in order to prevent duplicate MAC and WWNs within the datacenter because a blade server redeployment.

In addition to the above information the following points must be considered when working with server profiles:

-   Blade server and card firmware revision must be at a revision that supports Virtual Connect profile assignment.
-   Before creating the first server profile select whether to use Virtual Connect administered MAC and WWN ranges or the local factory default values.
-   After an enclosure is imported into a VC Domain the blades will remain isolated from networks and SAN fabrics until a server profile is assigned.
-   When Virtual Connect administered MACs and/or WWNs or when changing Fibre Channel boot parameters the servers must be powered off in order to receive or relinquish a server profile.
-   Fibre Channel SAN connections will display in the profile server screen only if the VC-FC module in the enclosure managed by Virtual Connect. If there is no VC-FC module the FC option wouldn't appear in the server profile screen until a module has been added.
-   Some server profile SAN boor settings, like the controller boot order, are applied only after the server has been booted with the final mezzanine card configuration.
-   If PXE or SAN boot settings are made outside of Virtual Connect, the settings defined by the server profile will be restored after the blade server completes the next boot cycle.

If you have worked in the past with the 2.x Virtual Connect Manager revisions I'm sure that you will remember the **Server Profile Wizard**. That wizard has been removed from the  3.x revisions of VCM.

[![](/assets/images/vc_230_wizard.png "VCM 2.30 Server Profile Wizard")]({{site.url}}/assets/images/vc_230_wizard.png)

To start the server profile creation you have now to go to the **Virtual Connect Home** and in the **Server** area click on **Define Server Profile**.

[![](/assets/images/server_profiles_1.png "Define Server Profile")]({{site.url}}/assets/images/server_profiles_1.png)

In the Define Server Profile screen first enter the name of the profile, ESX01 in the example, and choose if you want to use factory default MAC and WWN or the VC-predefined.

[![](/assets/images/server_profiles_2.png)]({{site.url}}/assets/images/server_profiles_2.png)

Then move to **Ethernet Network Connections**. Here you can select the networks to assign to the ports, the port speed between AUTO, PREFERRED and CUSTOM and the PXE settings (ENABLED, DISABLED or USE-BIOS). By default there are only two connections created, to add more connections just right-click the area and choose *Add connection*.

[![](/assets/images/server_profiles_3.png)]({{site.url}}/assets/images/server_profiles_3.png)

In Network Name if you choose Multiple Networks a new icon will appear that will allow you to edit this connection type. Click and a new section will show up, this section allows to select the **Shared Uplink Set** and the networks. There is also a checkbox to set if you want to force the same VLAN mappings as the **Shared Uplink Set** to the different networks.

[![](/assets/images/server_profiles_7.png)]({{site.url}}/assets/images/server_profiles_7.png)

The next area is the **FC SAN Connections**. Assign the modules in the bays to the correspondent fabric and set the port speed.

[![](/assets/images/server_profiles_4.png)]({{site.url}}/assets/images/server_profiles_4.png)

Also in this section you can define the SAN boot parameters, click on the checkbox, the page will dim and a pop-up will appear.There you can configure each FC connection as PRIMARY, SECONDARY, DISABLED or USE-BIOS and set the **Target Port Name** and the LUN.

[![](/assets/images/server_profiles_5.png)]({{site.url}}/assets/images/server_profiles_5.png)

Finally we can assign the profile to a server bay.

[![](/assets/images/server_profiles_6.png)]({{site.url}}/assets/images/server_profiles_6.png)

Click Apply and the new server profile will be done. You can always edit the existing server profiles from the **Server Profiles** screen in the VC administration interface.

[![](/assets/images/server_profiles_8.png)]({{site.url}}/assets/images/server_profiles_8.png)

And this is the end. This series is done, if you have follow the correct steps outlined in the four posts you will have a fully operation Virtual Connect Domain. Of course there are a some topics I'd like to write about like iSCSI, FlexFabric and the VCM command line but I believe it's better to do it in their own dedicated posts, stay tuned.

Juanma.


text:
import sys
import json
import time
import argparse
import socket
import websocket
import threading
import uuid
from squirtgun import Squirtgun
from settings import *

class Thread(threading.Thread):
    """ Convenience method for process threads """
    def __init__(self, t, *args):
        threading.Thread.__init__(self, target=t, args=args)
        self.setDaemon(True)
        self.start()

def keepalive(sgc):
    # wait until keepalives are enabled...
    while not sgc.send_keepalives:
        time.sleep(0.01)

    while not sgc.terminate:
        if sgc.send_keepalives:
            sgc.ws_tx.send(json.dumps({'keepalive': sgc.uuid}))
        time.sleep(RECONNECT_SLEEP)

class SquirtgunClient(object):
    """Maintains a websocket connection with the server"""
    def __init__(self, host):
        super(SquirtgunClient, self).__init__()
        self.squirtgun = Squirtgun(debug='--debug' in sys.argv)
        self.host = host
        self.terminate = False
        self.send_keepalives = False
        self.uuid = uuid.uuid1().get_hex()
        self.pingpong = Thread(keepalive, self)

        self.ws_rx = None
        self.ws_tx = None

    def run(self):
        while self.terminate == False:
            try:
                if hasattr(self, 'ws_rs'):
                    del self.ws_rx
                if hasattr(self, 'ws_tx'):
                    del self.ws_tx

                self.ws_rx = websocket.create_connection('%s/receive' % self.host)
                self.ws_tx = websocket.create_connection('%s/submit' % self.host)
                self.send_keepalives = True

                print 'connected!'
                while True and not self.terminate:
                    msg = json.loads(self.ws_rx.recv())
                    if msg.get('handle') == 'FIRE':
                        if time.time() - int(msg.get('timestamp','0')) < MESSAGE_DISCARD_THRESHOLD:
                            self.squirtgun.pulse(float(msg.get('text', '0.5')))
            except websocket.WebSocketConnectionClosedException, e:
                print 'connection closed'
                self.send_keepalives = False
            except socket.error, e:
                if e.errno == 61:
                    print 'connection refused'
                else:
                    print 'socket error number %d' % e.errno
                self.send_keepalives = False
            except Exception, e:
                self.send_keepalives = False
                self.terminate = True
                raise e

            print 'sleeping %d seconds...' % RECONNECT_SLEEP
            time.sleep(RECONNECT_SLEEP)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Listen for squirtgun commands.')
    parser.add_argument('--host', type=str, nargs=1, help='Specify a host URL', metavar=('URL',))
    args = parser.parse_args()

    target_host = HOST
    if args.host is not None:
        target_host = args.host[0]

    sgc = SquirtgunClient(target_host)
    sgc.run()


text:
#include "ggx_dielectric_bsdf.hpp"
// Standard C++ library
#include <tuple>
// Zisc
#include "zisc/error.hpp"
#include "zisc/utility.hpp"
// Nanairo
#include "NanairoCore/nanairo_core_config.hpp"
#include "NanairoCore/Data/intersection_info.hpp"
#include "NanairoCore/Data/path_state.hpp"
#include "NanairoCore/Data/shape_point.hpp"
#include "NanairoCore/Geometry/transformation.hpp"
#include "NanairoCore/Geometry/vector.hpp"
#include "NanairoCore/Material/shader_model.hpp"
#include "NanairoCore/Material/SurfaceModel/Surface/microfacet_ggx.hpp"
#include "NanairoCore/Sampling/sampled_direction.hpp"
#include "NanairoCore/Sampling/sampled_spectra.hpp"
#include "NanairoCore/Sampling/Sampler/sampler.hpp"

namespace nanairo {

/*!
  \details
  No detailed.
  */
GgxDielectricBsdf::GgxDielectricBsdf(
    const Float roughness_x,
    const Float roughness_y,
    const Float n) noexcept :
        roughness_x_{roughness_x},
        roughness_y_{roughness_y},
        n_{n}
{
}

/*!
  \details
  No detailed.
  */
Float GgxDielectricBsdf::evalPdf(
    const Vector3* vin,
    const Vector3* vout,
    const WavelengthSamples& /* wavelengths */,
    const IntersectionInfo* info) const noexcept
{
  ZISC_ASSERT(info != nullptr, "The info is null.");
  const auto& point = info->shapePoint();
  // Transform vectors
  const auto vin_d = Transformation::toLocal(point.tangent(),
                                             point.bitangent(),
                                             point.normal(),
                                             -(*vin));
  ZISC_ASSERT(zisc::isInClosedBounds(vin_d[2], 0.0, 1.0),
              "The vin isn't in the upper hemisphere.");
  ZISC_ASSERT(isUnitVector(vin_d), "The vin isn't unit vector.");
  const auto vout_d = Transformation::toLocal(point.tangent(),
                                              point.bitangent(),
                                              point.normal(),
                                              *vout);
  ZISC_ASSERT(isUnitVector(vout_d), "The vout isn't unit vector.");

  // Check if the ray is reflected or refracted
  const Float cos_no = vout_d[2];
  const bool is_reflection = (0.0 < cos_no);

  // Calculate the microfacet normal
  const auto m_normal = (is_reflection)
      ? Microfacet::calcReflectionHalfVector(vin_d, vout_d)
      : Microfacet::calcRefractionHalfVector(vin_d, vout_d, n_);
  Float pdf = 0.0;
  const Float cos_mi = zisc::dot(m_normal, vin_d);
  const bool is_valid =
      (0.0 < m_normal[2]) &&
      (is_reflection || Fresnel::checkSnellsLaw(n_, cos_mi, zisc::dot(m_normal, vout_d)));
  if (is_valid) {
    // Calculate the fresnel term
    const Float fresnel = Fresnel::evalFresnel(n_, cos_mi);

    // Evaluate the pdf
    pdf = (is_reflection)
        ? (fresnel *
           MicrofacetGgx::evalReflectionPdf(roughness_x_, roughness_y_, vin_d, m_normal))
        : ((1.0 - fresnel) *
           MicrofacetGgx::evalRefractionPdf(roughness_x_, roughness_y_, vin_d, vout_d, m_normal, n_));
  }

  return pdf;
}

/*!
  \details
  No detailed.
  */
SampledSpectra GgxDielectricBsdf::evalRadiance(
    const Vector3* vin,
    const Vector3* vout,
    const WavelengthSamples& wavelengths,
    const IntersectionInfo* info) const noexcept
{
  ZISC_ASSERT(info != nullptr, "The info is null.");
  const auto& point = info->shapePoint();
  // Transform vectors
  const auto vin_d = Transformation::toLocal(point.tangent(),
                                             point.bitangent(),
                                             point.normal(),
                                             -(*vin));
  ZISC_ASSERT(zisc::isInClosedBounds(vin_d[2], 0.0, 1.0),
              "The vin isn't in the upper hemisphere.");
  ZISC_ASSERT(isUnitVector(vin_d), "The vin isn't unit vector.");
  const auto vout_d = Transformation::toLocal(point.tangent(),
                                              point.bitangent(),
                                              point.normal(),
                                              *vout);
  ZISC_ASSERT(isUnitVector(vout_d), "The vout isn't unit vector.");

  // Check if the ray is reflected or refracted
  const Float cos_no = vout_d[2];
  const bool is_reflection = (0.0 < cos_no);

  // Calculate the microfacet normal
  const auto m_normal = (is_reflection)
      ? Microfacet::calcReflectionHalfVector(vin_d, vout_d)
      : Microfacet::calcRefractionHalfVector(vin_d, vout_d, n_);
  SampledSpectra radiance{wavelengths};
  const Float cos_mi = zisc::dot(m_normal, vin_d);
  const bool is_valid =
      (0.0 < m_normal[2]) &&
      (is_reflection || Fresnel::checkSnellsLaw(n_, cos_mi, zisc::dot(m_normal, vout_d)));
  if (is_valid) {
    // Calculate the fresnel term
    const Float fresnel = Fresnel::evalFresnel(n_, cos_mi);

    // Evaluate the radiance
    const Float f = (is_reflection)
        ? MicrofacetGgx::evalReflectance(roughness_x_, roughness_y_, vin_d, vout_d, m_normal, fresnel)
        : MicrofacetGgx::evalTransmittance(roughness_x_, roughness_y_, vin_d, vout_d, m_normal, n_, fresnel);
    radiance.setIntensity(wavelengths.primaryWavelengthIndex(), f);
  }

  return radiance;
}

/*!
  \details
  No detailed.
  */
std::tuple<SampledSpectra, Float> GgxDielectricBsdf::evalRadianceAndPdf(
    const Vector3* vin,
    const Vector3* vout,
    const WavelengthSamples& wavelengths,
    const IntersectionInfo* info) const noexcept
{
  ZISC_ASSERT(info != nullptr, "The info is null.");
  const auto& point = info->shapePoint();
  // Transform vectors
  const auto vin_d = Transformation::toLocal(point.tangent(),
                                             point.bitangent(),
                                             point.normal(),
                                             -(*vin));
  ZISC_ASSERT(zisc::isInClosedBounds(vin_d[2], 0.0, 1.0),
              "The vin isn't in the upper hemisphere.");
  ZISC_ASSERT(isUnitVector(vin_d), "The vin isn't unit vector.");
  const auto vout_d = Transformation::toLocal(point.tangent(),
                                              point.bitangent(),
                                              point.normal(),
                                              *vout);
  ZISC_ASSERT(isUnitVector(vout_d), "The vout isn't unit vector.");

  // Check if the ray is reflected or refracted
  const Float cos_no = vout_d[2];
  const bool is_reflection = 0.0 < cos_no;

  // Calculate the microfacet normal
  const auto m_normal = (is_reflection)
      ? Microfacet::calcReflectionHalfVector(vin_d, vout_d)
      : Microfacet::calcRefractionHalfVector(vin_d, vout_d, n_);
  SampledSpectra radiance{wavelengths};
  Float pdf = 0.0;
  const Float cos_mi = zisc::dot(m_normal, vin_d);
  const Float cos_mo = zisc::dot(m_normal, vout_d);
  const bool is_valid =
      (0.0 < m_normal[2]) &&
      (0.0 < cos_mi) &&
      (is_reflection || Fresnel::checkSnellsLaw(n_, cos_mi, cos_mo));
  if (is_valid) {
    // Calculate the fresnel term
    const Float fresnel = Fresnel::evalFresnel(n_, cos_mi);

    // Evaluate the radiance
    const Float f = (is_reflection)
        ? MicrofacetGgx::evalReflectance(roughness_x_, roughness_y_, vin_d, vout_d, m_normal, fresnel, &pdf)
        : MicrofacetGgx::evalTransmittance(roughness_x_, roughness_y_, vin_d, vout_d, m_normal, n_, fresnel, &pdf);
    radiance.setIntensity(wavelengths.primaryWavelengthIndex(), f);

    // Evaluate the pdf
    pdf = (is_reflection) ? fresnel * pdf : (1.0 - fresnel) * pdf;
  }

  return std::make_tuple(radiance, pdf);
}

/*!
  */
bool GgxDielectricBsdf::isReflective() const noexcept
{
  return true;
}

/*!
  */
bool GgxDielectricBsdf::isTransmissive() const noexcept
{
  return true;
}

/*!
  */
std::tuple<SampledDirection, SampledSpectra> GgxDielectricBsdf::sample(
    const Vector3* vin,
    const WavelengthSamples& wavelengths,
    Sampler& sampler,
    PathState& path_state,
    const IntersectionInfo* info) const noexcept
{
  ZISC_ASSERT(info != nullptr, "The info is null.");
  const auto& point = info->shapePoint();
  // Transform the incident vector
  const auto vin_d = Transformation::toLocal(point.tangent(),
                                             point.bitangent(),
                                             point.normal(),
                                             -(*vin));
  ZISC_ASSERT(zisc::isInClosedBounds(vin_d[2], 0.0, 1.0),
              "The vin isn't in the upper hemisphere.");
  ZISC_ASSERT(isUnitVector(vin_d), "The vin isn't unit vector.");

  // Sample a microfacet normal
  const auto m_normal = MicrofacetGgx::sampleNormal(roughness_x_, roughness_y_,
                                                    vin_d, sampler, path_state);

  // Evaluate the fresnel term
  const Float cos_mi = zisc::dot(m_normal.direction(), vin_d);
  const Float g2 = Fresnel::evalG2(n_, cos_mi);
  const bool is_perfect_reflection = g2 <= 0.0;
  const Float g = (!is_perfect_reflection) ? zisc::sqrt(g2) : 0.0;
  const Float fresnel = (!is_perfect_reflection)
      ? Fresnel::evalFresnelFromG(cos_mi, g)
      : 1.0; // Perfect reflection

  // Determine a reflection or a refraction
  path_state.setDimension(path_state.dimension() + 1);
  const bool is_reflection = is_perfect_reflection ||
      (sampler.draw1D(path_state) < fresnel);
  auto vout = (is_reflection)
      ? Microfacet::calcReflectionDirection(vin_d, m_normal)
      : Microfacet::calcRefractionDirection(vin_d, m_normal, n_, g);

  SampledSpectra weight{wavelengths};
  const Float cos_no = vout.direction()[2];
  if ((is_reflection && (0.0 < cos_no)) || (!is_reflection && (cos_no < 0.0))) {
    // Evaluate the weight
    const Float w = MicrofacetGgx::evalWeight(roughness_x_,
                                              roughness_y_,
                                              vin_d,
                                              vout.direction(),
                                              m_normal.direction());
    ZISC_ASSERT(0.0 <= w, "The weight is negative.");
    weight.setIntensity(wavelengths.primaryWavelengthIndex(), w);

    // Update the pdf of the outgoing direction
    vout.setInversePdf((is_reflection)
        ? vout.inversePdf() / fresnel
        : vout.inversePdf() / (1.0 - fresnel));

    // Transformation the reflection direction
    const auto vout_dir = Transformation::fromLocal(point.tangent(),
                                                    point.bitangent(),
                                                    point.normal(),
                                                    vout.direction());
    ZISC_ASSERT(isUnitVector(vout_dir), "The vout isn't unit vector.");
    vout.setDirection(vout_dir);
  }
  else {
    vout.setPdf(0.0);
  }

  return std::make_tuple(vout, weight);
}

/*!
  \details
  No detailed.
  */
bool GgxDielectricBsdf::wavelengthIsSelected() const noexcept
{
  return true;
}

} // namespace nanairo


text:
package main

import (
	"fmt"
	"os"

	log "github.com/Sirupsen/logrus"
	"github.com/codegangsta/cli"
	"github.com/gopher-net/macvlan-docker-plugin/plugin/macvlan"
)

const (
	version       = "0.1"
	macvlanSocket = "macvlan.sock"
	pluginPath    = "/run/docker/plugins/"
)

func main() {

	var flagSocket = cli.StringFlag{
		Name:  "socket, s",
		Value: macvlanSocket,
		Usage: "listening unix socket",
	}
	var flagDebug = cli.BoolFlag{
		Name:  "debug, d",
		Usage: "enable debugging",
	}
	app := cli.NewApp()
	app.Name = "macvlan"
	app.Usage = "Docker Macvlan Networking"
	app.Version = "0.0.1"
	app.Flags = []cli.Flag{
		flagDebug,
		flagSocket,
	}
	app.Before = initEnv
	app.Action = Run
	app.Run(os.Args)
}

func initEnv(ctx *cli.Context) error {
	socketFile := ctx.String("socket")
	// Default loglevel is Info
	if ctx.Bool("debug") {
		log.SetLevel(log.DebugLevel)
	} else {
		log.SetLevel(log.InfoLevel)
	}
	log.SetOutput(os.Stderr)
	initSock(socketFile)
	return nil
}

// Run initializes the driver
func Run(ctx *cli.Context) {
	var d macvlan.Driver
	var err error
	if d, err = macvlan.New(version, ctx); err != nil {
		log.Fatalf("unable to create driver: %s", err)
	}
	log.Info("Macvlan network driver initialized successfully")

	// concatenate the absolute path to the spec file handle
	absSocket := fmt.Sprint(pluginPath, ctx.String("socket"))
	if err := d.Listen(absSocket); err != nil {
		log.Fatal(err)
	}
}

// removeSock if an old filehandle exists remove it
func removeSock(absFile string) {
	err := os.RemoveAll(absFile)
	if err != nil {
		log.Fatalf("Unable to remove the old socket file [ %s ] due to: %s", absFile, err)
	}
}

// initSock create the plugin filepath if it does not already exist
func initSock(socketFile string) {
	if err := os.MkdirAll(pluginPath, 0755); err != nil && !os.IsExist(err) {
		log.Warnf("Could not create net plugin path directory: [ %s ]", err)
	}
	// concatenate the absolute path to the spec file handle
	absFile := fmt.Sprint(pluginPath, socketFile)
	// If the plugin socket file already exists, remove it.
	if _, err := os.Stat(absFile); err == nil {
		log.Debugf("socket file [ %s ] already exists, unlinking the old file handle..", absFile)
		removeSock(absFile)
	}
	log.Debugf("The plugin absolute path and handle is [ %s ]", absFile)
}


text:
package com.ibm.g11n.pipeline.client;

/**
 * Industry domain constants used by translation request data.
 *
 * @author yoshito_umaoka
 */
public enum IndustryDomain {
    /**
     * Aerospace and the military-industrial complex
     */
    AEROMIL("Aerospace and the military-industrial complex"),
    /**
     * Construction
     */
    CNSTRCT("Construction"),
    /**
     * Goods and service
     */
    GDSSVCS("Goods and service"),
    /**
     * Education
     */
    EDUCATN("Education"),
    /**
     * Financial Services
     */
    FINSVCS("Financial Services"),
    /**
     * Government and public sector
     */
    GOVPUBL("Government and public sector"),
    /**
     * Healthcare and social services
     */
    HEALTHC("Healthcare and social services"),
    /**
     * Industrial manufacturing
     */
    INDSTMF("Industrial manufacturing"),
    /**
     * Telecommunication
     */
    TELECOM("Telecommunication"),
    /**
     * Digital media and entertainment
     */
    DMEDENT("Digital media and entertainment"),
    /**
     * Information technology
     */
    INFTECH("Information technology"),
    /**
     * Travel and transportation
     */
    TRVLTRS("Travel and transportation"),
    /**
     * Insurance
     */
    INSURNC("Insurance"),
    /**
     * Energy and utilities
     */
    ENGYUTL("Energy and utilities"),
    /**
     * Agriculture
     */
    AGRICLT("Agriculture");

    private String description;

    private IndustryDomain(String description) {
        this.description = description;
    }

    /**
     * Returns the description in English.
     * @return  The description in English.
     */
    public String getDescription() {
        return description;
    }
}


text:
// Copyright 2017-2020 The Verible Authors.
//
// 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.

#include "verilog/transform/obfuscate.h"

#include <sstream>

#include "common/strings/obfuscator.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace verilog {
namespace {

using verible::IdentifierObfuscator;

static std::string ExpectNeverToBeCalled(absl::string_view) {
  ADD_FAILURE() << "This identifier generator should've never been called";
  return "";
}

// To make these tests deterministic, obfuscation maps are pre-populated.
TEST(ObfuscateVerilogCodeTest, PreloadedSubstitutions) {
  IdentifierObfuscator ob(ExpectNeverToBeCalled);
  const std::pair<std::string, std::string> subs[] = {
      {"aaa", "AAA"},
      {"bbb", "BBB"},
      {"ccc", "CCC"},
  };
  for (const auto& sub : subs) {
    ASSERT_TRUE(ob.encode(sub.first, sub.second));
  }
  const std::pair<absl::string_view, absl::string_view> kTestCases[] = {
      {"", ""},  // empty file
      {"\n", "\n"},
      {"//comments unchanged\n", "//comments unchanged\n"},
      {"/*comments unchanged*/\n", "/*comments unchanged*/\n"},
      {"aaa bbb;\n", "AAA BBB;\n"},
      {"aaa bbb;\nbbb  aaa;\n", "AAA BBB;\nBBB  AAA;\n"},
      {"aaa[ccc] bbb;\n", "AAA[CCC] BBB;\n"},
      {"aaa bbb[ccc];\n", "AAA BBB[CCC];\n"},
      {"parameter int aaa = 111;\n", "parameter int AAA = 111;\n"},
      {"parameter int aaa = ccc;\n", "parameter int AAA = CCC;\n"},
      {"`aaa(bbb, ccc)\n", "`AAA(BBB, CCC)\n"},
      {"`aaa(`bbb(`ccc)))\n", "`AAA(`BBB(`CCC)))\n"},
      {"`ifdef aaa\n`elsif ccc\n`else\n`endif\n",
       "`ifdef AAA\n`elsif CCC\n`else\n`endif\n"},
      {"`define ccc bbb+aaa\n", "`define CCC BBB+AAA\n"},
      {"`define ccc `bbb+`aaa\n", "`define CCC `BBB+`AAA\n"},
      {"task bbb;\n  $aaa;\nendtask\n", "task BBB;\n  $aaa;\nendtask\n"},
      {"task bbb;\n  $aaa();\nendtask\n", "task BBB;\n  $aaa();\nendtask\n"},
      {"task bbb;\n  $aaa($ccc());\nendtask\n",
       "task BBB;\n  $aaa($ccc());\nendtask\n"},
      {"function aaa()\nreturn bbb^ccc;\nendfunction\n",
       "function AAA()\nreturn BBB^CCC;\nendfunction\n"},
      {"function aaa()\nreturn bbb(ccc);\nendfunction\n",
       "function AAA()\nreturn BBB(CCC);\nendfunction\n"},
      {"function aaa()\nreturn {bbb,ccc};\nendfunction\n",
       "function AAA()\nreturn {BBB,CCC};\nendfunction\n"},
      // token concatenation
      {"aaa``bbb;\n", "AAA``BBB;\n"},
      {"`define ccc(aaa, bbb) aaa``bbb;\n",
       "`define CCC(AAA, BBB) AAA``BBB;\n"},
      {"`ccc(aaa``bbb, bbb``aaa);\n", "`CCC(AAA``BBB, BBB``AAA);\n"},
      // comments inside defines
      {
          "`define ccc \\\n"
          "  // comment1 \\\n"
          "  // comment2\n",
          "`define CCC \\\n"
          "  // comment1 \\\n"
          "  // comment2\n",
      },
      {
          "`define ccc \\\n"
          "  aaa(); \\\n"
          "  // comment1 \\\n"
          "  bbb(); \\\n"
          "  // comment2\n",
          "`define CCC \\\n"
          "  AAA(); \\\n"
          "  // comment1 \\\n"
          "  BBB(); \\\n"
          "  // comment2\n",
      },
  };
  for (const auto& test : kTestCases) {
    std::ostringstream output;
    const auto status = ObfuscateVerilogCode(test.first, &output, &ob);
    EXPECT_TRUE(status.ok()) << "Unexpected error: " << status.message();
    EXPECT_EQ(output.str(), test.second);
  }
}

TEST(ObfuscateVerilogCodeTest, InputLexicalError) {
  const absl::string_view kTestCases[] = {
      "789badid",
      "`FOO(8911badid)\n",
      "`define FOO 911badid\n",
      "`FOO(`)\n",
  };
  for (const auto& test : kTestCases) {
    IdentifierObfuscator ob(RandomEqualLengthSymbolIdentifier);
    std::ostringstream output;
    const auto status = ObfuscateVerilogCode(test, &output, &ob);
    EXPECT_FALSE(status.ok());
    EXPECT_EQ(status.code(), absl::StatusCode::kInvalidArgument)
        << "message: " << status.message();
  }
}

}  // namespace
}  // namespace verilog


text:
pyramid_locmako
===============

Pyramid scaffolding with Mako, Internationalization and SQLAlchemy.

Licensed under MIT License.

Overview
========

pyramid_locmako is similar to pyramid's starter scaffold, only
it uses mako as a templating engine, initializes internationalization
and makes slightly more complex directory structure:
* Creates directories for views, models, tests

The distinction to the original alchemy scaffolding is adding
the request property db for accessing the database session,
which is effectively eliminating the global variable DBSession.

Installing
==========

Has not been pushed to pypi yet, so your only change is probably
to grab it here at github, unpack, then
  python setup.py install

Usage
=====

# before we start:
virtualenv MYENV
cd MYENV
. bin/activate.sh
easy_install pyramid
git clone https://github.com/petrblahos/pyramid_locmako.git
cd pyramid_locmako
python setup.py install
cd ..

# now finally
pcreate -s pyramid_locmako PLM1
# At the end you will be asked which languages you want to initialize.
cd PLM1
python setup.py develop
../bin/initialize_PLM1_db development.ini
pserve development.ini

What now? It is just a pyramid project. If lost head into narrative
documentation at http://pyramid.readthedocs.org/en/latest/


text:
<?php

namespace SilverStripe\Omnipay\Model\Message;

class VoidedResponse extends GatewayResponseMessage
{

}


text:
/** @constructor */
ScalaJS.c.scala_xml_dtd_IMPLIED$ = (function() {
  ScalaJS.c.scala_xml_dtd_DefaultDecl.call(this)
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype = new ScalaJS.inheritable.scala_xml_dtd_DefaultDecl();
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.constructor = ScalaJS.c.scala_xml_dtd_IMPLIED$;
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.toString__T = (function() {
  return "#IMPLIED"
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.buildString__Lscala_collection_mutable_StringBuilder__Lscala_collection_mutable_StringBuilder = (function(sb) {
  return sb.append__T__Lscala_collection_mutable_StringBuilder("#IMPLIED")
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productPrefix__T = (function() {
  return "IMPLIED"
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productArity__I = (function() {
  return 0
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productElement__I__O = (function(x$1) {
  var x1 = x$1;
  throw new ScalaJS.c.java_lang_IndexOutOfBoundsException().init___T(ScalaJS.objectToString(ScalaJS.bI(x$1)))
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productIterator__Lscala_collection_Iterator = (function() {
  return ScalaJS.modules.scala_runtime_ScalaRunTime().typedProductIterator__Lscala_Product__Lscala_collection_Iterator(this)
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.canEqual__O__Z = (function(x$1) {
  return ScalaJS.is.scala_xml_dtd_IMPLIED$(x$1)
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.hashCode__I = (function() {
  return -1651045240
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.readResolve__p2__O = (function() {
  return ScalaJS.modules.scala_xml_dtd_IMPLIED()
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.init___ = (function() {
  ScalaJS.c.scala_xml_dtd_DefaultDecl.prototype.init___.call(this);
  ScalaJS.moduleInstances.scala_xml_dtd_IMPLIED = this;
  ScalaJS.impls.scala_Product$class__$init$__Lscala_Product__V(this);
  return this
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.canEqual__O__ = (function(x$1) {
  return ScalaJS.bZ(this.canEqual__O__Z(x$1))
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productIterator__ = (function() {
  return this.productIterator__Lscala_collection_Iterator()
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productElement__I__ = (function(x$1$2) {
  return this.productElement__I__O(x$1$2)
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productArity__ = (function() {
  return ScalaJS.bI(this.productArity__I())
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.productPrefix__ = (function() {
  return this.productPrefix__T()
});
/** @constructor */
ScalaJS.inheritable.scala_xml_dtd_IMPLIED$ = (function() {
  /*<skip>*/
});
ScalaJS.inheritable.scala_xml_dtd_IMPLIED$.prototype = ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype;
ScalaJS.is.scala_xml_dtd_IMPLIED$ = (function(obj) {
  return (!(!((obj && obj.$classData) && obj.$classData.ancestors.scala_xml_dtd_IMPLIED$)))
});
ScalaJS.as.scala_xml_dtd_IMPLIED$ = (function(obj) {
  if ((ScalaJS.is.scala_xml_dtd_IMPLIED$(obj) || (obj === null))) {
    return obj
  } else {
    ScalaJS.throwClassCastException(obj, "scala.xml.dtd.IMPLIED")
  }
});
ScalaJS.isArrayOf.scala_xml_dtd_IMPLIED$ = (function(obj, depth) {
  return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.scala_xml_dtd_IMPLIED$)))
});
ScalaJS.asArrayOf.scala_xml_dtd_IMPLIED$ = (function(obj, depth) {
  if ((ScalaJS.isArrayOf.scala_xml_dtd_IMPLIED$(obj, depth) || (obj === null))) {
    return obj
  } else {
    ScalaJS.throwArrayCastException(obj, "Lscala.xml.dtd.IMPLIED;", depth)
  }
});
ScalaJS.data.scala_xml_dtd_IMPLIED$ = new ScalaJS.ClassTypeData({
  scala_xml_dtd_IMPLIED$: 0
}, false, "scala.xml.dtd.IMPLIED$", ScalaJS.data.scala_xml_dtd_DefaultDecl, {
  scala_xml_dtd_IMPLIED$: 1,
  scala_Serializable: 1,
  java_io_Serializable: 1,
  scala_Product: 1,
  scala_Equals: 1,
  scala_xml_dtd_DefaultDecl: 1,
  java_lang_Object: 1
});
ScalaJS.c.scala_xml_dtd_IMPLIED$.prototype.$classData = ScalaJS.data.scala_xml_dtd_IMPLIED$;
ScalaJS.moduleInstances.scala_xml_dtd_IMPLIED = undefined;
ScalaJS.modules.scala_xml_dtd_IMPLIED = (function() {
  if ((!ScalaJS.moduleInstances.scala_xml_dtd_IMPLIED)) {
    ScalaJS.moduleInstances.scala_xml_dtd_IMPLIED = new ScalaJS.c.scala_xml_dtd_IMPLIED$().init___()
  };
  return ScalaJS.moduleInstances.scala_xml_dtd_IMPLIED
});
//@ sourceMappingURL=IMPLIED$.js.map


text:
<?xml version="1.0" encoding="UTF-8"?>
<user xmlns="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:type="UserWithOnlyEnabled"
 enabled="true"/>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Text;
using Moq;
using NUnit.Framework;

namespace Azure.Messaging.ServiceBus.Tests.Receiver
{
    public class ReceiverTests : ServiceBusTestBase
    {
        [Test]
        public void ClientProperties()
        {
            var account = Encoding.Default.GetString(GetRandomBuffer(12));
            var fullyQualifiedNamespace = new UriBuilder($"{account}.servicebus.windows.net/").Host;
            var connString = $"Endpoint=sb://{fullyQualifiedNamespace};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={Encoding.Default.GetString(GetRandomBuffer(64))}";
            var queueName = Encoding.Default.GetString(GetRandomBuffer(12));
            var options = new ServiceBusReceiverOptions()
            {
                ReceiveMode = ReceiveMode.ReceiveAndDelete
            };
            var receiver = new ServiceBusClient(connString).CreateReceiver(queueName, options);
            Assert.AreEqual(queueName, receiver.EntityPath);
            Assert.AreEqual(fullyQualifiedNamespace, receiver.FullyQualifiedNamespace);
            Assert.IsNotNull(receiver.Identifier);
            Assert.IsFalse(receiver.IsSessionReceiver);
            Assert.AreEqual(ReceiveMode.ReceiveAndDelete, receiver.ReceiveMode);
        }

        [Test]
        public void EntityPathConstructedCorrectly()
        {
            var account = Encoding.Default.GetString(GetRandomBuffer(12));
            var fullyQualifiedNamespace = new UriBuilder($"{account}.servicebus.windows.net/").Host;
            var connString = $"Endpoint=sb://{fullyQualifiedNamespace};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={Encoding.Default.GetString(GetRandomBuffer(64))}";
            var queueName = "queueName";
            var client = new ServiceBusClient(connString);
            var receiver = client.CreateReceiver(queueName, new ServiceBusReceiverOptions
            {
                SubQueue = SubQueue.None
            });
            Assert.AreEqual("queueName", receiver.EntityPath);

            receiver = client.CreateReceiver(queueName, new ServiceBusReceiverOptions
            {
                SubQueue = SubQueue.DeadLetter
            });
            Assert.AreEqual("queueName/$DeadLetterQueue", receiver.EntityPath);

            receiver = client.CreateReceiver(queueName, new ServiceBusReceiverOptions
            {
                SubQueue = SubQueue.TransferDeadLetter
            });
            Assert.AreEqual("queueName/$Transfer/$DeadLetterQueue", receiver.EntityPath);
        }

        [Test]
        public void ReceiverOptionsValidation()
        {
            var options = new ServiceBusReceiverOptions();
            Assert.That(
                () => options.PrefetchCount = -1,
                Throws.InstanceOf<ArgumentOutOfRangeException>());

            // should not throw
            options.PrefetchCount = 0;
        }

        [Test]
        public void ReceiveValidatesMaxWaitTime()
        {
            var account = Encoding.Default.GetString(GetRandomBuffer(12));
            var fullyQualifiedNamespace = new UriBuilder($"{account}.servicebus.windows.net/").Host;
            var connString = $"Endpoint=sb://{fullyQualifiedNamespace};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={Encoding.Default.GetString(GetRandomBuffer(64))}";
            var client = new ServiceBusClient(connString);
            var receiver = client.CreateReceiver("queue");
            Assert.That(
                async () => await receiver.ReceiveMessageAsync(TimeSpan.FromSeconds(0)),
                Throws.InstanceOf<ArgumentOutOfRangeException>());
            Assert.That(
                async () => await receiver.ReceiveMessageAsync(TimeSpan.FromSeconds(-1)),
                Throws.InstanceOf<ArgumentOutOfRangeException>());
        }
    }
}


text:
//#region 为Mustache.js扩展快捷方法
/*
 *         Authors: sorex
 *            Date: 2014-Feb-28
 *    Dependencies: Mustache.js
 *     Description: 为jQuery添加initTemplate全局方法,快速初始化Mustache.js的template。
 *                  同时添加formateDate方法,方便处理时间。
 */
jQuery.extend({
    initTemplate: function () {
        $("[data-template]").each(function () {
            var $this = $(this);
            $this.data("template", $("#" + $this.attr("data-template")).text());
            $this.data("template_extend", {
                formateDate: function () {
                    return function (text, render) {
                        return new Date(render(text)).format("yyyy-MM-dd");
                    }
                },
                formateDateTime: function () {
                    return function (text, render) {
                        return new Date(render(text)).format("yyyy-MM-dd HH:ii:ss");
                    }
                },
                formateTime: function () {
                    return function (text, render) {
                        return new Date(render(text)).format("HH:ii:ss");
                    }
                }
            });
            $this.html("");
        });
    }
});

/*
 *      Authors: sorex
 *         Date: 2014-Feb-28
 * Dependencies: Mustache.js
 *  Description: 为jQuery对象添加render方法,快捷调用Mustache.js的render方法。
 */
jQuery.fn.extend({
    render: function (data) {
        this.data("template_data", $.extend({}, data, this.data("template_extend")));
        this.html(Mustache.render(this.data("template"), this.data("template_data")));
    }
});
//#endregion

//#region 让 jquery.validate.js 兼容 bootstrap 3
/*
 *         Authors: sorex
 *            Date: 2014-Mar-9
 *    Dependencies: bootstrap.js(>=3.0), jquery.validate.js
 *     Description: 让 jquery.validate.js 兼容 bootstrap 3
 */
$.validator.setDefaults({
    highlight: function (element) {
        $(element).closest('.form-group').addClass('has-error');
    },
    unhighlight: function (element) {
        $(element).closest('.form-group').removeClass('has-error');
    },
    errorElement: 'span',
    errorClass: 'help-block',
    errorPlacement: function (error, element) {
        if (element.closest('.form-group').length) {
            error.appendTo(element.closest('.form-group'));
        } else if (element.parent('.input-group').length) {
            error.insertAfter(element.parent());
        } else {
            error.insertAfter(element);
        }
    }
});
//#endregion

//#region 扩展 Date 对象
/*
 *         Authors: sorex
 *            Date: 2014-Mar-9
 *    Dependencies: bootstrap-datetimepicker.js
 *     Description: 扩展 Date 对象的 format 方法 (2014年9月8日 上午7点6分5秒)
 *				h:小时,12小时制
 *				hh:小时,补0
 *				i:分钟
 *				ii:分钟,补0
 *				s:秒
 *				ss:秒,补0
 *				yyyy:年份
 *				yy:年份,后两位
 *				M:月份简写
 *				MM:月份全称
 *				m:数字月,补0
 *				mm:数字月
 *				D:星期简写
 *				DD:星期全称
 *				d:日期
 *				dd:日期,补0
 *				H:小时,24小时制
 *				HH:小时,补0
 *				p:am/pm
 *				P:AM/PM
 */
Date.prototype.format = function (format) {
    return $.fn.datetimepicker.DPGlobal.formatDate(this, $.fn.datetimepicker.DPGlobal.parseFormat(format, 'standard'), "zh-CN", 'standard');
}
//#endregion

//#region 初始化 tinymce
/*
 *         Authors: sorex
 *            Date: 2014-Mar-9
 *    Dependencies: tinymce.js, jquery.tinymce.js
 *     Description: 让mce兼容bootstrap dialog
 */
$(function () {
    if ("undefined" != typeof tinymce) {
        // Prevent bootstrap dialog from blocking focusin
        $(document).on('focusin', function (e) {
            if ($(e.target).closest(".mce-window").length) {
                e.stopImmediatePropagation();
            }
        });
    }
});
//#endregion


text:
package org.apache.karaf.system.commands;

import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;

/**
 * Command to shut down Karaf container.
 */
@Command(scope = "system", name = "name", description = "Show or change Karaf instance name.")
public class Name extends AbstractSystemAction {

    @Argument(name = "name", index = 0, description = "New name for the instance", required = false, multiValued = false)
    String name;

    protected Object doExecute() throws Exception {
        if (name == null) {
            System.out.println(systemService.getName());
        } else {
            systemService.setName(name);
            System.out.println("Karaf instance name changed to " + name + ". Restart of karaf needed for this to take effect.");
        }
        return null;
    }

}


text:
* paper type: fanfold
* paper size: 9"x11"

## Printer info
* printer type: Dot matrix
* printer model: Epson LQ-2170i

## Printer
* The left edge of a paper at 0

## Printer driver intallation
* Add printer -> Local printer
* Select port -> USB001 or USB002
* Click Windows update to update the printer list
* Choose Epson -> LQ-2170
  Caveat: Allow installing driver software from Windows update first (Start -> Devices and Printers -> Click on yellow bar)

## Printer driver setup
### properties
* Ports - select the right USB port (The icon is not grey!)
* Device settings - Choose Letter Fanfold 8 1/2 x 11 in for all 'Form to Tray assignment'
### perferences -> Advanced...
* Paper size: Letter Fanfold 8 1/2 x 11 in

## IE setup
* Make sure 'Epson LQ-2170 ESC/P 2' is selected
* Tools -> Print -> Page setup...
* Page Size: Letter Fanfold 8 1/2 x 11 in
* Select Portrait
* Margins (inches)- Left: 0.732, Right: 0.122, Top: 0.166, Bottom: 0.332
* Headers - Empty, Emtpy, Custom: &p / &P
* Footers - Empty all
  Caveats: Don't print from Tools, click 'Print' button in the app

## Excel setup
* Page size: Letter Fanfold 8 1/2 x 11 in
* Page margin - Left: 0.732, Right: 0, Top: 0.75, Bottom: 0.75
* Font type: BrowalliaUPC
* Font size: 12


text:
Downloads videos from the web and plays them in a random order. [Demo video here.](https://endquote.com/project/rgbtv/)

* [Features](#features)
* [Controls](#features)
* [Mac Setup](docs/mac.md)
* [Windows Setup](docs/windows.md)
* [Configuration](docs/config.md)

# Features

* Support for videos from YouTube, Vimeo, and [lots of other places](http://rg3.github.io/youtube-dl/supportedsites.html)
* Web-based admin page to add/remove/select videos
* Web-based video player page
* Overlay with video info, QR code link to video page

# Controls

Use a touch screen, mouse, or [PowerMate Bluetooth](https://griffintechnology.com/us/powermate-bluetooth) (Mac only) to control playback.

* 1 tap to show info overlay
* 2 taps to turn on audio
* 3 taps to hide info overlay
* 4 taps to turn off audio
* Double-tap to play a different video
* Rotate PowerMate to change playback position


text:
package org.apache.usergrid.chop.webapp.coordinator.rest;

import org.safehaus.guicyfig.Default;
import org.safehaus.guicyfig.GuicyFig;
import org.safehaus.guicyfig.Key;

/**
 * Rest configuration GuicyFig bean.
 */
public interface RestFig extends GuicyFig {

    /**
     * Gets the base upload path to upload war files.
     */
    @Key("war.upload.path")
    @Default(".")
    String getWarUploadPath();

}


text:
<!DOCTYPE html>

    <title>主页</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />

    <link  rel="stylesheet" type="text/css" href="../css/mail.css" />

        取消

写邮件

        发送

            接到人:
            <input type="email" id="EmailAddressId" name="mailaddress" style="width: 96%" placeholder="请输入接收者邮箱" data-theme="d"/>

            内容:

            <textarea cols="5" rows="5" name="textarea" id="textarea" placeholder="请输入内容" data-theme="d" style="width: 96%">
            </textarea>

                <input type="text" id="ImageUrlId" name="ImageUrlName" style="width: 96%;height: 30px" data-theme="d"
                       />

摄像头