text:
copyright:
  years: 2016,2017
lastupdated: "2017-04-27"
---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}

# Introduzione a Compose for etcd
{: #getting-started-with-compose-for-etcd}

etcd è un archivio di valore-chiave che ospita i dati sempre corretti di cui hai bisogno per coordinare e gestire il tuo cluster server per la gestione della configurazione del server distribuito. etcd utilizza l'algoritmo coseno RAFT per assicurare la consistenza dei dati nel tuo cluster. Forza l'ordine in cui vengono eseguite le operazioni sui dati in modo che ogni nodo nel cluster arrivi allo stesso risultato con la stessa modalità. {{site.data.keyword.composeForEtcd_full}} aggiunge backup automatici dei tuoi dati di configurazione archiviati in etcd. Un'interfaccia di amministrazione intuitiva che ti permette di monitorare, ridimensionare e gestire la tua distribuzione con facilità.
{:shortdesc}

**Nota:** tutte le istanze del servizio Compose di cui è stato eseguito il provisioning prima del 14 settembre 2016 che sono ancora attive e che possono ancora essere utilizzate a cui si può fare direttamente accesso da [https://www.compose.com/](https://www.compose.com). È possibile accedere direttamente a tutte le istanze del servizio Compose di cui è stato eseguito il provisioning da questo punto in avanti ed è possibile utilizzarle nel tuo account Bluemix.

Completa questa procedura per iniziare ad utilizzare {{site.data.keyword.composeForEtcd}}.

1. [Crea un'istanza {{site.data.keyword.composeForEtcd}}](https://console.ng.bluemix.net/catalog/services/compose-for-etcd/).

  Quando crei un'istanza del servizio, assicurati di scegliere un nome per il tuo servizio e un nome per la credenziale. Lascia il servizio senza bind; puoi collegare un'applicazione al tuo servizio successivamente utilizzando le credenziali fornite quando è stato eseguito il provisioning del servizio. I vari valori delle credenziali sono elencati nella sezione *Credenziali disponibili*.

2. Collega il tuo servizio {{site.data.keyword.composeForEtcd}}.

Per collegare un'applicazione al tuo servizio, utilizza le [credenziali](./credentials.html) create insieme al servizio. L'applicazione di esempio illustra come utilizzare Node.js per il collegamento a un servizio {{site.data.keyword.composeForEtcd}}.

Scarica l'applicazione di esempio [compose-etcd-helloworld-nodejs](https://github.com/IBM-Bluemix/compose-etcd-helloworld-nodejs) e segui le istruzioni nel file readme. In seguito, nella pagina dei dettagli della tua applicazione in Bluemix, fai clic su **Visualizza applicazione** per visualizzare il contenuto degli *esempi*.


text:
@font-face {
	font-family: 'icomoon';
	src: url('../fonts/icomoon.eot?iss94');
	src: url('../fonts/icomoon.eot?#iefixiss94') format('embedded-opentype'),
		url('../fonts/icomoon.ttf?iss94') format('truetype'),
		url('../fonts/icomoon.woff?iss94') format('woff'),
		url('../fonts/icomoon.svg?iss94#icomoon') format('svg');
	font-weight: normal;
	font-style: normal;
}

.icon-accordion, .icon-routeplan, .icon-imprint, .icon-licenses {
	font-family: 'icomoon';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	/* Better Font Rendering =========== */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.accordion-navigation .icon-accordion {
	line-height: inherit;
}

.accordion-navigation .icon-accordion:before {
	content: "\e600";
}

.accordion-navigation.active .icon-accordion:before {
	content: "\e601";
}

redpajama_set_name: RedPajamaGithub


text:
package ru.ming13.gambit.util;

public final class Loaders
{
	private Loaders() {
	}

	public static final int DECKS = 1;
	public static final int CARDS = 2;
}


text:
package org.pebble.core.encoding.longs.datastructures;

import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.longs.Long2ReferenceMap;
import it.unimi.dsi.fastutil.longs.Long2ReferenceOpenHashMap;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import it.unimi.dsi.fastutil.longs.LongList;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.pebble.UnitTest;
import org.pebble.core.encoding.Helper;

import static junit.framework.TestCase.assertEquals;

@Category(UnitTest.class)
public class InvertedListLongReferenceListsIndexRemoveListFromListsInvertedIndexTest {

    @Test
    public void whenIndexHavePreviousIndexedListsItShouldRemoveListFromIndexAsExpected() {
        final Long2ReferenceMap<IntList> expectedListsInvertedIndex = new Long2ReferenceOpenHashMap<IntList>() {{
            put(2L, new IntArrayList(new int[] {2}));
            put(3L, new IntArrayList(new int[] {0}));
            put(5L, new IntArrayList(new int[] {0, 2}));
            put(9L, new IntArrayList(new int[] {2}));
        }};
        final InvertedListLongReferenceListsIndex listsIndex = new InvertedListLongReferenceListsIndex() {{
            listsInvertedIndex.put(1L, new IntArrayList(new int[] {1}));
            listsInvertedIndex.put(2L, new IntArrayList(new int[] {2}));
            listsInvertedIndex.put(3L, new IntArrayList(new int[] {0, 1}));
            listsInvertedIndex.put(4L, new IntArrayList(new int[] {1}));
            listsInvertedIndex.put(5L, new IntArrayList(new int[] {0, 1, 2}));
            listsInvertedIndex.put(8L, new IntArrayList(new int[] {1}));
            listsInvertedIndex.put(9L, new IntArrayList() {{ add(2); }});
        }};
        final int index = 1;
        final LongList list = new LongArrayList(new long[] {1L, 3L, 4L, 5L, 8L});

        listsIndex.removeListFromListsInvertedIndex(index, list);

        assertEquals(
            Helper.<Long, Long2ReferenceMap<IntList>>translateToUtilsCollection(expectedListsInvertedIndex),
            Helper.<Long, Long2ReferenceMap<IntList>>translateToUtilsCollection(listsIndex.listsInvertedIndex)
        );
    }

}


text:
What people say about us

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
                                        incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                        nostrud exercitation ullamcoquat. Duis aute irure d olor in reprehenderit

Jonna Hike

                                        CEO, Themeforest

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
                                        incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                        nostrud exercitation ullamcoquat. Duis aute irure d olor in reprehenderit

Jonna Hike

                                        CEO, Themeforest


text: window.fitText(document.getElementById('owner-and-repo'), 1);


text:
Paperclip::Attachment.class_eval {
  @default_options = self.default_options.merge({
    :url => "/data/:class/:attachment/:hash_prefix/:id-:hash",
    :hash_data => ":class/:attachment/:id/:filename/:style",
    :hash_secret => "oJqDNFLYmaRb4CEqfodA3pbLhTtQF9PV2hMt8xBAXWQAf"
  })
}

Paperclip.interpolates :hash_prefix do |attachment, style|
  attachment.hash_key(style)[0,2]
end

# Paperclip doesn't correctly recognize XLS spreadsheets created by
# Spreadsheet. See https://github.com/zdavatz/spreadsheet/issues/97
Paperclip.options[:content_type_mappings] = {
    :xls => "CDF V2 Document, No summary info"
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package user;

import bean.User;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jdbc.JDBCUtility;
import static user.registerServlet.isNullorEqual;

/**
 *
 * @author Lili Madiha
 */
@WebServlet(name = "LoginServlet", urlPatterns = {"/LoginServlet"})
public class LoginServlet extends HttpServlet {

    private JDBCUtility jdbcUtility;
    private Connection con;

    public void init() throws ServletException
    {
        String driver = "com.mysql.jdbc.Driver";

        String dbName = "etourism";
        String url = "jdbc:mysql://localhost/" + dbName + "?";
        String userName = "root";
        String password = "";

        jdbcUtility = new JDBCUtility(driver,
                                      url,
                                      userName,
                                      password);

        jdbcUtility.jdbcConnect();
        try {
             jdbcUtility.prepareSQLStatement();
         } catch (SQLException ex) {
             Logger.getLogger(registerServlet.class.getName()).log(Level.SEVERE, null, ex);
         }
        con = jdbcUtility.jdbcGetConnection();
    }

    /**
     * Processes requests for both HTTP GET and POST
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        User user = null;

        //Get the session object
        HttpSession session = request.getSession(true);

        String username = request.getParameter("username");
        String password = request.getParameter("password");
        int userType = 2;
        int scs = 0;
        ResultSet rs = null;
        String dbPassword = "";
        String dbUsername = "";
        Boolean result = isNullorEqual(new String[] {username, password});
  //      Boolean userExists = false;

        if ( result ) {
            session = request.getSession(true);

            session.setAttribute("scs", "Please Enter All fields");
            response.sendRedirect("login.jsp");

            return;
        }

        try {
                PreparedStatement preparedStatement = jdbcUtility.psSelectUserExists();
                preparedStatement.setString(1, username);
                rs = preparedStatement.executeQuery();
                int uT = 2;
                    if ( rs.next() == false) {
                        session = request.getSession(true);

                        session.setAttribute("scs", "User does not exists");
                        response.sendRedirect("login.jsp");
                        return;
                    } else {
                        dbPassword = rs.getString("password");

                        dbUsername = rs.getString("username");
     //                   userExists = true;

                        if ( !password.equals(dbPassword)) {
                            session = request.getSession(true);

                            session.setAttribute("scs", "Username or Password Problem");
                            response.sendRedirect("login.jsp");
                            return;
                        } else {
                            uT = Integer.parseInt(rs.getString("userType"));
                        }

                    }

                while (rs.next())
                {
                    dbPassword = rs.getString("password");

                    dbUsername = rs.getString("username");
 //                   userExists = true;

                    if ( !password.equals(dbPassword)) {
                        session = request.getSession(true);

                        session.setAttribute("scs", "Username or Password Problem");
                        response.sendRedirect("login.jsp");
                        return;
                    } else {
                        uT = Integer.parseInt(rs.getString("userType"));
                        System.out.println("nIUhgasfhgishfkhskfhjshf Nizul Zaim");
                    }
                }

                userType = uT;

            }
            catch (SQLException ex)
            {
                while (ex != null)
                {
                    System.out.println ("SQLState: " +
                                         ex.getSQLState ());
                    System.out.println ("Message:  " +
                                         ex.getMessage ());
                    System.out.println ("Vendor:   " +
                                         ex.getErrorCode ());
                    ex = ex.getNextException ();
                    System.out.println ("");
                }

                session = request.getSession(true);

                session.setAttribute("scs", "Error when try to login");
                response.sendRedirect("login.jsp");
                return;
            }
            catch (java.lang.Exception ex)
            {
                ex.printStackTrace ();
            }
//           finally {
//                if (userExists) {
//                    HttpSession session = request.getSession(true);
//
//                    session.setAttribute("scs", "Username Already Exists");
//                    response.sendRedirect("register.jsp");
//                }
//
//            }

        session.setAttribute("username", username);
        session.setAttribute("userType", userType);

        if ( userType == 1 ) {
            response.sendRedirect(request.getContextPath() + "/admin/");
        } else {
            response.sendRedirect(request.getContextPath() + "/user/");
        }

    }

    public static boolean isNullorEqual(String... strArr) {
        for ( String st : strArr ) {
            if (st==null || st.equals("")) {
                return true;
            }

        }
        return false;
    }
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP GET method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP POST method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.web.clientproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/clientside-project/1">
            <name>Hdx-ebola-crisis-page-graph</name>
        </data>
    </configuration>
</project>


text:
/*
 *
 * ReserveList reducer
 *
 */

import { fromJS } from 'immutable';
import {
  DEFAULT_ACTION,
  LOAD_LIST,
  SET_RESERVE_LIST,
  CANCEL_RESERVE,
  AUTHORIZATION_RESERVE,
  DELETE_RESERVE_DB,
  PRINT_VOUCHER,
} from './constants';

const initialState = fromJS({
  preReserve:[],
  request:{
    'cancelID':0,
    'AprovedID':0,
    'DeleteID':0
  }
});
function reserveListReducer(state = initialState, action) {
  switch (action.type) {
    case DEFAULT_ACTION:
      return state;
    case LOAD_LIST:
      return state;
    case SET_RESERVE_LIST:
      return state.setIn(['preReserve'],action.data.PreBookings)
    case CANCEL_RESERVE:
      return state.setIn(['request','cancelID'],action.data)
    case AUTHORIZATION_RESERVE:
      return state.setIn(['request','AprovedID'],action.data)
    case DELETE_RESERVE_DB:
      return state.setIn(['request','DeleteID'],action.data)
    case PRINT_VOUCHER:
      return state.setIn(['request','AprovedID'],action.data)
    default:
      return state;
  }
}

export default reserveListReducer;


text:
extern block_t *bl_new(GLenum mode);
extern void bl_free(block_t *block);
extern void bl_draw(block_t *block);
extern void bl_q2t(block_t *block);
extern void bl_end(block_t *block);

extern void bl_vertex3f(block_t *block, GLfloat x, GLfloat y, GLfloat z);
extern void bl_track_color(block_t *block);
extern void bl_track_normal(block_t *block);
extern void bl_track_tex(block_t *block, GLenum target);
extern void bl_pollute(block_t *block);

extern void bl_push_call(block_t *block, packed_call_t *data);

#endif


text:
module Virgola
  module HelperMethods
    def people_csv
      File.read('spec/fixtures/people.csv')
    end

    def people_contact_infos_csv
      File.read('spec/fixtures/people_contact_infos.csv')
    end

    def people_has_manies_csv
      File.read('spec/fixtures/people_has_manies.csv')
    end

    def developer_csv
      File.read('spec/fixtures/developer.csv')
    end
  end
end


text:
Use #openDialog to open an instance of ourselves for selection from the user.
The user will either
	1) close the window (treated like a cancel)
	2) press cancel
	3) press okay

If window closed via close button or user selected cancel, and if there is a parentDialog defined, we send the #noServerSelected to that parentDialog.

If the window closed by the okay button and if there is a parent dialog defined, we send #useValuesFromServer:port: to that parent dialog.

In all cases our window is closed when we leave here.


text:
Activr.configure do |config|
  # skip duplicates with a one hour window
  config.skip_dup_period = 3600
end


text:
package com.linkedin.metadata.search.elasticsearch.indexbuilder;

import com.linkedin.metadata.models.EntitySpec;
import com.linkedin.metadata.models.registry.EntityRegistry;
import com.linkedin.metadata.utils.elasticsearch.IndexConvention;
import java.io.IOException;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class EntityIndexBuilders {
  private final ESIndexBuilder indexBuilder;
  private final EntityRegistry entityRegistry;
  private final IndexConvention indexConvention;
  private final SettingsBuilder settingsBuilder;

  public void buildAll() {
    for (EntitySpec entitySpec : entityRegistry.getEntitySpecs().values()) {
      try {
        new EntityIndexBuilder(indexBuilder, entitySpec, settingsBuilder,
            indexConvention.getIndexName(entitySpec)).buildIndex();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
}


text:
ovh-sdk
=======

OVH SDK written in PHP


text:
using System;

public class GreaterNumber
{
    private static void Main(string[] args)
    {
        // Console.WriteLine("Enter two integers: ");
        var num1 = int.Parse(Console.ReadLine());
        var num2 = int.Parse(Console.ReadLine());

        // Console.Write("Greater number: ");
        if (num1 > num2)
        {
            Console.WriteLine(num1);
        }
        else
        {
            Console.WriteLine(num2);
        }
    }
}


text:
package Paws::S3::HeadObject;
  use Moose;
  has Bucket => (is => 'ro', isa => 'Str', uri_name => 'Bucket', traits => ['ParamInURI'], required => 1);
  has IfMatch => (is => 'ro', isa => 'Str', header_name => 'If-Match', traits => ['ParamInHeader']);
  has IfModifiedSince => (is => 'ro', isa => 'Str', header_name => 'If-Modified-Since', traits => ['ParamInHeader']);
  has IfNoneMatch => (is => 'ro', isa => 'Str', header_name => 'If-None-Match', traits => ['ParamInHeader']);
  has IfUnmodifiedSince => (is => 'ro', isa => 'Str', header_name => 'If-Unmodified-Since', traits => ['ParamInHeader']);
  has Key => (is => 'ro', isa => 'Str', uri_name => 'Key', traits => ['ParamInURI'], required => 1);
  has PartNumber => (is => 'ro', isa => 'Int', query_name => 'partNumber', traits => ['ParamInQuery']);
  has Range => (is => 'ro', isa => 'Str', header_name => 'Range', traits => ['ParamInHeader']);
  has RequestPayer => (is => 'ro', isa => 'Str', header_name => 'x-amz-request-payer', traits => ['ParamInHeader']);
  has SSECustomerAlgorithm => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-algorithm', traits => ['ParamInHeader']);
  has SSECustomerKey => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-key', traits => ['ParamInHeader']);
  has SSECustomerKeyMD5 => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-key-MD5', traits => ['ParamInHeader']);
  has VersionId => (is => 'ro', isa => 'Str', query_name => 'versionId', traits => ['ParamInQuery']);

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'HeadObject');
  class_has _api_uri  => (isa => 'Str', is => 'ro', default => '/{Bucket}/{Key+}');
  class_has _api_method  => (isa => 'Str', is => 'ro', default => 'HEAD');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::S3::HeadObjectOutput');
  class_has _result_key => (isa => 'Str', is => 'ro');

1;

### main pod documentation begin ###

=head1 NAME

Paws::S3::HeadObject - Arguments for method HeadObject on Paws::S3

=head1 DESCRIPTION

This class represents the parameters used for calling the method HeadObject on the
Amazon Simple Storage Service service. Use the attributes of this class
as arguments to method HeadObject.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to HeadObject.

As an example:

  $service_obj->HeadObject(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> Bucket => Str

=head2 IfMatch => Str

Return the object only if its entity tag (ETag) is the same as the one
specified, otherwise return a 412 (precondition failed).

=head2 IfModifiedSince => Str

Return the object only if it has been modified since the specified
time, otherwise return a 304 (not modified).

=head2 IfNoneMatch => Str

Return the object only if its entity tag (ETag) is different from the
one specified, otherwise return a 304 (not modified).

=head2 IfUnmodifiedSince => Str

Return the object only if it has not been modified since the specified
time, otherwise return a 412 (precondition failed).

=head2 B<REQUIRED> Key => Str

=head2 PartNumber => Int

Part number of the object being read. This is a positive integer
between 1 and 10,000. Effectively performs a 'ranged' HEAD request for
the part specified. Useful querying about the size of the part and the
number of parts in this object.

=head2 Range => Str

Downloads the specified range bytes of an object. For more information
about the HTTP Range header, go to
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

=head2 RequestPayer => Str

Valid values are: C<"requester">

=head2 SSECustomerAlgorithm => Str

Specifies the algorithm to use to when encrypting the object (e.g.,
AES256).

=head2 SSECustomerKey => Str

Specifies the customer-provided encryption key for Amazon S3 to use in
encrypting data. This value is used to store the object and then it is
discarded; Amazon does not store the encryption key. The key must be
appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm header.

=head2 SSECustomerKeyMD5 => Str

Specifies the 128-bit MD5 digest of the encryption key according to RFC
1321. Amazon S3 uses this header for a message integrity check to
ensure the encryption key was transmitted without error.

=head2 VersionId => Str

VersionId used to reference a specific version of the object.

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method HeadObject in L<Paws::S3>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
using Carbon.Json;
using Carbon.Net.Dns;
using Xunit;

namespace Carbon.Platform.Hosting.Tests
{
    public class DomainTests
    {
        [Fact]
		public void A()
		{
            var domain = new Domain(
                id      : 1,
                name    : "processor.ai",
                ownerId : 1,
                flags   : DomainFlags.Managed | DomainFlags.Authoritative
            );

            var flags = DomainFlags.Managed | DomainFlags.Authoritative;

            Assert.Equal(1,                   domain.Id);
            Assert.Equal("ai/processor",      domain.Path);
            Assert.Equal("processor.ai",      domain.Name);
            Assert.Equal(1,                   domain.OwnerId);
            Assert.Equal(flags,               domain.Flags);
        }

        [Fact]
        public void DeserializeCreateDomainRequestFromJson()
        {
            var request = JsonObject.Parse(
                @"{ ""name"": ""www.processor.ai"", ""environmentId"": 5, ""ownerId"": 1 }"
            ).As<CreateDomainRequest>();

            Assert.Equal("www.processor.ai", request.Name);
            Assert.Equal(1, request.OwnerId);
            Assert.Equal(5, request.EnvironmentId);
        }

        [Fact]
        public void DeserializeCreateDomainRecordRequestFromJson()
        {
            var request = JsonObject.Parse(
                @"{ ""name"": ""www.processor.ai"", type: ""CNAME"", ""domainId"": 1 }"
            ).As<CreateDomainRecordRequest>();

            Assert.Equal("www.processor.ai",    request.Name);
            Assert.Equal(DnsRecordType.CNAME,   request.Type);
            Assert.Equal(1,                     request.DomainId);
        }
    }
}


text:
(function() {
    'use strict';

    app.service('UserService', UserService);

    UserService.$inject = ['$http', '$q', '$cookies', '$rootScope'];

    function UserService($http, $q, $cookies, $rootScope) {
        var self = this;

        this.user = null;

        this.getUser = function() {
            var deferred = $q.defer();

            if (self.user !== null) {
                deferred.resolve(self.user);
            }

            if (!angular.isDefined($cookies.get('token'))) {
                deferred.reject();
            } else {
                $http.get('/api/user/me')
                    .then(response => response.data)
                    .then(user => {
                        self.user = user;
                        deferred.resolve(user);
                    })
                    .catch(() => {
                        self.user = null;
                        $cookies.remove('token');
                        deferred.reject();
                    });
            }

            return deferred.promise;
        };

        this.registerUser = function(user) {
            return $http.post('/api/user/new', user)
                .then(response => response.data)
                .then(function(user) {
                    self.user = user;
                    return self.login(user);
                });
        };

        this.login = function(user) {
            return $http.post('/api/user/login', user)
                .then(response => response.data)
                .then(function(response) {
                    $cookies.put('token', response.tokenKey);
                    $rootScope.$broadcast('loginSuccess');

                    return self.getUser();
                })
                .catch(function() {
                    $rootScope.$broadcast('loginFailed');

                    return null;
                });
        };

        this.logout = function() {
            return $http.post('/api/user/logout')
                .then(function(response) {
                    if (response.status === 204) {
                        self.user = null;
                        $cookies.remove('token');
                        $rootScope.$broadcast('logoutSuccess');

                        return true;
                    }

                    $rootScope.$broadcast('logoutFailed');
                    return false;
                })
                .catch(function() {
                    $rootScope.$broadcast('logoutFailed');
                    return false;
                });
        };

        this.isLoggedIn = function() {
            return self.user !== null && angular.isDefined($cookies.get('token'));
        };
        this.sold_ads = function(id){
            return $http.get("/api/user/sold/" + id)
                .then(response => response.data)
        };
    }
})();


text:
<?php

/**
 * The ezcQueryExpressionSqlite class is used to create SQL expression for SQLite.
 *
 * This class reimplements the methods that have a different syntax in
 * SQLite (substr) and contains PHP implementations of functions that are
 * registered with SQLite with it's PDO::sqliteRegisterFunction() method.
 *
 * @package Database
 * @version 1.4.6
 */
class ezcQuerySqliteFunctions
{
    /**
     * Returns the md5 sum of the data that SQLite's md5() function receives.
     *
     * @param string $data
     * @return string
     */
    static public function md5Impl( $data )
    {
        return md5( $data );
    }

    /**
     * Returns the modules of the data that SQLite's mod() function receives.
     *
     * @param numeric $dividend
     * @param numeric $divisor
     * @return string
     */
    static public function modImpl( $dividend, $divisor )
    {
        return $dividend % $divisor;
    }

    /**
     * Returns a concattenation of the data that SQLite's concat() function receives.
     *
     * @return string
     */
    static public function concatImpl()
    {
        $args = func_get_args();
        return join( '', $args );
    }

    /**
     * Returns the SQL to locate the position of the first occurrence of a substring
     *
     * @param string $substr
     * @param string $value
     * @return integer
     */
     static public function positionImpl( $substr, $value )
     {
         return strpos( $value, $substr ) + 1;
     }

    /**
     * Returns the next lowest integer value from the number
     *
     * @param numeric $number
     * @return integer
     */
     static public function floorImpl( $number )
     {
         return (int) floor( $number );
     }

     /**
      * Returns the next highest integer value from the number
      *
      * @param numeric $number
      * @return integer
      */
     static public function ceilImpl( $number )
     {
         return (int) ceil( $number );
     }

     /**
      * Returns the unix timestamp belonging to a date/time spec
      *
      * @param string $spec
      * @return integer
      */
     static public function toUnixTimestampImpl( $spec )
     {
         return strtotime( $spec );
     }
}
?>


text:
import { BaseTextureCache, TextureCache } from '@pixi/utils';
import { Rectangle, Point } from '@pixi/math';
import { BaseTexture, Texture } from '@pixi/core';
import { settings } from '@pixi/settings';
import { expect } from 'chai';

const URL = 'foo.png';
const NAME = 'foo';
const NAME2 = 'bar';

function cleanCache()
{
    delete BaseTextureCache[URL];
    delete BaseTextureCache[NAME];
    delete BaseTextureCache[NAME2];

    delete TextureCache[URL];
    delete TextureCache[NAME];
    delete TextureCache[NAME2];
}

describe('Texture', function ()
{
    it('should register Texture from Loader', function (done)
    {
        cleanCache();

        const image = new Image();

        image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJ'
            + 'AAAADUlEQVQYV2P4GvD7PwAHvgNAdItKlAAAAABJRU5ErkJggg==';

        Texture.fromLoader(image, URL, NAME).then((texture) =>
        {
            expect(texture.baseTexture.resource.url).to.equal('foo.png');
            expect(TextureCache[NAME]).to.equal(texture);
            expect(BaseTextureCache[NAME]).to.equal(texture.baseTexture);
            expect(TextureCache[URL]).to.equal(texture);
            expect(BaseTextureCache[URL]).to.equal(texture.baseTexture);

            done();
        });
    });

    it('should remove Texture from cache on destroy', function ()
    {
        cleanCache();

        const texture = new Texture(new BaseTexture());

        Texture.addToCache(texture, NAME);
        Texture.addToCache(texture, NAME2);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(texture.textureCacheIds.indexOf(NAME2)).to.equal(1);
        expect(TextureCache[NAME]).to.equal(texture);
        expect(TextureCache[NAME2]).to.equal(texture);
        texture.destroy();
        expect(texture.textureCacheIds).to.equal(null);
        expect(TextureCache[NAME]).to.equal(undefined);
        expect(TextureCache[NAME2]).to.equal(undefined);
    });

    it('should use pixiIdPrefix correctly', function ()
    {
        cleanCache();

        const canvas = document.createElement('canvas');
        const texture = Texture.from(canvas, { pixiIdPrefix: 'unittest' });
        const baseTexture = texture.baseTexture;
        const _pixiId = baseTexture.resource.source._pixiId;

        expect(_pixiId.indexOf('unittest_')).to.equal(0);
        expect(baseTexture.textureCacheIds.indexOf(_pixiId)).to.equal(0);
        expect(BaseTextureCache[_pixiId]).to.equal(baseTexture);
        expect(texture.textureCacheIds.indexOf(_pixiId)).to.equal(0);
        expect(TextureCache[_pixiId]).to.equal(texture);
    });

    it('should be added to the texture cache correctly, '
     + 'and should remove only itself, not effecting the base texture and its cache', function ()
    {
        cleanCache();

        const texture = new Texture(new BaseTexture());

        BaseTexture.addToCache(texture.baseTexture, NAME);
        Texture.addToCache(texture, NAME);
        expect(texture.baseTexture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(BaseTextureCache[NAME]).to.equal(texture.baseTexture);
        expect(TextureCache[NAME]).to.equal(texture);
        Texture.removeFromCache(NAME);
        expect(texture.baseTexture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(-1);
        expect(BaseTextureCache[NAME]).to.equal(texture.baseTexture);
        expect(TextureCache[NAME]).to.equal(undefined);
    });

    it('should remove Texture from entire cache using removeFromCache (by Texture instance)', function ()
    {
        cleanCache();

        const texture = new Texture(new BaseTexture());

        Texture.addToCache(texture, NAME);
        Texture.addToCache(texture, NAME2);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(texture.textureCacheIds.indexOf(NAME2)).to.equal(1);
        expect(TextureCache[NAME]).to.equal(texture);
        expect(TextureCache[NAME2]).to.equal(texture);
        Texture.removeFromCache(texture);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(-1);
        expect(texture.textureCacheIds.indexOf(NAME2)).to.equal(-1);
        expect(TextureCache[NAME]).to.equal(undefined);
        expect(TextureCache[NAME2]).to.equal(undefined);
    });

    it('should remove Texture from single cache entry using removeFromCache (by id)', function ()
    {
        cleanCache();

        const texture = new Texture(new BaseTexture());

        Texture.addToCache(texture, NAME);
        Texture.addToCache(texture, NAME2);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(texture.textureCacheIds.indexOf(NAME2)).to.equal(1);
        expect(TextureCache[NAME]).to.equal(texture);
        expect(TextureCache[NAME2]).to.equal(texture);
        Texture.removeFromCache(NAME);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(-1);
        expect(texture.textureCacheIds.indexOf(NAME2)).to.equal(0);
        expect(TextureCache[NAME]).to.equal(undefined);
        expect(TextureCache[NAME2]).to.equal(texture);
    });

    it('should not remove Texture from cache if Texture instance has been replaced', function ()
    {
        cleanCache();

        const texture = new Texture(new BaseTexture());
        const texture2 = new Texture(new BaseTexture());

        Texture.addToCache(texture, NAME);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(TextureCache[NAME]).to.equal(texture);
        Texture.addToCache(texture2, NAME);
        expect(texture2.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(TextureCache[NAME]).to.equal(texture2);
        Texture.removeFromCache(texture);
        expect(texture.textureCacheIds.indexOf(NAME)).to.equal(-1);
        expect(texture2.textureCacheIds.indexOf(NAME)).to.equal(0);
        expect(TextureCache[NAME]).to.equal(texture2);
    });

    it('destroying a destroyed texture should not throw an error', function ()
    {
        const texture = new Texture(new BaseTexture());

        texture.destroy(true);
        texture.destroy(true);
    });

    it('should not throw if base texture loaded after destroy', function ()
    {
        const base = new BaseTexture();
        const texture = new Texture(base);

        texture.destroy();
        base.emit('loaded', base);
    });

    it('should clone a minimal texture', function ()
    {
        const baseTexture = new BaseTexture();
        const frame = new Rectangle(0, 0, 10, 10);
        const texture = new Texture(baseTexture, frame);
        const clone = texture.clone();
        const toJSON = ({ x, y, width, height }) => ({ x, y, width, height });

        expect(clone.baseTexture).to.equal(baseTexture);
        expect(clone.frame).to.not.equal(texture.frame);
        expect(toJSON(clone.frame)).to.deep.equal(toJSON(texture.frame));
        expect(clone.trim).to.be.undefined;
        expect(clone.orig).to.not.equal(texture.orig);
        expect(toJSON(clone.orig)).to.deep.equal(toJSON(texture.orig));
        expect(clone.frame === clone.orig).to.equal(texture.frame === texture.orig);
        expect(clone.noFrame).to.equal(texture.noFrame);

        clone.destroy();
        texture.destroy(true);
    });

    it('should clone a texture', function ()
    {
        const baseTexture = new BaseTexture();
        const frame = new Rectangle();
        const orig = new Rectangle();
        const trim = new Rectangle();
        const rotate = 2;
        const anchor = new Point(1, 0.5);
        const texture = new Texture(baseTexture, frame, orig, trim, rotate, anchor);
        const clone = texture.clone();
        const toJSON = ({ x, y, width, height }) => ({ x, y, width, height });

        expect(clone.baseTexture).to.equal(baseTexture);
        expect(clone.defaultAnchor).to.not.equal(texture.defaultAnchor);
        expect(clone.defaultAnchor.x).to.equal(texture.defaultAnchor.x);
        expect(clone.defaultAnchor.y).to.equal(texture.defaultAnchor.y);
        expect(clone.frame).to.not.equal(texture.frame);
        expect(toJSON(clone.frame)).to.deep.equal(toJSON(texture.frame));
        expect(clone.trim).to.not.equal(texture.trim);
        expect(toJSON(clone.trim)).to.deep.equal(toJSON(texture.trim));
        expect(clone.orig).to.not.equal(texture.orig);
        expect(toJSON(clone.orig)).to.deep.equal(toJSON(texture.orig));
        expect(clone.rotate).to.equal(texture.rotate);
        expect(clone.frame === clone.orig).to.equal(texture.frame === texture.orig);
        expect(clone.noFrame).to.equal(texture.noFrame);

        clone.destroy();
        texture.destroy(true);
    });

    it('should update frame if its backed by canvas that was resized', function ()
    {
        const canvas = document.createElement('canvas');

        canvas.width = 50;
        canvas.height = 50;

        const texture = Texture.from(canvas);

        expect(texture.noFrame).to.equal(true);
        expect(texture.width).to.equal(50);
        canvas.width = 100;
        texture.update();
        expect(texture.width).to.equal(100);
        canvas.height = 70;
        texture.update();
        expect(texture.height).to.equal(70);

        const clone = texture.clone();

        expect(texture.noFrame).to.equal(true);
        expect(clone.width).to.equal(100);
        expect(clone.height).to.equal(70);
        canvas.width = 40;
        clone.update();
        expect(clone.width).to.equal(40);
        canvas.height = 60;
        clone.update();
        expect(clone.height).to.equal(60);

        clone.destroy();
        texture.destroy(true);
    });

    it('should update frame on baseTexture update only if user set it in constructor or in setter', function ()
    {
        let baseTexture = new BaseTexture();

        baseTexture.setSize(50, 50);

        let texture = new Texture(baseTexture);

        expect(texture.noFrame).to.equal(true);
        expect(texture.width).to.equal(50);
        baseTexture.setSize(100, 70);
        expect(texture.width).to.equal(100);
        expect(texture.height).to.equal(70);

        texture.frame = new Rectangle(1, 1, 10, 20);
        expect(texture.noFrame).to.equal(false);
        baseTexture.setSize(110, 80);
        expect(texture.width).to.equal(10);
        expect(texture.height).to.equal(20);
        texture.destroy(true);

        baseTexture = new BaseTexture();
        texture = new Texture(baseTexture, new Rectangle(1, 1, 10, 20));
        expect(texture.noFrame).to.equal(false);
        baseTexture.setSize(50, 50);
        expect(texture.width).to.equal(10);
        expect(texture.height).to.equal(20);
        texture.destroy(true);
    });

    it('should handle loading an invalid URL', function ()
    {
        expect(() => Texture.fromURL('invalid/image.png')).throws;
    });

    it('should handle loading an cached URL', async function ()
    {
        const url = 'noop.png';

        TextureCache[url] = Texture.WHITE;

        expect(Texture.WHITE.valid).to.be.true;

        const texture = await Texture.fromURL(url);

        expect(texture).equals(Texture.WHITE);
        delete TextureCache[url];
    });

    it('should throw and error in strict from mode', function ()
    {
        const id = 'baz';

        expect(() => Texture.from(id, {}, true)).to.throw(`The cacheId "${id}" does not exist in TextureCache.`);
        settings.STRICT_TEXTURE_CACHE = true;
        expect(() => Texture.from(id)).to.throw(`The cacheId "${id}" does not exist in TextureCache.`);
        settings.STRICT_TEXTURE_CACHE = false;
    });

    describe('Texture.from', () =>
    {
        it('should accept & cache a BaseTexture', () =>
        {
            const baseTexture = new BaseTexture(null, { width: 100, height: 100 });
            const texture1 = Texture.from(baseTexture);

            expect(baseTexture.cacheId).to.not.equal(null);
            expect(BaseTextureCache[baseTexture.cacheId]).to.equal(baseTexture);
            expect(texture1.baseTexture).to.equal(baseTexture);

            expect(Texture.from(baseTexture)).to.equal(texture1);
        });
    });
});


text:
#import <GameKitServices/GKVoiceChatSessionInternal.h>

@interface GKVoiceChatSessionInternal (VideoConferenceChannelQualityDelegate)
- (void)lossRate:(float)arg1 forParticipantID:(id)arg2;
- (int)goodChannels;
- (int)calculateChannelQualities;
@end


text:
>Allows an object to alter its behavior when its internal state changes.

## Problem
How to make behaviour depend on state.

Typical state machine problem. For example communication protocol, file parsing.

## Solution

1. Define a context class to present a single interface to the outside world
2. Define state abstract base class
3. Represent the different states of the state machine as derived classes of the State base class
4. Define state-specific behavior in the each State derived classes
5. Maintain a pointer to the current state in the context class
6. Move between the different states by changing the currentState pointer.

## Notes

There is a discussion regarding where to change the pointer to the currentState:
1. In the context class. In this fashion States are not coupled between them but they are to the
context class and the logic to maintain the state machine is complex.
2. Each individual state knows which is the next state.

## General structure

![State](https://upload.wikimedia.org/wikipedia/commons/7/7c/State_design_pattern.png)

## References

https://sourcemaking.com/design_patterns/state


text:
cask 'busycal' do
  version '3.5.7,350718'
  sha256 '2f8af4c5780f267a8c9be163bd607e8d4be84e7df22cdd9a22ccc93ffc380764'

  url 'https://www.busymac.com/download/BusyCal.zip'
  appcast 'https://busymac.com/busycal/releasenotes.html'
  name 'BusyCal'
  homepage 'https://busymac.com/busycal/index.html'

  auto_updates true

  pkg 'BusyCal Installer.pkg'

  uninstall pkgutil: "com.busymac.busycal#{version.major}.pkg",
            quit:    "N4RA379GBW.com.busymac.busycal#{version.major}.alarm",
            signal:  ['TERM', "com.busymac.busycal#{version.major}"]

  zap trash: [
               "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.busymac.busycal#{version.major}.sfl*",
               "~/Library/Containers/com.busymac.busycal#{version.major}",
               "~/Library/Containers/N4RA379GBW.com.busymac.busycal#{version.major}.alarm",
               "~/Library/Group Containers/com.busymac.busycal#{version.major}",
               "~/Library/Group Containers/N4RA379GBW.com.busymac.busycal#{version.major}",
             ]
end


text:
/*-----------------------------------------------------------------------------
 * Name:    LED_STM32F072-Discovery.c
 * Purpose: LED interface for STM32F072-Discovery evaluation board
 * Rev.:    1.00
 *----------------------------------------------------------------------------*/

/* Copyright (c) 2013 - 2015 ARM LIMITED

   All rights reserved.
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
   - Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   - Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
   - Neither the name of ARM nor the names of its contributors may be used
     to endorse or promote products derived from this software without
     specific prior written permission.
   *
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.
   ---------------------------------------------------------------------------*/

#include "stm32f0xx.h"                  // Device header
#include "Board_LED.h"                  // ::Board Support:LED

#define LED_NUM             (4)

const unsigned long led_mask[] = {1UL << 6, 1UL << 7, 1UL << 8, 1UL << 9};

/**
  \fn          int32_t LED_Initialize (void)
  \brief       Initialize LEDs
  \returns
   - \b  0: function succeeded
   - \b -1: function failed
*/
int32_t LED_Initialize (void) {

  RCC->AHBENR |=  (1UL << 19);                  /* Enable GPIOC clock         */

  /* Configure LED pins as push-pull outputs, No pull-up, pull-down */
  GPIOC->MODER   &= ~((3UL << 2*6) | (3UL << 2*7) | (3UL << 2*8) | (3UL << 2*9));
  GPIOC->MODER   |=  ((1UL << 2*6) | (1UL << 2*7) | (1UL << 2*8) | (1UL << 2*9));
  GPIOC->OTYPER  &= ~((1UL <<   6) | (1UL <<   7) | (1UL <<   8) | (1UL <<   9));
  GPIOC->OSPEEDR &= ~((3UL << 2*6) | (3UL << 2*7) | (3UL << 2*8) | (3UL << 2*9));
  GPIOC->OSPEEDR |=  ((1UL << 2*6) | (1UL << 2*7) | (1UL << 2*8) | (1UL << 2*9));
  GPIOC->PUPDR   &= ~((3UL << 2*6) | (3UL << 2*7) | (3UL << 2*8) | (3UL << 2*9));

  LED_SetOut (0);

  return (0);
}

/**
  \fn          int32_t LED_Uninitialize (void)
  \brief       De-initialize I/O interface for LEDs
  \returns
   - \b  0: function succeeded
   - \b -1: function failed
*/
int32_t LED_Uninitialize (void) {

  return (0);
}

/**
  \fn          int32_t LED_On (uint32_t num)
  \brief       Turn on requested LED
  \param[in]   num  LED number
  \returns
   - \b  0: function succeeded
   - \b -1: function failed
*/
int32_t LED_On (uint32_t num) {

  if (num < LED_NUM) {
    GPIOC->BSRR |= (led_mask[num]);
  }
  return (0);
}

/**
  \fn          int32_t LED_Off (uint32_t num)
  \brief       Turn off requested LED
  \param[in]   num  LED number
  \returns
   - \b  0: function succeeded
   - \b -1: function failed
*/
int32_t LED_Off (uint32_t num) {

  if (num < LED_NUM) {
    GPIOC->BSRR |= (led_mask[num] << 16);
  }
  return (0);
}

/**
  \fn          int32_t LED_SetOut (uint32_t val)
  \brief       Write value to LEDs
  \param[in]   val  value to be displayed on LEDs
  \returns
   - \b  0: function succeeded
   - \b -1: function failed
*/
int32_t LED_SetOut (uint32_t val) {
  int i;

  for (i = 0; i < LED_NUM; i++) {
    if (val & (1<<i)) {
      LED_On (i);
    } else {
      LED_Off(i);
    }
  }
  return (0);
}

/**
  \fn          uint32_t LED_GetCount (void)
  \brief       Get number of LEDs
  \return      Number of available LEDs
*/
uint32_t LED_GetCount (void) {
  return LED_NUM;
}


text:
var Q = require('q');
var request = require("request");
var cheerio = require('cheerio');

module.exports = {
  search: function(query, cat, page, nyaa_url) {
    //http://www.nyaa.se/?page=search&term=Absolute+Duo&sort=2
    var torrent_search = query;
    var search_query = torrent_search.split(' ').join('+');

    var search_url = nyaa_url + "/?page=search&term=" + search_query + "&sort=2";

    var count = 1;
    var deferred = Q.defer();
    var data_content = {};
    var torrent_content = [];

    request(search_url, function(err, response, body){

      if(!err && response.statusCode === 200){

        $ = cheerio.load(body);

        if($('.tlist').find('tr').length > "2"){
          $('.tlist tr.tlistrow').each(function(index, torrents){

            find_torrent_title = $(torrents).find('.tlistname a');
            find_torrent_link = $(torrents).find('.tlistdownload a');
            find_torrent_seed = $(torrents).find('.tlistsn');
            find_torrent_leech = $(torrents).find('.tlistln');
            find_torrent_size = $(torrents).find('.tlistsize');

            torrent_title = find_torrent_title.text();
            torrent_link = find_torrent_link.attr('href');
            torrent_seed = find_torrent_seed.text();
            torrent_leech = find_torrent_leech.text();
            torrent_size = find_torrent_size.text();

            data_content = {
              torrent_num: count,
              title: torrent_title,
              category: "",
              seeds: torrent_seed,
              leechs: torrent_leech,
              size: torrent_size,
              torrent_link: torrent_link
            };

            torrent_content.push(data_content);

            deferred.resolve(torrent_content);
            count++;

          });
        } else {
          deferred.reject("No torrents found");
        }
      } else {
        deferred.reject("There was a problem loading Nyaa");
      }

    });

    return deferred.promise;

  }
};


text:
@implementation ARSearchResultsDataSource

- (id)init
{
    self = [super init];
    if (!self) {
        return nil;
    }

    _placeholderImage = [UIImage imageNamed:@"SearchThumb_LightGrey"];

    return self;
}

- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section
{
    return self.searchResults.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SearchCell"];
    SearchResult *result = self.searchResults[indexPath.row];

    BOOL published = result.isPublished.boolValue;
    if (!published) {
        cell.textLabel.text = [result.displayText stringByAppendingString:@" (unpublished)"];
    } else {
        cell.textLabel.text = result.displayText;
    }

    cell.textLabel.textColor = self.textColor ?: [UIColor whiteColor];

   @weakify(cell);
    [cell.imageView setImageWithURLRequest:result.imageRequest placeholderImage:self.placeholderImage
                                   success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
       @strongify(cell);
       cell.imageView.image = image;
       [cell layoutSubviews];

                                   }
                                   failure:nil];

    return cell;
}

- (SearchResult *)objectAtIndex:(NSInteger)index
{
    return self.searchResults[index];
}

@end


text:
from operator import add
import os

import pytest
nx = pytest.importorskip('networkx')

from streamz import Stream, create_graph, visualize
from streamz.utils_test import tmpfile

def test_create_graph():
    source1 = Stream(stream_name='source1')
    source2 = Stream(stream_name='source2')

    n1 = source1.zip(source2)
    n2 = n1.map(add)
    n2.sink(source1.emit)

    g = nx.DiGraph()
    create_graph(n2, g)
    for t in [hash(a) for a in [source1, source2, n1, n2]]:
        assert t in g

def test_create_file():
    source1 = Stream(stream_name='source1')
    source2 = Stream(stream_name='source2')

    n1 = source1.zip(source2)
    n2 = n1.map(add)
    n2.sink(source1.emit)

    with tmpfile(extension='png') as fn:
        visualize(n1, filename=fn)
        assert os.path.exists(fn)

    with tmpfile(extension='svg') as fn:
        n1.visualize(filename=fn, rankdir="LR")
        assert os.path.exists(fn)

    with tmpfile(extension='dot') as fn:
        n1.visualize(filename=fn, rankdir="LR")
        with open(fn) as f:
            text = f.read()

        for word in ['rankdir', 'source1', 'source2', 'zip', 'map', 'add']:
            assert word in text


text:
from ansible import utils, errors
import os
HAVE_DNS=False
try:
    import dns.resolver
    from dns.exception import DNSException
    HAVE_DNS=True
except ImportError:
    pass

# ==============================================================
# DNSTXT: DNS TXT records
#
#       key=domainname
# TODO: configurable resolver IPs
# --------------------------------------------------------------

class LookupModule(object):

    def __init__(self, basedir=None, **kwargs):
        self.basedir = basedir

        if HAVE_DNS == False:
            raise errors.AnsibleError("Can't LOOKUP(dnstxt): module dns.resolver is not installed")

    def run(self, terms, inject=None, **kwargs):

        terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject)

        if isinstance(basestring, terms):
            terms = [ terms ]

        ret = []
        for term in terms:
            domain = term.split()[0]
            string = []
            try:
                answers = dns.resolver.query(domain, 'TXT')
                for rdata in answers:
                    s = rdata.to_text()
                    string.append(s[1:-1])  # Strip outside quotes on TXT rdata

            except dns.resolver.NXDOMAIN:
                string = 'NXDOMAIN'
            except dns.resolver.Timeout:
                string = ''
            except dns.exception.DNSException as e:
                raise errors.AnsibleError("dns.resolver unhandled exception", e)

            ret.append(''.join(string))
        return ret


text:
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Umbraco.Web.Scheduling
{
    /// <summary>
    /// Represents a background task.
    /// </summary>
    public interface IBackgroundTask : IDisposable
    {
        /// <summary>
        /// Runs the background task.
        /// </summary>
        void Run();

        /// <summary>
        /// Runs the task asynchronously.
        /// </summary>
        /// <param name="token">A cancellation token.</param>
        /// <returns>A <see cref="Task"/> instance representing the execution of the background task.</returns>
        /// <exception cref="NotImplementedException">The background task cannot run asynchronously.</exception>
        Task RunAsync(CancellationToken token);

        /// <summary>
        /// Indicates whether the background task can run asynchronously.
        /// </summary>
        bool IsAsync { get; }
    }
}


text:
import { Meteor } from 'meteor/meteor';
import { EJSON } from 'meteor/ejson';

// InjectData object
export const InjectData = {
  // data object
  _data: {},

  // encode object to string
  _encode(ejson) {
    const ejsonString = EJSON.stringify(ejson);
    return encodeURIComponent(ejsonString);
  },

  // decode string to object
  _decode(encodedEjson) {
    const decodedEjsonString = decodeURIComponent(encodedEjson);
    if (!decodedEjsonString) return null;
    return EJSON.parse(decodedEjsonString);
  },

  // get data when DOM loaded
  getData(key, callback) {
    Meteor.startup(() => {
      callback(this._data[key]);
    });
  },
};

// when DOM loaded, decode string from <script> and save the data
Meteor.startup(() => {
  const dom = document.querySelector('script[type="text/inject-data"]');
  const injectedDataString = dom ? dom.textContent.trim() : '';
  InjectData._data = InjectData._decode(injectedDataString) || {};
});


text:
FROM      dustin/tiny
MAINTAINER Dustin Sallings "dustin@spy.net"

ADD http://cbfs-ext.hq.couchbase.com/projects/sync_gateway/sync_gateway.lin64.gz /usr/local/sbin/sync_gateway.gz

RUN gzip -d /usr/local/sbin/sync_gateway.gz
RUN chmod 755 /usr/local/sbin/sync_gateway


text:
<!doctype html PUBLIC "-//W3C//DTD html 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>

    <meta http-equiv='X-UA-Compatible' content='IE=emulateIE7' />
    <title>Coverage for scenes/elements/image_element: 0%</title>
    <link rel='stylesheet' href='style.css' type='text/css'>

Coverage for scenes/elements/image_element :
            0%

            20 statements
            0 run
            20 missing
            0 excluded

Hot-keys on this page

        r
        m
        x
        p   toggle line displays

        j
        k   next/prev highlighted chunk

        0   (zero) top of page

        1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

# coding: UTF-8

from __future__ import (absolute_import, division,

                        print_function, unicode_literals)

from .game_div import GameDiv

from .others import LazyAttribute

class ImageElement(GameDiv):

    image = LazyAttribute("_image")

    def __init__(self, image,

                 x=0, y=0, children=None, condition=None, name=''):

        super(ImageElement, self).__init__(x, y, children, condition, name)

        self.image = image

    def draw_element(self, screen, x=0, y=0):

        if not self.image:

            return

        screen.blit(self.image.get(), (x, y))

    def start_x(self):

        return min(0, super(ImageElement, self).start_x())

    def start_y(self):

        return min(0, super(ImageElement, self).start_y())

    def width(self):

        return max(self.image.dimensions[0],

                   super(ImageElement, self).width())

    def height(self):

        return max(self.image.dimensions[1],

                   super(ImageElement, self).height())

            « index     coverage.py v3.7.1


text:
using StageBitz.Data;
using StageBitz.UserWeb.Common.Helpers;
using System;
using System.Globalization;
using System.Linq;
using System.Web.UI.WebControls;

namespace StageBitz.UserWeb.Controls.Project
{
    /// <summary>
    /// Delegate for inform parent to reload
    /// </summary>
    public delegate void InformParentToReload();

    /// <summary>
    /// User control for Project ItemTypes
    /// </summary>
    public partial class ProjectItemTypes : UserControlBase
    {
        /// <summary>
        /// The inform parent to reload
        /// </summary>
        public InformParentToReload InformParentToReload;

        #region Properties

        /// <summary>
        /// Gets or sets the project identifier.
        /// </summary>
        /// <value>
        /// The project identifier.
        /// </value>
        public int ProjectID
        {
            get
            {
                if (ViewState["ProjectID"] == null)
                {
                    ViewState["ProjectID"] = 0;
                }

                return (int)ViewState["ProjectID"];
            }
            set
            {
                ViewState["ProjectID"] = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether [should show all item type text].
        /// </summary>
        /// <value>
        /// <c>true</c> if [should show all item type text]; otherwise, <c>false</c>.
        /// </value>
        public bool ShouldShowAllItemTypeText
        {
            get
            {
                if (ViewState["ShouldShowAllItemTypeText"] == null)
                {
                    ViewState["ShouldShowAllItemTypeText"] = false;
                }

                return (bool)ViewState["ShouldShowAllItemTypeText"];
            }
            set
            {
                ViewState["ShouldShowAllItemTypeText"] = value;
            }
        }

        /// <summary>
        /// Gets or sets the selected item type identifier.
        /// </summary>
        /// <value>
        /// The selected item type identifier.
        /// </value>
        public int SelectedItemTypeId
        {
            get
            {
                if (ViewState["SelectedItemTypeId"] == null || (int)ViewState["SelectedItemTypeId"] == 0)
                {
                    int itemTypeId = 0;

                    if (Request["itemtypeid"] != null)
                    {
                        int.TryParse(Request["itemtypeid"], out itemTypeId);
                    }
                    else
                    {
                        //Get the Database saved value. (i.e the last visited ItemType)
                        UserLastVisitedtItemType userLastVisitedtItemType = (from uli in DataContext.UserLastVisitedtItemTypes
                                                                             where uli.UserId == UserID && uli.ProjectId == ProjectID
                                                                             select uli).FirstOrDefault();
                        if (userLastVisitedtItemType != null)
                        {
                            itemTypeId = userLastVisitedtItemType.ItemTypeId;
                        }
                    }

                    ViewState["SelectedItemTypeId"] = itemTypeId;
                }

                return (int)ViewState["SelectedItemTypeId"];
            }
            set
            {
                ViewState["SelectedItemTypeId"] = value;
            }
        }

        /// <summary>
        /// Gets or sets the last visited item type identifier.
        /// </summary>
        /// <value>
        /// The last visited item type identifier.
        /// </value>
        private int LastVisitedItemTypeId
        {
            get
            {
                if (this.ViewState["LastVisitedItemTypeId"] == null)
                {
                    if (this.SelectedItemTypeId > 0)
                    {
                        //this.ViewState["LastVisitedItemTypeId"] = itemType != null ? itemType.ItemTypeId : 0;
                    }
                    else
                    {
                        this.ViewState["LastVisitedItemTypeId"] = 0;
                    }
                }

                return (int)this.ViewState["LastVisitedItemTypeId"];
            }

            set
            {
                this.ViewState["LastVisitedItemTypeId"] = value;
            }
        }

        #endregion Properties

        #region Event Handlers

        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadItemTypes();
            }
        }

        /// <summary>
        /// Handles the OnSelectedIndexChanged event of the ddItemTypes control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void ddItemTypes_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            if (!PageBase.StopProcessing)
            {
                SelectedItemTypeId = int.Parse(ddItemTypes.SelectedValue);
                if (InformParentToReload != null)
                {
                    InformParentToReload();
                }
            }
        }

        #endregion Event Handlers

        #region Private Methods

        /// <summary>
        /// Loads the item types.
        /// </summary>
        /// <exception cref="System.Exception">Item Type not found</exception>
        private void LoadItemTypes()
        {
            //Get the Database saved value. (i.e the last visited ItemType)
            var userLastVisitedtItemTypeObj = GetBL<Logic.Business.Inventory.InventoryBL>().GetUserLastVisitedItemType(ProjectID, UserID);

            var itemTypeList = GetBL<Logic.Business.Inventory.InventoryBL>().GetItemTypes(ProjectID);

            //When there is no clue (Neither DB vaue nor URL)
            if (SelectedItemTypeId == 0 && userLastVisitedtItemTypeObj == null)
            {
                //If There is no ItemType is being added, Then we can not proceed
                if (itemTypeList.Count() == 0)
                {
                    divItemTypePanel.Visible = false;
                    return;
                }
                SelectedItemTypeId = itemTypeList.First().ItemTypeId;
            }
            else if (SelectedItemTypeId == 0)
            {
                SelectedItemTypeId = userLastVisitedtItemTypeObj.ItemTypeId;
            }

            if (SelectedItemTypeId != -1)
            {
                if (userLastVisitedtItemTypeObj == null)
                {
                    userLastVisitedtItemTypeObj = new UserLastVisitedtItemType();
                    userLastVisitedtItemTypeObj.ProjectId = ProjectID;
                    userLastVisitedtItemTypeObj.UserId = UserID;
                    userLastVisitedtItemTypeObj.ItemTypeId = SelectedItemTypeId;
                    userLastVisitedtItemTypeObj.CreatedByUserId = userLastVisitedtItemTypeObj.LastUpdatedByUserId = UserID;
                    userLastVisitedtItemTypeObj.CreatedDate = userLastVisitedtItemTypeObj.LastUpdatedDate = Now;
                    DataContext.UserLastVisitedtItemTypes.AddObject(userLastVisitedtItemTypeObj);
                    DataContext.SaveChanges();
                }
                else if (userLastVisitedtItemTypeObj.ItemTypeId != SelectedItemTypeId)
                {
                    userLastVisitedtItemTypeObj.ItemTypeId = SelectedItemTypeId;
                    userLastVisitedtItemTypeObj.LastUpdatedDate = Now;
                    userLastVisitedtItemTypeObj.LastUpdatedByUserId = UserID;
                    DataContext.SaveChanges();
                }
            }

            var itemType = (from it in DataContext.ItemTypes
                            where it.ItemTypeId == SelectedItemTypeId
                            select it);

            //Check the validity of the ItemType
            if (GetBL<Logic.Business.Inventory.InventoryBL>().GetProjectItemType(ProjectID, SelectedItemTypeId) == null)
            {
                if (!(SelectedItemTypeId == -1 && ShouldShowAllItemTypeText))
                    throw new Exception("Item Type not found");
            }

            //This decides whether
            ShouldShowAllItemTypeText = (GetBL<Logic.Business.Inventory.InventoryBL>().GetItemTypes(ProjectID).Count() > 1 && ShouldShowAllItemTypeText);
            string allitemTypeItemId = "-1";
            if (SelectedItemTypeId == -1 && ShouldShowAllItemTypeText)
                this.ddItemTypes.Items.Add(new ListItem("All Item Types", allitemTypeItemId));
            else
                this.ddItemTypes.Items.Add(new ListItem(itemType.FirstOrDefault().Name, SelectedItemTypeId.ToString(CultureInfo.InvariantCulture)));

            ddItemTypes.SelectedIndex = 0;
            if (itemTypeList.Count() > 1)
                this.ddItemTypes.AddItemGroup("Change to:");

            var listToBind = itemTypeList.Except(itemType).ToList<Data.ItemType>();

            foreach (var it in listToBind.OrderBy(it => it.Name))
            {
                this.ddItemTypes.Items.Add(new ListItem(it.Name, it.ItemTypeId.ToString(CultureInfo.InvariantCulture)));
            }
            if (ddItemTypes.Items.FindByValue(allitemTypeItemId) == null && ShouldShowAllItemTypeText)
                this.ddItemTypes.Items.Add(new ListItem("All Item Types", allitemTypeItemId.ToString(CultureInfo.InvariantCulture)));
        }

        #endregion Private Methods
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Sydowia 12: 225 (1959)

#### Original name
Humidicutis marginata var. marginata (Peck) Singer, 1959

### Remarks
null


text:
package chat.client.util;

import java.util.List;

import chat.spring.model.CommandPojo;

public interface MessageHandler {
  public void handleMessage(CommandPojo message);

  public boolean isLoggedIn();

  public List<CommandPojo> getHistory();
}


text:
/**
 * A `TaskTrackingZoneSpec` allows one to track all outstanding Tasks.
 *
 * This is useful in tests. For example to see which tasks are preventing a test from completing
 * or an automated way of releasing all of the event listeners at the end of the test.
 */
var TaskTrackingZoneSpec = (function () {
    function TaskTrackingZoneSpec() {
        this.name = 'TaskTrackingZone';
        this.microTasks = [];
        this.macroTasks = [];
        this.eventTasks = [];
        this.properties = { 'TaskTrackingZone': this };
    }
    TaskTrackingZoneSpec.get = function () {
        return Zone.current.get('TaskTrackingZone');
    };
    TaskTrackingZoneSpec.prototype.getTasksFor = function (type) {
        switch (type) {
            case 'microTask': return this.microTasks;
            case 'macroTask': return this.macroTasks;
            case 'eventTask': return this.eventTasks;
        }
        throw new Error('Unknown task format: ' + type);
    };
    TaskTrackingZoneSpec.prototype.onScheduleTask = function (parentZoneDelegate, currentZone, targetZone, task) {
        task['creationLocation'] = new Error("Task '" + task.type + "' from '" + task.source + "'.");
        var tasks = this.getTasksFor(task.type);
        tasks.push(task);
        return parentZoneDelegate.scheduleTask(targetZone, task);
    };
    TaskTrackingZoneSpec.prototype.onCancelTask = function (parentZoneDelegate, currentZone, targetZone, task) {
        var tasks = this.getTasksFor(task.type);
        for (var i = 0; i < tasks.length; i++) {
            if (tasks[i] == task) {
                tasks.splice(i, 1);
                break;
            }
        }
        return parentZoneDelegate.cancelTask(targetZone, task);
    };
    TaskTrackingZoneSpec.prototype.onInvokeTask = function (parentZoneDelegate, currentZone, targetZone, task, applyThis, applyArgs) {
        if (task.type === 'eventTask')
            return parentZoneDelegate.invokeTask(targetZone, task, applyThis, applyArgs);
        var tasks = this.getTasksFor(task.type);
        for (var i = 0; i < tasks.length; i++) {
            if (tasks[i] == task) {
                tasks.splice(i, 1);
                break;
            }
        }
        return parentZoneDelegate.invokeTask(targetZone, task, applyThis, applyArgs);
    };
    TaskTrackingZoneSpec.prototype.clearEvents = function () {
        while (this.eventTasks.length) {
            Zone.current.cancelTask(this.eventTasks[0]);
        }
    };
    return TaskTrackingZoneSpec;
}());
// Export the class so that new instances can be created with proper
// constructor params.
Zone['TaskTrackingZoneSpec'] = TaskTrackingZoneSpec;


text:
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace PalindromeChecker.Tests
{
    [TestClass]
    public class PalindromeCheckerTests
    {
        private PalindromeChecker palindromeChecker;

        [TestInitialize]
        public void TestInitialize()
        {
            palindromeChecker = new PalindromeChecker();
        }

        [TestCleanup]
        public void TestCleanup()
        {
            palindromeChecker = null;
        }

        [TestMethod]
        public void PalindromeChecker_returns_true_for_empty_string()
        {
            var result = palindromeChecker.IsPalindrome(String.Empty);
            Assert.AreEqual(true, result);
        }

        [TestMethod]
        public void PalindromeChecker_returns_true_for_null()
        {
            var result = palindromeChecker.IsPalindrome(null);
            Assert.AreEqual(true, result);
        }

        [TestMethod]
        public void PalindromeChecker_returns_true_for_input_ABBA()
        {
            var result = palindromeChecker.IsPalindrome("ABBA");
            Assert.AreEqual(true, result);
        }

        [TestMethod]
        public void PalindromeChecker_returns_true_for_input_tattarrattat()
        {
            var result = palindromeChecker.IsPalindrome("tattarrattat");
            Assert.AreEqual(true, result);
        }

        [TestMethod]
        public void PalindromeChecker_returns_false_for_input_ABCD()
        {
            var result = palindromeChecker.IsPalindrome("ABCD");
            Assert.AreEqual(false, result);
        }

        [TestMethod]
        public void PalindromeChecker_returns_false_for_input_palindrome()
        {
            var result = palindromeChecker.IsPalindrome("palindrome");
            Assert.AreEqual(false, result);
        }
    }
}


text:
package translatortextapi

import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/translatortext/translatortextapi"

type TranslatorClientAPI = original.TranslatorClientAPI


text:
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
reservation_sid = 'WRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::TaskRouterClient.new account_sid,
                                            auth_token,
                                            workspace_sid

reservation = client.workspace
                    .workers.get(worker_sid)
                    .reservations.get(reservation_sid)
reservation.update(reservationStatus: 'rejected')
puts reservation.reservation_status
puts reservation.worker_name


text:
package minion

import (
	"fmt"

	"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
)

type CloudRegistry struct {
	cloud   cloudprovider.Interface
	matchRE string
}

func NewCloudRegistry(cloud cloudprovider.Interface, matchRE string) (*CloudRegistry, error) {
	return &CloudRegistry{
		cloud:   cloud,
		matchRE: matchRE,
	}, nil
}

func (r *CloudRegistry) Contains(minion string) (bool, error) {
	instances, err := r.List()
	if err != nil {
		return false, err
	}
	for _, name := range instances {
		if name == minion {
			return true, nil
		}
	}
	return false, nil
}

func (r CloudRegistry) Delete(minion string) error {
	return fmt.Errorf("unsupported")
}

func (r CloudRegistry) Insert(minion string) error {
	return fmt.Errorf("unsupported")
}

func (r *CloudRegistry) List() ([]string, error) {
	instances, ok := r.cloud.Instances()
	if !ok {
		return nil, fmt.Errorf("cloud doesn't support instances")
	}
	return instances.List(r.matchRE)
}


text:
package io.debezium.data;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Objects;

import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.SchemaBuilder;
import org.apache.kafka.connect.data.Struct;

/**
 * An arbitrary precision decimal value with variable scale.
 *
 * @author Jiri Pechanec
 *
 */
public class VariableScaleDecimal {
    public static final String LOGICAL_NAME = "io.debezium.data.VariableScaleDecimal";
    public static final String VALUE_FIELD = "value";
    public static final String SCALE_FIELD = "scale";
    public static final Struct ZERO = fromLogical(schema(), SpecialValueDecimal.ZERO);

    /**
     * Returns a {@link SchemaBuilder} for a VariableScaleDecimal. You can use the resulting SchemaBuilder
     * to set additional schema settings such as required/optional, default value, and documentation.
     *
     * @return the schema builder
     */
    public static SchemaBuilder builder() {
        return SchemaBuilder.struct()
                .name(LOGICAL_NAME)
                .version(1)
                .doc("Variable scaled decimal")
                .field(SCALE_FIELD, Schema.INT32_SCHEMA)
                .field(VALUE_FIELD, Schema.BYTES_SCHEMA);
    }

    /**
     * Returns a Schema for a VariableScaleDecimal but with all other default Schema settings.
     *
     * @return the schema
     * @see #builder()
     */
    public static Schema schema() {
        return builder().build();
    }

    /**
     * Returns a Schema for an optional VariableScaleDecimal but with all other default Schema settings.
     *
     * @return the schema
     * @see #builder()
     */
    public static Schema optionalSchema() {
        return builder().optional().build();
    }

    /**
     * Converts a value from its logical format to its encoded format - a struct containing
     * the scale of the number and a binary representation of the number.
     *
     * @param schema of the encoded value
     * @param value the value or the decimal
     *
     * @return the encoded value
     */
    public static Struct fromLogical(Schema schema, SpecialValueDecimal value) {
        return fromLogical(schema, value.getDecimalValue().orElse(null));
    }

    /**
     * Converts a value from its logical format to its encoded format - a struct containing
     * the scale of the number and a binary representation of the number.
     *
     * @param schema of the encoded value
     * @param value the value or the decimal
     *
     * @return the encoded value
     */
    public static Struct fromLogical(Schema schema, BigDecimal decimalValue) {
        Objects.requireNonNull(decimalValue, "decimalValue may not be null");

        Struct result = new Struct(schema);
        result.put(VALUE_FIELD, decimalValue.unscaledValue().toByteArray());
        result.put(SCALE_FIELD, decimalValue.scale());

        return result;
    }

    /**
     * Decodes the encoded value - see {@link #fromLogical(Schema, BigDecimal)} for encoding format
     *
     * @param value the encoded value
     * @return the decoded value
     */
    public static SpecialValueDecimal toLogical(final Struct value) {
        return new SpecialValueDecimal(new BigDecimal(new BigInteger(value.getBytes(VALUE_FIELD)), value.getInt32(SCALE_FIELD)));
    }
}