text:
<?php

namespace Formapro\Values;

class HooksEnum
{
    const PRE_SET_VALUE = 'pre_set_value';
    const PRE_ADD_VALUE = 'pre_add_value';
    const POST_SET_VALUE = 'post_set_value';
    const POST_SET_VALUES = 'post_set_values';
    const POST_ADD_VALUE = 'post_add_values';
    const POST_GET_VALUE = 'post_get_value';

    const POST_SET_OBJECT = 'post_set_object';
    const POST_ADD_OBJECT = 'post_add_object';
    const POST_BUILD_OBJECT = 'post_build_object';
    const POST_BUILD_SUB_OBJECT = 'post_build_sub_object';
    const GET_OBJECT_CLASS = 'get_object_class';
    const BUILD_OBJECT = 'build_object';
}


text:
package no.javazone.ems;

import net.hamnaberg.json.Item;
import no.javazone.sessions.EmsIds;
import org.junit.Test;

import java.net.URI;
import java.util.UUID;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;

public class EmsIdMapperTest {

    public static final String ITEM_URL = "http://test.javazone.no/ems/server/events/e213acd2-ad9e-4bba-a5aa-87d47fed5d08/sessions/717e34d7-f713-4edb-bb44-1b494d716b3b";

    @Test
    public void should_map_from_item_url_to_id() {
        Item item = Item.builder(URI.create(ITEM_URL)).build();
        EmsIds emsIds = EmsIdMapper.mapToEmsIds(item);

        assertThat(emsIds.getEventId(), is(UUID.fromString("e213acd2-ad9e-4bba-a5aa-87d47fed5d08")));
        assertThat(emsIds.getSessionId(), is(UUID.fromString("717e34d7-f713-4edb-bb44-1b494d716b3b")));
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>Black square reference</title>

Test passes if you see a black square, and no red.


text:
title: "Radium Keylogger"
layout: post
date: 2017-01-23 22:28
tag: python
image: https://image.ibb.co/bZHJ0a/IMG_0004.jpg
headerImage: false
projects: true
hidden: true # don't count this post in blog pagination
description: "Python keylogger with multiple features."
category: project
author: mehulj94
externalLink: https://mehulj94.github.io/Radium-Keylogger/
---


text:
Originally published: 2005-07-11 06:18:30
Last updated: 2005-07-11 06:18:30
Author: Lutz Horn

A method to parse a file like object containing data in the record jar format as described by ESR in "The Art of Unix Programming" (see http://www.faqs.org/docs/artu/ch05s02.html#id2906931).


text: Consider using [ForgeFed](https://forgefed.org/) compatible hosts for your projects


text:
using content::BrowserThread;
using content::PluginService;

namespace {

// TODO(xhwang): Move duplicate code among all component installer
// implementations to some common place.

// TODO(xhwang): This is the sha256sum of "Widevine CDM". Get the real extension
// ID for Widevine CDM.
// CRX hash. The extension id is: lgafhhiijclkaikclkjjofekikijofcm.
const uint8 kSha2Hash[] = {0xb6, 0x05, 0x77, 0x88, 0x92, 0xba, 0x08, 0xa2,
                           0xba, 0x99, 0xe5, 0x4a, 0x8a, 0x89, 0xe5, 0x2c,
                           0x88, 0x38, 0x2f, 0xf5, 0xa7, 0x7b, 0x93, 0xe7,
                           0xf1, 0x84, 0xcc, 0x37, 0xe1, 0xe5, 0x7a, 0xbd};

// File name of the Widevine CDM component manifest on different platforms.
const char kWidevineCdmManifestName[] = "WidevineCdm";

// Name of the Widevine CDM OS in the component manifest.
const char kWidevineCdmOperatingSystem[] =
#if defined(OS_MACOSX)
    "mac";
#elif defined(OS_WIN)
    "win";
#else  // OS_LINUX, etc. TODO(viettrungluu): Separate out Chrome OS and Android?
    "linux";
#endif

// Name of the Widevine CDM architecture in the component manifest.
const char kWidevineCdmArch[] =
#if defined(ARCH_CPU_X86)
    "ia32";
#elif defined(ARCH_CPU_X86_64)
    "x64";
#else  // TODO(viettrungluu): Support an ARM check?
    "???";
#endif

// If we don't have a Widevine CDM component, this is the version we claim.
const char kNullVersion[] = "0.0.0.0";

// The base directory on Windows looks like:
// <profile>\AppData\Local\Google\Chrome\User Data\WidevineCdm\.
base::FilePath GetWidevineCdmBaseDirectory() {
  base::FilePath result;
  PathService::Get(chrome::DIR_WIDEVINE_CDM, &result);
  return result;
}

#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)
// Widevine CDM plugins have the version encoded in the path itself
// so we need to enumerate the directories to find the full path.
// On success, |latest_dir| returns something like:
// <profile>\AppData\Local\Google\Chrome\User Data\WidevineCdm\10.3.44.555\.
// |latest_version| returns the corresponding version number. |older_dirs|
// returns directories of all older versions.
bool GetWidevineCdmDirectory(base::FilePath* latest_dir,
                             base::Version* latest_version,
                             std::vector<base::FilePath>* older_dirs) {
  base::FilePath base_dir = GetWidevineCdmBaseDirectory();
  bool found = false;
  file_util::FileEnumerator file_enumerator(
      base_dir, false, file_util::FileEnumerator::DIRECTORIES);
  for (base::FilePath path = file_enumerator.Next(); !path.value().empty();
       path = file_enumerator.Next()) {
    base::Version version(path.BaseName().MaybeAsASCII());
    if (!version.IsValid())
      continue;
    if (found) {
      if (version.CompareTo(*latest_version) > 0) {
        older_dirs->push_back(*latest_dir);
        *latest_dir = path;
        *latest_version = version;
      } else {
        older_dirs->push_back(path);
      }
    } else {
      *latest_dir = path;
      *latest_version = version;
      found = true;
    }
  }
  return found;
}
#endif  // defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)

// Returns true if the Pepper |interface_name| is implemented  by this browser.
// It does not check if the interface is proxied.
bool SupportsPepperInterface(const char* interface_name) {
  if (webkit::ppapi::PluginModule::SupportsInterface(interface_name))
    return true;
  // The PDF interface is invisible to SupportsInterface() on the browser
  // process because it is provided using PpapiInterfaceFactoryManager. We need
  // to check for that as well.
  // TODO(cpu): make this more sane.
  return (strcmp(interface_name, PPB_PDF_INTERFACE) == 0);
}

bool MakeWidevineCdmPluginInfo(const base::FilePath& path,
                               const base::Version& version,
                               content::PepperPluginInfo* plugin_info) {
  if (!version.IsValid() ||
      version.components().size() !=
          static_cast<size_t>(kWidevineCdmVersionNumComponents)) {
    return false;
  }

  plugin_info->is_internal = false;
  // Widevine CDM must run out of process.
  plugin_info->is_out_of_process = true;
  plugin_info->path = path;
  plugin_info->name = kWidevineCdmPluginName;
  plugin_info->description = kWidevineCdmPluginDescription;
  plugin_info->version = version.GetString();
  webkit::WebPluginMimeType widevine_cdm_mime_type(
      kWidevineCdmPluginMimeType,
      kWidevineCdmPluginExtension,
      kWidevineCdmPluginMimeTypeDescription);
  plugin_info->mime_types.push_back(widevine_cdm_mime_type);
  plugin_info->permissions = kWidevineCdmPluginPermissions;

  return true;
}

void RegisterWidevineCdmWithChrome(const base::FilePath& path,
                                   const base::Version& version) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  content::PepperPluginInfo plugin_info;
  if (!MakeWidevineCdmPluginInfo(path, version, &plugin_info))
    return;

  PluginService::GetInstance()->RegisterInternalPlugin(
      plugin_info.ToWebPluginInfo(), true);
  PluginService::GetInstance()->RefreshPlugins();
}

// Returns true if this browser implements one of the interfaces given in
// |interface_string|, which is a '|'-separated string of interface names.
bool CheckWidevineCdmInterfaceString(const std::string& interface_string) {
  std::vector<std::string> interface_names;
  base::SplitString(interface_string, '|', &interface_names);
  for (size_t i = 0; i < interface_names.size(); i++) {
    if (SupportsPepperInterface(interface_names[i].c_str()))
      return true;
  }
  return false;
}

// Returns true if this browser implements all the interfaces that Widevine CDM
// specifies in its component installer manifest.
bool CheckWidevineCdmInterfaces(const base::DictionaryValue& manifest) {
  const base::ListValue* interface_list = NULL;

  // We don't *require* an interface list, apparently.
  if (!manifest.GetList("x-ppapi-required-interfaces", &interface_list))
    return true;

  for (size_t i = 0; i < interface_list->GetSize(); i++) {
    std::string interface_string;
    if (!interface_list->GetString(i, &interface_string))
      return false;
    if (!CheckWidevineCdmInterfaceString(interface_string))
      return false;
  }

  return true;
}

// Returns true if this browser is compatible with the given Widevine CDM
// manifest, with the version specified in the manifest in |version_out|.
bool CheckWidevineCdmManifest(const base::DictionaryValue& manifest,
                              base::Version* version_out) {
  std::string name;
  manifest.GetStringASCII("name", &name);

  if (name != kWidevineCdmManifestName)
    return false;

  std::string proposed_version;
  manifest.GetStringASCII("version", &proposed_version);
  base::Version version(proposed_version.c_str());
  if (!version.IsValid())
    return false;

  if (!CheckWidevineCdmInterfaces(manifest))
    return false;

  std::string os;
  manifest.GetStringASCII("x-ppapi-os", &os);
  if (os != kWidevineCdmOperatingSystem)
    return false;

  std::string arch;
  manifest.GetStringASCII("x-ppapi-arch", &arch);
  if (arch != kWidevineCdmArch)
    return false;

  *version_out = version;
  return true;
}

}  // namespace

class WidevineCdmComponentInstaller : public ComponentInstaller {
 public:
  explicit WidevineCdmComponentInstaller(const base::Version& version);
  virtual ~WidevineCdmComponentInstaller() {}

  virtual void OnUpdateError(int error) OVERRIDE;
  virtual bool Install(base::DictionaryValue* manifest,
                       const base::FilePath& unpack_path) OVERRIDE;

 private:
  base::Version current_version_;
};

WidevineCdmComponentInstaller::WidevineCdmComponentInstaller(
    const base::Version& version)
    : current_version_(version) {
  DCHECK(version.IsValid());
}

void WidevineCdmComponentInstaller::OnUpdateError(int error) {
  NOTREACHED() << "Widevine CDM update error: " << error;
}

bool WidevineCdmComponentInstaller::Install(base::DictionaryValue* manifest,
                                            const base::FilePath& unpack_path) {
  base::Version version;
  if (!CheckWidevineCdmManifest(*manifest, &version))
    return false;
  if (current_version_.CompareTo(version) > 0)
    return false;

  // TODO(xhwang): Also check if Widevine CDM binary exists.
  if (!file_util::PathExists(unpack_path.Append(kWidevineCdmPluginFileName)))
    return false;

  // Passed the basic tests. Time to install it.
  base::FilePath path =
      GetWidevineCdmBaseDirectory().AppendASCII(version.GetString());
  if (file_util::PathExists(path))
    return false;
  if (!file_util::Move(unpack_path, path))
    return false;

  // Installation is done. Now tell the rest of chrome. Both the path service
  // and to the plugin service.
  current_version_ = version;
  PathService::Override(chrome::DIR_PEPPER_FLASH_PLUGIN, path);
  path = path.Append(kWidevineCdmPluginFileName);
  BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
      base::Bind(&RegisterWidevineCdmWithChrome, path, version));
  return true;
}

namespace {

#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)
void StartWidevineCdmUpdateRegistration(ComponentUpdateService* cus) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
  base::FilePath path = GetWidevineCdmBaseDirectory();
  if (!file_util::PathExists(path) && !file_util::CreateDirectory(path)) {
    NOTREACHED() << "Could not create Widevine CDM directory.";
    return;
  }

  base::Version version(kNullVersion);
  std::vector<base::FilePath> older_dirs;
  if (GetWidevineCdmDirectory(&path, &version, &older_dirs)) {
    path = path.Append(kWidevineCdmPluginFileName);
    if (file_util::PathExists(path)) {
      BrowserThread::PostTask(
          BrowserThread::UI, FROM_HERE,
          base::Bind(&RegisterWidevineCdmWithChrome, path, version));
    } else {
      version = base::Version(kNullVersion);
    }
  }

  BrowserThread::PostTask(
      BrowserThread::UI, FROM_HERE,
      base::Bind(&FinishWidevineCdmUpdateRegistration, cus, version));

  // Remove older versions of Widevine CDM.
  for (std::vector<base::FilePath>::iterator iter = older_dirs.begin();
       iter != older_dirs.end(); ++iter) {
    file_util::Delete(*iter, true);
  }
}

void FinishWidevineCdmUpdateRegistration(ComponentUpdateService* cus,
                                         const base::Version& version) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  CrxComponent widevine_cdm;
  widevine_cdm.name = "WidevineCdm";
  widevine_cdm.installer = new WidevineCdmComponentInstaller(version);
  widevine_cdm.version = version;
  widevine_cdm.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]);
  if (cus->RegisterComponent(widevine_cdm) != ComponentUpdateService::kOk) {
    NOTREACHED() << "Widevine CDM component registration failed.";
  }
}
#endif  // defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)

}  // namespace

void RegisterWidevineCdmComponent(ComponentUpdateService* cus) {
#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)
  BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
                          base::Bind(&StartWidevineCdmUpdateRegistration, cus));
#endif  // defined(WIDEVINE_CDM_AVAILABLE) && !defined(OS_LINUX)
}


text:
use std::collections::HashMap;
use std::thread;
use std::time::{Duration, Instant};

use anyhow::Result;
use clap::Clap;
use laminar::{Packet, Socket};
use legion::*;
use log::{debug, error, info, warn, LevelFilter};
use macroquad::prelude::*;
use simplelog::{Config, TermLogger, TerminalMode};

use zombenum_shared::components::GameEntityId;
use zombenum_shared::components::{Component, PlayerId};
use zombenum_shared::messages::client::ClientMessage;
use zombenum_shared::messages::server::{ServerMessage, ServerMessageType};

mod cli;
mod input;
mod network;
mod systems;

use input::get_input_events;
use network::receive::get_server_updates;
use network::send::send_input_events;

const SERVER: &str = "127.0.0.1:14191";

fn window_conf() -> Conf {
    Conf {
        window_title: "Zombenum".to_string(),
        ..Default::default()
    }
}

#[macroquad::main(window_conf)]
async fn main() {
    run().await.expect("Error in run()");
}

async fn run() -> Result<()> {
    let opt = cli::CliArguments::parse();
    // Set the verbosity level of the logger.
    let level = match opt.verbose {
        0 => LevelFilter::Warn,
        1 => LevelFilter::Info,
        _ => LevelFilter::Debug,
    };
    TermLogger::init(level, Config::default(), TerminalMode::Mixed)?;

    info!("Starting client");

    let mut socket = Socket::bind_any()?;
    info!("Bound on {}", socket.local_addr()?.to_string());

    let (sender, receiver) = (socket.get_packet_sender(), socket.get_event_receiver());
    let _thread = thread::spawn(move || socket.start_polling());

    info!("Server is {}", SERVER);
    let server = SERVER.parse()?;

    let mut world = World::default();
    let mut resources = Resources::default();
    let mut schedule = Schedule::builder()
        .add_system(systems::draw_system())
        .build();

    // Legion's ids of the same entities, might differ between the server and client worlds.
    // This map allows us to easily map GameEntityIds, which are shared and identical between all
    // members, to our local Legion Entity ids. This is, for instance, used during Component updates.
    let mut game_entity_id_map: HashMap<GameEntityId, Entity> = HashMap::new();

    // We start out not connected. Eventually, we'll send a `JoinGame` message and receive a reply
    // with our first initial game state. That's when we'll first be connected. However, we might
    // run into issues and the server might time us out in which case we'll receive network errors
    // and we'll revert this value to `false` and try to connect again.
    // let mut is_connected = false;

    let mut last_server_session_time = Duration::default();
    let mut last_server_session_time_changed_at = Instant::now();

    info!("Sending JoinGame");
    let join_game_msg = ClientMessage::JoinGame(PlayerId::new());
    sender.send(Packet::reliable_unordered(
        server,
        bincode::serialize(&join_game_msg)?,
    ))?;

    info!("Start main loop");
    loop {
        let session_time =
            last_server_session_time + (Instant::now() - last_server_session_time_changed_at);
        debug!("Starting tick at session time {:?}", session_time);
        // Get a list of all input events issued by the user.
        let input_events = get_input_events();

        // Send those input events to the server.
        send_input_events(&input_events, &sender, server, session_time)?;

        // Collect and handle all server messages since the last tick.
        let server_messages = get_server_updates(&receiver, server)?;
        for message in server_messages {
            let received_server_session_time =
                handle_world_update(&mut world, &mut game_entity_id_map, message);

            // Update last received server session time if it is more recent than the current value.
            if last_server_session_time < received_server_session_time {
                last_server_session_time = received_server_session_time;
                last_server_session_time_changed_at = Instant::now();
                debug!(
                    "Received new server session time {} at {:?}",
                    last_server_session_time.as_millis(),
                    last_server_session_time_changed_at,
                );
            }
        }

        clear_background(WHITE);
        schedule.execute(&mut world, &mut resources);
        next_frame().await
    }
}

fn handle_world_update(
    world: &mut World,
    game_entity_id_map: &mut HashMap<GameEntityId, Entity>,
    message: ServerMessage,
) -> Duration {
    if let ServerMessageType::WorldUpdate(world_update) = message.message_type {
        add_new_entities(world, game_entity_id_map, world_update.new_entities);
        update_components(world, game_entity_id_map, world_update.changed_components);
    }

    message.session_time
}

/// Some component changed on the server.
/// This function handles those updates and integrates them into our world.
fn update_components(
    world: &mut World,
    game_entity_id_map: &mut HashMap<GameEntityId, Entity>,
    changed_components: Vec<(GameEntityId, Component)>,
) {
    for (game_entity_id, component) in changed_components {
        let entity = if let Some(entity) = game_entity_id_map.get(&game_entity_id) {
            *entity
        } else {
            warn!(
                "Got update {:?} for unknown entity {:?}",
                component, game_entity_id
            );
            continue;
        };

        // For now this logic is SUPER simple, this will be replaced in the future
        // By adding a component over an existing one, we just delete the old component and replace
        // it with the new values wie got by the server.
        if let Some(mut entry) = world.entry(entity) {
            add_component_to_entity(&mut entry, component);
        } else {
            error!(
                "Got update {:?} for unknown entity {:?}",
                component, game_entity_id
            );
        }
    }
}

/// The server added some new entities.
/// This functions adds all those entities to our world and registers them in our
/// game_entity_id_map.
fn add_new_entities(
    world: &mut World,
    game_entity_id_map: &mut HashMap<GameEntityId, Entity>,
    entities: Vec<Vec<Component>>,
) {
    for components in entities.into_iter() {
        let entity = world.push(());
        let mut entry = world.entry(entity).unwrap();

        // Get the GameEntityId from the entity's component list.
        // We have to go through all components and filter the correct one.
        let game_entity_id = components
            .iter()
            .filter(|component| matches!(component, Component::GameEntityId(_)))
            .map(|component| {
                if let Component::GameEntityId(component) = component {
                    Some(component.clone())
                } else {
                    None
                }
            })
            .next();

        // Add the GameEntityId with our local EntityId to the game_entity_id_map.
        // Print an error message if there's no GameEntityId.
        // This should never be the case!
        if let Some(game_entity_id) = game_entity_id.flatten() {
            game_entity_id_map.insert(game_entity_id, entity);
        } else {
            error!("Got an entity without an GameEntityId: {:?}", components);
        }

        info!("Create new entity");
        for component in components {
            info!("Add component: {:?}", component);
            add_component_to_entity(&mut entry, component);
        }
    }
}

fn add_component_to_entity(entry: &mut world::Entry, component: Component) {
    match component {
        Component::GameEntityId(component) => entry.add_component(component),
        Component::PlayerId(component) => entry.add_component(component),
        Component::Position(component) => entry.add_component(component),
        Component::Drawable(component) => entry.add_component(component),
    }
}


text:
package de.realityinabox.databinding.types;

import de.realityinabox.databinding.sourcemodel.ClassType;
import de.realityinabox.databinding.sourcemodel.MultiProperty;
import de.realityinabox.databinding.sourcemodel.Package;
import de.realityinabox.databinding.sourcemodel.SourceFactory;
import de.realityinabox.util.Pair;

public class ListType extends CompositeType {

    private boolean ordered = true;

    protected ListType(Package pack, String name) {
        super(pack, name);
    }

    public boolean isOrdered() {
        return ordered;
    }

    public void setOrdered(boolean ordered) {
        this.ordered = ordered;
    }

    public void makeProperties(ClassType container) {
        for (Pair<String,Type> c : getComponents()) {
            MultiProperty p = SourceFactory.newMultiProperty(getPackage(),
                    c.getLeft(), c.getRight());
            p.setOrdered(isOrdered());
            container.addProperty(p);
        }
    }

	public void addComponent(String name, Type component) {
		component.getClassType();
		super.addComponent(name, component);
	}
}


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

namespace EmailRegistry_3_5.Infrastructure.Extensions.AsynchronousExecution.AsyncAwait
{
    public abstract partial class AsyncOperation<TResult>
    {
        private AsyncResult<TResult> _result;
        private IEnumerator<Step> _steps;
        private AsyncCallback _moveNext;
        private Step _currentStep;
        private bool _anyStepCompletedAsync;

        protected interface IExceptionHandler
        {
            bool Handle(Exception exception);
        }

        protected TResult Result { get; set; }

        public static TResult End(IAsyncResult result)
        {
            return ((AsyncResult<TResult>)result).EndInvoke();
        }

        public IAsyncResult Start(AsyncCallback callback, object state)
        {
            _result = new AsyncResult<TResult>(callback, state);
            _steps = Steps();
            _moveNext = MoveNext;
            MoveNextInner(null);
            return _result;
        }

        protected abstract IEnumerator<Step> Steps();

        private static void MoveNext(IAsyncResult result)
        {
            if (!result.CompletedSynchronously)
            {
                ((AsyncOperation<TResult>)result.AsyncState).MoveNextInner(result);
            }
        }

        private void MoveNextInner(IAsyncResult result)
        {
            try
            {
                if (result != null)
                {
                    _anyStepCompletedAsync = true;
                    _currentStep.EndInvoke(result);
                }

                while (_steps.MoveNext())
                {
                    _currentStep = _steps.Current;
                    var nextResult = _currentStep.BeginInvoke(_moveNext, this);
                    if (nextResult == null)
                    {
                        // No-op; exception was caught and handled.
                    }
                    else if (nextResult.CompletedSynchronously)
                    {
                        _currentStep.EndInvoke(nextResult);
                    }
                    else
                    {
                        return;
                    }
                }

                _result.SetAsCompleted(Result, !_anyStepCompletedAsync);
            }
            catch (Exception e)
            {
                using (_steps)
                {
                    if (result == null)
                    {
                        throw;
                    }

                    _result.SetAsCompleted(e, !_anyStepCompletedAsync);
                }
            }
        }
    }
}


text:
/*
 * Xero Payroll UK
 * This is the Xero Payroll API for orgs in the UK region.
 *
 * Contact: api@xero.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.xero.models.payrolluk;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.xero.api.StringUtil;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/** EmployeeLeaveTypes */
public class EmployeeLeaveTypes {
  StringUtil util = new StringUtil();

  @JsonProperty("pagination")
  private Pagination pagination;

  @JsonProperty("problem")
  private Problem problem;

  @JsonProperty("leaveTypes")
  private List<EmployeeLeaveType> leaveTypes = new ArrayList<EmployeeLeaveType>();
  /**
   * pagination
   *
   * @param pagination Pagination
   * @return EmployeeLeaveTypes
   */
  public EmployeeLeaveTypes pagination(Pagination pagination) {
    this.pagination = pagination;
    return this;
  }

  /**
   * Get pagination
   *
   * @return pagination
   */
  @ApiModelProperty(value = "")
  /**
   * pagination
   *
   * @return pagination Pagination
   */
  public Pagination getPagination() {
    return pagination;
  }

  /**
   * pagination
   *
   * @param pagination Pagination
   */
  public void setPagination(Pagination pagination) {
    this.pagination = pagination;
  }

  /**
   * problem
   *
   * @param problem Problem
   * @return EmployeeLeaveTypes
   */
  public EmployeeLeaveTypes problem(Problem problem) {
    this.problem = problem;
    return this;
  }

  /**
   * Get problem
   *
   * @return problem
   */
  @ApiModelProperty(value = "")
  /**
   * problem
   *
   * @return problem Problem
   */
  public Problem getProblem() {
    return problem;
  }

  /**
   * problem
   *
   * @param problem Problem
   */
  public void setProblem(Problem problem) {
    this.problem = problem;
  }

  /**
   * leaveTypes
   *
   * @param leaveTypes List<EmployeeLeaveType>
   * @return EmployeeLeaveTypes
   */
  public EmployeeLeaveTypes leaveTypes(List<EmployeeLeaveType> leaveTypes) {
    this.leaveTypes = leaveTypes;
    return this;
  }

  /**
   * leaveTypes
   *
   * @param leaveTypesItem EmployeeLeaveType
   * @return EmployeeLeaveTypes
   */
  public EmployeeLeaveTypes addLeaveTypesItem(EmployeeLeaveType leaveTypesItem) {
    if (this.leaveTypes == null) {
      this.leaveTypes = new ArrayList<EmployeeLeaveType>();
    }
    this.leaveTypes.add(leaveTypesItem);
    return this;
  }

  /**
   * Get leaveTypes
   *
   * @return leaveTypes
   */
  @ApiModelProperty(value = "")
  /**
   * leaveTypes
   *
   * @return leaveTypes List<EmployeeLeaveType>
   */
  public List<EmployeeLeaveType> getLeaveTypes() {
    return leaveTypes;
  }

  /**
   * leaveTypes
   *
   * @param leaveTypes List<EmployeeLeaveType>
   */
  public void setLeaveTypes(List<EmployeeLeaveType> leaveTypes) {
    this.leaveTypes = leaveTypes;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    EmployeeLeaveTypes employeeLeaveTypes = (EmployeeLeaveTypes) o;
    return Objects.equals(this.pagination, employeeLeaveTypes.pagination)
        && Objects.equals(this.problem, employeeLeaveTypes.problem)
        && Objects.equals(this.leaveTypes, employeeLeaveTypes.leaveTypes);
  }

  @Override
  public int hashCode() {
    return Objects.hash(pagination, problem, leaveTypes);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class EmployeeLeaveTypes {\n");
    sb.append("    pagination: ").append(toIndentedString(pagination)).append("\n");
    sb.append("    problem: ").append(toIndentedString(problem)).append("\n");
    sb.append("    leaveTypes: ").append(toIndentedString(leaveTypes)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
//
//  OpenGLOffscreenRenderer.hpp
//  GraphicsEngine
//
//  Created by Jonathan Graham on 7/22/17.
//  Copyright © 2017 Jonathan Graham. All rights reserved.
//

#ifndef OpenGLOffscreenRenderer_hpp
#define OpenGLOffscreenRenderer_hpp

#include <stdio.h>
#include <OpenGL/gl3.h>

#include "OpenGLShader.hpp"

class OpenGLOffscreenRenderer
{
public:
    void load(int width, int height);
    void unload();

    void bind(GLuint textureId);
    void unbind();

private:

    GLint m_width;
    GLint m_height;

    GLuint m_framebuffer;
    GLuint m_renderbuffer;

    GLint m_savedViewport[4];
    GLint m_savedFramebuffer;
    GLint m_savedRenderbuffer;

    void allocateBuffers(int width, int height);
    void checkFrameBufferStatus();
};

#endif /* OpenGLOffscreenRenderer_hpp */


text:
export default function dataURItoBlob(dataURI) {
  // convert base64 to raw binary data held in a string
  // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
  const byteString = atob(dataURI.split(',')[1]);

  // separate out the mime component
  const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]

  // write the bytes of the string to an ArrayBuffer
  const ab = new ArrayBuffer(byteString.length);

  // create a view into the buffer
  const ia = new Uint8Array(ab);

  // set the bytes of the buffer to the correct values
  for (let i = 0; i < byteString.length; i++) {
    ia[i] = byteString.charCodeAt(i);
  }

  // write the ArrayBuffer to a blob, and you're done
  const blob = new Blob([ab], { type: mimeString });
  return blob;
}


text:
from . import calculation as calc
from . import compatible as compat

@compat.check_special_characters
def validate(cnpj_number):
    """This function validates a CNPJ number.

    This function uses calculation package to calculate both digits
    and then validates the number.

    :param cnpj_number: a CNPJ number to be validated.  Only numbers.
    :type cnpj_number: string
    :return: Bool -- True for a valid number, False otherwise.

    """

    _cnpj = compat.clear_punctuation(cnpj_number)

    if len(_cnpj) != 14 or len(set(_cnpj)) == 1:
        return False

    first_part = _cnpj[:12]
    second_part = _cnpj[:13]
    first_digit = _cnpj[12]
    second_digit = _cnpj[13]

    if first_digit == calc.calculate_first_digit(
        first_part
    ) and second_digit == calc.calculate_second_digit(second_part):
        return True

    return False


text:
package state

import (
	"sync"
	"testing"

	proto "github.com/hyperledger/fabric-protos-go/gossip"
	"github.com/hyperledger/fabric/gossip/discovery"
	"github.com/hyperledger/fabric/gossip/metrics"
	gmetricsmocks "github.com/hyperledger/fabric/gossip/metrics/mocks"
	"github.com/hyperledger/fabric/gossip/protoext"
	"github.com/hyperledger/fabric/gossip/state/mocks"
	"github.com/hyperledger/fabric/protoutil"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/require"
)

func TestMetrics(t *testing.T) {
	mc := &mockCommitter{Mock: &mock.Mock{}}
	mc.On("CommitLegacy", mock.Anything).Return(nil)
	mc.On("LedgerHeight", mock.Anything).Return(uint64(100), nil).Twice()
	mc.On("DoesPvtDataInfoExistInLedger", mock.Anything).Return(false, nil)
	g := &mocks.GossipMock{}
	g.On("PeersOfChannel", mock.Anything).Return([]discovery.NetworkMember{})
	g.On("Accept", mock.Anything, false).Return(make(<-chan *proto.GossipMessage), nil)
	g.On("Accept", mock.Anything, true).Return(nil, make(chan protoext.ReceivedMessage))

	heightWG := sync.WaitGroup{}
	heightWG.Add(1)
	committedDurationWG := sync.WaitGroup{}
	committedDurationWG.Add(1)

	testMetricProvider := gmetricsmocks.TestUtilConstructMetricProvider()

	testMetricProvider.FakeHeightGauge.SetStub = func(delta float64) {
		heightWG.Done()
	}
	testMetricProvider.FakeCommitDurationHist.ObserveStub = func(value float64) {
		committedDurationWG.Done()
	}

	gossipMetrics := metrics.NewGossipMetrics(testMetricProvider.FakeProvider)

	// create peer with fake metrics provider for gossip state
	p := newPeerNodeWithGossipWithMetrics(0, mc, noopPeerIdentityAcceptor, g, gossipMetrics)
	defer p.shutdown()

	// add a payload to the payload buffer
	err := p.s.AddPayload(&proto.Payload{
		SeqNum: 100,
		Data:   protoutil.MarshalOrPanic(protoutil.NewBlock(100, []byte{})),
	})
	require.NoError(t, err)

	// update the ledger height to prepare for the pop operation
	mc.On("LedgerHeight", mock.Anything).Return(uint64(101), nil)

	// ensure the block commit event was sent, and the update event was sent
	heightWG.Wait()
	committedDurationWG.Wait()

	// ensure the right height was reported
	require.Equal(t,
		[]string{"channel", "testchannelid"},
		testMetricProvider.FakeHeightGauge.WithArgsForCall(0),
	)
	require.EqualValues(t,
		101,
		testMetricProvider.FakeHeightGauge.SetArgsForCall(0),
	)

	// after push or pop payload buffer size should be reported
	require.Equal(t,
		[]string{"channel", "testchannelid"},
		testMetricProvider.FakePayloadBufferSizeGauge.WithArgsForCall(0),
	)
	require.Equal(t,
		[]string{"channel", "testchannelid"},
		testMetricProvider.FakePayloadBufferSizeGauge.WithArgsForCall(1),
	)
	// both 0 and 1 as size can be reported, depends on timing
	size := testMetricProvider.FakePayloadBufferSizeGauge.SetArgsForCall(0)
	require.True(t, size == 1 || size == 0)
	size = testMetricProvider.FakePayloadBufferSizeGauge.SetArgsForCall(1)
	require.True(t, size == 1 || size == 0)
}


text:
package android.widget.layout.table;

import com.android.frameworks.coretests.R;

import android.app.Activity;
import android.os.Bundle;

/**
 * Exercise table layout with cells using a horizontal gravity.
 */
public class HorizontalGravity extends Activity {
    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.table_layout_horizontal_gravity);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

    <changeSet id="fix-workflow-id-column-type" author="fbristow">
        <modifyDataType tableName="workflow_named_parameters" columnName="workflow_id" newDataType="varchar(255)"/>
        <addNotNullConstraint tableName="workflow_named_parameters" columnName="workflow_id"
                              columnDataType="varchar(255)"/>
        <sql>
            update workflow_named_parameters set workflow_id = left(workflow_id, 36);
            <comment>
                Strip the trailing 'whitespace' characters (actually NUL characters) after converting from binary
                to varchar (36 is the number of characters in a UUID, with hyphens).
            </comment>
        </sql>
    </changeSet>
</databaseChangeLog>


text:
1. Install nginx `brew tap homebrew/nginx && brew install nginx-full --with-sub`
2. `cd blueocean-github-pipeline`
3. `./run_proxy.sh`

Github.com should be proxied at `http://localhost:9000/api/v3/`


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

using Aga.Controls.Tree;

using BitDiffer.Common.Model;
using BitDiffer.Common.Interfaces;
using BitDiffer.Common.Misc;

namespace BitDiffer.Client.Models
{
	class AssemblyGroupModel : ITreeModel
	{
		private AssemblyGroup _grp;

		public AssemblyGroupModel(AssemblyGroup grp)
		{
			_grp = grp;
		}

		public IEnumerable GetChildren(TreePath treePath)
		{
			if (treePath.IsEmpty())
			{
				//yield return new AssemblyGroupTreeItem(_grp);

				if (_grp.Assemblies.Count > 0)
				{
					foreach (RootDetail child in _grp.Assemblies[0].FilterChildrenInAll<RootDetail>())
					{
						yield return new DetailTreeItem(child);
					}
				}
			}
			else if (treePath.LastNode is AssemblyGroupTreeItem)
			{
				AssemblyGroup grp = ((AssemblyGroupTreeItem)treePath.LastNode).Group;

				if (grp.Assemblies.Count > 0)
				{
					foreach (RootDetail child in grp.Assemblies[0].FilterChildrenInAll<RootDetail>())
					{
						yield return new DetailTreeItem(child);
					}
				}
			}
			else if (treePath.LastNode is DetailTreeItem)
			{
				ICanCompare item = ((DetailTreeItem)treePath.LastNode).Item;

				foreach (RootDetail child in item.FilterChildrenInAll<RootDetail>())
				{
					yield return new DetailTreeItem(child);
				}
			}
		}

		public bool IsLeaf(TreePath treePath)
		{
			return (treePath.LastNode is DetailTreeItem) && (((DetailTreeItem)treePath.LastNode).Item.Children.Count == 0);
		}

#pragma warning disable 0067

		public event EventHandler<TreeModelEventArgs> NodesChanged;

		public event EventHandler<TreeModelEventArgs> NodesInserted;

		public event EventHandler<TreeModelEventArgs> NodesRemoved;

		public event EventHandler<TreePathEventArgs> StructureChanged;

#pragma warning restore 0067
	}
}


text:
package com.gitblit.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Test;

import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.FileSettings;
import com.gitblit.GitBlit;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;

public class GitBlitTest {

	@Test
	public void testRepositoryModel() throws Exception {
		List<String> repositories = GitBlit.self().getRepositoryList();
		assertTrue("Repository list is empty!", repositories.size() > 0);
		assertTrue(
				"Missing Helloworld repository!",
				repositories.contains(GitBlitSuite.getHelloworldRepository().getDirectory()
						.getName()));
		RepositoryModel model = GitBlit.self().getRepositoryModel(
				GitBlitSuite.getHelloworldRepository().getDirectory().getName());
		assertTrue("Helloworld model is null!", model != null);
		assertEquals(GitBlitSuite.getHelloworldRepository().getDirectory().getName(), model.name);
		assertTrue(GitBlit.self().calculateSize(model) > 22000L);
	}

	@Test
	public void testUserModel() throws Exception {
		List<String> users = GitBlit.self().getAllUsernames();
		assertTrue("No users found!", users.size() > 0);
		assertTrue("Admin not found", users.contains("admin"));
		UserModel user = GitBlit.self().getUserModel("admin");
		assertEquals("admin", user.toString());
		assertTrue("Admin missing #admin role!", user.canAdmin);
		user.canAdmin = false;
		assertFalse("Admin should not have #admin!", user.canAdmin);
		String repository = GitBlitSuite.getHelloworldRepository().getDirectory().getName();
		RepositoryModel repositoryModel = GitBlit.self().getRepositoryModel(repository);
		repositoryModel.accessRestriction = AccessRestrictionType.VIEW;
		assertFalse("Admin can still access repository!",
				user.canView(repositoryModel));
		user.addRepositoryPermission(repository);
		assertTrue("Admin can't access repository!", user.canView(repositoryModel));
		assertEquals(GitBlit.self().getRepositoryModel(user, "pretend"), null);
		assertNotNull(GitBlit.self().getRepositoryModel(user, repository));
		assertTrue(GitBlit.self().getRepositoryModels(user).size() > 0);
	}

	@Test
	public void testUserModelVerification() throws Exception {
		UserModel user = new UserModel("james");
		user.displayName = "James Moger";

		assertTrue(user.is("James", null));
		assertTrue(user.is("James", ""));
		assertTrue(user.is("JaMeS", "anything"));

		assertTrue(user.is("james moger", null));
		assertTrue(user.is("james moger", ""));
		assertTrue(user.is("james moger", "anything"));

		assertFalse(user.is("joe", null));
		assertFalse(user.is("joe", ""));
		assertFalse(user.is("joe", "anything"));

		// specify email address which results in address verification
		user.emailAddress = "something";

		assertFalse(user.is("James", null));
		assertFalse(user.is("James", ""));
		assertFalse(user.is("JaMeS", "anything"));

		assertFalse(user.is("james moger", null));
		assertFalse(user.is("james moger", ""));
		assertFalse(user.is("james moger", "anything"));

		assertTrue(user.is("JaMeS", user.emailAddress));
		assertTrue(user.is("JaMeS mOgEr", user.emailAddress));
	}

	@Test
	public void testAccessRestrictionTypes() throws Exception {
		assertTrue(AccessRestrictionType.PUSH.exceeds(AccessRestrictionType.NONE));
		assertTrue(AccessRestrictionType.CLONE.exceeds(AccessRestrictionType.PUSH));
		assertTrue(AccessRestrictionType.VIEW.exceeds(AccessRestrictionType.CLONE));

		assertFalse(AccessRestrictionType.NONE.exceeds(AccessRestrictionType.PUSH));
		assertFalse(AccessRestrictionType.PUSH.exceeds(AccessRestrictionType.CLONE));
		assertFalse(AccessRestrictionType.CLONE.exceeds(AccessRestrictionType.VIEW));

		assertTrue(AccessRestrictionType.PUSH.atLeast(AccessRestrictionType.NONE));
		assertTrue(AccessRestrictionType.CLONE.atLeast(AccessRestrictionType.PUSH));
		assertTrue(AccessRestrictionType.VIEW.atLeast(AccessRestrictionType.CLONE));

		assertFalse(AccessRestrictionType.NONE.atLeast(AccessRestrictionType.PUSH));
		assertFalse(AccessRestrictionType.PUSH.atLeast(AccessRestrictionType.CLONE));
		assertFalse(AccessRestrictionType.CLONE.atLeast(AccessRestrictionType.VIEW));

		assertTrue(AccessRestrictionType.PUSH.toString().equals("PUSH"));
		assertTrue(AccessRestrictionType.CLONE.toString().equals("CLONE"));
		assertTrue(AccessRestrictionType.VIEW.toString().equals("VIEW"));

		assertEquals(AccessRestrictionType.NONE, AccessRestrictionType.fromName("none"));
		assertEquals(AccessRestrictionType.PUSH, AccessRestrictionType.fromName("push"));
		assertEquals(AccessRestrictionType.CLONE, AccessRestrictionType.fromName("clone"));
		assertEquals(AccessRestrictionType.VIEW, AccessRestrictionType.fromName("view"));
	}

	@Test
	public void testFileSettings() throws Exception {
		FileSettings settings = new FileSettings("distrib/gitblit.properties");
		assertEquals(true, settings.getBoolean("missing", true));
		assertEquals("default", settings.getString("missing", "default"));
		assertEquals(10, settings.getInteger("missing", 10));
		assertEquals(5, settings.getInteger("realm.realmFile", 5));

		assertTrue(settings.getBoolean("git.enableGitServlet", false));
		assertEquals("${baseFolder}/users.conf", settings.getString("realm.userService", null));
		assertEquals(5, settings.getInteger("realm.minPasswordLength", 0));
		List<String> mdExtensions = settings.getStrings("web.markdownExtensions");
		assertTrue(mdExtensions.size() > 0);
		assertTrue(mdExtensions.contains("md"));

		List<String> keys = settings.getAllKeys("server");
		assertTrue(keys.size() > 0);
		assertTrue(keys.contains("server.httpsPort"));

		assertTrue(settings.getChar("web.forwardSlashCharacter", ' ') == '/');
	}

	@Test
	public void testGitblitSettings() throws Exception {
		// These are already tested by above test method.
		assertTrue(GitBlit.getBoolean("missing", true));
		assertEquals("default", GitBlit.getString("missing", "default"));
		assertEquals(10, GitBlit.getInteger("missing", 10));
		assertEquals(5, GitBlit.getInteger("realm.userService", 5));

		assertTrue(GitBlit.getBoolean("git.enableGitServlet", false));
		assertEquals("test-users.conf", GitBlit.getString("realm.userService", null));
		assertEquals(5, GitBlit.getInteger("realm.minPasswordLength", 0));
		List<String> mdExtensions = GitBlit.getStrings("web.markdownExtensions");
		assertTrue(mdExtensions.size() > 0);
		assertTrue(mdExtensions.contains("md"));

		List<String> keys = GitBlit.getAllKeys("server");
		assertTrue(keys.size() > 0);
		assertTrue(keys.contains("server.httpsPort"));

		assertTrue(GitBlit.getChar("web.forwardSlashCharacter", ' ') == '/');
		assertFalse(GitBlit.isDebugMode());
	}

	@Test
	public void testAuthentication() throws Exception {
		assertTrue(GitBlit.self().authenticate("admin", "admin".toCharArray()) != null);
	}

	@Test
	public void testRepositories() throws Exception {
		assertTrue(GitBlit.self().getRepository("missing") == null);
		assertTrue(GitBlit.self().getRepositoryModel("missing") == null);
	}
}


text:
from __future__ import unicode_literals

from django.db import models, migrations
import cloudinary.models

class Migration(migrations.Migration):

    dependencies = [
        ('core', '0005_auto_20150212_2030'),
    ]

    operations = [
        migrations.CreateModel(
            name='Gallery',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
            ],
            options={
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Picture',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
                ('image', cloudinary.models.CloudinaryField(verbose_name='image', max_length=100)),
                ('gallery', models.ForeignKey(to='core.Gallery')),
            ],
            options={
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='dog',
            name='gallery',
            field=models.ForeignKey(default=1, to='core.Gallery'),
            preserve_default=False,
        ),
    ]


text:
package org.bpel4chor.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.xml.namespace.QName;

import org.bpel4chor.interfaces.INamespaceMap;

/**
 * BPEL4Chor Namespace map of (Prefix,Namespace), which also holds the reverse
 * map of (Namespace,Prefix)
 *
 *

 * This class borrows the implementation of INamespaceMap in Eclipse BPEL model,
 * and some methods are added to enable the map to collect namspaces from the
 * new element.
 *
 * @since Oct 26, 2011
 * @author Daojun Cui
 *
 * @see {@link org.eclipse.bpel.model.adapters.BasicEObjectaAdapter}
 */
public class BPEL4ChorNamespaceMap implements INamespaceMap<String, String> {

	/** Forward, prefix to namespace map. */
	Map<String, String> prefix2Namespace = null;

	/** Reverse, Namespace to list of prefixes */
	Map<String, List<String>> namespace2Prefix = null;

	@Override
	public void clear() {
		if (namespace2Prefix != null) {
			namespace2Prefix.clear();
		}
		if (prefix2Namespace != null) {
			prefix2Namespace.clear();
		}
	}

	@Override
	public boolean containsKey(Object key) {
		return prefix2Namespace != null ? prefix2Namespace.containsKey(key) : false;
	}

	@Override
	public boolean containsValue(Object value) {

		return prefix2Namespace != null ? prefix2Namespace.containsValue(value) : false;
	}

	@Override
	public Set<java.util.Map.Entry<String, String>> entrySet() {

		return prefix2Namespace != null ? prefix2Namespace.entrySet() : null;
	}

	@Override
	public String get(Object key) {

		return prefix2Namespace != null ? prefix2Namespace.get(key) : null;
	}

	@Override
	public boolean isEmpty() {
		return prefix2Namespace != null ? prefix2Namespace.isEmpty() : true;
	}

	@Override
	public Set<String> keySet() {
		if (prefix2Namespace == null) {
			return Collections.emptySet();
		}
		return prefix2Namespace.keySet();
	}

	/**
	 * @param key
	 *            the key to set
	 * @param value
	 *            the value to set.
	 * @return the old value, if set
	 * @see java.util.Map#put(java.lang.Object, java.lang.Object)
	 */
	@Override
	public String put(String key, String value) {
		prefix2Namespace = getPrefix2NamespaceMap();
		String oldValue = prefix2Namespace.put(key, value);

		// when we put something in prefix2NamespaceMap
		// it might not exist in the reverse map yet
		List<String> ns2pfx = getReverse4(value);
		if (ns2pfx.contains(key) == false) {
			ns2pfx.add(key);
		}

		return oldValue;
	}

	@Override
	public void putAll(Map<? extends String, ? extends String> m) {

		getPrefix2NamespaceMap().putAll(m);

	}

	@Override
	public String remove(Object key) {

		String value = prefix2Namespace.remove(key);

		// the key did not exist.
		if (value == null) {
			return value;
		}

		// if oldValue is not null, remove in the reverse map too,
		// in this case , the entry in reverse map must exist.
		namespace2Prefix.get(value).remove(key);

		return value;
	}

	@Override
	public int size() {

		return prefix2Namespace != null ? prefix2Namespace.size() : 0;
	}

	@Override
	public Collection<String> values() {
		if (prefix2Namespace != null)
			return prefix2Namespace.values();
		else
			return Collections.emptyList();
	}

	/**
	 * @param key
	 *            the namespace to get the reverse mapping for
	 * @return The reverse mapping of the Namespace to namespace prefixes.
	 */
	@Override
	public List<String> getReverse(String key) {

		return getReverse4(key);
	}

	/**
	 * Get the prefix2Namespace map, initial capacity is 5.
	 *
	 * @return
	 */
	Map<String, String> getPrefix2NamespaceMap() {
		if (prefix2Namespace == null) {
			prefix2Namespace = new HashMap<String, String>(5);
		}
		return prefix2Namespace;
	}

	/**
	 * Get the reverse map, initial capacity is 5.
	 *
	 * @param key
	 * @return
	 */
	List<String> getReverse4(String key) {
		if (namespace2Prefix == null) {
			namespace2Prefix = new HashMap<String, List<String>>(5);
		}
		List<String> prefixes = namespace2Prefix.get(key);
		if (prefixes == null) {
			prefixes = new ArrayList<String>();
			namespace2Prefix.put(key, prefixes);
		}
		return prefixes;
	}

	/**
	 * Add the namespaceURI into map
	 *
	 *

	 * It does something more then the put method, you just needs
	 * to provide a namespaceURI and any prefixBase, the prefix will be created
	 * for you.
	 *
	 *

	 *

	 *
As default the prefix blank ("") will be assigned to
	 * "http://docs.oasis-open.org/wsbpel/2.0/process/abstract"
	 *
	 *
if the namespaceURI is a new one, a prefix for it will be created.
	 * the key,value pair is inserted and then the created prefix is returned.
	 *
	 *
if the namespaceURI already exists, it just returns the first one of
	 * the found corresponding prefixes.
	 *

	 *
	 * @param namespaceURI
	 *            the namespaceURI to add
	 * @param prefixBase
	 *            the base string for creating prefix
	 * @return the prefix assigned to the given namespaceURI
	 */
	@Override
	public String addNamespace(String namespaceURI, String prefixBase) {

		if (namespaceURI == null || prefixBase == null)
			throw new NullPointerException("argument is null.");

		String pfxBase = prefixBase;
		if (namespaceURI == null || namespaceURI.isEmpty())
			return null;
		if (pfxBase == null || pfxBase.isEmpty()) {
			pfxBase = BPEL4ChorConstants.CHOREOGRAPHY_PREFIX_BASE;
		}

		// retrieve the matches for this namespaces
		List<String> prefixes = this.getReverse(namespaceURI);

		if (prefixes.isEmpty()) {
			int i = 1;
			String newPrefix = pfxBase;
			while (this.containsKey(newPrefix)) {
				newPrefix = pfxBase + i;
				i++;
			}
			this.put(newPrefix, namespaceURI);
			return newPrefix;
		} else {
			String firstFoundPrefix = prefixes.get(0);
			return firstFoundPrefix;
		}
	}

	/**
	 * Collect the namespace into map
	 *
	 *

	 *

	 *
Case 1: Prefix==null, NSUri==null, nothing to collect
	 *
Case 2: Prefix==null, NSUri!=null, add the nsUri into map anyway, if
	 * the nsUri exists already, it just returns the first one of the associated
	 * prefixes. if the namespace does not exists yet, it is inserted in the
	 * namespaceMap and then returns the created prefix.
	 *
Case 3: Prefix!=null, NSUri==null, nothing to collect but check the
	 * prefix anyway, in case the prefix pointed to a non-existed one in the
	 * map.
	 *
Case 4: Prefix!=null, NSUri!=null, check the prefix first, if the
	 * prefix exists, the get(prefix) does not conform to this nsUri, then
	 * create one new prefix for this nsUri, if the prefix does not exist, add
	 * the prefix,namespace pair into the namespace map.
	 *
	 *
	 * @param qName
	 * @return the new version of the qName
	 * @throws Exception
	 */
	@Override
	public QName collectNamespace(QName qName) {

		if (qName == null)
			throw new NullPointerException("argument is null.");

		QName resQName = qName;

		int analRes = BPEL4ChorUtil.analyseQName(qName);

		String nsUri = qName.getNamespaceURI();
		String localPart = qName.getLocalPart();
		String prefix = qName.getPrefix();

		switch (analRes) {
		case BPEL4ChorUtil.QNAME_PREFIX_NAMESPACE_00: {
			break;// nothing to collect
		}
		case BPEL4ChorUtil.QNAME_PREFIX_NAMESPACE_01: {

			// add namespace to map anyway,
			// if the namespace exists in the namespaceMap already, it just
			// returns the first one of the associated prefixes.
			// if the namespace does not exists yet, it is inserted in the
			// namespaceMap and then returns the created prefix.
			prefix = this.addNamespace(nsUri, BPEL4ChorConstants.CHOREOGRAPHY_PREFIX_BASE);

			// should Update QName
			resQName = new QName(nsUri, localPart, prefix);
			break;
		}
		case BPEL4ChorUtil.QNAME_PREFIX_NAMESPACE_10: {

			// nothing to collect but check the prefix anyway
			if (!this.containsPrefix(prefix)) {
				throw new RuntimeException("Illegal Prefix: " + prefix + " namespaceMap(" + prefix2Namespace.keySet()
						+ ")");
			}
			break;
		}
		case BPEL4ChorUtil.QNAME_PREFIX_NAMESPACE_11: {

			// check the prefix first
			boolean prefixExists = containsPrefix(prefix);
			if (prefixExists) {
				// if the prefix exists, check whether the retrieved namespace
				// conforms to this nsUri
				String prestoredNS = get(prefix);
				if (!prestoredNS.equalsIgnoreCase(nsUri)) {

					// the namespace is not the same to the one pre-stored in
					// the map,
					// then add the namespace into map and create a
					// corresponding new prefix.
					prefix = addNamespace(nsUri, BPEL4ChorConstants.CHOREOGRAPHY_PREFIX_BASE);

					// should Update QName
					resQName = new QName(nsUri, localPart, prefix);
				}
			} else {
				// if the prefix does not exist, add the prefix,namespace pair
				// into the namespace map
				put(prefix, nsUri);
			}

			break;
		}
		default:
			throw new RuntimeException("illegal QName(" + nsUri + ", " + localPart + ", " + prefix + ")");
		}

		return resQName;
	}

	/**
	 * Check out whether the prefix exists in the keySet of (prefix,namespace)
	 * map
	 *
	 * @param prefix
	 * @return whether the prefix exists
	 */
	@Override
	public boolean containsPrefix(String prefix) {
		if (prefix == null)
			throw new NullPointerException("argument is null.");
		return this.containsKey(prefix);
	}

	/**
	 * Check out whether the namespaceUri exist in the namespaceMap
	 *
	 * @param namespace
	 *            The namespace of a QName
	 * @param namespaceMap
	 *            The namespaceMap of the root
	 * @return <tt>true</tt> if namespace exist, or <tt>false</tt>.
	 */
	public boolean containsNamespace(String namespace) {
		if (namespace == null)
			throw new NullPointerException("argument is null.");
		return this.containsValue(namespace);
	}
}


text:
package net.runelite.rs.api;

public interface RSJagexLoginType
{

}


text:
#pragma once
#include <SDL.h>
#include <list>
#include <string>

#ifdef _WIN32
	#ifndef SDL_INPUT_DLL
	#define SDL_INPUT_API __declspec( dllimport )
	#else
	#define SDL_INPUT_API __declspec( dllexport )
	#endif
#else
	#define SDL_INPUT_API
#endif

namespace si {

	class SDL_INPUT_API Binding;
	class SDL_INPUT_API Profile;
	class SDL_INPUT_API SDLInput;
	class SDL_INPUT_API BindSrc;

	enum BindSrcType {
		BindSrcType_Key = 1,
		BindSrcType_MouseAxis = 2,
		BindSrcType_MouseBtn = 3,
	};

	enum BindDest {
		BindDest_Undefined = 0,
		BindDest_Absolute = 1,
		BindDest_Relative = 2,
		BindDest_OnOff = 3,
		BindDest_Toggle = 4,
	};

	typedef void (*ValueChanged)(si::Binding* binding);

	class SDL_INPUT_API SDLInput
	{
		protected:
			std::list<Profile*> profiles;

		private:
			void handleEventsProfile(SDL_Event* e, Profile *p);
			void updateProfile(Profile *p);
			public:
			SDLInput() {}
			~SDLInput() {}

		public:
			void addProfile(Profile* value) { this->profiles.push_back(value); }
			void removeProfile(Profile* value) { this->profiles.remove(value); }

		public:
			/**
			* This is the main event handler method.
			*
			* It takes SDL events and dispatches them to the bound handlers
			* of the currently connected profiles.
			**/
			void handleEvents(SDL_Event* e);

			/**
			* To keep keyboard analog events working correctly,
			* their state needs to be updated reguarlly.
			* Call this method at regular intervals
			**/
			void update();
	};

	class SDL_INPUT_API Profile
	{
		friend class SDLInput;

		protected:
			void* userptr;
			std::list<Binding*> bindings;
			float relativePixels;

		public:
			Profile() : userptr(NULL), relativePixels(100) {}
			~Profile() {}
			void* getUserptr() { return this->userptr; }
			void setUserptr(void* value) { this->userptr = value; }
			float getRelativePixels() { return this->relativePixels; }

			/**
			* For mouse relative and absolute, the number of pixels for a value of 1.0
			**/
			void setRelativePixels(float value) { this->relativePixels = value; }

		public:
			Binding* absolute(BindSrc src, float* destination, ValueChanged changefunc = NULL, void* userptr = NULL);
			Binding* relative(BindSrc src, float* destination, ValueChanged changefunc = NULL, void* userptr = NULL);
			Binding* onoff(BindSrc src, bool* destination, ValueChanged changefunc = NULL, void* userptr = NULL);
			Binding* toggle(BindSrc src, bool* destination, ValueChanged changefunc = NULL, void* userptr = NULL);
	};

	class SDL_INPUT_API BindSrc
	{
		friend class Binding;
		friend class SDLInput;

		protected:
			BindSrcType type;			// The source type (keyboard, mouse axis, etc)
			int param1;					// First (only?) param of the source
			int param2;					// Some sources have two params

		public:
			BindSrc(BindSrcType type, int param1, int param2 = 0) : type(type), param1(param1), param2(param2) {}
			BindSrc(std::string spec);
			~BindSrc() {}
	};

	class SDL_INPUT_API Binding
	{
		friend class Profile;
		friend class SDLInput;

		protected:
			void* userptr;				// For whatever the user want to do with
			BindSrc src;				// The source of the binding
			BindDest desttype;			// Destination type (digital, analog)
			float* destfloat;			// Pointer to float to store analog values in
			bool* destbool;				// Pointer to fload to store digital values in
			int down;					// Used by analog keyboard presses; -1 = down, 0 = neither, 1 = up
			ValueChanged changefunc;	// Called every time the state changes
			float min, max;				// For absolute & relative, the min and max values
			int limit;					// Limit mode for abs and rel; 0 = none, 1 = limited, 2 = wrap around

		protected:
			Binding(BindSrc src, ValueChanged changefunc, void* userptr)
				: userptr(userptr), src(src), desttype(BindDest_Undefined),
				  destfloat(NULL), destbool(NULL), down(0), changefunc(changefunc),
				  min(0.0f), max(0.0f), limit(0)
				{}
			~Binding() {}

		public:
			void* getUserptr() { return this->userptr; }
			void setUserptr(void* value) { this->userptr = value; }

			bool getValueBool() { return *destbool; }
			bool* getRefBool() { return destbool; }
			void setRefBool(bool* ref) { destbool = ref; }

			float getValueFloat() { return *destfloat; }
			float* getRefFloat() { return destfloat; }
			void setRefFloat(float* ref) { destfloat = ref; }

			void setFree() { this->limit = 0; }
			void setLimit(float min, float max) { this->limit = 1; this->min = min; this->max = max; }
			void setWrap(float min, float max) { this->limit = 2; this->min = min; this->max = max; }
	};

}


text:
@charset "utf-8";
/*
 * artDialog skin
 * http://code.google.com/p/artdialog/
 * (c) 2009-2010 TangBin, http://www.planeArt.cn
 *
 * This is licensed under the GNU LGPL, version 2.1 or later.
 * For details, see: http://creativecommons.org/licenses/LGPL/2.1/
 */

/* common start */
body { _margin:0; _height:100%; }
.aui_outer { text-align:left; }
.aui_table { border:0; margin:0; border-collapse:collapse; width:auto; }
.aui_table td { padding:0; }
.aui_content,
.aui_buttons span { display:inline-block; *zoom:1; *display:inline }
.aui_dialogIcon { vertical-align:middle; _font-size:0; }
.aui_title { overflow:hidden; text-overflow: ellipsis; }
.aui_close { display:block; position:absolute; outline:none; }
.aui_main { text-align:center; }
.aui_content { text-align:left; border:none 0; }
.aui_tdIcon { vertical-align: middle; }
.aui_buttons { padding:5px 10px; text-align:right; white-space:nowrap; }
.aui_buttons button { margin-left:10px; cursor:pointer; }
.aui_contentFull{ display:block; width:100%; margin:0; padding:0!important; height:100%; }
.aui_loading { width:96px; height:32px; text-align:left; text-indent:-999em; overflow:hidden; background:url(icons/loading.gif) no-repeat center center; }
.aui_icon { width:48px; height:48px; margin:10px 0 10px 10px; }
.aui_buttons button { padding: 6px 10px; line-height: 1; *padding:4px 10px; *height:2em; letter-spacing:2px; width:auto; overflow:visible; *width:1; border: solid 1px #999; border-radius: 5px; background: #DDD; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#DDDDDD'); background: linear-gradient(top, #FFF, #DDD); background: -moz-linear-gradient(top, #FFF, #DDD); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFF), to(#DDD)); color: #333; text-decoration: none; cursor: pointer; display: inline-block; text-align: center; text-shadow: 0px 1px 1px rgba(255, 255, 255, 1); box-shadow: 0 1px 0 rgba(255, 255, 255, .7),  0 -1px 0 rgba(0, 0, 0, .09); }
.aui_buttons button:focus { outline:none 0; border-color:#426DC9; box-shadow:0 0 5px rgba(66, 109, 201, .9); }
.aui_buttons button:hover { color:#000; border-color:#666; }
.aui_buttons button:active { border-color:#666; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#DDDDDD', endColorstr='#FFFFFF'); background: linear-gradient(top, #DDD, #FFF); background: -moz-linear-gradient(top, #DDD, #FFF); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#DDD), to(#FFF)); box-shadow:inset 0 0 5px rgba(66, 109, 201, .9), inset 0 0 1em rgba(0, 0, 0, .3); }
.aui_buttons button[disabled] { cursor:default; color:#666; background:#DDD; border: solid 1px #999; filter:alpha(opacity=50); opacity:.5; box-shadow:none; }
/* common end */

/* skin start */
.aui_header, .aui_footer button { font: 12px/1.11 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; _font-family:Tahoma,Arial,Helvetica,STHeiti; -o-font-family: Tahoma, Arial; }
.aui_inner { background:#FFF; }
.aui_main { min-width:9em; }
.aui_outer, .aui_center { border:1px solid rgba(0, 0, 0, .5)!important; border:1px solid #333\9!important; }
.aui_outer { border-radius:3px; }
.aui_outer > .aui_table { border-radius:2px; box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.9); }
.aui_nw, .aui_ne, .aui_sw, .aui_se { width:8px; height:8px; }
.aui_border { background:rgba(0, 0, 0, .2); background:#000\9!important; filter:alpha(opacity=30); }
.aui_focus .aui_border { background:rgba(0, 0, 0, .4);  filter:alpha(opacity=50); }
.aui_drag .aui_border { background:rgba(0, 0, 0, .2); filter:alpha(opacity=30); }
.aui_focus .aui_inner, .aui_titleWrap { box-shadow: 0 0 3px rgba(0, 0, 0, 0.7); }
.aui_focus .aui_outer { box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); }
.aui_drag .aui_outer { box-shadow:none; border:1px solid rgba(0, 0, 0, .4)!important; border:1px solid #333\9!important; }
.aui_titleWrap { position:relative; height:100%; }
.aui_title { height:28px; line-height:26px; padding:0 28px 0 10px; background-color:#3A6EA5; font-weight:700; color:#EBEBEB; border-style:solid; border-width:1px; border-color:#4E84C0 #4780BE #17356C #4780BE; border-bottom-color:#0D1D3C\9; text-shadow:0 1px 0 #000; }
.aui_focus .aui_title { border-top-color:#739ECE; background-color:#214FA3; background: linear-gradient(top, #6998CB, #3A6EA5); background: -moz-linear-gradient(top, #6998CB, #3A6EA5); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6998CB), to(#3A6EA5)); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#427CBD', endColorstr='#2d5d90'); box-shadow: inset 0 -1px 1px rgba(238, 247, 245, .2); }
.aui_drag .aui_title { color:#FFF; border-top-color:#4E84C0; border-bottom-color:rgba(23, 53, 108, .2); background: linear-gradient(top, #3A6EA5, #6998CB); background: -moz-linear-gradient(top, #3A6EA5, #6998CB); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#3A6EA5), to(#6998CB)); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2d5d90', endColorstr='#427CBD'); box-shadow:none; }
.aui_drag .aui_titleWrap { box-shadow:none; }
.aui_close { padding:0; top:3px; right:3px; width:21px; height:21px; line-height:21px; font-size:18px; text-align:center; /*background:#739ECE;*/ font-family: Helvetica, STHeiti; _font-family: '\u9ed1\u4f53', 'Book Antiqua', Palatino; color:#FFF!important; text-decoration:none; border:1px solid transparent; _border:0 none; border-radius:15px;  }
.aui_focus .aui_close {/* border:1px solid #17356C;*/ }
.aui_close:hover, .aui_close:active { text-decoration:none; background:#771C35; border:1px solid #000; _border:0 none; box-shadow: 0 1px 0 rgba(255, 255, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .5); }
.aui_close:active { box-shadow: none; }
.aui_content { color:#666; }
.aui_focus .aui_content { color:#000; }
.aui_buttons { background-color:#F6F6F6; border-top:1px solid #EBEBEB; border-bottom:1px solid #CCC; box-shadow: inset 0 -3px 5px rgba(204, 204, 204, 0.3), inset 0 1px 0 rgba(255, 255, 255, .8); }
/* skin end */


text:
package org.restexpress.exception;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class DefaultExceptionMapperTest
{
	private ExceptionMapping mapping = new DefaultExceptionMapper();

	@Test
	public void shouldMapException()
	{
		mapping.map(ArrayIndexOutOfBoundsException.class, ServiceException.class);
		Throwable t = new ArrayIndexOutOfBoundsException("Important information here");
		Throwable u = mapping.getExceptionFor(t);
		assertNotNull(u);
		assertEquals("Important information here", u.getMessage());
		assertTrue(t == u.getCause());
	}

	@Test
	public void shouldMapToNull()
	{
		mapping.map(ArrayIndexOutOfBoundsException.class, ServiceException.class);
		Throwable t = new Exception("Important information here");
		Throwable u = mapping.getExceptionFor(t);
		assertNull(u);
	}
}


text:
package vcsclient

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"net/url"
	"os"
	"path"

	"sort"

	"golang.org/x/tools/godoc/vfs"
	"sourcegraph.com/sourcegraph/go-vcs/vcs"
	"sourcegraph.com/sqs/pbtypes"
)

type FileSystem interface {
	vfs.FileSystem
	Get(path string) (*TreeEntry, error)
}

type repositoryFS struct {
	at   vcs.CommitID
	repo *repository
}

var _ FileSystem = &repositoryFS{}

func (fs *repositoryFS) Open(name string) (vfs.ReadSeekCloser, error) {
	e, err := fs.Get(name)
	if err != nil {
		return nil, err
	}

	return nopCloser{bytes.NewReader(e.Contents)}, nil
}

func (fs *repositoryFS) Lstat(path string) (os.FileInfo, error) {
	e, err := fs.Get(path)
	if err != nil {
		return nil, err
	}

	return e.Stat()
}

func (fs *repositoryFS) Stat(path string) (os.FileInfo, error) {
	// TODO(sqs): follow symlinks (as Stat specification requires)
	e, err := fs.Get(path)
	if err != nil {
		return nil, err
	}

	return e.Stat()
}

func (fs *repositoryFS) ReadDir(path string) ([]os.FileInfo, error) {
	e, err := fs.Get(path)
	if err != nil {
		return nil, err
	}

	fis := make([]os.FileInfo, len(e.Entries))
	for i, e := range e.Entries {
		fis[i], err = e.Stat()
		if err != nil {
			return nil, err
		}
	}

	return fis, nil
}

func (fs *repositoryFS) String() string {
	return fmt.Sprintf("repository %s commit %s (client)", fs.repo.repoPath, fs.at)
}

// Get returns the whole TreeEntry struct for a tree entry.
func (fs *repositoryFS) Get(path string) (*TreeEntry, error) {
	url, err := fs.url(path, nil)
	if err != nil {
		return nil, err
	}

	req, err := fs.repo.client.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}

	var entry *TreeEntry
	_, err = fs.repo.client.Do(req, &entry)
	if err != nil {
		return nil, err
	}

	return entry, nil
}

// FileWithRange is returned by GetFileWithOptions and includes the
// returned file's TreeEntry as well as the actual range of lines and
// bytes returned (based on the GetFileOptions parameters). That is,
// if Start/EndLine are set in GetFileOptions, this struct's
// Start/EndByte will be set to the actual start and end bytes of
// those specified lines, and so on for the other fields in
// GetFileOptions.
type FileWithRange struct {
	*TreeEntry
	FileRange // range of actual returned tree entry contents within file
}

// GetFileWithOptions gets a file and allows additional configuration
// of the range to return, etc.
func (fs *repositoryFS) GetFileWithOptions(path string, opt GetFileOptions) (*FileWithRange, error) {
	url, err := fs.url(path, opt)
	if err != nil {
		return nil, err
	}

	req, err := fs.repo.client.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}

	var file *FileWithRange
	_, err = fs.repo.client.Do(req, &file)
	if err != nil {
		return nil, err
	}

	return file, nil
}

// A FileGetter is a repository FileSystem that can get files with
// extended range options (GetFileWithOptions).
//
// It's generally more efficient to use the client's implementation of
// the GetFileWithOptions method instead of calling the
// vcsclient.GetFileWithOptions func because the former causes only
// the requested range to be sent over the network, while the latter
// requests the whole file and narrows the range on the client side.
type FileGetter interface {
	GetFileWithOptions(path string, opt GetFileOptions) (*FileWithRange, error)
}

// GetFileWithOptions gets a file and observes the options specified
// in opt. If fs implements FileGetter, fs.GetFileWithOptions is
// called; otherwise the options are applied on the client side after
// fetching the whole file.
func GetFileWithOptions(fs vfs.FileSystem, path string, opt GetFileOptions) (*FileWithRange, error) {
	if fg, ok := fs.(FileGetter); ok {
		return fg.GetFileWithOptions(path, opt)
	}

	fi, err := fs.Lstat(path)
	if err != nil {
		return nil, err
	}

	e := newTreeEntry(fi)
	fwr := FileWithRange{TreeEntry: e}

	if fi.Mode().IsDir() {
		ee, err := readDir(fs, path, opt.RecurseSingleSubfolder, true)
		if err != nil {
			return nil, err
		}
		sort.Sort(TreeEntriesByTypeByName(ee))
		e.Entries = ee
	} else if fi.Mode().IsRegular() {
		f, err := fs.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()

		contents, err := ioutil.ReadAll(f)
		if err != nil {
			return nil, err
		}

		e.Contents = contents

		if empty := (GetFileOptions{}); opt != empty {
			fr, _, err := ComputeFileRange(contents, opt)
			if err != nil {
				return nil, err
			}

			// Trim to only requested range.
			e.Contents = e.Contents[fr.StartByte:fr.EndByte]
			fwr.FileRange = *fr
		}
	}

	return &fwr, nil
}

// readDir uses the passed vfs.FileSystem to read from starting at the base path.
// If recurseSingleSubfolder is true, it will descend and include sub-folders
// with a single sub-folder inside. first should always be set to true, other values are used internally.
func readDir(fs vfs.FileSystem, base string, recurseSingleSubfolder bool, first bool) ([]*TreeEntry, error) {
	entries, err := fs.ReadDir(base)
	if err != nil {
		return nil, err
	}
	if recurseSingleSubfolder && !first && !singleSubDir(entries) {
		return nil, nil
	}
	te := make([]*TreeEntry, len(entries))
	for i, fi := range entries {
		te[i] = newTreeEntry(fi)
		if fi.Mode().IsDir() && recurseSingleSubfolder {
			ee, err := readDir(fs, path.Join(base, fi.Name()), recurseSingleSubfolder, false)
			if err != nil {
				return nil, err
			}
			te[i].Entries = ee
		}
	}
	return te, nil
}

func singleSubDir(entries []os.FileInfo) bool {
	return len(entries) == 1 && entries[0].IsDir()
}

func newTreeEntry(fi os.FileInfo) *TreeEntry {
	e := &TreeEntry{
		Name:    fi.Name(),
		Size:    fi.Size(),
		ModTime: pbtypes.NewTimestamp(fi.ModTime()),
	}
	if fi.Mode().IsDir() {
		e.Type = DirEntry
	} else if fi.Mode().IsRegular() {
		e.Type = FileEntry
	} else if fi.Mode()&os.ModeSymlink != 0 {
		e.Type = SymlinkEntry
	}
	return e
}

// url generates the URL to RouteRepoTreeEntry for the given path (all other
// route vars are taken from repositoryFS fields).
func (fs *repositoryFS) url(path string, opt interface{}) (*url.URL, error) {
	return fs.repo.url(RouteRepoTreeEntry, map[string]string{
		"CommitID": string(fs.at),
		"Path":     path,
	}, opt)
}

type nopCloser struct {
	io.ReadSeeker
}

func (nc nopCloser) Close() error { return nil }


text:
source /jdk-base.sh

# set tomcat session timeout
if [ -n "$TOMCAT_SESSION_TIMEOUT" ]
then
    sed -i 's|'@SESSION_TIMEOUT@'|'$TOMCAT_SESSION_TIMEOUT'|' $CATALINA_HOME/conf/web.xml
fi


text:
var app = angular.module("app", []);

app.directive("zippy", function(){
  return {
    restrict: "E",
    transclude: true,
    scope: {
      title: "@"
    },
    template: '
' +
      '
{{title}}
' +
      '

' +
      '
',
    link: function(scope){
      scope.isContentVisible = false;
      scope.toggleContent = function(){
        scope.isContentVisible = !scope.isContentVisible;
      };
    }
  };
});


text:
import glob
import sys
import getopt
import os
import stat
import re
import pprint
import json
import fnmatch
import io

class I18nExtract:
    regex = r"polyglot.t\(['\"](.*?)['\"][,\)]"
    __correct_index = []

    def __init__(self, template_folder, locale_folder):
        self.template_folder = template_folder
        self.locale_folder = locale_folder

        self.__extract_template_keys()

    def __extract_template_keys(self):

        '''
        Finds all files in the given directory, as well as those in subdirectories
        '''
        template = [
            os.path.join(dirpath, f)
            for dirpath, dirnames, files in os.walk(os.path.join(os.path.realpath(self.template_folder)))
            for f in files
        ]

        '''
        Just a simple loop for read and add current key to a list
        '''
        for file_ in template:
            results = re.findall(self.regex, open(file_).read())
            print "%s anchors have been found in %s: \n%s\n" % (len(results), file_, results)

            for result in results:
                self.__correct_index.append(result)

        self.__update_locales()

    '''
    Intert the news keys founded in all templates
    '''
    def __insert_data(self, json_file):
        for data_index in set(self.__correct_index):
            if data_index not in self.json_datas.keys():
                self.json_datas.update({data_index: None})
                print "['%s'] as been added." % (data_index)

        with io.open(json_file, 'w', encoding='utf-8') as f:
          f.write(unicode(json.dumps(self.json_datas, indent=4, sort_keys=True, ensure_ascii=False)))

    '''
    Updates all the keys contained in the nTranslation files
    '''
    def __remove_data(self, json_file):
        for key in self.json_datas.keys():
            if key not in set(self.__correct_index):
                del self.json_datas[key]
                print "['%s'] as been deleted." % (key)

        with io.open(json_file, 'w', encoding='utf-8') as f:
          f.write(unicode(json.dumps(self.json_datas, indent=4, sort_keys=True, ensure_ascii=False)))
    '''
    Call __remove_data function and __insert_data function
    '''
    def __update_locales(self):
        for json_file in glob.glob(os.path.join(os.path.realpath(self.locale_folder), "*.json")):
            if os.stat(json_file)[stat.ST_SIZE] > 0:

                print "\nPROCESSING %s file." % json_file.split('/')[-1:]
                with open(json_file, "r") as feed_json:
                    try:
                        self.json_datas = json.loads(feed_json.read())

                        self.__remove_data(json_file)
                        self.__insert_data(json_file)

                        print "--UPDATED FILE--"

                    except (ValueError, KeyError, TypeError):
                        print "\n--------------- JSON FORMAT ERROR ---------------\n ValuError: %s\n KeyError: %s\n TypeError: %s\n" % (
                            ValueError, KeyError, TypeError)

try:
    if len(sys.argv) > 1:
        options, args = getopt.getopt(sys.argv[1:], "t:l:e:")
        templates_folder = None
        locales_folder = None

        for o, a in options:
            if o == '-t':
                templates_folder = a
            elif o == '-l':
                locales_folder = a
        if templates_folder is not None and locales_folder is not None:
            I18nExtract(templates_folder, locales_folder)
    else:
        print("Usage: %s -t < templates folder > -l < locales folder >" % sys.argv[0])
except:
    print("Usage: %s -t < templates folder > -l < locales folder >" % sys.argv[0])


text:
/**
 * Controller to handle click events on NoteViews.
 * @param {networkStickies.NoteModel} noteModel the model to forward calls to.
 * @param {networkStickies.NoteView} noteView the view this is controlling.
 *     Currently, there is one controller for every NoteView.
 * @constructor
 * @const
 */
networkStickies.NoteController = function(noteModel, noteView) {
  /** @const */ this.noteModel = noteModel;
  /** @const */ this.noteView = noteView;
};

/**
 * Swap out the NoteView with a NoteEditor that allows users to edit
 * that note, then click Confirm to switch back to a NoteView.
 * @param {string} identifier the ID for the note being edited.
 * @const
 */
networkStickies.NoteController.prototype.onEditButtonClicked =
    function(identifier) {
  this.noteView.editMode();
};

/**
 * Action when the Enter button is clicked, signifying that a note
 * body update is complete.
 * @param {string} identifier the ID for the note to update.
 * @const
 */
networkStickies.NoteController.prototype.onEnterButtonClicked =
    function(identifier) {
  /** @const */ var text = this.noteView.editTextAreaText();
  this.noteView.displayMode(text);
  this.noteModel.editNoteWithId(identifier, text);
};

/**
 * Action when a note is deleted.
 * @param {string} identifier the ID for the note to delete.
 * @const
 */
networkStickies.NoteController.prototype.onDeleteButtonClicked =
    function(identifier) {
  this.noteModel.deleteNoteWithId(identifier);
};

/**
 * Action when a note is moved.
 * @param {string} identifier the ID for the note to move.
 * @param {{top: number, left: number}} coordinates the new coordinates.
 * @const
 */
networkStickies.NoteController.prototype.onNoteMoved =
    function(identifier, coordinates) {
  this.noteModel.moveNoteWithId(identifier, coordinates);
};


text:
package in.suhj.eridown.elements.block

import in.suhj.eridown._
import in.suhj.eridown.core._
import in.suhj.eridown.elements.inline.TextGenerator

import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer

case class Table(text: String) extends Element {
    def render = s"
$text
"
}

case class TableRow(val children: ListBuffer[TableData]) extends Element {
    def render = s"
${children.map(_.render).mkString}
"
}

object TableDataAlignment extends Enumeration {
    type TableDataAlignment = Value
    val Left, Right, Center = Value
}
import in.suhj.eridown.elements.block.TableDataAlignment._

case class TableData(text: String, alignment: TableDataAlignment, isHeader: Boolean) extends Element {
    var rowspan = 1
    var colspan = 1

    def render = {
        val element = if (isHeader) "th" else "td"
        def attributes = {
            var span = ""

            if (rowspan > 1) span += s""" rowspan="$rowspan""""
            if (colspan > 1) span += s""" colspan="$colspan""""

            if (alignment == Center) span += s""" class="center""""
            else if (alignment == Right) span += s""" class="right""""

            span
        }

        s"""<$element$attributes>$text</$element>"""
    }
}

object TableGenerator extends Generator {
    def generate(text: String): Option[GenerateResult] = {
        val result = getChildrenData(TableRowGenerator, text)
        if (result.isEmpty) return None

        val rows = new ListBuffer[TableRow]
        var totalOffset = 0

        for (res <- result) {
            rows += res.asInstanceOf[TableRow]
            totalOffset += res.length
        }

        def setSpans(rows: ListBuffer[TableRow]): List[TableRow] = {
            @tailrec
            def countColspan(colspan: Int, row: TableRow, column: Int): Int = {
                if (column == row.children.length - 1) return colspan

                if (!row.children(column + 1).text.trim.isEmpty) colspan
                else countColspan(colspan + 1, row, column + 1)
            }

            @tailrec
            def countRowspan(rowspan: Int, rows: ListBuffer[TableRow], row: Int, column: Int): Int = {
                if (row == rows.length - 1) return rowspan

                if (rows(row + 1).children(column).text.trim != ":::") rowspan
                else countRowspan(rowspan + 1, rows, row + 1, column)
            }

            for (i <- rows.indices) {
                val row = rows(i)

                val newColumns = new ListBuffer[TableData]
                for (j <- row.children.indices) {
                    val column = row.children(j)
                    val text = column.text.trim

                    if (text != ":::" && !text.isEmpty) {
                        column.colspan = countColspan(1, row, j)
                        column.rowspan = countRowspan(1, rows, i, j)
                        newColumns += column
                    }
                }

                rows(i) = TableRow(newColumns)
            }

            rows.toList
        }

        Some((Table(setSpans(rows).map(_.render).mkString), totalOffset))
    }
}

object TableRowGenerator extends Generator {
    def generate(text: String): Option[GenerateResult] = {
        val result = getChildrenData(TableDataGenerator, text).map(_.asInstanceOf[TableData])
        if (result.isEmpty) return None

        Some((TableRow(new ListBuffer[TableData] ++= result), text.indexOf('\n') + 1))
    }
}

object TableDataGenerator extends Generator {
    def generate(text: String): Option[GenerateResult] = {
        import TableDataAlignment._

        val scanner = Scanner(text)

        val delim = scanner.currentChar
        if (delim != '|' && delim != '^')
            return None
        scanner.skip(1)

        var leadingSpaces = 0
        while (scanner.atWhitespace) {
            scanner.skip(1)
            leadingSpaces += 1
        }
        scanner.mark()

        val seek = scanner.seekAny(List('|', '^'))
        if (seek < 0) return None
        else if (scanner.seek('\n') < seek) return None
        scanner.skip(seek - 1)

        var trailingSpaces = 0
        while (scanner.atWhitespace) {
            scanner.skip(-1)
            trailingSpaces += 1
        }
        scanner.skip(1)

        val alignment =
            if (Math.min(leadingSpaces, trailingSpaces) >= 2) Center
            else if (leadingSpaces >= 2) Right
            else Left

        Some((TableData(scanner.extract, alignment, delim == '^'), scanner.position + trailingSpaces))
    }
}


text:
<?php

$dictionary['Account']['fields']['activities_modification_date'] = array(
    'name'=>'activities_modification_date',
    'vname'=>'LBL_ACTIVITIES_MODIFICATION_DATE',
    'type'=>'datetimecombo',
);


text:
package member

import (
	"errors"
	"github.com/watermint/toolbox/domain/dropbox/api/dbx_auth"
	"github.com/watermint/toolbox/domain/dropbox/api/dbx_conn"
	"github.com/watermint/toolbox/domain/dropbox/model/mo_path"
	"github.com/watermint/toolbox/domain/dropbox/service/sv_group"
	"github.com/watermint/toolbox/domain/dropbox/usecase/uc_teamfolder"
	"github.com/watermint/toolbox/essentials/log/esl"
	"github.com/watermint/toolbox/essentials/queue/eq_sequence"
	"github.com/watermint/toolbox/essentials/strings/es_mailaddr"
	"github.com/watermint/toolbox/infra/control/app_control"
	"github.com/watermint/toolbox/infra/feed/fd_file"
	"github.com/watermint/toolbox/infra/recipe/rc_exec"
	"github.com/watermint/toolbox/infra/recipe/rc_recipe"
	"github.com/watermint/toolbox/infra/report/rp_model"
	"github.com/watermint/toolbox/infra/ui/app_msg"
	"github.com/watermint/toolbox/ingredient/teamfolder"
	"github.com/watermint/toolbox/quality/infra/qt_file"
	"os"
)

type DeleteRecord struct {
	TeamFolderName         string `json:"team_folder_name"`
	Path                   string `json:"path"`
	GroupNameOrMemberEmail string `json:"group_name_or_member_email"`
}

func (z DeleteRecord) DropboxPath() mo_path.DropboxPath {
	if z.Path == "" {
		return mo_path.NewDropboxPath("")
	} else {
		return mo_path.NewDropboxPath("/" + z.Path)
	}
}

type Delete struct {
	rc_recipe.RemarkIrreversible
	Peer                       dbx_conn.ConnScopedTeam
	File                       fd_file.RowFeed
	OperationLog               rp_model.TransactionReport
	AdminGroupName             string
	SkipFolderNotFound         app_msg.Message
	SkipNotMember              app_msg.Message
	ErrorTeamSpaceNotSupported app_msg.Message
}

func (z *Delete) Preset() {
	z.AdminGroupName = uc_teamfolder.DefaultAdminWorkGroupName
	z.OperationLog.SetModel(&DeleteRecord{}, nil)
	z.File.SetModel(&DeleteRecord{})
	z.Peer.SetScopes(
		dbx_auth.ScopeGroupsRead,
		dbx_auth.ScopeGroupsWrite,
		dbx_auth.ScopeFilesContentRead,
		dbx_auth.ScopeFilesContentWrite,
		dbx_auth.ScopeSharingRead,
		dbx_auth.ScopeSharingWrite,
		dbx_auth.ScopeTeamDataMember,
		dbx_auth.ScopeTeamDataTeamSpace,
		dbx_auth.ScopeTeamInfoRead,
	)
}

func (z *Delete) delete(r *DeleteRecord, c app_control.Control, tc uc_teamfolder.TeamContent, sg sv_group.Group) error {
	if ok, _ := teamfolder.IsTeamSpaceSupported(z.Peer.Client()); ok {
		c.UI().Error(z.ErrorTeamSpaceNotSupported)
		return errors.New("team space is not supported by this command")
	}

	l := c.Log()
	l.Debug("Remove", esl.Any("record", r))

	tf, err := tc.GetTeamFolder(r.TeamFolderName)
	switch err {
	case nil:
		l.Debug("The folder found")
		// continue

	case uc_teamfolder.ErrorUnableToIdentifyFolder:
		l.Debug("The folder not found")
		z.OperationLog.Skip(z.SkipFolderNotFound, r)
		return nil

	default:
		l.Debug("Unable to resolve the team folder", esl.Error(err))
		z.OperationLog.Failure(err, r)
		return err
	}

	handleResult := func(err error) error {
		switch err {
		case uc_teamfolder.ErrorUnableToIdentifyFolder:
			l.Debug("The folder not found", esl.Error(err))
			z.OperationLog.Skip(z.SkipFolderNotFound, r)
			return nil

		case uc_teamfolder.ErrorNotAMember:
			l.Debug("The member does not have an access", esl.Error(err))
			z.OperationLog.Skip(z.SkipNotMember, r)
			return nil

		default:
			l.Debug("Successfully removed")
			z.OperationLog.Success(r, nil)
			return nil
		}
	}

	if _, err := sg.ResolveByName(r.GroupNameOrMemberEmail); err != nil {
		// assume the field is email
		if !es_mailaddr.IsEmailAddr(r.GroupNameOrMemberEmail) {
			l.Debug("The field look like not an email address")
			z.OperationLog.Failure(errors.New("group not found"), r)
			return errors.New("group not found")
		}

		return handleResult(tf.MemberRemoveUser(r.DropboxPath(), r.GroupNameOrMemberEmail))
	} else {
		// adding the group
		return handleResult(tf.MemberRemoveGroup(r.DropboxPath(), r.GroupNameOrMemberEmail))
	}
}

func (z *Delete) Exec(c app_control.Control) error {
	l := c.Log()
	if err := z.OperationLog.Open(); err != nil {
		return err
	}

	tc, err := uc_teamfolder.New(z.Peer.Client(), z.AdminGroupName)
	if err != nil {
		return err
	}
	sg := sv_group.NewCached(z.Peer.Client())

	var lastErr, fileErr error
	queueId := "delete"
	c.Sequence().Do(func(s eq_sequence.Stage) {
		s.Define(queueId, z.delete, c, tc, sg)
		q := s.Get(queueId)

		fileErr = z.File.EachRow(func(m interface{}, rowIndex int) error {
			q.Enqueue(m)
			return nil
		})
	}, eq_sequence.SingleThread(),
		eq_sequence.ErrorHandler(func(err error, mouldId, batchId string, p interface{}) {
			lastErr = err
		}))

	if fileErr != nil {
		l.Debug("Error on read file", esl.Error(fileErr))
		return fileErr
	}
	if lastErr != nil {
		l.Debug("Error on the process", esl.Error(lastErr))
		return lastErr

	}
	return nil
}

func (z *Delete) Test(c app_control.Control) error {
	f, err := qt_file.MakeTestFile("member", "Tokyo Sales,,Sales\nTokyo Sales,Sales Report,Audit\n")
	if err != nil {
		return err
	}
	defer func() {
		_ = os.Remove(f)
	}()

	return rc_exec.ExecMock(c, &Delete{}, func(r rc_recipe.Recipe) {
		m := r.(*Delete)
		m.File.SetFilePath(f)
	})
}


text:
package org.jetbrains.plugins.dotty.lang.parser.parsing.patterns

/**
  * @author adkozlov
  */
object CaseClauses extends org.jetbrains.plugins.scala.lang.parser.parsing.patterns.CaseClauses {
  override protected def caseClause = CaseClause
}


text:
using UnityEngine;
using System.Collections;

public enum FacesBitmask { PositiveX = 0, NegativeX = 1, PositiveY = 2, NegativeY = 4, PositiveZ = 8, NegativeZ = 16}

public class RealtimeCubemap : MonoBehaviour
{
    public int cubemapSize = 128;
    public bool oneFacePerFrame = false;
    private Camera cam;
    public RenderTexture rtex;
    private Texture2D temptex;
    private Cubemap cmap;
    private GameObject go;
    private Material m;
    public Shader shader;
    public int customMask = -1;
    public int antiAliasing = 2;

    public bool allFaces;
    public bool[] customFaces;

    public Shader stereoShader;
    public float separation;
    public float[] lookVector = new float[3];

    [ExecuteInEditMode]
    void Start()
    {
        // render all six faces at startup
        m = new Material(shader);
        //GetComponent<EQFullScreen>().mat = m;
        //UpdateCubemap(63);
        temptex = new Texture2D(cubemapSize, cubemapSize);
    }

    void LateUpdate()
    {
        if (oneFacePerFrame)
        {
            int faceToRender = Time.frameCount % 6;
            int faceMask = 1 << faceToRender;
            UpdateCubemap(faceMask);
        }
        else {
            if (allFaces)
            {
                UpdateCubemap(63); // all six faces
            }
            else if(customMask>0) // we have a custom mask set
            {
                UpdateCubemap(customMask);
            }
            else
            {
                int faceMask = 1;
                for (int i =0; i < customFaces.Length; i++)
                {
                    if (customFaces[i]) faceMask = faceMask | (1 << i);

                }
                UpdateCubemap(faceMask);

            }
        }
    }

    void UpdateCubemap(int faceMask)
    {
        Shader.SetGlobalFloat("_EYE_SEPARATION", separation);

        Shader.SetGlobalFloat("_Look_FloatX", Mathf.Deg2Rad*transform.eulerAngles.x); // used in AlloWarp Shader.
        Shader.SetGlobalFloat("_Look_FloatY", Mathf.Deg2Rad*transform.eulerAngles.y); // used in AlloWarp Shader
        Shader.SetGlobalFloat("_Look_FloatZ", Mathf.Deg2Rad*transform.eulerAngles.z); // used in AlloWarp Shader

        if (!cam)
        {

            go = new GameObject("CubemapCamera");
            go.AddComponent(typeof(Camera));
            go.AddComponent<ControlStereo>();
            go.GetComponent<ControlStereo>().shader = stereoShader;
            go.GetComponent<ControlStereo>().separation = separation;
            //go.AddComponent(typeof(EQFullScreen));

            //go.hideFlags = HideFlags.HideAndDontSave;
            go.transform.position = transform.position;
            go.transform.rotation = transform.rotation;

            cam = go.GetComponent<Camera>();
            cam.farClipPlane = 500; // don't render very far into cubemap
            cam.nearClipPlane = 0.01f; // don't render very far into cubemap
            cam.enabled = false;
        }

        if (!rtex)
        {
            rtex = new RenderTexture(cubemapSize, cubemapSize, 16);
            rtex.antiAliasing = antiAliasing;
            rtex.depth = 0;
            //rtex.anisoLevel = 16;
            rtex.useMipMap = true;
            rtex.isCubemap = true;
            rtex.hideFlags = HideFlags.HideAndDontSave;
            //GetComponent<Renderer>().sharedMaterial.SetTexture("_Cube", rtex);
            //GetComponent<EQFullScreen>().mat.SetTexture("_Cube", rtex);
        }

        cam.transform.position = transform.position;
        cam.RenderToCubemap(rtex, faceMask);
    }

    void UpdateCubemap3(int faceMask)
    {
        Shader.SetGlobalFloat("_EYE_SEPARATION", separation);
        if (!cam)
        {

            go = new GameObject("CubemapCamera");
            go.AddComponent(typeof(Camera));
            //go.AddComponent<ControlStereo>();
            //go.GetComponent<ControlStereo>().shader = stereoShader;
            // go.GetComponent<ControlStereo>().separation = separation;
            //go.AddComponent(typeof(EQFullScreen));

            //go.hideFlags = HideFlags.HideAndDontSave;
            go.transform.position = transform.position;
            go.transform.rotation = transform.rotation;

            cam = go.GetComponent<Camera>();
            cam.farClipPlane = 100; // don't render very far into cubemap
            cam.enabled = false;
        }

        if (!rtex)
        {
            rtex = new RenderTexture(cubemapSize, cubemapSize, 16);
            rtex.hideFlags = HideFlags.HideAndDontSave;
            cmap = new Cubemap(cubemapSize, TextureFormat.RGBA32, false);
            cmap.hideFlags = HideFlags.HideAndDontSave;
            //GetComponent<EQFullScreen>().mat.SetTexture("_Cube", cmap);
        }

        cam.transform.position = transform.position;

        //cam.RenderToCubemap(rtex, faceMask);
        cam.targetTexture = rtex;
        cam.Render();

    }

    void OnDisable()
    {
        DestroyImmediate(cam);
        DestroyImmediate(rtex);
    }
}


text:
package DefiningClasses.Exercise.PokemonTrainer;

import java.util.List;

public class Trainer {
    private String name;
    private int numberOfBadges;
    private List<Pokemon> pokemons;

    public Trainer(String name, List<Pokemon> pokemons) {
        this.name = name;
        this.pokemons = pokemons;
        this.numberOfBadges = 0;
    }

    public Trainer(){

    }

    public String getName() {
        return name;
    }

    public int getNumberOfBadges() {
        return numberOfBadges;
    }

    public List<Pokemon> getPokemons() {
        return pokemons;
    }

    public void setNumberOfBadges(int numberOfBadges) {
        this.numberOfBadges = numberOfBadges;
    }

    public void setPokemons(List<Pokemon> pokemons) {
        this.pokemons = pokemons;
    }
}


text:
layout: page
title: Joyce Moon Software Trade Fair
date: 2016-05-24
author: Jacob Chandler
tags: weekly links, java
status: published
summary: Vivamus ultricies, eros in pellentesque sollicitudin.
banner: images/banner/wedding.jpg
booking:
  startDate: 04/12/2018
  endDate: 04/16/2018
  ctyhocn: LPLLCHX
  groupCode: JMSTF
published: true
---
Nunc sit amet sapien quis odio cursus egestas nec convallis turpis. Vivamus ligula urna, laoreet id leo nec, molestie elementum turpis. Fusce ornare lacinia pharetra. Nullam at lacus at tellus mollis pharetra eget imperdiet justo. Quisque mi erat, finibus sit amet vestibulum vel, dapibus quis ligula. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec vehicula lectus vitae diam pellentesque mattis. Ut sagittis molestie ante eu eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean blandit elementum sollicitudin. Donec quis condimentum ligula. Integer malesuada felis at tempus dapibus.
Nunc eget ultricies nunc. Integer vel iaculis ipsum. Praesent nibh sem, pharetra at mattis interdum, dignissim a lorem. Cras vitae massa dictum, mattis justo id, condimentum nulla. Suspendisse suscipit dolor nec tellus sollicitudin, vitae accumsan nibh elementum. Nunc ut quam metus. Suspendisse tincidunt vestibulum nisl ac tristique. Vivamus vulputate enim vitae ante lobortis pellentesque. Nam ex nisl, ultricies tempor lectus ac, pellentesque venenatis turpis.

* Cras vehicula mauris ut turpis faucibus, ac feugiat nibh finibus
* Sed at lorem in sapien porta ultricies
* Donec tempor sapien nec justo viverra eleifend
* Maecenas non lorem aliquam, gravida turpis sit amet, lacinia nulla.

Nam ullamcorper euismod nulla, quis fringilla urna malesuada eget. Etiam quis diam a enim congue tempus. Aenean ullamcorper porta libero a lacinia. Phasellus a neque sapien. Morbi lacinia mi dui, quis vehicula lacus euismod non. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin faucibus semper purus quis viverra. In eros erat, euismod tincidunt faucibus vitae, ullamcorper sed arcu. Pellentesque eleifend dignissim magna, quis suscipit dui molestie et.


text:
class CreateProjects < ActiveRecord::Migration[4.2]

  def change
    create_table :projects do |t|
      t.string :name, null: false
      t.text :description
      t.references :facility, null: false

      t.timestamps null: false
    end

    add_index :projects, [:facility_id, :name], unique: true
    add_index :projects, :facility_id
    add_foreign_key :projects, :facilities
  end

end


text:
class LogVisitWorker
  include Sidekiq::Worker
  include LogVisitHelper

  #Log the ip address then log the visit of the record if
  def perform(user_agent, remote_ip, user_id, timestamp, record_class, record_id, rateable)
    logVisit(user_agent, remote_ip, user_id, timestamp, record_class, record_id, rateable)
  end
end