text:
namespace Kvasir {
//16-bit counter/timer
    namespace Ct16b0Ir{    ///<Interrupt Register (IR). The IR can be written to clear interrupts. The IR can be read to identify which of five possible interrupt sources are pending.
        using Addr = Register::Address<0x4000c000,0x00000000,0x00000000,unsigned>;
        ///Interrupt flag for match channel 0.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> mr0int{};
        ///Interrupt flag for match channel 1.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> mr1int{};
        ///Interrupt flag for match channel 2.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mr2int{};
        ///Interrupt flag for match channel 3.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> mr3int{};
        ///Interrupt flag for capture channel 0 event.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> cr0int{};
        ///Reserved
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,5),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Tcr{    ///<Timer Control Register (TCR). The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR.
        using Addr = Register::Address<0x4000c004,0x00000000,0x00000000,unsigned>;
        ///Counter Enable. When one, the Timer Counter and Prescale Counter are enabled for counting. When zero, the counters are disabled.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> cen{};
        ///Counter Reset. When one, the Timer Counter and the Prescale Counter are synchronously reset on the next positive edge of PCLK. The counters remain reset until TCR[1] is returned to zero.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> crst{};
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,2),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Tc{    ///<Timer Counter (TC). The 16-bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR.
        using Addr = Register::Address<0x4000c008,0x00000000,0x00000000,unsigned>;
        ///Timer counter value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> tc{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Pr{    ///<Prescale Register (PR). When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC.
        using Addr = Register::Address<0x4000c00c,0x00000000,0x00000000,unsigned>;
        ///Timer counter value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> pcval{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Pc{    ///<Prescale Counter (PC). The 16-bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface.
        using Addr = Register::Address<0x4000c010,0x00000000,0x00000000,unsigned>;
        ///Timer prescale counter value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> pc{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Mcr{    ///<Match Control Register (MCR). The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs.
        using Addr = Register::Address<0x4000c014,0x00000000,0x00000000,unsigned>;
        ///Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC.
        enum class Mr0iVal {
            enabled=0x00000001,     ///<Enabled
            d=0x00000000,     ///<DISABLED
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,Mr0iVal> mr0i{};
        namespace Mr0iValC{
            constexpr Register::FieldValue<decltype(mr0i)::Type,Mr0iVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr0i)::Type,Mr0iVal::d> d{};
        }
        ///Reset on MR0: the TC will be reset if MR0 matches it.
        enum class Mr0rVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,Mr0rVal> mr0r{};
        namespace Mr0rValC{
            constexpr Register::FieldValue<decltype(mr0r)::Type,Mr0rVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr0r)::Type,Mr0rVal::disabled> disabled{};
        }
        ///Stop on MR0: the TC and PC will be stopped and TCR[0] will be set to 0 if MR0 matches the TC.
        enum class Mr0sVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,Mr0sVal> mr0s{};
        namespace Mr0sValC{
            constexpr Register::FieldValue<decltype(mr0s)::Type,Mr0sVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr0s)::Type,Mr0sVal::disabled> disabled{};
        }
        ///Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC.
        enum class Mr1iVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,Mr1iVal> mr1i{};
        namespace Mr1iValC{
            constexpr Register::FieldValue<decltype(mr1i)::Type,Mr1iVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr1i)::Type,Mr1iVal::disabled> disabled{};
        }
        ///Reset on MR1: the TC will be reset if MR1 matches it.
        enum class Mr1rVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,Mr1rVal> mr1r{};
        namespace Mr1rValC{
            constexpr Register::FieldValue<decltype(mr1r)::Type,Mr1rVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr1r)::Type,Mr1rVal::disabled> disabled{};
        }
        ///Stop on MR1: the TC and PC will be stopped and TCR[0] will be set to 0 if MR1 matches the TC.
        enum class Mr1sVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,Mr1sVal> mr1s{};
        namespace Mr1sValC{
            constexpr Register::FieldValue<decltype(mr1s)::Type,Mr1sVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr1s)::Type,Mr1sVal::disabled> disabled{};
        }
        ///Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC.
        enum class Mr2iVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,Mr2iVal> mr2i{};
        namespace Mr2iValC{
            constexpr Register::FieldValue<decltype(mr2i)::Type,Mr2iVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr2i)::Type,Mr2iVal::disabled> disabled{};
        }
        ///Reset on MR2: the TC will be reset if MR2 matches it.
        enum class Mr2rVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,Mr2rVal> mr2r{};
        namespace Mr2rValC{
            constexpr Register::FieldValue<decltype(mr2r)::Type,Mr2rVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr2r)::Type,Mr2rVal::disabled> disabled{};
        }
        ///Stop on MR2: the TC and PC will be stopped and TCR[0] will be set to 0 if MR2 matches the TC.
        enum class Mr2sVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,Mr2sVal> mr2s{};
        namespace Mr2sValC{
            constexpr Register::FieldValue<decltype(mr2s)::Type,Mr2sVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr2s)::Type,Mr2sVal::disabled> disabled{};
        }
        ///Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC.
        enum class Mr3iVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,Mr3iVal> mr3i{};
        namespace Mr3iValC{
            constexpr Register::FieldValue<decltype(mr3i)::Type,Mr3iVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr3i)::Type,Mr3iVal::disabled> disabled{};
        }
        ///Reset on MR3: the TC will be reset if MR3 matches it.
        enum class Mr3rVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,Mr3rVal> mr3r{};
        namespace Mr3rValC{
            constexpr Register::FieldValue<decltype(mr3r)::Type,Mr3rVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr3r)::Type,Mr3rVal::disabled> disabled{};
        }
        ///Stop on MR3: the TC and PC will be stopped and TCR[0] will be set to 0 if MR3 matches the TC.
        enum class Mr3sVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,Mr3sVal> mr3s{};
        namespace Mr3sValC{
            constexpr Register::FieldValue<decltype(mr3s)::Type,Mr3sVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(mr3s)::Type,Mr3sVal::disabled> disabled{};
        }
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,12),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Ccr{    ///<Capture Control Register (CCR). The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place.
        using Addr = Register::Address<0x4000c028,0x00000000,0x00000000,unsigned>;
        ///Capture on CT16Bn_CAP0 rising edge: a sequence of 0 then 1 on CT16Bn_CAP0 will cause CR0 to be loaded with the contents of TC.
        enum class Cap0reVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,Cap0reVal> cap0re{};
        namespace Cap0reValC{
            constexpr Register::FieldValue<decltype(cap0re)::Type,Cap0reVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(cap0re)::Type,Cap0reVal::disabled> disabled{};
        }
        ///Capture on CT16Bn_CAP0 falling edge: a sequence of 1 then 0 on CT16Bn_CAP0 will cause CR0 to be loaded with the contents of TC.
        enum class Cap0feVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,Cap0feVal> cap0fe{};
        namespace Cap0feValC{
            constexpr Register::FieldValue<decltype(cap0fe)::Type,Cap0feVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(cap0fe)::Type,Cap0feVal::disabled> disabled{};
        }
        ///Interrupt on CT16Bn_CAP0 event: a CR0 load due to a CT16Bn_CAP0 event will generate an interrupt.
        enum class Cap0iVal {
            enabled=0x00000001,     ///<Enabled
            disabled=0x00000000,     ///<Disabled
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,Cap0iVal> cap0i{};
        namespace Cap0iValC{
            constexpr Register::FieldValue<decltype(cap0i)::Type,Cap0iVal::enabled> enabled{};
            constexpr Register::FieldValue<decltype(cap0i)::Type,Cap0iVal::disabled> disabled{};
        }
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,3),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Cr0{    ///<Capture Register 0 (CR0). CR0 is loaded with the value of TC when there is an event on the CT16B0_CAP0 input.
        using Addr = Register::Address<0x4000c02c,0x00000000,0x00000000,unsigned>;
        ///Timer counter capture value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> cap{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Emr{    ///<External Match Register (EMR). The EMR controls the match function and the external match pins CT16B0_MAT[2:0].
        using Addr = Register::Address<0x4000c03c,0x00000000,0x00000000,unsigned>;
        ///External Match 0. This bit reflects the state of output CT16B0_MAT0/CT16B1_MAT0, whether or not this output is connected to its pin. When a match occurs between the TC and MR0, this bit can either toggle, go LOW, go HIGH, or do nothing. Bits EMR[5:4] control the functionality of this output. This bit is driven to the CT16B0_MAT0/CT16B1_MAT0 pins if the match function is selected in the IOCON registers (0 = LOW, 1 = HIGH).
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> em0{};
        ///External Match 1. This bit reflects the state of output CT16B0_MAT1/CT16B1_MAT1, whether or not this output is connected to its pin. When a match occurs between the TC and MR1, this bit can either toggle, go LOW, go HIGH, or do nothing. Bits EMR[7:6] control the functionality of this output. This bit is driven to the CT16B0_MAT1/CT16B1_MAT1 pins if the match function is selected in the IOCON registers (0 = LOW, 1 = HIGH).
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> em1{};
        ///External Match 2. This bit reflects the state of output match channel 2, whether or not this output is connected to its pin. When a match occurs between the TC and MR2, this bit can either toggle, go LOW, go HIGH, or do nothing. Bits EMR[9:8] control the functionality of this output. Note that on counter/timer 0 this match channel is not pinned out. This bit is driven to the CT16B1_MAT2 pin if the match function is selected in the IOCON registers (0 = LOW, 1 = HIGH).
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> em2{};
        ///External Match 3. This bit reflects the state of output of match channel 3. When a match occurs between the TC and MR3, this bit can either toggle, go LOW, go HIGH, or do nothing. Bits EMR[11:10] control the functionality of this output. There is no output pin available for this channel on either of the 16-bit timers.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> em3{};
        ///External Match Control 0. Determines the functionality of External Match 0.
        enum class Emc0Val {
            donothing=0x00000000,     ///<Do Nothing.
            clear=0x00000001,     ///<Clear the corresponding External Match bit/output to 0 (CT16Bn_MATm pin is LOW if pinned out).
            set=0x00000002,     ///<Set the corresponding External Match bit/output to 1 (CT16Bn_MATm pin is HIGH if pinned out).
            toggle=0x00000003,     ///<Toggle the corresponding External Match bit/output.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,Emc0Val> emc0{};
        namespace Emc0ValC{
            constexpr Register::FieldValue<decltype(emc0)::Type,Emc0Val::donothing> donothing{};
            constexpr Register::FieldValue<decltype(emc0)::Type,Emc0Val::clear> clear{};
            constexpr Register::FieldValue<decltype(emc0)::Type,Emc0Val::set> set{};
            constexpr Register::FieldValue<decltype(emc0)::Type,Emc0Val::toggle> toggle{};
        }
        ///External Match Control 1. Determines the functionality of External Match 1.
        enum class Emc1Val {
            donothing=0x00000000,     ///<Do Nothing.
            clear=0x00000001,     ///<Clear the corresponding External Match bit/output to 0 (CT16Bn_MATm pin is LOW if pinned out).
            set=0x00000002,     ///<Set the corresponding External Match bit/output to 1 (CT16Bn_MATm pin is HIGH if pinned out).
            toggle=0x00000003,     ///<Toggle the corresponding External Match bit/output.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,6),Register::ReadWriteAccess,Emc1Val> emc1{};
        namespace Emc1ValC{
            constexpr Register::FieldValue<decltype(emc1)::Type,Emc1Val::donothing> donothing{};
            constexpr Register::FieldValue<decltype(emc1)::Type,Emc1Val::clear> clear{};
            constexpr Register::FieldValue<decltype(emc1)::Type,Emc1Val::set> set{};
            constexpr Register::FieldValue<decltype(emc1)::Type,Emc1Val::toggle> toggle{};
        }
        ///External Match Control 2. Determines the functionality of External Match 2.
        enum class Emc2Val {
            donothing=0x00000000,     ///<Do Nothing.
            clear=0x00000001,     ///<Clear the corresponding External Match bit/output to 0 (CT16Bn_MATm pin is LOW if pinned out).
            set=0x00000002,     ///<Set the corresponding External Match bit/output to 1 (CT16Bn_MATm pin is HIGH if pinned out).
            toggle=0x00000003,     ///<Toggle the corresponding External Match bit/output.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,Emc2Val> emc2{};
        namespace Emc2ValC{
            constexpr Register::FieldValue<decltype(emc2)::Type,Emc2Val::donothing> donothing{};
            constexpr Register::FieldValue<decltype(emc2)::Type,Emc2Val::clear> clear{};
            constexpr Register::FieldValue<decltype(emc2)::Type,Emc2Val::set> set{};
            constexpr Register::FieldValue<decltype(emc2)::Type,Emc2Val::toggle> toggle{};
        }
        ///External Match Control 3. Determines the functionality of External Match 3.
        enum class Emc3Val {
            donothing=0x00000000,     ///<Do Nothing.
            clear=0x00000001,     ///<Clear the corresponding External Match bit/output to 0 (CT16Bn_MATm pin is LOW if pinned out).
            set=0x00000002,     ///<Set the corresponding External Match bit/output to 1 (CT16Bn_MATm pin is HIGH if pinned out).
            toggle=0x00000003,     ///<Toggle the corresponding External Match bit/output.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,10),Register::ReadWriteAccess,Emc3Val> emc3{};
        namespace Emc3ValC{
            constexpr Register::FieldValue<decltype(emc3)::Type,Emc3Val::donothing> donothing{};
            constexpr Register::FieldValue<decltype(emc3)::Type,Emc3Val::clear> clear{};
            constexpr Register::FieldValue<decltype(emc3)::Type,Emc3Val::set> set{};
            constexpr Register::FieldValue<decltype(emc3)::Type,Emc3Val::toggle> toggle{};
        }
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,12),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Ctcr{    ///<Count Control Register (CTCR). The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting.
        using Addr = Register::Address<0x4000c070,0x00000000,0x00000000,unsigned>;
        ///Counter/Timer Mode. This field selects which rising PCLK edges can increment Timer's Prescale Counter (PC), or clear PC and increment Timer Counter (TC).
        enum class CtmVal {
            timermode=0x00000000,     ///<Timer Mode: every rising PCLK edge
            risingedge=0x00000001,     ///<Counter Mode: TC is incremented on rising edges on the CAP input selected by bits 3:2.
            falllingedge=0x00000002,     ///<Counter Mode: TC is incremented on falling edges on the CAP input selected by bits 3:2.
            risingfallingedge=0x00000003,     ///<Counter Mode: TC is incremented on both edges on the CAP input selected by bits 3:2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,CtmVal> ctm{};
        namespace CtmValC{
            constexpr Register::FieldValue<decltype(ctm)::Type,CtmVal::timermode> timermode{};
            constexpr Register::FieldValue<decltype(ctm)::Type,CtmVal::risingedge> risingedge{};
            constexpr Register::FieldValue<decltype(ctm)::Type,CtmVal::falllingedge> falllingedge{};
            constexpr Register::FieldValue<decltype(ctm)::Type,CtmVal::risingfallingedge> risingfallingedge{};
        }
        ///Count Input Select. In counter mode (when bits 1:0 in this register are not 00), these bits select which CAP pin is sampled for clocking. 						Note: If Counter mode is selected in the CTCR register, bits 2:0 in the Capture Control Register (CCR) must be programmed as 000.
        enum class CisVal {
            ct16bnCap0=0x00000000,     ///<CT16Bn_CAP0
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,2),Register::ReadWriteAccess,CisVal> cis{};
        namespace CisValC{
            constexpr Register::FieldValue<decltype(cis)::Type,CisVal::ct16bnCap0> ct16bnCap0{};
        }
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,4),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Pwmc{    ///<PWM Control Register (PWMCON). The PWMCON enables PWM mode for the external match pins CT16B0_MAT[2:0].
        using Addr = Register::Address<0x4000c074,0x00000000,0x00000000,unsigned>;
        ///PWM channel0 enable
        enum class Pwmen0Val {
            em0=0x00000000,     ///<CT16Bn_MAT0 is controlled by EM0.
            pwmmode=0x00000001,     ///<PWM mode is enabled for CT16Bn_MAT0.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,Pwmen0Val> pwmen0{};
        namespace Pwmen0ValC{
            constexpr Register::FieldValue<decltype(pwmen0)::Type,Pwmen0Val::em0> em0{};
            constexpr Register::FieldValue<decltype(pwmen0)::Type,Pwmen0Val::pwmmode> pwmmode{};
        }
        ///PWM channel1 enable
        enum class Pwmen1Val {
            em1=0x00000000,     ///<CT16Bn_MAT1 is controlled by EM1.
            pwmmode=0x00000001,     ///<PWM mode is enabled for CT16Bn_MAT1.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,Pwmen1Val> pwmen1{};
        namespace Pwmen1ValC{
            constexpr Register::FieldValue<decltype(pwmen1)::Type,Pwmen1Val::em1> em1{};
            constexpr Register::FieldValue<decltype(pwmen1)::Type,Pwmen1Val::pwmmode> pwmmode{};
        }
        ///PWM channel2 enable
        enum class Pwmen2Val {
            em2=0x00000000,     ///<Match channel 2 or pin CT16B0_MAT2 is controlled by EM2. Match channel 2 is not pinned out on timer 1.
            pwmmode=0x00000001,     ///<PWM mode is enabled for match channel 2 or pin CT16B0_MAT2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,Pwmen2Val> pwmen2{};
        namespace Pwmen2ValC{
            constexpr Register::FieldValue<decltype(pwmen2)::Type,Pwmen2Val::em2> em2{};
            constexpr Register::FieldValue<decltype(pwmen2)::Type,Pwmen2Val::pwmmode> pwmmode{};
        }
        ///PWM channel3 enable Note: It is recommended to use match channel 3 to set the PWM cycle because it is not pinned out.
        enum class Pwmen3Val {
            em3=0x00000000,     ///<Match channel 3 match channel 3 is controlled by EM3.
            pwmmode=0x00000001,     ///<PWM mode is enabled for match channel 3match channel 3.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,Pwmen3Val> pwmen3{};
        namespace Pwmen3ValC{
            constexpr Register::FieldValue<decltype(pwmen3)::Type,Pwmen3Val::em3> em3{};
            constexpr Register::FieldValue<decltype(pwmen3)::Type,Pwmen3Val::pwmmode> pwmmode{};
        }
        ///Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,4),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Mr0{    ///<Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.
        using Addr = Register::Address<0x4000c018,0x00000000,0x00000000,unsigned>;
        ///Timer counter match value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> match{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Mr1{    ///<Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.
        using Addr = Register::Address<0x4000c01c,0x00000000,0x00000000,unsigned>;
        ///Timer counter match value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> match{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Mr2{    ///<Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.
        using Addr = Register::Address<0x4000c020,0x00000000,0x00000000,unsigned>;
        ///Timer counter match value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> match{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
    namespace Ct16b0Mr3{    ///<Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.
        using Addr = Register::Address<0x4000c024,0x00000000,0x00000000,unsigned>;
        ///Timer counter match value.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> match{};
        ///Reserved.
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,16),Register::ReadWriteAccess,unsigned> reserved{};
    }
}


text:
"use strict";

exports.__esModule = true;
exports.default = void 0;

var React = _interopRequireWildcard(require("react"));

var _Text = _interopRequireDefault(require("../../../../exports/Text"));

var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var _default = (0, _createAnimatedComponent.default)(_Text.default, {
  collapsable: false
});

exports.default = _default;
module.exports = exports.default;

redpajama_set_name: RedPajamaGithub


text:
from flask import Flask, render_template
from flask_uwsgi_websocket import GeventWebSocket

app = Flask(__name__)
ws = GeventWebSocket(app)

@app.route('/')
def index():
    return render_template('index.html')

@ws.route('/websocket')
def echo(ws):
    while True:
        msg = ws.receive()
        if msg is not None:
            ws.send(msg)
        else: return

if __name__ == '__main__':
    app.run(debug=True, gevent=100)


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations
{
    public class VolatileKeywordRecommenderTests : KeywordRecommenderTests
    {
        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAtRoot_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script,
@"$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterClass_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script,
@"class C { }
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterGlobalStatement_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script,
@"System.Console.WriteLine();
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterGlobalVariableDeclaration_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script,
@"int i = 0;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotInUsingAlias()
        {
            await VerifyAbsenceAsync(
@"using Goo = $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotInEmptyStatement()
        {
            await VerifyAbsenceAsync(AddInsideMethod(
@"$$"));
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotInCompilationUnit()
            => await VerifyAbsenceAsync(SourceCodeKind.Regular, @"$$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterExtern()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"extern alias Goo;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterExtern_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script, @"extern alias Goo;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterUsing()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"using Goo;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterUsing_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script, @"using Goo;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterNamespace()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"namespace N {}
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterTypeDeclaration()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"class C {}
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterDelegateDeclaration()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"delegate void Goo();
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterMethod()
        {
            await VerifyKeywordAsync(
@"class C {
  void Goo() {}
  $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterField()
        {
            await VerifyKeywordAsync(
@"class C {
  int i;
  $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterProperty()
        {
            await VerifyKeywordAsync(
@"class C {
  int i { get; }
  $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotBeforeUsing()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular,
@"$$
using Goo;");
        }

        [WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/9880"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotBeforeUsing_Interactive()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Script,
@"$$
using Goo;");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterAssemblyAttribute()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"[assembly: goo]
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterAssemblyAttribute_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script, @"[assembly: goo]
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterRootAttribute()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular, @"[goo]
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterRootAttribute_Interactive()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script, @"[goo]
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedAttribute()
        {
            await VerifyKeywordAsync(
@"class C {
  [goo]
  $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestInsideStruct()
        {
            await VerifyKeywordAsync(
@"struct S {
   $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestInsideInterface()
        {
            await VerifyKeywordAsync(@"interface I {
   $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotInsideEnum()
        {
            await VerifyAbsenceAsync(@"enum E {
   $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestInsideClass()
        {
            await VerifyKeywordAsync(
@"class C {
   $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterPartial()
            => await VerifyAbsenceAsync(@"partial $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterAbstract()
            => await VerifyAbsenceAsync(@"abstract $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterInternal()
            => await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterInternal_Interactive()
            => await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedInternal()
        {
            await VerifyKeywordAsync(
@"class C {
    internal $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterPublic()
            => await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterPublic_Interactive()
            => await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedPublic()
        {
            await VerifyKeywordAsync(
@"class C {
    public $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterPrivate()
        {
            await VerifyAbsenceAsync(SourceCodeKind.Regular,
@"private $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterPrivate_Script()
        {
            await VerifyKeywordAsync(SourceCodeKind.Script,
@"private $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedPrivate()
        {
            await VerifyKeywordAsync(
@"class C {
    private $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterProtected()
        {
            await VerifyAbsenceAsync(
@"protected $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedProtected()
        {
            await VerifyKeywordAsync(
@"class C {
    protected $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterSealed()
            => await VerifyAbsenceAsync(@"sealed $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterNestedSealed()
        {
            await VerifyAbsenceAsync(
@"class C {
    sealed $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterStatic()
            => await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterStatic_Interactive()
            => await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedStatic()
        {
            await VerifyKeywordAsync(
@"class C {
    static $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterStaticPublic()
            => await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterStaticPublic_Interactive()
            => await VerifyKeywordAsync(SourceCodeKind.Script, @"static public $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedStaticPublic()
        {
            await VerifyKeywordAsync(
@"class C {
    static public $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterDelegate()
            => await VerifyAbsenceAsync(@"delegate $$");

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterEvent()
        {
            await VerifyAbsenceAsync(
@"class C {
    event $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterConst()
        {
            await VerifyAbsenceAsync(
@"class C {
    const $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterVolatile()
        {
            await VerifyAbsenceAsync(
@"class C {
    volatile $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotAfterNew()
        {
            await VerifyAbsenceAsync(
@"new $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestAfterNestedNew()
        {
            await VerifyKeywordAsync(
@"class C {
   new $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public async Task TestNotInMethod()
        {
            await VerifyAbsenceAsync(
@"class C {
   void Goo() {
     $$");
        }
    }
}


text:
package studio.ui;

import javax.swing.*;

public class TabPanel extends JPanel {
    Icon _icon;
    String _title;
    JComponent _component;

    public TabPanel(String title,Icon icon,JComponent component) {
        _title = title;
        _icon = icon;
        _component = component;
    }

    public Icon getIcon() {
        return _icon;
    }

    public void setIcon(Icon icon) {
        _icon = icon;
    }

    public String getTitle() {
        return _title;
    }

    public void setTitle(String title) {
        _title = title;
    }

    public JComponent getComponent() {
        return _component;
    }

    public void setComponent(JComponent component) {
        _component = component;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

    <session-factory>

        <property name="name">resources/hibernate.cfg.xml</property>
        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>

    </session-factory>

</hibernate-configuration>


text:
package zoopla

import (
    "net/http"
    "net/url"

    "github.com/google/go-querystring/query"
)

const (
    version        = "0.01"
    defaultBaseURL = "http://api.zoopla.co.uk/api/v1/"
    userAgent      = "github.com/JamesHutch/zoopla/" + version
)

type Api struct {
    BaseURL   *url.URL
    Key       string
    UserAgent string
}

func NewApi(key string) *Api {
    baseURL, _ := url.Parse(defaultBaseURL)
    return &Api{Key: key, UserAgent: userAgent, BaseURL: baseURL}
}

func (a *Api) NewRequest(relUrl, method string, opt interface{}) (*http.Request, error) {
    rel, err := url.Parse(relUrl)
    if err != nil {
        return nil, err
    }
    u := a.BaseURL.ResolveReference(rel)
    qs, err := query.Values(opt)
    if err != nil {
        return nil, err
    }
    qs.Set("api_key", a.Key)
    u.RawQuery = qs.Encode()
    req, err := http.NewRequest(method, u.String(), nil)
    if err != nil {
        return nil, err
    }
    req.Header.Add("User-Agent", a.UserAgent)
    return req, nil
}


text:
/*
 * NativeClient client side of a test for passing socket addresses.  The
 * client side steps are:
 * 1) The JavaScript bridge passes the "start" method socket address.
 * 2) Start then connects to that socket address, giving a connected socket.
 * 3) Start creates an SRPC client bound to the connected socket.
 * 4) Start performs an RPC on the SRPC client, which returns a message.
 * 5) Start compares the message for correctness.
 */

#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/nacl_syscalls.h>
#include <unistd.h>

#include "native_client/src/shared/srpc/nacl_srpc.h"

/* Flag used to record errors. */
/* It is returned to the JavaScript bridge through the report method. */
static int errors_seen = 0;

/* SockAddrClient implements the NativeClient client portion above. */
void SockAddrClient(NaClSrpcRpc *rpc,
                    NaClSrpcArg **in_args,
                    NaClSrpcArg **out_args,
                    NaClSrpcClosure *done) {
  NaClSrpcChannel channel;
  static char buf[1024];
  size_t buf_size = sizeof(buf);
  int connected_socket;
  int retval;
  int socket_address = in_args[0]->u.hval;
  static char cmp_msg[] = "Quidquid id est, timeo Danaos et dona ferentes";

  rpc->result = NACL_SRPC_RESULT_APP_ERROR;
  /* Start up banner, clear errors. */
  printf("SockAddrClient: socket address is %d\n", socket_address);
  errors_seen = 0;
  /* Connect to the socket address passed in, giving a new connected socket. */
  connected_socket = imc_connect(socket_address);
  if (connected_socket >= 0) {
    printf("SockAddrClient: connected as %d\n", connected_socket);
  } else {
    printf("SockAddrClient: connect FAILED, errno %d\n", errno);
    ++errors_seen;
    done->Run(done);
    return;
  }
  /* Start the SRPC client to communicate over the connected socket. */
  if (!NaClSrpcClientCtor(&channel, connected_socket)) {
    printf("SockAddrClient: SRPC constructor FAILED\n");
    ++errors_seen;
    done->Run(done);
    return;
  }
  /* Perform an RPC on the SRPC client, which returns a message. */
  if (NACL_SRPC_RESULT_OK
      != NaClSrpcInvokeBySignature(&channel, "getmsg::C", &buf_size, buf)) {
    printf("SockAddrClient: RPC FAILED.\n");
    ++errors_seen;
    done->Run(done);
    return;
  }
  /* Check the message for correctness. */
  printf("SockAddrClient: getmsg returned %s\n", buf);
  if (strcmp(buf, cmp_msg)) {
    printf("SockAddrClient: getmsg return string incorrect\n");
    ++errors_seen;
  }
  /* Shut down the SRPC server and close the client. */
  retval = NaClSrpcInvokeBySignature(&channel, "shutdown::");
  if (NACL_SRPC_RESULT_OK != retval && NACL_SRPC_RESULT_INTERNAL != retval) {
    printf("SockAddrClient: shutdown FAILED, retval = %d.\n", retval);
    ++errors_seen;
  }
  printf("SockAddrClient: shutting down, errors_seen %d\n", errors_seen);
  NaClSrpcDtor(&channel);
  /* Close the connected socket and the socket address descriptor. */
  if (0 != close(connected_socket)) {
    printf("SockAddrClient: connected socket close failed\n");
    ++errors_seen;
  }
  if (0 != close(socket_address)) {
    printf("SockAddrClient: socket address close failed\n");
    ++errors_seen;
  }
  /* Return the error count and success. */
  out_args[0]->u.ival = errors_seen;
  rpc->result = NACL_SRPC_RESULT_OK;
  done->Run(done);
}

/* SharedMemoryClient creates and returns a shared memory region. */
void SharedMemoryClient(NaClSrpcRpc *rpc,
                        NaClSrpcArg **in_args,
                        NaClSrpcArg **out_args,
                        NaClSrpcClosure *done) {
  int desc;
  char* test_string = "salvete, omnes";
  size_t size = in_args[0]->u.ival;
  /* Start up banner, clear errors. */
  printf("SharedMemoryClient: size %d\n", size);
  errors_seen = 0;
  /* Create an IMC shared memory region. */
  desc = imc_mem_obj_create(size);
  if (desc >= 0) {
    char* map_addr;
    map_addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, desc, 0);
    if (MAP_FAILED == map_addr) {
      printf("SharedMemoryClient: mmap failed\n");
      ++errors_seen;
    } else {
      strncpy(map_addr, test_string, strlen(test_string));
    }
  } else {
    printf("SharedMemoryClient: imc_mem_obj_create failed %d\n", desc);
    ++errors_seen;
  }
  /* Return the imc descriptor, the string we wrote, and the error count. */
  out_args[0]->u.hval = desc;
  /* NOTE: string return values from SRPC need to be heap allocated. */
  out_args[1]->arrays.str = strdup(test_string);
  out_args[2]->u.ival = errors_seen;
  rpc->result = NACL_SRPC_RESULT_OK;
  done->Run(done);
}

const struct NaClSrpcHandlerDesc srpc_methods[] = {
  { "sock_addr_client:h:i", SockAddrClient },
  { "shared_memory_client:i:hsi", SharedMemoryClient },
  { NULL, NULL },
};

int main(void) {
  printf("================== CLIENT ================\n");
  if (!NaClSrpcModuleInit()) {
    return 1;
  }
  printf("================== CLIENT INIT ================\n");
  if (!NaClSrpcAcceptClientConnection(srpc_methods)) {
    printf("================== CLIENT ACCEPT FAILED ================\n");
    return 1;
  }
  printf("================== CLIENT ACCEPT DONE ================\n");
  NaClSrpcModuleFini();
  return 0;
}


text:
{% extends "base.html" %}
{% block body %}
<p>{{ flatpage.content }}</p>
{% endblock body %}


text:
package org.knowm.xchange.ccex.dto.ticker;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Generated;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({"pairs"})
public class CCEXPairs {

  @JsonProperty("pairs")
  private List<String> pairs = new ArrayList<String>();
  @JsonIgnore
  private Map<String, Object> additionalProperties = new HashMap<String, Object>();

  /**
   * No args constructor for use in serialization
   */
  public CCEXPairs() {
  }

  /**
   * @param pairs
   */
  public CCEXPairs(List<String> pairs) {
    this.pairs = pairs;
  }

  /**
   * @return The pairs
   */
  @JsonProperty("pairs")
  public List<String> getPairs() {
    return pairs;
  }

  /**
   * @param pairs The pairs
   */
  @JsonProperty("pairs")
  public void setPairs(List<String> pairs) {
    this.pairs = pairs;
  }

  public CCEXPairs withPairs(List<String> pairs) {
    this.pairs = pairs;
    return this;
  }

  @JsonAnyGetter
  public Map<String, Object> getAdditionalProperties() {
    return this.additionalProperties;
  }

  @JsonAnySetter
  public void setAdditionalProperty(String name, Object value) {
    this.additionalProperties.put(name, value);
  }

  public CCEXPairs withAdditionalProperty(String name, Object value) {
    this.additionalProperties.put(name, value);
    return this;
  }

}


text:
/*
  You are given an array of integers representing coordinates of obstacles situated on a straight line.
  Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of
  the same length represented by some integer.
  Find the minimal length of the jump enough to avoid all the obstacles.

  Example
    For inputArray = [5, 3, 6, 7, 9], the output should be
      avoidObstacles(inputArray) = 4.
*/

int avoidObstacles(std::vector<int> inputArray) {
    int n = -1;
    for(n = 2; ; n++) {
        int count = 0;
        for(int i = 0; i < inputArray.size(); i++) {
            if(inputArray[i] % n == 0)
                break;
            else
                count++;
        }
        if(count == inputArray.size())
            break;
    }
    return n;
}


text:
package org.apache.velocity.test;

import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;

import java.io.StringWriter;
import java.io.Writer;

/**
 * Test resource caching related issues.
 *
 * @author Will Glass-Husain
 * @version $Id$
 */
public class ResourceCachingTestCase extends BaseTestCase
{
    /**
     * Path for templates. This property will override the
     * value in the default velocity properties file.
     */
    private final static String FILE_RESOURCE_LOADER_PATH = "/resourcecaching";

    /**
     * Default constructor.
     */
    public ResourceCachingTestCase(String name)
    {
        super(name);
    }

    @Override
    public void setUp()
            throws Exception
    {

    }

    public static Test suite ()
    {
        return new TestSuite(ResourceCachingTestCase.class);
    }

    /**
     * Tests for fix of bug VELOCITY-98 where a #include followed by #parse
     * of the same file throws ClassCastException when caching is on.
     * @throws Exception
     */
    public void testIncludeParseCaching ()
            throws Exception
    {

        VelocityEngine ve = new VelocityEngine();

        ve.setProperty("file.resource.loader.cache", "true");
        ve.setProperty("file.resource.loader.path", TemplateTestBase.TEST_COMPARE_DIR + FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template = ve.getTemplate("testincludeparse.vm");

        Writer writer = new StringWriter();

        VelocityContext context = new VelocityContext();

        // will produce a ClassCastException if Velocity-98 is not solved
        template.merge(context, writer);
        writer.flush();
        writer.close();
    }

}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<!DOCTYPE html>

  	<meta charset="utf-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge">
  	<title>Sipag CMS | Log in</title>

  	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  	<link rel="stylesheet" href="<?php echo base_url();?>assets/bootstrap/css/bootstrap.min.css">

  	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  	<link rel="stylesheet" href="<?php echo base_url();?>assets/dist/css/AdminLTE.min.css">

    		Sipag CMS

				Please enter your information

	    	<?php $msg = $this->session->flashdata('messages'); ?>
  			<?php if(!empty($msg)): ?>

				    <button type="button" class="close" data-dismiss="alert">

				    </button>
				    <?php echo $msg; ?>

  			<?php endif; ?>
	    	<?php $info = $this->session->flashdata('info'); ?>
			<?php if(!empty($info)): ?>

					<button type="button" class="close" data-dismiss="alert">

					</button>
					<?php echo $info; ?>

			<?php endif; ?>
	    	<form method="post" action="<?php echo base_url(); ?>admin/auth/check_login" />

			        <input type="text" name="username" class="form-control" placeholder="Username" required autofocus>

	        		<input type="password" name="password" class="form-control" placeholder="Password" required>

	          			<button type="submit" class="btn btn-primary btn-block btn-flat pull-right">Sign In</button>

	    	</form>

	    	Forgot password? <a href="<?php echo base_url(); ?>admin/reset_password">Click here


text:
#ifndef BOOST_POLY_COLLECTION_DETAIL_ANY_MODEL_HPP
#define BOOST_POLY_COLLECTION_DETAIL_ANY_MODEL_HPP

#if defined(_MSC_VER)
#pragma once
#endif

#include <boost/core/addressof.hpp>
#include <boost/mpl/map/map10.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/vector/vector10.hpp>
#include <boost/poly_collection/detail/any_iterator.hpp>
#include <boost/poly_collection/detail/is_acceptable.hpp>
#include <boost/poly_collection/detail/segment_backend.hpp>
#include <boost/poly_collection/detail/split_segment.hpp>
#include <boost/type_erasure/any.hpp>
#include <boost/type_erasure/any_cast.hpp>
#include <boost/type_erasure/binding.hpp>
#include <boost/type_erasure/builtin.hpp>
#include <boost/type_erasure/concept_of.hpp>
#include <boost/type_erasure/is_subconcept.hpp>
#include <boost/type_erasure/relaxed.hpp>
#include <boost/type_erasure/static_binding.hpp>
#include <boost/type_erasure/typeid_of.hpp>
#include <memory>
#include <type_traits>
#include <typeinfo>
#include <utility>

namespace boost{

namespace poly_collection{

namespace detail{

/* model for any_collection */

template<typename Concept>
struct any_model;

/* Refine is_acceptable to cover type_erasure::any classes whose assignment
 * operator won't compile.
 */

template<typename Concept,typename Concept2,typename T>
struct is_acceptable<
  type_erasure::any<Concept2,T>,any_model<Concept>,
  typename std::enable_if<
    !type_erasure::is_relaxed<Concept2>::value&&
    !type_erasure::is_subconcept<type_erasure::assignable<>,Concept2>::value&&
    !type_erasure::is_subconcept<
      type_erasure::assignable<type_erasure::_self,type_erasure::_self&&>,
      Concept2>::value
  >::type
>:std::false_type{};

/* is_terminal defined out-class to allow for partial specialization */

template<typename Concept,typename T>
using any_model_enable_if_has_typeid_=typename std::enable_if<
  type_erasure::is_subconcept<
    type_erasure::typeid_<typename std::decay<T>::type>,
    Concept
  >::value
>::type*;

template<typename T,typename=void*>
struct any_model_is_terminal:std::true_type{};

template<typename Concept,typename T>
struct any_model_is_terminal<
  type_erasure::any<Concept,T>,any_model_enable_if_has_typeid_<Concept,T>
>:std::false_type{};

/* used for make_value_type */

template<typename T,typename Q>
struct any_model_make_reference
{
  static T& apply(Q& x){return x;}
};

template<typename Concept>
struct any_model
{
  using value_type=type_erasure::any<
    typename std::conditional<
      type_erasure::is_subconcept<type_erasure::typeid_<>,Concept>::value,
      Concept,
      mpl::vector2<Concept,type_erasure::typeid_<>>
    >::type,
    type_erasure::_self&
  >;

  template<typename Concrete>
  using is_implementation=std::true_type; /* can't compile-time check concept
                                           * compliance */
  template<typename T>
  using is_terminal=any_model_is_terminal<T>;

  template<typename T>
  static const std::type_info& subtypeid(const T&){return typeid(T);}

  template<
    typename Concept2,typename T,
    any_model_enable_if_has_typeid_<Concept2,T> =nullptr
  >
  static const std::type_info& subtypeid(
    const type_erasure::any<Concept2,T>& a)
  {
    return type_erasure::typeid_of(a);
  }

  template<typename T>
  static void* subaddress(T& x){return boost::addressof(x);}

  template<typename T>
  static const void* subaddress(const T& x){return boost::addressof(x);}

  template<
    typename Concept2,typename T,
    any_model_enable_if_has_typeid_<Concept2,T> =nullptr
  >
  static void* subaddress(type_erasure::any<Concept2,T>& a)
  {
    return type_erasure::any_cast<void*>(&a);
  }

  template<
    typename Concept2,typename T,
    any_model_enable_if_has_typeid_<Concept2,T> =nullptr
  >
  static const void* subaddress(const type_erasure::any<Concept2,T>& a)
  {
    return type_erasure::any_cast<const void*>(&a);
  }

  using base_iterator=any_iterator<value_type>;
  using const_base_iterator=any_iterator<const value_type>;
  using base_sentinel=value_type*;
  using const_base_sentinel=const value_type*;
  template<typename Concrete>
  using iterator=Concrete*;
  template<typename Concrete>
  using const_iterator=const Concrete*;
  using segment_backend=detail::segment_backend<any_model>;
  template<typename Concrete,typename Allocator>
  using segment_backend_implementation=split_segment<
    any_model,
    Concrete,
    typename std::allocator_traits<Allocator>::
      template rebind_alloc<Concrete>
  >;
  using segment_backend_unique_ptr=
    typename segment_backend::segment_backend_unique_ptr;

  static base_iterator nonconst_iterator(const_base_iterator it)
  {
    return base_iterator{
      const_cast<value_type*>(static_cast<const value_type*>(it))};
  }

  template<typename T>
  static iterator<T> nonconst_iterator(const_iterator<T> it)
  {
    return const_cast<iterator<T>>(it);
  }

  template<typename Concrete,typename Allocator>
  static segment_backend_unique_ptr make(const Allocator& al)
  {
    return segment_backend_implementation<Concrete,Allocator>::new_(al,al);
  }

private:
  template<typename,typename,typename>
  friend class split_segment;

  template<typename Concrete>
  static value_type make_value_type(Concrete& x){return value_type{x};}

  template<typename Concept2,typename T>
  static value_type make_value_type(type_erasure::any<Concept2,T>& x)
  {
    /* I don't pretend to understand what's going on here, see
     * https://lists.boost.org/boost-users/2017/05/87556.php
     */

    using namespace boost::type_erasure;
    using ref_type=any<Concept2,T>;
    using make_ref=any_model_make_reference<_self,ref_type>;
    using concept_=typename concept_of<value_type>::type;

    auto b=make_binding<mpl::map1<mpl::pair<_self,ref_type>>>();

    return {call(binding<make_ref>{b},make_ref{},x),binding<concept_>{b}};
  }
};

} /* namespace poly_collection::detail */

} /* namespace poly_collection */

} /* namespace boost */

#endif


text:
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);

ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL;

ALTER TABLE ATTACHMENT ALTER COLUMN REF_INSTANCE DROP NOT NULL;


text:
<?php

namespace Phlexible\Component\MediaManager\Exception;

/**
 * Store uploaded files exception
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class StoreUploadedFileException extends RuntimeException
{

}


text:
if ping -c 1 -q metadata.google.internal &> /dev/null; then
  echo 'Running on GCE, not asking for sudo credentials'
elif sudo --non-interactive "$(which bash)" -c true 2> /dev/null; then
  # if we can run bash without a password, it's a pretty safe bet that either
  # we can run any command without a password, or that sudo credentials
  # are already cached - and they've just been re-cached
  echo 'No need to refresh sudo credentials'
else
  echo 'Updating sudo credentials'
  sudo --validate || exit 1
fi

# FOCUS is ginkgo focus to select which tests to run. By default, FOCUS is
# initialized as "\[Conformance\]" in the test container to run all conformance
# test.
FOCUS=${FOCUS:-""}

# SKIP is ginkgo skip to select which tests to skip. By default, SKIP is
# initialized as "\[Flaky\]|\[Serial\]" in the test container skipping all
# flaky and serial test.
SKIP=${SKIP:-""}

# TEST_ARGS is the test arguments. It could be used to override default test
# arguments in the container.
TEST_ARGS=${TEST_ARGS:-""}

# REGISTRY is the image registry for node test image.
REGISTRY=${REGISTRY:-"k8s.gcr.io"}

# ARCH is the architecture of current machine, the script will use this to
# select corresponding test container image.
ARCH=${ARCH:-"amd64"}

# VERSION is the version of the test container image.
VERSION=${VERSION:-"0.2"}

# KUBELET_BIN is the kubelet binary name. If it is not specified, use the
# default binary name "kubelet".
KUBELET_BIN=${KUBELET_BIN:-"kubelet"}

# KUBELET is the kubelet binary path. If it is not specified, assume kubelet is
# in PATH.
KUBELET=${KUBELET:-"$(which "$KUBELET_BIN")"}

# LOG_DIR is the absolute path of the directory where the test will collect all
# logs to. By default, use the current directory.
LOG_DIR=${LOG_DIR:-$(pwd)}
mkdir -p "$LOG_DIR"

# NETWORK_PLUGIN is the network plugin used by kubelet. Do not use network
# plugin by default.
NETWORK_PLUGIN=${NETWORK_PLUGIN:-""}

# CNI_CONF_DIR is the path to network plugin binaries.
CNI_CONF_DIR=${CNI_CONF_DIR:-""}

# CNI_BIN_DIR is the path to network plugin config files.
CNI_BIN_DIR=${CNI_BIN_DIR:-""}

# KUBELET_KUBECONFIG is the path to a kubeconfig file, specifying how to connect to the API server.
KUBELET_KUBECONFIG=${KUBELET_KUBECONFIG:-"/var/lib/kubelet/kubeconfig"}

# Creates a kubeconfig file for the kubelet.
# Args: address (e.g. "http://localhost:8080"), destination file path
function create-kubelet-kubeconfig() {
  local api_addr="${1}"
  local dest="${2}"
  local dest_dir
  dest_dir="$(dirname "${dest}")"
  mkdir -p "${dest_dir}" &>/dev/null || sudo mkdir -p "${dest_dir}"
  sudo=$(test -w "${dest_dir}" || echo "sudo -E")
  cat <<EOF | ${sudo} tee "${dest}" > /dev/null
apiVersion: v1
kind: Config
clusters:
  - cluster:
      server: ${api_addr}
    name: local
contexts:
  - context:
      cluster: local
    name: local
current-context: local
EOF
}

# start_kubelet starts kubelet and redirect kubelet log to $LOG_DIR/kubelet.log.
kubelet_log=kubelet.log
start_kubelet() {
  echo "Creating kubelet.kubeconfig"
  create-kubelet-kubeconfig "http://localhost:8080" "${KUBELET_KUBECONFIG}"
  echo "Starting kubelet..."
  # we want to run this command as root but log the file to a normal user file
  # (so disable SC2024)
  # shellcheck disable=SC2024
  if ! sudo -b "${KUBELET}" "$@" &>"${LOG_DIR}/${kubelet_log}"; then
    echo "Failed to start kubelet"
    exit 1
  fi
}

# wait_kubelet retries for 10 times for kubelet to be ready by checking http://127.0.0.1:10255/healthz.
wait_kubelet() {
  echo "Health checking kubelet..."
  healthCheckURL=http://127.0.0.1:10255/healthz
  local maxRetry=10
  local cur=1
  while [ $cur -le $maxRetry ]; do
    if curl -s $healthCheckURL > /dev/null; then
      echo "Kubelet is ready"
      break
    fi
    if [ $cur -eq $maxRetry ]; then
      echo "Health check exceeds max retry"
      exit 1
    fi
    echo "Kubelet is not ready"
    sleep 1
    ((cur++))
  done
}

# kill_kubelet kills kubelet.
kill_kubelet() {
  echo "Stopping kubelet..."
  if ! sudo pkill "${KUBELET_BIN}"; then
    echo "Failed to stop kubelet."
    exit 1
  fi
}

# run_test runs the node test container.
run_test() {
  env=""
  if [ -n "$FOCUS" ]; then
    env="$env -e FOCUS=\"$FOCUS\""
  fi
  if [ -n "$SKIP" ]; then
    env="$env -e SKIP=\"$SKIP\""
  fi
  if [ -n "$TEST_ARGS" ]; then
    env="$env -e TEST_ARGS=\"$TEST_ARGS\""
  fi
  # The test assumes that inside the container:
  # * kubelet manifest path is mounted to the same path;
  # * log collect directory is mounted to /var/result;
  # * root file system is mounted to /rootfs.
  sudo sh -c "docker run -it --rm --privileged=true --net=host -v /:/rootfs \
    -v $config_dir:$config_dir -v $LOG_DIR:/var/result ${env} $REGISTRY/node-test-$ARCH:$VERSION"
}

# Check whether kubelet is running. If kubelet is running, tell the user to stop
# it before running the test.
pid=$(pidof "${KUBELET_BIN}")
if [ -n "$pid" ]; then
  echo "Kubelet is running (pid=$pid), please stop it before running the test."
  exit 1
fi

volume_stats_agg_period=10s
serialize_image_pulls=false
config_dir=$(mktemp -d)
file_check_frequency=10s
pod_cidr=10.100.0.0/24
log_level=4
start_kubelet --kubeconfig "${KUBELET_KUBECONFIG}" \
  --volume-stats-agg-period $volume_stats_agg_period \
  --serialize-image-pulls=$serialize_image_pulls \
  --pod-manifest-path "${config_dir}" \
  --file-check-frequency $file_check_frequency \
  --pod-cidr=$pod_cidr \
  --runtime-cgroups=/docker-daemon \
  --kubelet-cgroups=/kubelet \
  --system-cgroups=/system \
  --cgroup-root=/ \
  "--network-plugin=${NETWORK_PLUGIN}" \
  "--cni-conf-dir=${CNI_CONF_DIR}" \
  "--cni-bin-dir=${CNI_BIN_DIR}" \
  --v=$log_level \
  --logtostderr

wait_kubelet

run_test

kill_kubelet

# Clean up the kubelet config directory
sudo rm -rf "${config_dir}"


text:
package com.balls.slack;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;

/**
 * Helper methods for making HTTP requests
 */
public class SlackRequestUtil {
    private static CloseableHttpClient httpClient = null;
    private static ObjectMapper objectMapper = null;

    private static final Charset EXPECTED_CHARSET = Charset.forName("UTF-8");

    /**
     * Convert a request to a json node.
     * @param request the request
     * @return the node
     */
    public static JsonNode executeRequestToJsonNode(HttpUriRequest request) {
        // get the json data
        JsonNode json = null;
        String content;
        CloseableHttpResponse response = null;
        try {
            response = getHttpClient().execute(request);
            content = EntityUtils.toString(response.getEntity(), EXPECTED_CHARSET);
            json = getObjectMapper().readTree(content);
        } catch (IOException ioe) {
            System.out.println("EXCEPTION: " + ioe); // TODO: fix
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException ioe) {
                System.out.println("EXCEPTION: " + ioe); // TODO: fix
            }
        }

        // return it
        if (json == null) {
            System.out.println("no json to return, wat"); // TODO: fix
        }
        return json;
    }

    public static String mapToJsonString(Map<String, Object> map) {
        String jsonString = null;
        try {
            jsonString = objectMapper.writeValueAsString(map);
        } catch (JsonProcessingException e) {
            System.err.println(e.getMessage());
        }

        return jsonString;
    }

    private static CloseableHttpClient getHttpClient() {
        if (httpClient == null) {
            httpClient = HttpClients.createDefault();
        }

        return httpClient;
    }

    private static ObjectMapper getObjectMapper() {
        if (objectMapper == null) {
            objectMapper = new ObjectMapper(new JsonFactory());
        }

        return objectMapper;
    }
}


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

<title>IndexedUDFFinder (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.ss.formula.udf

Class IndexedUDFFinder

java.lang.Object

org.apache.poi.ss.formula.udf.AggregatingUDFFinder

org.apache.poi.ss.formula.udf.IndexedUDFFinder

All Implemented Interfaces:

UDFFinder

Direct Known Subclasses:

IndexedUDFFinder

@Internal
public class IndexedUDFFinder
extends AggregatingUDFFinder

A UDFFinder that can retrieve functions both by name and by fake index.

Author:

Yegor Kozlov

Field Summary

Fields inherited from interface org.apache.poi.ss.formula.udf.UDFFinder

DEFAULT

Constructor Summary

Constructors

Constructor and Description

IndexedUDFFinder(UDFFinder... usedToolPacks)

Method Summary

Methods

Modifier and Type
Method and Description

FreeRefFunction
findFunction(java.lang.String name)

Returns executor by specified name.

int
getFunctionIndex(java.lang.String name)

java.lang.String
getFunctionName(int idx)

Methods inherited from class org.apache.poi.ss.formula.udf.AggregatingUDFFinder

add

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IndexedUDFFinder

public IndexedUDFFinder(UDFFinder... usedToolPacks)

Method Detail

findFunction

public FreeRefFunction findFunction(java.lang.String name)

Description copied from class: AggregatingUDFFinder

Returns executor by specified name. Returns null if
 function isn't contained by any registered tool pack.

Specified by:

findFunction in interface UDFFinder

Overrides:

findFunction in class AggregatingUDFFinder

Parameters:

name - Name of function.

Returns:

Function executor. null if not found

getFunctionName

public java.lang.String getFunctionName(int idx)

getFunctionIndex

public int getFunctionIndex(java.lang.String name)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.


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

<title>Location.LatLong (Whitepages PRO API Java Docs)</title>
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.whitepages.proapi.data.entity

Class Location.LatLong

java.lang.Object

com.whitepages.proapi.data.entity.Location.LatLong

Enclosing interface:

Location

public static class Location.LatLong
extends java.lang.Object

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
Location.LatLong.GeoAccuracy

Constructor Summary

Constructors

Constructor and Description

Location.LatLong(double latitude,
                double longitude)

Location.LatLong(double latitude,
                double longitude,
                Location.LatLong.GeoAccuracy geoAccuracy)

Method Summary

Methods

Modifier and Type
Method and Description

Location.LatLong.GeoAccuracy
getGeoAccuracy()

double
getLatitude()

double
getLongitude()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Location.LatLong

public Location.LatLong(double latitude,
                double longitude,
                Location.LatLong.GeoAccuracy geoAccuracy)

Location.LatLong

public Location.LatLong(double latitude,
                double longitude)

Method Detail

getLatitude

public double getLatitude()

getLongitude

public double getLongitude()

getGeoAccuracy

public Location.LatLong.GeoAccuracy getGeoAccuracy()

Overview

Package

Class

Tree

Deprecated

Index

Help

©2015, Whitepages, Inc.

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
#include <time.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "parsvfei.h"

/* End of standard includes.                                                  */
/******************************************************************************/

/*****VERSION*********************************************************/

static char parsVFEIcid[] = "$Id: parsVFEI.c Ver 01.0 Rel 01.0 $";

/*********************************************************************/

/*******************************************************************************

 HSMS_VFI_GetToken:                                  Date:  July 2013
 ~~~~~~~~~~~~~~~~~                                Author:  Zhou An-Ping

 This function will retrieve the data portion of the field associated with
 the given VID.

 Arguments:
 ~~~~~~~~~~
 - vid (type is *char - Read only):
 The referenced string represents the VID to be retrieved.

 - type (type is int - Read only):
 The coded integer represents the type of data.  If the value
 of type is greater than 0, the type is a string and the value
 of type represents the size of the string.

 - data (type is *void - Read/Write):
 The referenced data element is of the specified type.  Its
 contents will be loaded with data from the next field.

 Returns:
 ~~~~~~~~
 Type is int - coded value representing the completion status of the
 function.

 Modifications:
 ~~~~~~~~~~~~~~
 - Author                     Date
 Description...

 *******************************************************************************/

int HSMS_VFI_GetToken(char *vid, int type, void *data) {

  //char token[_SIZ_MSGBUFF], *pattern, *value;
  char *token, *pattern, *value;

  message.msgPtr = 0;
  pattern = HSMS_VFI_SetPattern(vid, type);
  if (pattern[0] == 0)

    return _RET_RECNOTFND;  // (TRC_SetAlarm("HSMS_VFI_GetToken", _RET_RECNOTFND, vid));

  while (HSMS_VFI_GetNext(token, _SIZ_MSGBUFF) == _RET_SUCCESS) {
    if (strncmp(token, pattern, strlen(pattern)) == 0) {
      if ((value = strchr(token, '=')) == NULL)
        return _RET_RECNOTFND;  // (TRC_SetAlarm("HSMS_VFI_GetToken", _RET_RECNOTFND, vid));
      return (HSMS_VFI_SetToken(&value[1], type, data));
    }
  }
  return _RET_SUCCESS;  //(TRC_SetAlarm("HSMS_VFI_GetToken", _RET_RECNOTFND, vid));
}

/********************* End of function HSMS_VFI_GetToken ***********************/

/*******************************************************************************

 HSMS_VFI_GetArray:                                  Date:  July 2013
 ~~~~~~~~~~~~~~~~~                                Author:  Zhou An-Ping

 This function will retrieve the data portion of the array associated with
 the given VID.

 Arguments:
 ~~~~~~~~~~
 - vid (type is *char - Read only):
 The referenced string represents the VID to be retrieved.

 - maxElem (type is int - Read only):
 The numeric value represents the maximum number of element that
 are defined in the array.

 - type (type is int - Read only):
 The coded integer represents the type of data in the array.  If
 the value of type is greater than 0, the type is a string and
 the value of type represents the maximum size of each string
 element in the array.

 - numElem (type is *int - Read/Write):
 The referenced integer will be loaded with the number of elements
 retrieved from the VFEI message.

 - data (type is *void - Read/Write):
 The referenced data element is of the specified type.  Its
 contents will be loaded with data from the next field.

 Returns:
 ~~~~~~~~
 Type is int - coded value representing the completion status of the
 function.

 Modifications:
 ~~~~~~~~~~~~~~
 - Author                     Date
 Description...

 *******************************************************************************/

int HSMS_VFI_GetArray(char *vid, int maxElem, int type, int *numElem, void *data) {

  //char array[_SIZ_MSGBUFF], *strPtr;
  char *array, *strPtr;
  int parse, length;
  int status;

  /*..........................................................................*/
  /* Get the array of data from the message...                                */

  if ((status = HSMS_VFI_GetToken(vid, _SIZ_MSGBUFF, array)) != _RET_SUCCESS)
    return (status);
  length = strlen(array);

  /*..........................................................................*/
  /* Process the entire array...                                              */

  parse = 0;
  *numElem = 0;
  while (parse < length) {

    /*........................................................................*/
    /* Get rid of leading blanks and assign start of token...                 */

    while (isspace(array[parse]) != 0)
      if (++parse >= length)
        return (_RET_SUCCESS);
    strPtr = &array[parse];

    /*........................................................................*/
    /* We got the start of a token - find the end...                          */

    if (*numElem >= maxElem)
      return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_GetArray", _RET_PARSEERR, strPtr));
    while (1 == 1) {
      if (isspace(array[parse]) != 0)
        break;
      else if (array[parse] == '"')
        while ((++parse < length) && (array[parse] != '"'))
          ;
      if (++parse >= length)
        break;
    }

    /*........................................................................*/
    /* Assign the token and NULL terminate it...                              */

    array[parse] = 0;
    if (type > 0)
      status = HSMS_VFI_SetToken(strPtr, type, &((char *) data)[(*numElem) * type]);
    else
      switch (type) {
        case _PRS_UINT:
        case _PRS_BIN:
          status = HSMS_VFI_SetToken(strPtr, type, &((unsigned *) data)[(*numElem)]);
          break;
        case _PRS_INT:
          status = HSMS_VFI_SetToken(strPtr, type, &((int *) data)[(*numElem)]);
          break;
        case _PRS_FLOAT:
          status = HSMS_VFI_SetToken(strPtr, type, &((float *) data)[(*numElem)]);
          break;
        default:
          return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_GetArray", _RET_PARSEERR, array));
          break;
      }
    if (status != _RET_SUCCESS)
      return (status);
    (*numElem)++;
    parse++;
  }

  return (_RET_SUCCESS);
}

/********************* End of function HSMS_VFI_GetArray ***********************/

/*******************************************************************************

 HSMS_VFI_SetPattern:                                Date:  July 2013
 ~~~~~~~~~~~~~~~~~                                Author:  Zhou An-Ping

 This function will establish the search pattern as a function of the VID
 name and the VID type.

 Arguments:
 ~~~~~~~~~~
 - vid (type is *char - Read only):
 The referenced string represents the VID to be retrieved.

 - type (type is int - Read only):
 The coded integer represents the type of data.  If the value
 of type is greater than 0, the type is a string and the value
 of type represents the size of the string.

 Returns:
 ~~~~~~~~
 Type is *char - pointer to string containing the search pattern.  The
 string is a static variable which will be modified with subsequent
 calls.

 Modifications:
 ~~~~~~~~~~~~~~
 - Author                     Date
 Description...

 *******************************************************************************/

char *HSMS_VFI_SetPattern(char *vid, int type) {

  static char pattern[_SIZ_GENFIELD];

  if (type > 0)
    sprintf(pattern, "%.*s/", _SIZ_GENFIELD - 2, vid);
  else
    switch (type) {
      case _PRS_UINT:
        sprintf(pattern, "%.*s/U", _SIZ_GENFIELD - 3, vid);
        break;
      case _PRS_BIN:
        sprintf(pattern, "%.*s/B", _SIZ_GENFIELD - 3, vid);
        break;
      case _PRS_INT:
        sprintf(pattern, "%.*s/I", _SIZ_GENFIELD - 3, vid);
        break;
      case _PRS_FLOAT:
        sprintf(pattern, "%.*s/F", _SIZ_GENFIELD - 3, vid);
        break;
      default:
        pattern[0] = 0;
        break;
    }

  return (pattern);
}

/******************** End of function HSMS_VFI_SetPattern **********************/

/*******************************************************************************

 HSMS_VFI_SetToken:                                  Date:  July 2013
 ~~~~~~~~~~~~~~~~~                                Author:  Zhou An-Ping

 This function will convert a string to the specified type.  It is assumed
 that the string comes from VFEI.  If a string to string conversion is
 required, the enclosing quotes ("") or brackets ([]) will be removed.

 Arguments:
 ~~~~~~~~~~
 - source (type is *char - Read only):
 The referenced string contains the data to be converted.

 - type (type is int - Read only):
 The coded integer represents the type of data.  If the value
 of type is greater than 0, the type is a string and the value
 of type represents the size of the string.

 - data (type is *void - Read/Write):
 The referenced data element is of the specified type.  Its
 contents will be loaded with data from the next field.

 Returns:
 ~~~~~~~~
 Type is int - coded value representing the completion status of the
 function.

 Modifications:
 ~~~~~~~~~~~~~~
 - Author                     Date
 Description...

 *******************************************************************************/

int HSMS_VFI_SetToken(char *source, int type, void *data) {

  int length;

  length = strlen(source);
  if (length == 0)
    return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_SetToken", _RET_PARSEERR, source));

  if (type > 0) {
    if ((length > 1)
        && (((source[0] == '[') && (source[length - 1] == ']')) || ((source[0] == '"') && (source[length - 1] == '"')))) {
      if ((length - 2) >= type)
        return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_SetToken", _RET_PARSEERR, source));
      strncpy((char *) data, &source[1], length - 2);
      ((char *) data)[length - 2] = '\0';
    } else {
      if (length >= type)
        return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_SetToken", _RET_PARSEERR, source));
      strcpy((char *) data, source);
    }
  } else
    switch (type) {
      case _PRS_UINT:
      case _PRS_BIN:
        *((unsigned *) data) = (unsigned) atol(source);
        break;
      case _PRS_INT:
        *((int *) data) = (int) atol(source);
        break;
      case _PRS_FLOAT:
        sscanf(source, "%e", data);

        /*     *(data) = (float) atof (source);  */
        break;

      default:
        return _RET_PARSEERR;  // (TRC_SetAlarm("HSMS_VFI_SetToken", _RET_PARSEERR, source));
        break;
    }

  return (_RET_SUCCESS);
}

/********************* End of function HSMS_VFI_SetToken ***********************/

/*******************************************************************************

 HSMS_VFI_GetNext:                                   Date:  July 2013
 ~~~~~~~~~~~~~~~~~                                Author:  Zhou An-Ping

 This function will retrieve the next VFEI field in the message buffer.
 It is assumed that the message pointer has been initialized.

 Arguments:
 ~~~~~~~~~~
 - data (type is *char - Read/Write):
 The referenced data element will be loaded with the next token.

 - size (type is int - Read only):
 The integer represents the maximum number of bytes that data
 can support.

 Returns:
 ~~~~~~~~
 Type is int - coded value representing the completion status of the
 function.

 Modifications:
 ~~~~~~~~~~~~~~
 - Author                     Date
 Description...

 *******************************************************************************/

int HSMS_VFI_GetNext(char *data, int size) {

  int parse, tokSize;

  /*..........................................................................*/
  /* Check if given size is appropriate...                                    */
  if (size <= 0)
    return (_RET_PARSEERR);
  if (message.msgPtr >= message.msgLen)
    return (_RET_PARSEERR);
  /*..........................................................................*/
  /* Get rid of leading blanks...                                             */

  while (isspace(message.buffer[message.msgPtr]) != 0)
    if (++message.msgPtr >= message.msgLen)
      return (_RET_PARSEERR);

  /*..........................................................................*/
  /* We got the start of a token - find the end...                            */

  parse = message.msgPtr;
  while (1 == 1) {
    if (isspace(message.buffer[parse]) != 0)
      break;
    else if (message.buffer[parse] == '[')
      while ((++parse < message.msgLen) && (message.buffer[parse] != ']'))
        ;
    else if (message.buffer[parse] == '"')
      while ((++parse < message.msgLen) && (message.buffer[parse] != '"'))
        ;
    if (++parse >= message.msgLen)
      break;
  }

  /*..........................................................................*/
  /* Assign the token and NULL terminate it...                                */

  tokSize = parse - message.msgPtr;
  if (tokSize >= size)
    return (_RET_PARSEERR);
  strncpy(data, &message.buffer[message.msgPtr], tokSize);
  data[tokSize] = 0;
  message.msgPtr = parse;
  return (_RET_SUCCESS);
}

/********************** End of function HSMS_VFI_GetNext ***********************/


text:
namespace Swetugg.Web.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class OpenCloseCfp : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Conferences", "CfpStart", c => c.DateTime());
            AddColumn("dbo.Conferences", "CfpEnd", c => c.DateTime());
        }

        public override void Down()
        {
            DropColumn("dbo.Conferences", "CfpEnd");
            DropColumn("dbo.Conferences", "CfpStart");
        }
    }
}


text:
var user1 = { id: 1, name: 'John', friends: [], friendIndexes: [] };  // friendIndexes: [3, 2, 1], friends: [ user3, user2, user 1]
var user2 = { id: 2, name: 'Susan', friends: [], friendIndexes: [] }; // friendIndexes: [4]
var user3 = { id: 3, name: 'Bob', friends: [], friendIndexes: [] };
var user4 = { id: 4, name: 'Sam', friends: [], friendIndexes: [] };
var user5 = { id: 5, name: 'Mike', friends: [], friendIndexes: [] };

var usersArray = [[3, 2, 1], [4], [0, 1, 4], [1, 4], [3]];

function getFriendsOfFriends(users, index) {
   // Convert array of into a graph of objects of type user
  var graph = [ user1, user2, user3, user4, user5 ];

  for (var i = 0; i < users.length; ++i) {
   var friends = users[i];
     graph[i].friendIndexes = friends;
  }

  for (var i = 0; i < graph.length; ++i) {
   var user = graph[i];
   for (var j = 0; j < user.friendIndexes.length; ++j) {
     var index =  user.friendIndexes[j];
       user.friends.push(graph[index]);
   }
	}
   var result = {};
   addFriends(graph[index], result, 5);
   return Object.values(result);
}

function addFriends(user, result, counter) { // user is of type User, result contains type User
	if (counter === 0) return;

  console.log('--------------------------------step: ', counter);
  console.log('--------------------------------user, result: ', user, result);
	var friends = user.friends;
    for (var i = 0; i < friends.length; i++) {
      var friend = friends[i];
      if (!result[friend.id]) {
        result[friend.id] = friend;
        addFriends(friend, result, counter-1);
      }
    }
}

var friends = getFriendsOfFriends(usersArray, 7);
console.log(friends);


text:
[Grunt homepage](http://gruntjs.com/) | [Documentation table of contents](toc.md)

# [The grunt API](api.md) / grunt.util

_Note: `grunt.utils` was renamed to `grunt.util` and deprecated in grunt v0.4.0. Please ensure that your custom tasks are are up-to-date, and update your links to refer to the [grunt.util documentation](api_util.md)._


text:
#include "com/centreon/broker/neb/service_dependency.hh"

#include "com/centreon/broker/database/table_max_size.hh"

using namespace com::centreon::broker;
using namespace com::centreon::broker::neb;

/**************************************
 *                                     *
 *           Public Methods            *
 *                                     *
 **************************************/

/**
 *  Default constructor.
 */
service_dependency::service_dependency()
    : dependency(service_dependency::static_type()),
      dependent_service_id(0),
      service_id(0) {}

/**
 *  Copy constructor.
 *
 *  @param[in] sd Object to copy.
 */
service_dependency::service_dependency(service_dependency const& sd)
    : dependency(sd) {
  _internal_copy(sd);
}

/**
 *  Destructor.
 */
service_dependency::~service_dependency() {}

/**
 *  Assignment operator.
 *
 *  @param[in] sd Object to copy.
 *
 *  @return This object.
 */
service_dependency& service_dependency::operator=(
    service_dependency const& sd) {
  if (this != &sd) {
    dependency::operator=(sd);
    _internal_copy(sd);
  }
  return *this;
}

/**************************************
 *                                     *
 *           Private Methods           *
 *                                     *
 **************************************/

/**
 *  Copy internal members from the given object.
 *
 *  @param[in] sd Object to copy.
 */
void service_dependency::_internal_copy(service_dependency const& sd) {
  dependent_service_id = sd.dependent_service_id;
  service_id = sd.service_id;
}

/**************************************
 *                                     *
 *           Static Objects            *
 *                                     *
 **************************************/

// Mapping.
mapping::entry const service_dependency::entries[] = {
    mapping::entry(&service_dependency::dependency_period,
                   "dependency_period",
                   get_services_services_dependencies_col_size(
                       services_services_dependencies_dependency_period)),
    mapping::entry(&service_dependency::dependent_host_id,
                   "dependent_host_id",
                   mapping::entry::invalid_on_zero),
    mapping::entry(&service_dependency::dependent_service_id,
                   "dependent_service_id",
                   mapping::entry::invalid_on_zero),
    mapping::entry(&service_dependency::enabled, ""),
    mapping::entry(
        &service_dependency::execution_failure_options,
        "execution_failure_options",
        get_services_services_dependencies_col_size(
            services_services_dependencies_execution_failure_options)),
    mapping::entry(&service_dependency::host_id,
                   "host_id",
                   mapping::entry::invalid_on_zero),
    mapping::entry(&service_dependency::inherits_parent, "inherits_parent"),
    mapping::entry(
        &service_dependency::notification_failure_options,
        "notification_failure_options",
        get_services_services_dependencies_col_size(
            services_services_dependencies_notification_failure_options)),
    mapping::entry(&service_dependency::service_id,
                   "service_id",
                   mapping::entry::invalid_on_zero),
    mapping::entry()};

// Operations.
static io::data* new_service_dependency() {
  return new service_dependency;
}
io::event_info::event_operations const service_dependency::operations = {
    &new_service_dependency};


text:
Version: 0.0.1

**pg_kafka** is a PostgreSQL extension to produce messages to Apache Kafka. When combined with PostgreSQL it
creates a convenient way to get operations and row data without the limits of using LISTEN/NOTIFY.

**pg_kafka** is released under the MIT license (See LICENSE file).

Shout out to the [pg_amqp extension](https://github.com/omniti-labs/pg_amqp) authors. I used their project as
a guide to teach myself how to write a PostgreSQL extension.

### Version Compatability
This code is built with the following assumptions.  You may get mixed results if you deviate from these versions.

* [PostgreSQL](http://www.postgresql.org) 9.2+
* [Kafka](http://kafka.apache.org) 0.8.1+
* [librdkafka](https://github.com/edenhill/librdkafka) 0.8.x

### Requirements
* PostgreSQL
* librdkafka
* libsnappy
* zlib

### Building

To build you will need to install PostgreSQL (for pg_config) and PostgreSQL server development packages. On Debian
based distributions you can usually do something like this:

    apt-get install -y postgresql postgresql-server-dev-9.2

You will also need to make sure the librdkafka library and it's header files have been installed. See their Github
page for further details.

If you have all of the prerequisites installed you should be able to just:

    make && make install

Once the extension has been installed you just need to enable it in postgresql.conf:

    shared_preload_libraries = 'pg_kafka.so'

And restart PostgreSQL.

### Usage
    -- run once
    create extension kafka;
    -- insert broker information
    insert into kafka.broker values ('localhost', 9092);
    -- produce a message
    select kafka.produce('test_topic', 'my message');

For something a bit more useful, consider setting this up on a trigger and producing a message for every INSERT, UPDATE,
and DELETE that happens on a table.

If the kafka schema wasn't auto-created by installing the extension take a look at sql/kafka.sql.

### Support

File bug reports, feature requests and questions using
[GitHub Issues](https://github.com/xstevens/pg_kafka/issues)

### Notes

Before implementing this project I had looked into LISTEN/NOTIFY operations in PostgreSQL. NOTIFY is unfortunately limited
to 8000 bytes for the total payload size. I also found several mentions in the PostgreSQL mailing lists that NOTIFY was
never intended to send row data; rather it was intended to get change notifications on keys to clean up external caching, etc.

So my next approach was trying to read PostgreSQL WAL data by creating a process that acted as a replication
client. This approach would have a number of advantages compared to being an extension in database (namely you wouldn't
potentially affect any transactions and you can run outside of the database). I successfully started receiving WAL data,
but I could not find any material on how to actually decode that data. Fortunately as of Postgres 9.4 they have added Logical Decoding. I have started working on a logical decoding output plugin called [decoderbufs](https://github.com/xstevens/decoderbufs).


text:
using Cuckoo.TestAssembly.Cuckoos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cuckoo.TestAssembly
{
    public class GenericClass<A, B> : MarshalByRefObject
    {

        [BareCuckoo]
        public int MethodInGenericClass(int i) {
            A a = default(A);
            return 12345;
        }

        [BareCuckoo]
        [DeductingCuckoo(100)]
        public int MethodWithGenericArgsInGenericClass<C, D>(C c, D d) {
            var cc = c;
            var dd = d;
            return 987;
        }

    }

}