text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03.Mankind
{
    public class Human
    {
        private string firstName;
        private string secondName;

        public Human(string firstName, string secondName)
        {
            this.FirstName = firstName;
            this.SecondName = secondName;
        }

        public string FirstName
        {
            get { return this.firstName; }
            protected set
            {
                if (Char.IsLower(value[0]))
                {
                    throw new ArgumentException("Expected upper case letter! Argument: firstName");
                }
                if (value.Length < 4)
                {
                    throw new ArgumentException("Expected length at least 4 symbols! Argument: firstName");
                }
                this.firstName = value;
            }
        }

        public string SecondName
        {
            get { return this.secondName; }
            protected set
            {
                if (Char.IsLower(value[0]))
                {
                    throw new ArgumentException("Expected upper case letter! Argument: lastName");
                }
                if (value.Length < 3)
                {
                    throw new ArgumentException("Expected length at least 3 symbols! Argument: lastName");
                }
                this.secondName = value;
            }
        }
    }
}


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, minimum-scale=1.0">
    <meta charset="utf-8" />
    <title>Dots</title>

redpajama_set_name: RedPajamaGithub


text:
require "active_support/core_ext/array/extract"

module ActiveRecord
  class PredicateBuilder
    class ArrayHandler # :nodoc:
      def initialize(predicate_builder)
        @predicate_builder = predicate_builder
      end

      def call(attribute, value)
        return attribute.in([]) if value.empty?

        values = value.map { |x| x.is_a?(Base) ? x.id : x }
        nils = values.extract!(&:nil?)
        ranges = values.extract! { |v| v.is_a?(Range) }

        values_predicate =
          case values.length
          when 0 then NullPredicate
          when 1 then predicate_builder.build(attribute, values.first)
          else Arel::Nodes::HomogeneousIn.new(values, attribute, :in)
          end

        unless nils.empty?
          values_predicate = values_predicate.or(attribute.eq(nil))
        end

        if ranges.empty?
          values_predicate
        else
          array_predicates = ranges.map! { |range| predicate_builder.build(attribute, range) }
          array_predicates.inject(values_predicate, &:or)
        end
      end

      private
        attr_reader :predicate_builder

        module NullPredicate # :nodoc:
          def self.or(other)
            other
          end
        end
    end
  end
end


text:
echo "Admin username: $admin_user"
echo "Admin password: $admin_password"

# access all explicitly passed inputs as environment variables like:
echo "Input db_host: $db_host"
echo "Input db_port: $db_port"
echo "Input db_name: $db_name"
echo "Input db_user: $db_user"
echo "Input db_password: $db_password"

# do something to configure ...

# exit with 0 to indicate sucessful completion
exit 0


text:
package org.mifos.test.acceptance.admin;

import org.dbunit.dataset.IDataSet;
import org.joda.time.DateTime;
import org.mifos.framework.util.DbUnitUtilities;
import org.mifos.test.acceptance.framework.MifosPage;
import org.mifos.test.acceptance.framework.UiTestCaseBase;
import org.mifos.test.acceptance.framework.admin.AdminPage;
import org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage;
import org.mifos.test.acceptance.framework.admin.ImportTransactionsPage;
import org.mifos.test.acceptance.framework.testhelpers.NavigationHelper;
import org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService;
import org.mifos.test.acceptance.remote.InitializeApplicationRemoteTestingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

@ContextConfiguration(locations = { "classpath:ui-test-context.xml" })
@Test(enabled = false, sequential = true, groups = {"admin", "acceptance","ui"})
public class ImportTransactionsTest extends UiTestCaseBase {

    private NavigationHelper navigationHelper;
    private static final String EXCEL_IMPORT_TYPE = "Audi Bank (Excel 2007)";
    private static final String TSV_IMPORT_TYPE = "Audi Bank (tab-delimited)";

    @Autowired
    private DriverManagerDataSource dataSource;
    @Autowired
    private DbUnitUtilities dbUnitUtilities;
    @Autowired
    private InitializeApplicationRemoteTestingService initRemote;

    public static final String ACCOUNT_PAYMENT = "ACCOUNT_PAYMENT";
    public static final String ACCOUNT_TRXN = "ACCOUNT_TRXN";
    public static final String FINANCIAL_TRXN = "FINANCIAL_TRXN";
    public static final String LOAN_ACTIVITY_DETAILS = "LOAN_ACTIVITY_DETAILS";
    public static final String LOAN_SCHEDULE = "LOAN_SCHEDULE";
    public static final String LOAN_SUMMARY = "LOAN_SUMMARY";
    public static final String LOAN_TRXN_DETAIL = "LOAN_TRXN_DETAIL";

    @SuppressWarnings("PMD.SignatureDeclareThrowsException")
    // one of the dependent methods throws Exception
    @BeforeMethod
    public void setUp() throws Exception {
        super.setUp();
        navigationHelper = new NavigationHelper(selenium);
        DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
        DateTime targetTime = new DateTime(2009,11,7,10,0,0,0);
        dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);

    }

    @AfterMethod
    public void tearDown() {
        (new MifosPage(selenium)).logout();
    }

    @SuppressWarnings("PMD.SignatureDeclareThrowsException")
    public void importTabDelimitedAudiBankTransactions() throws Exception {
        String importFile = this.getClass().getResource("/AudiUSD-OneTransactionEA00002.txt").toString();
        initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_009_dbunit.xml.zip", dataSource, selenium);

        importTransaction(importFile, TSV_IMPORT_TYPE);

        String expectedDataSetFile = "ImportTransactions_001_result_dbunit.xml.zip";

        verifyImportTransactions(expectedDataSetFile);
     }

    @SuppressWarnings("PMD.SignatureDeclareThrowsException")
    public void importExcelFormatAudiBankTransactions() throws Exception {
        String importFile = this.getClass().getResource("/AudiUSD-SevenTransactions.xls").toString();
        initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_009_dbunit.xml.zip", dataSource, selenium);

        importTransaction(importFile, EXCEL_IMPORT_TYPE);

        String expectedDataSetFile = "ImportTransactions_002_result_dbunit.xml.zip";

        verifyImportTransactions(expectedDataSetFile);
     }

    private void importTransaction(String importFile, String importType) {
        AdminPage adminPage = navigationHelper.navigateToAdminPage();
        ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
        importTransactionsPage.verifyPage();
        ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importAudiTransactions(importFile, importType);
        importTransactionsConfirmationPage.verifyPage();
    }

    @SuppressWarnings("PMD.SignatureDeclareThrowsException") // one of the dependent methods throws Exception
    private void verifyImportTransactions(String expectedDataSetFile) throws Exception {
        IDataSet expectedDataSet = dbUnitUtilities.getDataSetFromDataSetDirectoryFile(expectedDataSetFile);
        IDataSet databaseDataSet = dbUnitUtilities.getDataSetForTables(dataSource, new String[] { ACCOUNT_PAYMENT,
                                    ACCOUNT_TRXN,
                                    FINANCIAL_TRXN,
                                    LOAN_ACTIVITY_DETAILS,
                                    LOAN_SCHEDULE,
                                    LOAN_SUMMARY,
                                    LOAN_TRXN_DETAIL  });

        dbUnitUtilities.verifyTable(ACCOUNT_TRXN, databaseDataSet, expectedDataSet);
        dbUnitUtilities.verifyTable(LOAN_ACTIVITY_DETAILS, databaseDataSet, expectedDataSet);
        dbUnitUtilities.verifyTable(LOAN_SCHEDULE, databaseDataSet, expectedDataSet);
        dbUnitUtilities.verifyTable(LOAN_SUMMARY, databaseDataSet, expectedDataSet);
        dbUnitUtilities.verifyTable(LOAN_TRXN_DETAIL, databaseDataSet, expectedDataSet);

        String[] orderAccountPaymentByColumns = new String[] {"amount","account_id"};
        dbUnitUtilities.verifyTableWithSort(orderAccountPaymentByColumns,ACCOUNT_PAYMENT, expectedDataSet, databaseDataSet);
        String[] orderFinTrxnByColumns =  new String[]{"posted_amount", "glcode_id"};
        dbUnitUtilities.verifyTableWithSort(orderFinTrxnByColumns,FINANCIAL_TRXN, expectedDataSet, databaseDataSet );

    }

}


text:
package com.spaceproject.components;

public class TagComponent {
    //todo: apply tags to entities, this is an identifier. eg:
    //  character = ["character"]
    //  your character ["player", "character"]
    //  ai character = ["ai", "character"]
    //  you piloting = ["player", "ship"] transfer tag component when enter/exit
    //  ai piloting ship = ["ai", "ship] transfer tag component when enter/exit
    //  ship with no pilot = ["ship"]
    //  planet = ["planet", "<type>"] //type? eg: ["Desert", "Ice", "Ocean", "Lava"]
    //  rogue planet = ["planet", "<type>", "rogue"]
    //  star = ["star", "<type>"] //type? eg: [SuperGiants, Giants, White dwarf, Brown dwarf]

    // Then in debug engine view, if has entity has tag display it.
    // and display in minmap on mouse over/highlight
    String tags[];

}


text:
/**
   # Trampoline

   Reifies continutations onto the heap, rather than the stack. Allows
   efficient tail calls.

   Example usage:

       function loop(n) {
           function inner(i) {
               if(i == n) return bilby.done(n);
               return bilby.cont(function() {
                   return inner(i + 1);
               });
           }

           return bilby.trampoline(inner(0));
       }

   Where `loop` is the identity function for positive numbers. Without
   trampolining, this function would take `n` stack frames.
**/

/**
   ## done(result)

   Result constructor for a continuation.
**/
function done(result) {
    var self = getInstance(this, done);
    self.isDone = true;
    self.result = result;
    return self;
}

/**
   ## cont(thunk)

   Continuation constructor. `thunk` is a nullary closure, resulting
   in a `done` or a `cont`.
**/
function cont(thunk) {
    var self = getInstance(this, cont);
    self.isDone = false;
    self.thunk = thunk;
    return self;
}

/**
   ## trampoline(bounce)

   The beginning of the continuation to call. Will repeatedly evaluate
   `cont` thunks until it gets to a `done` value.
**/
function trampoline(bounce) {
    while(!bounce.isDone) {
        bounce = bounce.thunk();
    }
    return bounce.result;
}

bilby = bilby
    .property('done', done)
    .property('cont', cont)
    .property('trampoline', trampoline);


text:
// Copyright (c) 2021 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.

#ifndef PIVX_BLOCKSTATECATCHER_H
#define PIVX_BLOCKSTATECATCHER_H

#include "consensus/validation.h"
#include "validationinterface.h"

/**
 * Validation interface listener used to get feedback from ProcessNewBlock result.
 */
class BlockStateCatcher : public CValidationInterface
{
public:
    uint256 hash;
    bool found;
    CValidationState state;
    bool isRegistered{false};

    BlockStateCatcher(const uint256& hashIn) : hash(hashIn), found(false), state(){};
    ~BlockStateCatcher() { if (isRegistered) UnregisterValidationInterface(this); }
    void registerEvent() { RegisterValidationInterface(this); isRegistered = true; }
    void setBlockHash(const uint256& _hash) { clear(); hash = _hash; }
    void clear() { hash.SetNull(); found = false; state = CValidationState(); }
    bool stateErrorFound() { return found && state.IsError(); }

protected:
    virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) {
        if (block.GetHash() != hash) return;
        found = true;
        state = stateIn;
    };
};

#endif //PIVX_BLOCKSTATECATCHER_H


text:
declare namespace ಠ_ಠ.clutz.type_renaming_with_externs {
  let args : IArguments ;
  let arrayLike : ArrayLike < number > ;
  let thenable : PromiseLike < string > ;
}
declare module 'goog:type_renaming_with_externs' {
  import type_renaming_with_externs = ಠ_ಠ.clutz.type_renaming_with_externs;
  export = type_renaming_with_externs;
}


text:
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;

namespace NadekoBot.Services.Database.Repositories.Impl
{
    public class DonatorsRepository : Repository<Donator>, IDonatorsRepository
    {
        public DonatorsRepository(DbContext context) : base(context)
        {
        }

        public Donator AddOrUpdateDonator(ulong userId, string name, int amount)
        {
            var donator = _set.Where(d => d.UserId == userId).FirstOrDefault();

            if (donator == null)
            {
                _set.Add(donator = new Donator
                {
                    Amount = amount,
                    UserId = userId,
                    Name = name
                });
            }
            else
            {
                donator.Amount += amount;
                donator.Name = name;
                _set.Update(donator);
            }

            return donator;
        }

        public IEnumerable<Donator> GetDonatorsOrdered() =>
            _set.OrderByDescending(d => d.Amount).ToList();
    }
}


text:
require 'spec_helper'

describe FbGraph2::Edge::Permissions do
  context 'included in User' do
    describe '#permissions' do
      let(:me) { FbGraph2::User.me('token') }
      it 'should return an Array of FbGraph2::Struct::Permission' do
        permissions = mock_graph :get, 'me/permissions', 'user/permissions', access_token: 'token' do
          me.permissions
        end
        permissions.should be_instance_of FbGraph2::Edge
        permissions.should_not be_blank
        permissions.each do |permission|
          permission.should be_instance_of FbGraph2::Struct::Permission
        end
      end
    end
  end
end


text:
title: Adding Tasks
page_title: Adding Tasks | RadGantt for ASP.NET AJAX Documentation
description: Adding Tasks
slug: gantt/functionality/adding-tasks
tags: adding,tasks
published: True
position: 0
---

# Adding Tasks

This help article demonstrates how to add a new task in **RadGantt** tree.

##

To add a task you need to click the **Add Task** button which could be located either at the top or at the bottom of the **TreeList** area. If you didn't select a task before you click the button, then a new task will be added on the last possition of the tree. Otherwise if you select an item and then click the **Add Task** button a menu with three options will appear and you could choose where to add the new task. The first option is to add the task above the selected one, the second option is to add it below the selected one and the last option is to add the new task as a child of the selected one.

The image below shows the menu which appears when click the button to add a task.![gantt-functionality-adding-tasks-1](images/gantt-functionality-adding-tasks-1.png)

# See Also

 * [Tasks]({%slug gantt/structure/tasks%})


text:
package org.apache.openwhisk.core.connector

import scala.concurrent.Future

trait MessageProducer {

  /** Count of messages sent. */
  def sentCount(): Long

  /** Sends msg to topic. This is an asynchronous operation. */
  def send(topic: String, msg: Message, retry: Int = 0): Future[ResultMetadata]

  /** Closes producer. */
  def close(): Unit
}


text:
<?php

abstract class XmlElement
{
    /**
     *
     * @var DOMElement
     */
    protected $xmlElement = null;

    protected $namespaceURI = null;

    public function __construct(DOMElement $element)
    {
        $this->xmlElement   = $element;
        $this->namespaceURI = $element->namespaceURI;

        $this->initialize();
    }

    protected function initialize()
    {
    }

    public function getNamespaceURI()
    {
        return $this->namespaceURI;
    }

    /**
     *
     * @param string $name
     * @param string $ns
     * @return string
     */
    public function getXmlAttribute($name, $ns = null)
    {
        if ( $ns )
            return $this->xmlElement->getAttributeNS($ns, $name);
        else
            return $this->xmlElement->getAttribute($name);
    }

    /**
     *
     * @return string
     */
    public function getXmlTextContent()
    {
        return trim($this->xmlElement->textContent);
    }

    /**
     *
     * @return boolean
     */
    public function hasXmlTextContent()
    {
        return $this->getXmlTextContent() !== '';
    }

    /**
     *
     * @param string $name
     * @param string $ns
     * @return boolean
     */
    public function hasXmlAttribute($name, $ns = null)
    {
        if ( $ns )
            return $this->xmlElement->hasAttributeNS($ns, $name);
        else
            return $this->xmlElement->hasAttribute($name);
    }
}


text:
<metadata>
  <groupId>org.apache</groupId>
  <artifactId>apache</artifactId>
  <versioning>
    <versions>
      <version>4</version>
      <version>3</version>
      <version>7</version>
    </versions>
    <lastUpdated>20110822093529</lastUpdated>
  </versioning>
</metadata>


text:
<?php

$mess=array(
"Text logger" => "Logger Testuale",
"Stores the logs as readable tab delimited text." => "Memorizza i log come testo ben leggibile, delimitato con tabulazione.",
"Logpath" => "Logpath",
"The path to where the logs are kept." => "Il percorso dove memorizzare i log.",
"Logfile" => "Logfile",
"The name of the log file" => "Nome del file di log",
"Files Permissions" => "Permessi File",
"" => "",
"Log Folder" => "Cartella Log",
"Files Name Pattern" => "Maschera Nome File",
);


text:
/*
 * Minio Cloud Storage, (C) 2016 Minio, Inc.
 *
 * 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.
 */

package cmd

import (
	"bytes"
	"io"
	"net"
	"net/rpc"
	"path"
	"strings"

	"github.com/minio/minio/pkg/disk"
)

type networkStorage struct {
	rpcClient *AuthRPCClient
	connected bool
}

const (
	storageRPCPath = "/storage"
)

func isErrorNetworkDisconnect(err error) bool {
	if err == nil {
		return false
	}
	if _, ok := err.(*net.OpError); ok {
		return true
	}
	if err == rpc.ErrShutdown {
		return true
	}
	return false
}

// Converts rpc.ServerError to underlying error. This function is
// written so that the storageAPI errors are consistent across network
// disks as well.
func toStorageErr(err error) error {
	if err == nil {
		return nil
	}

	if isErrorNetworkDisconnect(err) {
		return errDiskNotFound
	}

	switch err.Error() {
	case io.EOF.Error():
		return io.EOF
	case io.ErrUnexpectedEOF.Error():
		return io.ErrUnexpectedEOF
	case errUnexpected.Error():
		return errUnexpected
	case errDiskFull.Error():
		return errDiskFull
	case errVolumeNotFound.Error():
		return errVolumeNotFound
	case errVolumeExists.Error():
		return errVolumeExists
	case errFileNotFound.Error():
		return errFileNotFound
	case errFileNameTooLong.Error():
		return errFileNameTooLong
	case errFileAccessDenied.Error():
		return errFileAccessDenied
	case errIsNotRegular.Error():
		return errIsNotRegular
	case errVolumeNotEmpty.Error():
		return errVolumeNotEmpty
	case errVolumeAccessDenied.Error():
		return errVolumeAccessDenied
	case errCorruptedFormat.Error():
		return errCorruptedFormat
	case errUnformattedDisk.Error():
		return errUnformattedDisk
	case errInvalidAccessKeyID.Error():
		return errInvalidAccessKeyID
	case errAuthentication.Error():
		return errAuthentication
	case errRPCAPIVersionUnsupported.Error():
		return errRPCAPIVersionUnsupported
	case errServerTimeMismatch.Error():
		return errServerTimeMismatch
	}
	return err
}

// Initialize new storage rpc client.
func newStorageRPC(endpoint Endpoint) StorageAPI {
	// Dial minio rpc storage http path.
	rpcPath := path.Join(minioReservedBucketPath, storageRPCPath, endpoint.Path)
	serverCred := globalServerConfig.GetCredential()

	disk := &networkStorage{
		rpcClient: newAuthRPCClient(authConfig{
			accessKey:        serverCred.AccessKey,
			secretKey:        serverCred.SecretKey,
			serverAddr:       endpoint.Host,
			serviceEndpoint:  rpcPath,
			secureConn:       globalIsSSL,
			serviceName:      "Storage",
			disableReconnect: true,
		}),
	}
	// Attempt a remote login.
	disk.connected = disk.rpcClient.Login() == nil
	return disk
}

// Stringer provides a canonicalized representation of network device.
func (n *networkStorage) String() string {
	// Remove the storage RPC path prefix, internal paths are meaningless.
	serviceEndpoint := strings.TrimPrefix(n.rpcClient.ServiceEndpoint(),
		path.Join(minioReservedBucketPath, storageRPCPath))
	// Check for the transport layer being used.
	scheme := "http"
	if n.rpcClient.config.secureConn {
		scheme = "https"
	}
	// Finally construct the disk endpoint in http://<server>/<path> form.
	return scheme + "://" + n.rpcClient.ServerAddr() + path.Join("/", serviceEndpoint)
}

func (n *networkStorage) Close() error {
	n.connected = false
	return toStorageErr(n.rpcClient.Close())
}

func (n *networkStorage) IsOnline() bool {
	return n.connected
}

func (n *networkStorage) call(handler string, args interface {
	SetAuthToken(string)
	SetRPCAPIVersion(semVersion)
}, reply interface{}) error {
	if !n.connected {
		return errDiskNotFound
	}
	if err := n.rpcClient.Call(handler, args, reply); err != nil {
		if isErrorNetworkDisconnect(err) {
			n.connected = false
		}
		return toStorageErr(err)
	}
	return nil
}

// DiskInfo - fetch disk information for a remote disk.
func (n *networkStorage) DiskInfo() (info disk.Info, err error) {
	args := AuthRPCArgs{}
	if err = n.call("Storage.DiskInfoHandler", &args, &info); err != nil {
		return disk.Info{}, err
	}
	return info, nil
}

// MakeVol - create a volume on a remote disk.
func (n *networkStorage) MakeVol(volume string) (err error) {
	reply := AuthRPCReply{}
	args := GenericVolArgs{Vol: volume}
	return n.call("Storage.MakeVolHandler", &args, &reply)
}

// ListVols - List all volumes on a remote disk.
func (n *networkStorage) ListVols() (vols []VolInfo, err error) {
	ListVols := ListVolsReply{}
	if err = n.call("Storage.ListVolsHandler", &AuthRPCArgs{}, &ListVols); err != nil {
		return nil, err
	}
	return ListVols.Vols, nil
}

// StatVol - get volume info over the network.
func (n *networkStorage) StatVol(volume string) (volInfo VolInfo, err error) {
	args := GenericVolArgs{Vol: volume}
	if err = n.call("Storage.StatVolHandler", &args, &volInfo); err != nil {
		return VolInfo{}, err
	}
	return volInfo, nil
}

// DeleteVol - Deletes a volume over the network.
func (n *networkStorage) DeleteVol(volume string) (err error) {
	reply := AuthRPCReply{}
	args := GenericVolArgs{Vol: volume}
	return n.call("Storage.DeleteVolHandler", &args, &reply)
}

// File operations.

func (n *networkStorage) PrepareFile(volume, path string, length int64) (err error) {
	reply := AuthRPCReply{}
	return n.call("Storage.PrepareFileHandler", &PrepareFileArgs{
		Vol:  volume,
		Path: path,
		Size: length,
	}, &reply)
}

// AppendFile - append file writes buffer to a remote network path.
func (n *networkStorage) AppendFile(volume, path string, buffer []byte) (err error) {
	reply := AuthRPCReply{}
	return n.call("Storage.AppendFileHandler", &AppendFileArgs{
		Vol:    volume,
		Path:   path,
		Buffer: buffer,
	}, &reply)
}

// StatFile - get latest Stat information for a file at path.
func (n *networkStorage) StatFile(volume, path string) (fileInfo FileInfo, err error) {
	if err = n.call("Storage.StatFileHandler", &StatFileArgs{
		Vol:  volume,
		Path: path,
	}, &fileInfo); err != nil {
		return FileInfo{}, err
	}
	return fileInfo, nil
}

// ReadAll - reads entire contents of the file at path until EOF, returns the
// contents in a byte slice. Returns buf == nil if err != nil.
// This API is meant to be used on files which have small memory footprint, do
// not use this on large files as it would cause server to crash.
func (n *networkStorage) ReadAll(volume, path string) (buf []byte, err error) {
	if err = n.call("Storage.ReadAllHandler", &ReadAllArgs{
		Vol:  volume,
		Path: path,
	}, &buf); err != nil {
		return nil, err
	}
	return buf, nil
}

// ReadFile - reads a file at remote path and fills the buffer.
func (n *networkStorage) ReadFile(volume string, path string, offset int64, buffer []byte, verifier *BitrotVerifier) (m int64, err error) {
	defer func() {
		if r := recover(); r != nil {
			// Recover any panic from allocation, and return error.
			err = bytes.ErrTooLarge
		}
	}() // Do not crash the server.

	args := ReadFileArgs{
		Vol:      volume,
		Path:     path,
		Offset:   offset,
		Buffer:   buffer,
		Verified: true, // mark read as verified by default
	}
	if verifier != nil {
		args.Algo = verifier.algorithm
		args.ExpectedHash = verifier.sum
		args.Verified = verifier.IsVerified()
	}

	var result []byte
	err = n.call("Storage.ReadFileHandler", &args, &result)

	// Copy results to buffer.
	copy(buffer, result)

	// Return length of result, err if any.
	return int64(len(result)), err
}

// ListDir - list all entries at prefix.
func (n *networkStorage) ListDir(volume, path string) (entries []string, err error) {
	if err = n.call("Storage.ListDirHandler", &ListDirArgs{
		Vol:  volume,
		Path: path,
	}, &entries); err != nil {
		return nil, err
	}
	// Return successfully unmarshalled results.
	return entries, nil
}

// DeleteFile - Delete a file at path.
func (n *networkStorage) DeleteFile(volume, path string) (err error) {
	reply := AuthRPCReply{}
	return n.call("Storage.DeleteFileHandler", &DeleteFileArgs{
		Vol:  volume,
		Path: path,
	}, &reply)
}

// RenameFile - rename a remote file from source to destination.
func (n *networkStorage) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) (err error) {
	reply := AuthRPCReply{}
	return n.call("Storage.RenameFileHandler", &RenameFileArgs{
		SrcVol:  srcVolume,
		SrcPath: srcPath,
		DstVol:  dstVolume,
		DstPath: dstPath,
	}, &reply)
}


text:
"""Emacs lisp for the PyLit code<->text converter.

Defaults and filters for elisp (emacs lisp) code
"""

__docformat__ = 'restructuredtext'

_version = "0.3"

# Requirements
# ------------
#
# Regular espressions are used in `ELISP filters` to match
# the ELisp sectioning comments::

import re

import pylit

# Emacs Lisp filters
# ==================
#
#
# ::

def elisp_code_preprocessor(data):
    """Convert Emacs Lisp comment sectioning markers to reST comments.

    The special headers listed at:

      http://www.gnu.org/software/emacs/elisp/html_node/Library-Headers.html#Library-Headers

    are converted to reST comment lines and prefixed with the comment
    line marker (taken from keyword arguments); all other content is
    passed through unchanged.

    For instance, ELisp code:

      ;;; Code:

      ;; here begins the real coding
      (defun my-elisp-function () ...)

    is translated to:

      ;; .. |elisp> ;;; Code:

      ;; here begins the real coding
      (defun my-elisp-function () ...)
    """

# Regular expression matching the special ELisp headers::

    SECTION_PATTERN = \
        re.compile(';;; *(Change *Log|Code|Commentary|Documentation|History):',\
                       re.IGNORECASE)

# Prepend ``.. |elisp> `` to matching headers, one line at a time::

    for line in data:
        if SECTION_PATTERN.match(line):
            yield pylit.defaults.comment_strings["elisp"] + '.. |elisp> ' + line
        else:
            yield line

def elisp_code_postprocessor(data):
    """Convert specially-marked reST comments to Emacs Lisp code.

    In all lines, the prefix ``.. |elisp> `` (note
    the trailing space!) is stripped from the begin of a line.

    For instance, the block:

      .. |elisp> ;;; Code:
      .. |elisp> (some-elisp-incantation)
      (another-one)

    is translated to:

      ;;; Code:
      (some-elisp-incantation)
      (another-one)
    """

    # Set the prefix to be stripped
    prefix = pylit.defaults.comment_strings["elisp"] + '.. |elisp> '

    for line in data:
        if line.startswith(prefix):
            yield line[len(prefix):]
        else:
            yield line

# Register elisp
# ==============
#
# Add default values for "elisp" to the `defaults` object from PyLit.
#
# The following code assumes that this plug-in is always evaluated in the
# pylit namespace and after pylit.py
#
# ::

pylit.defaults.languages[".el"] = "elisp"
pylit.defaults.comment_strings["elisp"] = ';; '

# Filters
pylit.defaults.preprocessors["elisp2text"] = elisp_code_preprocessor
pylit.defaults.postprocessors["text2elisp"] = elisp_code_postprocessor


text:
using namespace llvm;

namespace {

class X86WinCOFFObjectWriter : public MCWinCOFFObjectTargetWriter {
public:
  X86WinCOFFObjectWriter(bool Is64Bit);
  ~X86WinCOFFObjectWriter() override = default;

  unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
                        const MCFixup &Fixup, bool IsCrossSection,
                        const MCAsmBackend &MAB) const override;
};

} // end anonymous namespace

X86WinCOFFObjectWriter::X86WinCOFFObjectWriter(bool Is64Bit)
    : MCWinCOFFObjectTargetWriter(Is64Bit ? COFF::IMAGE_FILE_MACHINE_AMD64
                                          : COFF::IMAGE_FILE_MACHINE_I386) {}

unsigned X86WinCOFFObjectWriter::getRelocType(MCContext &Ctx,
                                              const MCValue &Target,
                                              const MCFixup &Fixup,
                                              bool IsCrossSection,
                                              const MCAsmBackend &MAB) const {
  unsigned FixupKind = Fixup.getKind();
  if (IsCrossSection) {
    if (FixupKind != FK_Data_4 && FixupKind != llvm::X86::reloc_signed_4byte) {
      Ctx.reportError(Fixup.getLoc(), "Cannot represent this expression");
      return COFF::IMAGE_REL_AMD64_ADDR32;
    }
    FixupKind = FK_PCRel_4;
  }

  MCSymbolRefExpr::VariantKind Modifier = Target.isAbsolute() ?
    MCSymbolRefExpr::VK_None : Target.getSymA()->getKind();

  if (getMachine() == COFF::IMAGE_FILE_MACHINE_AMD64) {
    switch (FixupKind) {
    case FK_PCRel_4:
    case X86::reloc_riprel_4byte:
    case X86::reloc_riprel_4byte_movq_load:
    case X86::reloc_riprel_4byte_relax:
    case X86::reloc_riprel_4byte_relax_rex:
    case X86::reloc_branch_4byte_pcrel:
      return COFF::IMAGE_REL_AMD64_REL32;
    case FK_Data_4:
    case X86::reloc_signed_4byte:
    case X86::reloc_signed_4byte_relax:
      if (Modifier == MCSymbolRefExpr::VK_COFF_IMGREL32)
        return COFF::IMAGE_REL_AMD64_ADDR32NB;
      if (Modifier == MCSymbolRefExpr::VK_SECREL)
        return COFF::IMAGE_REL_AMD64_SECREL;
      return COFF::IMAGE_REL_AMD64_ADDR32;
    case FK_Data_8:
      return COFF::IMAGE_REL_AMD64_ADDR64;
    case FK_SecRel_2:
      return COFF::IMAGE_REL_AMD64_SECTION;
    case FK_SecRel_4:
      return COFF::IMAGE_REL_AMD64_SECREL;
    default:
      Ctx.reportError(Fixup.getLoc(), "unsupported relocation type");
      return COFF::IMAGE_REL_AMD64_ADDR32;
    }
  } else if (getMachine() == COFF::IMAGE_FILE_MACHINE_I386) {
    switch (FixupKind) {
    case FK_PCRel_4:
    case X86::reloc_riprel_4byte:
    case X86::reloc_riprel_4byte_movq_load:
      return COFF::IMAGE_REL_I386_REL32;
    case FK_Data_4:
    case X86::reloc_signed_4byte:
    case X86::reloc_signed_4byte_relax:
      if (Modifier == MCSymbolRefExpr::VK_COFF_IMGREL32)
        return COFF::IMAGE_REL_I386_DIR32NB;
      if (Modifier == MCSymbolRefExpr::VK_SECREL)
        return COFF::IMAGE_REL_AMD64_SECREL;
      return COFF::IMAGE_REL_I386_DIR32;
    case FK_SecRel_2:
      return COFF::IMAGE_REL_I386_SECTION;
    case FK_SecRel_4:
      return COFF::IMAGE_REL_I386_SECREL;
    default:
      Ctx.reportError(Fixup.getLoc(), "unsupported relocation type");
      return COFF::IMAGE_REL_I386_DIR32;
    }
  } else
    llvm_unreachable("Unsupported COFF machine type.");
}

std::unique_ptr<MCObjectTargetWriter>
llvm::createX86WinCOFFObjectWriter(bool Is64Bit) {
  return std::make_unique<X86WinCOFFObjectWriter>(Is64Bit);
}


text:
// -*- C++ -*-
//
// Copyright (C) 2009-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

/** @file profile/impl/profiler_hash_func.h
 *  @brief Data structures to represent profiling traces.
 */

// Written by Lixia Liu and Silvius Rus.

#ifndef _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H
#define _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H 1

#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"

namespace __gnu_profile
{
  /** @brief A hash performance instrumentation line in the object table.  */
  class __hashfunc_info
  : public __object_info_base
  {
  public:
    __hashfunc_info()
    : _M_longest_chain(0), _M_accesses(0), _M_hops(0) { }

    __hashfunc_info(const __hashfunc_info& __o)
    : __object_info_base(__o), _M_longest_chain(__o._M_longest_chain),
      _M_accesses(__o._M_accesses), _M_hops(__o._M_hops) { }

    __hashfunc_info(__stack_t __stack)
    : __object_info_base(__stack), _M_longest_chain(0),
      _M_accesses(0), _M_hops(0) { }

    virtual ~__hashfunc_info() { }

    void
    __merge(const __hashfunc_info& __o)
    {
      _M_longest_chain  = std::max(_M_longest_chain, __o._M_longest_chain);
      _M_accesses      += __o._M_accesses;
      _M_hops          += __o._M_hops;
    }

    void
    __destruct(std::size_t __chain, std::size_t __accesses,
	       std::size_t __hops)
    {
      _M_longest_chain  = std::max(_M_longest_chain, __chain);
      _M_accesses      += __accesses;
      _M_hops          += __hops;
    }

    void
    __write(FILE* __f) const
    { std::fprintf(__f, "%Zu %Zu %Zu\n", _M_hops,
		   _M_accesses, _M_longest_chain); }

    float
    __magnitude() const
    { return static_cast<float>(_M_hops); }

    std::string
    __advice() const
    { return "change hash function"; }

  private:
    std::size_t _M_longest_chain;
    std::size_t _M_accesses;
    std::size_t _M_hops;
  };

  /** @brief A hash performance instrumentation line in the stack table.  */
  class __hashfunc_stack_info
  : public __hashfunc_info
  {
  public:
    __hashfunc_stack_info(const __hashfunc_info& __o)
    : __hashfunc_info(__o) { }
  };

  /** @brief Hash performance instrumentation producer.  */
  class __trace_hash_func
  : public __trace_base<__hashfunc_info, __hashfunc_stack_info>
  {
  public:
    __trace_hash_func()
    : __trace_base<__hashfunc_info, __hashfunc_stack_info>()
    { __id = "hash-distr"; }

    ~__trace_hash_func() {}

    // Insert a new node at construct with object, callstack and initial size.
    void
    __insert(__object_t __obj, __stack_t __stack)
    { __add_object(__obj, __hashfunc_info(__stack)); }

    // Call at destruction/clean to set container final size.
    void
    __destruct(const void* __obj, std::size_t __chain,
	       std::size_t __accesses, std::size_t __hops)
    {
      if (!__is_on())
	return;

      // First find the item from the live objects and update the informations.
      __hashfunc_info* __objs = __get_object_info(__obj);
      if (!__objs)
	return;

      __objs->__destruct(__chain, __accesses, __hops);
      __retire_object(__obj);
    }
  };

  inline void
  __trace_hash_func_init()
  { _GLIBCXX_PROFILE_DATA(_S_hash_func) = new __trace_hash_func(); }

  inline void
  __trace_hash_func_report(FILE* __f, __warning_vector_t& __warnings)
  {
    if (_GLIBCXX_PROFILE_DATA(_S_hash_func))
      {
	_GLIBCXX_PROFILE_DATA(_S_hash_func)->__collect_warnings(__warnings);
	_GLIBCXX_PROFILE_DATA(_S_hash_func)->__write(__f);
      }
  }

  inline void
  __trace_hash_func_construct(const void* __obj)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_hash_func)->__insert(__obj, __get_stack());
  }

  inline void
  __trace_hash_func_destruct(const void* __obj, std::size_t __chain,
			     std::size_t __accesses, std::size_t __hops)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_hash_func)->__destruct(__obj, __chain,
						    __accesses, __hops);
  }

} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H */


text:
namespace arangodb {

class GeneralRequest;

// Note that the value 0 is reserved and means unset.
struct SyncerId {
  TRI_voc_tick_t value;

  std::string toString() const;
  static SyncerId fromRequest(GeneralRequest const& request);

  inline bool operator==(SyncerId other) const noexcept {
    return value == other.value;
  }
};
}

#endif // ARANGOD_REPLICATION_SYNCERID_H


text:
package viewhelpers

import (
	"html/template"
	"path/filepath"
	"testing"
)

var getFilePathsTests = []struct {
	currentPath string
	extension   string
	expected    []string
	expectErr   error
}{
	{"../../static/js", ".js", []string{"pivotal.js"}, nil},
	{"../../static/js", ".gitkeep", []string{".gitkeep"}, nil},
	{"../../static/css", ".css", []string{"styles.css"}, nil},
}

func TestGetFilePaths(t *testing.T) {
	for _, tt := range getFilePathsTests {
		rootPath, err := filepath.Abs(tt.currentPath)
		if err != nil {
			t.Fatalf("Failed to get absolute file path of %s. err: %s", tt.currentPath, err)
		}
		fps, err := getFilePaths(rootPath, tt.extension)
		if err != nil {
			if tt.expectErr != nil && err != tt.expectErr {
				t.Errorf("Error while getting (%s) files from %s. err: %s", tt.extension, rootPath, err)
			}
		}
		if len(fps) != len(tt.expected) {
			t.Errorf("Failed to get correct number of (%s) files from path: got: %d, want: %d", tt.extension, len(fps), len(tt.expected))
		}
		for i, _ := range fps {
			if fps[i] != tt.expected[i] {
				t.Errorf("Failed to get correct base file path for file. got: %s, want: %s", fps[i], tt.expected[i])
			}
		}
	}
}

var stylesheetTemplateTests = []struct {
	currentPath string
	expected    string
	expectErr   error
}{
	{"../../static/js", "", nil},
	{"../../static/css", "<link href='/static/css/styles.css' rel='stylesheet'>", nil},
}

func TestMakeStylesheetTemplate(t *testing.T) {
	for _, tt := range stylesheetTemplateTests {
		rootPath, err := filepath.Abs(tt.currentPath)
		if err != nil {
			t.Fatalf("Failed to get absolute file path of %s. err: %s", tt.currentPath, err)
		}
		tmpl := makeStylesheetTemplate(rootPath)
		var expectTmpl = template.HTML(tt.expected)
		if tmpl != expectTmpl {
			t.Errorf("Failed to make right HTML template structure for stylesheet. got: %v, want: %v", tmpl, expectTmpl)
		}
	}
}

var javascriptTemplateTests = []struct {
	currentPath string
	expected    string
	expectErr   error
}{
	{"../../static/js", "<script src='/static/js/pivotal.js'></script>", nil},
	{"../../static/css", "", nil},
}

func TestMakeJavascriptTemplate(t *testing.T) {
	for _, tt := range javascriptTemplateTests {
		rootPath, err := filepath.Abs(tt.currentPath)
		if err != nil {
			t.Fatalf("Failed to get absolute file path of %s. err: %s", tt.currentPath, err)
		}
		tmpl := makeJavascriptTemplate(rootPath)
		var expectTmpl = template.HTML(tt.expected)
		if tmpl != expectTmpl {
			t.Errorf("Failed to make right HTML template structure for javascript. got: %v, want: %v", tmpl, expectTmpl)
		}
	}
}


text:
export class RateVideoDTO {
  public _filmId: number;
  public _rate: number;

  constructor() {

  }

  public get filmId(): number {
    return this._filmId;
  }

  public set filmId(value: number) {
    this._filmId = value;
  }

  public get rate(): number {
    return this._rate;
  }

  public set rate(value: number) {
    this._rate = value;
  }
}


text:
import angular from 'angular'

import wrapActionCreators from '../utils/wrapActionCreators'
import createWrappedComponent from '../utils/wrappedComponentFactory'
import createWrapperComponent from '../utils/wrapperComponentFactory'
import { getDisplayName, getElementName } from '../utils/stringUtils'

const defaultMapStateToBindings = state => ({})
const defaultMapDispatchToBindings = dispatch => ({ dispatch })

function connect (mapStateToBindings, mapDispatchToBindings) {
  const shouldSubscribe = Boolean(mapStateToBindings)
  const mapState = mapStateToBindings || defaultMapStateToBindings

  let mapDispatch

  if (typeof mapDispatchToBindings === 'function') {
    mapDispatch = mapDispatchToBindings
  } else if (!mapDispatchToBindings) {
    mapDispatch = defaultMapDispatchToBindings
  } else {
    mapDispatch = wrapActionCreators(mapDispatchToBindings)
  }

  return function wrapWithConnect (GivenComponent) {
    const { bindings, name, transclude } = GivenComponent
    const wrappedComponentName = `connect${getDisplayName(name)}`
    const wrappedElementName = `connect-${getElementName(name)}`

    const WrappedComponent = createWrappedComponent(GivenComponent)

    angular.module('angular-redux.connectedComponents')
      .component(wrappedComponentName, WrappedComponent)

    return createWrapperComponent({
      bindings,
      mapState,
      transclude,
      mapDispatch,
      shouldSubscribe,
      wrappedElementName,
      wrappedComponentName
    })
  }
}

export default connect


text:
FROM docker.io/centos:centos7
# FROM openshift/base-centos7
LABEL maintainer="tangfeixiong <tangfx128@gmail.com>" \
      project="https://github.com/tangfeixiong/go-to-kubernetes" \
      name="web-console" \
      annotation='{"example.com/console-k8s":"web-console"}' \
      tag="centos java1.8 openjdk springboot"

ARG jarTgt
ARG javaUri
ARG javaOpt

COPY /maven/${jarTgt:-web-console.jar} /web-console.jar

ENV JAVA_OPTIONS="${javaOpt:-'-Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m'}" \
    GO_TO_KUBERNETES="console-k8s"

RUN set -x \
    && install_Pkgs=" \
        tar \
        unzip \
        bc \
        which \
        lsof \
        java-1.8.0-openjdk-headless \
    " \
    && yum install -y $install_Pkgs \
    && yum clean all -y \
    && echo

# This default user is created in the openshift/base-centos7 image
# USER 1001

CMD java -Djava.security.egd=file:/dev/./urandom $JAVA_OPTIONS -jar /web-console.jar


text:
require 'spec_helper'

describe Speedio::Request do
  describe "#post" do
    let(:params) { { to: "554888303054", content: "VCR cleaning" } }

    def do_post
      subject.post params
    end

    it "should return a parsed response" do
      VCR.use_cassette('speedio_request') do
        response = do_post
        response.to.should eq "554888303054"
      end
    end

    context "when an error occurs" do
      let(:params) { { to: '5511971889422' } }

      it "should raise an exception" do
        VCR.use_cassette('speedio_request_error') do
          expect { do_post }.to raise_error Speedio::Error, 'Invalid request'
        end
      end
    end
  end

  describe "#messages" do
    let(:params) { { from: "554888303054", timestamp: '1424803496' } }

    def do_get
      subject.messages params
    end

    it "should return a parsed response" do
      VCR.use_cassette('speedio_messages') do
        response = do_get
        response.messages.first['content'].should eq "Opaaa"
      end
    end
  end
end


text:
import PropTypes from 'prop-types';

const {any, bool, func, shape, string, object, number, array} = PropTypes;

export const textfieldPropTypes = {
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
    })
};
export const buttonPropType={
    definition:shape({
        buttonType: string.isRequired,
        label: string.isRequired,
    })
};
export const cascadeSelectPropType={
    definition:shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        optionDataKey: string.isRequired,
        //rules: array.isRequired,
    })
};
export const checkBoxGroupPropType={
    definition:shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        optionDataKey: string.isRequired,
        //rules: array.isRequired,
    })
};
export const datePickerPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
        format:string.isRequired,
    })
};
export const dynamicControlPropType={
    definition:shape({
        label:string.isRequired,
        defaultCount:number.isRequired,
        template:object.isRequired,
    })
};
export const inputNumberPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
    })
};
export const monthPickerPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
        format:string.isRequired,
    })
};
export const radioGroupPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
    })
};
export const rangePickerPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
        format:string.isRequired,
    })
};
export const selectPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        optionDataKey:string.isRequierd,
        //rules: array.isRequired,
    })
};
export const timePickerProType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
        format:string.isRequired,
    })
};
export const uploadPropType={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        label: string.isRequired,
        //rules: array.isRequired,
        fileType:string.isRequired,
        action:string.isRequired,
        multiple:bool.isRequired,
        showUploadList:bool.isRequired,
    })
};
export const validationButtonProptype={
    definition: shape({
        name: string.isRequired,
        path: string.isRequired,
        value: string.isRequired,
        paths: array.isRequired,
        APIPath:string.isRequired,
    })
};

export const containerProptypes = {
    definition: shape({
        label: string.isRequired,
        components: array.isRequired
    })
};


text:
class Gridr::Generator
  class << self
    def generate(opts = {})
      self.new(opts).generate
    end
  end

  def initialize(opts = {})
    @opts = defaults.merge(opts)
  end

  def generate
    File.open(@opts[:file_name], 'w+') { |f| f.write(grid_css) }
  end

  private

  def grid_css
    css = [".row { overflow: hidden; }"]
    css_classes = []
    css_for_columns = []
    css_for_left_offsets = []
    css_for_right_offsets = []

    (1..@opts[:columns]).to_a.map do |n|
      class_name = @opts[:column_class].gsub("NUM", n.to_s)
      css_classes << class_name
      css_for_columns << "#{class_name} { width: #{numbered_column_width(n)}%; }"

      left_offset_class_name = @opts[:left_offset_class].gsub("NUM", n.to_s)
      right_offset_class_name = @opts[:right_offset_class].gsub("NUM", n.to_s)

      unless n == @opts[:columns]
        css_for_left_offsets << "#{left_offset_class_name} {margin-left: #{numbered_column_width(n) + (@opts[:margin] + @opts[:padding]) * 2}; }"
        css_for_right_offsets << "#{right_offset_class_name} { margin-right: #{numbered_column_width(n) + (@opts[:margin] + @opts[:padding]) * 2 }; }"
      end
    end

    shared_styles = css_classes.join(', ') << " { float: left; margin: #{@opts[:margin]}; padding: #{@opts[:padding]}; }"

    css << shared_styles << css_for_columns << css_for_left_offsets << css_for_right_offsets

    css.join("\n\n")
  end

  def numbered_column_width(n)
    single_column_width * n + (@opts[:margin] + @opts[:padding]) * 2 * (n - 1)
  end

  def single_column_width
    (100.0 / @opts[:columns]) - (@opts[:margin] + @opts[:padding]) * 2
  end

  def defaults
    {
      file_name: 'grid.css',
      columns: 12,
      margin: 0.5,
      padding: 0,
      column_class: '.col-NUM',
      left_offset_class: '.lo-NUM',
      right_offset_class: '.ro-NUM'
    }
  end
end


text:
package com.applicationforlife.jamesnikolaidis.thesis_farmers_helper.Dialogs_Help_Classes;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.applicationforlife.jamesnikolaidis.thesis_farmers_helper.Dialogs.DialogClassGr;
import com.applicationforlife.jamesnikolaidis.thesis_farmers_helper.Dialogs.Dialogs_Class;
import com.applicationforlife.jamesnikolaidis.thesis_farmers_helper.R;

import java.util.ArrayList;

/**
 * Created by James Nikolaidis on 1/31/2017.
 */

public class FarmingListOptionActivate_Class {

        private DialogClassGr dialogClassGr;
        private Dialogs_Class dialogs_class;
        public FarmingListOptionActivate_Class(){}

    public void FarmingListOptionActivate(final Context context, String BeforeOption, final Activity activity, final SharedPreferences.Editor editor , final ArrayList<Button> ButtonArray , TextView mSolutionFor , final ListView listView) {
        final ArrayList<Integer> imageid = new ArrayList<>();

        dialogClassGr = new DialogClassGr();
        switch (BeforeOption) {
            case "Λαχανικά":
                imageid.clear();
                mSolutionFor.setText(activity.getResources().getString(R.string.ThirdButtonTextGr));
                imageid.add(activity.getResources().getIdentifier("cucumber","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("artichoke","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cauliflower","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("spinach","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("onion","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cabbage","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("broccoli","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("tomato","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.VegetablesGr), activity);

                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;
            case "Όσπρια":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("beans","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("lentils","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("chickpeas","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peas","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.LegumesGr), activity);

                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;
            case "Φρούτα":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("apple","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("strawberry","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("pear","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("apriums","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("watermelon","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cherry","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("lemon","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("mandarin","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peach","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("fig","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("orange","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));

                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.FruitsGr), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView,ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;
            case "Δημητριακά":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("rice","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("wheat","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("oats","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("corn","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("barley","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));

                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.CerealsGr), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;
            case "Ελιά":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("olives","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));

                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.olives), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;

            default:
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("almond","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peanut","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("hazel_nuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("chestnuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("walnuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid, listView,ButtonArray.get(2), activity.getResources().getStringArray(R.array.Tree_NutsGr), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogClassGr.CreateDialogForProblem(context,activity.getResources().getString(R.string.ThirdButtonTextGr),imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_CultureGr), activity);
                    }
                });
                dialogClassGr.BeforeOption2 =BeforeOption;
                break;

        }

    }

    public void FarmingListOptionActivateEn(final Context context, String BeforeOption, final Activity activity, final SharedPreferences.Editor editor , final ArrayList<Button> ButtonArray , final ListView listView) {
        final ArrayList<Integer> imageid = new ArrayList<>();
        dialogs_class = new Dialogs_Class();

        switch (BeforeOption) {
            case "Vegetables":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("cucumber","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("artichoke","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cauliflower","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("spinach","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("onion","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cabbage","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("broccoli","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("tomato","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Vegetables), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;
            case "Legumes":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("beans","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("lentils","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("chickpeas","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peas","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Legumes), activity);

                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;
            case "Fruits":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("apple","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("strawberry","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("pear","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("apriums","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("watermelon","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("cherry","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("lemon","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("mandarin","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peach","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("fig","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("orange","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Fruits), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView,ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;
            case "Cereal":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("rice","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("wheat","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("oats","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("corn","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("barley","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Cereals), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;
            case "Olives":
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("olives","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.olives), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;

            default:
                imageid.clear();
                imageid.add(activity.getResources().getIdentifier("almond","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("peanut","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("hazel_nuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("chestnuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                imageid.add(activity.getResources().getIdentifier("walnuts","drawable","com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid, listView,ButtonArray.get(2), activity.getResources().getStringArray(R.array.Tree_Nuts), activity);
                ButtonArray.get(1).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        imageid.clear();
                        imageid.add(activity.getResources().getIdentifier("vegetables_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("legumes_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("fruits_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("olives_amin_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("cereal_main_photo", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        imageid.add(activity.getResources().getIdentifier("nuts", "drawable", "com.applicationforlife.jamesnikolaidis.thesis_farmers_helper"));
                        editor.putBoolean("Clicked1",true);
                        editor.commit();
                        editor.putBoolean("Clicked",false);
                        editor.commit();
                        dialogs_class.CreateDialogForProblem(context,"Solutuion For",imageid,listView, ButtonArray.get(2), activity.getResources().getStringArray(R.array.Farming_Culture), activity);
                    }
                });
                dialogs_class.BeforeOption2 =BeforeOption;
                break;

        }

    }

}


text:
package com.amazonaws.services.workspaces.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.workspaces.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ImportClientBrandingRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ImportClientBrandingRequestMarshaller {

    private static final MarshallingInfo<String> RESOURCEID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ResourceId").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPEWINDOWS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeWindows").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPEOSX_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeOsx").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPEANDROID_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeAndroid").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPEIOS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeIos").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPELINUX_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeLinux").build();
    private static final MarshallingInfo<StructuredPojo> DEVICETYPEWEB_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeviceTypeWeb").build();

    private static final ImportClientBrandingRequestMarshaller instance = new ImportClientBrandingRequestMarshaller();

    public static ImportClientBrandingRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ImportClientBrandingRequest importClientBrandingRequest, ProtocolMarshaller protocolMarshaller) {

        if (importClientBrandingRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(importClientBrandingRequest.getResourceId(), RESOURCEID_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeWindows(), DEVICETYPEWINDOWS_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeOsx(), DEVICETYPEOSX_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeAndroid(), DEVICETYPEANDROID_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeIos(), DEVICETYPEIOS_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeLinux(), DEVICETYPELINUX_BINDING);
            protocolMarshaller.marshall(importClientBrandingRequest.getDeviceTypeWeb(), DEVICETYPEWEB_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<out>main stylesheet, should have highest precedence</out>