text:
package org.usfirst.frc.team1797.robot.commands.autocommands;

import org.usfirst.frc.team1797.robot.commands.FloorGearOuttakeCommand;
import org.usfirst.frc.team1797.robot.commands.autoprofiles.DrivetrainBlueLeftHCReverseCommand;

import edu.wpi.first.wpilibj.command.CommandGroup;

/**
 *
 */
public class AutoBlueLeftHCReverse extends CommandGroup {

    public AutoBlueLeftHCReverse() {
    	addParallel(new FloorGearOuttakeCommand());
        addSequential(new DrivetrainBlueLeftHCReverseCommand());
    }
}


text:
<ui>
<_string>Add-in Manager</_string>
<_string>Additional extensions are required to perform this operation.</_string>
<_string>The following add-ins will be installed:</_string>
<_string><big>Add-in Manager</big></_string>
<_string>The following add-ins are currently installed:</_string>
<_string>_Install Add-ins...</_string>
<_string>_Repositories...</_string>
<_string>_Uninstall...</_string>
<_string>Enable</_string>
<_string>Disable</_string>
<_string>Add-in</_string>
<_string>Version</_string>
<_string>Other</_string>
<_string>Version:</_string>
<_string>Author:</_string>
<_string>Copyright:</_string>
<_string>Add-in Dependencies:</_string>
<_string>Select the add-ins to install and click on Next</_string>
<_string>Show all packages</_string>
<_string>Show new versions only</_string>
<_string>Show updates only</_string>
<_string>_Unselect All</_string>
<_string>Select _All</_string>
<_string>Add-in Installation</_string>
<_string>Name</_string>
<_string>Url</_string>
<_string>Install from:</_string>
<_string>Repository</_string>
<_string>All registered repositories</_string>
<_string>Register an on-line repository</_string>
<_string>Select the location of the repository you want to register:</_string>
<_string>Register a local repository</_string>
<_string>Url:</_string>
<_string>Browse...</_string>
<_string>Path:</_string>
</ui>

redpajama_set_name: RedPajamaGithub


text:
layout: collection
collection: biostim
title: BioStim
permalink: /products/biostim/
---

What is BioStim?

Bio-Stim is a fish emulsion and soil stimulant that is produced through natural anaerobic digestion processes.

More Frequently Asked Questions


text:
using System;
using System.Collections.Generic;
using System.Net;
using HighriseApi.Interfaces;
using HighriseApi.Models;
using HighriseApi.Models.Enums;
using HighriseApi.Serializers;
using RestSharp;

namespace HighriseApi.Requests
{
    public class CaseRequest : RequestBase, ICaseRequest
    {
        public CaseRequest(IRestClient client) : base(client) { }

        public Kase Get(int id)
        {
            var response = _client.Execute<Kase>(new RestRequest(String.Format("kases/{0}.xml", id), Method.GET));
            var kase = response.Data;

            if (kase == null) return null;
            kase.LoadParties(response.Content);

            return kase;
        }

        public IEnumerable<Kase> Get(CaseStatus caseStatus)
        {
            var url = caseStatus == CaseStatus.Open ? "kases/open.xml" : "kases/closed.xml";
            var response = _client.Execute<List<Kase>>(new RestRequest(url, Method.GET));
            var kases = response.Data;

            foreach (var kase in kases)
                kase.LoadParties(response.Content);

            return kases;
        }

        public Kase Create(Kase kase)
        {
            var request = new RestRequest("kases.xml", Method.POST) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddBody(kase);

            var response = _client.Execute<Kase>(request);
            return response.Data;
        }

        public bool Update(Kase kase)
        {
            var request = new RestRequest("kases/{id}.xml", Method.PUT) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddParameter("id", kase.Id, ParameterType.UrlSegment);
            request.AddBody(kase);

            var response = _client.Execute<Kase>(request);
            return response.StatusCode == HttpStatusCode.OK;
        }

        public bool Delete(int id)
        {
            var response = _client.Execute<Kase>(new RestRequest(String.Format("kases/{0}.xml", id), Method.DELETE));
            return response.StatusCode == HttpStatusCode.OK;
        }
    }
}


text:
from tinydb import TinyDB, Query

class Moods:

    def __init__(self):
        db_path = 'deified_bot_db.json'
        db = TinyDB(db_path)
        self.mood_table = db.table('Moods')
        self.mood_query = Query()

    def mood_exists(self, mood : str):
        # trim and lower
        mood = mood.strip().lower()

        # if mood exists...
        if self.mood_table.get(self.mood_query.mood == mood):
            return True
        else:
            return False

    def add_mood(self, mood : str, emoji = ''):
        mood = mood.strip().lower()
        emoji = emoji.strip().lower()

        if self.mood_exists(mood):
            self.mood_table.update({'mood':mood, 'emoji':emoji},self.mood_query.mood == mood)
            print(self.mood_table.search(self.mood_query.mood == mood))
        else:
            self.mood_table.insert({'mood':mood,'emoji':emoji})
            print(self.mood_table.search(self.mood_query.mood == mood))

    def get_mood(self, mood : str):
        mood = mood.strip().lower()

        if self.mood_exists(mood):
            return self.mood_table.search(self.mood_query.mood == mood)[0]


text:
package cn.fmachine.lintcode.easy;

import cn.fmachine.lintcode.util.ListNode;

/**
 * algorithm
 * Author: XIN MING
 * Date: 11/12/16
 */
public class RemoveDuplicatesFromSortedListII {
    /**
     * @param ListNode head is the head of the linked list
     * @return: ListNode head of the linked list
     */
    public static ListNode deleteDuplicates(ListNode head) {
        ListNode dummy = new ListNode(0);
        dummy.next = head;
        ListNode prev = dummy;// 代表上一个节点
        while (head != null && head.next != null) {
            // 删除所有重复节点
            if (head.val == head.next.val) {
                int dupVal = head.val;
                while (head != null && dupVal == head.val) {
                    head = head.next;
                }
                // 把prev节点直接接到删除完所有重复节点的后面一个节点
                prev.next = head;
            } else { // 先更新上一个节点到当前节点,然后再移动当前节点到下一个节点
                prev = head;
                head = head.next;
            }
        }
        return dummy.next;
    }
}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Workloads.Models;

namespace Azure.ResourceManager.Workloads
{
    public partial class SapVirtualInstanceData : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(Identity))
            {
                writer.WritePropertyName("identity");
                writer.WriteObjectValue(Identity);
            }
            if (Optional.IsCollectionDefined(Tags))
            {
                writer.WritePropertyName("tags");
                writer.WriteStartObject();
                foreach (var item in Tags)
                {
                    writer.WritePropertyName(item.Key);
                    writer.WriteStringValue(item.Value);
                }
                writer.WriteEndObject();
            }
            writer.WritePropertyName("location");
            writer.WriteStringValue(Location);
            writer.WritePropertyName("properties");
            writer.WriteStartObject();
            writer.WritePropertyName("environment");
            writer.WriteStringValue(Environment.ToString());
            writer.WritePropertyName("sapProduct");
            writer.WriteStringValue(SapProduct.ToString());
            writer.WritePropertyName("configuration");
            writer.WriteObjectValue(Configuration);
            if (Optional.IsDefined(ManagedResourceGroupConfiguration))
            {
                writer.WritePropertyName("managedResourceGroupConfiguration");
                writer.WriteObjectValue(ManagedResourceGroupConfiguration);
            }
            writer.WriteEndObject();
            writer.WriteEndObject();
        }

        internal static SapVirtualInstanceData DeserializeSapVirtualInstanceData(JsonElement element)
        {
            Optional<UserAssignedServiceIdentity> identity = default;
            Optional<IDictionary<string, string>> tags = default;
            AzureLocation location = default;
            ResourceIdentifier id = default;
            string name = default;
            ResourceType type = default;
            Optional<SystemData> systemData = default;
            SapEnvironmentType environment = default;
            SapProductType sapProduct = default;
            SapConfiguration configuration = default;
            Optional<ManagedRGConfiguration> managedResourceGroupConfiguration = default;
            Optional<SapVirtualInstanceStatus> status = default;
            Optional<SapHealthState> health = default;
            Optional<SapVirtualInstanceState> state = default;
            Optional<SapVirtualInstanceProvisioningState> provisioningState = default;
            Optional<SapVirtualInstanceError> errors = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = UserAssignedServiceIdentity.DeserializeUserAssignedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = JsonSerializer.Deserialize<SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("environment"))
                        {
                            environment = new SapEnvironmentType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("sapProduct"))
                        {
                            sapProduct = new SapProductType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("configuration"))
                        {
                            configuration = SapConfiguration.DeserializeSapConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("managedResourceGroupConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            managedResourceGroupConfiguration = ManagedRGConfiguration.DeserializeManagedRGConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            status = new SapVirtualInstanceStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("health"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            health = new SapHealthState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            state = new SapVirtualInstanceState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new SapVirtualInstanceProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("errors"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return new SapVirtualInstanceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, identity.Value, environment, sapProduct, configuration, managedResourceGroupConfiguration.Value, Optional.ToNullable(status), Optional.ToNullable(health), Optional.ToNullable(state), Optional.ToNullable(provisioningState), errors.Value);
        }
    }
}


text:
<?php namespace AnandPatel\SeoExtension\Components;

use Cms\Classes\ComponentBase;
use Event;

class BlogPost extends ComponentBase
{

    public $page;
    public $seo_title;
    public $seo_description;
    public $seo_keywords;
    public $canonical_url;
    public $redirect_url;
    public $robot_index;
    public $robot_follow;

    public function componentDetails()
    {
        return [
            'name'        => 'anandpatel.seoextension::lang.component.blog.name',
            'description' => 'anandpatel.seoextension::lang.component.blog.description'
        ];
    }

    public function defineProperties()
    {
        return [
            "post" => [
                "title" => "data",
                "default" => "post"
            ]
        ];
    }

}


text:
<?php

namespace Code16\Sharp\View\Utils\Content;

use Illuminate\Support\Collection;
use Illuminate\View\ComponentAttributeBag;

class ComponentAttributeBagCollection
{
    protected Collection $collection;

    public function __construct()
    {
        $this->collection = new Collection();
    }

    public function get(string $componentName): ?ComponentAttributeBag
    {
        return $this->collection->get($componentName);
    }

    public function put(string $componentName, ComponentAttributeBag|array $attributes): void
    {
        if (is_array($attributes)) {
            $attributes = new ComponentAttributeBag($attributes);
        }

        $this->collection[$componentName] = $this->mergedAttributes($componentName, $attributes);
    }

    protected function mergedAttributes(string $componentName, ComponentAttributeBag $attributes): ComponentAttributeBag
    {
        if ($existingAttributes = $this->get($componentName)) {
            return $attributes->merge($existingAttributes->getAttributes());
        }

        return $attributes;
    }
}


text:
// copyright 2015 inbetweengames GBR

#include "LudumGame.h"
#include "GoalBehaviourComponent.h"
#include "FlockingGameMode.h"
#include "AI/Navigation/NavigationPath.h"
#include "DrawDebugHelpers.h"
#include "../FlockingDataCache.h"

DECLARE_CYCLE_STAT(TEXT("Goal Behaviour"),STAT_AI_GoalBehaviour,STATGROUP_Flocking);

// Sets default values for this component's properties
UGoalBehaviourComponent::UGoalBehaviourComponent()
{
	m_behaviourWeight = 1.0f;

	m_reevaluationTime = 1.0f;
	m_reevaluationTimeRand = 0.1f;
}

FVector UGoalBehaviourComponent::CalcAccelerationVector(int32 thisAIIndex, const FYAgentTeamData &forTeam, class UFlockingDataCache * dataCache, uint8 *scratchData, float tickTime) const
{
	SCOPE_CYCLE_COUNTER(STAT_AI_GoalBehaviour);

	FGoalScratchData *thisAgentData = (FGoalScratchData*)scratchData;

	thisAgentData->m_timeToRevaluation -= tickTime;
	FVector thisLocation = forTeam.m_locations[thisAIIndex];

	if (thisAgentData->m_timeToRevaluation < 0.0f || thisAgentData->m_currentPathDest.IsNearlyZero())
	{
		const TArray<FBox> &boxes = forTeam.m_goalBoxes;
		if (boxes.Num() == 0)
		{
			return FVector::ZeroVector;
		}

		bool alreadyHasGoal = !thisAgentData->m_currentGoal.IsNearlyZero() &&
			FVector::Dist(thisAgentData->m_currentGoal, thisLocation) >= forTeam.m_agentRadius;
		if (!alreadyHasGoal)
		{
			float closest = MAX_FLT;

			for (const FBox & box : boxes)
			{
				FVector boxGoal;
				if (m_goToClosestPoint)
				{
					boxGoal = box.GetClosestPointTo(thisLocation);
				}
				else
				{
					boxGoal = FMath::RandPointInBox(box);
				}

				float distSq = FVector::DistSquared(thisLocation, boxGoal);
				if (distSq < closest)
				{
					closest = distSq;
					thisAgentData->m_currentGoal = boxGoal;
				}
			}
		}

/*		AActor *nonConstActor = (AActor*)(forTeam.m_agents[thisAIIndex]);*/

		thisLocation.Z = thisAgentData->m_currentGoal.Z;
		UNavigationPath *path = UNavigationSystem::FindPathToLocationSynchronously(GetWorld(), thisLocation, thisAgentData->m_currentGoal, nullptr);
		if (path && path->PathPoints.Num() > 1)
		{
			thisAgentData->m_currentPathDest = path->PathPoints[1];
		}

		thisAgentData->m_timeToRevaluation = m_reevaluationTime + FMath::FRandRange(-m_reevaluationTimeRand, m_reevaluationTimeRand);

// 		if (path && /*m_path->IsValid() &&*/ path->PathPoints.Num() > 1)
// 		{
// 			for (int i = 0; i < path->PathPoints.Num() - 1; i++)
// 			{
// 				DrawDebugLine(GetWorld(), path->PathPoints[i], path->PathPoints[i + 1], FColor::Red, false, thisAgentData->m_timeToRevaluation);
// 			}
// 		}

		//DrawDebugLine(GetWorld(), thisLocation, closestGoal, FColor::Yellow, false, thisAgentData->m_timeToRevaluation);
	}

	if (!thisAgentData->m_currentPathDest.IsNearlyZero())
	{
		FVector toFirstPoint = thisAgentData->m_currentPathDest - thisLocation;
		toFirstPoint.Z = 0.0f;

		if (toFirstPoint.Size() < (forTeam.m_agentRadius))
		{
			// reached destination
			thisAgentData->m_currentPathDest = FVector::ZeroVector;
			thisAgentData->m_currentGoal = FVector::ZeroVector;
		}

		toFirstPoint.Normalize();
		return toFirstPoint * m_behaviourWeight;
	}
	else
	{
		return FVector::ZeroVector;
	}
}


text:
#include "stdafx.h"
#include "ZipArchive.h"
#include <assert.h>

#ifndef __cplusplus
#error ZipArchive requires C++ compilation (use a .cpp suffix)
#endif

#ifdef ZIP_WILDCARD
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#endif

// Include ZLIB stuff. ZLIB is maintained by Jean-loup Gailly and Mark Adler.
// It is a general GZIP and PKZIP compatible compression library.
#include <zconf.h>
#include <zlib.h>

#include <crtdbg.h>
#include <tchar.h>
#include <malloc.h>

CZipFile::CZipFile(DWORD dwSize/*=0*/)
		: m_pData(NULL),
		m_dwSize(0),
		m_dwPos(0)
	{
#ifdef ZLIB_DECRYPTION
		m_pCrcTable = NULL;
#endif
		if(dwSize!=0)
		{
			m_pData=new BYTE[dwSize];
			m_dwSize=dwSize;
		}
	}
	CZipFile::~CZipFile()
	{
		Close();
	}
	BOOL CZipFile::Read(void* pBuffer, DWORD dwSize, LPDWORD pdwRead/* = NULL*/)
	{
		_ASSERTE(IsOpen());

		if (pdwRead != NULL)
			*pdwRead = 0;
		if (m_pData == NULL)
			return FALSE;
		if (dwSize == 0 || m_dwPos >= m_dwSize)
			return FALSE;

		if (m_dwPos + dwSize > m_dwSize)
			dwSize = m_dwSize - m_dwPos;
		::CopyMemory(pBuffer, m_pData + m_dwPos, dwSize);
		m_dwPos += dwSize;
		if (pdwRead != NULL)
			*pdwRead = dwSize;

		return TRUE;
	}
	BOOL CZipFile::Close()
	{
		if (m_pData == NULL)
			return TRUE;

		delete[] m_pData;
		m_pData = NULL;
		m_dwSize = 0;
		m_dwPos = 0;

		return TRUE;
	}
	BOOL CZipFile::IsOpen() const
	{
		return m_pData != NULL;
	}
	BYTE* CZipFile::GetData() const
	{
		_ASSERTE(IsOpen());
		return m_pData;
	}
	DWORD CZipFile::GetSize() const
	{
		_ASSERTE(IsOpen());
		return m_dwSize;
	}
	DWORD CZipFile::GetPosition() const
	{
		_ASSERTE(IsOpen());
		return m_dwPos;
	}
	DWORD CZipFile::Seek(DWORD dwOffset, UINT nFrom)	//	return old pos
	{
		_ASSERTE(IsOpen());
		DWORD dwPos = m_dwPos;
		switch (nFrom)
		{
		case FILE_BEGIN:
			m_dwPos = dwOffset;
			break;
		case FILE_END:
			m_dwPos = m_dwSize + dwOffset;
			break;
		case FILE_CURRENT:
			m_dwPos += dwOffset;
			break;
		}
		if (m_dwPos < 0)
			m_dwPos = 0;
		if (m_dwPos >= m_dwSize)
			m_dwPos = m_dwSize;
		return dwPos;
	}

#ifdef ZLIB_DECRYPTION
	BOOL CZipFile::_DecryptFile(LPCSTR pstrPassword, LPBYTE& pData, DWORD& dwSize, DWORD crc32)
	{
		_ASSERTE(pData);
		_ASSERTE(!::IsBadStringPtrA(pstrPassword, -1));

		if (!_InitKeys(pstrPassword))
			return FALSE;
		if (!_DecryptHeader(pData, dwSize, crc32))
			return FALSE;
		if (!_DecryptData(pData, dwSize))
			return FALSE;

		return TRUE;
	}

	BOOL CZipFile::_InitKeys(LPCSTR pstrPassword)
	{
		m_pCrcTable = get_crc_table();
		m_dwKey[0] = 305419896;
		m_dwKey[1] = 591751049;
		m_dwKey[2] = 878082192;

		int nLen = ::lstrlenA(pstrPassword);
		if (nLen == 0)
			return FALSE;

		for(int i = 0; i < nLen; i++)
			_UpdateKeys(pstrPassword[i]);

		return TRUE;
	}
	void CZipFile::_UpdateKeys(BYTE c)
	{
		m_dwKey[0] = _crc32(m_dwKey[0], c);
		m_dwKey[1] = m_dwKey[1] + (m_dwKey[0] & 0x000000FF);
		m_dwKey[1] = m_dwKey[1] * 134775813 + 1;
		BYTE b = (BYTE) (m_dwKey[1] >> 24);
		m_dwKey[2] = _crc32(m_dwKey[2], b);
	}

    DWORD CZipFile::_crc32( DWORD c, BYTE b )
    {
        assert(m_pCrcTable);
        return m_pCrcTable[((DWORD) (c) ^ (b)) & 0xFF] ^ ((c) >> 8);
    }

	BOOL CZipFile::_DecryptHeader(LPBYTE pData, DWORD dwSize, DWORD crc32)
	{
		if (dwSize < 12)
			return FALSE;

		BYTE header[12];
		::CopyMemory(&header, pData, 12);
		for(int i = 0; i < 12; i++)
		{
			BYTE c = (BYTE)(header[i] ^ _DecryptByte());
			_UpdateKeys(c);
			header[i] = c;
		}

		// Password check
		return header[11] == (BYTE)(crc32 >> 24);
	}

    BYTE CZipFile::_DecryptByte() const
    {
        DWORD temp = (WORD) (m_dwKey[2] | 2);
        return (BYTE)((temp * (temp ^ 1)) >> 8);
    }

	BOOL CZipFile::_DecryptData(LPBYTE& pData, DWORD& dwSize)
	{
		LPBYTE pRawData;
		pRawData = new BYTE[dwSize - 12];
		_ASSERTE(pRawData);

		if (pRawData == NULL)
			return FALSE;

		LPBYTE p = pRawData;
		for(DWORD i = 12; i < dwSize; i++)
		{
			BYTE c = (BYTE) (pData[i] ^ _DecryptByte());
			_UpdateKeys(c);
			*p++ = c;
		}

		delete[] pData;
		pData = pRawData;
		dwSize -= 12;

		return TRUE;
	}
#endif	//	ZLIB_DECRYPTION

	BOOL CZipFile::Attach(LPBYTE pData, DWORD dwSize)
	{
		if(m_pData) return FALSE;
		_ASSERTE(pData);
		_ASSERTE(!::IsBadReadPtr(pData,dwSize));

		m_pData = pData;
		m_dwSize = dwSize;
		return TRUE;
	}

	void CZipFile::Detach()
	{
		m_pData = NULL;
		m_dwSize = 0;
		m_dwPos = 0;
	}

	//////////////////////////////////////////////////////////////////////////
	//CZipArchive
	//////////////////////////////////////////////////////////////////////////

	CZipArchive::CZipArchive()
		: m_hFile(INVALID_HANDLE_VALUE),
		m_Files(NULL),
		m_DirData(NULL)
	{
		memset(&m_Header, 0, sizeof(m_Header));
	}
	CZipArchive::~CZipArchive()
	{
		Close();
	}

	BOOL CZipArchive::OpenZip()
	{
		_ASSERTE(m_hFile);

		SeekFile(-(LONG)sizeof(m_Header), FILE_END);

		DWORD dwRead = ReadFile(&m_Header, sizeof(m_Header));
		_ASSERTE(dwRead == sizeof(m_Header));

		if (dwRead != sizeof(m_Header) || m_Header.sig != DIR_SIGNATURE)
		{
			Close();
			return FALSE;
		}

		_ASSERTE(m_Header.nDirEntries < 1000); // Sanity check

		m_DirData = (LPBYTE)malloc(m_Header.dirSize);
		_ASSERTE(m_DirData);

		m_Files = new ZipDirFileHeader*[m_Header.nDirEntries];
		_ASSERTE(m_Files);

		if (m_Files == NULL || m_DirData == NULL)
		{
			Close();
			return FALSE;
		}

		SeekFile(-(LONG)(sizeof(m_Header) + m_Header.dirSize), FILE_END);

		dwRead = ReadFile(m_DirData, m_Header.dirSize);
		_ASSERTE(dwRead == m_Header.dirSize);

		if (dwRead != m_Header.dirSize)
		{
			Close();
			return FALSE;
		}

		LPBYTE pData = m_DirData;
		for (int i = 0; i < m_Header.nDirEntries; i++)
		{
			// Set the header pointer in the m_Files array
			ZipDirFileHeader* fh = (ZipDirFileHeader*) pData;
			m_Files[i] = fh;
			if (fh->sig != FILE_SIGNATURE)
			{
				Close();
				return FALSE;
			}
			// Convert UNIX slash to Windows backslash in ANSI string
			LPSTR pszName = fh->GetName();
			for(int j = 0; j < fh->fnameLen; j++, pszName++)
				if (*pszName == '/')
					*pszName='\\';

			// Get next header
			pData += sizeof(ZipDirFileHeader) + fh->fnameLen + fh->xtraLen + fh->cmntLen;
		}

		m_szPassword[0] = '\0';

		return TRUE;
	}
	void CZipArchive::Close()
	{
		CloseFile();

		if (m_Files != NULL)
		{
			delete[] m_Files;
			m_Files = NULL;
		}
		if (m_DirData != NULL)
		{
			free(m_DirData);
			m_DirData = NULL;
		}
		memset(&m_Header, 0, sizeof(m_Header));
	}
	BOOL CZipArchive::IsOpen() const
	{
		return m_hFile != INVALID_HANDLE_VALUE;
	}
	int CZipArchive::GetEntries() const
	{
		return m_Header.nDirEntries;
	}

	BOOL CZipArchive::SetPassword(LPCSTR pstrPassword)
	{
        if(!pstrPassword) return FALSE;

		if (::lstrlenA(pstrPassword) >= sizeof(m_szPassword)-1)
			return FALSE;

		::lstrcpyA(m_szPassword, pstrPassword);
		return TRUE;
	}

	// ZIP File API

	BOOL CZipArchive::GetFile(LPCTSTR pszFileName, CZipFile& file)
	{
		return GetFile(GetFileIndex(pszFileName),file);
	}

	BOOL CZipArchive::GetFile2(int iIndex, CZipFile& file)
	{
		_ASSERTE(IsOpen());
		_ASSERTE(iIndex >= 0 && iIndex < m_Header.nDirEntries);

		if (m_hFile == INVALID_HANDLE_VALUE)
			return FALSE;
		if (iIndex < 0 || iIndex >= m_Header.nDirEntries)
			return FALSE;

		ZipLocalHeader hdr;
		SeekFile(m_Files[iIndex]->hdrOffset, FILE_BEGIN);

		DWORD dwRead = ReadFile(&hdr, sizeof(hdr));
		if (dwRead != sizeof(hdr))
			return FALSE;

		if (hdr.sig != LOCAL_SIGNATURE)
			return FALSE;

		SeekFile(hdr.fnameLen + hdr.xtraLen, FILE_CURRENT);

		DWORD dwSize = hdr.cSize;
		if (hdr.flag & 1)
		{//Õâ¸ö½Ó¿Ú²»Ö§³Ö¼ÓÃÜ
			return FALSE;
		}

		switch (hdr.compression)
		{
		case LOCAL_COMP_STORE:
			_ASSERTE(hdr.cSize == hdr.ucSize);
			dwRead = ReadFile(file.GetData(), hdr.cSize);
			return dwRead==hdr.cSize;
		case LOCAL_COMP_DEFLAT:
			{
				if(file.GetSize()<hdr.ucSize) return FALSE;
				// Read Source Data.
				LPBYTE pData=new BYTE[hdr.cSize];

				if (pData == NULL)
					return FALSE;

				dwRead = ReadFile(pData, hdr.cSize);
				if (dwRead != hdr.cSize)
				{
					delete[] pData;
					return FALSE;
				}

				LPBYTE pTarget=file.GetData();

				z_stream stream = { 0 };
				stream.next_in = (Bytef*) pData;
				stream.avail_in = (uInt) hdr.cSize;
				stream.next_out = (Bytef*) pTarget;
				stream.avail_out = hdr.ucSize;
				stream.zalloc = (alloc_func) NULL;
				stream.zfree = (free_func) NULL;
				// Perform inflation; wbits < 0 indicates no zlib header inside the data.
				int err = inflateInit2(&stream, -MAX_WBITS);
				if (err == Z_OK)
				{
					err = inflate(&stream, Z_OK);
					if (err != Z_OK && err != Z_STREAM_END)
						_ASSERTE(err == Z_OK);
					inflateEnd(&stream);
					if (err == Z_STREAM_END)
						err = Z_OK;
					inflateEnd(&stream);
				}

				delete[] pData;

				return err == Z_OK;
			}
		default:
			_ASSERTE(FALSE); // unsupported compression scheme
			return FALSE;
		}
	}

	BOOL CZipArchive::GetFile(int iIndex, CZipFile& file)
	{
		_ASSERTE(IsOpen());
		_ASSERTE(iIndex >= 0 && iIndex < m_Header.nDirEntries);

		if (m_hFile == INVALID_HANDLE_VALUE)
			return FALSE;
		if (iIndex < 0 || iIndex >= m_Header.nDirEntries)
			return FALSE;

		ZipLocalHeader hdr;
		SeekFile(m_Files[iIndex]->hdrOffset, FILE_BEGIN);

		DWORD dwRead = ReadFile(&hdr, sizeof(hdr));
		if (dwRead != sizeof(hdr))
			return FALSE;

		if (hdr.sig != LOCAL_SIGNATURE)
			return FALSE;

		SeekFile(hdr.fnameLen + hdr.xtraLen, FILE_CURRENT);

		// 		// Decompress file if needed.
		LPBYTE pData;
		pData = new BYTE[hdr.cSize];

		if (pData == NULL)
			return FALSE;

		dwRead = ReadFile(pData, hdr.cSize);
		if (dwRead != hdr.cSize)
		{
            delete[] pData;
			return FALSE;
		}

		DWORD dwSize = hdr.cSize;
		if (hdr.flag & 1)
		{
#ifdef ZLIB_DECRYPTION
			if (::lstrlenA(m_szPassword) == 0)
			{
				delete[] pData;
				return FALSE;
			}
			if (!file._DecryptFile(m_szPassword, pData, dwSize, hdr.crc32))
			{
                delete[] pData;
				return FALSE;
			}
#else
            delete[] pData;
			return FALSE;
#endif
		}

		switch (hdr.compression)
		{
		case LOCAL_COMP_STORE:
			//_ASSERTE(hdr.cSize == hdr.ucSize);//¼ÓÃܵÄʱÕâÁ½¸öÖµ²»Ò»¶¨ÏàµÈ
			break;
		case LOCAL_COMP_DEFLAT:
			{
				LPBYTE pTarget;
				pTarget = new BYTE[hdr.ucSize];
				_ASSERTE(pTarget);

				if (pTarget == NULL)
					return FALSE;

				z_stream stream = { 0 };
				stream.next_in = (Bytef*) pData;
				stream.avail_in = (uInt) hdr.cSize;
				stream.next_out = (Bytef*) pTarget;
				stream.avail_out = hdr.ucSize;
				stream.zalloc = (alloc_func) NULL;
				stream.zfree = (free_func) NULL;
				// Perform inflation; wbits < 0 indicates no zlib header inside the data.
				int err = inflateInit2(&stream, -MAX_WBITS);
				if (err == Z_OK)
				{
					err = inflate(&stream, Z_OK);
					if (err != Z_OK && err != Z_STREAM_END)
						_ASSERTE(err == Z_OK);
					inflateEnd(&stream);
					if (err == Z_STREAM_END)
						err = Z_OK;
					inflateEnd(&stream);
				}

				delete[] pData;

				if (err != Z_OK)
				{
					delete[] pTarget;
					return FALSE;
				}
				pData = pTarget;
			}
			break;
		default:
			_ASSERTE(FALSE); // unsupported compression scheme
			return FALSE;
		}
		// The memory we allocated is passed to the file, which
		// takes ownership of it.
		file.Attach(pData, hdr.ucSize);

		return TRUE;
	}

	// FindFile API

	HANDLE CZipArchive::FindFirstFile(LPCTSTR pszFileName, LPZIP_FIND_DATA lpFindFileData) const
	{
		_ASSERTE(IsOpen());
		_ASSERTE(!::IsBadWritePtr(lpFindFileData, sizeof(ZIP_FIND_DATA)));

		::ZeroMemory(lpFindFileData, sizeof(ZIP_FIND_DATA));

		_ASSERTE(pszFileName != NULL);
		if (pszFileName == NULL || pszFileName[0] == '\0')
			return INVALID_HANDLE_VALUE;

		FindFileHandle* pFF;
		pFF = new FindFileHandle;
		if (pFF == NULL)
			return INVALID_HANDLE_VALUE;

		::lstrcpy(pFF->szSearch, pszFileName);
		pFF->nPos = 0;

		BOOL bRet = FindNextFile((HANDLE)pFF, lpFindFileData);
		if (!bRet)
		{
			delete pFF;
			return INVALID_HANDLE_VALUE;
		}
		return (HANDLE)pFF;
	}
	BOOL CZipArchive::FindNextFile(HANDLE hFindFile, LPZIP_FIND_DATA lpFindFileData) const
	{
		_ASSERTE(IsOpen());

		if (!IsOpen())
			return FALSE;
		if (hFindFile == INVALID_HANDLE_VALUE || hFindFile == NULL)
			return FALSE;

		FindFileHandle* pFF = reinterpret_cast<FindFileHandle*>(hFindFile);
		while (TRUE)
		{
			if (pFF->nPos >= m_Header.nDirEntries)
				return FALSE;

			// Extract filename and match with pattern
			ZipDirFileHeader* fh = m_Files[pFF->nPos];
			TCHAR szFile[MAX_PATH] = { 0 };
			::OemToCharBuff(fh->GetName(), szFile, fh->fnameLen);

#ifdef ZIP_WILDCARD
			if (::PathMatchSpec(szFile, pFF->szSearch) != NULL)
#else
			if (_tcsicmp(szFile, pFF->szSearch) == 0)
#endif
			{
				// Copy data to the ZIP_FIND_DATA structure
				::lstrcpy(lpFindFileData->szFileName, szFile);
				lpFindFileData->szComment[0] = _T('\0'); // unsupported right now
				lpFindFileData->nFileSizeCompressed = fh->cSize;
				lpFindFileData->nFileSizeUncompressed = fh->ucSize;
				::DosDateTimeToFileTime(fh->modDate, fh->modTime, &lpFindFileData->ftCreationDate);
				lpFindFileData->nIndex = pFF->nPos;

				// Figure out the file attributes
				DWORD& dwFlags = lpFindFileData->dwFileAttributes = 0;
				if (fh->flag & 1)
					dwFlags |= FILE_ATTRIBUTE_ENCRYPTED;
				if (fh->flag & (2|4))
					dwFlags |= FILE_ATTRIBUTE_COMPRESSED;
				if (fh->flag & (16|32|64))
					dwFlags |= FILE_ATTRIBUTE_OFFLINE; // unsupported compression used
				if (dwFlags == 0)
					dwFlags = (fh->compression == LOCAL_COMP_STORE) ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL;

				// Ready for next entry...
				pFF->nPos++;
				return TRUE;
			}
			pFF->nPos++;
		}
		return FALSE;
	}
	BOOL CZipArchive::FindClose(HANDLE hFindFile) const
	{
		if (hFindFile == INVALID_HANDLE_VALUE || hFindFile == NULL)
			return FALSE;

		FindFileHandle* pFF = reinterpret_cast<FindFileHandle*>(hFindFile);
		delete pFF;
		return TRUE;
	}

	BOOL CZipArchive::Open(LPCTSTR pszFileName)
	{
		_ASSERTE(!::IsBadStringPtr(pszFileName, MAX_PATH));
		HANDLE hFile = ::CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

		if(INVALID_HANDLE_VALUE==hFile) return FALSE;

		Close();
		m_hFile=hFile;
		BOOL bOK=OpenZip();
		if(!bOK)
		{
			CloseHandle(m_hFile);
			m_hFile=INVALID_HANDLE_VALUE;
		}
		return bOK;
	}

	BOOL CZipArchive::Open( HMODULE hModule,LPCTSTR pszName,LPCTSTR pszType )
	{
		HRSRC hResInfo = ::FindResource(hModule, pszName, pszType);
		if (hResInfo == NULL)
			return FALSE;

		DWORD dwLength = ::SizeofResource(hModule, hResInfo);
		if (dwLength == 0)
			return FALSE;

		HGLOBAL hResData = ::LoadResource(hModule, hResInfo);
		if (hResData == NULL)
			return FALSE;

		BYTE* pData = (BYTE*)::LockResource(hResData);
		if (pData == NULL)
			return FALSE;

		Close();

		m_fileRes.Attach(pData, dwLength);

		m_hFile = (HANDLE)hResInfo;

		BOOL bOK=OpenZip();
		if(!bOK)
		{
			m_fileRes.Detach();
			m_hFile=INVALID_HANDLE_VALUE;
		}
		return bOK;
	}

	void CZipArchive::CloseFile()
	{
		if (m_hFile != INVALID_HANDLE_VALUE)
		{
			if (m_fileRes.IsOpen())
				m_fileRes.Detach();
			else
				::CloseHandle(m_hFile);
			m_hFile = INVALID_HANDLE_VALUE;
		}
	}

	DWORD CZipArchive::ReadFile(void* pBuffer, DWORD dwBytes)
	{
		_ASSERTE(m_hFile != INVALID_HANDLE_VALUE);

		DWORD dwRead = 0;

		if (m_fileRes.IsOpen())
			m_fileRes.Read(pBuffer, dwBytes, &dwRead);
		else
			::ReadFile(m_hFile, pBuffer, dwBytes, &dwRead, NULL);

		return dwRead;
	}
	DWORD CZipArchive::SeekFile(LONG lOffset, UINT nFrom)
	{
		_ASSERTE(m_hFile != INVALID_HANDLE_VALUE);

		if (m_fileRes.IsOpen())
		{
			m_fileRes.Seek(lOffset, nFrom);
			return m_fileRes.GetPosition();
		}

		return ::SetFilePointer(m_hFile, lOffset, NULL, nFrom);
	}

	DWORD CZipArchive::GetFileSize( LPCTSTR pszFileName )
	{
		return GetFileSize(GetFileIndex(pszFileName));
	}

	DWORD CZipArchive::GetFileSize( int iIndex )
	{
		if(iIndex==-1) return 0;

		if (m_hFile == INVALID_HANDLE_VALUE)
			return 0;
		if (iIndex < 0 || iIndex >= m_Header.nDirEntries)
			return 0;

		ZipLocalHeader hdr;
		SeekFile(m_Files[iIndex]->hdrOffset, FILE_BEGIN);

		DWORD dwRead = ReadFile(&hdr, sizeof(hdr));
		if (dwRead != sizeof(hdr))
			return 0;
		return hdr.ucSize;
	}

	int CZipArchive::GetFileIndex( LPCTSTR pszFileName )
	{
		_ASSERTE(IsOpen());
		_ASSERTE(!::IsBadStringPtr(pszFileName, MAX_PATH));

		ZIP_FIND_DATA fd;
		HANDLE hFindFile = FindFirstFile(pszFileName, &fd);
		if (hFindFile == INVALID_HANDLE_VALUE)
			return -1;
		FindClose(hFindFile);
		return fd.nIndex;
	}


text:
import { ajax, layer } from './../../common';
export default {
  data() {
    return {
      projectId: '',
      apiList: [],
      groupModalShown: false,
      groupList: [],
      projectOwner: ''
    }
  },
  created() {
    this.projectId = this.$route.params.id;
    this.loadProject();
    this.loadApiList();
  },
  computed: {
    pathForCreateApi() {
      return `/project/${this.projectId}/new`;
    },
    isProjectOwner() {
      return this.$store.state.userInfo.id === this.projectOwner;
    }
  },
  methods: {
    loadProject() {
      ajax.get(`${AppConf.apiHost}/project/${this.projectId}`)
        .then(project => {
          this.projectOwner = project.createBy;
        });
    },
    loadApiList() {
      ajax.get(`${AppConf.apiHost}/project/${this.projectId}/api`)
        .then(data => {
          this.apiList = data;
        });
    },
    doApiOperate(type, api) {
      if (type === 'detail') {
        this.$router.push(`/project/${this.projectId}/api/${api.id}`);
      } else if (type === 'edit') {
        this.$router.push(`/project/${this.projectId}/api/${api.id}/edit`);
      } else if (type === 'delete') {
        layer.error('禁止删除');
      }
    },
    showGroupModal() {
      this.groupModalShown = true;
      this.loadGroupList();
    },
    loadGroupList() {
      ajax.get(`${AppConf.apiHost}/project/${this.projectId}/group`)
        .then(data => {
          this.groupList = data.map(x => {
            x.edit = false;
            x.editName = x.name;
            return x;
          });
        });
    },
    checkApiGroup() {
      if (this.groupList.find(x => x.edit)) {
        layer.error('Has one group in editing mode, please check.');
        return false;
      }
      return true;
    },
    changeToEditMode(group) {
      if (this.checkApiGroup()) {
        group.edit = true;
      }
    },
    addNewGroup() {
      if (this.checkApiGroup()) {
        this.groupList.push({
          name: '',
          apiCount: 0,
          edit: true
        });
      }
    },
    cancelGroupOperate(group) {
      if (!group.groupId) { // 整体移除
        this._removeGroupFromGroupList(group);
      } else { // 取消编辑
        group.edit = false;
      }
    },
    _removeGroupFromGroupList(group) {
      for (let i = this.groupList.length - 1; i >= 0; i--) {
        if (group === this.groupList[i]) {
          this.groupList.splice(i, 1);
          return;
        }
      }
    },
    deleteApiGroup(group) {
      if (this.groupList && this.groupList[0] === group) {
        return layer.error('Can\'t delete the first group');
      }
      ajax.delete(`${window.AppConf.apiHost}/project/${this.projectId}/group/${group.groupId}`)
        .then(() => {
          this._removeGroupFromGroupList(group);
          layer.msg('Delete API Group Successfully.');
        });
    },
    saveApiGroup(group) {
      let p;
      if (group.groupId) { // Update
        p = ajax.put(`${window.AppConf.apiHost}/project/${this.projectId}/group/${group.groupId}`, { groupName: group.editName });
      } else { // Create
        p = ajax.post(`${window.AppConf.apiHost}/project/${this.projectId}/group/new`, { groupName: group.editName });
      }
      p.then(() => {
        group.name = group.editName;
        group.edit = false;
        layer.msg('Save Successfully.');
      });
    }
  }
};


text:
package braque;

/**
 *
A generic interface from which all properties that are in a property set inherit.
 * Added under the hood by braque, useful for introspection.

 *
 *
Created by mikesolomon on 11/09/16.

 */

public interface PropSet extends Prop {
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Arch. Protistenk. 52(2): 232 (1995)

#### Original name
Pseudonitschkia Coppins & S.Y. Kondr.

### Remarks
null


text:
using System;
using System.Globalization;

namespace Docker.DotNet
{
    internal static class HttpUtility
    {
        public static Uri BuildUri(Uri baseUri, Version requestedApiVersion, string path, IQueryString queryString)
        {
            if (baseUri == null)
            {
                throw new ArgumentNullException("baseUri");
            }

            UriBuilder builder = new UriBuilder(baseUri);

            if (requestedApiVersion != null)
            {
                builder.Path += string.Format(CultureInfo.InvariantCulture, "v{0}/", requestedApiVersion);
            }

            if (!string.IsNullOrEmpty(path))
            {
                builder.Path += path;
            }

            if (queryString != null)
            {
                builder.Query = queryString.GetQueryString();
            }

            return builder.Uri;
        }
    }
}


text:
package usingflume.ch03;

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

public class RandomQuoteProvider implements QuoteProvider {
  private final Random r = new Random(System.currentTimeMillis());

  @Override
  public void start() {
  }

  @Override
  public void stop() {
  }

  @Override
  public Map<String, Float> getQuote(List<String> tickers) {
    Map<String, Float> prices = new HashMap<String, Float>(tickers.size());
    for(String ticker: tickers) {
      prices.put(ticker, r.nextFloat());
    }
    return prices;
  }
}


text:
using System;
using System.Text;

namespace StringBuilderExtensions
{
    public static class StringBuilderExtensions
    {
        // Gets the substring with specific length from the provided start index
        public static StringBuilder Substring(this StringBuilder wholeString, int startIndex, int length)
        {
            if (startIndex < 0 || startIndex > wholeString.Length)
            {
                throw new IndexOutOfRangeException("Start index is out of the boundaries of the string!");
            }
            if (length < 0)
            {
                throw new ArgumentOutOfRangeException("Cannot get a substring with negative length!");
            }
            int endIndex = startIndex + length;
            if (endIndex > wholeString.Length)
            {
                throw new ArgumentOutOfRangeException("The substring with the provided length gets out of the boundaries of the string!");
            }
            StringBuilder substring = new StringBuilder(length);
            for (int index = startIndex; index < endIndex; index++)
            {
                substring.Append(wholeString[index]);
            }
            return substring;
        }

        // Gets the substring from the start index to the end of the provided string
        public static StringBuilder Substring(this StringBuilder wholeString, int startIndex)
        {
            if (startIndex < 0 || startIndex > wholeString.Length)
            {
                throw new IndexOutOfRangeException("Start index is out of the boundaries of the string!");
            }
            int endIndex = wholeString.Length;
            int length = endIndex - startIndex;
            StringBuilder substring = new StringBuilder(length);
            for (int index = startIndex; index < endIndex; index++)
            {
                substring.Append(wholeString[index]);
            }
            return substring;
        }
    }
}


text:
package com.devilwwj.mvp.presenter;

import com.devilwwj.mvp.bean.UserBean;
import com.devilwwj.mvp.model.IUserModel;
import com.devilwwj.mvp.model.impl.UserModel;
import com.devilwwj.mvp.view.IUserView;

/**
 * 建立presenter(主导器,通过iView和iModel接口操作model和View)
 * activity可以把所有逻辑交给presenter处理,这样java逻辑就从手机的activity中分离出来
 * Created by wwj_748 on 2016/4/26.16.37
 */
public class UserPresenter {
    private IUserView mUserView;
    private IUserModel mUserModel;

    public UserPresenter(IUserView view) {
        mUserView = view;
        mUserModel = new UserModel();
    }

    public void saveUser(int id, String firstName, String lastName) {
        mUserModel.setID(id);
        mUserModel.setFirstName(firstName);
        mUserModel.setLastName(lastName);
    }

    public void loadUser(int id) {
        UserBean user = mUserModel.load(id);
        mUserView.setFirstName(user.getFirstName());
        mUserView.setLastName(user.getLastName());
    }
}


text:
/**
 * BGP overall constants and some interfaces
 */
package org.topology.bgp_ls.netty;


text:
namespace Poco {

std::string EnvironmentImpl::getImpl(const std::string& name)
{
	std::wstring uname;
	UnicodeConverter::toUTF16(name, uname);
	DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0);
	if (len == 0) throw NotFoundException(name);
	Buffer<wchar_t> buffer(len);
	GetEnvironmentVariableW(uname.c_str(), buffer.begin(), len);
	std::string result;
	UnicodeConverter::toUTF8(buffer.begin(), len - 1, result);
	return result;
}

bool EnvironmentImpl::hasImpl(const std::string& name)
{
	std::wstring uname;
	UnicodeConverter::toUTF16(name, uname);
	DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0);
	return len > 0;
}

void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
{
	std::wstring uname;
	std::wstring uvalue;
	UnicodeConverter::toUTF16(name, uname);
	UnicodeConverter::toUTF16(value, uvalue);
	if (SetEnvironmentVariableW(uname.c_str(), uvalue.c_str()) == 0)
	{
		std::string msg = "cannot set environment variable: ";
		msg.append(name);
		throw SystemException(msg);
	}
}

std::string EnvironmentImpl::osNameImpl()
{
	OSVERSIONINFO vi;
	vi.dwOSVersionInfoSize = sizeof(vi);
	if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
	switch (vi.dwPlatformId)
	{
	case VER_PLATFORM_WIN32s:
		return "Windows 3.x";
	case VER_PLATFORM_WIN32_WINDOWS:
		return vi.dwMinorVersion == 0 ? "Windows 95" : "Windows 98";
	case VER_PLATFORM_WIN32_NT:
		return "Windows NT";
	default:
		return "Unknown";
	}
}

std::string EnvironmentImpl::osDisplayNameImpl()
{
	OSVERSIONINFO vi;
	vi.dwOSVersionInfoSize = sizeof(vi);
	if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
	switch(vi.dwMajorVersion)
	{
	case 6:
		switch (vi.dwMinorVersion)
		{
		case 0:
			return "Windows Vista/Server 2008";
		case 1:
			return "Windows 7/Server 2008 R2";
		case 2:
			return "Windows 8/Server 2012";
		default:
			return "Unknown";
		}
	case 5:
		switch (vi.dwMinorVersion)
		{
		case 0:
			return "Windows 2000";
		case 1:
			return "Windows XP";
		case 2:
			return "Windows Server 2003/Windows Server 2003 R2";
		default:
			return "Unknown";
		}
	case 4:
		switch (vi.dwMinorVersion)
		{
		case 0:
			return "Windows 95/Windows NT 4.0";
		case 10:
			return "Windows 98";
		case 90:
			return "Windows ME";
		default:
			return "Unknown";
		}
	default:
		return "Unknown";
	}
}

std::string EnvironmentImpl::osVersionImpl()
{
	OSVERSIONINFOW vi;
	vi.dwOSVersionInfoSize = sizeof(vi);
	if (GetVersionExW(&vi) == 0) throw SystemException("Cannot get OS version information");
	std::ostringstream str;
	str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF);
	std::string version;
	UnicodeConverter::toUTF8(vi.szCSDVersion, version);
	if (!version.empty()) str << ": " << version;
	str << ")";
	return str.str();
}

std::string EnvironmentImpl::osArchitectureImpl()
{
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	switch (si.wProcessorArchitecture)
	{
	case PROCESSOR_ARCHITECTURE_INTEL:
		return "IA32";
	case PROCESSOR_ARCHITECTURE_MIPS:
		return "MIPS";
	case PROCESSOR_ARCHITECTURE_ALPHA:
		return "ALPHA";
	case PROCESSOR_ARCHITECTURE_PPC:
		return "PPC";
	case PROCESSOR_ARCHITECTURE_IA64:
		return "IA64";
#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
	case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
		return "IA64/32";
#endif
#ifdef PROCESSOR_ARCHITECTURE_AMD64
	case PROCESSOR_ARCHITECTURE_AMD64:
		return "AMD64";
#endif
	default:
		return "Unknown";
	}
}

std::string EnvironmentImpl::nodeNameImpl()
{
	wchar_t name[MAX_COMPUTERNAME_LENGTH + 1];
	DWORD size = MAX_COMPUTERNAME_LENGTH + 1;
	if (GetComputerNameW(name, &size) == 0) throw SystemException("Cannot get computer name");
	std::string result;
	UnicodeConverter::toUTF8(name, result);
	return result;
}

void EnvironmentImpl::nodeIdImpl(NodeId& id)
{
	std::memset(&id, 0, sizeof(id));

	PIP_ADAPTER_INFO pAdapterInfo;
	PIP_ADAPTER_INFO pAdapter = 0;
	ULONG len    = sizeof(IP_ADAPTER_INFO);
	pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
	// Make an initial call to GetAdaptersInfo to get
	// the necessary size into len
	DWORD rc = GetAdaptersInfo(pAdapterInfo, &len);
	if (rc == ERROR_BUFFER_OVERFLOW)
	{
		delete [] reinterpret_cast<char*>(pAdapterInfo);
		pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
	}
	else if (rc != ERROR_SUCCESS)
	{
		return;
	}
	if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR)
	{
		pAdapter = pAdapterInfo;
		bool found = false;
		while (pAdapter && !found)
		{
			if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id))
			{
				found = true;
				std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength);
			}
			pAdapter = pAdapter->Next;
		}
	}
	delete [] reinterpret_cast<char*>(pAdapterInfo);
}

unsigned EnvironmentImpl::processorCountImpl()
{
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	return si.dwNumberOfProcessors;
}

} // namespace Poco


text:
namespace content {
class BrowserContext;
class JavaScriptDialogManager;
class WebContents;
}

namespace android_webview {

class AwContentsContainer;

// The concrete class implementing this interface is the responsible for
// creating he browser component objects that the Android WebView depends on.
// The motivation for this abstraction is to keep code under
// android_webview/native from holding direct chrome/ layer dependencies.
// Note this is a distinct role to the Webview embedder proper: this class is
// about 'static' environmental decoupling, allowing dependency injection by the
// top-level lib, whereas runtime behavior is controlled by propagated back to
// the embedding application code via WebContentsDelegate and the like.
class AwBrowserDependencyFactory {
 public:
  virtual ~AwBrowserDependencyFactory();

  // Allows the lib executive to inject the delegate instance. Ownership of
  // |delegate| is NOT transferred, but the object must be long-lived.
  static void SetInstance(AwBrowserDependencyFactory* delegate);

  // Returns the singleton instance. |SetInstance| must have been called.
  static AwBrowserDependencyFactory* GetInstance();

  // Returns the current browser context based on the specified mode.
  virtual content::BrowserContext* GetBrowserContext() = 0;

  // Constructs and returns ownership of a WebContents instance.
  virtual content::WebContents* CreateWebContents() = 0;

 protected:
  AwBrowserDependencyFactory();

 private:
  DISALLOW_COPY_AND_ASSIGN(AwBrowserDependencyFactory);
};

}  // namespace android_webview

#endif  // ANDROID_WEBVIEW_AW_BROWSER_DELEGATE_H_


text:
import logging

from twilio.rest import Client

from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _

from awx.main.notifications.base import AWXBaseEmailBackend
from awx.main.notifications.custom_notification_base import CustomNotificationBase

logger = logging.getLogger('awx.main.notifications.twilio_backend')

class TwilioBackend(AWXBaseEmailBackend, CustomNotificationBase):

    init_parameters = {"account_sid": {"label": "Account SID", "type": "string"},
                       "account_token": {"label": "Account Token", "type": "password"},
                       "from_number": {"label": "Source Phone Number", "type": "string"},
                       "to_numbers": {"label": "Destination SMS Numbers", "type": "list"}}
    recipient_parameter = "to_numbers"
    sender_parameter = "from_number"

    def __init__(self, account_sid, account_token, fail_silently=False, **kwargs):
        super(TwilioBackend, self).__init__(fail_silently=fail_silently)
        self.account_sid = account_sid
        self.account_token = account_token

    def send_messages(self, messages):
        sent_messages = 0
        try:
            connection = Client(self.account_sid, self.account_token)
        except Exception as e:
            if not self.fail_silently:
                raise
            logger.error(smart_text(_("Exception connecting to Twilio: {}").format(e)))

        for m in messages:
            try:
                connection.messages.create(
                    to=m.to,
                    from_=m.from_email,
                    body=m.subject)
                sent_messages += 1
            except Exception as e:
                logger.error(smart_text(_("Exception sending messages: {}").format(e)))
                if not self.fail_silently:
                    raise
        return sent_messages


text:
<% include "../common/head" %>

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

没有账号?注册

            <form id="form" class="inputs" action="">

用户名:<input type="text" id="username" name="username">

密   码:<input type="password" id="password" name="password">

                role:<select id="select" name="role">
                        <option  value="0">个人登录</option>
                        <option  value="1">团队登录</option>
                     </select>

            </form>
            <button id="login">登录</button>

<% include "../common/footer" %>


text:
namespace JustBlueberry.Blueberries.Contracts
{
    public interface IRadioactive
    {
        bool HasPowerElectron { get; }

        bool CheckState();

        void ChangeState();
    }
}


text:
namespace Envoy {
namespace Http {
namespace Http1 {

ConnPoolImpl::ConnPoolImpl(Event::Dispatcher& dispatcher, Upstream::HostConstSharedPtr host,
                           Upstream::ResourcePriority priority,
                           const Network::ConnectionSocket::OptionsSharedPtr& options,
                           const Network::TransportSocketOptionsSharedPtr& transport_socket_options)
    : HttpConnPoolImplBase(std::move(host), std::move(priority), dispatcher, options,
                           transport_socket_options, Protocol::Http11),
      upstream_ready_cb_(dispatcher_.createSchedulableCallback([this]() {
        upstream_ready_enabled_ = false;
        onUpstreamReady();
      })) {}

ConnPoolImpl::~ConnPoolImpl() { destructAllConnections(); }

Envoy::ConnectionPool::ActiveClientPtr ConnPoolImpl::instantiateActiveClient() {
  return std::make_unique<ActiveClient>(*this);
}

void ConnPoolImpl::onDownstreamReset(ActiveClient& client) {
  // If we get a downstream reset to an attached client, we just blow it away.
  client.codec_client_->close();
}

void ConnPoolImpl::onResponseComplete(ActiveClient& client) {
  ENVOY_CONN_LOG(debug, "response complete", *client.codec_client_);

  if (!client.stream_wrapper_->encode_complete_) {
    ENVOY_CONN_LOG(debug, "response before request complete", *client.codec_client_);
    onDownstreamReset(client);
  } else if (client.stream_wrapper_->close_connection_ || client.codec_client_->remoteClosed()) {
    ENVOY_CONN_LOG(debug, "saw upstream close connection", *client.codec_client_);
    onDownstreamReset(client);
  } else {
    client.stream_wrapper_.reset();

    if (!pending_streams_.empty() && !upstream_ready_enabled_) {
      upstream_ready_enabled_ = true;
      upstream_ready_cb_->scheduleCallbackCurrentIteration();
    }

    checkForDrained();
  }
}

ConnPoolImpl::StreamWrapper::StreamWrapper(ResponseDecoder& response_decoder, ActiveClient& parent)
    : RequestEncoderWrapper(parent.codec_client_->newStream(*this)),
      ResponseDecoderWrapper(response_decoder), parent_(parent) {

  RequestEncoderWrapper::inner_.getStream().addCallbacks(*this);
}

ConnPoolImpl::StreamWrapper::~StreamWrapper() {
  // Upstream connection might be closed right after response is complete. Setting delay=true
  // here to attach pending requests in next dispatcher loop to handle that case.
  // https://github.com/envoyproxy/envoy/issues/2715
  parent_.parent().onRequestClosed(parent_, true);
}

void ConnPoolImpl::StreamWrapper::onEncodeComplete() { encode_complete_ = true; }

void ConnPoolImpl::StreamWrapper::decodeHeaders(ResponseHeaderMapPtr&& headers, bool end_stream) {
  if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.fixed_connection_close")) {
    close_connection_ =
        HeaderUtility::shouldCloseConnection(parent_.codec_client_->protocol(), *headers);
    if (close_connection_) {
      parent_.parent_.host()->cluster().stats().upstream_cx_close_notify_.inc();
    }
  } else {
    // If Connection: close OR
    //    Http/1.0 and not Connection: keep-alive OR
    //    Proxy-Connection: close
    if ((absl::EqualsIgnoreCase(headers->getConnectionValue(),
                                Headers::get().ConnectionValues.Close)) ||
        (parent_.codec_client_->protocol() == Protocol::Http10 &&
         !absl::EqualsIgnoreCase(headers->getConnectionValue(),
                                 Headers::get().ConnectionValues.KeepAlive)) ||
        (absl::EqualsIgnoreCase(headers->getProxyConnectionValue(),
                                Headers::get().ConnectionValues.Close))) {
      parent_.parent_.host()->cluster().stats().upstream_cx_close_notify_.inc();
      close_connection_ = true;
    }
  }
  ResponseDecoderWrapper::decodeHeaders(std::move(headers), end_stream);
}

void ConnPoolImpl::StreamWrapper::onDecodeComplete() {
  decode_complete_ = encode_complete_;
  parent_.parent().onResponseComplete(parent_);
}

ConnPoolImpl::ActiveClient::ActiveClient(ConnPoolImpl& parent)
    : Envoy::Http::ActiveClient(
          parent, parent.host_->cluster().maxRequestsPerConnection(),
          1 // HTTP1 always has a concurrent-request-limit of 1 per connection.
      ) {
  parent.host_->cluster().stats().upstream_cx_http1_total_.inc();
}

bool ConnPoolImpl::ActiveClient::closingWithIncompleteRequest() const {
  return (stream_wrapper_ != nullptr) && (!stream_wrapper_->decode_complete_);
}

RequestEncoder& ConnPoolImpl::ActiveClient::newStreamEncoder(ResponseDecoder& response_decoder) {
  ASSERT(!stream_wrapper_);
  stream_wrapper_ = std::make_unique<StreamWrapper>(response_decoder, *this);
  return *stream_wrapper_;
}

CodecClientPtr ProdConnPoolImpl::createCodecClient(Upstream::Host::CreateConnectionData& data) {
  CodecClientPtr codec{new CodecClientProd(CodecClient::Type::HTTP1, std::move(data.connection_),
                                           data.host_description_, dispatcher_)};
  return codec;
}

ConnectionPool::InstancePtr
allocateConnPool(Event::Dispatcher& dispatcher, Upstream::HostConstSharedPtr host,
                 Upstream::ResourcePriority priority,
                 const Network::ConnectionSocket::OptionsSharedPtr& options,
                 const Network::TransportSocketOptionsSharedPtr& transport_socket_options) {
  return std::make_unique<Http::Http1::ProdConnPoolImpl>(dispatcher, host, priority, options,
                                                         transport_socket_options);
}

} // namespace Http1
} // namespace Http
} // namespace Envoy


text:
**rawstreamer** is a low latency audio streaming tool that connects to [JACK](http://jackaudio.org/) as the audio source. rawstreamer is written entirely in golang, and uses [go-jack](https://github.com/xthexder/go-jack) and [portaudio-go](https://code.google.com/p/portaudio-go/) for stream input and playback respectively.

rawstreamer is designed to minimize the audio delay from the input source. This means when you hit `Pause` on the audio source, you won't have to wait for 8 seconds of buffer to play before it stops on your local player. Streaming works very well on local networks, as well as over the internet if the bandwidth is available.

rawstreamer implements a custom metadata header at the beginning of the stream to send sample rate and bit depth information, but the header length is matched to be compatible with raw data streaming programs like `sox`.

## `rawstreamer`

### Requirements
- A linux system
- [Jack Audio Connection Kit](http://jackaudio.org/)

### Building
1. `go clone github.com/xthexder/rawstreamer`
2. `cd rawstreamer/streamer`
3. `go get .`
4. `go build rawstreamer.go`

### Usage

The default settings will stream on port `:5253`, 24bit signed-int little-endian PCM, but these can be changed with command line flags. The sample rate specified by JACK will always be used.

To stream all system output, the `-mirror` flag can be used:
`./rawstreamer -mirror system` (where `system` is jack system output port)

To stream a specific program, you can specify the program name with `-proc-name`:
`./rawstreamer -proc-name mplayer` (programs using alsa-plugins only)

To stream a specific jack port name, you can specify it with `-source`:
`./rawstreamer -source PulseAudio`

## `rawplayer`

### Requirements
- [Portaudio](http://www.portaudio.com/)

### Building
1. `go clone github.com/xthexder/rawstreamer`
2. `cd rawstreamer/player`
3. `go get .`
4. `go build rawplayer.go`

### Usage

`./rawplayer hostname:port [buffer-duration]`

Example:
`./rawplayer localhost:5253 50ms`

When connecting to a `rawstreamer` server, the `rawplayer` client will automatically detect the stream sample rate and encoding information, so they do not need to be specified. Depending on the quality of the network between the client and server, you may want to change the buffer size used by the client, but the default `100ms` buffer should work fine over most networks. Increasing the buffer size will reduce buffer underflows, but will increase the audio delay.

The bar displayed by the player shows the current state of the buffer:
`18363 / 24001 [========================================>------------] 76.51 %`
If the buffer empties, then the audio will dropout until the buffer has filled again. This should help you gauge how big your buffer need to be to eliminate dropouts.


text:
<?php
namespace Library\Caching;

class CachedRequest
{
    public $contents;
    public $type;

    public function __construct($contents, $type)
    {
        $this->contents = $contents;
        $this->type = $type;
    }
}
?>


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Tephrocactus coloreus F.Ritter

### Remarks
null


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
    android:background="@drawable/mps">

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Single Player Mode"
        android:id="@+id/btn1"
        android:gravity="center"
        />

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Statistics"

        android:id="@+id/btn2"
        android:layout_below="@+id/btn1"
        android:gravity="center"

        />

</RelativeLayout>