text:
Jenkins API clients generated from Swagger / Open API specification

This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.5.1-pre.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
    For more information, please visit [http://github.com/cliffano/swaggy-jenkins](http://github.com/cliffano/swaggy-jenkins)

## Frameworks supported

- .NET 4.0 or later
- Windows Phone 7.1 (Mango)

## Dependencies

- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later

The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:

```
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
```

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)

## Installation

Run the following command to generate the DLL

- [Mac/Linux] `/bin/sh build.sh`
- [Windows] `build.bat`

Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:

```csharp
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

```

## Packaging

A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.

This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:

```
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj
```

Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.

## Getting Started

```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration.Default.BasePath = "http://localhost";
            // Configure HTTP basic authorization: jenkins_auth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";

            var apiInstance = new BaseApi(Configuration.Default);

            try
            {
                DefaultCrumbIssuer result = apiInstance.GetCrumb();
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling BaseApi.GetCrumb: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}
```

## Documentation for API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BaseApi* | [**GetCrumb**](docs/BaseApi.md#getcrumb) | **GET** /crumbIssuer/api/json |
*BlueOceanApi* | [**DeletePipelineQueueItem**](docs/BlueOceanApi.md#deletepipelinequeueitem) | **DELETE** /blue/rest/organizations/{organization}/pipelines/{pipeline}/queue/{queue} |
*BlueOceanApi* | [**GetAuthenticatedUser**](docs/BlueOceanApi.md#getauthenticateduser) | **GET** /blue/rest/organizations/{organization}/user/ |
*BlueOceanApi* | [**GetClasses**](docs/BlueOceanApi.md#getclasses) | **GET** /blue/rest/classes/{class} |
*BlueOceanApi* | [**GetJsonWebKey**](docs/BlueOceanApi.md#getjsonwebkey) | **GET** /jwt-auth/jwks/{key} |
*BlueOceanApi* | [**GetJsonWebToken**](docs/BlueOceanApi.md#getjsonwebtoken) | **GET** /jwt-auth/token |
*BlueOceanApi* | [**GetOrganisation**](docs/BlueOceanApi.md#getorganisation) | **GET** /blue/rest/organizations/{organization} |
*BlueOceanApi* | [**GetOrganisations**](docs/BlueOceanApi.md#getorganisations) | **GET** /blue/rest/organizations/ |
*BlueOceanApi* | [**GetPipeline**](docs/BlueOceanApi.md#getpipeline) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline} |
*BlueOceanApi* | [**GetPipelineActivities**](docs/BlueOceanApi.md#getpipelineactivities) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/activities |
*BlueOceanApi* | [**GetPipelineBranch**](docs/BlueOceanApi.md#getpipelinebranch) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/branches/{branch}/ |
*BlueOceanApi* | [**GetPipelineBranchRun**](docs/BlueOceanApi.md#getpipelinebranchrun) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/branches/{branch}/runs/{run} |
*BlueOceanApi* | [**GetPipelineBranches**](docs/BlueOceanApi.md#getpipelinebranches) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/branches |
*BlueOceanApi* | [**GetPipelineFolder**](docs/BlueOceanApi.md#getpipelinefolder) | **GET** /blue/rest/organizations/{organization}/pipelines/{folder}/ |
*BlueOceanApi* | [**GetPipelineFolderPipeline**](docs/BlueOceanApi.md#getpipelinefolderpipeline) | **GET** /blue/rest/organizations/{organization}/pipelines/{folder}/pipelines/{pipeline} |
*BlueOceanApi* | [**GetPipelineQueue**](docs/BlueOceanApi.md#getpipelinequeue) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/queue |
*BlueOceanApi* | [**GetPipelineRun**](docs/BlueOceanApi.md#getpipelinerun) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run} |
*BlueOceanApi* | [**GetPipelineRunLog**](docs/BlueOceanApi.md#getpipelinerunlog) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/log |
*BlueOceanApi* | [**GetPipelineRunNode**](docs/BlueOceanApi.md#getpipelinerunnode) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/nodes/{node} |
*BlueOceanApi* | [**GetPipelineRunNodeStep**](docs/BlueOceanApi.md#getpipelinerunnodestep) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step} |
*BlueOceanApi* | [**GetPipelineRunNodeStepLog**](docs/BlueOceanApi.md#getpipelinerunnodesteplog) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}/log |
*BlueOceanApi* | [**GetPipelineRunNodeSteps**](docs/BlueOceanApi.md#getpipelinerunnodesteps) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps |
*BlueOceanApi* | [**GetPipelineRunNodes**](docs/BlueOceanApi.md#getpipelinerunnodes) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/nodes |
*BlueOceanApi* | [**GetPipelineRuns**](docs/BlueOceanApi.md#getpipelineruns) | **GET** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs |
*BlueOceanApi* | [**GetPipelines**](docs/BlueOceanApi.md#getpipelines) | **GET** /blue/rest/organizations/{organization}/pipelines/ |
*BlueOceanApi* | [**GetSCM**](docs/BlueOceanApi.md#getscm) | **GET** /blue/rest/organizations/{organization}/scm/{scm} |
*BlueOceanApi* | [**GetSCMOrganisationRepositories**](docs/BlueOceanApi.md#getscmorganisationrepositories) | **GET** /blue/rest/organizations/{organization}/scm/{scm}/organizations/{scmOrganisation}/repositories |
*BlueOceanApi* | [**GetSCMOrganisationRepository**](docs/BlueOceanApi.md#getscmorganisationrepository) | **GET** /blue/rest/organizations/{organization}/scm/{scm}/organizations/{scmOrganisation}/repositories/{repository} |
*BlueOceanApi* | [**GetSCMOrganisations**](docs/BlueOceanApi.md#getscmorganisations) | **GET** /blue/rest/organizations/{organization}/scm/{scm}/organizations |
*BlueOceanApi* | [**GetUser**](docs/BlueOceanApi.md#getuser) | **GET** /blue/rest/organizations/{organization}/users/{user} |
*BlueOceanApi* | [**GetUserFavorites**](docs/BlueOceanApi.md#getuserfavorites) | **GET** /blue/rest/users/{user}/favorites |
*BlueOceanApi* | [**GetUsers**](docs/BlueOceanApi.md#getusers) | **GET** /blue/rest/organizations/{organization}/users/ |
*BlueOceanApi* | [**PostPipelineRun**](docs/BlueOceanApi.md#postpipelinerun) | **POST** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/replay |
*BlueOceanApi* | [**PostPipelineRuns**](docs/BlueOceanApi.md#postpipelineruns) | **POST** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs |
*BlueOceanApi* | [**PutPipelineFavorite**](docs/BlueOceanApi.md#putpipelinefavorite) | **PUT** /blue/rest/organizations/{organization}/pipelines/{pipeline}/favorite |
*BlueOceanApi* | [**PutPipelineRun**](docs/BlueOceanApi.md#putpipelinerun) | **PUT** /blue/rest/organizations/{organization}/pipelines/{pipeline}/runs/{run}/stop |
*BlueOceanApi* | [**Search**](docs/BlueOceanApi.md#search) | **GET** /blue/rest/search/ |
*BlueOceanApi* | [**SearchClasses**](docs/BlueOceanApi.md#searchclasses) | **GET** /blue/rest/classes/ |
*RemoteAccessApi* | [**GetComputer**](docs/RemoteAccessApi.md#getcomputer) | **GET** /computer/api/json |
*RemoteAccessApi* | [**GetJenkins**](docs/RemoteAccessApi.md#getjenkins) | **GET** /api/json |
*RemoteAccessApi* | [**GetJob**](docs/RemoteAccessApi.md#getjob) | **GET** /job/{name}/api/json |
*RemoteAccessApi* | [**GetJobConfig**](docs/RemoteAccessApi.md#getjobconfig) | **GET** /job/{name}/config.xml |
*RemoteAccessApi* | [**GetJobLastBuild**](docs/RemoteAccessApi.md#getjoblastbuild) | **GET** /job/{name}/lastBuild/api/json |
*RemoteAccessApi* | [**GetJobProgressiveText**](docs/RemoteAccessApi.md#getjobprogressivetext) | **GET** /job/{name}/{number}/logText/progressiveText |
*RemoteAccessApi* | [**GetQueue**](docs/RemoteAccessApi.md#getqueue) | **GET** /queue/api/json |
*RemoteAccessApi* | [**GetQueueItem**](docs/RemoteAccessApi.md#getqueueitem) | **GET** /queue/item/{number}/api/json |
*RemoteAccessApi* | [**GetView**](docs/RemoteAccessApi.md#getview) | **GET** /view/{name}/api/json |
*RemoteAccessApi* | [**GetViewConfig**](docs/RemoteAccessApi.md#getviewconfig) | **GET** /view/{name}/config.xml |
*RemoteAccessApi* | [**HeadJenkins**](docs/RemoteAccessApi.md#headjenkins) | **HEAD** /api/json |
*RemoteAccessApi* | [**PostCreateItem**](docs/RemoteAccessApi.md#postcreateitem) | **POST** /createItem |
*RemoteAccessApi* | [**PostCreateView**](docs/RemoteAccessApi.md#postcreateview) | **POST** /createView |
*RemoteAccessApi* | [**PostJobBuild**](docs/RemoteAccessApi.md#postjobbuild) | **POST** /job/{name}/build |
*RemoteAccessApi* | [**PostJobConfig**](docs/RemoteAccessApi.md#postjobconfig) | **POST** /job/{name}/config.xml |
*RemoteAccessApi* | [**PostJobDelete**](docs/RemoteAccessApi.md#postjobdelete) | **POST** /job/{name}/doDelete |
*RemoteAccessApi* | [**PostJobDisable**](docs/RemoteAccessApi.md#postjobdisable) | **POST** /job/{name}/disable |
*RemoteAccessApi* | [**PostJobEnable**](docs/RemoteAccessApi.md#postjobenable) | **POST** /job/{name}/enable |
*RemoteAccessApi* | [**PostJobLastBuildStop**](docs/RemoteAccessApi.md#postjoblastbuildstop) | **POST** /job/{name}/lastBuild/stop |
*RemoteAccessApi* | [**PostViewConfig**](docs/RemoteAccessApi.md#postviewconfig) | **POST** /view/{name}/config.xml |

## Documentation for Models

 - [Model.AllView](docs/AllView.md)
 - [Model.BranchImpl](docs/BranchImpl.md)
 - [Model.BranchImpllinks](docs/BranchImpllinks.md)
 - [Model.BranchImplpermissions](docs/BranchImplpermissions.md)
 - [Model.CauseAction](docs/CauseAction.md)
 - [Model.CauseUserIdCause](docs/CauseUserIdCause.md)
 - [Model.ClassesByClass](docs/ClassesByClass.md)
 - [Model.ClockDifference](docs/ClockDifference.md)
 - [Model.ComputerSet](docs/ComputerSet.md)
 - [Model.DefaultCrumbIssuer](docs/DefaultCrumbIssuer.md)
 - [Model.DiskSpaceMonitorDescriptorDiskSpace](docs/DiskSpaceMonitorDescriptorDiskSpace.md)
 - [Model.EmptyChangeLogSet](docs/EmptyChangeLogSet.md)
 - [Model.ExtensionClassContainerImpl1](docs/ExtensionClassContainerImpl1.md)
 - [Model.ExtensionClassContainerImpl1links](docs/ExtensionClassContainerImpl1links.md)
 - [Model.ExtensionClassContainerImpl1map](docs/ExtensionClassContainerImpl1map.md)
 - [Model.ExtensionClassImpl](docs/ExtensionClassImpl.md)
 - [Model.ExtensionClassImpllinks](docs/ExtensionClassImpllinks.md)
 - [Model.FavoriteImpl](docs/FavoriteImpl.md)
 - [Model.FavoriteImpllinks](docs/FavoriteImpllinks.md)
 - [Model.FreeStyleBuild](docs/FreeStyleBuild.md)
 - [Model.FreeStyleProject](docs/FreeStyleProject.md)
 - [Model.FreeStyleProjectactions](docs/FreeStyleProjectactions.md)
 - [Model.FreeStyleProjecthealthReport](docs/FreeStyleProjecthealthReport.md)
 - [Model.GenericResource](docs/GenericResource.md)
 - [Model.GithubContent](docs/GithubContent.md)
 - [Model.GithubFile](docs/GithubFile.md)
 - [Model.GithubOrganization](docs/GithubOrganization.md)
 - [Model.GithubOrganizationlinks](docs/GithubOrganizationlinks.md)
 - [Model.GithubRepositories](docs/GithubRepositories.md)
 - [Model.GithubRepositorieslinks](docs/GithubRepositorieslinks.md)
 - [Model.GithubRepository](docs/GithubRepository.md)
 - [Model.GithubRepositorylinks](docs/GithubRepositorylinks.md)
 - [Model.GithubRepositorypermissions](docs/GithubRepositorypermissions.md)
 - [Model.GithubRespositoryContainer](docs/GithubRespositoryContainer.md)
 - [Model.GithubRespositoryContainerlinks](docs/GithubRespositoryContainerlinks.md)
 - [Model.GithubScm](docs/GithubScm.md)
 - [Model.GithubScmlinks](docs/GithubScmlinks.md)
 - [Model.Hudson](docs/Hudson.md)
 - [Model.HudsonMasterComputer](docs/HudsonMasterComputer.md)
 - [Model.HudsonMasterComputerexecutors](docs/HudsonMasterComputerexecutors.md)
 - [Model.HudsonMasterComputermonitorData](docs/HudsonMasterComputermonitorData.md)
 - [Model.HudsonassignedLabels](docs/HudsonassignedLabels.md)
 - [Model.InputStepImpl](docs/InputStepImpl.md)
 - [Model.InputStepImpllinks](docs/InputStepImpllinks.md)
 - [Model.Label1](docs/Label1.md)
 - [Model.Link](docs/Link.md)
 - [Model.ListView](docs/ListView.md)
 - [Model.MultibranchPipeline](docs/MultibranchPipeline.md)
 - [Model.NullSCM](docs/NullSCM.md)
 - [Model.Organisation](docs/Organisation.md)
 - [Model.Pipeline](docs/Pipeline.md)
 - [Model.PipelineActivity](docs/PipelineActivity.md)
 - [Model.PipelineActivityartifacts](docs/PipelineActivityartifacts.md)
 - [Model.PipelineBranchesitem](docs/PipelineBranchesitem.md)
 - [Model.PipelineBranchesitemlatestRun](docs/PipelineBranchesitemlatestRun.md)
 - [Model.PipelineBranchesitempullRequest](docs/PipelineBranchesitempullRequest.md)
 - [Model.PipelineBranchesitempullRequestlinks](docs/PipelineBranchesitempullRequestlinks.md)
 - [Model.PipelineFolderImpl](docs/PipelineFolderImpl.md)
 - [Model.PipelineImpl](docs/PipelineImpl.md)
 - [Model.PipelineImpllinks](docs/PipelineImpllinks.md)
 - [Model.PipelineRun](docs/PipelineRun.md)
 - [Model.PipelineRunImpl](docs/PipelineRunImpl.md)
 - [Model.PipelineRunImpllinks](docs/PipelineRunImpllinks.md)
 - [Model.PipelineRunNode](docs/PipelineRunNode.md)
 - [Model.PipelineRunNodeedges](docs/PipelineRunNodeedges.md)
 - [Model.PipelineRunartifacts](docs/PipelineRunartifacts.md)
 - [Model.PipelineStepImpl](docs/PipelineStepImpl.md)
 - [Model.PipelineStepImpllinks](docs/PipelineStepImpllinks.md)
 - [Model.PipelinelatestRun](docs/PipelinelatestRun.md)
 - [Model.PipelinelatestRunartifacts](docs/PipelinelatestRunartifacts.md)
 - [Model.Queue](docs/Queue.md)
 - [Model.QueueBlockedItem](docs/QueueBlockedItem.md)
 - [Model.QueueItemImpl](docs/QueueItemImpl.md)
 - [Model.QueueLeftItem](docs/QueueLeftItem.md)
 - [Model.ResponseTimeMonitorData](docs/ResponseTimeMonitorData.md)
 - [Model.StringParameterDefinition](docs/StringParameterDefinition.md)
 - [Model.StringParameterValue](docs/StringParameterValue.md)
 - [Model.SwapSpaceMonitorMemoryUsage2](docs/SwapSpaceMonitorMemoryUsage2.md)
 - [Model.UnlabeledLoadStatistics](docs/UnlabeledLoadStatistics.md)
 - [Model.User](docs/User.md)

## Documentation for Authorization

### jenkins_auth

- **Type**: HTTP basic authentication

### jwt_auth

- **Type**: API key

- **API key parameter name**: Authorization
- **Location**: HTTP header


text:
#ifndef GRT_EXCEPTION_HEADER
#define GRT_EXCEPTION_HEADER

#include <iostream>
#include <exception>

namespace GRT {
class Exception : public std::exception
{
public:
    Exception(const std::string error = "") throw() {
        this->error = error;
    }

    virtual ~Exception() throw(){

    }

    virtual const char* what() const throw()
    {
        return error.c_str();
    }

protected:
    std::string error;
};

}

#endif //GRT_EXCEPTION_HEADER

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Nexus\CoreBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use JMS\Serializer\SerializerBuilder;

class APIController extends Controller
{
    public function fightAction()
    {
    	$fight = $this->container->get('nexus_core.fight_manager');
        $fightLog = $this->container->get('nexus_core.fight_logger');
        $char_rep = $this->getDoctrine()->getRepository('NexusCoreBundle:Characters');
        $serializer = $this->get('jms_serializer');

        $data = $fight->launchFight();

        $fightLogs = $fightLog->getLastLog();

        $data['eventLog_HTML'] = $this->renderView(
            'NexusCoreBundle:Core:event.html.twig',
            array('fightLogs' => $fightLogs)
        );

        $json = $serializer->serialize($data, 'json');

        $leaderboard = $char_rep->getLeaderBoard();

        $data['leaderboard_HTML'] = $this->renderView(
            'NexusCoreBundle:Core:leaderboard.html.twig',
            array('leaderboard' => $leaderboard)
        );

        $response = new Response();
        $response->setContent($json);
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }

    public function eventAction()
    {
        $fightLog = $this->container->get('nexus_core.fight_logger');
        $serializer = $this->get('jms_serializer');

        $fightLogs = $fightLog->getLastLog();

        $data['eventLog_HTML'] = $this->renderView(
            'NexusCoreBundle:Core:event.html.twig',
            array('fightLogs' => $fightLogs)
        );
        $json = $serializer->serialize($data, 'json');

        $response = new Response();
        $response->setContent($json);
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }

    public function leaderboardAction()
    {
        $char_rep = $this->getDoctrine()->getRepository('NexusCoreBundle:Characters');
        $serializer = $this->get('jms_serializer');

        $leaderboard = $char_rep->getLeaderBoard();

        $data['leaderboard_HTML'] = $this->renderView(
            'NexusCoreBundle:Core:leaderboard.html.twig',
            array('leaderboard' => $leaderboard)
        );
        $json = $serializer->serialize($data, 'json');

        $response = new Response();
        $response->setContent($json);
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
}


text:
package org.taitasciore.android.hospitalk.close;

import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.dgreenhalgh.android.simpleitemdecoration.linear.DividerItemDecoration;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.taitasciore.android.event.LoadMoreBestRatedHospitalsEvent;
import org.taitasciore.android.event.LoadMoreServicesEvent;
import org.taitasciore.android.event.LoadMoreWorstRatedHospitalsEvent;
import org.taitasciore.android.event.RequestCityEvent;
import org.taitasciore.android.event.RequestLocationEvent;
import org.taitasciore.android.event.SendCityEvent;
import org.taitasciore.android.event.SendLocationEvent;
import org.taitasciore.android.hospitalk.ActivityUtils;
import org.taitasciore.android.hospitalk.R;
import org.taitasciore.android.model.Hospital;
import org.taitasciore.android.model.ServiceResponse;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by roberto on 18/04/17.
 */

public class CloseFragment extends Fragment implements CloseContract.View {

    private double lat;
    private double lon;
    private String mCity = "";
    private int mOffsetBest;
    private int mOffsetWorst;
    private int mOffsetPopular;
    private ArrayList<Hospital> mBestRated;
    private ArrayList<Hospital> mWorstRated;
    private ArrayList<ServiceResponse.Service> mPopularServices;

    private CloseContract.Presenter mPresenter;

    private CloseHospitalAdapter mAdapterBest;
    private CloseHospitalAdapter mAdapterWorst;
    private CloseServiceAdapter mAdapterServices;

    private ProgressDialog mDialog;

    @BindView(R.id.ly1) LinearLayout mLyBest;
    @BindView(R.id.ly2) LinearLayout mLyWorst;
    @BindView(R.id.ly3) LinearLayout mLyPopular;

    private TextView mTvCloseBest;
    private TextView mTvCloseWorst;
    private TextView mTvClosePopular;

    private ImageView mArrowBest;
    private ImageView mArrowWorst;
    private ImageView mArrowPopular;

    private RecyclerView mRecyclerViewBest;
    private RecyclerView mRecyclerViewWorst;
    private RecyclerView mRecyclerViewPopular;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_close, container, false);
        ButterKnife.bind(this, v);
        return v;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (mPresenter == null) mPresenter = new ClosePresenter(this);
        else mPresenter.bindView(this);
    }

    @Override
    public void onDetach() {
        hideProgress();
        super.onDetach();
        if (mPresenter != null) mPresenter.bindView(this);
    }

    @Override
    public void onStart() {
        super.onStart();
        EventBus.getDefault().register(this);
        initListeners();
    }

    @Override
    public void onStop() {
        super.onStop();
        EventBus.getDefault().unregister(this);
        clearListeners();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void getLocation(SendLocationEvent event) {
        lat = event.lat;
        lon = event.lon;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void getCity(SendCityEvent event) {
        mCity = event.city;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void loadMoreBestRatedHospitals(LoadMoreBestRatedHospitalsEvent event) {
        mPresenter.getBestRatedHospitals(mOffsetBest, lat, lon);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void loadMoreWorstRatedHospitals(LoadMoreWorstRatedHospitalsEvent event) {
        mPresenter.getWorstRatedHospitals(mOffsetWorst, lat, lon);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void loadMoreServices(LoadMoreServicesEvent event) {
        mPresenter.getPopularServices(mOffsetPopular, lat, lon);
    }

    @Override
    public void onResume() {
        super.onResume();
        EventBus.getDefault().post(new RequestLocationEvent());
        EventBus.getDefault().post(new RequestCityEvent());

        initViews();
        initRecyclerViews();

        if (mBestRated != null) {
            setBestRatedHospitals(mBestRated);
        }
        if (mWorstRated != null) {
            setWorstRatedHospitals(mWorstRated);
        }
        if (mPopularServices != null) {
            setPopularServices(mPopularServices);
        }
    }

    @Override
    public void bindPresenter(CloseContract.Presenter presenter) {
        mPresenter = presenter;
        mPresenter.bindView(this);
    }

    @Override
    public void showProgress() {
        mDialog = ActivityUtils.showProgressDialog(getActivity());
    }

    @Override
    public void hideProgress() {
        if (mDialog != null && mDialog.isShowing()) mDialog.dismiss();
    }

    @Override
    public void incrementBestRatedOffset() {
        mOffsetBest += ClosePresenter.LIMIT;
    }

    @Override
    public void setBestRatedHospitals(ArrayList<Hospital> list) {
        mBestRated = list;
        mAdapterBest = new CloseHospitalAdapter(
                getActivity(), list, CloseHospitalAdapter.TYPE_BEST_RATED);
        mRecyclerViewBest.setAdapter(mAdapterBest);
    }

    @Override
    public void showBestRatedHospitals() {
        mArrowBest.setImageResource(R.drawable.up_arrow_4);
        mRecyclerViewBest.setAlpha(0f);
        mRecyclerViewBest.setVisibility(View.VISIBLE);
        mRecyclerViewBest.animate().alpha(1f);
    }

    @Override
    public void hideBestRatedHospitals() {
        mArrowBest.setImageResource(R.drawable.down_arrow_4);
        mRecyclerViewBest.setAlpha(1f);
        mRecyclerViewBest.setVisibility(View.GONE);
        mRecyclerViewBest.animate().alpha(0f);
    }

    @Override
    public void incrementWorstRatedOffset() {
        mOffsetWorst += ClosePresenter.LIMIT;
    }

    @Override
    public void setWorstRatedHospitals(ArrayList<Hospital> list) {
        mWorstRated = list;
        mAdapterWorst = new CloseHospitalAdapter(
                getActivity(), list, CloseHospitalAdapter.TYPE_WORST_RATED);
        mRecyclerViewWorst.setAdapter(mAdapterWorst);
    }

    @Override
    public void showWorstRatedHospitals() {
        mArrowWorst.setImageResource(R.drawable.up_arrow_4);
        mRecyclerViewWorst.setAlpha(0f);
        mRecyclerViewWorst.setVisibility(View.VISIBLE);
        mRecyclerViewWorst.animate().alpha(1f);
    }

    @Override
    public void hideWorstRatedHospitals() {
        mArrowWorst.setImageResource(R.drawable.down_arrow_4);
        mRecyclerViewWorst.setAlpha(1f);
        mRecyclerViewWorst.setVisibility(View.GONE);
        mRecyclerViewWorst.animate().alpha(0f);
    }

    @Override
    public void incrementPopularServicesOffset() {
        mOffsetPopular += ClosePresenter.LIMIT;
    }

    @Override
    public void setPopularServices(ArrayList<ServiceResponse.Service> list) {
        mPopularServices = list;
        mAdapterServices = new CloseServiceAdapter(getActivity(), list);
        mRecyclerViewPopular.setAdapter(mAdapterServices);
    }

    @Override
    public void showPopularServices() {
        mArrowPopular.setImageResource(R.drawable.up_arrow_4);
        mRecyclerViewPopular.setAlpha(0f);
        mRecyclerViewPopular.setVisibility(View.VISIBLE);
        mRecyclerViewPopular.animate().alpha(1f);
    }

    @Override
    public void hidePopularServices() {
        mArrowPopular.setImageResource(R.drawable.down_arrow_4);
        mRecyclerViewPopular.setAlpha(1f);
        mRecyclerViewPopular.setVisibility(View.GONE);
        mRecyclerViewPopular.animate().alpha(0f);
    }

    @Override
    public void addBestRatedHospitals(ArrayList<Hospital> hospitals) {
        for (Hospital h : hospitals) mAdapterBest.add(h);
        mBestRated = mAdapterBest.getList();
    }

    @Override
    public void addWorstRatedHospitals(ArrayList<Hospital> hospitals) {
        for (Hospital h : hospitals) mAdapterWorst.add(h);
        mWorstRated = mAdapterWorst.getList();
    }

    @Override
    public void addPopularServices(ArrayList<ServiceResponse.Service> services) {
        for (ServiceResponse.Service s : services) mAdapterServices.add(s);
        mPopularServices = mAdapterServices.getList();
    }

    @Override
    public void showNetworkError() {
        Toast.makeText(getActivity(), getString(R.string.network_error), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void showNetworkFailedError() {
        Toast.makeText(getActivity(),getString(R.string.network_failed_error), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void showNoMoreHospitalsError() {
        Toast.makeText(getActivity(), "No hay hospitales que mostrar", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void showNoMoreServicesError() {
        Toast.makeText(getActivity(), "No hay servicios que mostrar", Toast.LENGTH_SHORT).show();
    }

    private void initViews() {
        initArrows();

        mTvCloseBest = (TextView) mLyBest.findViewById(R.id.tvCerca);
        mTvCloseWorst = (TextView) mLyWorst.findViewById(R.id.tvCerca);
        mTvClosePopular = (TextView) mLyPopular.findViewById(R.id.tvCerca);

        mTvCloseBest.setText("Hospitales mejor valorados cerca de " + mCity);
        mTvCloseWorst.setText("Hospitales peor valorados cerca de " + mCity);
        mTvClosePopular.setText("Servicios más populares cerca de " + mCity);
    }

    private void initArrows() {
        mArrowBest = (ImageView) mLyBest.findViewById(R.id.arrow);
        mArrowWorst = (ImageView) mLyWorst.findViewById(R.id.arrow);
        mArrowPopular = (ImageView) mLyPopular.findViewById(R.id.arrow);
    }

    private void initRecyclerViews() {
        mRecyclerViewBest = (RecyclerView)
                mLyBest.findViewById(R.id.list);
        mRecyclerViewWorst = (RecyclerView)
                mLyWorst.findViewById(R.id.list);
        mRecyclerViewPopular = (RecyclerView)
                mLyPopular.findViewById(R.id.list);
        mRecyclerViewBest.setLayoutManager(new LinearLayoutManager(getActivity()));
        mRecyclerViewWorst.setLayoutManager(new LinearLayoutManager(getActivity()));
        mRecyclerViewPopular.setLayoutManager(new LinearLayoutManager(getActivity()));
        mRecyclerViewBest.setNestedScrollingEnabled(false);
        mRecyclerViewWorst.setNestedScrollingEnabled(false);
        mRecyclerViewPopular.setNestedScrollingEnabled(false);
        Drawable divider = ContextCompat.getDrawable(getActivity(), R.drawable.divider);
        mRecyclerViewBest.addItemDecoration(new DividerItemDecoration(divider));
        mRecyclerViewWorst.addItemDecoration(new DividerItemDecoration(divider));
        mRecyclerViewPopular.addItemDecoration(new DividerItemDecoration(divider));
    }

    private void initListeners() {
        mLyBest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.i("current pos", lat + " - " + lon);

                if (mBestRated == null) {
                    mPresenter.getBestRatedHospitals(mOffsetBest, lat, lon);
                } else if (mRecyclerViewBest.getVisibility() == View.GONE) {
                    showBestRatedHospitals();
                } else {
                    hideBestRatedHospitals();
                }
            }
        });

        mLyWorst.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.i("current pos", lat + " - " + lon);

                if (mWorstRated == null) {
                    mPresenter.getWorstRatedHospitals(mOffsetWorst, lat, lon);
                } else if (mRecyclerViewWorst.getVisibility() == View.GONE) {
                    showWorstRatedHospitals();
                } else {
                    hideWorstRatedHospitals();
                }
            }
        });

        mLyPopular.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.i("current pos", lat + " - " + lon);

                if (mPopularServices == null) {
                    mPresenter.getPopularServices(mOffsetPopular, lat, lon);
                } else if (mRecyclerViewPopular.getVisibility() == View.GONE) {
                    showPopularServices();
                } else {
                    hidePopularServices();
                }
            }
        });
    }

    private void clearListeners() {
        mLyBest.setOnClickListener(null);
        mLyWorst.setOnClickListener(null);
        mLyPopular.setOnClickListener(null);
    }
}


text:
package trace

import (
	"bufio"
	"context"
	"io"
	"net"
	"time"

	"github.com/golang/protobuf/proto"
	"github.com/stripe/veneur/v14/protocol"
	"github.com/stripe/veneur/v14/ssf"
)

// DefaultBackoff defaults to 10 milliseconds of initial wait
// time. Subsequent wait times will add this backoff to the time they
// wait.
const DefaultBackoff = 20 * time.Millisecond

// DefaultMaxBackoff defaults to 1 second. No reconnection attempt
// wait interval will be longer than this.
const DefaultMaxBackoff = 1 * time.Second

// DefaultConnectTimeout is to 10 seconds. Any attempt to (re)connect
// to a veneur will take longer than this. If it would take longer,
// the span is discarded.
const DefaultConnectTimeout = 10 * time.Second

// BufferSize is the default size of the SSF buffer per connection. It
// defaults to enough bytes to accomodate the largest SSF span.
const BufferSize int = int(protocol.MaxSSFPacketLength + protocol.SSFFrameLength)

type backendParams struct {
	addr           net.Addr
	backoff        time.Duration
	maxBackoff     time.Duration
	connectTimeout time.Duration
	bufferSize     uint
}

func (p *backendParams) params() *backendParams {
	return p
}

// ClientBackend represents the ability of a client to transport SSF
// spans to a veneur server.
type ClientBackend interface {
	io.Closer

	// SendSync synchronously sends a span to an upstream
	// veneur.
	//
	// On a networked connection, if it encounters a protocol
	// error in sending, it must loop forever, backing off by
	// n*the backoff interval (until it reaches the maximal
	// backoff interval) and tries to reconnect. If SendSync
	// encounters any non-protocol errors (e.g. in serializing the
	// SSF span), it must return them without reconnecting.
	SendSync(ctx context.Context, span *ssf.SSFSpan) error
}

// FlushableClientBackend represents the ability of a client to flush
// any buffered SSF spans over to a veneur server.
type FlushableClientBackend interface {
	ClientBackend

	// FlushSync causes all (potentially) buffered data to be sent to
	// the upstream veneur.
	FlushSync(ctx context.Context) error
}

// networkBackend is a structure that can send an SSF span to a
// destination over a persistent connection, handling
// reconnections. When encountering connection errors, a
// networkBackend will automatically attempt to reconnect and blocks
// until reconnecting succeeds.
//
// Data loss / resiliency to failure
//
// If a networkBackend encounters an error sending a span, it should
// discard the span and attempt to reconnect. This is intended to make
// the networkBackend resilient against "poison pill" spans, at the
// cost of losing that span if there are connection problems, such as
// veneurs getting restarted.
type networkBackend interface {
	ClientBackend

	params() *backendParams
	connection(net.Conn)
}

// packetBackend represents a UDP connection to a veneur server. It
// does no buffering.
type packetBackend struct {
	backendParams
	conn net.Conn
}

func (s *packetBackend) connection(conn net.Conn) {
	s.conn = conn
}

func (s *packetBackend) Close() error {
	if s.conn == nil {
		return nil
	}
	return s.conn.Close()
}

func (s *packetBackend) SendSync(ctx context.Context, span *ssf.SSFSpan) error {
	if s.conn == nil {
		if err := connect(ctx, s); err != nil {
			return err
		}
	}

	data, err := proto.Marshal(span)
	if err != nil {
		return err
	}
	_, err = s.conn.Write(data)
	return err
}

var _ networkBackend = &packetBackend{}

// streamBackend is a backend for streaming connections.
type streamBackend struct {
	backendParams
	conn   net.Conn
	output io.Writer
	buffer *bufio.Writer
}

func connect(ctx context.Context, s networkBackend) error {
	dialer := net.Dialer{}

	params := s.params()
	backoff := params.backoff
	if backoff == 0 {
		backoff = DefaultBackoff
	}

	maxBackoff := params.maxBackoff
	if maxBackoff == 0 {
		maxBackoff = DefaultMaxBackoff
	}

	connectTimeout := params.connectTimeout
	if connectTimeout == 0 {
		connectTimeout = DefaultConnectTimeout
	}
	ctx, cancel := context.WithTimeout(ctx, connectTimeout)
	defer cancel()

	var wait time.Duration
	var conn net.Conn
	var err error
	for {
		conn, err = dialer.DialContext(ctx, params.addr.Network(), params.addr.String())
		if err == nil {
			break
		}

		if ctx.Err() != nil {
			return ctx.Err()
		}
		select {
		case <-ctx.Done():
			return ctx.Err()
		case <-time.After(wait):
			wait += backoff
			if backoff > maxBackoff {
				wait = maxBackoff
			}
		}
	}
	s.connection(conn)
	return nil
}

func (ds *streamBackend) connection(conn net.Conn) {
	ds.conn = conn
	ds.output = conn
	if ds.bufferSize > 0 {
		ds.buffer = bufio.NewWriterSize(conn, int(ds.bufferSize))
		ds.output = ds.buffer
	}
}

// SendSync on a streamBackend attempts to write the packet on the
// connection to the upstream veneur directly. If it encounters a
// protocol error, SendSync will return the original protocol error once
// the connection is re-established.
func (ds *streamBackend) SendSync(ctx context.Context, span *ssf.SSFSpan) error {
	if ds.conn == nil {
		if err := connect(ctx, ds); err != nil {
			return err
		}
	}
	_, err := protocol.WriteSSF(ds.output, span)
	if err != nil {
		if protocol.IsFramingError(err) {
			_ = ds.conn.Close()
			ds.conn = nil
		}
	}
	return err
}

func (ds *streamBackend) Close() error {
	if ds.conn == nil {
		return nil
	}
	return ds.conn.Close()
}

// FlushSync on a streamBackend flushes the buffer if one exists. If the
// connection was disconnected prior to flushing, FlushSync re-establishes
// it and discards the buffer.
func (ds *streamBackend) FlushSync(ctx context.Context) error {
	if ds.buffer == nil {
		return nil
	}
	if ds.conn == nil {
		if err := connect(ctx, ds); err != nil {
			return err
		}
	}
	err := ds.buffer.Flush()
	if err != nil {
		// buffer is poisoned, and we have no idea if the
		// connection is still valid. We better reconnect.
		_ = ds.conn.Close()
		ds.conn = nil
	}
	return err
}

var _ networkBackend = &streamBackend{}


text:
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

/**
 * Why base-58 instead of standard base-64 encoding?
 * - Don't want 0OIl characters that look the same in some fonts and
 *      could be used to create visually identical looking data.
 * - A string with non-alphanumeric characters is not as easily accepted as input.
 * - E-mail usually won't line-break if there's no punctuation to break at.
 * - Double-clicking selects the whole string as one word if it's all alphanumeric.
 */
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H

#include "chainparams.h"
#include "key.h"
#include "pubkey.h"
#include "script/script.h"
#include "script/standard.h"
#include "support/allocators/zeroafterfree.h"
#include "zcash/Address.hpp"

#include <string>
#include <vector>

/**
 * Encode a byte sequence as a base58-encoded string.
 * pbegin and pend cannot be NULL, unless both are.
 */
std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend);

/**
 * Encode a byte vector as a base58-encoded string
 */
std::string EncodeBase58(const std::vector<unsigned char>& vch);

/**
 * Decode a base58-encoded string (psz) into a byte vector (vchRet).
 * return true if decoding is successful.
 * psz cannot be NULL.
 */
bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet);

/**
 * Decode a base58-encoded string (str) into a byte vector (vchRet).
 * return true if decoding is successful.
 */
bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet);

/**
 * Encode a byte vector into a base58-encoded string, including checksum
 */
std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);

/**
 * Decode a base58-encoded string (psz) that includes a checksum into a byte
 * vector (vchRet), return true if decoding is successful
 */
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);

/**
 * Decode a base58-encoded string (str) that includes a checksum into a byte
 * vector (vchRet), return true if decoding is successful
 */
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);

/**
 * Base class for all base58-encoded data
 */
class CBase58Data
{
protected:
    //! the version byte(s)
    std::vector<unsigned char> vchVersion;

    //! the actually encoded data
    typedef std::vector<unsigned char, zero_after_free_allocator<unsigned char> > vector_uchar;
    vector_uchar vchData;

    CBase58Data();
    void SetData(const std::vector<unsigned char> &vchVersionIn, const void* pdata, size_t nSize);
    void SetData(const std::vector<unsigned char> &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend);

public:
    bool SetString(const char* psz, unsigned int nVersionBytes);
    bool SetString(const std::string& str, unsigned int nVersionBytes);
    std::string ToString() const;
    int CompareTo(const CBase58Data& b58) const;

    bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; }
    bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; }
    bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; }
    bool operator< (const CBase58Data& b58) const { return CompareTo(b58) <  0; }
    bool operator> (const CBase58Data& b58) const { return CompareTo(b58) >  0; }
};

class CZCPaymentAddress : public CBase58Data {
public:
    bool Set(const libzcash::PaymentAddress& addr);
    CZCPaymentAddress() {}

    CZCPaymentAddress(const std::string& strAddress) { SetString(strAddress.c_str(), 2); }
    CZCPaymentAddress(const libzcash::PaymentAddress& addr) { Set(addr); }

    libzcash::PaymentAddress Get() const;
};

class CZCSpendingKey : public CBase58Data {
public:
    bool Set(const libzcash::SpendingKey& addr);
    CZCSpendingKey() {}

    CZCSpendingKey(const std::string& strAddress) { SetString(strAddress.c_str(), 2); }
    CZCSpendingKey(const libzcash::SpendingKey& addr) { Set(addr); }

    libzcash::SpendingKey Get() const;
};

/** base58-encoded Bitcoin addresses.
 * Public-key-hash-addresses have version 0 (or 111 testnet).
 * The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
 * Script-hash-addresses have version 5 (or 196 testnet).
 * The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
 */
class CBitcoinAddress : public CBase58Data {
public:
    bool Set(const CKeyID &id);
    bool Set(const CScriptID &id);
    bool Set(const CTxDestination &dest);
    bool IsValid() const;
    bool IsValid(const CChainParams &params) const;
    bool SetString(const char* pszSecret);
    bool SetString(const std::string& strSecret);

    CBitcoinAddress() {}
    CBitcoinAddress(const CTxDestination &dest) { Set(dest); }
    CBitcoinAddress(const std::string& strAddress) { SetString(strAddress); }
    CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); }

    CTxDestination Get() const;
    bool GetKeyID(CKeyID &keyID) const;
    bool IsScript() const;
};

/**
 * A base58-encoded secret key
 */
class CBitcoinSecret : public CBase58Data
{
public:
    void SetKey(const CKey& vchSecret);
    CKey GetKey();
    bool IsValid() const;
    bool SetString(const char* pszSecret);
    bool SetString(const std::string& strSecret);

    CBitcoinSecret(const CKey& vchSecret) { SetKey(vchSecret); }
    CBitcoinSecret() {}
};

template<typename K, int Size, CChainParams::Base58Type Type> class CBitcoinExtKeyBase : public CBase58Data
{
public:
    void SetKey(const K &key) {
        unsigned char vch[Size];
        key.Encode(vch);
        SetData(Params().Base58Prefix(Type), vch, vch+Size);
    }

    K GetKey() {
        K ret;
        ret.Decode(&vchData[0], &vchData[Size]);
        return ret;
    }

    CBitcoinExtKeyBase(const K &key) {
        SetKey(key);
    }

    CBitcoinExtKeyBase() {}
};

typedef CBitcoinExtKeyBase<CExtKey, 74, CChainParams::EXT_SECRET_KEY> CBitcoinExtKey;
typedef CBitcoinExtKeyBase<CExtPubKey, 74, CChainParams::EXT_PUBLIC_KEY> CBitcoinExtPubKey;

#endif // BITCOIN_BASE58_H


text:
using GSF.ASN1;
using GSF.ASN1.Attributes;
using GSF.ASN1.Attributes.Constraints;
using GSF.ASN1.Coders;
using GSF.ASN1.Types;

namespace GSF.MMS.Model
{

    [ASN1PreparedElement]
    [ASN1Sequence(Name = "StatusResponse", IsSet = false)]
    public class StatusResponse : IASN1PreparedElement
    {
        private static readonly IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(StatusResponse));
        private BitString localDetail_;

        private bool localDetail_present;
        private long vmdLogicalStatus_;

        private long vmdPhysicalStatus_;

        [ASN1Integer(Name = "")]
        [ASN1Element(Name = "vmdLogicalStatus", IsOptional = false, HasTag = true, Tag = 0, HasDefaultValue = false)]
        public long VmdLogicalStatus
        {
            get
            {
                return vmdLogicalStatus_;
            }
            set
            {
                vmdLogicalStatus_ = value;
            }
        }

        [ASN1Integer(Name = "")]
        [ASN1Element(Name = "vmdPhysicalStatus", IsOptional = false, HasTag = true, Tag = 1, HasDefaultValue = false)]
        public long VmdPhysicalStatus
        {
            get
            {
                return vmdPhysicalStatus_;
            }
            set
            {
                vmdPhysicalStatus_ = value;
            }
        }

        [ASN1BitString(Name = "")]
        [ASN1ValueRangeConstraint(
            Min = 0L,
            Max = 128L
            )]
        [ASN1Element(Name = "localDetail", IsOptional = true, HasTag = true, Tag = 2, HasDefaultValue = false)]
        public BitString LocalDetail
        {
            get
            {
                return localDetail_;
            }
            set
            {
                localDetail_ = value;
                localDetail_present = true;
            }
        }

        public void initWithDefaults()
        {
        }

        public IASN1PreparedElementData PreparedData
        {
            get
            {
                return preparedData;
            }
        }

        public bool isLocalDetailPresent()
        {
            return localDetail_present;
        }
    }
}


text:
package org.jpc.internal.gc;

import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;

public class CleanablePhantomReference<T> extends PhantomReference<T> implements Cleanable {

	private final Runnable cleaningTask; //a cleaning task to be executed when the referent is garbage collected.

	public CleanablePhantomReference(T referent, ReferenceQueue<? super T> q, Runnable cleaningTask) {
		super(referent, q);
		this.cleaningTask = cleaningTask;
	}

	/**
	 * Callback method that should be invoked when the referenced object has been garbage collected.
	 */
	@Override
	public void cleanUp() {
		if(cleaningTask != null)
			cleaningTask.run();
	}
}


text:
namespace ALS {
	namespace TSAP {
		namespace PROV {
			// Forward declarations.--------------------------
			class TSAP;
			class TSAP_AKWAIT;
			class TSAP_CLOSED;
			class TSAP_CLOSING;
			class TSAP_CLOSING_BOC;
			class TSAP_CLOSING_BOC_WR;
			class TSAP_CLOSING_R;
			class TSAP_CLOSING_WR;
			class TSAP_ERROR;
			class TSAP_OPEN;
			class TSAP_OPEN_R;
			class TSAP_OPEN_WR;
			class TSAP_REFWAIT;
			class TSAP_WBCL;
			class TSAP_WBCL_R;
			class TSAP_WBCL_WR;
			class TSAP_WBOC;
			class TSAP_WBOC_WR;
			class TSAP_WFCC;
			class TSAP_WFCC_R;
			class TSAP_WFNC;
			class TSAP_WFNC_R;
			class TSAP_WFTRESP;
			class TSAP_WFTRESP_WR;
			class TSAP_Default;
			class ProviderState;
			class FSM;
			class Provider;

			// ProviderState.---------------------------------
			class ProviderState : public statemap::State {
			public:
				ProviderState(const char *name, int no) : statemap::State(name, no) {};

				virtual void Entry(FSM&) {};
				virtual void Exit(FSM&) {};
				virtual void AK(FSM& context);
				virtual void CC(FSM& context);
				virtual void CR(FSM& context);
				virtual void DC(FSM& context);
				virtual void DR(FSM& context);
				virtual void DT(FSM& context);
				virtual void DT(FSM& context, shared_ptr<Buffer>& tsdu);
				virtual void EA(FSM& context);
				virtual void ED(FSM& context);
				virtual void ER(FSM& context);
				virtual void NCONconf(FSM& context);
				virtual void NCONconf(FSM& context, Buffer* tdsu);
				virtual void NDISind(FSM& context);
				virtual void NRSTind(FSM& context);
				virtual void RJ(FSM& context);
				virtual void TCONreq(FSM& context);
				virtual void TCONreq(FSM& context, TPDU::CR& tsdu);
				virtual void TCONresp(FSM& context);
				virtual void TCONresp(FSM& context, TPDU::CC& tsdu);
				virtual void TDISreq(FSM& context);
				virtual void TDISreq(FSM& context, TPDU::DR& tsdu);
				virtual void TDTreq(FSM& context);
				virtual void TDTreq(FSM& context, TPDU::DT& tsdu);
				virtual void TEXreq(FSM& context);
			protected:
				virtual void Default(FSM& context);
			};

			// FSM map class.---------------------------------
			class TSAP {
			public:
				static TSAP_AKWAIT AKWAIT;
				static TSAP_CLOSED CLOSED;
				static TSAP_CLOSING CLOSING;
				static TSAP_CLOSING_BOC CLOSING_BOC;
				static TSAP_CLOSING_BOC_WR CLOSING_BOC_WR;
				static TSAP_CLOSING_R CLOSING_R;
				static TSAP_CLOSING_WR CLOSING_WR;
				static TSAP_ERROR ERROR;
				static TSAP_OPEN OPEN;
				static TSAP_OPEN_R OPEN_R;
				static TSAP_OPEN_WR OPEN_WR;
				static TSAP_REFWAIT REFWAIT;
				static TSAP_WBCL WBCL;
				static TSAP_WBCL_R WBCL_R;
				static TSAP_WBCL_WR WBCL_WR;
				static TSAP_WBOC WBOC;
				static TSAP_WBOC_WR WBOC_WR;
				static TSAP_WFCC WFCC;
				static TSAP_WFCC_R WFCC_R;
				static TSAP_WFNC WFNC;
				static TSAP_WFNC_R WFNC_R;
				static TSAP_WFTRESP WFTRESP;
				static TSAP_WFTRESP_WR WFTRESP_WR;
			};

			// FSM map default state class.-------------------
			class TSAP_Default : public ProviderState {
			public:
				TSAP_Default (const char *name, int stateId) : ProviderState(name, stateId)	{}
			};

			// FSM map states class.--------------------------
			// --------------------------------------------------
			class TSAP_AKWAIT:  public TSAP_Default {
			public:
				TSAP_AKWAIT(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_CLOSED:  public TSAP_Default {
			public:
				TSAP_CLOSED(const char* name, int no) : TSAP_Default(name, no) {}
				void TCONreq(FSM& context);
				void TCONreq(FSM& context, TPDU::CR& tsdu);
				void CR(FSM& context);
				void DR(FSM& context);
				void DC(FSM& context);
				void CC(FSM& context);
				void AK(FSM& context);
				void EA(FSM& context);
				void ED(FSM& context);
				void DT(FSM& context);
				void ER(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_CLOSING:  public TSAP_Default {
			public:
				TSAP_CLOSING(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_CLOSING_BOC:  public TSAP_Default {
			public:
				TSAP_CLOSING_BOC(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_CLOSING_BOC_WR:  public TSAP_Default {
			public:
				TSAP_CLOSING_BOC_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_CLOSING_R:  public TSAP_Default {
			public:
				TSAP_CLOSING_R(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_CLOSING_WR:  public TSAP_Default {
			public:
				TSAP_CLOSING_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_ERROR:  public TSAP_Default {
			public:
				TSAP_ERROR(const char* name, int no) : TSAP_Default(name, no) {}
				void TCONreq(FSM& context);
				void TCONresp(FSM& context);
				void TDTreq(FSM& context);
				void TEXreq(FSM& context);
				void TDISreq(FSM& context);
				void NDISind(FSM& context);
				void NCONconf(FSM& context);
				void NRSTind(FSM& context);
				void CR(FSM& context);
				void CC(FSM& context);
				void DR(FSM& context);
				void DC(FSM& context);
				void AK(FSM& context);
				void EA(FSM& context);
				void DT(FSM& context);
				void ED(FSM& context);
				void ER(FSM& context);
				void RJ(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_OPEN:  public TSAP_Default {
			public:
				TSAP_OPEN(const char* name, int no) : TSAP_Default(name, no) {}
				void TDTreq(FSM& context, TPDU::DT& tsdu);
				void TDISreq(FSM& context);
				void TDISreq(FSM& context, TPDU::DR& tsdu);
				void NRSTind(FSM& context);
				void NDISind(FSM& context);
				void CR(FSM& context);
				void DT(FSM& context, shared_ptr<Buffer>& tsdu);
				void DR(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_OPEN_R:  public TSAP_Default {
			public:
				TSAP_OPEN_R(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_OPEN_WR:  public TSAP_Default {
			public:
				TSAP_OPEN_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_REFWAIT:  public TSAP_Default {
			public:
				TSAP_REFWAIT(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WBCL:  public TSAP_Default {
			public:
				TSAP_WBCL(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WBCL_R:  public TSAP_Default {
			public:
				TSAP_WBCL_R(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WBCL_WR:  public TSAP_Default {
			public:
				TSAP_WBCL_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WBOC:  public TSAP_Default {
			public:
				TSAP_WBOC(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WBOC_WR:  public TSAP_Default {
			public:
				TSAP_WBOC_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WFCC:  public TSAP_Default {
			public:
				TSAP_WFCC(const char* name, int no) : TSAP_Default(name, no) {}
				void TDISreq(FSM& context);
				void NRSTind(FSM& context);
				void NDISind(FSM& context);
				void DR(FSM& context);
				void CC(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_WFCC_R:  public TSAP_Default {
			public:
				TSAP_WFCC_R(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WFNC:  public TSAP_Default {
			public:
				TSAP_WFNC(const char* name, int no) : TSAP_Default(name, no) {}
				void TDISreq(FSM& context);
				void NCONconf(FSM& context, Buffer* tdsu);
				void NDISind(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_WFNC_R:  public TSAP_Default {
			public:
				TSAP_WFNC_R(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// --------------------------------------------------
			class TSAP_WFTRESP:  public TSAP_Default {
			public:
				TSAP_WFTRESP(const char* name, int no) : TSAP_Default(name, no) {}
				void TCONresp(FSM& context, TPDU::CC& tsdu);
				void TDISreq(FSM& context, TPDU::DR& tsdu);
				void NRSTind(FSM& context);
				void NDISind(FSM& context);
				void CR(FSM& context);
				void DR(FSM& context);
			};

			// --------------------------------------------------
			class TSAP_WFTRESP_WR:  public TSAP_Default {
			public:
				TSAP_WFTRESP_WR(const char* name, int no) : TSAP_Default(name, no) {}
			};

			// FSM context class -----------------------------
			class FSM : public statemap::FSMContext {
			public:
				FSM(Provider& owner) : FSMContext(TSAP::CLOSED), _owner(owner) {};
				FSM(Provider& owner, const statemap::State& state) : FSMContext(state), _owner(owner) {};
				virtual void enterStartState() {
				    getState().Entry(*this);
				    return;
				}
				Provider& getOwner() const {
				    return (_owner);
				};
				ProviderState& getState() const {
				    if (_state == nullptr) {
				        throw statemap::StateUndefinedException();
				    }
				     return (dynamic_cast<ProviderState&>(*_state));
				};
				void AK() {
				     (getState()).AK(*this);
				};
				void CC() {
				     (getState()).CC(*this);
				};
				void CR() {
				     (getState()).CR(*this);
				};
				void DC() {
				     (getState()).DC(*this);
				};
				void DR() {
				     (getState()).DR(*this);
				};
				void DT() {
				     (getState()).DT(*this);
				};
				void DT(shared_ptr<Buffer>& tsdu) {
				     (getState()).DT(*this, tsdu);
				};
				void EA() {
				     (getState()).EA(*this);
				};
				void ED() {
				     (getState()).ED(*this);
				};
				void ER() {
				     (getState()).ER(*this);
				};
				void NCONconf() {
				     (getState()).NCONconf(*this);
				};
				void NCONconf(Buffer* tdsu) {
				     (getState()).NCONconf(*this, tdsu);
				};
				void NDISind() {
				     (getState()).NDISind(*this);
				};
				void NRSTind() {
				     (getState()).NRSTind(*this);
				};
				void RJ() {
				     (getState()).RJ(*this);
				};
				void TCONreq() {
				     (getState()).TCONreq(*this);
				};
				void TCONreq(TPDU::CR& tsdu) {
				     (getState()).TCONreq(*this, tsdu);
				};
				void TCONresp() {
				     (getState()).TCONresp(*this);
				};
				void TCONresp(TPDU::CC& tsdu) {
				     (getState()).TCONresp(*this, tsdu);
				};
				void TDISreq() {
				     (getState()).TDISreq(*this);
				};
				void TDISreq(TPDU::DR& tsdu) {
				     (getState()).TDISreq(*this, tsdu);
				};
				void TDTreq() {
				     (getState()).TDTreq(*this);
				};
				void TDTreq(TPDU::DT& tsdu) {
				     (getState()).TDTreq(*this, tsdu);
				};
				void TEXreq() {
				     (getState()).TEXreq(*this);
				};
			private:
			    Provider& _owner;
			};
		}
	}
}
#endif


text:
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../lib'))

if File.exist?(File.join(lib_dir, 'daemons.rb'))
  $LOAD_PATH.unshift lib_dir
else
  begin; require 'rubygems'; rescue ::Exception; end
end

require 'daemons'

Daemons.run_proc('myscript') do
  loop do
    file = File.open('/tmp/myscript.log', 'a')
    file.write(Random.rand)   # breaks without seeding
    # file.write(Random.new.rand)  # works without seeding
    # file.write(rand) # also works, but this is Kernel.rand() so its different
    file.write("\n")
    file.close
    sleep 2
  end
end


text:
<q-grid header="{{::$details.title}}" rows="$ctrl.rows">
	<q-grid:columns generation="deep"></q-grid:columns>
	<q-grid:toolbar>
		<q-grid:template for="right">
			<q-grid:column-chooser>
			</q-grid:column-chooser>
		</q-grid:template>
		<q-grid:template for="left">
			<q-grid:visibility>
			</q-grid:visibility>
		</q-grid:template>
	</q-grid:toolbar>

	<q-grid:visibility toolbar.left="true"
							 toolbar.right="true"
							 toolbar.top="true"
							 toolbar.bottom="true">
	</q-grid:visibility>
</q-grid>


text:
require 'test_helper'

class CourseplanTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


text:
<resources>
    <string name="app_name">Task manager</string>

    <!--Activity Task list-->
    <string name="title_list_task">Task list:</string>
    <string name="btn_new_task">New task</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_task_register">Task register</string>

    <!--Activity Task list-->
    <string name="lb_title">Title</string>
    <string name="lb_description">Description</string>
    <string name="lb_location">Location</string>
    <string name="btn_search_location">Search</string>
    <string name="btn_due_date">Due date</string>
    <string name="btn_save_task">Save task</string>
</resources>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('extended_app', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='extimage',
            name='file_ptr',
            field=models.OneToOneField(primary_key=True, serialize=False, related_name='extended_app_extimage_file', parent_link=True, to='filer.File'),
        ),
    ]


text:
This is a draft of an icon library. In the current state, these are *not approved* for ML projects.

#Instructions
Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures.

To use the generated font in desktop programs, you can install the TTF font. In order to copy
the character associated with each icon, refer to the text box at the bottom right corner of each
glyph in demo.html. The character inside this text box may be invisible; but it can still be copied.

You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via
Main Menu > Manage Projects) to retrieve your icon selection.

To use in a website, include the font files and update your CSS to include the glyphs' classes.
Review *style.css* to see the classs you would need. You won't need any of the files located
under the *demo-files* directory when including the generated font in your own projects.


text:
package com.redman.client.data.mapper;

import com.redman.client.data.model.UserEntity;
import com.redman.client.data.security.ConvertIntToLong;
import com.redman.client.data.security.ConvertLongToInt;
import com.redman.client.data.security.ModelConverter;
import com.redman.client.data.security.ModelDTOMapper;
import com.redman.client.data.dto.UserDTO;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;

import static java.util.stream.Collectors.toList;

public class UserMapper {

	public static Logger LOGGER = LoggerFactory.getLogger(UserMapper.class);

    public static List<UserDTO> mapEntitiesIntoDTOs(List<UserEntity> entities) {
        return entities.stream()
                .map(UserMapper::mapEntityIntoDTO)
                .collect(toList());
    }

    public static UserEntity mapDTOIntoEntity(UserDTO dto, UserEntity entity) {
    	entity.setLogin(dto.getLogin());
    	entity.setPassword(dto.getPassword());
    	//entity.setQuota(dto.getQuota());
    	ModelDTOMapper.writeDtoFieldToEntity(dto, "quota", entity, "quota", new ConvertLongToInt());
    	entity.setEnabled(dto.getEnabled());
    	return entity;
    }

    public static UserEntity mapDTOIntoEntity(UserDTO dto) {
    	return mapDTOIntoEntity(dto, new UserEntity());
    }

    public static UserDTO mapEntityIntoDTO(UserEntity entity) {
    	// Model is null, no entry found in the database
    	if (entity == null) {
    		return null;
    	}

    	UserDTO dto = new UserDTO();

    	dto.setLogin(entity.getLogin());

    	dto.setPassword(entity.getPassword());
    	// mapValue(entity, dto, "password");

    	//dto.setQuota(entity.getQuota());
    	ModelDTOMapper.readEntityFieldToDto(dto, "quota", entity, "quota", new ConvertIntToLong());

    	// dto.setEnabled(entity.getEnabled());
    	ModelDTOMapper.readEntityFieldToDto(dto, entity, "enabled");
        return dto;
    }

    public static Page<UserDTO> mapEntityPageIntoDTOPage(Pageable page, Page<UserEntity> source) {
        List<UserDTO> dtos = mapEntitiesIntoDTOs(source.getContent());
        return new PageImpl<>(dtos, page, source.getTotalElements());
    }
}


text:
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace FalconSharp.Models
{
    public class Content
    {
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("network")]
        public string Network { get; set; }

        [JsonProperty("message")]
        public string Message { get; set; }

        [JsonProperty("type")]
        public ContentType Type { get; set; }

        [JsonProperty("publicationDate")]
        public DateTime PublicationDate { get; set; }

        [JsonProperty("href")]
        public string Href { get; set; }

        [JsonProperty("channel")]
        public ChannelSummary Channel { get; set; }

        [JsonProperty("stats")]
        public ContentStats Stats { get; set; }

        [JsonProperty("falcon")]
        public UserSummary Falcon { get; set; }

        [JsonProperty("tags")]
        public IEnumerable<string> Tags { get; set; }

        [JsonProperty("createdDate")]
        public DateTime CreatedDate { get; set; }

        [JsonProperty("picture")]
        public string Picture { get; set; }

        [JsonProperty("link")]
        public string Link { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Parmelia olivetorum var. esorediata Vain.

### Remarks
null


text:
// ==========================================================================
//                        DG.GuideConfigurationView
//
//  Implements a modal dialog used to configure the Guide menu in the tool shelf
//
//  Authors:  William Finzer
//
//  Copyright ©2014 Concord Consortium
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// ==========================================================================

/** @class

  Implements a modal dialog used to configure the Guide menu in the tool shelf

 @extends SC.PalettePane
 */
DG.GuideConfigurationView = SC.PalettePane.extend(
  /** @scope DG.GuideConfigurationView.prototype */ {

    itemRow: SC.View.extend({
      blurAction: null,
      blurTarget: null,
      childViews: 'itemTitle itemURL'.w(),
        itemTitle: SC.TextFieldView.design({
          hint: 'DG.GuideConfigView.itemTitleHint'
        }),
        itemURL: SC.TextFieldView.design({
          hint: 'DG.GuideConfigView.itemURLHint'
        }),
      init: function() {
        sc_super();
        var tBlurAction = this.get('blurAction' ),
            tBlurTarget = this.get('blurTarget');
        this.setPath( 'itemTitle.layout', { left: 5, width: 140 });
        this.setPath( 'itemURL.layout', { left: 150, right: 5 });
        this.get('childViews' ).forEach( function( iView) {
          iView.set('fieldDidBlur', function() {
            if( tBlurAction)
              tBlurAction.call( tBlurTarget);
          });
        });
      },
      rowObject: function() {
        var tTitle = this.getPath('itemTitle.value' ),
            tURL = this.getPath('itemURL.value' );
        if(!SC.empty(tTitle) || !SC.empty( tURL)) {
          return { itemTitle: tTitle, url: tURL};
        }
        return null;
      }.property(),

      /**
       *
       * @param iItem {Object {itemTitle: {String} url: {String}}
       */
      setItem: function( iItem) {
        if( iItem) {
          this.setPath('itemTitle.value', iItem.itemTitle);
          this.setPath('itemURL.value', iItem.url);
        }
      }
    }),

    model: null,

    isModal: YES,

    layout: { width: 400, height: 400, centerX: 0, centerY: 0 },

    contentView: SC.View.extend( {
      childViews: 'titleField menuItems okButton cancel warning'.w(),
      titleField: SC.TextFieldView.design( {
        layout: { top: 5, left: 5, right: 25, height: 24 },
        value: '',
        spellCheckEnabled: true,
        hint: 'DG.GuideConfigView.titleHint',
        leftAccessoryView: SC.LabelView.create( {
          layout: { left: 1, width: 95, height: 22, centerY: 0 },
          value: 'DG.GuideConfigView.titlePrompt',  // "Guide Title"
          backgroundColor: 'lightgray',
          localize: true
        } )
      } ),
      menuItems: SC.View.design( {
        layout: { left: 5, right: 5, top: 34, bottom: 34 },
        backgroundColor: 'white'
      } ),
      okButton: SC.ButtonView.design( {
        layout: { bottom: 5, right: 5, height: 24, width: 90 },
        titleMinWidth: 0,
        title: 'DG.GuideConfigView.okBtnTitle', // "OK"
        toolTip: 'DG.GuideConfigView.okBtnToolTip',
        target: null,
        action: null,
        localize: true,
        isDefault: true
      } ),
      cancel: SC.ButtonView.design( {
        layout: { bottom: 5, right: 115, height: 24, width: 90 },
        titleMinWidth: 0,
        title: 'DG.GuideConfigView.cancelBtnTitle',  // "Cancel"
        target: null,
        action: null,
        toolTip: 'DG.GuideConfigView.cancelBtnTooltip',  // "Dismiss the dialog without making any changes"
        localize: true,
        isCancel: true
      } ),
      warning: SC.LabelView.design( {
        value: 'DG.GuideConfigView.httpWarning',  // "The URL must start with either http:// or https://"
        classNames: 'dg-guide-alert',
        isVisible: false,
        transitionShow: SC.View.FADE_IN,
        localize: true
      } )
    } ),

    title: function() {
      return this.getPath('contentView.titleField.value');
    }.property(),

    items: function() {
      return this.get('rowObjects');
    }.property(),

    addMenuItemRow: function( iItem) {
      var tMenuItemsView = this.getPath('contentView.menuItems' ),
          tNumRows = this.get('rowViews' ).length,
          tTop = 5 + tNumRows * 27,
          tSection = this.itemRow.create({
            layout: { border: 1, left: 5, right: 5, top: tTop + 5, height: 22 },
            blurAction: this.configureRows,
            blurTarget: this
          });
      tSection.setItem( iItem);
      tMenuItemsView.appendChild( tSection);
    },

    rowViews: function() {
      return this.getPath('contentView.menuItems.childViews' );
    }.property(),

    rowObjects: function() {
      return this.get('rowViews' )
        .map( function( iRowView) {
                return iRowView.get('rowObject');
              } )
        .filter( function( iObject) {
                  return !!iObject;
                });
    }.property(),

    configureRows: function() {

      var checkURLs = function() {
        var tRowObjects = this.get('rowObjects'),
            tWarning = this.getPath('contentView.warning'),
            tTitleLayout = this.getPath('contentView.titleField.layout');
        tWarning.set('isVisible', false);
        tRowObjects.forEach( function( iObject, iIndex) {
          var tUrl = SC.empty(iObject.url) ? '' : iObject.url.toLowerCase();
          if( !SC.empty( tUrl) && (tUrl.indexOf('http://') !== 0) && (tUrl.indexOf('https://') !== 0)) {
            var tItemLayout = this.get('rowViews')[iIndex].get('layout'),
                tItemViewBottom = tTitleLayout.top + tTitleLayout.height + tItemLayout.top + tItemLayout.height - 3;
            tWarning.set('layout', { left: 160, top: tItemViewBottom, height: 12 });
            tWarning.set('isVisible', true);
          }
        }.bind( this));
      }.bind( this);

      var tNumRowViews = this.get('rowViews' ).length,
          tNumRowObjects = this.get('rowObjects').length;

      checkURLs();

      while( tNumRowViews < tNumRowObjects + 1) {
        this.addMenuItemRow();
        tNumRowViews++;
      }
    },

    /**
     *
     * @param iModel {DG.GuideModel}
     */
    setupFromModel: function( iModel) {
      var tModel = this.get('model');
      this.setPath('contentView.titleField.value', tModel.get('title'));
      tModel.get('items' ).forEach( function( iItem) {
        this.addMenuItemRow( iItem);
      }.bind( this));
    },

    /**
     Initialization function.
     */
    init: function () {
      sc_super();
      this.setPath( 'contentView.cancel.target', this );
      this.setPath( 'contentView.cancel.action', 'close' );
      this.setupFromModel();
      this.configureRows();
    },

    /**
     Close the dialog.
     */
    close: function () {
      this.remove();
      this.destroy();
    }
  } );

DG.CreateGuideConfigurationView = function ( iProperties ) {
  var tDialog = DG.GuideConfigurationView.create( iProperties ),
      tContentView = tDialog.get('contentView' ),
      tEditView = tDialog.getPath( 'contentView.titleField' );

  tContentView.setPath('okButton.target', iProperties.okTarget);
  tContentView.setPath('okButton.action', iProperties.okAction);
  tDialog.append();
  tEditView.becomeFirstResponder();

  return tDialog;
};


text:
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        ('home', '0005_auto_20151125_0607'),
    ]

    operations = [
        migrations.AlterField(
            model_name='profilepublication',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True),
        ),
    ]


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>404 – Amy Kotas</title>
  <meta name="description" content="I'm Amy. I build websites.">
  <meta name="author" content="Amy Kotas">

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

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link href="https://fonts.googleapis.com/css?family=Karla:400,400i,700" rel="stylesheet">

  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/skeleton.css">
  <link rel="stylesheet" href="css/animate.css">
  <link rel="stylesheet" href="css/custom.css">

  <link rel="icon" type="image/png" href="img/favicon.png">

Home

About

Work

Contact

404

Sorry

We can't find the page you're looking for.

It may have expired, or there could be a typo. Maybe you can find what you need from our homepage.

          Return to the Homepage

Need a site built? Get in touch!

        Contact Me

Design & code by Amy Kotas.   © 2017


text:
<?php

namespace Sample\Controller;

use Blueprint\Controller\Controller;
use Sample\View;

/**
 * CssTest class.
 *
 * @extends Controller
 */
class CssTest extends Controller {

    /**
     * __construct function.
     *
     * @access public
     * @return void
     */
    public function __construct() {

        $this->view = new View\Index();

    }

    /**
     * setContainer function.
     *
     * @access public
     * @param mixed $container
     * @return void
     */
    public function setContainer($container) {

        parent::setContainer($container);

        $this->view->setContainer($this->container);

        $this->page = $this->container->get('page');
        $this->page->h1 = 'Title 01 Heading';

    }

    /**
     * indexAction function.
     *
     * @access public
     * @return void
     */
    public function indexAction() {

        echo $this->view->render("lipsum.php");

    }

}


text:
package io.hekate.spring.boot;

import io.hekate.cluster.event.ClusterEvent;
import io.hekate.cluster.event.ClusterEventType;
import io.hekate.cluster.event.ClusterJoinEvent;
import io.hekate.cluster.event.ClusterLeaveEvent;
import io.hekate.codec.CodecFactory;
import io.hekate.codec.CodecService;
import io.hekate.core.Hekate;
import io.hekate.core.HekateFatalErrorPolicy;
import io.hekate.core.service.Service;
import io.hekate.core.service.ServiceFactory;
import io.hekate.network.NetworkService;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import static java.util.Collections.synchronizedList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

public class HekateConfigurerTest extends HekateAutoConfigurerTestBase {
    @Configuration
    @EnableAutoConfiguration
    public static class DefaultTestConfig extends HekateTestConfigBase {
        @Component
        public static class TestClusterListener {
            private final List<ClusterEvent> events = synchronizedList(new ArrayList<>());

            @EventListener
            public void onJoin(ClusterJoinEvent evt) {
                events.add(evt);
            }

            @EventListener
            public void onLeave(ClusterLeaveEvent evt) {
                events.add(evt);
            }
        }

        @Component
        public static class TestLifecycleListener implements Hekate.LifecycleListener {
            private final List<Hekate.State> states = synchronizedList(new ArrayList<>());

            @Override
            public void onStateChanged(Hekate changed) {
                states.add(changed.state());
            }
        }

        @Autowired
        private Hekate node;

        @Autowired
        private CodecService codecService;

        @Autowired
        private NetworkService networkService;
    }

    @Configuration
    @EnableAutoConfiguration
    public static class NoAnnotationTestConfig {
        @Autowired(required = false)
        private Hekate node;
    }

    @EnableHekate
    @Configuration
    @EnableAutoConfiguration
    public static class DisableTestConfig {
        @Autowired
        private Optional<Hekate> node;
    }

    @Test
    public void testDefault() {
        registerAndRefresh(new String[]{
            "hekate.node-name=test-node",
            "hekate.roles=role1,role2",
            "hekate.properties.prop1=test1",
            "hekate.properties[long.prop2]=test2"
        }, DefaultTestConfig.class);

        Hekate node = getNode();

        assertNotNull(node);
        assertSame(Hekate.State.UP, node.state());

        assertEquals("test-node", node.localNode().name());
        assertEquals(toSet("role1", "role2"), node.localNode().roles());
        assertEquals(2, node.localNode().properties().size());
        assertEquals("test1", node.localNode().property("prop1"));
        assertEquals("test2", node.localNode().property("long.prop2"));

        DefaultTestConfig app = get(DefaultTestConfig.class);

        assertNotNull(app.node);
        assertNotNull(app.codecService);
        assertNotNull(app.networkService);

        DefaultTestConfig.TestClusterListener clusterListener = get(DefaultTestConfig.TestClusterListener.class);
        DefaultTestConfig.TestLifecycleListener lifecycleListener = get(DefaultTestConfig.TestLifecycleListener.class);

        getContext().close();

        assertEquals(2, clusterListener.events.size());
        assertSame(ClusterEventType.JOIN, clusterListener.events.get(0).type());
        assertSame(ClusterEventType.LEAVE, clusterListener.events.get(1).type());

        assertEquals(lifecycleListener.states.toString(), 8, lifecycleListener.states.size());
        assertSame(Hekate.State.INITIALIZING, lifecycleListener.states.get(0));
        assertSame(Hekate.State.INITIALIZED, lifecycleListener.states.get(1));
        assertSame(Hekate.State.JOINING, lifecycleListener.states.get(2));
        assertSame(Hekate.State.SYNCHRONIZING, lifecycleListener.states.get(3));
        assertSame(Hekate.State.UP, lifecycleListener.states.get(4));
        assertSame(Hekate.State.LEAVING, lifecycleListener.states.get(5));
        assertSame(Hekate.State.TERMINATING, lifecycleListener.states.get(6));
        assertSame(Hekate.State.DOWN, lifecycleListener.states.get(7));
    }

    @Test
    public void testNoAnnotation() {
        registerAndRefresh(NoAnnotationTestConfig.class);

        assertTrue(getContext().getBeansOfType(Hekate.class).isEmpty());
        assertTrue(getContext().getBeansOfType(ServiceFactory.class).isEmpty());
        assertTrue(getContext().getBeansOfType(Service.class).isEmpty());
        assertTrue(getContext().getBeansOfType(CodecFactory.class).isEmpty());

        assertNull(get(NoAnnotationTestConfig.class).node);
    }

    @Test
    public void testDisabled() {
        registerAndRefresh(new String[]{"hekate.enable=false"}, DisableTestConfig.class);

        assertTrue(getContext().getBeansOfType(Hekate.class).isEmpty());
        assertTrue(getContext().getBeansOfType(ServiceFactory.class).isEmpty());
        assertTrue(getContext().getBeansOfType(Service.class).isEmpty());
        assertTrue(getContext().getBeansOfType(CodecFactory.class).isEmpty());

        assertFalse(get(DisableTestConfig.class).node.isPresent());
    }

    @Test
    public void testFatalErrorPolicyRejoin() {
        registerAndRefresh(new String[]{"hekate.on-fatal-error=rejoin"}, DefaultTestConfig.class);

        assertEquals(HekateFatalErrorPolicy.rejoin().getClass(), get(HekateFatalErrorPolicy.class).getClass());
    }

    @Test
    public void testFatalErrorPolicyTerminate() {
        registerAndRefresh(new String[]{"hekate.on-fatal-error=terminate"}, DefaultTestConfig.class);

        assertEquals(HekateFatalErrorPolicy.terminate().getClass(), get(HekateFatalErrorPolicy.class).getClass());
    }

    @Test
    public void testFatalErrorPolicyExitJvm() {
        registerAndRefresh(new String[]{"hekate.on-fatal-error=exit-jvm"}, DefaultTestConfig.class);

        assertEquals(HekateFatalErrorPolicy.exitJvm().getClass(), get(HekateFatalErrorPolicy.class).getClass());
    }
}


text: Clear All


text:
set (TARGET_NAME sqlite3)
set (ROOT_DIR "${SLIB_PATH}/external/src/sqlite")

set (
 SRC_LIST
 "${ROOT_DIR}/sqlite3.c"
)

include ("${CMAKE_CURRENT_LIST_DIR}/common.inc.cmake")


text:
<?php
/* @var $this AlmabCustomersController */
/* @var $model AlmabCustomers */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

		<?php echo $form->label($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>

		<?php echo $form->label($model,'descr'); ?>
		<?php echo $form->textField($model,'descr',array('size'=>60,'maxlength'=>255)); ?>

		<?php echo $form->label($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>100)); ?>

		<?php echo $form->label($model,'guid'); ?>
		<?php echo $form->textField($model,'guid',array('size'=>50,'maxlength'=>50)); ?>

		<?php echo $form->label($model,'updatefrom'); ?>
		<?php echo $form->textField($model,'updatefrom'); ?>

		<?php echo $form->label($model,'updateto'); ?>
		<?php echo $form->textField($model,'updateto'); ?>

		<?php echo $form->label($model,'dbserial'); ?>
		<?php echo $form->textField($model,'dbserial',array('size'=>50,'maxlength'=>50)); ?>

		<?php echo $form->label($model,'iscustom'); ?>
		<?php echo $form->checkbox($model,'iscustom'); ?>

		<?php echo CHtml::submitButton('Search'); ?>

<?php $this->endWidget(); ?>