text:
namespace {

constexpr uint32_t kVendorId = 25;
constexpr uint32_t kProductId = 17;
constexpr uint32_t kRevision = 92;
constexpr uint64_t kFwVersion = 0xA0EF1;
constexpr uint64_t kSizeMb = 1024;
constexpr uint64_t kSize = kSizeMb * 1e6;
constexpr char kModel[] = "fabulous";
constexpr char kSubsystem[] = "block:nvme:pcie";
constexpr auto kType =
    metrics::SystemProfileProto::Hardware::InternalStorageDevice::TYPE_NVME;
constexpr auto kMojoPurpose =
    ash::cros_healthd::mojom::StorageDevicePurpose::kSwapDevice;
constexpr auto kUmaPurpose =
    metrics::SystemProfileProto::Hardware::InternalStorageDevice::PURPOSE_SWAP;

}  // namespace

class CrosHealthdMetricsProviderTest : public testing::Test {
 public:
  CrosHealthdMetricsProviderTest() {
    ash::cros_healthd::FakeCrosHealthd::Initialize();

    ash::cros_healthd::mojom::NonRemovableBlockDeviceInfo storage_info;
    storage_info.vendor_id =
        ash::cros_healthd::mojom::BlockDeviceVendor::NewNvmeSubsystemVendor(
            kVendorId);
    storage_info.product_id =
        ash::cros_healthd::mojom::BlockDeviceProduct::NewNvmeSubsystemDevice(
            kProductId);
    storage_info.revision =
        ash::cros_healthd::mojom::BlockDeviceRevision::NewNvmePcieRev(
            kRevision);
    storage_info.firmware_version =
        ash::cros_healthd::mojom::BlockDeviceFirmware::NewNvmeFirmwareRev(
            kFwVersion);
    storage_info.size = kSize;
    storage_info.name = kModel;
    storage_info.type = kSubsystem;
    storage_info.purpose = kMojoPurpose;

    std::vector<ash::cros_healthd::mojom::NonRemovableBlockDeviceInfoPtr> devs;
    devs.push_back(storage_info.Clone());
    auto info = ash::cros_healthd::mojom::TelemetryInfo::New();
    info->block_device_result = ash::cros_healthd::mojom::
        NonRemovableBlockDeviceResult::NewBlockDeviceInfo(std::move(devs));
    ash::cros_healthd::FakeCrosHealthd::Get()
        ->SetProbeTelemetryInfoResponseForTesting(info);
  }

  ~CrosHealthdMetricsProviderTest() override {
    ash::cros_healthd::FakeCrosHealthd::Shutdown();
  }

 protected:
  base::test::TaskEnvironment task_environment_{
      base::test::TaskEnvironment::TimeSource::MOCK_TIME};
};

TEST_F(CrosHealthdMetricsProviderTest, EndToEnd) {
  base::RunLoop run_loop;
  CrosHealthdMetricsProvider provider;
  provider.AsyncInit(base::BindOnce(
      [](base::OnceClosure callback) { std::move(callback).Run(); },
      run_loop.QuitClosure()));
  run_loop.Run();

  ASSERT_TRUE(provider.IsInitialized());
  metrics::SystemProfileProto profile;
  provider.ProvideSystemProfileMetrics(&profile);

  const auto& hardware = profile.hardware();
  ASSERT_EQ(1, hardware.internal_storage_devices_size());

  const auto& dev = hardware.internal_storage_devices(0);

  EXPECT_EQ(kVendorId, dev.vendor_id());
  EXPECT_EQ(kProductId, dev.product_id());
  EXPECT_EQ(kRevision, dev.revision());
  EXPECT_EQ(kFwVersion, dev.firmware_version());
  EXPECT_EQ(kSizeMb, dev.size_mb());
  EXPECT_EQ(kModel, dev.model());
  EXPECT_EQ(kType, dev.type());
  EXPECT_EQ(kUmaPurpose, dev.purpose());
}

TEST_F(CrosHealthdMetricsProviderTest, EndToEndTimeout) {
  ash::cros_healthd::FakeCrosHealthd::Get()->SetCallbackDelay(
      CrosHealthdMetricsProvider::GetTimeout() + base::Seconds(5));

  base::RunLoop run_loop;
  CrosHealthdMetricsProvider provider;
  provider.AsyncInit(base::BindOnce(
      [](base::OnceClosure callback) { std::move(callback).Run(); },
      run_loop.QuitClosure()));

  // FastForward by timeout period.
  task_environment_.FastForwardBy(CrosHealthdMetricsProvider::GetTimeout());
  run_loop.Run();

  EXPECT_FALSE(provider.IsInitialized());

  metrics::SystemProfileProto profile;
  provider.ProvideSystemProfileMetrics(&profile);

  const auto& hardware = profile.hardware();
  EXPECT_EQ(0, hardware.internal_storage_devices_size());
}


text:
<?php
require_once("report.php");
class Inventory_low extends Report
{
	function __construct()
	{
		parent::__construct();
	}

	public function getDataColumns()
	{
		return array($this->lang->line('reports_item_name'), $this->lang->line('reports_item_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_reorder_level'), $this->lang->line('reports_stock_location'));
	}

    public function getData(array $inputs)
    {
        $this->db->from('items');
        $this->db->join('item_quantities','items.item_id=item_quantities.item_id');
        $this->db->join('stock_locations','item_quantities.location_id=stock_locations.location_id');

        $this->db->select('name, item_number, reorder_level, item_quantities.quantity,description,location_name');

        $this->db->where('item_quantities.quantity <= reorder_level');
        $this->db->where('items.deleted = 0');

        $this->db->order_by('name');

        return $this->db->get()->result_array();

    }

	public function getSummaryData(array $inputs)
	{
		return array();
	}
}
?>

redpajama_set_name: RedPajamaGithub


text:
package org.osc.core.broker.service.api;

import org.osc.core.broker.service.dto.openstack.HostAggregateDto;
import org.osc.core.broker.service.request.BaseOpenStackRequest;
import org.osc.core.broker.service.response.ListResponse;

public interface ListHostAggregateServiceApi
        extends ServiceDispatcherApi<BaseOpenStackRequest, ListResponse<HostAggregateDto>> {
}


text:
<?php

namespace GetOptionKit\Exception;

use Exception;

class InvalidOptionValueException extends Exception
{
}


text:
module Azure::DevTestLabs::Mgmt::V2018_09_15
  module Models
    #
    # Policy violation.
    #
    class PolicyViolation

      include MsRestAzure

      # @return [String] The code of the policy violation.
      attr_accessor :code

      # @return [String] The message of the policy violation.
      attr_accessor :message

      #
      # Mapper for PolicyViolation class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'PolicyViolation',
          type: {
            name: 'Composite',
            class_name: 'PolicyViolation',
            model_properties: {
              code: {
                client_side_validation: true,
                required: false,
                serialized_name: 'code',
                type: {
                  name: 'String'
                }
              },
              message: {
                client_side_validation: true,
                required: false,
                serialized_name: 'message',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package com.opengamma.analytics.financial.model.finitedifference;

import java.util.Arrays;

import com.opengamma.analytics.math.FunctionUtils;
import com.opengamma.analytics.math.interpolation.Interpolator1D;
import com.opengamma.analytics.math.interpolation.NaturalCubicSplineInterpolator1D;
import com.opengamma.analytics.math.interpolation.data.Interpolator1DCubicSplineDataBundle;
import com.opengamma.analytics.math.interpolation.data.Interpolator1DDataBundle;
import com.opengamma.util.ArgumentChecker;

/**
 *
 */
public class UniformMeshing extends MeshingFunction {

  private static final Interpolator1D INTERPOLATOR = new NaturalCubicSplineInterpolator1D();
  private final Interpolator1DDataBundle _db;
  private final int[] _fpIndicies;
  private final double[] _fpValues;

  /**
   * Crates a set of points (mesh) equally spaced between 0.0 and 1.0 inclusive.
   *
   * @param nPoints
   *          Number of points in the mesh
   */
  public UniformMeshing(final int nPoints) {
    super(nPoints);
    _db = null;
    _fpIndicies = null;
    _fpValues = null;
  }

  /**
   * Crates a set of points (mesh) approximately equally spaced between 0.0 and 1.0 inclusive, such that the specified fixedPoints are included as
   * points.
   *
   * @param nPoints
   *          Number of points in the mesh
   * @param fixedPoints
   *          Set of points that must be in the mesh. Note: the mesh can be far from uniform if fixed-points are close together and/or a small number of
   *          points are used
   */
  public UniformMeshing(final int nPoints, final double[] fixedPoints) {
    super(nPoints);
    ArgumentChecker.notNull(fixedPoints, "null fixed Points");

    // sort and remove duplicates, preserving order
    _fpValues = FunctionUtils.unique(fixedPoints);
    // remove any fixed points on the boundary
    // int nn = temp.length;
    // if (nn > 0 && temp[0] == 0.0) {
    // temp = Arrays.copyOfRange(temp, 1, nn - 1);
    // }
    // nn = temp.length;
    // if (nn > 0 && temp[nn - 1] == 1.0) {
    // temp = Arrays.copyOfRange(temp, 0, nn - 2);
    // }
    // _fpValues = temp;
    final int m = _fpValues.length;
    if (m == 0) {
      _db = null;
      _fpIndicies = null;
    } else {
      if (_fpValues[0] <= 0.0 || _fpValues[m - 1] >= 1.0) {
        throw new IllegalArgumentException("fixedPoints must be between 0.0 and 1.0 exclusive");
      }
      if (super.getNumberOfPoints() - m < 2) {
        throw new IllegalArgumentException("insufficient points to form grid");
      }

      _fpIndicies = new int[m];
      for (int ii = 0; ii < m; ii++) {
        _fpIndicies[ii] = (int) Math.round((nPoints - 1) * _fpValues[ii]);
      }
      // prevent points sharing index
      if (m != FunctionUtils.unique(_fpIndicies).length) {
        for (int ii = 1; ii < m; ii++) {
          final int step = _fpIndicies[ii] - _fpIndicies[ii - 1];
          if (step < 1) {
            _fpIndicies[ii] += 1 - step;
          }
        }
      }

      if (_fpIndicies[0] == 0) {
        _fpIndicies[0] = 1;
        for (int ii = 1; ii < m; ii++) {
          if (_fpIndicies[ii - 1] == _fpIndicies[ii]) {
            _fpIndicies[ii] = _fpIndicies[ii] + 1;
          } else {
            break; // no more work to do
          }
        }
      }

      if (_fpIndicies[m - 1] >= nPoints - 1) {
        _fpIndicies[m - 1] = nPoints - 2;
        for (int ii = 1; ii < m - 1; ii++) {
          final int step = _fpIndicies[m - ii] - _fpIndicies[m - ii - 1];
          if (step < 1) {
            _fpIndicies[m - ii - 1] += step - 1;
          } else {
            break;
          }
        }
      }

      final double[] x = new double[m + 2];
      final double[] y = new double[m + 2];
      x[0] = 0.0;
      for (int ii = 0; ii < m; ii++) {
        x[ii + 1] = _fpIndicies[ii];
      }
      x[m + 1] = nPoints - 1;
      y[0] = 0.0;
      System.arraycopy(_fpValues, 0, y, 1, m);
      y[m + 1] = 1.0;
      final Interpolator1DDataBundle data = INTERPOLATOR.getDataBundleFromSortedArrays(x, y);
      final double grad = 1.0 / (nPoints - 1);
      _db = new Interpolator1DCubicSplineDataBundle(data, grad, grad);
    }
  }

  protected int getFixedPointIndex(final int i) {
    return Arrays.binarySearch(_fpIndicies, i);
  }

  @Override
  public Double evaluate(final Integer x) {
    if (x < 0 || x >= getNumberOfPoints()) {
      throw new IllegalArgumentException("index out of range");
    }

    if (x == 0) {
      return 0.0;
    }
    if (x == getNumberOfPoints() - 1) {
      return 1.0;
    }

    if (_db == null) {
      return (double) x / (getNumberOfPoints() - 1);
    }

    // avoid interpolator lookup if requested value is a fixed value
    final int index = getFixedPointIndex(x);
    if (index >= 0) {
      return _fpValues[index];
    }

    return INTERPOLATOR.interpolate(_db, (double) x);
  }

}


text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.dummy.fooforandroid;

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int icon=0x7f020000;
        public static final int script_logo_48=0x7f020001;
        public static final int stat_sys_warning=0x7f020002;
    }
    public static final class id {
        public static final int color_layout=0x7f060000;
        public static final int progress_bar=0x7f060001;
    }
    public static final class layout {
        public static final int dialog=0x7f030000;
        public static final int main=0x7f030001;
    }
    public static final class raw {
        public static final int script=0x7f040000;
    }
    public static final class string {
        public static final int app_name=0x7f050001;
        public static final int hello=0x7f050000;
        public static final int loading=0x7f050002;
    }
}


text:
package apfe.dsl.slf;

import apfe.runtime.Acceptor;
import apfe.runtime.Repetition;
import apfe.runtime.Sequence;
import static apfe.dsl.slf.Operator.factory;

public class Library extends Acceptor {

    public Library() {
    }

    @Override
    protected boolean accepti() {
        //Library <- Spacing K_LIBRARY LPAREN LibraryName RPAREN
        //              LCURLY LibraryEle* RCURLY
        Repetition r1 = new Repetition(new LibraryEle(), Repetition.ERepeat.eZeroOrMore);
        Sequence s1 = new Sequence(new Spacing(), factory(Operator.EOp.K_LIBRARY),
                factory(Operator.EOp.LPAREN), new LibraryName(), factory(Operator.EOp.RPAREN),
                factory(Operator.EOp.LCURLY), r1, factory(Operator.EOp.RCURLY));
        boolean match = (null != (s1 = match(s1)));
        if (match) {
            //todo
        }
        return match;
    }

    @Override
    public String toString() {
        return null;//todo Util.toString(m_id, stLeftArrow, m_expr, m_codeBlk).toString();
    }

    @Override
    public Acceptor create() {
        return new Library();
    }
}


text:
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FamilyCongress2015.Models;
using FamilyCongress2015.DAL;
using System;
using Newtonsoft.Json;
using DropNet;
using DropNet.Models;
using DropNet.Exceptions;
using System.Net.Mail;
using System.Net;

namespace FamilyCongress2015.Controllers
{
	public class HomeController : Controller
	{
		#region DropBox Api
		private static string DropBoxAccessToken = "U_IaYulTQ4YAAAAAAAACrwasLc3NcTLom1FnxpPZ1zE6I5hh_EFMTlTpzYd95TGH";
		private static string DropBoxApiKey="srxkms5181bo1kj";
		private static string DropBoxApiSecret = "9n2000p9utgrwx5";
		private DropNetClient _dropBoxClient = new DropNetClient(DropBoxApiKey, DropBoxApiSecret, DropBoxAccessToken, null);

		private string DropBoxDownloadBasePath
		{
			get
			{
				return "KONGRES 2015 listopad download/download - do pobrania";
			}
		}
		#endregion

		#region View Methods
		//Home page
		public ActionResult Index()
		{
			return View();
		}

		public FileResult Download(string filePath, string fileName)
		{
			byte[] file = _dropBoxClient.GetFile(filePath);
			return File(file, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
		}

		public ActionResult Downloads()
		{
			List<FileInfo> items = new List<FileInfo>();

			try
			{
				MetaData metaData = _dropBoxClient.GetMetaData(DropBoxDownloadBasePath);
				List<MetaData> folderContents = metaData.Contents;
				foreach (MetaData fileInfo in folderContents)
				{
					items.Add(new FileInfo() { FileName = fileInfo.Name, FilePath = fileInfo.Path });
				}
			}
			catch (DropboxException dex)
			{
				string message = dex.Message;
			}
			catch (Exception ex)
			{
				string messag = ex.Message;
			}

			return View(items);
		}

		public ActionResult Contact()
		{
			return View();
		}

		[HttpPost]
		[ValidateAntiForgeryToken]
		public ActionResult Contact(ContactUs model)
		{
			if (ModelState.IsValid)
			{
				return SendFeedback(model);
			}
			return View(model);
		}

		public ActionResult Sponsors()
		{
			return View();
		}

		public ActionResult MediaPatrons()
		{
			return View();
		}

		public ActionResult Cooperators()
		{
			return View();
		}

		//Mission
		public ActionResult Mission()
		{
			return View();
		}

		//Main Program page
		public ActionResult Program()
		{
			return View();
		}

		//Participants page
		public ActionResult Participants()
		{
			return View();
		}

		//Places page
		public ActionResult Places()
		{
			return View();
		}

		//Prayer page
		public ActionResult Prayer()
		{
			return View();
		}

		//Retreat page
		public ActionResult Retreat()
		{
			return View();
		}

		public ActionResult Registration(String labName)
		{
			ViewBag.LabName = labName;
			return View();
		}

		[HttpPost]
		[ValidateAntiForgeryToken]
		public ActionResult Registration(RegistrationForm model)
		{
			if (ModelState.IsValid)
			{
				return SendRegistratioMessage(model);
			}
			return View(model);
		}

		public ActionResult Sent()
		{
			return View();
		}

		public ActionResult Workshops(String labName, String subject, String instructor)
		{
			ViewBag.LabName = labName;
			ViewBag.Subject = subject;
			ViewBag.Instructor = instructor;

			return View();
		}

		//Symposium page
		public ActionResult Symposium()
		{
			return View();
		}

		//Conferences
		public ActionResult Conferences()
		{
			return View();
		}

		public ActionResult Culture()
		{
			return View();
		}

		public ActionResult Articles()
		{
			List
 articles = SqlFuDAL.FindObjectsByType
();
			return View(articles);
		}

		public ActionResult Donation(Boolean fromRegistration = false)
		{
			ViewBag.FromRegistration = fromRegistration;
			return View();
		}

		public ActionResult Article(int id)
		{
			Article article = SqlFuDAL.FindArticleById(id);

			return View(article);
		}
		#endregion

		#region JSON Methods

		public String GetJSONParticipants()
		{
			//build json object to populate Participants view:
			//query Participants table to retrieve needed info
			List<Participant> participants = SqlFuDAL.FindObjectsByType<Participant>();

			//perform any needed translation into JSON friendly object here:
			ParticipantCollection participantCol = new ParticipantCollection();
			participantCol.Participants = participants.Where(p => p.IsActive).ToList();
			String json = JsonConvert.SerializeObject(participantCol);

			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			//return JSON object back to the view
			return jsonData.Data.ToString();
		}

		public String GetJSONPosts()
		{
			String sql = "SELECT TOP 3 * FROM appadmin.Blogs ORDER BY CreatedOn DESC";

			List<Blog> blogs = SqlFuDAL.FindObjectsByType<Blog>(sql);

			List<Tag> tags = new List<Tag>();
			PostCollection postCol = new PostCollection();

			sql = @"SELECT t.TagName, t.TagURL
FROM appadmin.Tags t
INNER JOIN appadmin.BlogTags bt ON t.ID = bt.TagID
WHERE bt.BlogID = {0}";

			foreach (Blog blog in blogs)
			{
				String query = String.Format(sql, blog.ID);
				//Build Post:
				tags = SqlFuDAL.FindObjectsByType<Tag>(query);
				blog.Tags = tags;
				//massage CreatedOn property to contain just date part
				blog.CreatedOnDate = blog.CreatedOn.ToShortDateString();
				postCol.Posts.Add(blog);
			}

			String json = JsonConvert.SerializeObject(postCol);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			return jsonData.Data.ToString();
		}

		///
		/// Returns all articles found in database.
		///
		/// <returns></returns>
		public String GetJSONArticles()
		{
			List
 articles = SqlFuDAL.FindObjectsByType
();
			ArticleCollection articleCol = new ArticleCollection();
			articleCol.Articles = articles;

			String json = JsonConvert.SerializeObject(articleCol);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			return jsonData.Data.ToString();
		}

		public String GetJSONArticle(int id)
		{
			Article article = SqlFuDAL.FindArticleById(id);

			ArticleCollection articleCol = new ArticleCollection();
			articleCol.Articles = new List
() { article };

			String json = JsonConvert.SerializeObject(articleCol);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			return jsonData.Data.ToString();
		}

		public String GetJSONConferences()
		{
			List<Conference> conferences = SqlFuDAL.FindObjectsByType<Conference>();
			ConferenceCollection conferenceCol = new ConferenceCollection();
			conferenceCol.Conferences = conferences;

			String json = JsonConvert.SerializeObject(conferenceCol);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			return jsonData.Data.ToString();
		}

		public String GetJSONCooperators(String type)
		{
			List<Cooperator> cooperators = SqlFuDAL.FindCooperatorsByType(type);
			CooperatorCollection cooperatorCol = new CooperatorCollection();
			cooperatorCol.Cooperators = cooperators;

			String json = JsonConvert.SerializeObject(cooperatorCol);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };

			return jsonData.Data.ToString();
		}

		public String GetJSONWorkshop(String labName)
		{
			Workshop workshop = SqlFuDAL.FindWorkshopByLabName(labName);
			String json = JsonConvert.SerializeObject(workshop);
			JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) };
			return jsonData.Data.ToString();
		}
		#endregion

		public ActionResult FindBlogs(string tags)
		{
			List<Blog> blogs = new List<Blog>();
			if (!String.IsNullOrEmpty(tags))
			{
				String[] values = tags.Split(new Char[] { ',', ' ' });
				foreach (string value in values)
				{
					if (!String.IsNullOrEmpty(value.Trim()))
					{
						//search the database of blogs for a given tag:

					}
				}
			}
			return View(blogs);
		}

		#region Send Message Methods
		private RedirectToRouteResult SendRegistratioMessage(RegistrationForm model)
		{
			var body = @"
Workshop Title: {0}

First Name: {1}

Last Name: {2}

Email Address: {3}

Telephone Number: {4}
";

			var message = new MailMessage();
			message.To.Add(new MailAddress("info@familycongresschicago.org"));
			message.From = new MailAddress("web@familycongresschicago.org");
			message.Subject = String.Format("{0} {1} wants to register for: {2}.", model.FirstName, model.LastName, model.LabName);
			message.Body = String.Format(body, model.LabName, model.FirstName, model.LastName, model.Email, model.Telephone);
			message.IsBodyHtml = true;

			using (var smtp = new SmtpClient())
			{
				var credential = new NetworkCredential
				{
					UserName = "web@familycongresschicago.org",
					Password = "strong_family"
				};
				smtp.Credentials = credential;
				smtp.Host = "smtp.familycongresschicago.org";
				smtp.Port = 587;
				smtp.EnableSsl = false;
				smtp.Send(message);
				return RedirectToAction("Donation", "Home", new { fromRegistration = true });
			}
		}

		private RedirectToRouteResult SendFeedback(ContactUs model)
		{
			var body = @"
Feedback: {0}

First Name: {1}

Last Name: {2}

Email Address: {3}

Telephone Number: {4}
";

			var message = new MailMessage();
			message.To.Add(new MailAddress("info@familycongresschicago.org"));
			message.From = new MailAddress("web@familycongresschicago.org");
			message.Subject = String.Format("{0} {1} wants to sent a feedback", model.FirstName, model.LastName);
			message.Body = String.Format(body, model.Comment, model.FirstName, model.LastName, model.Email, model.Telephone);
			message.IsBodyHtml = true;

			using (var smtp = new SmtpClient())
			{
				var credential = new NetworkCredential
				{
					UserName = "web@familycongresschicago.org",
					Password = "strong_family"
				};
				smtp.Credentials = credential;
				smtp.Host = "smtp.familycongresschicago.org";
				smtp.Port = 587;
				smtp.EnableSsl = false;
				smtp.Send(message);
				return RedirectToAction("Sent");
			}
		}
		#endregion
	}
}


text:
package org.springframework.boot.autoconfigure.session;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.session.FlushMode;
import org.springframework.session.SaveMode;

/**
 * Configuration properties for Hazelcast backed Spring Session.
 *
 * @author Vedran Pavic
 * @since 2.0.0
 */
@ConfigurationProperties(prefix = "spring.session.hazelcast")
public class HazelcastSessionProperties {

	/**
	 * Name of the map used to store sessions.
	 */
	private String mapName = "spring:session:sessions";

	/**
	 * Sessions flush mode. Determines when session changes are written to the session
	 * store.
	 */
	private FlushMode flushMode = FlushMode.ON_SAVE;

	/**
	 * Sessions save mode. Determines how session changes are tracked and saved to the
	 * session store.
	 */
	private SaveMode saveMode = SaveMode.ON_SET_ATTRIBUTE;

	public String getMapName() {
		return this.mapName;
	}

	public void setMapName(String mapName) {
		this.mapName = mapName;
	}

	public FlushMode getFlushMode() {
		return this.flushMode;
	}

	public void setFlushMode(FlushMode flushMode) {
		this.flushMode = flushMode;
	}

	public SaveMode getSaveMode() {
		return this.saveMode;
	}

	public void setSaveMode(SaveMode saveMode) {
		this.saveMode = saveMode;
	}

}


text:
package org.jspare.vertx.builder;

/**
 * The Interface Collector.
 *
 * @param <T> the generic type
 * @author Paulo Lima
 */
public interface Collector<T> {

  /**
   * Collect.
   *
   * @param source the source
   * @param args   the args
   * @return the t
   */
  T collect(Class<?> source, Object... args);
}


text:
========
eventlog
========

``eventlog`` is a simple app that provides an easy and clean
interface for logging diagnostic as well as business intelligence
data about activity that occurs in your site.

There is optional Pusher (http://pusher.com) support baked in so
that if you add a ``PUSHER_CONFIG`` to settings, your events will
also be sent to Pusher as well as your database. Using this feature
you can write a simple Pusher client to aggregate activity across
multiple sites in a dashboard showing live activity.

Out of the box using this does write to the database (and if Pusher
is enabled, write to an http connection). For small sites, it should
be good enough to use inline but you might at some point want to
consider wrapping calls to the ``log()`` method and queue them in
a job manager like ``celery`` or ``pyres`` so that the calls become
asyncronous.

Development
-----------

The source repository can be found at https://github.com/eldarion/eventlog/

Contents
========

.. toctree::
 :maxdepth: 1

 changelog
 installation
 templatetags
 usage


text:
 CREATE TABLE ENVIRONMENTS FOR SYSTEM NAME ENVIRON(
    id FOR COLUMN ENVID INTEGER GENERATED ALWAYS AS IDENTITY,
    description FOR COLUMN ENVDSC CHAR(50),
    address FOR COLUMN ENVADR CHAR(50),
    secured FOR COLUMN ENVSEC CHAR(1),
    user_profile FOR COLUMN ENVUSR CHAR(50),
    user_password FOR COLUMN ENVPWD CHAR(50),
    PRIMARY KEY(ENVID))
    RCDFMT ENV000101;

LABEL ON
     TABLE ENVIRONMENTS IS '[DEPLOY2I] Environments';


text:
<?php

include_once 'config.php';

session_start();
if (empty($_SESSION['email'])) {
    header("location: index.php");
} else {
    echo "Welcome " . $_SESSION['name'];

    if (isset($_POST['submit'])) {
        $planeMakerName = $_POST['name'];

        if (empty($planeMakerName)) {
            echo '
Aeroplane maker field is empty
';
        }else {
            $sqlStatement = "INSERT INTO plane_maker(planeMakerName) VALUES(:planeMakerName)";
            $sqlQuery = $pdo->prepare($sqlStatement);
            $sqlQuery->bindParam(':planeMakerName', $planeMakerName);
            $sqlQuery->execute();

            echo '
Aeroplane maker added
';
        }
    }
}

?>

<!DOCTYPE html>

        <title>Table-summary</title>
        <link rel="stylesheet" href="style.css" />

        Home
         |
        Back

        Log out

        <form method="post">
            <input type="text" name="name" placeholder="Aeroplane maker">

            <input type="submit" name="submit" value="Submit">

        </form>


text:
<!DOCTYPE HTML>

<link rel="stylesheet" href="../../resources/testharness.css">


text:
FindEigen3
--------

This module determines the Eigen3 library of the system.

IMPORTED Targets
^^^^^^^^^^^^^^^^

This module defines :prop_tgt:`IMPORTED` target ``Eigen3::Eigen``, if
Eigen3 has been found.

Result Variables
^^^^^^^^^^^^^^^^

This module defines the following variables:

::

Eigen3_FOUND          - True if Eigen3 found.

#]=======================================================================]
include(FindPackageHandleStandardArgs)

find_package(Eigen3 QUIET NO_MODULE)
# if we found the Eigen3 cmake package then we are done, and
# can print what we found and return.
if(Eigen3_FOUND)
  find_package_handle_standard_args(Eigen3 CONFIG_MODE)
  return()
endif()

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
  pkg_check_modules(Eigen3 QUIET eigen3 IMPORTED_TARGET GLOBAL)
  if(Eigen3_FOUND)
    add_library(Eigen3::Eigen ALIAS PkgConfig::Eigen3)
  endif()
endif()


text:
package gov.va.isaac.gui.listview.operations;

import gov.va.isaac.gui.SimpleDisplayConcept;
import gov.va.isaac.gui.util.FxUtils;
import javafx.beans.binding.BooleanExpression;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.collections.ObservableList;
import javafx.scene.control.Label;
import org.glassfish.hk2.api.PerLookup;

/**
 * {@link LogicRetireDisjointSet}
 *
 * An example operation that does nothing during execution, but provides an example for
 * implementing other operations.  Will remove this code, eventually, as other real operations
 * are implemented.
 *
 * @author Dan Armbrust
 */
//@Service  TODO Uncomment this when implemented
@PerLookup
public class LogicRetireDisjointSet extends Operation
{
	private LogicRetireDisjointSet()
	{
		//For HK2 to init
	}
	@Override
	public void init(ObservableList<SimpleDisplayConcept> conceptList)
	{
		super.init(conceptList);
		root_.add(new Label("User configuration detail: "), 0, 0);
		root_.add(new Label("user setting"), 1, 0);
		FxUtils.preventColCollapse(root_, 0);
	}

	/**
	 * @see gov.va.isaac.gui.listview.operations.Operation#getTitle()
	 */
	@Override
	public String getTitle()
	{
		return "Logic, Retire Disjoint Set";
	}

	/**
	 * @see gov.va.isaac.gui.listview.operations.Operation#conceptListChanged()
	 */
	@Override
	protected void conceptListChanged()
	{
		//noop
	}

	/**
	 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
	 */
	@Override
	public BooleanExpression isValid()
	{
		return new SimpleBooleanProperty(true);
	}

	/**
	 * @see gov.va.isaac.gui.listview.operations.Operation#getOperationDescription()
	 */
	@Override
	public String getOperationDescription()
	{
		return "A do-nothing operation for demonstration purposes";
	}

	/**
	 * @see gov.va.isaac.gui.listview.operations.Operation#createTask()
	 */
	@Override
	public CustomTask<OperationResult> createTask()
	{
		return new CustomTask<OperationResult>(LogicRetireDisjointSet.this)
		{
			@Override
			protected OperationResult call() throws Exception
			{
//				double i = 0;
//				for (SimpleDisplayConcept c : conceptList_)
//				{
//					if (cancelRequested_)
//					{
//						return ParentAddNew.this.getTitle() + " was cancelled";
//					}
//					updateProgress(i, conceptList_.size());
//					updateMessage("processing " + c.getDescription());
//					Thread.sleep(3000);
//					if (cancelRequested_)
//					{
//						return ParentAddNew.this.getTitle() + " was cancelled";
//					}
//					updateProgress((i + 0.5), conceptList_.size());
//					updateMessage("still working on " + c.getDescription());
//					Thread.sleep(3000);
//					if (cancelRequested_)
//					{
//						return ParentAddNew.this.getTitle() + " was cancelled";
//					}
//					updateProgress(++i, conceptList_.size());
//				}
//				return ParentAddNew.this.getTitle() + " completed - modified 0 concepts";
				//TODO implement LogicRetireDisjointSet
				return new OperationResult();
			}
		};
	}
}


text:
using System;
using System.Windows;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using Coding4Fun.Toolkit.Controls.Primitives;
using Microsoft.Phone.Controls.Primitives;
using System.Windows.Navigation;

namespace Cordova.Extension.Commands
{
    public class DateTimePickerTask
    {
        private PhoneApplicationFrame _frame;
        private object _frameContentWhenOpened;
        private NavigationInTransition _savedNavigationInTransition;
        private NavigationOutTransition _savedNavigationOutTransition;
        private IDateTimePickerPage _dateTimePickerPage;
        private ITimeSpanPickerPage<TimeSpan> _timeSpanPickerPage;

        public enum DateTimePickerType
        {
            Date = 0,
            Time = 1
        }

        public class DateTimeResult : TaskEventArgs
        {
            public DateTimeResult(TaskResult taskResult) : base(taskResult) { }

            public DateTime? Value { get; internal set; }
        }

        public event EventHandler<DateTimeResult> Completed;

        public DateTime? Value { get; set; }

        public int? Step { get; set; }

        public void Show(DateTimePickerType type)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() => OpenPickerPage(type));
        }

        private void OpenPickerPage(DateTimePickerType type)
        {
            var page = type == DateTimePickerType.Date
                           ? "/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/DatePickerPage.xaml?dummy="
                           : "/Coding4Fun.Toolkit.Controls;component/ValuePicker/TimeSpanPicker/TimespanPickerPage.xaml?dummy=";

            page += Guid.NewGuid();

            var pickerPageUri = new Uri(page, UriKind.Relative);

            if (_frame != null) return;
            _frame = Application.Current.RootVisual as PhoneApplicationFrame;

            if (_frame == null) return;

            _frameContentWhenOpened = _frame.Content;

            var uiElement = _frameContentWhenOpened as UIElement;
            if (null != uiElement)
            {
                _savedNavigationInTransition = TransitionService.GetNavigationInTransition(uiElement);
                TransitionService.SetNavigationInTransition(uiElement, null);
                _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(uiElement);
                TransitionService.SetNavigationOutTransition(uiElement, null);
            }

            if (type == DateTimePickerType.Date)
            {
                _frame.Navigated += OnDateFrameNavigated;
            }
            else
            {
                _frame.Navigated += OnTimeFrameNavigated;
            }
            _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
            _frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;

            _frame.Navigate(pickerPageUri);
        }

        private void ClosePickerPage()
        {
            if (_frame != null)
            {
                _frame.Navigated -= OnDateFrameNavigated;
                _frame.Navigated -= OnTimeFrameNavigated;
                _frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                _frame.NavigationFailed -= OnFrameNavigationStoppedOrFailed;

                var uiElement = _frameContentWhenOpened as UIElement;
                if (uiElement != null)
                {
                    TransitionService.SetNavigationInTransition(uiElement, _savedNavigationInTransition);
                    _savedNavigationInTransition = null;
                    TransitionService.SetNavigationOutTransition(uiElement, _savedNavigationOutTransition);
                    _savedNavigationOutTransition = null;
                }

                _frame = null;
                _frameContentWhenOpened = null;
            }

            var taskResult = new DateTimeResult(TaskResult.Cancel);

            if (_dateTimePickerPage != null)
            {
                if (_dateTimePickerPage.Value.HasValue)
                {
                    Value = _dateTimePickerPage.Value.Value;
                    taskResult = new DateTimeResult(TaskResult.OK) { Value = Value.Value };
                }
            }
            if (_timeSpanPickerPage != null)
            {
                if (_timeSpanPickerPage.Value.HasValue)
                {
                    Value = new DateTime(1970, 1, 1, 0, 0, 0, 0) + _timeSpanPickerPage.Value.Value;
                    taskResult = new DateTimeResult(TaskResult.OK) { Value = Value.Value };
                }
            }

            _dateTimePickerPage = null;
            _timeSpanPickerPage = null;

            Completed(this, taskResult);
        }

        private void OnDateFrameNavigated(object sender, NavigationEventArgs e)
        {
            if (e.Content == _frameContentWhenOpened)
            {
                ClosePickerPage();
            }
            else if (_dateTimePickerPage == null)
            {
                _dateTimePickerPage = e.Content as IDateTimePickerPage;
                if (_dateTimePickerPage != null)
                {
                    _dateTimePickerPage.Value = Value.GetValueOrDefault(DateTime.Now);
                }
            }
        }

        private void OnTimeFrameNavigated(object sender, NavigationEventArgs e)
        {
            if (e.Content == _frameContentWhenOpened)
            {
                ClosePickerPage();
            }
            else if (_timeSpanPickerPage == null)
            {
                _timeSpanPickerPage = e.Content as ITimeSpanPickerPage<TimeSpan>;
                if (_timeSpanPickerPage != null)
                {
                    if (Step != null)
                    {
                        _timeSpanPickerPage.StepFrequency = new TimeSpan(0, (int) (Step / 60), 0);
                    }
                    _timeSpanPickerPage.Maximum = new TimeSpan(23, 59, 0);
                    _timeSpanPickerPage.Minimum = new TimeSpan(0, 0, 0);
                    _timeSpanPickerPage.Value = DateTimeToTimeSpan(Value);
                }
            }
        }

        private static TimeSpan DateTimeToTimeSpan(DateTime? dt)
        {
            return dt.HasValue
                       ? new TimeSpan(0, dt.Value.Hour, dt.Value.Minute, dt.Value.Second, dt.Value.Millisecond)
                       : TimeSpan.Zero;
        }

        private void OnFrameNavigationStoppedOrFailed(object sender, EventArgs e)
        {
            ClosePickerPage();
        }

    }
}


text:
import NewAssetstoreWidget from 'girder/views/widgets/NewAssetstoreWidget';
import { AssetstoreType } from 'girder/constants';
import { wrap } from 'girder/utilities/PluginUtils';

import AssetstoreCreateTemplate from '../templates/dbAssetstoreCreate.pug';

/**
 * Add UI for creating new Database assetstore.
 */
wrap(NewAssetstoreWidget, 'render', function (render) {
    render.call(this);

    this.$('#g-assetstore-accordion').append(AssetstoreCreateTemplate());
    return this;
});

NewAssetstoreWidget.prototype.events['submit #g-new-dbas-form'] = function (e) {
    this.createAssetstore(e, this.$('#g-new-dbas-error'), {
        type: AssetstoreType.DATABASE,
        name: this.$('#g-new-dbas-name').val(),
        dburi: this.$('#g-edit-dbas-dburi').val()
    });
};


text:
describe('Fan menu component suite', function() {
  var fanMenuService = null;

  /**
   * Inject the main module and the service before each spec
   */
  beforeEach(function() {
    module('projects.fanMenu');

    /**
     * Inject the service
     */
    inject(function(_FanMenuService_) {
      fanMenuService = _FanMenuService_;
    });
  });

  it('Service loaded', function() {
    expect(fanMenuService).not.toBe(null);
  });

  it('Say hello', function() {
    expect(fanMenuService.sayHello()).toEqual('Hello from the fan menu');
  });
});


text:
using System;
using System.Diagnostics;
using System.Windows;

namespace MiniETL.ViewModels
{
	/// <summary>
	/// Represents the free-floating point under cursor
	/// </summary>
	public class PartCreatedConnectorInfo : ConnectorInfoBase
	{
		private Point _currentLocation;

		public Point CurrentLocation
		{
			get { return _currentLocation; }
			set
			{
				if (value.Equals(_currentLocation)) return;
				_currentLocation = value;
				OnPropertyChanged();
			}
		}

		public PartCreatedConnectorInfo(ConnectorKind kind, Type dataType, Point currentLocation)
			: base(kind, ConnectorOrientation.None, dataType)
		{
			CurrentLocation = currentLocation;
		}
	}
}


text:
package cli.printer

import java.io.OutputStream

import core.Pipeline

/**
 * Created by OpenDataFlow on 31/12/15.
 */
object Printer {
  def getPrinter(name: String): Printer = {
    name match {
      case "text" ⇒ new PlainTextPrinter()
      case "dot"  ⇒ new DotPrinter()
      // if we don't have it let's assume it's a class name
      case _ ⇒
        val c = Class.forName(name)
        if (c.getInterfaces.contains(Printer.getClass)) {
          return c.newInstance().asInstanceOf[Printer]
        } else {
          throw new Exception(s"Class ${name} does not extend Printer")
        }
    }
  }
}

trait Printer {
  def renderPipeline(p: Pipeline, o: OutputStream)
}


text:
package com.github.markusbernhardt.xmldoclet.simpledata;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Field1
 */
public class Field1 {
	public String field0;

	public String field1;

	@SuppressWarnings("unused")
	private String field2;

	String field3;

	protected String field4;

	public volatile String field5;

	public static String field6;

	public transient String field7;

	public final String field8 = "mer";

	public final String field9 = "testy";

	public final int field10 = 10;

	@Deprecated
	public String field11;

	@Deprecated
	@Annotation12("mister")
	public String field12;

	public String field13;

	public ArrayList<?> field14;

	public HashMap<String, Integer> field15;

	public String[] field16;

}


text:
CKEDITOR.plugins.setLang( 'sourcearea', 'sl', {
	toolbar: 'Izvorna koda'
});


text:
package com.grarak.kerneladiutor.utils.kernel.gpu;

import android.content.Context;

import com.grarak.kerneladiutor.R;
import com.grarak.kerneladiutor.fragments.ApplyOnBootFragment;
import com.grarak.kerneladiutor.utils.Utils;
import com.grarak.kerneladiutor.utils.root.Control;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/**
 * Created by willi on 12.05.16.
 */
public class GPUFreq {

    private static final String GENERIC_GOVERNORS = "performance powersave ondemand simple conservative";

    private static final String CUR_KGSL2D0_QCOM_FREQ = "/sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/gpuclk";
    private static final String MAX_KGSL2D0_QCOM_FREQ = "/sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/max_gpuclk";
    private static final String AVAILABLE_KGSL2D0_QCOM_FREQS = "/sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/gpu_available_frequencies";
    private static final String SCALING_KGSL2D0_QCOM_GOVERNOR = "/sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/pwrscale/trustzone/governor";

    private static final String KGSL3D0_GPUBUSY = "/sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/gpubusy";
    private static final String CUR_KGSL3D0_FREQ = "/sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/gpuclk";
    private static final String MAX_KGSL3D0_FREQ = "/sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk";
    private static final String AVAILABLE_KGSL3D0_FREQS = "/sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/gpu_available_frequencies";
    private static final String SCALING_KGSL3D0_GOVERNOR = "/sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor";

    private static final String KGSL3D0_DEVFREQ_GPUBUSY = "/sys/class/kgsl/kgsl-3d0/gpubusy";
    private static final String CUR_KGSL3D0_DEVFREQ_FREQ = "/sys/class/kgsl/kgsl-3d0/gpuclk";
    private static final String MAX_KGSL3D0_DEVFREQ_FREQ = "/sys/class/kgsl/kgsl-3d0/max_gpuclk";
    private static final String MIN_KGSL3D0_DEVFREQ_FREQ = "/sys/class/kgsl/kgsl-3d0/devfreq/min_freq";
    private static final String AVAILABLE_KGSL3D0_DEVFREQ_FREQS = "/sys/class/kgsl/kgsl-3d0/gpu_available_frequencies";
    private static final String SCALING_KGSL3D0_DEVFREQ_GOVERNOR = "/sys/class/kgsl/kgsl-3d0/devfreq/governor";
    private static final String AVAILABLE_KGSL3D0_DEVFREQ_GOVERNORS = "/sys/class/kgsl/kgsl-3d0/devfreq/available_governors";

    private static final String CUR_OMAP_FREQ = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/frequency";
    private static final String MAX_OMAP_FREQ = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/frequency_limit";
    private static final String AVAILABLE_OMAP_FREQS = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/frequency_list";
    private static final String SCALING_OMAP_GOVERNOR = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/governor";
    private static final String AVAILABLE_OMAP_GOVERNORS = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/governor_list";
    private static final String TUNABLES_OMAP = "/sys/devices/platform/omap/pvrsrvkm.0/sgxfreq/%s";

    private static final String CUR_TEGRA_FREQ = "/sys/kernel/tegra_gpu/gpu_rate";
    private static final String MAX_TEGRA_FREQ = "/sys/kernel/tegra_gpu/gpu_cap_rate";
    private static final String MIN_TEGRA_FREQ = "/sys/kernel/tegra_gpu/gpu_floor_rate";
    private static final String AVAILABLE_TEGRA_FREQS = "/sys/kernel/tegra_gpu/gpu_available_rates";

    private static final String CUR_POWERVR_FREQ = "/sys/devices/platform/dfrgx/devfreq/dfrgx/cur_freq";
    private static final String MAX_POWERVR_FREQ = "/sys/devices/platform/dfrgx/devfreq/dfrgx/max_freq";
    private static final String MIN_POWERVR_FREQ = "/sys/devices/platform/dfrgx/devfreq/dfrgx/min_freq";
    private static final String AVAILABLE_POWERVR_FREQS = "/sys/devices/platform/dfrgx/devfreq/dfrgx/available_frequencies";
    private static final String SCALING_POWERVR_GOVERNOR = "/sys/devices/platform/dfrgx/devfreq/dfrgx/governor";
    private static final String AVAILABLE_POWERVR_GOVERNORS = "/sys/devices/platform/dfrgx/devfreq/dfrgx/available_governors";

    private static final List<String> sGpuBusys = new ArrayList<>();
    private static final HashMap<String, Integer> sCurrentFreqs = new HashMap<>();
    private static final HashMap<String, Integer> sMaxFreqs = new HashMap<>();
    private static final HashMap<String, Integer> sMinFreqs = new HashMap<>();
    private static final HashMap<String, Integer> sAvailableFreqs = new HashMap<>();
    private static final List<String> sScalingGovernors = new ArrayList<>();
    private static final List<String> sAvailableGovernors = new ArrayList<>();
    private static final List<String> sTunables = new ArrayList<>();

    static {
        sGpuBusys.add(KGSL3D0_GPUBUSY);
        sGpuBusys.add(KGSL3D0_DEVFREQ_GPUBUSY);

        sCurrentFreqs.put(CUR_KGSL3D0_FREQ, 1000000);
        sCurrentFreqs.put(CUR_KGSL3D0_DEVFREQ_FREQ, 1000000);
        sCurrentFreqs.put(CUR_OMAP_FREQ, 1000000);
        sCurrentFreqs.put(CUR_TEGRA_FREQ, 1000000);
        sCurrentFreqs.put(CUR_POWERVR_FREQ, 1000);

        sMaxFreqs.put(MAX_KGSL3D0_FREQ, 1000000);
        sMaxFreqs.put(MAX_KGSL3D0_DEVFREQ_FREQ, 1000000);
        sMaxFreqs.put(MAX_OMAP_FREQ, 1000000);
        sMaxFreqs.put(MAX_TEGRA_FREQ, 1000000);
        sMaxFreqs.put(MAX_POWERVR_FREQ, 1000);

        sMinFreqs.put(MIN_KGSL3D0_DEVFREQ_FREQ, 1000000);
        sMinFreqs.put(MIN_TEGRA_FREQ, 1000000);
        sMinFreqs.put(MIN_POWERVR_FREQ, 1000);

        sAvailableFreqs.put(AVAILABLE_KGSL3D0_FREQS, 1000000);
        sAvailableFreqs.put(AVAILABLE_KGSL3D0_DEVFREQ_FREQS, 1000000);
        sAvailableFreqs.put(AVAILABLE_OMAP_FREQS, 1000000);
        sAvailableFreqs.put(AVAILABLE_TEGRA_FREQS, 1000000);
        sAvailableFreqs.put(AVAILABLE_POWERVR_FREQS, 1000);

        sScalingGovernors.add(SCALING_KGSL3D0_GOVERNOR);
        sScalingGovernors.add(SCALING_KGSL3D0_DEVFREQ_GOVERNOR);
        sScalingGovernors.add(SCALING_OMAP_GOVERNOR);
        sScalingGovernors.add(SCALING_POWERVR_GOVERNOR);

        sAvailableGovernors.add(AVAILABLE_KGSL3D0_DEVFREQ_GOVERNORS);
        sAvailableGovernors.add(AVAILABLE_OMAP_GOVERNORS);
        sAvailableGovernors.add(AVAILABLE_POWERVR_GOVERNORS);

        sTunables.add(TUNABLES_OMAP);
    }

    private static String BUSY;
    private static String CUR_FREQ;
    private static Integer CUR_FREQ_OFFSET;
    private static List<Integer> AVAILABLE_FREQS;
    private static String MAX_FREQ;
    private static Integer MAX_FREQ_OFFSET;
    private static String MIN_FREQ;
    private static Integer MIN_FREQ_OFFSET;
    private static String GOVERNOR;
    private static String[] AVAILABLE_GOVERNORS;
    private static Integer AVAILABLE_GOVERNORS_OFFSET;
    private static String TUNABLES;

    private static Integer[] AVAILABLE_2D_FREQS;

    public static String getTunables(String governor) {
        return Utils.strFormat(TUNABLES, governor);
    }

    public static boolean hasTunables(String governor) {
        if (TUNABLES != null) return true;
        for (String tunables : sTunables) {
            if (Utils.existFile(Utils.strFormat(tunables, governor))) {
                TUNABLES = tunables;
                return true;
            }
        }
        return false;
    }

    public static void set2dGovernor(String value, Context context) {
        run(Control.write(value, SCALING_KGSL2D0_QCOM_GOVERNOR), SCALING_KGSL2D0_QCOM_GOVERNOR, context);
    }

    public static String get2dGovernor() {
        return Utils.readFile(SCALING_KGSL2D0_QCOM_GOVERNOR);
    }

    public static List<String> get2dAvailableGovernors() {
        return Arrays.asList(GENERIC_GOVERNORS.split(" "));
    }

    public static boolean has2dGovernor() {
        return Utils.existFile(SCALING_KGSL2D0_QCOM_GOVERNOR);
    }

    public static void set2dMaxFreq(int value, Context context) {
        run(Control.write(String.valueOf(value), MAX_KGSL2D0_QCOM_FREQ), MAX_KGSL2D0_QCOM_FREQ, context);
    }

    public static int get2dMaxFreq() {
        return Utils.strToInt(Utils.readFile(MAX_KGSL2D0_QCOM_FREQ));
    }

    public static boolean has2dMaxFreq() {
        return Utils.existFile(MAX_KGSL2D0_QCOM_FREQ);
    }

    public static List<String> get2dAdjustedFreqs(Context context) {
        List<String> list = new ArrayList<>();
        for (int freq : get2dAvailableFreqs()) {
            list.add((freq / 1000000) + context.getString(R.string.mhz));
        }
        return list;
    }

    public static List<Integer> get2dAvailableFreqs() {
        if (AVAILABLE_2D_FREQS == null) {
            if (Utils.existFile(AVAILABLE_KGSL2D0_QCOM_FREQS)) {
                String[] freqs = Utils.readFile(AVAILABLE_KGSL2D0_QCOM_FREQS).split(" ");
                AVAILABLE_2D_FREQS = new Integer[freqs.length];
                for (int i = 0; i < freqs.length; i++) {
                    AVAILABLE_2D_FREQS[i] = Utils.strToInt(freqs[i]);
                }
            }
        }
        if (AVAILABLE_2D_FREQS == null) return null;
        List<Integer> list = Arrays.asList(AVAILABLE_2D_FREQS);
        Collections.sort(list);
        return list;
    }

    public static int get2dCurFreq() {
        return Utils.strToInt(Utils.readFile(CUR_KGSL2D0_QCOM_FREQ));
    }

    public static boolean has2dCurFreq() {
        return Utils.existFile(CUR_KGSL2D0_QCOM_FREQ);
    }

    public static void setGovernor(String value, Context context) {
        run(Control.write(value, GOVERNOR), GOVERNOR, context);
    }

    public static List<String> getAvailableGovernors() {
        if (AVAILABLE_GOVERNORS == null) {
            for (String file : sAvailableGovernors) {
                if (Utils.existFile(file)) {
                    AVAILABLE_GOVERNORS = Utils.readFile(file).split(" ");
                    break;
                }
            }
        }
        if (AVAILABLE_GOVERNORS == null) {
            AVAILABLE_GOVERNORS = GENERIC_GOVERNORS.split(" ");
        }
        return Arrays.asList(AVAILABLE_GOVERNORS);
    }

    public static String getGovernor() {
        return Utils.readFile(GOVERNOR);
    }

    public static boolean hasGovernor() {
        if (GOVERNOR == null) {
            for (String file : sScalingGovernors) {
                if (Utils.existFile(file)) {
                    GOVERNOR = file;
                    return true;
                }
            }
        }
        return GOVERNOR != null;
    }

    public static void setMinFreq(int value, Context context) {
        run(Control.write(String.valueOf(value), MIN_FREQ), MIN_FREQ, context);
    }

    public static int getMinFreqOffset() {
        return MIN_FREQ_OFFSET;
    }

    public static int getMinFreq() {
        return Utils.strToInt(Utils.readFile(MIN_FREQ));
    }

    public static boolean hasMinFreq() {
        if (MIN_FREQ == null) {
            for (String file : sMinFreqs.keySet()) {
                if (Utils.existFile(file)) {
                    MIN_FREQ = file;
                    MIN_FREQ_OFFSET = sMinFreqs.get(file);
                    return true;
                }
            }
        }
        return MIN_FREQ != null;
    }

    public static void setMaxFreq(int value, Context context) {
        run(Control.write(String.valueOf(value), MAX_FREQ), MAX_FREQ, context);
    }

    public static int getMaxFreqOffset() {
        return MAX_FREQ_OFFSET;
    }

    public static int getMaxFreq() {
        return Utils.strToInt(Utils.readFile(MAX_FREQ));
    }

    public static boolean hasMaxFreq() {
        if (MAX_FREQ == null) {
            for (String file : sMaxFreqs.keySet()) {
                if (Utils.existFile(file)) {
                    MAX_FREQ = file;
                    MAX_FREQ_OFFSET = sMaxFreqs.get(file);
                    return true;
                }
            }
        }
        return MAX_FREQ != null;
    }

    public static List<String> getAdjustedFreqs(Context context) {
        List<String> list = new ArrayList<>();
        for (int freq : getAvailableFreqs()) {
            list.add((freq / AVAILABLE_GOVERNORS_OFFSET) + context.getString(R.string.mhz));
        }
        return list;
    }

    public static List<Integer> getAvailableFreqs() {
        if (AVAILABLE_FREQS == null) {
            for (String file : sAvailableFreqs.keySet()) {
                if (Utils.existFile(file)) {
                    String freqs[] = Utils.readFile(file).split(" ");
                    AVAILABLE_FREQS = new ArrayList<>();
                    for (String freq : freqs) {
                        if (!AVAILABLE_FREQS.contains(Utils.strToInt(freq))) {
                            AVAILABLE_FREQS.add(Utils.strToInt(freq));
                        }
                    }
                    AVAILABLE_GOVERNORS_OFFSET = sAvailableFreqs.get(file);
                    break;
                }
            }
        }
        if (AVAILABLE_FREQS == null) return null;
        Collections.sort(AVAILABLE_FREQS);
        return AVAILABLE_FREQS;
    }

    public static int getCurFreqOffset() {
        return CUR_FREQ_OFFSET;
    }

    public static int getCurFreq() {
        return Utils.strToInt(Utils.readFile(CUR_FREQ));
    }

    public static boolean hasCurFreq() {
        if (CUR_FREQ == null) {
            for (String file : sCurrentFreqs.keySet()) {
                if (Utils.existFile(file)) {
                    CUR_FREQ = file;
                    CUR_FREQ_OFFSET = sCurrentFreqs.get(file);
                    return true;
                }
            }
        }
        return CUR_FREQ != null;
    }

    public static int getBusy() {
        String value = Utils.readFile(BUSY);
        float arg1 = Utils.strToFloat(value.split(" ")[0]);
        float arg2 = Utils.strToFloat(value.split(" ")[1]);
        return arg2 == 0 ? 0 : Math.round(arg1 / arg2 * 100f);
    }

    public static boolean hasBusy() {
        if (BUSY == null) {
            for (String file : sGpuBusys) {
                if (Utils.existFile(file)) {
                    BUSY = file;
                    return true;
                }
            }
        }
        return BUSY != null;
    }

    public static boolean supported() {
        return hasCurFreq()
                || (hasMaxFreq() && getAvailableFreqs() != null)
                || (hasMinFreq() && getAvailableFreqs() != null)
                || hasGovernor()
                || has2dCurFreq()
                || (has2dMaxFreq() && get2dAvailableFreqs() != null)
                || has2dGovernor();
    }

    private static void run(String command, String id, Context context) {
        Control.runSetting(command, ApplyOnBootFragment.GPU, id, context);
    }

}


text:
var searchData=
[
  ['igeprogramflushoutput_107',['IGEProgramFlushOutput',['../class_i_g_e_program_flush_output.html',1,'']]],
  ['igeprograminputchar_108',['IGEProgramInputChar',['../class_i_g_e_program_input_char.html',1,'']]],
  ['igeprograminputcheck_109',['IGEProgramInputCheck',['../class_i_g_e_program_input_check.html',1,'']]],
  ['igeprograminputstring_110',['IGEProgramInputString',['../class_i_g_e_program_input_string.html',1,'']]],
  ['igeprogramoutput_111',['IGEProgramOutput',['../class_i_g_e_program_output.html',1,'']]]
];


text:
'use strict';

app.directive('yelpVisOverlay', function() {
    return {
        restrict: 'A',
        scope: false,
        link: function(scope, elem) {
            var map = null;
            var originalBounds = null;
            var originalZoom = null;
            var originalProjection = null;
            var overlay = null;

            var checkinsMap = new bubbleMap()
                .minBubbleRadius(1.5)
                .maxBubbleRadius(25)
                .transitionDuration(500);

            // Initialized overlay when the API is finished loading.
            scope.uiGmapIsReady.promise(1).then(function(instances) {
                // Set the map reference for this directive.

                // Create the map overlay for layering custom SVG elements on top of the
                // map.
                map = instances[0].map;

                overlay = new google.maps.OverlayView();
                overlay.onAdd = function() {
                    originalBounds = map.getBounds();
                    originalZoom = map.getZoom();
                    originalProjection = overlay.getProjection();
                }

                overlay.draw = function() {
                    var projection = overlay.getProjection();

                    var sw = projection.fromLatLngToDivPixel(
                        map.getBounds().getSouthWest());
                    var ne = projection.fromLatLngToDivPixel(
                        map.getBounds().getNorthEast());

                    var origSw = projection.fromLatLngToDivPixel(
                        originalBounds.getSouthWest());
                    var origNe = projection.fromLatLngToDivPixel(
                        originalBounds.getNorthEast());

                    checkinsMap.width(ne.x - sw.x)
                        .height(sw.y - ne.y);

                    var svgLayer = d3.select(overlay.getPanes().overlayLayer)
                        .select('svg');

                    var currZoom = originalZoom - map.getZoom();
                    var zoomFactor = Math.pow(2, currZoom);
                    var viewBox = {
                        x: (sw.x - origSw.x) * zoomFactor,
                        y: (ne.y - origNe.y) * zoomFactor,
                        width: (ne.x - sw.x) * zoomFactor,
                        height: (sw.y - ne.y) * zoomFactor
                    };

                    svgLayer.style('left', sw.x + 'px')
                        .style('top', ne.y + 'px')
                        .style('width', (ne.x - sw.x) + 'px')
                        .style('height', (sw.y - ne.y) + 'px')
                        .attr('viewBox', viewBox.x + ' ' + viewBox.y + ' '
                            + viewBox.width + ' ' + viewBox.height);
                };

                overlay.setMap(scope.map.control.getGMap());

                map.addListener('bounds_changed', overlay.draw);
            });

            scope.$watch('checkinData', function(checkinData) {
                if (checkinData === null) {
                    return;
                }

                var datum = {
                    projection: originalProjection,
                    sizes: checkinData,
                    maps: google.maps
                };

                d3.select(overlay.getPanes().overlayLayer)
                    .datum(datum)
                    .call(checkinsMap);

                overlay.draw();
            }, true);
        }
    };
});


text:
import os

from Utilidad import Utilidad
from Sustitucion_Monoalfabetica.Cesar import Cesar
from Sustitucion_Monoalfabetica.Playfair import Playfair
from Sustitucion_Monoalfabetica.Polybios import Polybios
from Sustitucion_Monoalfabetica.Afin import Afin

class ControladorSustitucionMonoTemplate(object):
	"""
	Clase "abstracta" que utiliza el patrón TemplateMethod.

	Los métodos cifrarTexto, cifrarArchivo, descifrarTexto, descifrarArchivo, son métodos que
	tienen pasos en común, lo único que cambia es el modo en que se va a cifrar los diferentes
	algoritmos de Transposicion.

	Los métodos modoCifrar y modoDescifrar, son los métodos que van a cambiar según el algoritmo
	a utilzar, estos se definen en las clases concretas.

	"""
	def __init__(self):
		self.utilidad = Utilidad()

	def modoDefinicionAlfabeto(self, *argumentos):
		raise NotImplementedError

	def modoCifrar(self, *argumentos):
		raise NotImplementedError

	def modoDescifrar(self, *argumentos):
		raise NotImplementedError

	def definirAlfabeto(self, alfabeto):
		self.alfabeto = alfabeto
		self.modoDefinicionAlfabeto(alfabeto)
		self.modoDefinicionAlfabeto(self.alfabeto)

	def cifrarTexto(self, archivo, relleno, clave):
		"""
		Método que se encarga de cifrar un archivo de texto (archvo plano).

		Parámetros:
		archivo: archivo plano que se desea cifrar.
		n: la cantidad de iteraciones con la que se desea cifrar el archivo plano.
		   Por ahora éste parámetro se utiliza para la Transposicion Doble.
		"""
		nombre, extension, codificacion, so = self.utilidad.obtenerMetadatos(archivo)
		self.utilidad.crearArchivoMetadatos(nombre, nombre, extension, codificacion, so)

		self.utilidad.resolverCodificacion(codificacion, "UTF-8", archivo, "tmp")

		cadena = self.utilidad.leerArchivo(self.utilidad.dirSalida+"tmp","r")
		os.remove(self.utilidad.dirSalida+"tmp")
		cadena = cadena.split("\n")

		criptograma = self.modoCifrar(cadena, relleno, clave)

		self.utilidad.crearArchivo(nombre+extension+".CIF", criptograma, "w")

	def descifrarTexto(self, archivo, relleno, clave):
		"""
		Método que se encarga de descifrar un archivo de texto (archvo plano).

		Parámetros:
		archivo: archivo plano que se desea descifrar.
		n: la cantidad de iteraciones con la que se desea descifrar el archivo plano.
		   Por ahora éste parámetro se utiliza para la Transposicion Doble.
		"""
		metadatos = self.obtenerArchivoMetadatos(archivo)

		nombre = metadatos[0]
		extension = metadatos[1]
		codificacion = metadatos[2]
		so = metadatos[3]

		cadena = self.utilidad.leerArchivo(self.utilidad.dirSalida+nombre+extension+".CIF","r")
		cadena = cadena.split("\n")

		textoClaro = self.modoDescifrar(cadena, relleno, clave)
		self.__crearArchivoDescifrado(textoClaro, codificacion, nombre, extension)
		self.__resolverSaltoLinea(nombre,extension,so)

	def cifrarArchivo(self, archivo, n, clave):
		"""
		Método que se encarga de cifrar un archivo con codificación binaria.

		Parámetros:
		archivo: Dirección del archivo plano que se desea descifrar.
		n: la cantidad de iteraciones con la que se desea cifrar el archivo plano.
		   Por ahora éste parámetro se utiliza para la Transposicion Doble.
		"""
		try:
			nombre, extension, codificacion, so = self.utilidad.obtenerMetadatos(archivo)
			self.utilidad.crearArchivoMetadatos(nombre, nombre, extension, codificacion, so)
		except TypeError:
			pass

		cadenaB64 = self.utilidad.obtenerBase64(archivo)
		cadena = list()
		cadena.append(cadenaB64)

		criptograma = self.modoCifrar(cadena, 0, clave)

		self.utilidad.crearArchivo(nombre+extension+".CIF", criptograma.encode(), "wb")

		cantidadRelleno = len(criptograma) - len(cadenaB64)
		self.utilidad.crearArchivo(nombre+".mtd", str(cantidadRelleno), "a")

	def descifrarArchivo(self, archivo, n, clave):
		"""
		Método que se encarga de descifrar un archivo con codificación binaria.

		Parámetros:
		archivo: Dirección del archivo plano que se desea descifrar.
		n: la cantidad de iteraciones con la que se desea descifrar el archivo plano.
		   Por ahora éste parámetro se utiliza para la Transposicion Doble.
		"""
		try:
			metadatos = self.obtenerArchivoMetadatos(archivo)
			nombre = metadatos[0]
			extension = metadatos[1]
		except TypeError as te:
			print(te , " descifrarArchivo -- Template")

		cadenaB64 = self.utilidad.leerArchivo(self.utilidad.dirSalida+nombre+extension+".CIF", "r")

		cadena = list()
		cadena.append(cadenaB64)

		textoClaro = self.modoDescifrar(cadena, 0, clave)
		textoClaro = self.utilidad.cadena_a_Base64(textoClaro)
		self.utilidad.crearArchivo(nombre+extension, textoClaro, "wb")

	#-----------------------------------------------------------------------------Métodos adicionales

	def obtenerArchivoMetadatos(self, archivo):
		"""
		Método que se encarga de obtener los metadatos del archivo (tanto texto como binario)
		para poder realizar el proceso de descifrado.
		"""
		#Obtener el archivo de metadatos según el nombre del archivo Cifrado
		direccion = os.path.splitext(archivo)
		nombre = direccion[0].split("/")[-1]
		nombre = os.path.splitext(nombre)[0]

		#Leer el archivo de metadatos -> metadatos = [nombre, extension, codificacion, so]
		metadatos = self.utilidad.leerArchivo(self.utilidad.dirSalida+nombre+".mtd", "r")
		return metadatos.split("\n")

	def __crearArchivoDescifrado(self, textoClaro, codificacion, nombre, extension):
		"""
		Método que se encarga de crear el ArchivoDescifrado, cambiando la codificación si es
		necesario. Este método por ahora se usa sólo para descifrarTexto.
		"""
		self.utilidad.crearArchivo("tmp", textoClaro, "w")
		self.utilidad.resolverCodificacion("UTF-8", codificacion, self.utilidad.dirSalida+"tmp", nombre+extension)
		os.remove(self.utilidad.dirSalida+"tmp")

	def __resolverSaltoLinea(self,nombre,extension,so):
		"""
		Método que se encarga de resolver el salto de línea, cuando el archivo original era proveniente
		de un sistema Windos (LF-> CLRF). Este método por ahora se utiliza sólo para descifrarTexto.
		"""
		if so == "WINDOWS":
			direccion = self.utilidad.dirSalida+nombre+extension
			self.utilidad.resolverSaltoLinea(direccion)
	#------------------------------------------------------------------------------------------------

class ControladorCesarSD(ControladorSustitucionMonoTemplate):
	"""
	Clase concreta que va a implementar el modoCifrar y modoDescifrar de la clase Template.
	"""
	def __init__(self):
		super(ControladorCesarSD, self).__init__()
		self.cesar = Cesar()
		self.utilidad = Utilidad()

	def modoCifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0

		self.cesar.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.cesar.textoCifrado= self.cesar.textoCifrado + self.cesar.cifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.cesar.textoCifrado= self.cesar.textoCifrado + self.cesar.cifrar(cadena[x], cantidadRellenoB64, clave)
				for p in self.cesar.cadena:
						if(p>len(self.cesar.cadena - 3)):
							if(p=='='):
								self.cesar.textoCifrado = + '='
		return self.cesar.textoCifrado

	def modoDescifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0

		self.cesar.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.cesar.textoClaro= self.cesar.textoClaro + self.cesar.descifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.cesar.textoClaro= self.cesar.textoClaro + self.cesar.descifrar(cadena[x], cantidadRellenoB64, clave)
				for p in self.cesar.cadena:
						if(p>len(self.cesar.cadena - 3)):
							if(p=='='):
								self.cesar.textoClaro = + '='
		return self.cesar.textoClaro

	def modoDefinicionAlfabeto(self, *argumentos):
		try:
			argumentos = list(argumentos)
			alfabeto = argumentos[0]
		except IndexError:
			alfabeto = "B64"
		self.cesar.definirAlfabeto(alfabeto)

class ControladorPlayfairSD(ControladorSustitucionMonoTemplate):
	"""
	Clase concreta que va a implementar el modoCifrar y modoDescifrar de la clase Template.
	"""
	def __init__(self):
		super(ControladorPlayfairSD, self).__init__()
		self.playfair = Playfair()
		self.utilidad = Utilidad()

	def modoCifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0

		self.playfair.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.playfair.textoCifrado= self.playfair.textoCifrado + self.playfair.cifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.playfair.textoCifrado= self.playfair.textoCifrado + self.playfair.cifrar(cadena[x], cantidadRellenoB64, clave)
		return self.playfair.textoCifrado

	def modoDescifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0
		self.playfair.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.playfair.textoClaro= self.playfair.textoClaro + self.playfair.descifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.playfair.textoClaro= self.playfair.textoClaro + self.playfair.descifrar(cadena[x], cantidadRellenoB64, clave)
		return self.playfair.textoClaro

	def modoDefinicionAlfabeto(self, *argumentos):
		try:
			argumentos = list(argumentos)
			alfabeto = argumentos[0]
		except IndexError:
			alfabeto = "B64"
		self.playfair.definirAlfabeto(alfabeto)

class ControladorPolybiosSD(ControladorSustitucionMonoTemplate):
	"""
	Clase concreta que va a implementar el modoCifrar y modoDescifrar de la clase Template.
	"""
	def __init__(self):
		super(ControladorPolybiosSD, self).__init__()
		self.polybios = Polybios()
		self.utilidad = Utilidad()

	def modoCifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0

		self.polybios.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.polybios.textoCifrado= self.polybios.textoCifrado + self.polybios.cifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.polybios.textoCifrado= self.polybios.textoCifrado + self.polybios.cifrar(cadena[x], cantidadRellenoB64, clave)
		return self.polybios.textoCifrado

	def modoDescifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			cantidadRellenoB64 = argumentos[1]
			clave = argumentos[2]
		except IndexError:
			cantidadRellenoB64 = 0
		self.polybios.cadena = cadena
		largo = len(cadena)
		for x in range(0, largo):
			if(x<largo):
				self.polybios.textoClaro= self.polybios.textoClaro + self.polybios.descifrar(cadena[x], cantidadRellenoB64, clave) + "\n"
			else:
				self.polybios.textoClaro= self.polybios.textoClaro + self.polybios.descifrar(cadena[x], cantidadRellenoB64, clave)
		return self.polybios.textoClaro

	def modoDefinicionAlfabeto(self, *argumentos):
		try:
			argumentos = list(argumentos)
			alfabeto = argumentos[0]
		except IndexError:
			alfabeto = "B64"
		self.polybios.definirAlfabeto(alfabeto)

class ControladorAfinSD(ControladorSustitucionMonoTemplate):
	"""
	Clase concreta que va a implementar el modoCifrar y modoDescifrar de la clase Template.
	"""
	def __init__(self, clave=None, alfabeto=None):
		super(ControladorAfinSD, self).__init__()
		self.clave = clave
		self.alfabeto = alfabeto
		self.afin = Afin(clave, alfabeto)
		self.utilidad = Utilidad()

	def modoCifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
		except IndexError:
			pass

		self.afin.cadena = cadena
		self.afin.cifrar()
		return self.afin.textoCifrado

	def modoDescifrar(self, *argumentos):
		try:
			argumentos = list(argumentos)
			cadena = argumentos[0]
			clave = argumentos[1]
		except IndexError:
			pass

		self.afin.cadena = cadena
		self.afin.clave = clave
		self.afin.descifrar()
		return self.afin.textoClaro


text:
from inflection import camelize
import requests
import traceback

class Geocoder():

    def __init__(self, service, opts=None):
        for s in [service, camelize(service)]:
            try: self.service = getattr(self, s)(opts)
            except: continue
        if self.service is None:
            raise AttributeError

    def lookup(self, **params):
        self.service.lookup(**params)

    def reverse_lookup(self, lat, lng, **kwargs):
        self.service.reverse_lookup(lat, lng, **kwargs)

    def check_for_data(self):
        func = self

        def check_for_data_and_call(self, *args, **kwargs):
            if self.service.data is None:
                raise Exception('No data available. Do a lookup or reverse lookup first.')
            return func(self, *args, **kwargs)

        return check_for_data_and_call

    @check_for_data
    def lat_long(self):
        return self.service.lat_long()

    @check_for_data
    def street_address(self):
        return self.service.street_address()

    @check_for_data
    def city(self):
        return self.service.city()

    @check_for_data
    def state(self):
        return self.service.state()

    @check_for_data
    def zip5(self):
        return self.service.zip5()

    @check_for_data
    def zip4(self):
        return self.service.zip4()

    @check_for_data
    def address(self):
        return self.service.address()

    class TexasAm:

        TEXAS_AM_BASE_URL = 'https://geoservices.tamu.edu/Services/Geocode/WebService/GeocoderWebServiceHttpNonParsed_V04_01.aspx'
        TEXAS_AM_REVERSE_BASE_URL = 'https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP/default.aspx'

        def __init__(self, opts=None):
            try:
                self.apiKey = opts['apiKey']
                self.version = opts.get('version','4.01')
                self.format = opts.get('format', 'json')
                self.data = None
            except KeyError:
                print('This service requires an apiKey and version.')
                raise KeyError

        def lookup(self, **params):

            params = {
                'apiKey': self.apiKey,
                'version': self.version,
                'streetAddress': params.get('street_address',''),
                'city': params.get('city',''),
                'state': params.get('state',''),
                'zip': params.get('zip5',''),
                'format': self.format
            }

            try:
                r = requests.get(self.TEXAS_AM_BASE_URL, params=params)
                self.data = r.json() if self.format == 'json' else r.text
                return self
                # TODO convert other formats to correct json
            except:
                pass

        def reverse_lookup(self, lat, lng, **kwargs):

            params = {
                'apiKey': self.apiKey,
                'version': self.version,
                'lat': lat,
                'lon': lng,
                'format': self.format,
                'state': kwargs.get('state', ''),
            }

            try:
                r = requests.get(self.TEXAS_AM_REVERSE_BASE_URL, params=params)
                self.data = r.json() if self.format == 'json' else r.text
                return self
                # TODO convert other formats to correct json
            except:
                print(traceback.format_exc())
                pass

        def address(self):
            return {
                'street_address': self.street_address(),
                'city': self.city(),
                'state': self.state(),
                'zip5': self.zip5(),
                'zip4': self.zip4()
            }

        def street_address(self):
            return self.data['StreetAddresses'][0]['StreetAddress']

        def city(self):
            return self.data['StreetAddresses'][0]['City']

        def state(self):
            return self.data['StreetAddresses'][0]['State']

        def zip5(self):
            return self.data['StreetAddresses'][0]['Zip']

        def zip4(self):
            return self.data['StreetAddresses'][0]['ZipPlus4']

        def lat_long(self):
            return (self.data['OutputGeocodes'][0]['OutputGeocode']['Latitude'],
                    self.data['OutputGeocodes'][0]['OutputGeocode']['Longitude'])


text:
<?php

namespace Tests\Rudz\FreshBundle\Command;

use Tests\AppBundle\WebTestCase;
use Rudz\FreshBundle\Command\Test\SleeperCommand;
use Symfony\Component\Process\Process;

class LockingTest extends WebTestCase
{
    /**
     * @group console
     */
    public function testSleeperCommand()
    {
        // init
        $sleeperCommand = new SleeperCommand();
        $sleeperCommandLockFilePath = sprintf(
            '%s/lock_command_%s',
            $this->getClient()->getKernel()->getCacheDir(),
            str_replace(':', '_', $sleeperCommand->getName())
        );
        $commandline = sprintf(
            'env bin/console --env=%s %s',
            $this->getClient()->getKernel()->getEnvironment(),
            $sleeperCommand->getName()
        );

        // the first run of this command with the locking mechanism: the lock is created
        $firstProcess = new Process($commandline);
        $firstProcess->start();
        sleep(SleeperCommand::SLEEPING_TIME / 2);

        // the second run of this command is invalid
        $secondProcess = new Process($commandline);
        $secondProcess->run();
        $this->assertSame(2, $secondProcess->getExitCode(), 'Invalid exit code');
        $secondProcessOutput = $secondProcess->getOutput();
        $this->assertSame(2, substr_count($secondProcessOutput, PHP_EOL), 'There is more than two lines');
        $this->assertContains('locking is activated', $secondProcessOutput, 'Incorrect line 1');
        $this->assertContains('will not be started', $secondProcessOutput, 'Incorrect line 2');

        // check the first process is still running
        $this->assertTrue($firstProcess->isRunning(), sprintf('The command %s does not work', $firstProcess->getCommandLine()));

        // after the sleeping, the lock is released
        sleep(1 + SleeperCommand::SLEEPING_TIME / 2);
        $this->assertSame(0, $firstProcess->getExitCode());
        $firstProcessOutput = $firstProcess->getOutput();
        $this->assertSame(3, substr_count($firstProcessOutput, PHP_EOL), 'There is more than three lines');
        $this->assertContains('starting', $firstProcessOutput);
        $this->assertContains('processing', $firstProcessOutput);
        $this->assertContains('ending', $firstProcessOutput);

        // the third run of this command, after the sleeping, is valid
        $thirdProcess = new Process($commandline);
        $thirdProcess->run();
        $this->assertSame(0, $thirdProcess->getExitCode());
    }
}