text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent" android:layout_height="fill_parent">
	<LinearLayout android:orientation="vertical"
		android:padding="10dip" android:layout_width="fill_parent"
		android:layout_height="wrap_content">
		<TextView android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:layout_marginTop="10dip"
			android:text="@string/prefs_user_name" />
		<EditText android:id="@+id/prefs_user_name" android:text="marcus.schiesser"
			android:layout_width="fill_parent" android:layout_height="wrap_content" />

		<TextView android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:layout_marginTop="10dip"
			android:text="@string/prefs_pin" />
		<EditText android:id="@+id/prefs_pin" android:layout_width="fill_parent" android:inputType="textPassword"
			android:text="abc123"
			android:layout_height="wrap_content" />

		<TextView android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:layout_marginTop="10dip"
			android:text="@string/prefs_bahncard" />
		<Spinner android:id="@+id/prefs_bahncard"
			android:layout_width="fill_parent" android:layout_height="wrap_content"
			android:prompt="@string/prefs_bahncard_prompt" />

		<TextView android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:layout_marginTop="10dip"
			android:text="@string/prefs_class" />
		<RadioGroup android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:orientation="horizontal">
			<RadioButton android:id="@+id/prefs_firstclass"
				android:layout_width="wrap_content" android:layout_height="wrap_content"
				android:text="@string/prefs_firstclass" />
			<RadioButton android:id="@+id/prefs_secondclass"
				android:layout_width="wrap_content" android:layout_height="wrap_content"
				android:text="@string/prefs_secondclass" />
		</RadioGroup>

		<TextView android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:layout_marginTop="10dip"
			android:text="@string/prefs_seat" />
		<Spinner android:id="@+id/prefs_seat" android:layout_width="fill_parent"
			android:layout_height="wrap_content" android:prompt="@string/prefs_seat_prompt" />

		<Button android:id="@+id/prefs_ok" android:text="@string/prefs_ok" android:layout_gravity="center_horizontal"
			android:layout_marginTop="10dip" android:layout_width="wrap_content"
			android:layout_height="wrap_content" />

	</LinearLayout>
</ScrollView>


text:
import pykazoo.cdrs
import pykazoo.restrequest
from unittest import TestCase
from unittest.mock import create_autospec

mock_rest_request = create_autospec(pykazoo.restrequest.RestRequest)

class TestCDRs(TestCase):
    def setUp(self):
        self.mock_rest_request = mock_rest_request

        self.cdrs = pykazoo.cdrs.CDRs(self.mock_rest_request)
        self.params = {'test': 'params'}
        self.data = {'test': 'data'}

    def test_get_cdrs_request_call(self):
        self.cdrs.get_cdrs(self.params)
        self.mock_rest_request.get.assert_called_with('cdrs', self.params)

    def test_get_cdrs_returns_dict(self):
        self.mock_rest_request.get.return_value = self.data
        return_data = self.cdrs.get_cdrs(self.params)

        assert return_data is self.data

redpajama_set_name: RedPajamaGithub


text:
CREATE TABLE `phpvms_rules` (
  `id` int(11) NOT NULL auto_increment,
  `rule` varchar(800) NOT NULL,
  `category` int(10) NOT NULL,
  `status` int(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1

CREATE TABLE `phpvms_rules_categories` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(100) NOT NULL,
  `status` int(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


text:
/*
    NodeMCU Foosball monitor
*/

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "Adafruit_HTU21DF.h"

const char* ssid = "geodan";
const char* password = "";
const char* mqtt_server = "gost.geodan.nl";

const char* door_topic = "GOST/Datastreams(39)/Observations";
const char* pir_topic = "GOST/Datastreams(40)/Observations";
const char* temperature_topic = "GOST/Datastreams(41)/Observations";
const char* hum_topic = "GOST/Datastreams(42)/Observations";

unsigned long time_of_last_loop = millis();
char data[80];

WiFiClient espClient;
PubSubClient client(espClient);

Adafruit_HTU21DF htu = Adafruit_HTU21DF();

const int DOOR_PIN = D2;
const int PIR_PIN = D3;

bool pir_state = false;
bool door_state = false;

void setup_wifi() {

    Serial.print("Connecting to wifi network: ");
    Serial.println(ssid);
    Serial.println(password);
    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) {
        delay(100);
        Serial.print(".");
    }

    Serial.println("Connected: ");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
}

void reconnect() {
  // Loop until we're reconnected
    while (!client.connected()) {
        Serial.println("Attempting MQTT connection...");

        // Attempt to connect
        if (client.connect("ESP8266Client-foosball")) {
            Serial.println("Connected to MQTT broker");
        } else {
            Serial.print("failed, rc=");
            Serial.print(client.state());
            Serial.println(" try again in 5 seconds");
            // Wait 5 seconds before retrying
            for(int i = 0; i<5000; i++){
                delay(1);
            }
        }
    }
}

void setup() {
    Serial.begin(9600);
    setup_wifi();
    Wire.begin(D3, D5);

    pinMode(PIR_PIN, INPUT);
    pinMode(DOOR_PIN, INPUT_PULLUP);

    client.setServer(mqtt_server, 1883);
}

void loop() {

    if (!client.connected()) {
       reconnect();
    }
    client.loop();

    if ((millis() - time_of_last_loop) > 60000) {
        Serial.println("Logging :)");
        Serial.println(String(htu.readTemperature()));
        String payload = "{\"result\" : \" " + String(htu.readTemperature()) + "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(temperature_topic, data);

        payload = "{\"result\" : \" " + String(htu.readHumidity()) + "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(hum_topic, data);

        time_of_last_loop = millis();
    }

    if (millis() < time_of_last_loop) {
        time_of_last_loop = millis();
    }

    bool new_pir_state = digitalRead(PIR_PIN);
    if (new_pir_state != pir_state && pir_state) {
        pir_state = new_pir_state;
        Serial.println("Movement Done");

        String payload = "{\"result\" : \" " + String(!pir_state)+ "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(pir_topic, data);
    }
    else if (new_pir_state != pir_state && !pir_state) {
        pir_state = new_pir_state;
        Serial.println("Movement Began!");

        String payload = "{\"result\" : \" " + String(!pir_state)+ "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(pir_topic, data);
    }

    bool new_door_state = digitalRead(DOOR_PIN);
    if (new_door_state != door_state && door_state) {
        door_state = new_door_state;
        Serial.println("Door closed");

        String payload = "{\"result\" : \" " + String(!door_state)+ "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(door_topic, data);
    }
    else if (new_door_state != door_state && !door_state) {
        door_state = new_door_state;
        Serial.println("Door opened");

        String payload = "{\"result\" : \" " + String(!door_state)+ "\"}";
        payload.toCharArray(data, (payload.length() + 1));
        client.publish(door_topic, data);
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.promagent</groupId>
    <artifactId>promagent-framework</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>pom</packaging>
    <name>promagent framework</name>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <junit5.version>5.3.1</junit5.version>
    </properties>

    <profiles>

        <profile>
            <id>promagent-loader</id>
            <modules>
                <module>promagent-agent</module>
                <module>promagent-api</module>
                <module>promagent-internal</module>
                <module>promagent-exporter</module>
                <module>promagent-loader</module> <!-- this is only in the promagent-loader profile -->
                <module>promagent-maven-plugin</module>
            </modules>
        </profile>

        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>promagent-agent</module>
                <module>promagent-api</module>
                <module>promagent-internal</module>
                <module>promagent-exporter</module>
                <module>promagent-maven-plugin</module>
            </modules>
        </profile>

    </profiles>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient_common</artifactId>
                <version>0.5.0</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit5.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <!-- Native support for the JUnit platform was introduced with  2.22.0, so make sure we use this or later as the surefire plugin version -->
                    <version>2.22.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>


text:
#import "ZXEAN8BlackBox1TestCase.h"

@implementation ZXEAN8BlackBox1TestCase

- (id)initWithInvocation:(NSInvocation *)invocation {
  self = [super initWithInvocation:invocation
                testBasePathSuffix:@"Resources/blackbox/ean8-1"
                     barcodeReader:[[ZXMultiFormatReader alloc] init]
                    expectedFormat:kBarcodeFormatEan8];

  if (self) {
    [self addTest:8 tryHarderCount:8 rotation:0.0f];
    [self addTest:8 tryHarderCount:8 rotation:180.0f];
  }

  return self;
}

- (void)testBlackBox {
  [super runTests];
}

@end


text:
using System.Text;
using NDatabase.Api;

namespace NDatabase.Indexing
{
    ///
    ///   A composed key : an object that contains various values used for indexing query result
    ///
This is an implementation that allows compare keys to contain more than one single value to be compared

    ///
    internal sealed class ComposedCompareKey : IOdbComparable
    {
        private readonly IOdbComparable[] _keys;

        public ComposedCompareKey(IOdbComparable[] keys)
        {
            _keys = keys;
        }

        public int CompareTo(object o)
        {
            if (o == null || o.GetType() != typeof (ComposedCompareKey))
                return -1;
            var ckey = (ComposedCompareKey) o;

            for (var i = 0; i < _keys.Length; i++)
            {
                var key = _keys[i];

                if (key == null && ckey._keys[i] == null)
                    continue;

                if (key == null)
                    return -1;

                var result = key.CompareTo(ckey._keys[i]);
                if (result != 0)
                    return result;
            }

            return 0;
        }

        public override string ToString()
        {
            if (_keys == null)
                return "no keys defined";

            var buffer = new StringBuilder();
            for (var i = 0; i < _keys.Length; i++)
            {
                if (i != 0)
                    buffer.Append("|");

                buffer.Append(_keys[i]);
            }

            return buffer.ToString();
        }
    }
}


text:
import xml.etree.ElementTree as ET
import base64
from pprint import pprint as pp

"""

Very special thanks to Dorian Alcacer-Labrador (http://www.alcacer.de)
for providing a script that acted as the backbone for writing this one below.

"""

def b64(q):
    return base64.b64decode(q)

def idref(item, single = False):
    idrefs = item.get('idrefs')
    if single == False:
        if idrefs is not None:
            return str(idrefs).strip().split(" ")
        else:
            return []
    else:
        if idrefs is not None:
            return str(item.get('idrefs')).strip().split(" ")[0]
        else:
            return ""

class snippets():

    def __init__(self, file):
        self._file = file
        self._tagobjects = dict()
        self._assetobjects = dict()
        self._snippetobjects = dict()
        self._listobjects = dict()
        self._folderobjects = dict()

    def parse(self):
        tree = ET.parse(self._file)
        root = tree.getroot()
        for child in root._children:
            childtype = child.attrib.get('type')
            if childtype == "ASSET":
                 self._parseAsset(child)
            elif childtype == "SNIPPET":
                self._parseSnippet(child)
            elif childtype == "TAG":
                self._parseTag(child)
            elif childtype == "LIST":
                self._parseList(child)
            elif childtype == "FOLDER":
                self._parseFolder(child)
            else:
                pass

    def _parseAsset(self, asset):
        """
        parses and decodes an asset-tag
        0.1 id, content
        <object type="ASSET" id="z116">
            <attribute name="sort" type="int32">-1</attribute>
            <attribute name="path" type="string">Asset.java</attribute>
            <attribute name="content" type="binary">LyoqCiAgICAgKiBXcml0ZXMgYW4gYnl0ZSBhcnJheSBpbnRvIGEgZmlsZS4KICAgICAqIEBwYXJh
            bSBkYXRhIERhdGEgdGhhdCBzaG91bGQgYmUgd3JpdHRlbiBpbnRvIGEgZmlsZS4KICAgICAqIEBwYXJhbSBmaWxlbmFtZSBUaGUgZmlsZSwgdGhhdCBzaG91bGQgYmUgdXNlZC4KICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24KICAgICAqLwogICAgcHVibGljIHN0YXRpYyB2b2lkIHdyaXRlQnl0ZTJGaWxlKGJ5dGVbXSBkYXRhLCBTdHJpbmcgZmlsZW5hbWUpIHRocm93cyBJT0V4Y2VwdGlvbiB7CiAgICAgICAgT3V0cHV0U3RyZWFtIG91dCA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKGZpbGVuYW1lKTsKICAgICAgICBvdXQud3JpdGUoZGF0YSk7CiAgICAgICAgb3V0LmNsb3NlKCk7CiAgICB9
            </attribute>
            <relationship name="snippet" type="1/1" destination="SNIPPET" idrefs="z113"></relationship>
        </object>
        """
        asset_id = asset.attrib.get('id')
        self._assetobjects[asset_id] = {}
        for child in asset._children:
            if child.tag == "attribute":
                # attribute tags
                attributeType = child.attrib.get("name")
                if attributeType == 'content':
                    encoded = child.text
                    if encoded is not None:
                        self._assetobjects[asset_id]["content"] = b64(encoded)
            elif child.tag == 'relationship':
                attributeType = child.attrib.get("name")
                if attributeType == "snippet":
                    self._assetobjects[asset_id]["snippet_id"] = child.attrib.get("idrefs")

    def _parseSnippet(self, snippet):
        """
        parses a snippet-tag
        0.1 id, assetes, tags
        <object type="SNIPPET" id="z108">
            <attribute name="name" type="string">.gitignore</attribute>
            <attribute name="modified" type="date">336046917.00164198875427246094</attribute>
            <attribute name="locked" type="bool">0</attribute>
            <relationship name="list" type="1/1" destination="LIST" idrefs="z114"></relationship>
            <relationship name="assets" type="0/0" destination="ASSET" idrefs="z107"></relationship>
            <relationship name="tags" type="0/0" destination="TAG"></relationship>
        </object>
        """
        snippid = snippet.attrib.get('id')
        self._snippetobjects[snippid] = {}
        for child in snippet._children:
            if child.tag == "attribute":
                # attribute tags
                attributeType = child.attrib.get("name")
                if attributeType == 'name':
                    self._snippetobjects[snippid]["title"] = child.text
            elif child.tag == 'relationship':
                # relationship-tag
                attributeType = child.attrib.get("name")
                if attributeType == 'list':
                    # list relationship
                    self._snippetobjects[snippid]["lists"] = idref(child)
                elif attributeType == 'assets':
                    # assets relationship
                    self._snippetobjects[snippid]["assets"] = idref(child, True)
                elif attributeType == 'tags':
                    # tags relationships
                    self._snippetobjects[snippid]["tags"] = idref(child)

    def _parseTag(self, tag):
        """
        parses a tag-tag :)
        0.1 id and content
        <object type="TAG" id="z106">
            <attribute name="name" type="string">gitignore</attribute>
            <relationship name="snippets" type="0/0" destination="SNIPPET"></relationship>
        </object>
        """
        tagid = tag.attrib.get('id')
        self._tagobjects[tagid] = {}
        for child in tag._children:
            if child.tag == "attribute":
                # attribute tags
                self._tagobjects[tagid]["name"] = child.text
            elif child.tag == 'relationship':
                # relationship tags
                self._tagobjects[tagid]["snippets"] = idref(child)

    def _parseList(self, list):
        """
        <object type="LIST" id="z118">
            <attribute name="sort" type="int16">0</attribute>
            <attribute name="name" type="string">s</attribute>
            <attribute name="expanded" type="bool">0</attribute>
            <relationship name="parent" type="1/1" destination="FOLDER" idrefs="z107"></relationship>
            <relationship name="children" type="0/0" destination="FOLDER"></relationship>
            <relationship name="snippets" type="0/0" destination="SNIPPET" idrefs="z120"></relationship>
        </object>
        """
        listid = list.attrib.get('id')
        self._listobjects[listid] = {}
        self._listobjects[listid]["id"] = listid
        self._listobjects[listid]["type"] = "list"
        for child in list._children:
            if child.tag == "attribute":
                attributeType = child.attrib.get("name")
                if attributeType == 'name':
                    self._listobjects[listid]["name"] = child.text
            elif child.tag == 'relationship':
                # relationship tags
                attributeType = child.attrib.get("name")
                if attributeType == "parent":
                    self._listobjects[listid]["parent"] = idref(child)
                elif attributeType == "children":
                    self._listobjects[listid]["children"] = idref(child)

    def _parseFolder(self, folder):
        """
        object type="FOLDER" id="z229">
            <attribute name="sort" type="int16">7</attribute>
            <attribute name="name" type="string">java</attribute>
            <attribute name="expanded" type="bool">1</attribute>
            <relationship name="parent" type="1/1" destination="FOLDER"></relationship>
            <relationship name="children" type="0/0" destination="FOLDER" idrefs="z223 z222 z333 z228"></relationship>
        </object>
        """
        folderid = folder.attrib.get('id')
        self._folderobjects[folderid] = {}
        self._folderobjects[folderid]["id"] = folderid
        self._folderobjects[folderid]["type"] = "folder"
        for child in folder._children:
            if child.tag == "attribute":
                # attribute tags
                attributeType = child.attrib.get("name")
                if attributeType == 'name':
                    self._folderobjects[folderid]["name"] = child.text
            elif child.tag == 'relationship':
                attributeType = child.attrib.get("name")
                if attributeType == "parent":
                    self._folderobjects[folderid]["parent"] = idref(child)
                elif attributeType == "children":
                    self._folderobjects[folderid]["children"] = idref(child)

    def list_snippets(self):
        for k,snippet in self._snippetobjects.items():
            # Fetch asset
            try:
                snippet["content"] = self._assetobjects[snippet["assets"]]["content"]
                del snippet["assets"]
            except:
                snippet["content"] = ""
            # Fetch tag
            snippet["tags"] = [self._tagobjects[x]["name"] for x in snippet["tags"]]
            # Fetch lists
            snippet["lists"] = [self._listobjects[x]["name"] for x in snippet["lists"]]
            # Fetch folders
            #snippet["folders"] = [self._folderobjects[x]["name"] for x in snippet["lists"]]

        return [v for k,v in self._snippetobjects.items()]

    def list_tags(self):
        """ returns tag and associated snippets """
        for k,tag in self._tagobjects.items():
            tag["count"] = len(tag["snippets"])
        return [v for k,v in self._tagobjects.items()]

    def unique_folder_name(self, folder_name):
        # Determine if folder name is unique
        return len([x for x in self._folderobjects.values() if x["name"] == folder_name]) == 1

    def unique_list_name(self, list_name):
        # Determine if list name is unique
        return len([x for x in self._listobjects.values() if x["name"] == list_name]) == 1

    def get_folder_items(self, folder, use_id = False):
        if use_id == False:
            try:
                folder_id = [x for x in self._folderobjects.values() if x["name"] == folder][0]["id"]
            except:
                return []
        folder_items = [x for x in self._folderobjects.values() if folder_id in x["parent"]]
        # Add counts
        list_items = [x for x in self._listobjects.values() if folder_id in x["parent"]]
        return folder_items + list_items

    def get_list_items(self, list_id, use_id = False):
        if use_id == False:
            try:
                list_id = [x["id"] for x in self._listobjects.values() if list_id == x["name"]][0]
            except:
                return []
        list_items = [x for x in self._snippetobjects.values() if list_id in x["lists"]]
        for snippet in list_items:
            try:
                snippet["content"] = self._assetobjects[snippet["assets"]]["content"]
                del snippet["assets"]
            except:
                snippet["content"] = ""
            # Fetch tag
            snippet["tags"] = [self._tagobjects[x]["name"] for x in snippet["tags"]]
            # Fetch lists
            snippet["lists"] = [self._listobjects[x]["name"] for x in snippet["lists"]]
        return list_items


text:
#ifndef MUGGLE_C_MEMORY_DETECT_H_
#define MUGGLE_C_MEMORY_DETECT_H_

#include "muggle/c/base/macro.h"

EXTERN_C_BEGIN

#if MUGGLE_DEBUG & MUGGLE_PLATFORM_WINDOWS

// detect memory leak
#if defined(_WIN32) && MUGGLE_DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif

struct muggle_debug_memory_state
{
	_CrtMemState start;
	_CrtMemState end;
};

MUGGLE_C_EXPORT
void muggle_debug_memory_leak_start(struct muggle_debug_memory_state *state);

MUGGLE_C_EXPORT
void muggle_debug_memory_leak_end(struct muggle_debug_memory_state *state);

#else

struct muggle_debug_memory_state
{
	void *v;
};

#define muggle_debug_memory_leak_start(state)
#define muggle_debug_memory_leak_end(state)

#endif

EXTERN_C_END

#endif


text:
namespace SequencerDemo
{
    partial class AboutDialog
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if(disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.okButton = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // okButton
            //
            this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.okButton.Location = new System.Drawing.Point(100, 67);
            this.okButton.Name = "okButton";
            this.okButton.Size = new System.Drawing.Size(75, 23);
            this.okButton.TabIndex = 0;
            this.okButton.Text = "OK";
            this.okButton.UseVisualStyleBackColor = true;
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(47, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(179, 39);
            this.label1.TabIndex = 1;
            this.label1.Text = "Sequencer Demo\r\nCreated by: Leslie Sanford\r\nContact: jabberdabber@hotmail.com";
            this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            //
            // AboutDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(278, 102);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.okButton);
            this.Name = "AboutDialog";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "About MIDI File Player Demo";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button okButton;
        private System.Windows.Forms.Label label1;
    }
}


text:
namespace llvm {

struct NewArchiveMember {
  std::unique_ptr<MemoryBuffer> Buf;
  StringRef MemberName;
  sys::TimePoint<std::chrono::seconds> ModTime;
  unsigned UID = 0, GID = 0, Perms = 0644;

  NewArchiveMember() = default;
  NewArchiveMember(MemoryBufferRef BufRef);

  static Expected<NewArchiveMember>
  getOldMember(const object::Archive::Child &OldMember, bool Deterministic);

  static Expected<NewArchiveMember> getFile(StringRef FileName,
                                            bool Deterministic);
};

Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To);

Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
                   bool WriteSymtab, object::Archive::Kind Kind,
                   bool Deterministic, bool Thin,
                   std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr);
}

#endif


text:
package co.colector.model.request;

import java.util.ArrayList;
import java.util.List;

import co.colector.ColectorApplication;
import co.colector.R;
import co.colector.model.IdInputValue;
import co.colector.model.IdValue;
import co.colector.model.Survey;
import co.colector.model.AnswerValue;
import co.colector.session.AppSession;
import co.colector.utils.NetworkUtils;

/**
 * Created by dherrera on 11/10/15.
 */
public class SendSurveyRequest {

    private String colector_id;
    private String form_id;
    private String longitud;
    private String latitud;
    private String horaini;
    private String horafin;
    private List<IdInputValue> responses;

    public SendSurveyRequest(Survey survey) {
        this.colector_id = String.valueOf(AppSession.getInstance().getUser().getColector_id());
        this.form_id = String.valueOf(survey.getForm_id());
        this.longitud = survey.getInstanceLongitude();
        this.latitud = survey.getInstanceLatitude();
        this.horaini = survey.getInstanceHoraIni();
        this.horafin = survey.getInstanceHoraFin();
        this.setResponsesData(survey.getInstanceAnswers());
    }

    public List<IdInputValue> getResponses() {
        return responses;
    }

    public void setResponses(List<IdInputValue> responses) {
        this.responses = responses;
    }

    private void setResponsesData(List<IdValue> responsesData) {
        responses = new ArrayList<>();
        for (IdValue item : responsesData) {
            switch (item.getmType()) {
                case 6:
                case 14:
                case 16:
                    for (AnswerValue answerValue : item.getValue())
                    if (!answerValue.getValue().equals("")) {
                        int lastIndex = answerValue.getValue().length();
                        int slashIndex = answerValue.getValue().lastIndexOf("/");
                        responses.add(new IdInputValue(String.valueOf(item.getId()), ColectorApplication.getInstance().getString(R.string.image_name_format,
                                NetworkUtils.getAndroidID(ColectorApplication.getInstance()),
                                answerValue.getValue().substring((slashIndex + 1), lastIndex))));
                    }
                    break;
                default:
                    for (AnswerValue answerValue : item.getValue())
                        responses.add(new IdInputValue(String.valueOf(item.getId()), answerValue.getValue()));
            }

        }
    }
}


text:
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.Windows;

namespace Microsoft.Phone.Controls
{
    /// <summary>
    /// Transition factory for a particular transition family.
    /// </summary>
    /// <QualityBand>Preview</QualityBand>
    public abstract class TransitionElement : DependencyObject
    {
        /// <summary>
        /// Creates a new
        /// <see cref="T:Microsoft.Phone.Controls.ITransition"/>
        /// for a
        /// <see cref="T:System.Windows.UIElement"/>.
        /// Existing
        /// <see cref="F:System.Windows.UIElement.RenderTransformProperty"/>
        /// or
        /// <see cref="F:System.Windows.UIElement.ProjectionProperty"/>
        /// values may be saved and cleared before the start of the transition, then restored it after it is stopped or completed.
        /// </summary>
        /// <param name="element">The <see cref="T:System.Windows.UIElement"/>.</param>
        /// <returns>The <see cref="T:Microsoft.Phone.Controls.ITransition"/>.</returns>
        public abstract ITransition GetTransition(UIElement element);
    }
}


text:
Placeholder for **CSRF Protector - php library**
=====================================================

**Dependency:** `None`

**Configuration-File:** `../config.php`

**Configuration-Format:** `PHP ARRAY`


text:
package com.javarush.test.level17.lesson10.bonus01;

public enum Sex {
    MALE,
    FEMALE
}


text:
<?php

namespace frontend\controllers;

use Yii;
use common\models\p\PagosAccionistasDecretos;
use app\models\PagosAccionistasDecretosSearch;
use common\components\BaseController;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * PagosAccionistasDecretosController implements the CRUD actions for PagosAccionistasDecretos model.
 */
class PagosAccionistasDecretosController extends BaseController
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all PagosAccionistasDecretos models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new PagosAccionistasDecretosSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        $dataProvider->sort = false;

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single PagosAccionistasDecretos model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new PagosAccionistasDecretos model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new PagosAccionistasDecretos();
         if($model->existeregistro()){

            Yii::$app->session->setFlash('error','Usuario no posee un decreto dividiendos en curso');
            return $this->redirect(['decretos-div-excedentes/index']);
        }

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['decretos-div-excedentes/index']);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing PagosAccionistasDecretos model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
             return $this->redirect(['decretos-div-excedentes/index']);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing PagosAccionistasDecretos model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

       return $this->redirect(['decretos-div-excedentes/index']);
    }

    /**
     * Finds the PagosAccionistasDecretos model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return PagosAccionistasDecretos the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = PagosAccionistasDecretos::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/uptime.proto

namespace Google\Cloud\Monitoring\V3;

use UnexpectedValueException;

/**
 * The supported resource types that can be used as values of
 * `group_resource.resource_type`.
 * `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types.
 * The resource types `gae_app` and `uptime_url` are not valid here because
 * group checks on App Engine modules and URLs are not allowed.
 *
 * Protobuf type google.monitoring.v3.GroupResourceType
 */
class GroupResourceType
{
    /**
     * Default value (not valid).
     *
     * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0;
     */
    const RESOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * A group of instances from Google Cloud Platform (GCP) or
     * Amazon Web Services (AWS).
     *
     * Generated from protobuf enum INSTANCE = 1;
     */
    const INSTANCE = 1;
    /**
     * A group of Amazon ELB load balancers.
     *
     * Generated from protobuf enum AWS_ELB_LOAD_BALANCER = 2;
     */
    const AWS_ELB_LOAD_BALANCER = 2;

    private static $valueToName = [
        self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED',
        self::INSTANCE => 'INSTANCE',
        self::AWS_ELB_LOAD_BALANCER => 'AWS_ELB_LOAD_BALANCER',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }

    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


text:
function buildHtmlTable(selector, rows, columns, changeFilterKeyColumn, changeFilterValueColumn) {
  currentRows = filterChanged(explodedItems(rows), changeFilterKeyColumn, changeFilterValueColumn)
  if (columns == null) {
	  columns = collectColumns(currentRows);
  }
  addColumns(selector, columns)

  for (var i = currentRows.length - 1; i >= 0; i--) {
    var row$ = $('<tr/>');
    for (var colIndex = 0; colIndex < columns.length; colIndex++) {
      var cellValue = currentRows[i][columns[colIndex]];
      if (cellValue == null) cellValue = "";
      row$.append($('<td/>').html(cellValue));
    }
    $(selector).append(row$);
  }
}

function addColumns(selector, columns) {
  var headerTr$ = $('<tr/>');
  for (var colIndex = 0; colIndex < columns.length; colIndex++) {
	headerTr$.append($('<th/>').html(columns[colIndex]));
  }
  $(selector).append(headerTr$);
}

function collectColumns(rows, selector) {
  var columnSet = [];

  for (var i = 0; i < rows.length; i++) {
    var rowHash = rows[i];
    for (var key in rowHash) {
      if ($.inArray(key, columnSet) == -1) {
		columnSet.push(key);
      }
    }
  }
  return columnSet;
}

function explodedItems(rows) {
  var ret = []
  for (var i = 0; i < rows.length; i++) {
    var commonColumns = {}
    var rowHash = rows[i];
    var expanded = false
    for (var key in rowHash) {
		var cellValue = rowHash[key]
		if ($.isArray(cellValue)) {
            expanded = true
			for (var ci = 0; ci < cellValue.length; ci++) {
				var childRow = cellValue[ci]
                var item = jQuery.extend({}, commonColumns);
                for (var childKey in childRow) {
					item[childKey] = childRow[childKey]
				}
                ret.push(item)
			}
		} else {
            commonColumns[key] = cellValue
        }
    }
    if (!expanded) {
        ret.push(rowHash)
    }
  }
  return ret
}

function filterChanged(rows, keyColumn, valueColumn) {
  var ret = []
  var lastStates = {}
  for (var i = 0; i < rows.length; i++) {
    var row = rows[i];
    var key = row[keyColumn]
    var value = row[valueColumn]
    if (lastStates[key] == null || lastStates[key] != value) {
        ret.push(row)
        lastStates[key] = value
    }
  }
  return ret
}


text:
import T from "prop-types";
import React from "react";

import { Link } from "react-router";

const Pagination = props => {
  const start = props.page.number * props.page.size + 1;
  let end = start + props.page.size - 1;
  if (!props.links.next) {
    end = props.page.totalElements;
  }

  let pageLinks = [];
  if (props.links.first) {
    pageLinks.push(

        <PageLink
          pageType={props.pageType}
          url={props.links.first.href}
          text="«"
        />

    );
  }
  if (props.links.prev) {
    pageLinks.push(

        <PageLink
          pageType={props.pageType}
          url={props.links.prev.href}
          text="← Previous"
        />

    );
  }
  if (props.links.next) {
    pageLinks.push(

        <PageLink
          pageType={props.pageType}
          url={props.links.next.href}
          text="Next →"
        />

    );
  }
  if (props.links.last) {
    pageLinks.push(

        <PageLink
          pageType={props.pageType}
          url={props.links.last.href}
          text="»"
        />

    );
  }

  return (

        Showing {start} to {end} of {props.page.totalElements.toLocaleString()}{" "}
        entries

          {pageLinks}

  );
};

Pagination.propTypes = {
  page: T.shape({
    size: T.number,
    totalElements: T.number,
    totalPages: T.number,
    number: T.number
  }),
  pageType: T.string,
  links: T.shape({
    first: T.objectOf(T.string),
    self: T.objectOf(T.string),
    last: T.objectOf(T.string),
    prev: T.objectOf(T.string),
    next: T.objectOf(T.string)
  })
};

const PageLink = props => {
  const constructUrl = (pageType, genieLink) =>
    `${pageType}?${genieLink.substring(genieLink.indexOf("?") + 1)}`;
  return (
    <Link to={constructUrl(props.pageType, props.url)} activeClassName="active">
      {props.text}
    </Link>
  );
};

PageLink.propTypes = { pageType: T.string, text: T.string, url: T.string };

export default Pagination;


text:
package org.extremecomponents.table.callback;

import java.util.Iterator;
import java.util.Locale;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.collections.Predicate;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.extremecomponents.table.bean.Column;
import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.util.ExtremeUtils;

/**
 * Use the Jakarta Collections predicate pattern to filter out the table.
 *
 * @author Jeff Johnston
 */
public final class FilterPredicate implements Predicate {
    private static Log logger = LogFactory.getLog(FilterPredicate.class);
    private TableModel model;

    public FilterPredicate(TableModel model) {
        this.model = model;
    }

    /**
     * Use the filter parameters to filter out the table.
     */
    public boolean evaluate(Object bean) {
        boolean match = false;

        try {
            for (Iterator iter = model.getColumnHandler().getColumns().iterator(); iter.hasNext();) {
                Column column = (Column) iter.next();
                String alias = column.getAlias();
                String filterValue = model.getLimit().getFilterSet().getFilterValue(alias);

                if (StringUtils.isEmpty(filterValue)) {
                    continue;
                }

                String property = column.getProperty();
                Object value = PropertyUtils.getProperty(bean, property);

                if (value == null) {
                    continue;
                }

                if (column.isDate()) {
                    Locale locale = model.getLocale();
                    value = ExtremeUtils.formatDate(column.getParse(), column.getFormat(), value, locale);
                } else if (column.isCurrency()) {
                    Locale locale = model.getLocale();
                    value = ExtremeUtils.formatNumber(column.getFormat(), value, locale);
                }

                if (!isSearchMatch(value.toString(), filterValue)) {
                    match = false; // as soon as fail just short circuit

                    break;
                }

                match = true;
            }
        } catch (Exception e) {
            logger.error("FilterPredicate.evaluate() had problems", e);
        }

        return match;
    }

    private boolean isSearchMatch(String value, String search) {
        value = value.toLowerCase().trim();
        search = search.toLowerCase().trim();

        if (search.startsWith("*") && value.endsWith(StringUtils.replace(search, "*", ""))) {
            return true;
        } else if (search.endsWith("*") && value.startsWith(StringUtils.replace(search, "*", ""))) {
            return true;
        } else if (StringUtils.contains(value, search)) {
            return true;
        }

        return false;
    }
}