text:
//package com.gersion.superlock.db;
//
//import android.content.Context;
//import android.text.TextUtils;
//
//import com.gersion.superlock.bean.PasswordBean;
//import com.gersion.superlock.utils.Aes;
//import com.gersion.superlock.utils.ConfigManager;
//import com.gersion.superlock.utils.Md5Utils;
//import com.gersion.superlock.utils.TimeUtils;
//
//import io.realm.Realm;
//import io.realm.RealmConfiguration;
//
//public final class PasswordManager {
//    public static String mCreateDate;
//    public static String mPasswordKey;
//    private Realm mRealm;
//
//    private PasswordManager() {
//    }
//
//    public static PasswordManager getInstance() {
//        return InstanceHolder.INSTANCE;
//    }
//
//    public Realm getRealm() {
//        return mRealm;
//    }
//
//    public String getEncyptPassword(String password){
//        return Aes.encrypt(password,mPasswordKey);
//    }
//    /**
//     * @param appContext
//     * @param dbVersion
//     */
//    public void init(Context appContext, long dbVersion) {
//        byte[] key = getKey(appContext);
//        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
//                .name("password.realm")
//                .encryptionKey(key)
//                .schemaVersion(dbVersion)
//                .deleteRealmIfMigrationNeeded()
//                .build();
//
//        mRealm = Realm.getInstance(realmConfiguration);
//    }
//
//    /*
//    * ~~ 时间:2017/5/25 21:30 ~~
//    * 生成加密Key
//    **/
//    private byte[] getKey(Context appContext) {
//        byte[] key = new byte[64];
//        mCreateDate = ConfigManager.getInstance().getCreateLockDate();
//        if (TextUtils.isEmpty(mCreateDate)) {
//            mCreateDate = TimeUtils.getCurrentTimeInString();
//            ConfigManager.getInstance().setCreateLockDate(mCreateDate);
//        }
//        mPasswordKey = Md5Utils.encodeWithTimes(mCreateDate, 66);
//        String password = Md5Utils.encodeWithTimes(mCreateDate, 88);
//        char[] chars = password.toCharArray();
//        int length = chars.length;
//        for (int i = length - 1; i > 0; i--) {
//            key[i] = (byte) chars[i];
//        }
//        return key;
//    }
//
//    /**
//     * 退出应用的时候调用
//     */
//    public void destroy() {
//        if (mRealm != null) {
//            if (!mRealm.isClosed()) {
//                mRealm.close();
//            }
//            mRealm = null;
//        }
//    }
//
//    public PasswordBean addPassword(String password) {
//        PasswordBean bean = new PasswordBean();
//        bean.setPassword(password);
//        return addPassword(bean, 1);
//    }
//
//    /**
//     * @param bean 要添加的对象
//     * @return 返回realm中的对象
//     */
//    public PasswordBean addPassword(final PasswordBean bean, final long id) {
//        mRealm.executeTransaction(
//                new Realm.Transaction() {
//                    @Override
//                    public void execute(Realm realm) {
//                        bean.setId(id);
//                        realm.insert(bean);
//                    }
//                });
//
//        return bean;
//    }
//
//    public PasswordBean updatePassword(String password) {
//        mRealm.beginTransaction();
//        PasswordBean passwordBean = load();
//        passwordBean.setPassword(password);
//        PasswordBean dbPasswordBean = mRealm.copyToRealmOrUpdate(passwordBean);
//        mRealm.commitTransaction();
//
//        return dbPasswordBean;
//    }
//
//    public String getPassword(){
//        return load().getPassword();
//    }
//
//    private PasswordBean load() {
//        return mRealm.where(PasswordBean.class).findFirst();
//    }
//
//    public void delete(PasswordBean bean) {
//        if (bean.getId() < 0) {
//            throw new IllegalArgumentException("非法参数: PasswordBean的id不正确");
//        }
//
//        //managed, 直接删除
//        if (bean.isValid()) {
//            mRealm.beginTransaction();
//            bean.deleteFromRealm();
//            mRealm.commitTransaction();
//            return;
//        }
//
//        //unmanaged: 先查询, 再删除
//        deleteById(bean.getId());
//    }
//
//    public void deleteById(long id) {
//        PasswordBean dbPasswordBean = mRealm.where(PasswordBean.class)
//                .equalTo("id", id)
//                .findFirst();
//
//        mRealm.beginTransaction();
//        dbPasswordBean.deleteFromRealm();
//        mRealm.commitTransaction();
//    }
//
//    public interface OnUpdateCallback {
//        PasswordBean onUpdate();
//    }
//
//    private static class InstanceHolder {
//        private static final PasswordManager INSTANCE = new PasswordManager();
//    }
//}


text:
package songs

object Input {

}

redpajama_set_name: RedPajamaGithub


text:
#include <grpc/grpc.h>

#include <string.h>

#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>

#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"

static void client_channel_factory_ref(
    grpc_client_channel_factory* cc_factory) {}

static void client_channel_factory_unref(
    grpc_client_channel_factory* cc_factory) {}

static grpc_subchannel* client_channel_factory_create_subchannel(
    grpc_client_channel_factory* cc_factory, const grpc_subchannel_args* args) {
  grpc_connector* connector = grpc_chttp2_connector_create();
  grpc_subchannel* s = grpc_subchannel_create(connector, args);
  grpc_connector_unref(connector);
  return s;
}

static grpc_channel* client_channel_factory_create_channel(
    grpc_client_channel_factory* cc_factory, const char* target,
    grpc_client_channel_type type, const grpc_channel_args* args) {
  if (target == nullptr) {
    gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
    return nullptr;
  }
  // Add channel arg containing the server URI.
  grpc_arg arg = grpc_channel_arg_string_create(
      (char*)GRPC_ARG_SERVER_URI,
      grpc_resolver_factory_add_default_prefix_if_needed(target));
  const char* to_remove[] = {GRPC_ARG_SERVER_URI};
  grpc_channel_args* new_args =
      grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
  gpr_free(arg.value.string);
  grpc_channel* channel =
      grpc_channel_create(target, new_args, GRPC_CLIENT_CHANNEL, nullptr);
  grpc_channel_args_destroy(new_args);
  return channel;
}

static const grpc_client_channel_factory_vtable client_channel_factory_vtable =
    {client_channel_factory_ref, client_channel_factory_unref,
     client_channel_factory_create_subchannel,
     client_channel_factory_create_channel};

static grpc_client_channel_factory client_channel_factory = {
    &client_channel_factory_vtable};

/* Create a client channel:
   Asynchronously: - resolve target
                   - connect to it (trying alternatives as presented)
                   - perform handshakes */
grpc_channel* grpc_insecure_channel_create(const char* target,
                                           const grpc_channel_args* args,
                                           void* reserved) {
  grpc_core::ExecCtx exec_ctx;
  GRPC_API_TRACE(
      "grpc_insecure_channel_create(target=%s, args=%p, reserved=%p)", 3,
      (target, args, reserved));
  GPR_ASSERT(reserved == nullptr);
  // Add channel arg containing the client channel factory.
  grpc_arg arg =
      grpc_client_channel_factory_create_channel_arg(&client_channel_factory);
  grpc_channel_args* new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
  // Create channel.
  grpc_channel* channel = client_channel_factory_create_channel(
      &client_channel_factory, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR,
      new_args);
  // Clean up.
  grpc_channel_args_destroy(new_args);

  return channel != nullptr ? channel
                            : grpc_lame_client_channel_create(
                                  target, GRPC_STATUS_INTERNAL,
                                  "Failed to create client channel");
}


text:
<link rel="import" href="..\..\bower_components/polymer/polymer.html">

<dom-module id="main-panel">
  <template>

      <paper-card elevation="1" class="fancy" heading="Dispositivos" image="../../images/header.png">

          <paper-checkbox id="automode" onclick="EnviarComandoAUTO()">Automático</paper-checkbox>

          <iron-icon icon="mdi:lan"></iron-icon>Dispositivo A<paper-toggle-button id="ptb_mp1" onclick="EnviarSaida('D1')" disabled></paper-toggle-button>

          <iron-icon icon="mdi:lan"></iron-icon>Dispositivo B<paper-toggle-button id="ptb_mp2" onclick="EnviarSaida('D2')" disabled></paper-toggle-button>

          <iron-icon icon="mdi:lan"></iron-icon>Dispositivo C<paper-toggle-button id="ptb_mp3" onclick="EnviarSaida('D3')" ></paper-toggle-button>

          <iron-icon icon="mdi:lan"></iron-icon>Dispositivo D<paper-toggle-button id="ptb_mp4" onclick="EnviarSaida('D4')" ></paper-toggle-button>

          <paper-button raised id="btAll" onclick="LigarTodos('DALL')">
            LIGAR TODOS
          </paper-button>

      </paper-card>
      <paper-card id="2card" elevation="1" heading="Situação atual" image="../../images/header.png">

          <iron-icon icon="mdi:temperature-celsius"></iron-icon>Temperatura:

          <iron-icon icon="mdi:water-percent"></iron-icon>Nível da água no aquário:

          <iron-icon icon="mdi:water-percent"></iron-icon>Nível da água no reservatório:

          <iron-icon icon="mdi:alarm"></iron-icon>Hora atual: <flip-clock></flip-clock>

            <paper-button raised>
              RELATÓRIO
            </paper-button>

      </paper-card>

  </template>

</dom-module>


text:
@interface ViewController ()

@property (nonatomic) bool isConnectedToService;

@end

@implementation ViewController

- (AJNTransportMask)transportType
{
    AJNTransportMask transportMask;
    switch (self.transportTypeSegmentedControl.selectedSegment) {
        case 0:
            transportMask = kAJNTransportMaskAny;
            break;

        default:
            break;
    }
    return transportMask;
}

- (void)setIsConnectedToService:(bool)isConnectedToService
{
    NSString *title = isConnectedToService ? @"Stop" : @"Start";
    [self.startButton setTitle:title];
    _isConnectedToService = isConnectedToService;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {

    }

    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [PingClient.sharedInstance setDelegate:self];
    }
    return self;
}

- (IBAction)didTouchStartButton:(id)sender
{
    if (!self.isConnectedToService) {
        [PingClient.sharedInstance connectToService:self.advertisedNameTextField.stringValue];
    }
    else {
        [PingClient.sharedInstance disconnect];
    }

    self.isConnectedToService = !self.isConnectedToService;
}

#pragma mark - PingClientDelegate implementation

- (void)didConnectWithService:(NSString *)serviceName
{
    [self receivedStatusMessage:[NSString stringWithFormat:@"Successfully connected with the service named %@", serviceName]];

    self.isConnectedToService = true;
}

- (void)shouldDisconnectFromService:(NSString *)serviceName
{
    [self receivedStatusMessage:[NSString stringWithFormat:@"Disconnected from the service named %@", serviceName]];

    if (self.isConnectedToService) {
        [PingClient.sharedInstance disconnect];
    }

    self.isConnectedToService = false;
}

- (void)receivedStatusMessage:(NSString *)message
{
    dispatch_async(dispatch_get_main_queue(), ^{
        NSMutableString *string = self.eventsTextView.string.length ? [self.eventsTextView.string mutableCopy] : [[NSMutableString alloc] init];
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        [formatter setTimeStyle:NSDateFormatterMediumStyle];
        [formatter setDateStyle:NSDateFormatterShortStyle];
        [string appendFormat:@"[%@] ",[formatter stringFromDate:[NSDate date]]];
        [string appendString:message];
        [string appendString:@"\r\n\r\n"];
        [self.eventsTextView setString:string];
        NSLog(@"%@",string);
    });
}

@end


text:
namespace Microsoft.Azure.Management.Synapse
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for IntegrationRuntimeStatusOperations.
    /// </summary>
    public static partial class IntegrationRuntimeStatusOperationsExtensions
    {
            /// <summary>
            /// Get integration runtime status
            /// </summary>
            /// <remarks>
            /// Get the integration runtime status
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group. The name is case insensitive.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace
            /// </param>
            /// <param name='integrationRuntimeName'>
            /// Integration runtime name
            /// </param>
            public static IntegrationRuntimeStatusResponse Get(this IIntegrationRuntimeStatusOperations operations, string resourceGroupName, string workspaceName, string integrationRuntimeName)
            {
                return operations.GetAsync(resourceGroupName, workspaceName, integrationRuntimeName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get integration runtime status
            /// </summary>
            /// <remarks>
            /// Get the integration runtime status
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group. The name is case insensitive.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace
            /// </param>
            /// <param name='integrationRuntimeName'>
            /// Integration runtime name
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IntegrationRuntimeStatusResponse> GetAsync(this IIntegrationRuntimeStatusOperations operations, string resourceGroupName, string workspaceName, string integrationRuntimeName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, integrationRuntimeName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
<!doctype html>

 <html class="no-js" <?php language_attributes(); ?> >

	<meta charset="<?php bloginfo('charset'); ?>">

	<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>

	<meta name="viewport" content="width=device-width" />

	<link rel="shortcut icon" type="image/png" href="<?php echo get_template_directory_uri(); ?>/favicon.png">
	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">

	<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-icon-ipad.png" />
	<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-icon-retina.png" />
	<link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-icon.png" />

	<meta name="apple-mobile-web-app-capable" content="yes" />
	<link rel="apple-touch-startup-image" href="<?php echo get_template_directory_uri(); ?>/mobile-load.png" />

	<link rel="apple-touch-startup-image" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-load-ipad-landscape.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" />

	<link rel="apple-touch-startup-image" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-load-ipad-portrait.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" />

	<link rel="apple-touch-startup-image" href="<?php echo get_template_directory_uri(); ?>/img/devices/reverie-load.png" media="screen and (max-device-width: 320px)" />

<?php wp_head(); ?>

<body <?php body_class('antialiased'); ?>>

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?>

Menu

	    <?php
	        wp_nav_menu( array(
	            'theme_location' => 'primary',
	            'container' => false,
	            'depth' => 0,
	            'items_wrap' => '
%3$s
',
	            'fallback_cb' => 'reverie_menu_fallback', // workaround to show a message to set up a menu
	            'walker' => new reverie_walker( array(
	                'in_top_bar' => true,
	                'item_type' => 'li',
	                'menu_type' => 'main-menu'
	            ) ),
	        ) );
	    ?>
	    <?php
	    	// Uncomment the following to enable the right menu (additional menu)

	    	/*
	        wp_nav_menu( array(
	            'theme_location' => 'additional',
	            'container' => false,
	            'depth' => 0,
	            'items_wrap' => '
%3$s
',
	            'walker' => new reverie_walker( array(
	                'in_top_bar' => true,
	                'item_type' => 'li',
	                'menu_type' => 'main-menu'
	            ) ),
	        ) );
	        */
	    ?>


text:
<?php

namespace Lexik\Bundle\FormFilterBundle\Tests\Fixtures\Filter;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;

/**
 * Form filter for tests.
 *
 * @author Cédric Girard <c.girard@lexik.fr>
 */
class OptionFilterType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('label', TextFilterType::class);
        $builder->add('rank', NumberFilterType::class);
    }

    public function getBlockPrefix()
    {
        return 'options_filter';
    }
}


text:
@extends('core::app.layout')

@section('content')

            @include('point-sales::app.sales.point.sales._breadcrumb')

Return

Create step 1

RETURN

        @include('point-sales::app.sales.point.sales.retur._menu')

                <form action="{{ url('sales/point/indirect/retur/create-step-1') }}" method="get"
                      class="form-horizontal">

                                <input type="text" name="date_from" class="form-control date input-datepicker"
                                       placeholder="From"
                                       value="{{\Input::get('date_from') ? \Input::get('date_from') : ''}}">

                                <input type="text" name="date_to" class="form-control date input-datepicker"
                                       placeholder="To"
                                       value="{{\Input::get('date_to') ? \Input::get('date_to') : ''}}">

                            <input type="text" name="search" class="form-control"
                                   placeholder="Search Form Number / Supplier..." value="{{\Input::get('search')}}"
                                   value="{{\Input::get('search') ? \Input::get('search') : ''}}">

                            <button type="submit" class="btn btn-effect-ripple btn-effect-ripple btn-primary"> Search
                            </button>

                </form>

                    {!! $list_invoice->render() !!}

                            Invoice
                            Customer
                            Items

                        @foreach($list_invoice as $invoice)

formulir_id}}">

                                    id) }}"
                                       class="btn btn-effect-ripple btn-xs btn-info">
                                        Return

                                {{ date_Format_view($invoice->formulir->form_date) }}
id) }}">{{ $invoice->formulir->form_number}}

                                    person_id) }}">{{ $invoice->person->codeName}}

                                    @foreach($invoice->items as $invoice_item)
                                        item_id)}}">{{$invoice_item->item->codeName}}

                                    @endforeach

                        @endforeach

                    {!! $list_invoice->render() !!}

@stop


text:
namespace refinery {

// The stack frame analyzer populates the process state with information
// about the contents of stack frames.
class StackFrameAnalyzer : public Analyzer {
 public:
  StackFrameAnalyzer();

  const char* name() const override { return kStackFrameAnalyzerName; }

  AnalysisResult Analyze(const minidump::Minidump& minidump,
                         const ProcessAnalysis& process_analysis) override;

  ANALYZER_INPUT_LAYERS(ProcessState::BytesLayer,
                        ProcessState::ModuleLayer,
                        ProcessState::StackFrameLayer)
  ANALYZER_OUTPUT_LAYERS(ProcessState::TypedBlockLayer)

 private:
  bool AnalyzeFrame(StackFrameRecordPtr frame_record,
                    const ProcessAnalysis& process_analysis);
  bool SetSymbolInformation(Address instruction_pointer,
                            const ProcessAnalysis& process_analysis);

  static const char kStackFrameAnalyzerName[];

  // Symbol information for the frame being processed.
  base::win::ScopedComPtr<IDiaSession> dia_session_;
  scoped_refptr<TypeNameIndex> typename_index_;

  DISALLOW_COPY_AND_ASSIGN(StackFrameAnalyzer);
};

}  // namespace refinery

#endif  // SYZYGY_REFINERY_ANALYZERS_STACK_FRAME_ANALYZER_H_


text:
require 'rubyserial'

class NumatoGPIO

  attr_accessor :device
  attr_accessor :io_map
  attr_accessor :mock
  attr_accessor :verbose

  def initialize(params={})
    {
      mock: false,
      verbose: false,
      io_map: {},
    }.merge(params).each { |k, v| send("#{k}=", v) }
    open_device
  end

  def open_device
    return if @mock
    unless @device
      devices = Dir.glob('/dev/tty.usbmodem*')
      raise "More than one device: #{devices.join(', ')}" if devices.length > 2
      @device = devices.first
    end
    @port = Serial.new(@device)
    warn "connected to device #{@device}" if @verbose
  end

  def version
    command('ver')
  end

  def id
    command('id get')
  end

  def id=(id)
    #FIXME
    raise
  end

  def set(x)
    command("gpio set #{gpio_str(io_id_to_num(x))}", false)
  end

  def clear(x)
    command("gpio clear #{gpio_str(io_id_to_num(x))}", false)
  end

  def read(x)
    status = command("gpio read #{gpio_str(io_id_to_num(x))}", true)
    case status
    when '1'
      true
    when '0'
      false
    else
      raise "Unknown status on read from IO #{x.inspect}: #{status.inspect}"
    end
  end

  private

  def command(cmd, wait_for_response=true)
    warn "* #{cmd}" if @verbose
    return if @mock
    @port.write("#{cmd}\r")
    @port.gets # echo
    if wait_for_response
      response = @port.gets.strip
      #FIXME
      # prompt = @port.gets
      # prompt.strip!
      # if prompt != '>'
      #   raise "Expected prompt, but got #{prompt.inspect}"
      # end
      response
    end
  end

  IONames = ('0'..'9').to_a + ('A'..'V').to_a.freeze

  def gpio_str(x)
    IONames[x] or raise "Can't convert GPIO number #{x.inspect} to string"
  end

  def io_id_to_num(x)
    case x
    when Numeric
      x
    when Symbol
      @io_map[x] or raise "No IO ID #{x.inspect}"
    else
      raise "Can't convert #{x.class} to IO: #{x.inspect}"
    end
  end

end

if $0 == __FILE__

  gpio = NumatoGPIO.new(mock: true)

  gpio.clear(0)
  gpio.clear(1)

  gpio.set(1)

  3.times do |i|
    puts i
    gpio.set(0)
    sleep 0.5
    gpio.clear(0)
    sleep 0.5
  end

  gpio.clear(1)

end


text:
<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm  */

$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
	'Login',
);
?>

		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'login-form',
			'enableClientValidation'=>true,
			'clientOptions'=>array(
				'validateOnSubmit'=>true,
			),
		    'htmlOptions'=>array(
		        'class'=>'log-page',
		        'style'=>'padding-bottom:45px;',
		    )
		)); ?>

Login

Los campos marcados con * son necesarios.

				<?php echo $form->labelEx($model,'username'); ?>

<?php echo $form->textField($model,'username'); ?>

				<?php echo $form->error($model,'username',array("class"=>"alert alert-error")); ?>

				<?php echo $form->labelEx($model,'password'); ?>

<?php echo $form->passwordField($model,'password'); ?>

				<?php echo $form->error($model,'password',array("class"=>"alert alert-error")); ?>

					Hint: You may login with demo/demo or admin/admin.

				<?php echo $form->checkBox($model,'rememberMe'); ?>
				<?php echo $form->label($model,'rememberMe'); ?>
				<?php echo $form->error($model,'rememberMe'); ?>

				<?php echo CHtml::submitButton('Login', array('class' => 'btn btn-primary pull-left')); ?>

				<?php echo CHtml::link('Registrate', $this->createAbsoluteUrl('users/create'), array('class'=>'btn btn-success pull-right')); ?>

		<?php $this->endWidget(); ?>


text:
require File.expand_path('../../spec_helper', __FILE__)

=begin
describe "``" do
  it "returns the output of the executed sub-process" do
    ip = 'world'
    `echo disc #{ip}`.should == "disc world\n"
  end
end

describe "%x" do
  it "is the same as ``" do
    ip = 'world'
    %x(echo disc #{ip}).should == "disc world\n"
  end
end
=end


text:
<?php

namespace PHPProm\Storage;

use \Doctrine\DBAL\Connection;

/**
 * Class DBAL
 * Storage implementation using Doctrine DBAL.
 * This way, MySQL and other databases are supported.
 * The used SQL is kept very simple so the queries should work
 * with most of the DBAL supported databases.
 *
 * A MySQL example of the expected table:
 * CREATE TABLE `phpprom` (
 *     `key` varchar(255) NOT NULL,
 *     `value` double NOT NULL,
 *     PRIMARY KEY (`key`)
 * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 * @package PHPProm\Storage
 *
 * A SQLite example of the expected table:
 * CREATE TABLE `phpprom` (
 *     `key`	TEXT NOT NULL UNIQUE,
 *     `value`	REAL NOT NULL,
 *     PRIMARY KEY(`key`)
 * );
 *
 * A PostgreSQL example of the expected table:
 * CREATE TABLE public.phpprom (
 *     key VARCHAR(255) PRIMARY KEY NOT NULL,
 *     value DOUBLE PRECISION NOT NULL
 * );
 * CREATE UNIQUE INDEX phpprom_key_uindex ON public.phpprom (key);
 */
class DBAL extends AbstractStorage {

    /**
     * @var Connection
     * The DBAL connection.
     */
    protected $connection;

    /**
     * @var string
     * The table to use.
     */
    protected $table;

    /**
     * @var \Doctrine\DBAL\Driver\Statement
     * The prepared statement to check whether there is already a value for a given key.
     */
    protected $statementKeyExists;

    /**
     * @var \Doctrine\DBAL\Driver\Statement
     * The prepared statement to insert a new key value pair.
     */
    protected $statementKeyInsert;

    /**
     * @var \Doctrine\DBAL\Driver\Statement
     * The prepared statement to update the value of an existing key.
     */
    protected $statementKeyUpdate;

    /**
     * @var \Doctrine\DBAL\Driver\Statement
     * The prepared statement to increment the value of the given key.
     */
    protected $statementKeyIncr;

    /**
     * @var string
     * the sign to use to quote identifiers in queries
     */
    protected $quote;

    /**
     * Builds the prepared statements.
     */
    protected function buildStatements() {
        $quote                    = $this->quote;
        $queryBuilder             = $this->connection->createQueryBuilder()
            ->select('COUNT('.$quote.'key'.$quote.') AS amount')->from($quote.$this->table.$quote)->where(''.$quote.'key'.$quote.' = ?');
        $this->statementKeyExists = $this->connection->prepare($queryBuilder->getSQL());

        $queryBuilder             = $this->connection->createQueryBuilder()
            ->insert($quote.$this->table.$quote)->setValue($quote.'value'.$quote, '?')->setValue(''.$quote.'key'.$quote.'', '?');
        $this->statementKeyInsert = $this->connection->prepare($queryBuilder->getSQL());

        $queryBuilder             = $this->connection->createQueryBuilder()
            ->update($quote.$this->table.$quote)->set($quote.'value'.$quote, '?')->where($quote.'key'.$quote.' = ?');
        $this->statementKeyUpdate = $this->connection->prepare($queryBuilder->getSQL());

        $queryBuilder           = $this->connection->createQueryBuilder()
            ->update($quote.$this->table.$quote)->set($quote.'value'.$quote, $quote.'value'.$quote.' + 1')->where($quote.'key'.$quote.' = ?');
        $this->statementKeyIncr = $this->connection->prepare($queryBuilder->getSQL());
    }

    /**
     * DBAL constructor.
     *
     * @param Connection $connection
     * the DBAL connection
     * @param string $table
     * the table to use
     */
    public function __construct(Connection $connection, $table = 'phpprom') {
        parent::__construct();
        $this->connection = $connection;
        $this->table      = $table;
        $this->quote      = $connection->getDatabasePlatform()->getIdentifierQuoteCharacter();
        $this->buildStatements();
    }

    /**
     * {@inheritdoc}
     */
    public function storeMeasurement($metric, $key, $value) {
        $prefixedKey = $metric.':'.$key;
        $this->statementKeyExists->bindValue(1, $prefixedKey);
        $this->statementKeyExists->execute();
        $exists         = $this->statementKeyExists->fetch(\PDO::FETCH_ASSOC);
        $statementStore = $exists['amount'] > 0 ? $this->statementKeyUpdate : $this->statementKeyInsert;
        $statementStore->bindValue(1, $value);
        $statementStore->bindValue(2, $prefixedKey);
        $statementStore->execute();
    }

    /**
     * {@inheritdoc}
     */
    public function incrementMeasurement($metric, $key) {
        $prefixedKey = $metric.':'.$key;
        $this->statementKeyExists->bindValue(1, $prefixedKey);
        $this->statementKeyExists->execute();
        $exists             = $this->statementKeyExists->fetch(\PDO::FETCH_ASSOC);
        $statementIncrement = $exists['amount'] > 0 ? $this->statementKeyIncr : $this->statementKeyInsert;
        if ($exists['amount'] > 0) {
            $statementIncrement->bindValue(1, $prefixedKey);
        } else {
            $statementIncrement->bindValue(1, 1);
            $statementIncrement->bindValue(2, $prefixedKey);
        }
        $statementIncrement->execute();
    }

    /**
     * {@inheritdoc}
     */
    public function getMeasurements($metric, array $keys, $defaultValue = 'Nan') {
        $prefixedKeys = array_map(function($key) use ($metric) {
            return $metric.':'.$key;
        }, $keys);
        $quote        = $this->quote;
        $queryBuilder = $this->connection->createQueryBuilder();
        $queryBuilder
            ->select($quote.'key'.$quote, $quote.'value'.$quote)
            ->from($quote.$this->table.$quote)
            ->where($quote.'key'.$quote.' IN (?)')
            ->setParameter(1, $prefixedKeys, Connection::PARAM_STR_ARRAY)
        ;
        $measurements = [];
        foreach ($keys as $key) {
            $measurements[$key] = $defaultValue;
        }
        $rows = $queryBuilder->execute()->fetchAll(\PDO::FETCH_ASSOC);
        foreach ($rows as $row) {
            $unprefixedKey                = substr($row['key'], strlen($metric) + 1);
            $measurements[$unprefixedKey] = (float)$row['value'];
        }
        return $measurements;
    }
}


text:
	<title>..::AMRadioLIVE::..</title>

	<meta name="Description" content="AMRadioLIVE is the Leader in Online Showcasing">
	<meta name="Keywords" content="AMRadioLIVE, amradio, am radio live, texas, music, promotion, hip hop, rap">
	<meta name="Copyright" content="AMRadioLIVE">
	<meta name="Language" content="English">

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

Music Submissions

Are you looking for an exciting career in business? At AMR and #GEEKGANG Online, we have a clear vision: to be the place where a diverse mix of talented people want to come, to stay and do their best work. We pride ourselves on bringing the best entertainment to our audiences around the world, and we know our company runs on the hard work and dedication of our passionate and creative employees.

Here at AMR and #Geekgang Online we believe in the power of people... And the power of people with the same goal in mind is an extremely powerful tool.

	<form method="POST" action="uploadsubmit.php" name="submissions" enctype="multipart/form-data">
		<fieldset>
			<legend>
Single Submission
</legend>
		Twitter:
<input type="text" name="twittername" value="@"required >

		Track Name:
<input type="text" name="trackname" value=""required>

		Email:
<input type="text" name="email"required>

		<input type="file" name="file" id="file">
		<input type="submit" name="submit" value="Upload Submission">
		</fieldset>
	</form>

+ Single(s) Promotion

AMRadioLIVE Artist Account

24/7 Radio Placement

Interviews

Artist Webpage

Dashboard for booking interviews and features

60 Minute Mixtape Radio Showcase

Tour/Event Booking (If available in your region)

Mixtape Placement Opportunities

					There is a $35 monthly fee to create your account. Your music will be available on AMRadioLIVE's broadcast shortly after finishing your registration. Your Radio Feature dates and times for when you will be scheduled to be on the air will be found on your Dashboard immediately after creating your account.

Create an account


text:
unless defined?(BasicObject)
  require 'blankslate'
  BasicObject = BlankSlate
end

# = BasicStruct
#
# BasicStruct is very similar to Ruby's own OpenStruct, but it offers some
# advantages. With OpenStruct, slots with the same name as predefined
# Object methods cannot be used. With BasicStruct, almost any slot can be
# defined. BasicStruct is a subclass of BasicObject to ensure all method
# slots, except those that are absolutely essential, are open for use.
#
#--
# If you wish to pass a BasicStruct to a routine that normal takes a Hash,
# but are uncertain it can handle the distictions properly you can convert
# easily to a Hash using #as_hash! and the result will automatically be
# converted back to an BasicStruct on return.
#
#   o = BasicStruct.new(:a=>1,:b=>2)
#   o.as_hash!{ |h| h.update(:a=>6) }
#   o #=> #<BasicObject {:a=>6,:b=>2}>
#++
#
# Unlike a Hash, all BasicStruct's keys are symbols and all keys are converted
# to such using #to_sym on the fly.

class BasicStruct < BasicObject

  def self.[](hash=nil)
    new(hash)
  end

  # Inititalizer for BasicStruct is slightly different than that of Hash.
  # It does not take a default parameter, but an initial priming Hash,
  # like OpenStruct. The initializer can still take a default block
  # however. To set the default value use <code>#default!(value)</code>.
  #
  #   BasicStruct.new(:a=>1).default!(0)
  #
  def initialize(hash=nil, &yld)
    super(&yld)
    if hash
      hash.each{ |k,v| store(k,v) }
    end
  end

  #
  def initialize_copy(orig)
    orig.each{ |k,v| store(k,v) }
  end

  # Object inspection.
  # TODO: Need to get __class__ and __id__ in hex form.
  def inspect
    #@table.inspect
    hexid = __id__
    klass = "BasicStruct" # __class__
    "#<#{klass}:#{hexid} #{@table.inspect}>"
  end

  # Convert to an associative array.
  def to_a
    super
  end

  #
  def to_hash
    h = {}
    each do |k,v|
      h[k] = v
    end
    h
  end

  #
  alias_method :to_h, :to_hash

  #
  def to_basicstruct
    self
  end

  # Convert to an assignment procedure.
  def to_proc(response=false)
    hash = self #@table
    if response
      ::Proc.new do |o|
        hash.each do |k,v|
          o.__send__("#{k}=", v) rescue nil
        end
      end
    else
      ::Proc.new do |o|
        hash.each{ |k,v| o.__send__("#{k}=", v) }
      end
    end
  end

  # NOT SURE ABOUT THIS
  #def as_hash
  #  @table
  #end

  # Is a given +key+ defined?
  def key?(key)
    super(key.to_sym)
  end

  #
  def is_a?(klass)
    return true if klass == ::Hash  # TODO: Is this wise? How to fake a subclass?
    return true if klass == ::BasicStruct
    false
  end

  # Iterate over each key-value pair.
  def each(&yld)
    super(&yld)
  end

  # Set the default value.
  def default=(default)
    #@table.default = default
    super(default)
  end

  # Check equality.
  def ==( other )
    case other
    when ::BasicStruct
      to_hash == other.to_hash  # as_hash
    when ::Hash
      to_hash == other
    else
      if other.respond_to?(:to_hash)
        to_hash == other.to_hash
      else
        false
      end
    end
  end

  #
  def eql?( other )
    case other
    when ::BasicStruct
      super(other.to_hash)  # other.as_hash
    else
      false
    end
  end

  #
  def <<(x)
    case x
    when ::Hash
      self.update(x)
    when ::Array
      x.each_slice(2) do |(k,v)|
        self[k] = v
      end
    end
  end

  #
  def []=(key, value)
    super(key.to_sym, value)
  end

  #
  def [](key)
    super(key.to_sym)
  end

  # TODO: Should this work like #merge or #update ?
  def merge!(other)
    ::BasicStruct.new(to_hash.merge(other))
  end

  #
  def update!(other)
    self.update(other)
    self
  end

  #
  def respond_to?(key)
    key?(key)
  end

  # NOTE: These were protected, why?

  #
  def store(k, v)
    super(k.to_sym, v)
  end

  #
  def fetch(k, *d, &b)
    super(k.to_sym, *d, &b)
  end

  protected

    #def as_hash!
    #  Functor.new do |op,*a,&b|
    #    result = @table.__send__(op,*a,&b)
    #    case result
    #    when Hash
    #      BasicObject.new(result)
    #    else
    #      result
    #    end
    #  end
    #end

    #def define_slot(key, value=nil)
    #  @table[key.to_sym] = value
    #end

    #def protect_slot( key )
    #  (class << self; self; end).class_eval {
    #    protected key rescue nil
    # }
    #end

    def method_missing(sym, *args, &blk)
      type = sym.to_s[-1,1]
      key  = sym.to_s.sub(/[=?!]$/,'').to_sym
      case type
      when '='
        store(key, args[0])
      when '!'
        __send__(key, *args, &blk)
      #  if key?(key)
      #    fetch(key)
      #  else
      #    store(key, BasicObject.new)
      #  end
      when '?'
        fetch(key)
      else
        fetch(key)
      end
    end

end

# Core Extensions

class Hash
  # Convert a Hash into a BasicStruct.
  def to_basicstruct
    BasicStruct[self]
  end
end

=begin
class NilClass
  # Nil converts to an empty BasicObject.
  def to_basicstruct
    BasicObject.new
  end
end

class Proc
  # Translates a Proc into an BasicObject. By droping an BasicObject into
  # the Proc, the resulting assignments incured as the procedure is
  # evaluated produce the BasicObject. This technique is simlar to that
  # of MethodProbe.
  #
  #   p = lambda { |x|
  #     x.word = "Hello"
  #   }
  #   o = p.to_basicstruct
  #   o.word #=> "Hello"
  #
  # NOTE The Proc must have an arity of one --no more and no less.
  def to_basicstruct
    raise ArgumentError, 'bad arity for converting Proc to basicstruct' if arity != 1
    o = BasicObject.new
    self.call( o )
    o
  end
end
=end


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var _utils = require("./utils");

var _utils2 = _interopRequireDefault(_utils);

var _reactPrefixer = require("react-prefixer");

var _reactPrefixer2 = _interopRequireDefault(_reactPrefixer);

exports["default"] = function () {
    var obj = {};

    _utils2["default"].forEach(arguments, function (argument, i) {
        obj = _utils2["default"].merge(obj, (0, _reactPrefixer2["default"])(argument));
    });

    return obj;
};

module.exports = exports["default"];


text:
import { QuickPickItem, window, QuickPick, QuickPickItemKind } from 'vscode';
import * as nls from 'vscode-nls';
import { RemoteSourceProvider, RemoteSource, PickRemoteSourceOptions, PickRemoteSourceResult } from './api/git-base';
import { Model } from './model';
import { throttle, debounce } from './decorators';

const localize = nls.loadMessageBundle();

async function getQuickPickResult<T extends QuickPickItem>(quickpick: QuickPick<T>): Promise<T | undefined> {
	const result = await new Promise<T | undefined>(c => {
		quickpick.onDidAccept(() => c(quickpick.selectedItems[0]));
		quickpick.onDidHide(() => c(undefined));
		quickpick.show();
	});

	quickpick.hide();
	return result;
}

class RemoteSourceProviderQuickPick {

	private quickpick: QuickPick<QuickPickItem & { remoteSource?: RemoteSource }> | undefined;

	constructor(private provider: RemoteSourceProvider) { }

	private ensureQuickPick() {
		if (!this.quickpick) {
			this.quickpick = window.createQuickPick();
			this.quickpick.ignoreFocusOut = true;
			if (this.provider.supportsQuery) {
				this.quickpick.placeholder = this.provider.placeholder ?? localize('type to search', "Repository name (type to search)");
				this.quickpick.onDidChangeValue(this.onDidChangeValue, this);
			} else {
				this.quickpick.placeholder = this.provider.placeholder ?? localize('type to filter', "Repository name");
			}
		}
	}

	@debounce(300)
	private onDidChangeValue(): void {
		this.query();
	}

	@throttle
	private async query(): Promise<void> {
		try {
			this.ensureQuickPick();
			this.quickpick!.busy = true;
			this.quickpick!.show();

			const remoteSources = await this.provider.getRemoteSources(this.quickpick?.value) || [];

			if (remoteSources.length === 0) {
				this.quickpick!.items = [{
					label: localize('none found', "No remote repositories found."),
					alwaysShow: true
				}];
			} else {
				this.quickpick!.items = remoteSources.map(remoteSource => ({
					label: remoteSource.icon ? `$(${remoteSource.icon}) ${remoteSource.name}` : remoteSource.name,
					description: remoteSource.description || (typeof remoteSource.url === 'string' ? remoteSource.url : remoteSource.url[0]),
					detail: remoteSource.detail,
					remoteSource,
					alwaysShow: true
				}));
			}
		} catch (err) {
			this.quickpick!.items = [{ label: localize('error', "{0} Error: {1}", '$(error)', err.message), alwaysShow: true }];
			console.error(err);
		} finally {
			this.quickpick!.busy = false;
		}
	}

	async pick(): Promise<RemoteSource | undefined> {
		await this.query();
		const result = await getQuickPickResult(this.quickpick!);
		return result?.remoteSource;
	}
}

export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch?: false | undefined }): Promise<string | undefined>;
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch: true }): Promise<PickRemoteSourceResult | undefined>;
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | PickRemoteSourceResult | undefined> {
	const quickpick = window.createQuickPick<(QuickPickItem & { provider?: RemoteSourceProvider; url?: string })>();
	quickpick.ignoreFocusOut = true;
	quickpick.title = options.title;

	if (options.providerName) {
		const provider = model.getRemoteProviders()
			.filter(provider => provider.name === options.providerName)[0];

		if (provider) {
			return await pickProviderSource(provider, options);
		}
	}

	const remoteProviders = model.getRemoteProviders()
		.map(provider => ({ label: (provider.icon ? `$(${provider.icon}) ` : '') + (options.providerLabel ? options.providerLabel(provider) : provider.name), alwaysShow: true, provider }));

	const recentSources: (QuickPickItem & { url?: string; timestamp: number })[] = [];
	if (options.showRecentSources) {
		for (const { provider } of remoteProviders) {
			const sources = (await provider.getRecentRemoteSources?.() ?? []).map((item) => {
				return {
					...item,
					label: (item.icon ? `$(${item.icon}) ` : '') + item.name,
					url: typeof item.url === 'string' ? item.url : item.url[0],
				};
			});
			recentSources.push(...sources);
		}
	}

	const items = [
		{ kind: QuickPickItemKind.Separator, label: localize('remote sources', 'remote sources') },
		...remoteProviders,
		{ kind: QuickPickItemKind.Separator, label: localize('recently opened', 'recently opened') },
		...recentSources.sort((a, b) => b.timestamp - a.timestamp)
	];

	quickpick.placeholder = options.placeholder ?? (remoteProviders.length === 0
		? localize('provide url', "Provide repository URL")
		: localize('provide url or pick', "Provide repository URL or pick a repository source."));

	const updatePicks = (value?: string) => {
		if (value) {
			const label = (typeof options.urlLabel === 'string' ? options.urlLabel : options.urlLabel?.(value)) ?? localize('url', "URL");
			quickpick.items = [{
				label: label,
				description: value,
				alwaysShow: true,
				url: value
			},
			...items
			];
		} else {
			quickpick.items = items;
		}
	};

	quickpick.onDidChangeValue(updatePicks);
	updatePicks();

	const result = await getQuickPickResult(quickpick);

	if (result) {
		if (result.url) {
			return result.url;
		} else if (result.provider) {
			return await pickProviderSource(result.provider, options);
		}
	}

	return undefined;
}

async function pickProviderSource(provider: RemoteSourceProvider, options: PickRemoteSourceOptions = {}): Promise<string | PickRemoteSourceResult | undefined> {
	const quickpick = new RemoteSourceProviderQuickPick(provider);
	const remote = await quickpick.pick();

	let url: string | undefined;

	if (remote) {
		if (typeof remote.url === 'string') {
			url = remote.url;
		} else if (remote.url.length > 0) {
			url = await window.showQuickPick(remote.url, { ignoreFocusOut: true, placeHolder: localize('pick url', "Choose a URL to clone from.") });
		}
	}

	if (!url || !options.branch) {
		return url;
	}

	if (!provider.getBranches) {
		return { url };
	}

	const branches = await provider.getBranches(url);

	if (!branches) {
		return { url };
	}

	const branch = await window.showQuickPick(branches, {
		placeHolder: localize('branch name', "Branch name")
	});

	if (!branch) {
		return { url };
	}

	return { url, branch };
}


text:
package com.intellij.remoteServer.impl.runtime.deployment;

import com.intellij.remoteServer.runtime.Deployment;
import com.intellij.remoteServer.runtime.deployment.DeploymentRuntime;
import com.intellij.remoteServer.runtime.deployment.DeploymentStatus;
import com.intellij.remoteServer.runtime.deployment.DeploymentTask;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author nik
 */
public class DeploymentImpl implements Deployment {
  private final String myName;
  private final DeploymentTask<?> myDeploymentTask;
  private volatile DeploymentState myState;

  public DeploymentImpl(@NotNull String name, @NotNull DeploymentStatus status, @Nullable String statusText,
                        @Nullable DeploymentRuntime runtime, @Nullable DeploymentTask<?> deploymentTask) {
    myName = name;
    myDeploymentTask = deploymentTask;
    myState = new DeploymentState(status, statusText, runtime);
  }

  @NotNull
  public String getName() {
    return myName;
  }

  @Override
  @NotNull
  public DeploymentStatus getStatus() {
    return myState.getStatus();
  }

  @NotNull
  public String getStatusText() {
    String statusText = myState.getStatusText();
    return statusText != null ? statusText : getStatus().getPresentableText();
  }

  public DeploymentRuntime getRuntime() {
    return myState.getRuntime();
  }

  @Nullable
  @Override
  public DeploymentTask<?> getDeploymentTask() {
    return myDeploymentTask;
  }

  public boolean changeState(@NotNull DeploymentStatus oldStatus, @NotNull DeploymentStatus newStatus, @Nullable String statusText,
                             @Nullable DeploymentRuntime runtime) {
    if (myState.getStatus() == oldStatus) {
      myState = new DeploymentState(newStatus, statusText, runtime);
      return true;
    }
    return false;
  }

  private static class DeploymentState {
    private final DeploymentStatus myStatus;
    private final String myStatusText;
    private final DeploymentRuntime myRuntime;

    private DeploymentState(@NotNull DeploymentStatus status, @Nullable String statusText, @Nullable DeploymentRuntime runtime) {
      myStatus = status;
      myStatusText = statusText;
      myRuntime = runtime;
    }

    @NotNull
    public DeploymentStatus getStatus() {
      return myStatus;
    }

    @Nullable
    public String getStatusText() {
      return myStatusText;
    }

    @Nullable
    public DeploymentRuntime getRuntime() {
      return myRuntime;
    }
  }
}


text:
package me.jonathing.minecraft.foragecraft.common.capability.base;

import me.jonathing.minecraft.foragecraft.common.capability.util.IPersistentCapability;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.common.util.INBTSerializable;

import javax.annotation.Nonnull;

public interface IForageChunk extends IPersistentCapability<IForageChunk>
{
    void forage();

    int getTimesForaged();

    void setTimesForaged(int timesForaged);
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title>huthesh.github.io</title>

        <link rel="stylesheet" href="{{ '/assets/css/print.css' | relative_url }}" media="print" type="text/css">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

        <link rel="stylesheet" href="{{ '/assets/css/style3.css?v=' | append: site.github.build_revision | relative_url }}" media="screen" type="text/css">

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css">
        <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css" />
        <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css" />

                    huthesh.github.io
                    <button class="navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                        Menu

                    </button>

About

            {{ content }}


text:
program t
100 format (a)
  200 assign 100 to i
  print i,'hello'
end program t


text:
<?php

namespace Sylius\Component\Payment\Calculator;

use Sylius\Component\Payment\Model\PaymentSubjectInterface;

/**
 * @author Mateusz Zalewski <mateusz.p.zalewski@gmail.com>
 */
interface DelegatingFeeCalculatorInterface
{
    /**
     * @param PaymentSubjectInterface $payment
     *
     * @return int
     */
    public function calculate(PaymentSubjectInterface $payment);
}


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

<title>Text</title>
<meta name="date" content="2016-06-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.canova.api.io.data

Class Text

java.lang.Object

org.canova.api.io.BinaryComparable

org.canova.api.io.data.Text

All Implemented Interfaces:

java.io.Serializable, java.lang.Comparable<BinaryComparable>, WritableComparable<BinaryComparable>, Writable

public class Text
extends BinaryComparable
implements WritableComparable<BinaryComparable>

This class stores text using standard UTF8 encoding.  It provides methods
 to serialize, deserialize, and compare texts at byte level.  The type of
 length is integer and is serialized using zero-compressed format.
In
 addition, it provides methods for string traversal without converting the
 byte array to a string.
Also includes utilities for
 serializing/deserialing a string, coding/decoding a string, checking if a
 byte array contains valid UTF8 code, calculating the length of an encoded
 string.

See Also:

Serialized Form

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
Text.Comparator

A WritableComparator optimized for Text keys.

Constructor Summary

Constructors

Constructor and Description

Text()

Text(byte[] utf8)

Construct from a byte array.

Text(java.lang.String string)

Construct from a string.

Text(Text utf8)

Construct from another text.

Method Summary

Methods

Modifier and Type
Method and Description

void
append(byte[] utf8,
      int start,
      int len)

Append a range of bytes to the end of the given text

static int
bytesToCodePoint(java.nio.ByteBuffer bytes)

Returns the next code point at the current position in
 the buffer.

int
charAt(int position)

Returns the Unicode Scalar Value (32-bit integer value)
 for the character at position.

void
clear()

Clear the string to empty.

static java.lang.String
decode(byte[] utf8)

Converts the provided byte array to a String using the
 UTF-8 encoding.

static java.lang.String
decode(byte[] utf8,
      int start,
      int length)

static java.lang.String
decode(byte[] utf8,
      int start,
      int length,
      boolean replace)

Converts the provided byte array to a String using the
 UTF-8 encoding.

static java.nio.ByteBuffer
encode(java.lang.String string)

Converts the provided String to bytes using the
 UTF-8 encoding.

static java.nio.ByteBuffer
encode(java.lang.String string,
      boolean replace)

Converts the provided String to bytes using the
 UTF-8 encoding.

boolean
equals(java.lang.Object o)

Returns true iff o is a Text with the same contents.

int
find(java.lang.String what)

int
find(java.lang.String what,
    int start)

Finds any occurence of what in the backing
 buffer, starting as position start.

byte[]
getBytes()

Returns the raw bytes; however, only data up to getLength() is
 valid.

int
getLength()

Returns the number of bytes in the byte array

int
hashCode()

Return a hash of the bytes returned from {#getBytes()}.

void
readFields(java.io.DataInput in)

deserialize

static java.lang.String
readString(java.io.DataInput in)

Read a UTF8 encoded string from in

void
set(byte[] utf8)

Set to a utf8 byte array

void
set(byte[] utf8,
   int start,
   int len)

Set the Text to range of bytes

void
set(java.lang.String string)

Set to contain the contents of a string.

void
set(Text other)

copy a text.

static void
skip(java.io.DataInput in)

Skips over one Text in the input.

double
toDouble()

Convert Writable to double.

float
toFloat()

Convert Writable to float.

int
toInt()

Convert Writable to int.

long
toLong()

Convert Writable to long.

java.lang.String
toString()

Convert text back to string

static int
utf8Length(java.lang.String string)

For the given string, returns the number of UTF-8 bytes
 required to encode the string.

static void
validateUTF8(byte[] utf8)

Check if a byte array contains valid utf-8

static void
validateUTF8(byte[] utf8,
            int start,
            int len)

Check to see if a byte array is valid utf-8

void
write(java.io.DataOutput out)

serialize
 write this object to out
 length uses zero-compressed encoding

static int
writeString(java.io.DataOutput out,
           java.lang.String s)

Write a UTF8 encoded string to out

Methods inherited from class org.canova.api.io.BinaryComparable

compareTo, compareTo

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.lang.Comparable

compareTo

Constructor Detail

Text

public Text()

Text

public Text(java.lang.String string)

Construct from a string.

Text

public Text(Text utf8)

Construct from another text.

Text

public Text(byte[] utf8)

Construct from a byte array.

Method Detail

getBytes

public byte[] getBytes()

Returns the raw bytes; however, only data up to getLength() is
 valid.

Specified by:

getBytes in class BinaryComparable

getLength

public int getLength()

Returns the number of bytes in the byte array

Specified by:

getLength in class BinaryComparable

charAt

public int charAt(int position)

Returns the Unicode Scalar Value (32-bit integer value)
 for the character at position. Note that this
 method avoids using the converter or doing String instatiation

Returns:

the Unicode scalar value at position or -1
          if the position is invalid or points to a
          trailing byte

find

public int find(java.lang.String what)

find

public int find(java.lang.String what,
       int start)

Finds any occurence of what in the backing
 buffer, starting as position start. The starting
 position is measured in bytes and the return value is in
 terms of byte position in the buffer. The backing buffer is
 not converted to a string for this operation.

Returns:

byte position of the first occurence of the search
         string in the UTF-8 buffer or -1 if not found

set

public void set(java.lang.String string)

Set to contain the contents of a string.

set

public void set(byte[] utf8)

Set to a utf8 byte array

set

public void set(Text other)

copy a text.

set

public void set(byte[] utf8,
       int start,
       int len)

Set the Text to range of bytes

Parameters:

utf8 - the data to copy from

start - the first position of the new string

len - the number of bytes of the new string

append

public void append(byte[] utf8,
          int start,
          int len)

Append a range of bytes to the end of the given text

Parameters:

utf8 - the data to copy from

start - the first position to append from utf8

len - the number of bytes to append

clear

public void clear()

Clear the string to empty.

toString

public java.lang.String toString()

Convert text back to string

Overrides:

toString in class java.lang.Object

See Also:

Object.toString()

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException

deserialize

Specified by:

readFields in interface Writable

Parameters:

in - DataInput to deseriablize this object from.

Throws:

java.io.IOException

skip

public static void skip(java.io.DataInput in)
                 throws java.io.IOException

Skips over one Text in the input.

Throws:

java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException

serialize
 write this object to out
 length uses zero-compressed encoding

Specified by:

write in interface Writable

Parameters:

out - DataOuput to serialize this object into.

Throws:

java.io.IOException

See Also:

Writable.write(DataOutput)

equals

public boolean equals(java.lang.Object o)

Returns true iff o is a Text with the same contents.

Overrides:

equals in class BinaryComparable

hashCode

public int hashCode()

Description copied from class: BinaryComparable

Return a hash of the bytes returned from {#getBytes()}.

Overrides:

hashCode in class BinaryComparable

See Also:

WritableComparator.hashBytes(byte[],int)

decode

public static java.lang.String decode(byte[] utf8)
                               throws java.nio.charset.CharacterCodingException

Converts the provided byte array to a String using the
 UTF-8 encoding. If the input is malformed,
 replace by a default value.

Throws:

java.nio.charset.CharacterCodingException

decode

public static java.lang.String decode(byte[] utf8,
                      int start,
                      int length)
                               throws java.nio.charset.CharacterCodingException

Throws:

java.nio.charset.CharacterCodingException

decode

public static java.lang.String decode(byte[] utf8,
                      int start,
                      int length,
                      boolean replace)
                               throws java.nio.charset.CharacterCodingException

Converts the provided byte array to a String using the
 UTF-8 encoding. If replace is true, then
 malformed input is replaced with the
 substitution character, which is U+FFFD. Otherwise the
 method throws a MalformedInputException.

Throws:

java.nio.charset.CharacterCodingException

encode

public static java.nio.ByteBuffer encode(java.lang.String string)
                                  throws java.nio.charset.CharacterCodingException

Converts the provided String to bytes using the
 UTF-8 encoding. If the input is malformed,
 invalid chars are replaced by a default value.

Returns:

ByteBuffer: bytes stores at ByteBuffer.array()
                     and length is ByteBuffer.limit()

Throws:

java.nio.charset.CharacterCodingException

encode

public static java.nio.ByteBuffer encode(java.lang.String string,
                         boolean replace)
                                  throws java.nio.charset.CharacterCodingException

Converts the provided String to bytes using the
 UTF-8 encoding. If replace is true, then
 malformed input is replaced with the
 substitution character, which is U+FFFD. Otherwise the
 method throws a MalformedInputException.

Returns:

ByteBuffer: bytes stores at ByteBuffer.array()
                     and length is ByteBuffer.limit()

Throws:

java.nio.charset.CharacterCodingException

readString

public static java.lang.String readString(java.io.DataInput in)
                                   throws java.io.IOException

Read a UTF8 encoded string from in

Throws:

java.io.IOException

writeString

public static int writeString(java.io.DataOutput out,
              java.lang.String s)
                       throws java.io.IOException

Write a UTF8 encoded string to out

Throws:

java.io.IOException

validateUTF8

public static void validateUTF8(byte[] utf8)
                         throws java.nio.charset.MalformedInputException

Check if a byte array contains valid utf-8

Parameters:

utf8 - byte array

Throws:

java.nio.charset.MalformedInputException - if the byte array contains invalid utf-8

validateUTF8

public static void validateUTF8(byte[] utf8,
                int start,
                int len)
                         throws java.nio.charset.MalformedInputException

Check to see if a byte array is valid utf-8

Parameters:

utf8 - the array of bytes

start - the offset of the first byte in the array

len - the length of the byte sequence

Throws:

java.nio.charset.MalformedInputException - if the byte array contains invalid bytes

bytesToCodePoint

public static int bytesToCodePoint(java.nio.ByteBuffer bytes)

Returns the next code point at the current position in
 the buffer. The buffer's position will be incremented.
 Any mark set on this buffer will be changed by this method!

utf8Length

public static int utf8Length(java.lang.String string)

For the given string, returns the number of UTF-8 bytes
 required to encode the string.

Parameters:

string - text to encode

Returns:

number of UTF-8 bytes required to encode

toDouble

public double toDouble()

Description copied from interface: Writable

Convert Writable to double. Whether this is supported depends on the specific writable.

Specified by:

toDouble in interface Writable

toFloat

public float toFloat()

Description copied from interface: Writable

Convert Writable to float. Whether this is supported depends on the specific writable.

Specified by:

toFloat in interface Writable

toInt

public int toInt()

Description copied from interface: Writable

Convert Writable to int. Whether this is supported depends on the specific writable.

Specified by:

toInt in interface Writable

toLong

public long toLong()

Description copied from interface: Writable

Convert Writable to long. Whether this is supported depends on the specific writable.

Specified by:

toLong in interface Writable

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
require 'kaminari/sinatra'
require 'rack/test'
require 'sinatra/test_helpers'
require 'capybara/dsl'
require 'capybara/rspec'

require 'fake_app/sinatra_app'

Capybara.app = SinatraApp

module HelperMethodForHelperSpec
  module FakeEnv
    def env
      {'PATH_INFO' => '/'}
    end
  end

  def helper
    # OMG terrible object...
    Kaminari::Helpers::SinatraHelpers::ActionViewTemplateProxy.new(:current_params => {}, :current_path => '/', :param_name => Kaminari.config.param_name).extend(Padrino::Helpers, Kaminari::ActionViewExtension, Kaminari::Helpers::SinatraHelpers::HelperMethods, FakeEnv)
  end
end

RSpec.configure do |config|
  config.include Rack::Test::Methods
  config.include Sinatra::TestHelpers
  config.include Capybara::DSL
  config.include HelperMethodForHelperSpec
#   config.include HelperMethodForHelperSpec, :type => :helper
end

require 'nokogiri'
def last_document
  Nokogiri::HTML(last_response.body)
end


text:
package test

import (
	"github.com/hashicorp/terraform/helper/schema"
	"github.com/hashicorp/terraform/terraform"
)

func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			// Optional attribute to label a particular instance for a test
			// that has multiple instances of this provider, so that they
			// can be distinguished using the test_provider_label data source.
			"label": {
				Type:     schema.TypeString,
				Optional: true,
			},
		},
		ResourcesMap: map[string]*schema.Resource{
			"test_resource":         testResource(),
			"test_resource_gh12183": testResourceGH12183(),
		},
		DataSourcesMap: map[string]*schema.Resource{
			"test_data_source":    testDataSource(),
			"test_provider_label": providerLabelDataSource(),
		},
		ConfigureFunc: providerConfigure,
	}
}

func providerConfigure(d *schema.ResourceData) (interface{}, error) {
	return d.Get("label"), nil
}


text:
/**
 * Prevent circular dependencies.
 */

import './document'

/**
 * Dependencies.
 */

import isPlainObject from 'is-plain-object'
import { List, Map, Record } from 'immutable'

import MODEL_TYPES from '../constants/model-types'
import Node from './node'
import generateKey from '../utils/generate-key'

/**
 * Default properties.
 *
 * @type {Object}
 */

const DEFAULTS = {
  data: new Map(),
  isVoid: false,
  key: undefined,
  nodes: new List(),
  type: undefined,
}

/**
 * Block.
 *
 * @type {Block}
 */

class Block extends Record(DEFAULTS) {

  /**
   * Create a new `Block` from `value`.
   *
   * @param {Object|String|Block} value
   * @return {Block}
   */

  static create(value = {}) {
    if (Block.isBlock(value)) {
      return value
    }

    if (typeof value == 'string') {
      value = { type: value }
    }

    if (isPlainObject(value)) {
      return Block.fromJSON(value)
    }

    throw new Error(`\`Block.create\` only accepts objects, strings or blocks, but you passed it: ${value}`)
  }

  /**
   * Create a list of `Blocks` from `value`.
   *
   * @param {Array<Block|Object>|List<Block|Object>} value
   * @return {List<Block>}
   */

  static createList(value = []) {
    if (List.isList(value) || Array.isArray(value)) {
      const list = new List(value.map(Block.create))
      return list
    }

    throw new Error(`\`Block.createList\` only accepts arrays or lists, but you passed it: ${value}`)
  }

  /**
   * Create a `Block` from a JSON `object`.
   *
   * @param {Object|Block} object
   * @return {Block}
   */

  static fromJSON(object) {
    if (Block.isBlock(object)) {
      return object
    }

    const {
      data = {},
      isVoid = false,
      key = generateKey(),
      nodes = [],
      type,
    } = object

    if (typeof type != 'string') {
      throw new Error('`Block.fromJSON` requires a `type` string.')
    }

    const block = new Block({
      key,
      type,
      isVoid: !!isVoid,
      data: new Map(data),
      nodes: new List(nodes.map(Node.fromJSON)),
    })

    return block
  }

  /**
   * Alias `fromJS`.
   */

  static fromJS = Block.fromJSON

  /**
   * Check if a `value` is a `Block`.
   *
   * @param {Any} value
   * @return {Boolean}
   */

  static isBlock(value) {
    return !!(value && value[MODEL_TYPES.BLOCK])
  }

  /**
   * Check if a `value` is a block list.
   *
   * @param {Any} value
   * @return {Boolean}
   */

  static isBlockList(value) {
    return List.isList(value) && value.every(item => Block.isBlock(item))
  }

  /**
   * Get the node's kind.
   *
   * @return {String}
   */

  get kind() {
    return 'block'
  }

  /**
   * Check if the block is empty.
   *
   * @return {Boolean}
   */

  get isEmpty() {
    return this.text == ''
  }

  /**
   * Get the concatenated text of all the block's children.
   *
   * @return {String}
   */

  get text() {
    return this.getText()
  }

  /**
   * Return a JSON representation of the block.
   *
   * @param {Object} options
   * @return {Object}
   */

  toJSON(options = {}) {
    const object = {
      data: this.data.toJSON(),
      key: this.key,
      kind: this.kind,
      isVoid: this.isVoid,
      type: this.type,
      nodes: this.nodes.toArray().map(n => n.toJSON(options)),
    }

    if (!options.preserveKeys) {
      delete object.key
    }

    return object
  }

  /**
   * Alias `toJS`.
   */

  toJS(options) {
    return this.toJSON(options)
  }

}

/**
 * Attach a pseudo-symbol for type checking.
 */

Block.prototype[MODEL_TYPES.BLOCK] = true

/**
 * Mix in `Node` methods.
 */

Object.getOwnPropertyNames(Node.prototype).forEach((method) => {
  if (method == 'constructor') return
  Block.prototype[method] = Node.prototype[method]
})

/**
 * Export.
 *
 * @type {Block}
 */

export default Block


text:
set -eux

cd `dirname $0`/../..

args=""
if [ ${1:-""} = "fast" ]
then args="--fast"
fi

echo "Installing golangci-lint..."

# Make a backup of go.{mod,sum} first
cp go.mod go.mod.bak && cp go.sum go.sum.bak
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2

# Run linting
echo "Looking for lint..."

# Capture exit code to ensure go.{mod,sum} is restored before exiting
exit_code=0

PATH="$PATH:$(go env GOPATH)/bin" golangci-lint run $args || exit_code=1

# Restore go.{mod,sum}
mv go.mod.bak go.mod && mv go.sum.bak go.sum

exit $exit_code


text:
using System.Collections.ObjectModel;

namespace Newbe.Mahua
{
    public class MahuaOutputConfig
    {
        public string Name { get; set; }
        public string Type { get; set; }
        public string Version { get; set; }
        public ReadOnlyDictionary<string, object> Args { get; set; }
    }
}


text:
@interface NSString (MD5)
- (NSData*)MD5CharData;
- (NSString*)MD5;

@end


text:
namespace IncludeNamespace
{
    using Virtuosity;

    [DoNotVirtualize]
    public class InNamespaceButWithAttribute
    {
        public void Method()
        {
        }
    }
}


text:
FORM EDIT KELAS

  <uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">
    {{alert.msg}}
  </uib-alert>

                    <form name="Form">

                                <fieldset>

										                     Name

                                        <input type="text" placeholder="Enter your Name" class="form-control" name="name" ng-model="myModel.name" required />
                                        First Name is required
                                        Thank You!

										                     Descriptions

                                        <input type="text" placeholder="Enter your Descriptions" class="form-control" name="descriptions" ng-model="myModel.descriptions" required />
                                        descriptions is required
                                        Thank You!

                                </fieldset>

                  <button md-ink-ripple class="btn btn-primary" ng-click="updateData()"
                      ng-disabled="Form.$invalid || process">Simpan
                  </button>
                  <button md-ink-ripple class="btn btn-primary btn-o" ui-sref="app.kelas-list"
                      ng-disabled="process">Kembali
                  </button>

          </form>


text:
Angular Directive for simplified usage of Bootstrap dismissable alerts

## Dependencies
- angular 1.4.7
- bootstrap 3.3.5
- font-awesome 4.4.0

## Installation
    bower install angular-bootstrap-alert --save

#### Include the module on your app
    angular.module('yourApp', ['angular-bootstrap-alert'])

## Description
The directive transcludes the following $scope elements:

    $scope.Error
    $scope.Success
    $scope.Warning
    $scope.Information

This means all you have to do to pop the alert would be something like:

    $scope.Error = "There has been a terrible error in your application. Please try again until madness.";

## Usage examples

### Html
The alert possible types:

    <alert type="error"></alert>
    <alert type="success"></alert>
    <alert type="warning"></alert>
    <alert type="info"></alert>

Button calling the example bellow:

    <button type="button" ng-click="doSomethingUseful"></button>

### Controller

    $scope.doSomethingUseful = function() {

        $http.get("/api/useful")
            .then(....)
            .catch(err) {
               $scope.Error = err;
            }
    }

## Author
- Ricardo Cunha <ricardocunha@tranquilo.pt>

## License
[MIT] (/LICENSE)


text:
@protocol FLWTouchGesture <NSObject>

@property (nonatomic, assign) CGFloat duration;
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, readonly) NSArray *touchIndicatorViews;

@property (nonatomic, assign) CGFloat progress;

@end


text:
package com.github.pyknic.stiletto;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Annotates that the specified element should be selected for dependency
 * injection, potentially under a specified qualifier.
 *
 *
Element Types

 * If placed on an {@link ElementType#TYPE type}, then this has no other effect
 * than to mark the class as dependency managed for other programmers. If placed
 * on an {@link ElementType#CONSTRUCTOR constructor}, then that constructor will
 * be used when creating instances of the class. If no constructor is marked
 * then any constructor might be selected. If placed on a
 * {@link ElementType#CONSTRUCTOR parameter} or
 * {@link ElementType#CONSTRUCTOR field}, then it has no other effect than to
 * indicate which qualifier applies to that field.
 *
 *
Qualifiers

 * Normally, the qualifier for an injected value is the absolute class name.
 * However, a custom qualifier can be specified by using the {@link #value()} on
 * this annotation.
 *
 * @author Emil Forslund
 * @since 1.0.0
 */
@Retention(RUNTIME)
@Target({TYPE, CONSTRUCTOR, PARAMETER, FIELD})
public @interface Inject {

    /**
     * Qualifier for the injected value.
     *
     * @return  the qualifier
     */
    String value() default "";

}


text:
/**
 * Define enemies for each level of difficulty.
 * @param  {Number} levels Number of levels of difficulty.
 */

function defineEnemies(levels) {
	for (var i = 1; i < levels + 1; i++) {
		var half = i / 2;
		var size = 7;
		if (half * 2 > size) {
			size = half * 2;
		}
		enemies.push({
			level: i,
			size: size,
			speed: half * 0.5,
			health: half * 5,
			fullHealth: half * 5,
			targetX: null,
			targetY: null,
			path: null,
			x: null,
			y: null,
			pixelX: null,
			pixelY: null,
			pathIndex: 0,
			color: "rgb(0,0,0)",
			red: 0,
			green: 0,
			blue: 0
		});
	}
}

/**
 * Function to move an enemy from the wave to the map. Will only spawn where the enemy can reach the base.
 */

function findSpawn(enemy) {
	var testPath;
	var times = 0;
	/**
	 * test paths until a
	 */
	do {
		do {
			// 0-3 top-left clockwise
			var x = 0;
			var y = 0;
			if (side === 0 || side === 2) {
				x = random(0, canvasWidth - 1);
				if (side === 2) {
					y = canvasWidth - 1;
				}
			} else if (side === 1 || side === 3) {
				y = random(0, canvasHeight - 1);
				if (side === 1) {
					x = canvasHeight - 1;
				}
			}
			times++
			var testMap = compile();
		} while (testMap[x][y].speed === 0 /* && times < canvasWidth * canvasHeight*/ );

		data.x = x;
		data.y = y;
		data.pixelX = centerSymmetrical(x, data.size);
		data.pixelY = centerSymmetrical(y, data.size);
		testPath = getPaths([data], testMap);
	} while (!testPath.length)
	data.path = testPath;
	data.targetX = testPath[0].x;
	data.targetY = testPath[0].y;
	data.pathIndex = 0;
	return enemy;
}

function spawnEnemy() {
	if (waves[0] && base) {
		var data = waves[0].splice(0, 1)[0];
		if (data) {
			var testPath;
			var times = 0;
			/**
			 * test paths until a
			 */
			do {
				do {
					var side = random(0, 3)
					// 0-3 top-left clockwise
					var x = 0;
					var y = 0;
					if (side === 0 || side === 2) {
						x = random(0, canvasWidth - 1);
						if (side === 2) {
							y = canvasWidth - 1;
						}
					} else if (side === 1 || side === 3) {
						y = random(0, canvasHeight - 1);
						if (side === 1) {
							x = canvasHeight - 1;
						}
					}
					times++
					var testMap = compile();
				} while (testMap[x][y].speed === 0 /* && times < canvasWidth * canvasHeight*/ );
				data.x = x;
				data.y = y;
				data.pixelX = centerSymmetrical(x, data.size);
				data.pixelY = centerSymmetrical(y, data.size);
				testPath = getPaths([data], testMap);
			} while (!testPath.length)
			data.path = testPath;
			data.targetX = testPath[0].x;
			data.targetY = testPath[0].y;
			data.pathIndex = 0;
			onScreen.push(data);
		}
	}
}

/**
 * Make enemy waves.
 * @param  {Number} levels Number of waves to make.
 */

function makeWaves(levels) {
	/**
	 * Make a wave for each level
	 */
	// for (var l = 1; l < levels + 1; l++) {
	// var wave = [];
	// var enemyId = 0;
	/**
	 * Start large, end small.
	 */
	// for (var e = l; e > 0; e--) {
	/**
	 * Enemy numbers, based off of previous value.
	 */
	// for (var n = 0; n < e * 2; n++) {
	/**
	 * EnemyId is increased after this loop is run, resulting in decreased enemies as they become more difficult.
	 */
	// var data = cloneData(enemies[enemyId]);
	// wave.push(data);
	// }
	// enemyId = round((l / levels) * (enemies.length - 1));
	// }
	// waves.push(wave);
	// }
	for (var l = 1; l < levels + 1; l++) {
		var wave = [];
		// var enemyId = 0;
		/**
		 * Start large, end small.
		 */
		for (var e = l; e > 0; e--) {
			/**
			 * Enemy numbers, based off of previous value.
			 */
			for (var n = 0; n < (e * 2) + 15; n++) {
				/**
				 * EnemyId is increased after this loop is run, resulting in decreased enemies as they become more difficult.
				 */
				var data = cloneData(enemies[l]);
				wave.push(data);
			}
			// enemyId = round((l / levels) * (enemies.length - 1));
		}
		waves.push(wave);
	}

}

/**
 * Function to manage cloning enemy X value. Refer to functions.js/cloneData.
 * @param  {Object} enemy     Enemy that is being cloned.
 * @param  {String} attribute Attribute that was targetted
 * @param  {Array}  other     Variables added when called.
 * @return {Number}           Changes the enemy[attribute] to the returned value.
 */

function xModifier(enemy, attribute, other) {
	return other[0];
}

/**
 * Function to manage cloning enemy Y value. Refer to functions.js/cloneData.
 * @param  {Object} enemy     Enemy that is being cloned.
 * @param  {String} attribute Attribute that was targetted
 * @param  {Array}  other     Variables added when called.
 * @return {Number}           Changes the enemy[attribute] to the returned value.
 */

function yModifier(enemy, attribute, other) {
	return other[1];
}

/**
 * Function to manage cloning enemy pixelX value. Refer to functions.js/cloneData.
 * @param  {Object} enemy     Enemy that is being cloned.
 * @param  {String} attribute Attribute that was targetted
 * @param  {Array}  other     Variables added when called.
 * @return {Number}           Changes the enemy[attribute] to the returned value.
 */

function pixelXModifier(enemy, attribute, other) {
	return centerSymmetrical(other[0], enemy.size);
}

/**
 * Function to manage cloning enemy pixelY value. Refer to functions.js/cloneData.
 * @param  {Object} enemy     Enemy that is being cloned.
 * @param  {String} attribute Attribute that was targetted
 * @param  {Array}  other     Variables added when called.
 * @return {Number}           Changes the enemy[attribute] to the returned value.
 */

function pixelYModifier(enemy, attribute, other) {
	return centerSymmetrical(other[1], enemy.size);
}

/**
 * Draw each onScreen enemy.
 */

function drawEnemies() {
	forEach(onScreen, function(index) {
		var enemy = this;
		if (enemy.health < 1) {
			destroyEnemy(enemy, index);
		} else {
			context.beginPath();
			context.strokeStyle = "white";
			context.lineWidth = 2;
			context.strokeRect(enemy.pixelX, enemy.pixelY, enemy.size, enemy.size);
			context.fillStyle = enemy.color;
			context.fillRect(enemy.pixelX, enemy.pixelY, enemy.size, enemy.size);
			context.fill();
			context.closePath();
			// draw enemy health
			var radius = 16 - 1;
			var fullHealth = enemy.fullHealth * 100;
			var health = enemy.health * 100;
			var healthCalc = ((fullHealth - health) / (fullHealth / 2)) + 1;
			if (health < fullHealth / 2) {
				healthCalc = (((fullHealth / 2) - health) / (fullHealth / 2));
			}
			var startAngle = healthCalc * Math.PI;
			var endAngle = 1 * Math.PI;

			context.beginPath();
			context.arc(enemy.pixelX + (enemy.size / 2), enemy.pixelY + (enemy.size / 2), radius, startAngle, endAngle, false);
			context.lineWidth = 2;
			// line color
			context.strokeStyle = "rgba(255,0,0,0.4)";
			context.stroke();
		}
	});
}

/**
 * Move enemies that are onScreen, until they reach the base.
 */

function moveEnemies() {
	forEach(onScreen, function(index) {
		var enemy = this;
		if (base && enemy.pathIndex < enemy[PATH][LENGTH]) {
			var target = enemy[PATH][enemy.pathIndex];
			enemy.x = modulus(enemy.pixelX + (enemy.size / 2), tileSize);
			enemy.y = modulus(enemy.pixelY + (enemy.size / 2), tileSize);
			enemy.targetX = target.x;
			enemy.targetY = target.y;
			var tile = map[enemy.x][enemy.y];
			var speed = enemy[SPEED] / tile[SPEED];
			var x = centerSymmetrical(enemy.targetX, enemy.size);
			var y = centerSymmetrical(enemy.targetY, enemy.size);
			if (round(enemy.pixelX) < x) {
				if (enemy.pixelX + speed > x) {
					enemy.pixelX = x
				} else {
					enemy.pixelX += speed;
				}
			} else if (round(enemy.pixelY) < y) {
				if (enemy.pixelY + speed > y) {
					enemy.pixelY = y
				} else {
					enemy.pixelY += speed;
				}
			} else if (round(enemy.pixelX) > x) {
				if (enemy.pixelX - speed < x) {
					enemy.pixelX = x
				} else {
					enemy.pixelX -= speed;
				}
			} else if (round(enemy.pixelY) > y) {
				if (enemy.pixelY - speed < y) {
					enemy.pixelY = y
				} else {
					enemy.pixelY -= speed;
				}
			}
			if (round(enemy.pixelX) === centerSymmetrical(enemy.targetX, enemy.size) && round(enemy.pixelY) === centerSymmetrical(enemy.targetY, enemy.size)) {
				enemy.pathIndex++;
			}
		}
		if (base && enemy.x === base.x && enemy.y === base.y) {
			reachBase(enemy);
			destroyEnemy(enemy, index, true);
		}
	});
}

/**
 * Remove an enemy from play. Either it's been destroyed or it reached the base.
 * @param  {Object} enemy Enemy to remove.
 * @param  {Number} index Index to use when splicing it from onScreen.
 */

function destroyEnemy(enemy, index, noMoney) {
	var x = enemy.pixelX;
	var y = enemy.pixelY;
	var modifier = enemy.size / 2;
	makeParticles(floor((enemy.health / enemy.fullHealth) * enemy.size) + 1, 60, [2, 7], [-2, 2, -2, 2], [x, y - modifier, x + modifier, y + modifier], [color(enemy.red, enemy.green, enemy.blue), color(darken(enemy.red), darken(enemy.green), darken(enemy.blue))]);
	if (!noMoney) {
		addMoney((enemy.fullHealth * 10) / (wave));
	}
	onScreen.splice(index, 1);
}

/**
 * Tests paths for enemies.
 * @param  {Array} enemies  Array of enemies to find paths for.
 * @param  {Array} map      Map to test against.
 * @return {Boolean}        Returns path on success, false on failure.
 */

function getPaths(enemies, map) {
	if (base) {
		var list = [];
		var path, enemy, compiledMap;
		forEach(enemies, function(index) {
			enemy = this;
			compiledMap = map || compile();
			path = astar.search(compiledMap, compiledMap[enemy.x][enemy.y], compiledMap[base.x][base.y]);
			list[PUSH]( !! path.length);
		});
		if (list.indexOf(false) > -1) {
			return false;
		}
		return path;
	}
}

function getAllPaths(enemies) {
	forEach(enemies, function(index) {
		var enemy = this;
		var path = getPaths([enemy]);
		enemy.path = path;
		enemy.pathIndex = 0;
		enemy.targetX = path[0].x;
		enemy.targetY = path[0].y;
	});
}

function nextWave() {
	for (var i = 0; i < waves[0].length; i++) {
		waves[1].push(waves[0][i]);
	}
	advanceWave = true;
}


text:
shared_examples_for "a baza driver" do
  let(:driver) { constant.new(type_translation: :string) }
  let(:driver2) { constant.new }
  let(:db) { driver.db }
  let(:db2) { driver2.db }
  let(:db_with_type_translation) { constant.new(type_translation: true, debug: false).db }
  let(:row) do
    test_table.insert(text: "Kasper", number: 30, float: 4.5)
    db.select(:test, text: "Kasper").fetch
  end
  let(:test_table) do
    db.tables.create(
      "test",
      columns: [
        {name: "id", type: :int, autoincr: true, primarykey: true},
        {name: "text", type: :varchar},
        {name: "number", type: :int, default: 0},
        {name: "float", type: :float, default: 0.0},
        {name: "created_at", type: :datetime}
      ]
    )
    db.tables[:test]
  end

  before do
    driver.before
    driver2.before
  end

  after do
    driver.after
    driver2.after
  end

  it "does id-queries" do
    test_table

    rows_count = 1250
    db.transaction do
      rows_count.times do |count|
        db.insert(:test, text: "User #{count}")
      end
    end

    block_ran = 0
    Baza::Idquery.new(db: db, debug: false, table: :test, query: "SELECT id FROM test") do
      block_ran += 1
    end

    expect(block_ran).to eq rows_count

    block_ran = 0
    db.select(:test, {}, idquery: true) do
      block_ran += 1
    end

    expect(block_ran).to eq rows_count
  end

  it "does unbuffered queries" do
    test_table

    10.times do |count|
      db.insert(:test, text: "Test #{count}")
    end

    count_results = 0
    db.query_ubuf("SELECT * FROM test") do |row|
      expect(row[:text]).to eq "Test #{count_results}"
      count_results += 1
    end

    expect(count_results).to eq 10
  end

  it "#upsert" do
    test_table.create_columns([{name: "nickname", type: :varchar}])

    # Test upserting.
    data = {text: "upsert - Kasper Johansen"}
    data2 = {text: "upsert - Kasper Nielsen Johansen"}
    sel = {nickname: "upsert - kaspernj"}

    table = db.tables[:test]
    table.reload
    rows_count = table.rows_count

    db.upsert(:test, data, sel)
    row = db.select(:test, sel).fetch
    expect(row[:text]).to eq "upsert - Kasper Johansen"

    table.reload
    expect(table.rows_count).to eq rows_count + 1

    db.upsert(:test, data2, sel)
    row = db.select(:test, sel).fetch
    expect(row[:text]).to eq "upsert - Kasper Nielsen Johansen"

    table.reload
    expect(table.rows_count).to eq rows_count + 1
  end

  describe "#upsert_duplicate_key" do
    before do
      test_table.create_indexes([name: "unique_text", columns: ["text"], unique: true])
    end

    it "inserts records with terms" do
      expect(test_table.rows_count).to eq 0
      test_table.upsert_duplicate_key({number: 2}, text: "test1")
      expect(test_table.rows_count).to eq 1
    end

    it "updates existing records with terms" do
      test_table.insert(text: "test1", number: 1)
      test_table.upsert_duplicate_key({number: 2}, text: "test1")
      expect(test_table.rows_count).to eq 1

      rows = test_table.rows.to_a.map(&:to_hash)
      rows[0][:float] = "0.0" if rows[0][:float] == "0"
      expect(rows).to eq [{id: "1", text: "test1", number: "2", float: "0.0", created_at: ""}]
    end

    it "inserts with empty terms" do
      expect(test_table.rows_count).to eq 0
      id = test_table.upsert_duplicate_key({text: "test2"}, {}, return_id: true)
      expect(test_table.rows_count).to eq 1
      expect(id).to eq 1
    end

    it "updates existing records with empty terms" do
      test_table.insert(text: "test1", number: 1)
      id = test_table.upsert_duplicate_key({number: 2, text: "test1"}, {}, return_id: true)
      expect(test_table.rows_count).to eq 1
      expect(id).to eq 1
    end
  end

  it "dumps as SQL" do
    dump = Baza::Dump.new(db: db, debug: false)
    str_io = StringIO.new
    dump.dump(str_io)
    str_io.rewind

    # Remember some numbers for validation.
    tables_count = db.tables.list.length

    # Remove everything in the db.
    db.tables.list.select(&:native?).each(&:drop)

    # Run the exported SQL.
    db.transaction do
      str_io.each_line do |sql|
        db.q(sql)
      end
    end

    # Vaildate import.
    raise "Not same amount of tables: #{tables_count}, #{db.tables.list.length}" if tables_count != db.tables.list.length
  end

  it "generates proper sql" do
    time = Time.new(1985, 6, 17, 10, 30)
    expect(db.insert(:test, {date: time}, return_sql: true)).to eq "INSERT INTO #{db.sep_table}test#{db.sep_table} (#{db.sep_col}date#{db.sep_col}) VALUES (#{db.sep_val}1985-06-17 10:30:00#{db.sep_val})"

    date = Date.new(1985, 6, 17)
    expect(db.insert(:test, {date: date}, return_sql: true)).to eq "INSERT INTO #{db.sep_table}test#{db.sep_table} (#{db.sep_col}date#{db.sep_col}) VALUES (#{db.sep_val}1985-06-17#{db.sep_val})"
  end

  it "is able to make new connections based on given objects" do
    # Mysql doesn't support it...
    unless db.opts.fetch(:type) == :mysql
      Baza::Db.from_object(object: db.driver.conn)
    end
  end

  it "is able to do ID-queries through the select-method" do
    db.tables.create(
      :test_table,
      columns: [
        {name: :idrow, type: :int, autoincr: true, primarykey: true},
        {name: :name, type: :varchar}
      ]
    )

    count = 0
    100.times do
      arr = []
      100.times do
        count += 1
        arr << {name: "Kasper #{count}"}
      end

      db.insert_multi(:test_table, arr)
    end

    count_found = 0
    db.select(:test_table, nil, idquery: :idrow) do |row|
      count_found += 1

      expect(row[:name]).to eq "Kasper #{count_found}"
    end

    expect(count_found).to eq 10_000
  end

  it "uses query buffers" do
    db.tables.create(
      :test_table,
      columns: [
        {name: :id, type: :int, autoincr: true, primarykey: true},
        {name: :name, type: :varchar}
      ]
    )

    upsert = false
    count_inserts = 0
    db.q_buffer do |buffer|
      2500.times do |count|
        if upsert
          buffer.upsert(:test_table, {name: "Kasper #{count}"}, name: "Kasper #{count}")
          upsert = false
        else
          buffer.insert(:test_table, name: "Kasper #{count}")
          upsert = true
        end

        count_inserts += 1
      end
    end

    expect(count_inserts).to eq 2500

    test_table = db.tables[:test_table]
    expect(test_table.rows_count).to eq 2500

    count = 0
    db.q_buffer do |buffer|
      upsert = false

      db.select(:test_table, {}, orderby: :id) do |row|
        expect(row[:name]).to eq "Kasper #{count}"

        if upsert
          buffer.upsert(:test_table, {name: "Kasper #{count}-#{count}"}, id: row.fetch(:id))
          upsert = false
        else
          buffer.update(:test_table, {name: "Kasper #{count}-#{count}"}, id: row.fetch(:id))
          upsert = true
        end

        count += 1
      end
    end

    expect(count).to eq 2500

    count = 0
    db.select(:test_table, {}, orderby: :id) do |row|
      expect(row[:name]).to eq "Kasper #{count}-#{count}"
      count += 1
    end

    expect(count).to eq 2500

    # Test the flush-async which flushes transactions in a thread asyncronous.
    db.q_buffer(flush_async: true) do |buffer|
      count = 0
      db.select(:test_table) do |row|
        count += 1
        time_start = Time.now.to_f if count == 1000

        buffer.delete(:test_table, id: row.fetch(:id))

        next unless count == 1000
        time_end = Time.now.to_f

        time_spent = time_end - time_start
        raise "Too much time spent: '#{time_spent}'." if time_spent > 0.015
      end
    end

    expect(test_table.rows_count).to eq 0
  end

  describe "results" do
    before do
      test_table.insert(text: "test 1")
      test_table.insert(text: "test 2")
    end

    it '#to_a' do
      array = db.select(:test).to_a
      expect(array.length).to eq 2
    end

    it '#to_a_enum' do
      array_enum = db.select(:test).to_a_enum
      count = 0
      array_enum.each { count += 1 }
      expect(count).to eq 2
      expect(array_enum.length).to eq 2
    end

    it '#to_enum' do
      enum = db.select(:test).to_enum

      count = 0
      enum.each { count += 1 }
      expect(count).to eq 2
    end
  end

  it "counts" do
    test_table.insert(text: "test 1")
    expect(db.count(:test, text: "test 1")).to eq 1
  end

  it "doesnt do type translation by default" do
    expect(row.fetch(:text).class).to eq String
    expect(row.fetch(:number).class).to eq String
    expect(row.fetch(:float).class).to eq String
  end

  it "does type translation" do
    db_with_type_translation.tables.create(
      :test,
      columns: [
        {name: "id", type: :int, autoincr: true, primarykey: true},
        {name: "text", type: :varchar},
        {name: "number", type: :int},
        {name: "float", type: :float},
        {name: "created_at", type: :datetime},
        {name: "date", type: :date}
      ]
    )

    db_with_type_translation.insert(:test, text: "Kasper", number: 30, float: 4.5, created_at: Time.now, date: Date.new(2015, 06, 17))

    row = db_with_type_translation.select(:test, text: "Kasper").fetch

    expect(row.fetch(:text).class).to eq String
    expect(row.fetch(:number).class.name).to eq "Integer"
    expect(row.fetch(:float).class).to eq Float

    if db.driver.conn.class.name == "ActiveRecord::ConnectionAdapters::SQLite3Adapter"
      check_time_and_date = false
    elsif db.driver.class.name == "Baza::Driver::ActiveRecord" && RUBY_PLATFORM == "java"
      check_time_and_date = false
    else
      check_time_and_date = true
    end

    if check_time_and_date
      expect(row.fetch(:created_at).class).to eq Time
      expect(row.fetch(:date).class).to eq Date
    end
  end

  it "returns arguments used to connect" do
    require_relative "../../lib/baza/driver/active_record"

    unless db.driver.is_a?(Baza::Driver::ActiveRecord)
      args = db.driver.class.args
      expect(args).to be_a Array
    end
  end

  it "#new_query" do
    test_table
    test_table.insert(text: "Kasper")

    query = db.new_query.from(:test).where(text: "Kasper").to_a
    query[0][:float] = query[0][:float].to_f.to_s if query[0][:float] == "0"
    expect(query.to_a).to eq [{id: "1", text: "Kasper", number: "0", float: "0.0", created_at: ""}]
  end

  it "#last_id" do
    test_table.insert(text: "Kasper")
    expect(db.last_id).to eq 1
  end

  it "handels null values for datetimes" do
    id = test_table.insert({text: "Kasper"}, return_id: true)
    row = test_table.row(id)
    expect(row[:created_at]).to eq ""
  end

  describe "#insert" do
    it "returns id" do
      test_table
      id = db.insert("test", {text: "Kasper"}, return_id: true)
      expect(id).to eq 1
    end
  end
end