text:
#import "RNCConnectionState.h"
#if !TARGET_OS_TV
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#endif

#if TARGET_OS_TV || TARGET_OS_OSX
#include <ifaddrs.h>
#endif

@implementation RNCConnectionState

// Creates a new "blank" state
- (instancetype)init
{
    self = [super init];
    if (self) {
        _type = RNCConnectionTypeUnknown;
        _cellularGeneration = nil;
        _expensive = false;
    }
    return self;
}

// Creates the state from the given reachability references
- (instancetype)initWithReachabilityFlags:(SCNetworkReachabilityFlags)flags
{
    self = [self init];
    if (self) {
        _type = RNCConnectionTypeUnknown;
        _cellularGeneration = nil;
        _expensive = false;

        if ((flags & kSCNetworkReachabilityFlagsReachable) == 0 ||
            (flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0) {
            _type = RNCConnectionTypeNone;
        }
#if !TARGET_OS_TV && !TARGET_OS_OSX
        else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) {
            _type = RNCConnectionTypeCellular;
            _expensive = true;

            CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
            if (netinfo) {
                if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS] ||
                    [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge] ||
                    [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                    _cellularGeneration = RNCCellularGeneration2g;
                } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB] ||
                           [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                    _cellularGeneration = RNCCellularGeneration3g;
                } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
                    _cellularGeneration = RNCCellularGeneration4g;
                } else if (@available(iOS 14.1, *)) {
                    if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyNRNSA] ||
                        [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyNR]) {
                        _cellularGeneration = RNCCellularGeneration5g;
                    }
                }
            }
        }
#endif
        else {
            _type = RNCConnectionTypeWifi;
#if TARGET_OS_TV || TARGET_OS_OSX
            struct ifaddrs *interfaces = NULL;
            struct ifaddrs *temp_addr = NULL;
            int success = 0;
            // retrieve the current interfaces - returns 0 on success
            success = getifaddrs(&interfaces);
            if (success == 0) {
                // Loop through linked list of interfaces
                temp_addr = interfaces;
                while (temp_addr != NULL) {
                    if (temp_addr->ifa_addr->sa_family == AF_INET) {
                        // Check if interface is en0 which is the ethernet connection on the Apple TV
                        NSString* ifname = [NSString stringWithUTF8String:temp_addr->ifa_name];
                        if ([ifname isEqualToString:@"en0"]) {
                            _type = RNCConnectionTypeEthernet;
                        }
                    }
                    temp_addr = temp_addr->ifa_next;
                }
            }
            // Free memory
            freeifaddrs(interfaces);
#endif
        }
    }
    return self;
}

// Checks if two states are equal
- (BOOL)isEqualToConnectionState:(RNCConnectionState *)otherState
{
    return [self.type isEqualToString:otherState.type]
            && [self.cellularGeneration isEqualToString:otherState.cellularGeneration]
            && self.expensive == otherState.expensive;
}

- (BOOL)connected
{
    return ![self.type isEqualToString:RNCConnectionTypeNone] && ![self.type isEqualToString:RNCConnectionTypeUnknown];
}

@end


text:
(function() {

    if( typeof Showdown === 'undefined' ) {
        throw 'The reveal.js Markdown plugin requires Showdown to be loaded';
    }

    var sections = document.querySelectorAll( '[data-markdown]' );

    for( var i = 0, len = sections.length; i < len; i++ ) {
        var section = sections[i];
        var notes = section.querySelector( 'aside.notes' );

        var template = section.querySelector( 'script' );

        // strip leading whitespace so it isn't evaluated as code
        var text = ( template || section ).innerHTML;

        var leadingWs = text.match(/^\n?(\s*)/)[1].length,
            leadingTabs = text.match(/^\n?(\t*)/)[1].length;

        if( leadingTabs > 0 ) {
            text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
        }
        else if( leadingWs > 1 ) {
            text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' );
        }

        // TODO: HACKED
        // remove double-encoded HTML entities
        text = text.replace(/_AMP_/g, "&");
        text = text.replace(/_LT_/g, "<");
        text = text.replace(/_GT_/g, ">");
        text = text.replace(/_QUOT_/g, "\"");

        section.innerHTML = (new Showdown.converter()).makeHtml(text);

        if( notes ) {
            section.appendChild( notes );
        }
    }
})();

redpajama_set_name: RedPajamaGithub


text:
// ***********************************************************************
// Copyright (c) 2015 Charlie Poole
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************

using System.Drawing;
using System.Windows.Forms;

namespace NUnit.UiKit.Elements
{
    /// <summary>
    /// IControlElement is implemented by elements that wrap controls.
    /// </summary>
    public interface IControlElement : IViewElement
    {
        Point Location { get; set; }
        Size Size { get; set; }
        Size ClientSize { get; set; }
    }

    public interface IControlElement<T> : IControlElement where T : Control
    {
        T Control { get; }
    }
}


text:
namespace Org.Apache.REEF.Common.Events
{
    public interface IContextStart
    {
        string Id { get; set; }
    }
}


text:
public class A{
 public void method(<caret>){
 }
}


text:
DECLARE

   CURSOR role_mbr_data IS SELECT RMT.MBR_ID, RMT.MBR_TYP_CD, RMAD.ATTR_VAL, RMAD.KIM_TYP_ID, RMAD.KIM_ATTR_DEFN_ID FROM KRIM_ROLE_MBR_T RMT
     JOIN KRIM_ROLE_MBR_ATTR_DATA_T RMAD ON RMT.ROLE_MBR_ID = RMAD.ROLE_MBR_ID
         WHERE RMT.ROLE_ID = (SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL' AND ROLE_NM = 'Protocol Aggregator')
            AND RMAD.KIM_TYP_ID = (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Unit')
            AND RMAD.KIM_ATTR_DEFN_ID = (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM='unitNumber')
    minus
    SELECT RMT.MBR_ID, RMT.MBR_TYP_CD, RMAD.ATTR_VAL, RMAD.KIM_TYP_ID, RMAD.KIM_ATTR_DEFN_ID FROM KRIM_ROLE_MBR_T RMT
     JOIN KRIM_ROLE_MBR_ATTR_DATA_T RMAD ON RMT.ROLE_MBR_ID = RMAD.ROLE_MBR_ID
         WHERE RMT.ROLE_ID = (SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL-DOC' AND ROLE_NM = 'Protocol Aggregator')
            AND RMAD.KIM_TYP_ID = (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Unit')
            AND RMAD.KIM_ATTR_DEFN_ID = (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM='unitNumber');

BEGIN
   FOR record IN role_mbr_data
     LOOP
      INSERT INTO KRIM_ROLE_MBR_T (ROLE_MBR_ID,ROLE_ID,MBR_ID,MBR_TYP_CD,LAST_UPDT_DT,OBJ_ID,VER_NBR)
        VALUES (CONCAT('KC',KRIM_ROLE_MBR_ID_S.NEXTVAL),(SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL-DOC' AND ROLE_NM = 'Protocol Aggregator'),record.MBR_ID, record.MBR_TYP_CD,SYSDATE,SYS_GUID(),1 );

      INSERT INTO KRIM_ROLE_MBR_ATTR_DATA_T (ATTR_DATA_ID,ROLE_MBR_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
        VALUES (CONCAT('KC',KRIM_ATTR_DATA_ID_S.NEXTVAL),CONCAT('KC',KRIM_ROLE_MBR_ID_S.CURRVAL),record.KIM_TYP_ID, record.KIM_ATTR_DEFN_ID, record.ATTR_VAL,SYS_GUID(),1);

   COMMIT;
  END LOOP;
END;
/

-- add all role memberships that are currently in KC-PROTOCOL:Protocol Aggregator namespace:role to the KC-PROTOCOL-DOC:Protocol Viewer
-- also need to limit this to truly unit qualified memberships and associate the RoleMembership to the unit in ROLE_MBR_ATTR_DATA_T
DECLARE

   CURSOR role_mbr_data IS SELECT RMT.MBR_ID, RMT.MBR_TYP_CD, RMAD.ATTR_VAL, RMAD.KIM_TYP_ID, RMAD.KIM_ATTR_DEFN_ID FROM KRIM_ROLE_MBR_T RMT
     JOIN KRIM_ROLE_MBR_ATTR_DATA_T RMAD ON RMT.ROLE_MBR_ID = RMAD.ROLE_MBR_ID
         WHERE RMT.ROLE_ID = (SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL' AND ROLE_NM = 'Protocol Viewer')
            AND RMAD.KIM_TYP_ID = (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Unit')
            AND RMAD.KIM_ATTR_DEFN_ID = (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM='unitNumber')
    minus
    SELECT RMT.MBR_ID, RMT.MBR_TYP_CD, RMAD.ATTR_VAL, RMAD.KIM_TYP_ID, RMAD.KIM_ATTR_DEFN_ID FROM KRIM_ROLE_MBR_T RMT
     JOIN KRIM_ROLE_MBR_ATTR_DATA_T RMAD ON RMT.ROLE_MBR_ID = RMAD.ROLE_MBR_ID
         WHERE RMT.ROLE_ID = (SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL-DOC' AND ROLE_NM = 'Protocol Viewer')
            AND RMAD.KIM_TYP_ID = (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Unit')
            AND RMAD.KIM_ATTR_DEFN_ID = (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM='unitNumber');

BEGIN
   FOR record IN role_mbr_data
     LOOP
      INSERT INTO KRIM_ROLE_MBR_T (ROLE_MBR_ID,ROLE_ID,MBR_ID,MBR_TYP_CD,LAST_UPDT_DT,OBJ_ID,VER_NBR)
        VALUES (CONCAT('KC',KRIM_ROLE_MBR_ID_S.NEXTVAL),(SELECT ROLE_ID FROM KRIM_ROLE_T WHERE NMSPC_CD = 'KC-PROTOCOL-DOC' AND ROLE_NM = 'Protocol Viewer'),record.MBR_ID, record.MBR_TYP_CD,SYSDATE,SYS_GUID(),1 );

      INSERT INTO KRIM_ROLE_MBR_ATTR_DATA_T (ATTR_DATA_ID,ROLE_MBR_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
        VALUES (CONCAT('KC',KRIM_ATTR_DATA_ID_S.NEXTVAL),CONCAT('KC',KRIM_ROLE_MBR_ID_S.CURRVAL),record.KIM_TYP_ID, record.KIM_ATTR_DEFN_ID, record.ATTR_VAL,SYS_GUID(),1);

   COMMIT;
  END LOOP;
END;
/


text:
#include "SAD.h"

_MTF_BEGIN_NAMESPACE

class MCSAD : public SAD{
public:
	MCSAD(const ParamType *ssd_params = nullptr);
};

_MTF_END_NAMESPACE

#endif


text:
/*global describe:false, it:false, beforeEach:false, afterEach:false*/

'use strict';

var kraken = require('kraken-js'),
    express = require('express'),
    path = require('path'),
    request = require('supertest');

describe('index', function () {

    var app, mock;

    beforeEach(function (done) {
        app = express();
        app.on('start', done);
        app.use(kraken({
            basedir: path.resolve(__dirname, '..')
        }));

        mock = app.listen(1337);

    });

    afterEach(function (done) {
        mock.close(done);
    });

    it('should say "hello"', function (done) {
        request(mock)
            .get('/')
            .expect(200)
            .expect('Content-Type', /html/)

                .expect('Hello World! Kraken.js on Google App Engine.')

            .end(function (err, res) {
                done(err);
            });
    });

});


text:
package pricing;

import org.junit.Test;
import org.junit.runner.RunWith;

import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;

import java.math.BigDecimal;
import java.util.Currency;

import static org.hamcrest.Matchers.containsString;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@RunWith(SpringRunner.class)
@WebMvcTest({App.class, PricingController.class, DataStore.class})
@AutoConfigureRestDocs(outputDir = "target/snippets")
public class WebLayerTest {

    @Autowired
    private MockMvc mockMvc;

    @MockBean
    DataStore repo;

    /**
     * Tests the basic PUT functionality of the API. The MongoDB connection is actually using a test stub MockBean
     * to avoid the need for a db while testing in a CI environment.
     *
     * Test also produces simple API use example for use in documentation.
     * @throws Exception
     */
    @Test
    public void putSomeItems() throws Exception {

        String uri = "/products/13860428";
        String json = "{\"value\":12.99,\"currency_code\":\"USD\"}";

        this.mockMvc.perform(put(uri).contentType(MediaType.APPLICATION_JSON).content(json))
                .andDo(print()).andExpect(status().isOk())
                .andExpect(content().string(containsString("success")))
                .andDo(document("PUT"));

        String uri2 = "/products/13860429";
        String json2 = "{\"value\":22.99,\"currency_code\":\"USD\"}";

        this.mockMvc.perform(put(uri2).contentType(MediaType.APPLICATION_JSON).content(json2))
                .andDo(print()).andExpect(status().isOk())
                .andExpect(content().string(containsString("success")))
                .andDo(document("PUT2"));

    }

    /**
     * Tests the basic GET functionality of the API. The redsky API is actually called. The MongoDB connection
     * is actually using a test stub MockBean to avoid the need for a db while testing in a CI environment.
     *
     * Test also produces simple API example for use in documentation.
     * @throws Exception
     */
    @Test
    public void getSomeItems() throws Exception {
        Current_Price cp = new Current_Price();
        cp.setValue(BigDecimal.valueOf(12.99));
        Current_Price cp2 = new Current_Price();
        cp2.setValue(BigDecimal.valueOf(22.99));

        Currency curr = Currency.getInstance("USD");
        cp.setCurrency_code(curr);
        Price p = new Price(13860428L, cp);
        Price p2 = new Price(13860429L, cp2);
        Mockito.when(repo.findById(13860428L)).thenReturn(p);
        Mockito.when(repo.findById(13860429L)).thenReturn(p2);
        this.mockMvc.perform(get("/products/13860428")).andDo(print()).andExpect(status().isOk())
                .andExpect(content().string(containsString("The Big Lebowski")))
                .andDo(document("GET"));
        this.mockMvc.perform(get("/products/13860429")).andDo(print()).andExpect(status().isOk())
                .andExpect(content().string(containsString("SpongeBob SquarePants")))
                .andDo(document("GET2"));
    }
}


text:
a.btn-new-entry { margin: 20px 0px }

div.home-well { min-height: 300px }
div.home-well-small { min-height: 130px }
span.progress-percent { font-size: 36px; font-weight: bolder; }

ul.achievement-list { margin-bottom: 30px; }
ul.achievement-list > li { padding: 5px; }
ul.achievement-list > li.achieved { background-color: #DFF0D8; }


text:
<?xml version="1.0" ?>
<sweep runs="1">
	<parameter name="distance_factor" type="constant"
		constant_type="double" value="5"></parameter>
	<parameter name="print_params" type="constant" constant_type="boolean"
		value="false"></parameter>
	<parameter name="expl_strategy" type="constant"
		constant_type="java.lang.String" value="CC"></parameter>
	<parameter name="decay_rate" type="constant" constant_type="double"
		value="0.1"></parameter>
	<parameter name="comm_frequency" type="constant"
		constant_type="int" value="1"></parameter>
	<parameter name="perception_scope" type="constant"
		constant_type="double" value="1"></parameter>
	<parameter name="foraging_strategy" type="constant"
		constant_type="java.lang.String" value="NC"></parameter>
	<parameter name="k" type="constant" constant_type="double"
		value="6"></parameter>
	<parameter name="agent_count" type="constant" constant_type="int"
		value="16"></parameter>
	<parameter name="resource_count" type="constant"
		constant_type="int" value="0"></parameter>
	<parameter name="consecutive_move" type="constant"
		constant_type="int" value="0"></parameter>
	<parameter name="communication_scope" type="constant"
		constant_type="double" value="15"></parameter>
	<parameter name="resource_nest_count" type="constant"
		constant_type="int" value="6"></parameter>
	<parameter name="use_ga" type="constant" constant_type="boolean"
		value="true"></parameter>
	<parameter name="space_dimensions" type="constant"
		constant_type="java.lang.String" value="100:100"></parameter>
	<parameter name="failure_probability" type="constant"
		constant_type="double" value="0.0"></parameter>
	<parameter name="prob_init" type="constant" constant_type="double"
		value="0.01"></parameter>
	<parameter name="segment_count" type="constant"
		constant_type="int" value="8"></parameter>
</sweep>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template type="basic" name="T2map_slice_mouse_9_4T_01" author="Agilent" investigator=""
  ExpSelNoShow="true" application="imaging" rfcoil="72mm_2ch" anatomy="head" species="mouse" time_created="20130603T111818"
  parfile="T2map_slice_mouse_9_4T_01" apptype="im2D" label="" scans="T2map_slice_mouse_9_4T_01" seqfil="mems">
  <protocol title="T2map_slice_mouse_9_4T_01" type="protocol">
    <action   type="LIB" status="Ready" title="T2map_slice_mouse_9_4T" exp="T2map_slice_mouse_9_4T" lock="off" time="10m:40s" data="" macro="sqexp('studycard','Head_Parametric_Maps_mouse_9_4T','T2map_slice_mouse_9_4T_01')" />
  </protocol>
</template>