text:
namespace gfx {

// The GL Api being used. This could be g_real_gl or gl_trace_gl
static GLApi* g_gl;
// A GL Api that calls directly into the driver.
static RealGLApi* g_real_gl;
// A GL Api that calls TRACE and then calls another GL api.
static TraceGLApi* g_trace_gl;

namespace {

static inline GLenum GetInternalFormat(GLenum internal_format) {
  if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
    if (internal_format == GL_BGRA_EXT || internal_format == GL_BGRA8_EXT)
      return GL_RGBA8;
  }
  return internal_format;
}

// TODO(epenner): Could the above function be merged into this and removed?
static inline GLenum GetTexInternalFormat(GLenum internal_format,
                                          GLenum format,
                                          GLenum type) {
  GLenum gl_internal_format = GetInternalFormat(internal_format);

  if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
    return gl_internal_format;

  if (type == GL_FLOAT) {
    switch (format) {
      case GL_RGBA:
        gl_internal_format = GL_RGBA32F_ARB;
        break;
      case GL_RGB:
        gl_internal_format = GL_RGB32F_ARB;
        break;
      case GL_LUMINANCE_ALPHA:
        gl_internal_format = GL_LUMINANCE_ALPHA32F_ARB;
        break;
      case GL_LUMINANCE:
        gl_internal_format = GL_LUMINANCE32F_ARB;
        break;
      case GL_ALPHA:
        gl_internal_format = GL_ALPHA32F_ARB;
        break;
      default:
        NOTREACHED();
        break;
    }
  } else if (type == GL_HALF_FLOAT_OES) {
    switch (format) {
      case GL_RGBA:
        gl_internal_format = GL_RGBA16F_ARB;
        break;
      case GL_RGB:
        gl_internal_format = GL_RGB16F_ARB;
        break;
      case GL_LUMINANCE_ALPHA:
        gl_internal_format = GL_LUMINANCE_ALPHA16F_ARB;
        break;
      case GL_LUMINANCE:
        gl_internal_format = GL_LUMINANCE16F_ARB;
        break;
      case GL_ALPHA:
        gl_internal_format = GL_ALPHA16F_ARB;
        break;
      default:
        NOTREACHED();
        break;
    }
  }
  return gl_internal_format;
}

static inline GLenum GetTexType(GLenum type) {
   if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
     if (type == GL_HALF_FLOAT_OES)
       return GL_HALF_FLOAT_ARB;
   }
   return type;
}

static void GL_BINDING_CALL CustomTexImage2D(
    GLenum target, GLint level, GLint internalformat,
    GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
    const void* pixels) {
  GLenum gl_internal_format = GetTexInternalFormat(
      internalformat, format, type);
  GLenum gl_type = GetTexType(type);
  return g_driver_gl.orig_fn.glTexImage2DFn(
      target, level, gl_internal_format, width, height, border, format, gl_type,
      pixels);
}

static void GL_BINDING_CALL CustomTexSubImage2D(
      GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
      GLsizei height, GLenum format, GLenum type, const void* pixels) {
  GLenum gl_type = GetTexType(type);
  return g_driver_gl.orig_fn.glTexSubImage2DFn(
      target, level, xoffset, yoffset, width, height, format, gl_type, pixels);
}

static void GL_BINDING_CALL CustomTexStorage2DEXT(
    GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
    GLsizei height) {
  GLenum gl_internal_format = GetInternalFormat(internalformat);
  return g_driver_gl.orig_fn.glTexStorage2DEXTFn(
      target, levels, gl_internal_format, width, height);
}

static void GL_BINDING_CALL CustomRenderbufferStorageEXT(
    GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
  GLenum gl_internal_format = GetInternalFormat(internalformat);
  return g_driver_gl.orig_fn.glRenderbufferStorageEXTFn(
      target, gl_internal_format, width, height);
}

// The ANGLE and IMG variants of glRenderbufferStorageMultisample currently do
// not support BGRA render buffers so only the EXT one is customized. If
// GL_CHROMIUM_renderbuffer_format_BGRA8888 support is added to ANGLE then the
// ANGLE version should also be customized.
static void GL_BINDING_CALL CustomRenderbufferStorageMultisampleEXT(
    GLenum target, GLsizei samples, GLenum internalformat, GLsizei width,
    GLsizei height) {
  GLenum gl_internal_format = GetInternalFormat(internalformat);
  return g_driver_gl.orig_fn.glRenderbufferStorageMultisampleEXTFn(
      target, samples, gl_internal_format, width, height);
}

}  // anonymous namespace

void DriverGL::Initialize() {
  InitializeBindings();
}

void DriverGL::InitializeExtensions(GLContext* context) {
  InitializeExtensionBindings(context);
  orig_fn = fn;
  fn.glTexImage2DFn =
      reinterpret_cast<glTexImage2DProc>(CustomTexImage2D);
  fn.glTexSubImage2DFn =
      reinterpret_cast<glTexSubImage2DProc>(CustomTexSubImage2D);
  fn.glTexStorage2DEXTFn =
      reinterpret_cast<glTexStorage2DEXTProc>(CustomTexStorage2DEXT);
  fn.glRenderbufferStorageEXTFn =
      reinterpret_cast<glRenderbufferStorageEXTProc>(
      CustomRenderbufferStorageEXT);
  fn.glRenderbufferStorageMultisampleEXTFn =
      reinterpret_cast<glRenderbufferStorageMultisampleEXTProc>(
      CustomRenderbufferStorageMultisampleEXT);
}

void InitializeGLBindingsGL() {
  g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>;
  g_driver_gl.Initialize();
  if (!g_real_gl) {
    g_real_gl = new RealGLApi();
    g_trace_gl = new TraceGLApi(g_real_gl);
  }
  g_real_gl->Initialize(&g_driver_gl);
  g_gl = g_real_gl;
  if (CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kEnableGPUServiceTracing)) {
    g_gl = g_trace_gl;
  }
  SetGLToRealGLApi();
}

GLApi* GetCurrentGLApi() {
  return g_current_gl_context_tls->Get();
}

void SetGLApi(GLApi* api) {
  g_current_gl_context_tls->Set(api);
}

void SetGLToRealGLApi() {
  SetGLApi(g_gl);
}

void InitializeGLExtensionBindingsGL(GLContext* context) {
  g_driver_gl.InitializeExtensions(context);
}

void InitializeDebugGLBindingsGL() {
  g_driver_gl.InitializeDebugBindings();
}

void ClearGLBindingsGL() {
  if (g_real_gl) {
    delete g_real_gl;
    g_real_gl = NULL;
  }
  if (g_trace_gl) {
    delete g_trace_gl;
    g_trace_gl = NULL;
  }
  g_gl = NULL;
  g_driver_gl.ClearBindings();
  if (g_current_gl_context_tls) {
    delete g_current_gl_context_tls;
    g_current_gl_context_tls = NULL;
  }
}

GLApi::GLApi() {
}

GLApi::~GLApi() {
  if (GetCurrentGLApi() == this)
    SetGLApi(NULL);
}

GLApiBase::GLApiBase()
    : driver_(NULL) {
}

GLApiBase::~GLApiBase() {
}

void GLApiBase::InitializeBase(DriverGL* driver) {
  driver_ = driver;
}

RealGLApi::RealGLApi() {
}

RealGLApi::~RealGLApi() {
}

void RealGLApi::Initialize(DriverGL* driver) {
  InitializeBase(driver);
}

TraceGLApi::~TraceGLApi() {
}

VirtualGLApi::VirtualGLApi()
    : real_context_(NULL),
      current_context_(NULL) {
}

VirtualGLApi::~VirtualGLApi() {
}

void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) {
  InitializeBase(driver);
  real_context_ = real_context;

  DCHECK(real_context->IsCurrent(NULL));
  std::string ext_string(
      reinterpret_cast<const char*>(driver_->fn.glGetStringFn(GL_EXTENSIONS)));
  std::vector<std::string> ext;
  Tokenize(ext_string, " ", &ext);

  std::vector<std::string>::iterator it;
  // We can't support GL_EXT_occlusion_query_boolean which is
  // based on GL_ARB_occlusion_query without a lot of work virtualizing
  // queries.
  it = std::find(ext.begin(), ext.end(), "GL_EXT_occlusion_query_boolean");
  if (it != ext.end())
    ext.erase(it);

  extensions_ = JoinString(ext, " ");
}

bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
  bool switched_contexts = g_current_gl_context_tls->Get() != this;
  GLSurface* current_surface = GLSurface::GetCurrent();
  if (switched_contexts || surface != current_surface) {
    // MakeCurrent 'lite' path that avoids potentially expensive MakeCurrent()
    // calls if the GLSurface uses the same underlying surface or renders to
    // an FBO.
    if (switched_contexts || !current_surface ||
        !virtual_context->IsCurrent(surface)) {
      if (!real_context_->MakeCurrent(surface)) {
        return false;
      }
    }
  }

  DCHECK_EQ(real_context_, GLContext::GetRealCurrent());
  DCHECK(real_context_->IsCurrent(NULL));
  DCHECK(virtual_context->IsCurrent(surface));

  if (switched_contexts || virtual_context != current_context_) {
    // There should be no errors from the previous context leaking into the
    // new context.
    DCHECK_EQ(glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR));

    current_context_ = virtual_context;
    // Set all state that is different from the real state
    // NOTE: !!! This is a temporary implementation that just restores all
    // state to let us test that it works.
    // TODO: ASAP, change this to something that only restores the state
    // needed for individual GL calls.
    GLApi* temp = GetCurrentGLApi();
    SetGLToRealGLApi();
    if (virtual_context->GetGLStateRestorer()->IsInitialized())
      virtual_context->GetGLStateRestorer()->RestoreState();
    SetGLApi(temp);
  }
  SetGLApi(this);

  virtual_context->SetCurrent(surface);
  if (!surface->OnMakeCurrent(virtual_context)) {
    LOG(ERROR) << "Could not make GLSurface current.";
    return false;
  }
  return true;
}

void VirtualGLApi::OnReleaseVirtuallyCurrent(GLContext* virtual_context) {
  if (current_context_ == virtual_context)
    current_context_ = NULL;
}

const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) {
  switch (name) {
    case GL_EXTENSIONS:
      return reinterpret_cast<const GLubyte*>(extensions_.c_str());
    default:
      return driver_->fn.glGetStringFn(name);
  }
}

}  // namespace gfx


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\TypedData\Validation\RecursiveValidator.
 */

namespace Drupal\Core\TypedData\Validation;

use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\Core\TypedData\TypedDataManager;
use Symfony\Component\Validator\ConstraintValidatorFactoryInterface;
use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;

/**
 * Defines a recursive validator for Typed Data.
 *
 * The difference to \Symfony\Component\Validator\Validator\RecursiveValidator
 * is that we just allow to validate typed data objects.
 */
class RecursiveValidator implements ValidatorInterface {

  /**
   * @var \Symfony\Component\Validator\Context\ExecutionContextFactoryInterface
   */
  protected $contextFactory;

  /**
   * @var \Symfony\Component\Validator\ConstraintValidatorFactoryInterface
   */
  protected $constraintValidatorFactory;

  /**
   * @var \Drupal\Core\TypedData\TypedDataManager
   */
  protected $typedDataManager;

  /**
   * Creates a new validator.
   *
   * @param \Symfony\Component\Validator\Context\ExecutionContextFactoryInterface $context_factory
   *   The factory for creating new contexts.
   * @param \Symfony\Component\Validator\ConstraintValidatorFactoryInterface $validator_factory
   *   The constraint validator factory.
   * @param \Drupal\Core\TypedData\TypedDataManager $typed_data_manager
   *   The typed data manager.
   */
  public function __construct(ExecutionContextFactoryInterface $context_factory, ConstraintValidatorFactoryInterface $validator_factory, TypedDataManager $typed_data_manager) {
    $this->contextFactory = $context_factory;
    $this->constraintValidatorFactory = $validator_factory;
    $this->typedDataManager = $typed_data_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function startContext($root = NULL) {
    return new RecursiveContextualValidator($this->contextFactory->createContext($this, $root), $this, $this->constraintValidatorFactory, $this->typedDataManager);
  }

  /**
   * {@inheritdoc}
   */
  public function inContext(ExecutionContextInterface $context) {
    return new RecursiveContextualValidator($context, $this, $this->constraintValidatorFactory, $this->typedDataManager);
  }

  /**
   * {@inheritdoc}
   *
   * @param \Drupal\Core\TypedData\TypedDataInterface $typed_data
   *   A typed data object containing the value to validate.
   */
  public function getMetadataFor($typed_data) {
    if (!$typed_data instanceof TypedDataInterface) {
      throw new \InvalidArgumentException('The passed value must be a typed data object.');
    }
    return new TypedDataMetadata($typed_data);
  }

  /**
   * {@inheritdoc}
   */
  public function hasMetadataFor($value) {
    return $value instanceof TypedDataInterface;
  }

  /**
   * {@inheritdoc}
   */
  public function validate($value, $constraints = null, $groups = null) {
    return $this->startContext($value)
      ->validate($value, $constraints, $groups)
      ->getViolations();
  }

  /**
   * {@inheritdoc}
   */
  public function validateProperty($object, $propertyName, $groups = NULL) {
    return $this->startContext($object)
      ->validateProperty($object, $propertyName, $groups)
      ->getViolations();
  }

  /**
   * {@inheritdoc}
   */
  public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = NULL) {
    // Just passing a class name is not supported.
    if (!is_object($objectOrClass)) {
      throw new \LogicException('Typed data validation does not support passing the class name only.');
    }
    return $this->startContext($objectOrClass)
      ->validatePropertyValue($objectOrClass, $propertyName, $value, $groups)
      ->getViolations();
  }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ComposerJsonPluginSettings">
    <unboundedVersionInspectionSettings>
      <excludedPackages />
    </unboundedVersionInspectionSettings>
    <customRepositories />
    <composerUpdateOptions />
  </component>
</project>


text:
#include "ImageCamera.h"

#include <iostream>

int main(int argc, char*argv[])
{
//   ImageCamera(vtkRenderer* const renderer);
//
//   void FlipVertically();
//   void FlipHorizontally();
  throw;

  return EXIT_SUCCESS;
}


text: the matasano cryptography challenges done in erlang


text:
module SmartMoney
  module Operations

    include Comparable

    def convert_to(new_currency)
      new_amount = Money.convert(@amount, @currency.upcase, new_currency.upcase).round(2)
      Money.new(new_amount, new_currency)
    end

    def inspect
      "#{@amount} #{@currency}"
    end

    def +(other)
      raise TypeError unless other.is_a?(Money)
      Money.new @amount+other.convert_to(@currency).amount, @currency
    end

    def -(other)
      raise TypeError unless other.is_a?(Money)
      Money.new @amount-other.convert_to(@currency).amount, @currency
    end

    def *(value)
      Money.new @amount*value, @currency if value.is_a?(Numeric)
    end

    def /(value)
      Money.new @amount/value, @currency if value.is_a?(Numeric)
    end

    def ==(other)
      raise TypeError unless other.is_a?(Money)
      @amount.round(2)==other.convert_to(@currency).amount.round(2)
    end

    def <=>(other)
      raise TypeError unless other.is_a?(Money)
      if @currency != other.currency
        other = other.convert_to(@currency)
      end
      @amount.round(2) <=> other.amount.round(2)
    end
  end
end


text:
package es.udc.fic.acs.infmsb01.atm.common.model.message.instance.data;

import es.udc.fic.acs.infmsb01.atm.common.model.agentinfo.RecipientInfo;
import es.udc.fic.acs.infmsb01.atm.common.model.message.DataResponseMessage;
import es.udc.fic.acs.infmsb01.atm.common.model.message.code.DataResponseCode;

public final class ResponseDeposit extends DataResponseMessage {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private Double accountBalance;

	public ResponseDeposit(RecipientInfo from, RecipientInfo to,
			byte channelNumber, short messageNumber, boolean bankOnline,
			DataResponseCode responseCode, Double accountBalance) {

		super(from, to, channelNumber, messageNumber, bankOnline, responseCode);
		this.accountBalance = accountBalance;

	}

	public ResponseDeposit() {
		super();
	}

	public void setAccountBalance(Double accountBalance) {
		this.accountBalance = accountBalance;
	}

	public Double getAccountBalance() {
		return accountBalance;
	}

	@Override
	public String toString() {
		return "[" + getClass().getSimpleName() + "] " + super.toString()
				+ " ab:" + accountBalance;
	}

}


text:
using namespace A2O;

PointCloudSensor::PointCloudSensor(ICameraConfig::ConstPtr config)
      : Sensor(config)
{

}

PointCloudSensor::~PointCloudSensor()
{

}

pcl::PointCloud< pcl::PointXYZ >::Ptr PointCloudSensor::getPointCloud() const
{
  return _cloud;
}

const bool PointCloudSensor::update(IPerception::ConstPtr perception)
{
  IPointCloudPerceptor::ConstPtr pclPerceptor = perception->getPointCloudPerceptor(_perceptorName);

  if (pclPerceptor.get()) {
    _cloud = pclPerceptor->getPointCloud();
    _lastMeasurementTime = pclPerceptor->getTime();
    return true;
  }

  return false;
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DnD_5e_CharacterSheet.CustomControls
{
    /// <summary>
    /// Interaction logic for AbilityScore.xaml
    /// </summary>
    public partial class AbilityScore : UserControl, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public string Ability
        {
            get { return (string)GetValue(AbilityProperty); }
            set { SetValue(AbilityProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Ability.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AbilityProperty =
            DependencyProperty.Register("Ability", typeof(string), typeof(AbilityScore), new PropertyMetadata(string.Empty));

        public int Score
        {
            get { return (int)GetValue(ScoreProperty); }
            set { SetValue(ScoreProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Score.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ScoreProperty =
            DependencyProperty.Register("Score", typeof(int), typeof(AbilityScore), new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, ScoreChanged));

        private static void ScoreChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ((AbilityScore)d).PropertyChanged?.Invoke(d, new PropertyChangedEventArgs("Modifier"));
        }

        public int Modifier
        {
            get { return getAbilityModifier(Score); }
        }

        public AbilityScore()
        {
            InitializeComponent();
        }

        private int getAbilityModifier(int abilityScore)
        {
            switch (abilityScore)
            {
                case 1:
                    return -5;
                case 2:
                case 3:
                    return -4;
                case 4:
                case 5:
                    return -3;
                case 6:
                case 7:
                    return -2;
                case 8:
                case 9:
                    return -1;
                case 10:
                case 11:
                    return 0;
                case 12:
                case 13:
                    return 1;
                case 14:
                case 15:
                    return 2;
                case 16:
                case 17:
                    return 3;
                case 18:
                case 19:
                    return 4;
                case 20:
                case 21:
                    return 5;
                case 22:
                case 23:
                    return 6;
                case 24:
                case 25:
                    return 7;
                case 26:
                case 27:
                    return 8;
                case 28:
                case 29:
                    return 9;
                case 30:
                    return 10;
                default:
                    return 0;
            }
        }
    }
}


text:
import {
    Component, DoCheck, ElementRef, Input, OnInit, ViewChild
} from "@angular/core";
import { CallStatus } from "./call-status";

@Component({
    selector: 'call-status',
    templateUrl: './call-status.component.html',
    host: {
        '(document:click)': 'handleClick($event)',
    },
})

export class CallStatusComponent implements OnInit {
    @ViewChild('errorBox') errorBox: ElementRef;
    @ViewChild('successBox') successBox: ElementRef;

    // if true opens the detailed error messages by default
    @Input() showAllDetails: boolean = false;
    @Input() callStatus: CallStatus;
    // if true adds the alert class to the component for top and bottom padding
    @Input() large: boolean;
    showDetails: boolean[] = [];

    ngOnInit(): void {
        if (this.callStatus.aggregatedErrors) {
            for (let error of this.callStatus.aggregatedErrors) {
                this.showDetails.push(false);
            }
        }
    }

    isLoadingIconHidden(): boolean {
        return this.callStatus.callCount === 0 || this.callStatus.isAllComplete();
    }

    handleClick(event) {
        // if the call is still active, ignore click
        if (!this.callStatus || this.callStatus.fb_submitted == true) {
            return;
        }

        var clickedComponent = event.target;
        var inside = false;
        do {
            // null check on the element refs in case they might not be rendered at all
            if ((this.errorBox != null && clickedComponent === this.errorBox.nativeElement) ||
                (this.successBox != null && clickedComponent === this.successBox.nativeElement)) {
                inside = true;
                break;
            }
            clickedComponent = clickedComponent.parentNode;
        } while (clickedComponent);

        // if successful and outside the box, reset the status
        /*if(!inside && this.callStatus.fb_callback == true) {
            this.callStatus.reset();
        }
        if(!inside && this.callStatus.fb_errordetc == true) {
            //this.callStatus.reset();
        }*/
    }
}


text:
"use strict";

/**
 * Mocha setup.
 */
var chai = require("chai");
var Adapter = require("../../../index").adapters.mocha;

// Globals.
global.expect = chai.expect;
global.adapter = new Adapter();


text:
/* global require, $ */
import Chat from "./chat/Chat";
import ContactList from "./contactlist/ContactList";
import Settings from "./../../settings/Settings";
import SettingsMenu from "./settings/SettingsMenu";
import VideoLayout from "../videolayout/VideoLayout";
import ToolbarToggler from "../toolbars/ToolbarToggler";
import UIUtil from "../util/UIUtil";

const buttons = {
    '#chatspace': '#chatBottomButton',
    '#contactlist': '#contactListButton',
    '#settingsmenu': '#toolbar_button_settings'
};

var currentlyOpen = null;

/**
 * Toggles the windows in the side panel
 * @param object the window that should be shown
 * @param selector the selector for the element containing the panel
 * @param onOpenComplete function to be called when the panel is opened
 * @param onOpen function to be called if the window is going to be opened
 * @param onClose function to be called if the window is going to be closed
 * @param onVideoResizeComplete function to be called after the video area
 * is resized
 */
function toggle (object, selector, onOpenComplete,
                 onOpen, onClose, onVideoResizeComplete) {
    let isSideBarVisible = object.isVisible();

    UIUtil.buttonClick(buttons[selector], "active");

    if (isSideBarVisible) {
        $("#toast-container").animate({
            right: 5
        }, {
            queue: false,
            duration: 500
        });
        $(selector).hide("slide", {
            direction: "right",
            queue: false,
            duration: 500
        });

        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);

        if(typeof onClose === "function") {
            onClose();
        }

        currentlyOpen = null;
    } else {
        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);

        // Undock the toolbar when the chat is shown and if we're in a
        // video mode.
        if (VideoLayout.isLargeVideoVisible()) {
            ToolbarToggler.dockToolbar(false);
        }

        if (currentlyOpen) {
            var current = $(currentlyOpen);
            UIUtil.buttonClick(buttons[currentlyOpen], "active");
            current.css('z-index', 4);
            setTimeout(function () {
                current.css('display', 'none');
                current.css('z-index', 5);
            }, 500);
        }

        $("#toast-container").animate({
            right: (UIUtil.getSidePanelSize()[0] + 5)
        }, {
            queue: false,
            duration: 500
        });
        $(selector).show("slide", {
            direction: "right",
            queue: false,
            duration: 500,
            complete: onOpenComplete
        });
        if(typeof onOpen === "function") {
            onOpen();
        }

        currentlyOpen = selector;
    }
}

function resizeVideoArea(isSidePanelVisible, completeFunction) {
    VideoLayout.resizeVideoArea(!isSidePanelVisible,
        false,
        false,
        completeFunction);
}

/**
 * Toggler for the chat, contact list, settings menu, etc..
 */
var PanelToggler = {

    /**
     * Opens / closes the chat area.
     */
    toggleChat () {
        var chatCompleteFunction = Chat.isVisible()
            ? function () {}
            : function () {
                Chat.scrollChatToBottom();
                $('#chatspace').trigger('shown');
            };

        toggle(Chat, //Object
            '#chatspace', // Selector
            function () { //onOpenComplete
                // Request the focus in the nickname field or the chat input
                // field.
                if ($('#nickname').css('visibility') === 'visible') {
                    $('#nickinput').focus();
                } else {
                    $('#usermsg').focus();
                }
            },
            () => this.resizeChat(), //OnOpen
            null,
            chatCompleteFunction); //OnClose
    },

    resizeChat () {
        let [width, height] = UIUtil.getSidePanelSize();
        Chat.resizeChat(width, height);
    },

    /**
     * Opens / closes the contact list area.
     */
    toggleContactList () {
        var completeFunction = ContactList.isVisible()
            ? function () {}
            : function () {
                $('#contactlist').trigger('shown');
            };

        toggle(ContactList,
            '#contactlist',
            null,
            function() {
                ContactList.setVisualNotification(false);
            },
            null,
            completeFunction);
    },

    /**
     * Opens / closes the settings menu
     */
    toggleSettingsMenu () {
        toggle(SettingsMenu,
            '#settingsmenu',
            null,
            function() {},
            null);
    },

    isVisible () {
        return (Chat.isVisible() ||
                ContactList.isVisible() ||
                SettingsMenu.isVisible());
    }
};

export default PanelToggler;


text:
#include "xvmaininc.h"
#include "defines.h"
#include "rtlintproto.h"
#include "declares.h"
#include "externs.h"

/* Write a number of blocks out to the file */

int v2_write_blocks(
   struct devstate *devstate,
   char *buf,
   V2_OFFSET block,
   V2_OFFSET nblocks,
   int async_flag	/* included for orthogonality... not used under Unix */
)

{
   int status;

   switch (devstate->device_type) {

      case DEV_DISK:
         status = v2_write_disk(&devstate->dev.disk, buf, block, nblocks,
		  async_flag, &devstate->transfer_count, devstate->file_offset);
         break;

#if RTL_USE_TAPE
      case DEV_TAPE:
         status = v2_write_tape(&devstate->dev.tape, buf, block, nblocks,
			     async_flag, &devstate->transfer_count);
         break;
#endif

      case DEV_ARRAY:
         status = v2_write_nop();
         break;

      default:
         status = NOT_IMPLEMENTED;
   }

   return status;
}


text:
var qs = require('querystring')
var response = require('response')
var JSONStream = require('JSONStream')
var jsonBody = require('body/json')
var through = require('through2')
var filter = require('filter-object')
var extend = require('extend')

var errorResponse = require('../../lib/error-response')

module.exports = function (server, options) {
  var handler = {}

  handler.index = function (req, res, options) {
    return response().json(server.schema()).pipe(res)
  }

  return handler
}


text:
pkg_mgr exists mongodb && exit $SKIP
pkg_mgr install mongodb


text:
		<link rel="stylesheet" type="text/css" href="../styles.css"/>

spring:message

org.springframework.web.servlet.tags.MessageTag

					spring:message (since 1.0)

					General information

						The spring:message tag provides you with internationalization
						support using Spring's MessageSource concept. The MessageSource
						is an interface providing functionality for retrieving messages. It closely
						resembles JSTL's fmt:message-tag, however, the MessageSource
						classes can be integrated with the Spring context. Also, the spring:message-
						tag, works with the locale support that comes with Spring.

					Attributes

					code

					The code (key) to use when looking up the message. If code is not
						provided, the text attribute will be used.

					required: no

					el-support: yes

					text

					Default text to output when a message for the given code could
						not be found. If both text and code are not set, the
						tag will output null

					required: no

					el-support: yes

					var

					The string to use when binding the result to the page,
						request, session or application scope. If not specified,
						the result gets outputted to the writer (directly to the JSP i.e.).

					required: no

					el-support: yes

					scope

					The scope to use when exported the result to a variable.
						This attribute is only used when var is also set.
						Possible values are page, request,
						session and application

					required: no

					el-support: yes

					Variables

					none

					Also have a look at

					the ResourceBundleMessageSource
					to see how resource bundles can be used in conjunction with the spring:message-tag

					the MessageSource
					to see how you can implement your own message sources


text:
<?php

declare(strict_types=1);

namespace PjbServer\Tools\System;

use PjbServer\Tools\Exception;

interface ProcessInterface
{
    /**
     * Kill a process.
     *
     * @throws Exception\InvalidArgumentException
     */
    public function kill(int $pid, bool $wait = false): bool;

    /**
     * Check whether a pid is running.
     *
     * @throws Exception\InvalidArgumentException
     */
    public function isRunning(int $pid): bool;
}


text:
@interface YBNewFeatureCollectionCell ()

/// 背景图片
@property(nonatomic, weak) UIImageView *bgView;
/// 开始按钮
@property(nonatomic, weak) UIButton *startBut;

@end

@implementation YBNewFeatureCollectionCell

#pragma mark - 构造方法
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // 准备UI
        [self prepareUI];
    }
    return self;
}

#pragma mark - 准备UI
- (void)prepareUI{
    // 背景图片
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.contentView);
    }];
    // 按钮
    [self.startBut mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(105, 36));
        make.centerX.mas_equalTo(self.contentView.mas_centerX);
        make.centerY.mas_equalTo(self.contentView.mas_bottom).offset(-180);
    }];
}

#pragma mark - 数据拦截
/// 索引
- (void)setIndex:(NSInteger)index {
    _index = index;
    // 设置背景图片
    self.bgView.image = [UIImage imageNamed:[NSString stringWithFormat:@"new_feature_%zd",index + 1]];
}

/// 是否显示按钮
- (void)setIsShowBut:(BOOL)isShowBut {
    _isShowBut = isShowBut;
    self.startBut.hidden = !isShowBut;
    if (isShowBut) {
        // 开始动画
        self.startBut.transform = CGAffineTransformMakeScale(0.01, 0.01);
        [UIView animateWithDuration:2 delay:0.1 usingSpringWithDamping:0.4 initialSpringVelocity:5 options:UIViewAnimationOptionAllowUserInteraction animations:^{
            self.startBut.transform = CGAffineTransformIdentity;
        } completion:^(BOOL finished) {

        }];
    }
}

#pragma mark - 按钮点击事件
- (void)startButClick {
    [UIApplication sharedApplication].keyWindow.rootViewController = [YBTabBarController new];
}

#pragma mark - 懒加载
/// 背景图片
- (UIImageView *)bgView {
    if (_bgView == nil) {
        UIImageView *bgView = [UIImageView new];
        [self.contentView addSubview:bgView];
        _bgView = bgView;
    }
    return _bgView;
}

/// 开始图片
- (UIButton *)startBut{
    if (_startBut == nil) {
        UIButton *but = [UIButton new];
        [but setTitle:@"开始" forState:UIControlStateNormal];
        [but setBackgroundImage:[UIImage imageNamed:@"new_feature_finish_button_highlighted"] forState:UIControlStateHighlighted];
        [but setBackgroundImage:[UIImage imageNamed:@"new_feature_finish_button"] forState:UIControlStateNormal];
        but.hidden = YES;
        // 天机点击事件
        [but addTarget:self action:@selector(startButClick) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:but];
        _startBut = but;
    }
    return _startBut;
}

@end


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".CitiesActivity" >

    <FrameLayout
        android:id="@+id/frameLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <LinearLayout
        android:id="@+id/progressLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone" >
        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">
        <fragment
            android:id="@+id/citiesListFragment"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            class="com.ruenzuo.weatherapp.fragments.CitiesListFragment" />
    </LinearLayout>

</LinearLayout>


text:
package com.github.srgg.yads.impl.runtime;

import com.github.srgg.yads.api.ActivationAware;
import com.github.srgg.yads.api.Identifiable;
import com.github.srgg.yads.api.message.Messages;
import com.github.srgg.yads.api.messages.Message;
import com.github.srgg.yads.impl.AbstractNode;
import com.github.srgg.yads.impl.AbstractExecutionRuntime;
import com.github.srgg.yads.impl.MasterNode;
import com.github.srgg.yads.impl.StorageNode;
import com.github.srgg.yads.impl.api.Chain;
import com.github.srgg.yads.impl.api.context.ExecutionContext;
import com.github.srgg.yads.impl.api.context.StorageExecutionContext.StorageState;
import com.github.srgg.yads.impl.context.MasterNodeExecutionContext;
import com.github.srgg.yads.impl.context.StorageNodeExecutionContext;
import com.github.srgg.yads.impl.util.InMemoryStorage;
import com.github.srgg.yads.impl.context.communication.AbstractTransport;
import com.github.srgg.yads.impl.context.communication.JacksonPayloadMapper;
import com.github.srgg.yads.impl.util.MessageUtils;
import com.github.srgg.yads.impl.util.TaggedLogger;
import com.google.common.base.Joiner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;

import static com.google.common.base.Preconditions.checkState;

/**
 *  @author Sergey Galkin <srggal at gmail dot com>
 */
public final class LocalRuntime implements ActivationAware {
    private final Logger logger = new TaggedLogger(LoggerFactory.getLogger(LocalRuntime.class), "LocalRuntime: ");
    private final LocalTransport transport = new LocalTransport();

    @Override
    public String getState() {
        return transport.getState();
    }

    @Override
    public void start() throws Exception {
        logger.debug("is about to start");
        transport.start();
        logger.debug("has been STARTED");
    }

    @Override
    public void stop() throws Exception {
        logger.debug("is about to stop");
        transport.stop();
        logger.debug("has been STOPPED");
    }

    @Override
    public String getId() {
        return "local-rt";
    }

    public static class LocalClient implements Identifiable<String> {
        private final String clientId;

        public LocalClient(final String cid) {
            this.clientId = cid;
        }

        public void storeValue(final Object key, final Object value) {
        }

        public Object getValue(final Object key) {
            return null;
        }

        @Override
        public String getId() {
            return clientId;
        }
    }

    public void sendMessage(final String nodeId, final Message.MessageBuilder builder) throws Exception {
        final Message msg = builder
                .setSender("fake-local")
                .build();

        transport.send(nodeId, msg);
    }

    public <M extends Message> M performRequest(final String nodeId, final Message.MessageBuilder builder) throws Exception {
        final String senderId = UUID.randomUUID().toString();

        final SynchronousQueue<Message>  messageQueue = new SynchronousQueue<>(false);

        final AbstractExecutionRuntime rt = new AbstractExecutionRuntime(transport, null) {
            @Override
            public boolean onMessage(final String recipient, final Messages.MessageTypes type,
                                     final Message message) throws Exception {
                messageQueue.put(message);
                return true;
            }

            @Override
            public String getId() {
                return senderId;
            }
        };

        rt.stateChanged(State.STARTED.name());
        try {
            final Message msg = builder
                    .setSender(senderId)
                    .build();

            transport.send(nodeId, msg);
            //noinspection unchecked
            return (M) messageQueue.take();
        } finally {
            rt.stateChanged(State.STOPPED.name());
        }
    }

    public StorageNode createStorageNode(final String nodeId) throws Exception {
        final StorageNode node = new StorageNode(nodeId, new InMemoryStorage());
        final StorageNodeExecutionContext ctx = new StorageNodeExecutionContext(transport, node);
        node.configure(ctx);
        node.start();
        return node;
    }

    public void nodeShutdown(final String nodeId) {
        final AbstractNode node = transport.getNodeById(nodeId);
        checkState(node != null, "Can't shutdown node '%s', since it doesn't exist", nodeId);
        node.stop();
    }

    public MasterNode createMasterNode(final String nodeId) throws Exception {
        final MasterNode node = new MasterNode(nodeId);
        final MasterNodeExecutionContext ctx = new MasterNodeExecutionContext(transport, node);
        node.configure(ctx);
        node.start();
        return node;
    }

    public List<Chain.INodeInfo<MasterNode.NodeInfo>> waitForCompleteChain() throws InterruptedException {
        final String id = transport.getNearestMaster();
        checkState(id != null, "Can't wait for chain, there is no master at all");
        final MasterNode node = (MasterNode) transport.getNodeById(id);

        for (;;) {
            final Set<StorageNodeExecutionContext> contexts = transport.getNodeContexts(StorageNodeExecutionContext.class);
            final int expected = contexts.size();

            final List<Chain.INodeInfo<MasterNode.NodeInfo>> chain = node.chain().asList();
            if (chain.size() == expected) {
                return chain;
            }
            Thread.sleep(20);
        }
    }

    public List<Chain.INodeInfo<MasterNode.NodeInfo>> waitForRunningChain() throws InterruptedException {
        final List<Chain.INodeInfo<MasterNode.NodeInfo>> r = waitForCompleteChain();

        for (boolean b = false; !b;) {
            Thread.sleep(10);

            for (Chain.INodeInfo<MasterNode.NodeInfo> ni : r) {
                b = StorageState.RUNNING.name().equals(ni.state());
                if (!b) {
                    break;
                }
            }
        }

        return r;
    }

    public Map<String, StorageNodeExecutionContext.NodeState> getAllStorageStates() {
        final Set<StorageNodeExecutionContext> contexts = transport.getNodeContexts(StorageNodeExecutionContext.class);

        final HashMap<String, StorageNodeExecutionContext.NodeState> r = new HashMap<>(contexts.size());
        contexts.forEach((ctx) -> r.put(ctx.getId(), ctx.getNodeState()));
        return r;
    }

    private static class LocalTransport extends AbstractTransport implements ActivationAware {
        private ScheduledExecutorService executor;

        LocalTransport() {
            super(new JacksonPayloadMapper());
            logger().debug("Created");
        }

        private String getMasterId() {
            final Set<MasterNodeExecutionContext> contexts = getNodeContexts(MasterNodeExecutionContext.class);
            return contexts.isEmpty() ? null : contexts.iterator().next().getId();
        }

        protected String getLeader() {
            return getMasterId();
        }

        protected String getNearestMaster() {
            return getMasterId();
        }

        protected <N extends ExecutionContext> Set<N> getNodeContexts(final Class<N> contextClass) {
            final HashSet<N> r = new HashSet<>();

            forEach((id, h)-> {
                if (contextClass.isInstance(h)) {
                    r.add((N) h);
                }
            });

            return r;
        }

        protected AbstractNode<?> getNodeById(final String nodeId) {
            final AbstractNode<?>[] r = {null};
            forEach((id, h) -> {
                if (h instanceof AbstractExecutionRuntime) {
                    final AbstractNode<?> n = ((AbstractExecutionRuntime) h).node();

                    if (n.getId().equals(nodeId)) {
                        r[0] = n;
                    }
                }
            });

            return r[0];
        }

        private void sendImpl(final String sender, final String recipient, final ByteBuffer bb) {
            checkState("RUNNING".equals(getState()));

            final AbstractExecutionRuntime nrt = (AbstractExecutionRuntime) this.handlerById(recipient);
            checkState(nrt != null, "Unknown recipient id:'%s'", recipient);

            executor.submit(() -> {
                final ArrayList<Message> messages = new ArrayList<>(1);
                try {
                    final int i = decode(bb, messages);
                    assert i == -1;
                } catch (Exception e) {
                    // TODO: add hexdump
                    logger().error(
                            String.format("[ERR] receive call failed: '%s' -> '%s'. Binary can't be decoded",
                                    sender, recipient),
                            e
                    );
                }

                checkState(messages.size() == 1);
                final Message msg = messages.get(0);
                try {
                    onReceive(recipient, msg);
                } catch (Exception e) {
                    final byte msgCode = getMessageCodeFor(msg);
                    final Messages.MessageTypes mt = Messages.MessageTypes.valueOf(msgCode);

                    logger().error(
                            MessageUtils.dumpMessage(msg, "[RECEIVE FAILED] '%s' -> '%s': %s@%s",
                                    sender,  recipient, mt, msg.getId()),
                            e
                    );
                }
            });
        }

        @Override
        protected void doSend(final String sender, final String recipient, final ByteBuffer bb) throws Exception {
            switch (recipient) {
                case LEADER_NODE:
                    final String leaderId = getLeader();
                    checkState(leaderId != null);
                    sendImpl(sender, leaderId, bb);
                    break;

                case NEAREST_MASTER:
                    final String masterId = getNearestMaster();
                    checkState(masterId != null);
                    sendImpl(sender, masterId, bb);
                    break;

                case NEAREST_NODE:
                    throw new UnsupportedOperationException();

                default:
                    sendImpl(sender, recipient, bb);
            }
        }

        @Override
        public String getState() {
            return executor == null ? "STOPPED" : "RUNNING";
        }

        @Override
        public void start() throws Exception {
            logger().debug("is about to start");

            executor = Executors.newScheduledThreadPool(10);
            logger().debug("has been STARTED");
        }

        @Override
        public void stop() throws Exception {
            logger().debug("is about to stop");
            final Set<AbstractExecutionRuntime> contexts = getNodeContexts(AbstractExecutionRuntime.class);

            for (AbstractExecutionRuntime nrt: contexts) {
                if (nrt.node() != null) {
                    nrt.node().stop();
                } else {
                    nrt.stateChanged(State.STOPPED.name());
                }
            }

            executor.shutdown();
            try {
                executor.awaitTermination(2, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                logger().debug("Got InterruptedException while waiting for executor termination");
            }

            if (!executor.isTerminated()) {
                final List<Runnable> pendingTasks = executor.shutdownNow();
                logger().warn("List of pending tasks that weren't stopped:\n\t{}",
                        Joiner.on("\n\t").join(pendingTasks));
            }

            logger().debug("has been STOPPED");
        }

        @Override
        public String getId() {
            return "local";
        }
    }

}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Publicadas extends CI_Controller {

	public function __construct(){
		parent::__construct();
               $this->load->helper(array('form','url','date','html'));
               $this->load->model('DBModel');
               $this->load->library('session');
	}

	public function publicacion()
	{
		$idUsuario =  $this->session->userdata('idUsuario');
		if(!empty($idUsuario)){
			$data["dondeestoy"] = "Publicaciones";
			$this->load->helper(array('form','url','date','html'));
			$data["title"] = "GeoValores";
			$data["title_page"] = "Mis Publicaciones";
			$data["publicaciones"] = $this->DBModel->selectPublicaciones('publicaciones',$this->session->userdata('idUsuario'));
			$this->load->view('misVentas/publicaciones', $data);
		}
		else {
			redirect(base_url().'index.php/Login/adminuser');
		}

	}

	public function editar($id)
	{
		$idUsuario =  $this->session->userdata('idUsuario');
		if(!empty($idUsuario)){
			$this->session->set_userdata('idPublicacion',$id);
			$this->load->helper(array('form','url','date','html'));
			$data["title"] = "GeoValores";
			$data["title_page"] = "Mis Publicaciones";
                        $data["dondeestoy"] = "Publicaciones";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $useractivo = $publicacion[0]['usuarios_idUsuario'];
                        if($useractivo != $idUsuario){
                          $data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                    $data['nopuede'] = 'Usted no es el dueño de esta propiedad';
                     $this->load->view('publicaciones/desactiva', $data);
                       }
			$fields= $this->DBModel->selectDetailsPublicacion('details_fields',$id);
                        foreach ($fields as $value ){
                        if($value['field_name'] == "imagen1" && $value['field_value'] != ''){ $count = 1;}
                        if($value['field_name'] == "imagen2" && $value['field_value'] != ''){ $count = 2;}
                        if($value['field_name'] == "imagen3" && $value['field_value'] != ''){ $count = 3;}
                        if($value['field_name'] == "imagen4" && $value['field_value'] != ''){ $count = 4;}
                        if($value['field_name'] == "imagen5" && $value['field_value'] != ''){ $count = 5;}

                     }
                        $data['count'] = $count;
			array_unshift($fields, array('field_name'=>'tiempo','field_value'=>$publicacion[0]['tiempo']  ));
			$data["publicacion"] = array_merge ( $fields ,$publicacion );
			if($publicacion[0]['tipo_categoria'] == "remate"){
				$this->load->view('misVentas/editar-remate', $data);
			}else{
				$this->load->view('misVentas/editar', $data);
			}
		}
		else {
			redirect(base_url().'index.php/Login/adminuser');
		}

	}

	public function show($id){

                $idUsuario =  $this->session->userdata('idUsuario');
		if(!empty($idUsuario)){

			$this->load->helper(array('form','url','date','html'));
			$data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                        if($status == 0){
                            $this->load->view('publicaciones/desactiva', $data);
                        }
                        else {
			$fields= $this->DBModel->selectDetailsPublicacion('details_fields',$id);

                        $idUsuario =  $this->session->userdata('idUsuario');
                        $userid = $publicacion[0]['usuarios_idUsuario'];
                        $idpublicacion = $id;
                        $usercontacto =  $this->DBModel->selectuser('usuarios',$userid);
                        if(!empty($idUsuario)){
                        $favorita =  $this->DBModel->selectfavorita('publicaciones_marcadas',$idUsuario,$id);
                        $data['favorita'] = $favorita;
                        $data['idpublicacion'] = $idpublicacion;
                        }
                        foreach ($fields as $value ){
                        if($value['field_name'] == "imagen1"){ $count = 1;}
                        if($value['field_name'] == "imagen2"){ $count = 2;}
                        if($value['field_name'] == "imagen3"){ $count = 3;}
                        if($value['field_name'] == "imagen4"){ $count = 4;}
                        if($value['field_name'] == "imagen5"){ $count = 5;}
                        if($value['field_name'] == "name"){$titulo = $value['field_value'];}

                     }
                        $data['count'] = $count;
                        $data['usercontacto'] = $usercontacto;
                        $data['verporpiedad'] = 'si';
                        $data['titulo'] = $titulo;
			array_unshift($fields, array('field_name'=>'tiempo','field_value'=>$publicacion[0]['tiempo']  ));
			$data["publicacion"] = array_merge ( $fields ,$publicacion );

			if($publicacion[0]['tipo_categoria'] == "remate"){
				$this->load->view('publicaciones/show-remate', $data);
			}else{
				$this->load->view('publicaciones/show', $data);
			}
                        }
                }
                else {
                    $data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                    $data['nopuede'] = 'Usted no esta con una sesion activa, Si quiere ver alguna propiedad, puede crear una cuenta con nosotros o si ya tiene una cuenta con nosotros puede iniciar sesión';
                     $this->load->view('publicaciones/desactiva', $data);
                }
	}

    public function propiedades()
        {
            $data["dondeestoy"] = "compra";
	    $this->load->helper(array('form','url','date','html'));
	    $data["title"] = "GeoValores";
	    $data["title_page"] = "Publicaciones";
	    $data["publicaciones"] = $this->DBModel->selectJoinPropiedades('details_fields');

	    $this->load->view('publicaciones/propiedades', $data);
        }
    public function favorito()
	{
		$idUsuario =  $this->session->userdata('idUsuario');
		if(!empty($idUsuario)){
			$data["dondeestoy"] = "Favoritos";
			$this->load->helper(array('form','url','date','html'));
			$data["title"] = "GeoValores";
			$data["title_page"] = "Mis Favoritos";
                        $this->load->model('InicioModel');
                        $favorita =  $this->InicioModel->selectfavorita('publicaciones_marcadas',$idUsuario);
                        $data['favorita'] = $favorita;

			$this->load->view('misVentas/favoritos', $data);
		}
		else {
			redirect(base_url().'index.php/Login/adminuser');
		}

	}

	public function saveInfoEditada() {
		$this->load->model('DBModel');
		$data = $_POST['data'];
		$idPublicacion = $_POST['idPublicacion'];
		$price_old = '';

		$array_data = array();
		$array_publicacion = array();

		$c=0;
		foreach ( $data as $dat)
		{
			if($dat['name'] == "tipo_categoria" || $dat['name'] == "tiempo" || $dat['name'] == "status")
			{
				$array_publicacion[$dat['name']] =  $dat['value'];
			}
			else
			{
				if($dat['name'] !== "idPublicacion"){
					if($dat['name'] !== "precio-old"){
						$array_data[$dat['name']] = $dat['value'];
					}
					else{
						$price_old = $dat['value'];
					}

				}

			}
			$c++;
		}
		$array_publicacion['usuarios_idUsuario'] =  $this->session->userdata('usuario_id');
		$array_publicacion['date_publicacion'] = date('Y-m-d H:i:s');

		$publicacion = $this->DBModel->UpdateTable('publicaciones',$array_publicacion,$idPublicacion );
		$msj = '';
		if($publicacion !== 'error'){
			foreach ($array_data as $key => $value) {

				try {
					if($value == 'precio-colones'){

						if($price_old > $key){ //precio mayor se guarda 1
							$this->DBModel->UpdateFieldPublicacion($value,$key, $idPublicacion, 1);
						}
						else if ($price_old < $key) {// precio menor se guarda 0
							$this->DBModel->UpdateFieldPublicacion($value,$key, $idPublicacion, 0);
						}
						else{// se guarda normal
							$this->DBModel->UpdateFieldPublicacion($value,$key, $idPublicacion);
						}

					}
					else{
						$this->DBModel->UpdateFieldPublicacion($value,$key, $idPublicacion);
					}

				} catch (Exception $exc) {
					$msj = false;
				}
				$msj = true;
			}
		}else{
			echo false;
		}

		if($msj == true){
			echo true;
		}else{
			echo false;
		}
	}

public function delete_file()
{
    $file_id = $_POST['data'];
    if ($this->DBModel->delete_file($file_id))
    {
        $status = 'success';
        $msg = 'Imagen eliminado correctamente';

    }
    else
    {
        $status = 'error';
        $msg = 'Algo salió mal al borrar la imagen, por favor, inténtalo de nuevo';
    }
    echo json_encode(array('status' => $status, 'msg' => $msg));
}

public function agregarfavorito()
{
    $iduser = $_POST['data'];
    $idpublicacion = $_POST['data1'];

    $data = array('idUsuario' => $iduser, 'idPublicacion' => $idpublicacion);
    if ($this->DBModel->InsertTable("publicaciones_marcadas",$data))
    {
        $status = 'success';
        $msg = 'Esta propiedad es parte de sus favoritas';

    }
    else
    {
        $status = 'error';
        $msg = 'Algo salió mal al agregar a sus favoritas, por favor, inténtalo de nuevo';
    }
    echo json_encode(array('status' => $status, 'msg' => $msg));
}

public function deletefavorito()
{
    $file_id = $_POST['data'];
    if ($this->DBModel->deletefavorito1($file_id))
    {
        $status = 'success';
        $msg = 'Ya no esta sus favoritos';

    }
    else
    {
        $status = 'error';
        $msg = 'Algo salió mal al borrar el favorito, por favor, inténtalo de nuevo';
    }
    echo json_encode(array('status' => $status, 'msg' => $msg));
}

public function cambiarestado(){
    $tabla = "publicaciones";
    $idPublicacion = $_POST['idpublicar'];
    $data = array (
      'status' => $_POST['data'],

    );
    if( $this->DBModel->UpdateTable($tabla ,$data, $idPublicacion))
     {
        $status = 'success';
        $msg = 'Ya se cambio la propiedad'.$_POST['data'];

    }
    else
    {
        $status = 'error';
        $msg = 'Algo salió mal al cambiar la propiedad, por favor, inténtalo de nuevo';
    }
    echo json_encode(array('status' => $status, 'msg' => $msg));
}

public function cfecha(){
    $tabla = "publicaciones";
    $idPublicacion = $_POST['data'];
    $data = array (
      'status' => 1,
      'date_publicacion' => date("Y-m-d H:i:s")

    );
     $this->DBModel->UpdateTable($tabla ,$data, $idPublicacion);
}

public function exito($id){

                $idUsuario =  $this->session->userdata('idUsuario');
		if(!empty($idUsuario)){

			$this->load->helper(array('form','url','date','html'));
			$data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                        $useractivo = $publicacion[0]['usuarios_idUsuario'];
                       if($useractivo != $idUsuario){
                          $data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                    $data['nopuede'] = 'Usted no es el dueño de esta propiedad';
                     $this->load->view('publicaciones/desactiva', $data);
                       }
			$fields= $this->DBModel->selectDetailsPublicacion('details_fields',$id);

                        $idUsuario =  $this->session->userdata('idUsuario');
                        $userid = $publicacion[0]['usuarios_idUsuario'];
                        $idpublicacion = $id;
                        $usercontacto =  $this->DBModel->selectuser('usuarios',$userid);
                        if(!empty($idUsuario)){
                        $favorita =  $this->DBModel->selectfavorita('publicaciones_marcadas',$idUsuario,$id);
                        $data['favorita'] = $favorita;
                        $data['idpublicacion'] = $idpublicacion;
                        }
                        foreach ($fields as $value ){
                        if($value['field_name'] == "imagen1"){ $count = 1;}
                        if($value['field_name'] == "imagen2"){ $count = 2;}
                        if($value['field_name'] == "imagen3"){ $count = 3;}
                        if($value['field_name'] == "imagen4"){ $count = 4;}
                        if($value['field_name'] == "imagen5"){ $count = 5;}
                        if($value['field_name'] == "name"){$titulo = $value['field_value'];}

                     }
                        $data['count'] = $count;
                        $data['usercontacto'] = $usercontacto;
                        $data['verporpiedad'] = 'si';
                        $data['titulo'] = $titulo;
			array_unshift($fields, array('field_name'=>'tiempo','field_value'=>$publicacion[0]['tiempo']  ));
			$data["publicacion"] = array_merge ( $fields ,$publicacion );

			if($publicacion[0]['tipo_categoria'] == "remate"){
				$this->load->view('publicaciones/show-remate', $data);
			}else{
				$this->load->view('exito', $data);
			}

                }
                else {
                    $data["title"] = "GeoValores";
			$data["title_page"] = "Publicacion".$id;
                        $data["dondeestoy"] = "compra";
			$publicacion =  $this->DBModel->selectPublicacion('publicaciones',$id);
                        $status = $publicacion[0]['status'];
                    $data['nopuede'] = 'Usted no esta con una sesion activa, Si quiere ver alguna propiedad, puede crear una cuenta con nosotros o si ya tiene una cuenta con nosotros puede iniciar sesión';
                     $this->load->view('publicaciones/desactiva', $data);
                }
	}
}


text:
> Asynchronous logging actor for Celluloid.

## Contributing

* Fork this repository on github
* Make your changes and send us a pull request
* If we like them we'll merge them
* If we've accepted a patch, feel free to ask for commit access

## License

Copyright (c) 2015 Donovan Keme, Tony Arcieri.

Distributed under the MIT License. See [LICENSE.txt](https://github.com/celluloid/celluloid-logger/blob/master/LICENSE.txt) for further details.


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Rainforest Connection | Our team</title>
    <meta name="description" content="Meet the RFCx team. Also check out Rainforest Connection partners and Rainforest Connection donors.">
    <meta name="keywords" content="Topher White, RFCx team, Rainforest Connection partners, Rainforest Connection donors">
    <!-- @include modules/common/head.html -->
    <link rel="stylesheet" href="css/team.min.css">
</head>
<body class="team">
<!-- @include modules/common/body-start.html -->
<!-- @include modules/common/header.html -->
<!-- @include modules/team/about.html -->
<!-- @include modules/team/people.html -->
<!-- @include modules/team/about-board.html -->
<!-- @include modules/team/people-board.html -->
<!-- @include modules/team/about-volunteer.html -->
<!-- @include modules/team/people-volunteer.html -->
<!-- @include modules/common/footer.html -->
<!-- @include modules/common/modal.html -->
<!-- @include modules/common/foot.html -->
<script type="text/javascript" src="js/our-work.min.js"></script>
<!-- @include modules/common/body-end.html -->
</body>
</html>


text:
import os
import sys
import traceback
import array

# Add the pulsar path
thispath = os.path.dirname(os.path.realpath(__file__))
psrpath = os.path.join(os.path.dirname(thispath), "../", "modules")
parent = os.path.join(os.path.dirname(thispath))
sys.path.insert(0, psrpath)
sys.path.insert(0, parent)

from pulsar.testing import *
from pulsar.system import *
from pulsar.datastore import *
from pulsar.output import *

from helper.TestAtoms import water2

def CompareList(lst1, lst2, tol):
  if len(lst1) != len(lst2):
    return False

  else:
    for i in range(0, len(lst1)):
        if abs(lst1[i]-lst2[i]) > tol:
            return False

  return True

def Run(mm):
    try:

        out = get_global_output()

        # Load the python modules
        #             supermodule              module name    key
        mm.load_module("Integrals",  "Overlap",     "AO_OVERLAP")
        mm.print(out)
        mm.sanity_check()

        atoms = list(water2)
        u = AtomSetUniverse()
        for a in atoms:
            u.insert(a)
        s = System(u, True)

        s = apply_single_basis("Primary","sto-3g",s)
        wfn = Wavefunction()
        wfn.system = s
        bs = s.get_basis_set("Primary")

        nr = mm.get_module("AO_OVERLAP", 0)
        nr.enable_debug(True)
        nr.initialize(0, wfn, bs, bs)

        tester = Tester("Testing Overlap integrals")
        tester.print_header()

        outbuf = array.array('d', [0]*64)
        n = nr.calculate(1, 2, outbuf)
        print("calculated {} integrals".format(n))
        print(outbuf[:n])

        #tester.test_value("H2O Nuclear repulsion", True, CompareList(ref_h2o, list(outbuf[:n]), 1e-14))

        tester.print_results()

    except Exception as e:
      print_global_output("Caught exception in main handler\n")
      traceback.print_exc()

psr.initialize(sys.argv, color = True, debug = True)

with psr.ModuleAdministrator() as mm:
    Run(mm)

psr.finalize()


text:
namespace Volo.PostgreSqlDemo.Web.Views.Shared.Components.TenantChange
{
    public class ChangeModalViewModel
    {
        public string TenancyName { get; set; }
    }
}


text:
package ws.leipold.felix.jgoodies.polyadapter;

import com.jgoodies.binding.beans.Model;

/**
 * @author Felix Leipold
 * Date: 09.10.2005
 * Time: 22:07:58
 */
public class Rectangle extends Model {
    public static final String PROPERTYNAME_HEIGHT ="height";
    public static final String PROPERTYNAME_WIDTH="width";

    int height;
    int width;

    public Rectangle(int height, int width) {
        this.height = height;
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(int height) {
        int old=this.height;
        this.height = height;
        firePropertyChange(PROPERTYNAME_HEIGHT,old,height);
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        int old=this.width;
        this.width = width;
        firePropertyChange(PROPERTYNAME_WIDTH,old,width);
    }

    public String toString() {
        return "Rectangle("+width+","+height+")";
    }
}


text:
typedef struct {
  int number_of_vertices;
  size_t size;
  GLenum type;
  int components;
} ADF_HEADER;

void create_array_data_file(const char *destination, const void *data,
                            int number_of_vertices, size_t size, GLenum type,
                            int components)
{
  ADF_HEADER header;

  header.number_of_vertices = number_of_vertices;
  header.size = size;
  header.type = type;
  header.components = components;

  FILE *file = fopen(destination, "w+b");
  if(file == NULL)  {
    fprintf(stderr, "Could not open %s for writting.\n", destination);

    exit(1);
  }

  if(fwrite(&header, sizeof(ADF_HEADER), 1, file) != 1)  {
    fprintf(stderr, "Could not write header to %s\n", destination);

    exit(1);
  }

  if(fwrite(data, size * components * number_of_vertices, 1, file) != 1)  {
    fprintf(stderr, "Could not write data to %s\n", destination);

    exit(1);
  }

  fclose(file);
}

void read_array_data_file(const char *source, void **data, int *number_of_vertices,
                          size_t *size, GLenum *type, int *components)
{
  FILE *file = fopen(source, "rb");
  if(file == NULL)  {
    fprintf(stderr, "Could not open %s for reading\n", source);

    exit(1);
  }

  ADF_HEADER header;

  if(fread(&header, sizeof(ADF_HEADER), 1, file) != 1)  {
    fprintf(stderr, "Could not read header of %s\n", source);

    exit(1);
  }

  *number_of_vertices = header.number_of_vertices;
  *size = header.size;
  *type = header.type;
  *components = header.components;

  *data = malloc(header.size * header.components * header.number_of_vertices);
  if(*data == NULL)  {
    fprintf(stderr, "Could not allocate space for data at %p\n", source);

    exit(1);
  }

  if(fread(*data, header.size * header.components * header.number_of_vertices,
       1, file) != 1)  {
    fprintf(stderr, "Could not read data from %s\n", source);

    exit(1);
  }

  fclose(file);
}

void create_VDF_from_ADFs(const char *destination, int number_of_arrays,
                          GLenum draw_mode, ...)
{
  int attribute_locations[number_of_arrays];
  const char *files[number_of_arrays];

  void *data[number_of_arrays];

  va_list arrays;

  va_start(arrays, draw_mode);

  for(int i = 0; i <  number_of_arrays; i++)  {
    attribute_locations[i] = va_arg(arrays, int);
    files[i] = va_arg(arrays, const char*);
  }

  va_end(arrays);

  int number_of_vertices = 0, temp;

  size_t sizes[number_of_arrays];
  GLenum types[number_of_arrays];
  int components[number_of_arrays];

  for(int i = 0; i < number_of_arrays; i++) {
    read_array_data_file(files[i], &data[i], &temp, &sizes[i], &types[i], &components[i]);

    if(number_of_vertices == 0)
      number_of_vertices = temp;
    else if(number_of_vertices != temp) {
      fprintf(stderr, "The array_data_files do not have the same number of vertices.\n");

      for(int i = 0; i < number_of_arrays; i++)
        if(data[i] != NULL)
          free(data[i]);

      exit(1);
    }
  }

  create_vertex_data_file_arrays(destination, number_of_arrays, number_of_vertices,
                                 draw_mode, sizes, types, components,
                                 attribute_locations, data);

  for(int i = 0; i < number_of_arrays; i++)
    if(data[i] != NULL)
      free(data[i]);
}


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

package com.upwardsnorthwards.blueplaqueslondon.utils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.annotation.NonNull;
import android.util.Log;
import android.widget.Toast;

import com.upwardsnorthwards.blueplaqueslondon.R;

/**
 * Helper class which listens for internet connectivity events.
 */
public class InternetConnectivityHelper {

    private static final String TAG = "ConnectivityHelper";

    /**
     * Weak reference to the context in which this helper was instantiated.
     */
    private final Context context;

    /**
     * Used for communicating connectivity events back to client code.
     */
    private InternetConnectivityHelperDelegate delegate;
    /**
     * The current state of internet connectivity.
     */
    private InternetConnectivity currentInternetConnectivity;
    /**
     * The receiver responsible for indicating whether or not the device has regained or lost internet connectivity.
     */
    private BroadcastReceiver networkConnectivityReceiver;

    /**
     * Simple constructor.
     *
     * @param context the activity context.
     */
    public InternetConnectivityHelper(Context context) {
        this.context = context;
    }

    public void onResume() {
        networkConnectivityReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, @NonNull Intent intent) {
                String action = intent.getAction();
                if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
                    Log.v(TAG, "Received an intent related to internet connectivity");
                    boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
                    if (noConnectivity && currentInternetConnectivity == InternetConnectivity.InternetConnectivityConnected) {
                        lostInternetConnectivity();
                    } else if (!noConnectivity && currentInternetConnectivity == InternetConnectivity.InternetConnectivityNoConnection) {
                        regainedInternetConnectivity();
                    }
                }
            }
        };
        IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
        context.registerReceiver(networkConnectivityReceiver, filter);
        updateCurrentInternetConnectivity();
    }

    public void onPause() {
        if (networkConnectivityReceiver != null) {
            context.unregisterReceiver(networkConnectivityReceiver);
        }
    }

    public void showConnectivityToast() {
        if (context != null) {
            Toast toast = Toast.makeText(context, context.getString(R.string.internet_connectivity_message), Toast.LENGTH_SHORT);
            toast.show();
        }
    }

    /**
     * Executed callback when the device loses internet connectivity
     */
    private void lostInternetConnectivity() {
        currentInternetConnectivity = InternetConnectivity.InternetConnectivityNoConnection;
        if (delegate != null) {
            delegate.lostInternetConnectivity();
        }
    }

    /**
     * Executed callback when the device regains internet connectivity
     */
    private void regainedInternetConnectivity() {
        currentInternetConnectivity = InternetConnectivity.InternetConnectivityConnected;
        if (delegate != null) {
            delegate.regainedInternetConnectivity();
        }
    }

    private void updateCurrentInternetConnectivity() {
        ConnectivityManager cm =
                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = cm.getActiveNetworkInfo();
        if (netInfo != null && netInfo.isConnectedOrConnecting()) {
            Log.v(TAG, "The application has an internet connection");
            currentInternetConnectivity = InternetConnectivity.InternetConnectivityConnected;
        } else {
            Log.v(TAG, "The application does not have an internet connection");
            currentInternetConnectivity = InternetConnectivity.InternetConnectivityNoConnection;
        }
        if (delegate != null) {
            delegate.internetConnectivityUpdated(currentInternetConnectivity == InternetConnectivity.InternetConnectivityConnected);
        }
    }

    public void setDelegate(InternetConnectivityHelperDelegate delegate) {
        this.delegate = delegate;
    }

    /**
     * Gives an understanding of whether or not the application has an internet connection.
     */
    private enum InternetConnectivity {
        InternetConnectivityConnected,
        InternetConnectivityNoConnection,
    }
}


text:
package com.indeed.proctor.builder;

import com.indeed.proctor.common.IncompatibleTestMatrixException;
import com.indeed.proctor.store.ProctorReader;
import com.indeed.proctor.store.StoreException;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.io.Writer;

public class ProctorBuilder {

    private static final Logger LOGGER = Logger.getLogger(ProctorBuilder.class);

    private final ProctorReader proctorReader;
    private final Writer outputSink;
    private final String author;
    private String version;

    public ProctorBuilder(final ProctorReader proctorReader, Writer outputSink) {
        this(proctorReader, outputSink, null);
    }
    public ProctorBuilder(final ProctorReader proctorReader, Writer outputSink, String author) {
        this(proctorReader, outputSink, author, "");
    }
    public ProctorBuilder(final ProctorReader proctorReader, Writer outputSink, String author, String version) {
        this.proctorReader = proctorReader;
        this.outputSink = outputSink;
        this.author = author;
        this.version = version;
    }

    public void execute() throws StoreException, IOException, IncompatibleTestMatrixException {
        ProctorBuilderUtils.generateArtifact(proctorReader, outputSink, author, version);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/accelerate_interpolator"
     android:shareInterpolator="true">
    <translate
        android:duration="200"
        android:fillAfter="true"
        android:fillBefore="true"
        android:fromXDelta="0"
        android:fromYDelta="0"
        android:toXDelta="0"
        android:toYDelta="150%p"/>
</set>


text:
//-------------------------------------------------------------------------------------
//  ExportDialogUtils.h
//
//  Wrapper code to build Win32 dialog boxes.
//
//  Microsoft XNA Developer Connection
//  Copyright © Microsoft Corporation. All rights reserved.
//-------------------------------------------------------------------------------------

#pragma once

namespace ATG
{
    class ThinDialog
    {
    public:
        static LRESULT CALLBACK DlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

        HWND Hwnd()
        {
            return m_hwnd;
        };

        ThinDialog() :
            m_hwnd( NULL ),
            m_strTemplate( NULL )
        {
        };

        virtual ~ThinDialog()
        {
            ::DestroyWindow( m_hwnd );
        };

        INT DoModal( HINSTANCE hinst, HWND hwndParent )
        {
            return (INT)::DialogBoxParam( hinst,
                m_strTemplate,
                hwndParent,
                (DLGPROC)DlgProc,
                (LPARAM)this );
        };

        BOOL DoModeless( HINSTANCE hinst, HWND hwndParent )
        {
            m_hwnd = ::CreateDialogParam( hinst,
                m_strTemplate,
                hwndParent,
                (DLGPROC)DlgProc,
                (LPARAM)this );
            return (m_hwnd != NULL );
        };

        BOOL Destroy()
        {
            return ::DestroyWindow( m_hwnd );
        }

    protected:
        virtual LRESULT OnMessage( UINT uMsg, WPARAM wParam, LPARAM lParam );
        virtual LRESULT OnNcActivate( BOOL fDrawActive );
        virtual LRESULT OnActivate( BOOL fActivated, DWORD idThread );
        virtual LRESULT OnInitDialog( HWND hwndFocusCtrl );
        virtual LRESULT OnDestroyDialog( );
        virtual LRESULT OnNotify( INT idCtrl, LPNMHDR pnmh );
        virtual LRESULT OnCommand( WORD wNotifyCode, WORD idCtrl, HWND hwndCtrl );

        void CenterOnParent();
        HWND m_hwnd;
        LPTSTR m_strTemplate;

    private:

        static void SetInstance( HWND hwndDlg, ThinDialog* pDlg )
        {
            if (pDlg)
            {
                ::SetWindowLong( hwndDlg, GWL_USERDATA, (LONG)(LPARAM)pDlg );
                pDlg->m_hwnd = hwndDlg;
            }
        };

        static  ThinDialog* GetInstance( HWND hwndDlg )
        {
            return ( ThinDialog* )( ::GetWindowLong( hwndDlg, GWL_USERDATA ) );
        }
    };

    /*

    GridLayout manages a grid of rectangles, where the column and row sizes are
    based on user-provided specifications combined with the size of an input
    rectangle, which spcifies the size of the entire grid.  Its operation is much like
    a TABLE object in HTML.

    This class is really useful for laying out a window of UI elements that needs to be
    arbitrarily resizable.

    Specifications for rows and columns come in the form of FLOATs.  If the FLOAT is
    less than or equal to 1, it is INTerpreted as a percentage of the adjusted size of
    the grid.  If the FLOAT is greater than 1, it is INTerpreted as an exact pixel size
    that is expected in the final pixel allocation.

    After the specs have been set, an input rect is passed in.  A border amount (also a parameter)
    is subtracted from the input rect, making it smaller.  Then, all of the exact pixel amounts
    in the row and column specs are evaluated, and each subtracts their amount from the remaining
    height and width, respectively.  The remaining amount is called the adjusted height and width.
    Now, the percentage specs are evaluated, for example a row spec of 0.5 gets 50% of the adjusted
    height.

    Once the allocated amounts are computed, the user can now query cells in the grid or ranges of
    cells in the grid.  The PlaceWindow method is where a user can pass in a window handle, a cell range,
    and an alignment specification, and GridLayout will move the window INTo the proper place.

    Sample usage:

    // create a 2x2 grid
    GridLayout layout(2, 2);
    // set the height of row 0 to be the current height of the window m_toolbarHwnd
    layout.SetRowSpec(0, m_toolbarHwnd);
    // set the height of row 1 to be the rest of the height
    layout.SetRowSpec(1, 1);
    // set the width of column 0 to 200 pixels
    layout.SetColumnSpec(0, 200);
    // set the width of column 1 to be the rest of the width
    layout.SetColumnSpec(1, 1);
    // allocate the grid sizes based on the client rect of m_hwnd
    layout.SetClientRect(m_hwnd);
    // place the toolbar in cell 0,0, spanning two columns with a border of 0
    layout.PlaceWindow(m_toolbarHwnd, 0, 0, 1, 2, 0);
    // place the tree view in cell 1,0 with a border of 5 pixels
    layout.PlaceWindow(m_treeViewHwnd, 1, 0, 1, 1, 5);
    // place the tab control in cell 1,1 with a border of 2 pixels
    layout.PlaceWindow(m_tabCtrlHwnd, 1, 1, 1, 1, 2);

    */

#define GRIDMAX 10

    class GridLayout
    {
    public:
        enum Alignments
        {
            ALIGN_HCENTER = 0x0001,
            ALIGN_LEFT = 0x0002,
            ALIGN_RIGHT = 0x0004,
            ALIGN_HJUSTIFY = 0x0008,
            ALIGN_VCENTER = 0x0010,
            ALIGN_TOP = 0x0020,
            ALIGN_BOTTOM = 0x0040,
            ALIGN_VJUSTIFY = 0x0080,
            ALIGN_FILLRECT = ALIGN_HJUSTIFY | ALIGN_VJUSTIFY,
            ALIGN_CENTERED = ALIGN_HCENTER | ALIGN_VCENTER,
            ALIGN_UPPERLEFT = ALIGN_LEFT | ALIGN_TOP,
            ALIGN_CENTERLEFT = ALIGN_LEFT | ALIGN_VCENTER,
            ALIGN_CENTERRIGHT = ALIGN_RIGHT | ALIGN_VCENTER,
            ALIGN_FORCE_DWORD = 0x7fffffff
        };
    public:

        GridLayout(INT rows = 1, INT columns = 1)
        {
            assert(rows > 0 && columns > 0);
            Reset();
            FLOAT share = 1.0f / (FLOAT)rows;
            for (INT i = 0; i < rows; i++)
                m_rowSpec[i] = share;
            share = 1.0f / (FLOAT)columns;
            for (INT i = 0; i < columns; i++)
                m_columnSpec[i] = share;
        }

        ~GridLayout(void)
        {
        }

        // spec methods
        // ------------------------------

        // SetRowSpec sets the allocation spec for a row.
        // if the value is less than 1, the allocation will be a percentage of the adjusted height.
        // if the value is 1, the allocation will be 100% of the adjusted height.
        // if the value is greater than 1, the allocation will be that amount in pixels.
        void SetRowSpec(UINT index, FLOAT s = 1)
        {
            assert(index < GRIDMAX);
            m_rowSpec[index] = s;
        }

        // convenience method that gets the current height of window
        void SetRowSpec(UINT index, HWND window)
        {
            assert(index < GRIDMAX);
            RECT rect;
            GetWindowRect(window, &rect);
            m_rowSpec[index] = (FLOAT)(rect.bottom - rect.top);
        }

        // SetColumnSpec sets the allocation spec for a column.
        // if the value is less than 1, the allocation will be a percentage of the adjusted width.
        // if the value is 1, the allocation will be 100% of the adjusted width.
        // if the value is greater than 1, the allocation will be that amount in pixels.
        void SetColumnSpec(UINT index, FLOAT s = 1)
        {
            assert(index < GRIDMAX);
            m_columnSpec[index] = s;
        }

        // convenience method that gets the current width of window
        void SetColumnSpec(UINT index, HWND window)
        {
            assert(index < GRIDMAX);
            RECT rect;
            GetWindowRect(window, &rect);
            m_columnSpec[index] = (FLOAT)(rect.right - rect.left);
        }

        // allocation methods
        // ------------------------------

        void SetRect(const LPRECT rect, INT border = 0);
        void SetWindowRect(HWND hwnd, INT border = 0);
        void SetClientRect(HWND hwnd, INT border = 0);

        // query methods
        // ------------------------------

        void GetRect(LPRECT destRect, INT rowStart, INT colStart, INT rowSpan = 1, INT colSpan = 1, INT border = 0);
        void PlaceWindow(HWND hwnd, INT rowStart, INT colStart, INT rowSpan = 1, INT colSpan = 1, INT border = 0, DWORD alignment = ALIGN_FILLRECT);
        void PlaceLayout(GridLayout& layout, INT rowStart, INT colStart, INT rowSpan = 1, INT colSpan = 1, INT border = 0);

    private:
        void Reset()
        {
            ZeroMemory(m_columnSpec, GRIDMAX * sizeof(FLOAT));
            ZeroMemory(m_rowSpec, GRIDMAX * sizeof(FLOAT));
            ZeroMemory(m_columnAlloc, GRIDMAX * sizeof(INT));
            ZeroMemory(m_rowAlloc, GRIDMAX * sizeof(INT));
        }

    private:
        FLOAT m_columnSpec[GRIDMAX];
        FLOAT m_rowSpec[GRIDMAX];

        INT m_columnAlloc[GRIDMAX];
        INT m_rowAlloc[GRIDMAX];

        INT m_xOffset;
        INT m_yOffset;
    };

}


text: Simple example scripts illustrating usage of Handwriting.io's API


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
  <meta name="description" content="Miller documentation"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <meta name="keywords"
	content="John Kerl, Kerl, Miller, miller, mlr, OLAP, data analysis software, regression, correlation, variance, data tools, " />

  <title> How original is Miller? </title>
  <link rel="stylesheet" type="text/css" href="css/miller.css"/>
  <link rel="stylesheet" type="text/css" href="css/poki-callbacks.css"/>

      <titleinbody>Miller</titleinbody>

User info:

• About

• File formats

• Miller features in the context of the Unix toolkit

• Record-heterogeneity

• Performance

• Why call it Miller?

• How original is Miller?

• Reference

• Data examples

• Things to do

Developer info:

• Compiling, portability, dependencies, and testing

• Why C?

• Contact information

• GitHub repo

     <titleinbody> How original is Miller? </titleinbody>

 It isn’t. Miller is one of many, many participants in the
online-analytical-processing culture. Other key participants include
<tt>awk</tt>, SQL, spreadsheets, etc. etc.  etc.  Far from being an original
concept, Miller explicitly strives to imitate several existing tools:

<boldmaroon>Unix toolkit</boldmaroon>: Intentional similarities as described in
Miller features in the context of the Unix toolkit.

Recipes abound for command-line data analysis using the Unix toolkit. Here are just a couple of my favorites:

 http://en.wikibooks.org/wiki/Ad_Hoc_Data_Analysis_From_The_Unix_Command_Line

 http://www.gregreda.com/2013/07/15/unix-commands-for-data-science

 <boldmaroon>RecordStream</boldmaroon>: Miller owes particular inspiration
to RecordStream. The
key difference is that RecordStream is a Perl-based tool for manipulating JSON
(including requiring it to separately manipulate other formats such as CSV into
and out of JSON), while Miller is fast C which handles its formats natively.
The similarities include the <tt>sort</tt>, <tt>stats1</tt> (analog of
RecordStream’s <tt>collate</tt>), and <tt>delta</tt> operations, as well
as <tt>filter</tt> and <tt>put</tt>, and pretty-print formatting.

 <boldmaroon>stats_m</boldmaroon>: A third source of lineage is my Python
stats_m
module.  This includes simple single-pass algorithms which form Miller’s
<tt>stats1</tt> and <tt>stats2</tt> subcommands.

 <boldmaroon>SQL</boldmaroon>: Fourthly, Miller’s <tt>group-by</tt> command
name is from SQL, as is the term <tt>aggregate</tt>.

 <boldmaroon>Added value</boldmaroon>:
Miller’s added values include:

 Name-indexing, compared to the Unix toolkit’s positional indexing.

 Raw speed, compared to <tt>awk</tt>, RecordStream, <tt>stats_m</tt>, or various other kinds of Python/Ruby/etc. scripts one can easily create.

 Ability to handle text files on the Unix pipe, without need for creating database tables, compared to SQL databases.

<boldmaroon>jq</boldmaroon>: Miller does for name-indexed text what
jq does for JSON. If you’re
not already familiar with <tt>jq</tt>, please check it out!.

<boldmaroon>What about DOTADIW?</boldmaroon> One of the key points of the
Unix philosophy is
that a tool should do one thing and do it well.  Hence <tt>sort</tt> and
<tt>cut</tt> do just one thing. Why does Miller put <tt>awk</tt>-like
processing, a few SQL-like operations, and statistical reduction all into one
tool (see also Reference)?  This is a fair
question. First note that many standard tools, such as <tt>awk</tt> and
<tt>perl</tt>, do quite a few things — as does <tt>jq</tt>.  But I could
have pushed for putting format awareness and name-indexing options into
<tt>cut</tt>, <tt>awk</tt>, and so on (so you could do <tt>cut -f
hostname,uptime</tt> or <tt>awk '{sum += $x*$y}END{print sum}'</tt>).  Patching
<tt>cut</tt>, <tt>sort</tt>, etc. on multiple operating systems is a
non-starter in terms of uptake.  Moreover, it makes sense for me to have Miller
be a tool which collects together format-aware record-stream processing into
one place, with good reuse of Miller-internal library code for its various
features.

 <boldmaroon>No, really, why one more command-line data-manipulation
tool?</boldmaroon> I wrote Miller because I was frustrated with tools like
<tt>grep</tt>, <tt>sed</tt>, and so on being line-aware without being
format-aware. The single most poignant example I can think of is seeing
people grep data lines out of their CSV files and sadly losing their header
lines.  While some lighter-than-SQL processing is very nice to have, at core I
wanted the format-awareness of RecordStream combined
with the raw speed of the Unix toolkit. Miller does precisely that.


text:
<?php

namespace AppBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Security\Core\User\UserInterface;

class UserEvent extends Event
{
    protected $user;

    public function __construct(UserInterface $user)
    {
        $this->user = $user;
    }

    public function getUser()
    {
        return $this->user;
    }
}


text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_filter :require_admin
  def require_admin
    if session[:user_id].is_a?(Integer)
      @user = User.find(session[:user_id])
    end
    render text:"You must be an admin to view the admin pages." unless @user.try(:is_admin?)
  end
end


text:
<!doctype html>

    <meta charset="utf-8">

    <title>CodeTalks 2016 - Responsive Testing mit Galen</title>

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

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

    <link rel="stylesheet" href="styles/reveal.css" media="all">

    <link rel="stylesheet" href="styles/presentation.css" media="all">

    <link rel="shortcut icon" href="images/brand/favicon.png">

NOTES:">


text:
<?php

namespace NumPHPTest\Core;

use NumPHP\Core\NumArray;
use NumPHP\Core\NumPHP;
use NumPHPTest\Core\Framework\TestCase;

/**
 * Class NumPHPTest
 *
 * @package   NumPHPTest\Core
 * @author    Gordon Lesti <info@gordonlesti.com>
 * @copyright 2014-2015 Gordon Lesti (https://gordonlesti.com/)
 * @license   http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link      http://numphp.org/
 * @since     1.0.0
 */
class NumPHPTest extends TestCase
{
    /**
     * Compares the version in README.md with NumPHP::VERSION
     */
    public function testREADMEVersion()
    {
        $readmeContent = file_get_contents(realpath(__DIR__.'/../../../README.md'));
        $this->assertNotFalse(
            strpos($readmeContent, '*NumPHP '.NumPHP::VERSION.'*'),
            'Version in README.md is not updated'
        );
    }

    /**
     * Tests NumPHP::arange without step
     */
    public function testArangeIntWithoutStep()
    {
        $expectedNumArray = new NumArray(
            [3, 4, 5, 6, 7]
        );
        $this->assertNumArrayEquals($expectedNumArray, NumPHP::arange(3, 7));
    }

    /**
     * Tests NumPHP::arange with float values and step
     */
    public function testArangeFloatWithoutStep()
    {
        $expectedNumArray = new NumArray(
            [3.45, 4.45, 5.45, 6.45]
        );
        $this->assertNumArrayEquals($expectedNumArray, NumPHP::arange(3.45, 7));

        $expectedNumArray = new NumArray(
            [3.45, 4.45, 5.45, 6.45, 7.45]
        );
        $this->assertNumArrayEquals($expectedNumArray, NumPHP::arange(3.45, 7.45));
    }

    /**
     * Tests NumPHP::arange with integer step
     */
    public function testArangeIntWithStep()
    {
        $expectedNumArray = new NumArray(
            [3, 5, 7]
        );
        $this->assertNumArrayEquals($expectedNumArray, NumPHP::arange(3, 7, 2));
    }

    /**
     * Tests NumPHP::arange with float step
     */
    public function testArangeFloatWithStep()
    {
        $expectedNumArray = new NumArray(
            [3.12, 4.66, 6.2]
        );
        $this->assertNumArrayEquals(
            $expectedNumArray,
            NumPHP::arange(3.12, 7, 1.54)
        );
    }

    /**
     * Tests if InvalidArgumentException will be thrown, when using NumPHP::arange
     * with negative step
     *
     * @expectedException        \NumPHP\Core\Exception\InvalidArgumentException
     * @expectedExceptionMessage Step has to be a positive value
     */
    public function testArangeInvalidArgumentException()
    {
        NumPHP::arange(1, 2, -1);
    }

    /**
     * Tests NumPHP::linspace with size 0
     */
    public function testLinspace0()
    {
        $expectedNumArray = new NumArray([]);
        $this->assertNumArrayEquals(
            $expectedNumArray,
            NumPHP::linspace(1.5, 4.5, 0)
        );
    }

    /**
     * Tests NumPHP::linspace with size 1
     */
    public function testLinspace1()
    {
        $expectedNumArray = new NumArray([1.5]);
        $this->assertNumArrayEquals(
            $expectedNumArray,
            NumPHP::linspace(1.5, 4.5, 1)
        );
    }

    /**
     * Tests NumPHP::linspace with size 7
     */
    public function testLinspace()
    {
        $expectedNumArray = new NumArray(
            [1.5, 2, 2.5, 3, 3.5, 4, 4.5]
        );
        $this->assertNumArrayEquals(
            $expectedNumArray,
            NumPHP::linspace(1.5, 4.5, 7)
        );
    }

    /**
     * Test if InvalidArgumentException will be thrown, when using NumPHP::linspace
     * with negative `$number`
     *
     * @expectedException        \NumPHP\Core\Exception\InvalidArgumentException
     * @expectedExceptionMessage Number has to be a positive value
     */
    public function testLinspaceInvalidArgumentException()
    {
        NumPHP::linspace(1.5, 4.5, -1);
    }
}


text:
var expect = require('chai').expect;
var mock = require('./');

// not sure the best way to test for a Proxy, since it's completely transparent...
describe('mock-css-modules', function() {
  it('should handle CSS requires', function() {
    var test = require('./test/test.css');
    expect(test).to.be.an('object');
    expect(test.monkey).to.equal('monkey');
  });

  it('should allow me to register a single file extension', function() {
    mock.register('.sass');

    var test = require('./test/test.sass');
    expect(test).to.be.an('object');
    expect(test.bagel).to.equal('bagel');
  });

  it('should allow me to register multiple file extensions', function() {
    mock.register(['.scss', '.stylesheet']);

    var test = require('./test/test.stylesheet');
    expect(test).to.be.an('object');
    expect(test.bob).to.equal('bob');
  });

  it('should not confuse babel', function() {
    var test = require('./test/test.css');
    expect(test.__esModule).to.be.false;
  });
});