text:
import argparse
import os
import re
import sys
import tempfile
import time

from spinnaker.fetch import fetch
from spinnaker.fetch import GOOGLE_INSTANCE_METADATA_URL
from spinnaker.run import run_quick
from spinnaker.run import check_run_quick
from spinnaker.yaml_util import YamlBindings

__NEXT_STEP_INSTRUCTIONS = """
To finish the installation, follow these steps:

(1) Log into your new instance (with or without tunneling ssh-flags):

  gcloud compute ssh --project {project} --zone {zone} {instance}\
 --ssh-flag="-L 9000:localhost:9000"\
 --ssh-flag="-L 8084:localhost:8084"

(2) Wait for the installation to complete:

  tail -f /var/log/syslog

  When the instance startup script finishes installing the developer tools
  you will be ready to continue. ^C to terminate the tail process.

(3) Set up the build environment:

  source /opt/spinnaker/install/bootstrap_dev.sh

For more information about Spinnaker, see http://spinnaker.io

"""

def get_project(options):
    """Determine the default project name.

    The default project name is the gcloud configured default project.
    """
    if not options.project:
      result = check_run_quick('gcloud config list', echo=False)
      options.project = re.search('project = (.*)\n', result.stdout).group(1)
    return options.project

def get_zone(options):
    """Determine the default availability zone.

    The default zone is the current zone if on GCE or an arbitrary zone.
    """
    if not options.zone:
      result = fetch(os.path.join(GOOGLE_INSTANCE_METADATA_URL, 'zone'),
                                  google=True)
      if result.ok():
        options.zone = os.path.basename(result.content)
      else:
        options.zone = 'us-central1-f'

    return options.zone

def init_argument_parser(parser):
    parser.add_argument(
        '--instance',
        default='{user}-spinnaker-dev'.format(user=os.environ['USER']),
        help='The name of the GCE instance to create.')
    parser.add_argument(
        '--project', default=None,
        help='The Google Project ID to create the new instance in.'
        ' If left empty, use the default project gcloud was configured with.')

    parser.add_argument(
        '--zone', default=None,
        help='The Google Cloud Platform zone to create the new instance in.')

    parser.add_argument(
        '--disk_type',  default='pd-ssd',
        help='The Google Cloud Platform disk type to use for the new instance.'
        '  The default is pd-standard. For a list of other available options,'
        ' see "gcloud compute disk-types list".')
    parser.add_argument('--disk_size', default='200GB',
                        help='Warnings appear if disk size < 200GB')
    parser.add_argument('--machine_type', default='n1-standard-8')

    parser.add_argument(
        '--copy_personal_files', default=True, action='store_true',
        help='Copy personal configuration files (.gitconfig, etc.)')
    parser.add_argument(
        '--no_personal_files', dest='copy_personal_files',
        action='store_false', help='Do not copy personal files.')

    parser.add_argument(
        '--copy_git_credentials', default=False, action='store_true',
        help='Copy git credentials (.git-credentials)')
    parser.add_argument(
        '--no_git_credentials', dest='copy_git_credentials',
        action='store_false', help='Do not copy git credentials')

    parser.add_argument(
        '--copy_gcloud_config', default=False, action='store_true',
        help='Copy private gcloud configuration files.')
    parser.add_argument(
        '--no_gcloud_config', dest='copy_gcloud_config',
        action='store_false',
        help='Do not copy private gcloud configuration files.')

    parser.add_argument(
        '--aws_credentials', default=None,
        help='If specified, the path to the aws credentials file.')
    parser.add_argument(
        '--master_yml', default=None,
        help='If specified, the path to the master spinnaker-local.yml file.')

    parser.add_argument(
        '--address', default=None,
        help='The IP address to assign to the new instance. The address may'
             ' be an IP address or the name or URI of an address resource.')
    parser.add_argument(
        '--scopes', default='compute-rw,storage-full,monitoring-write,logging-write',
        help='Create the instance with these scopes.'
        'The default are the minimal scopes needed to run the development'
        ' scripts. This is currently "compute-rw,storage-rw,monitoring-write,logging-write".')

def try_until_ready(command):
    while True:
        result = run_quick(command, echo=False)
        if not result.returncode:
            break
        msg = result.stderr or result.stdout
        if msg.find('refused') > 0:
            print 'New instance does not seem ready yet...retry in 5s.'
        else:
            print msg.strip()
            print 'Retrying in 5s.'
        time.sleep(5)

def make_remote_directories(options):
    all = []
    if options.copy_personal_files:
        all.append('.gradle')
    if options.aws_credentials:
        all.append('.aws')
    if options.master_yml:
        all.append('.spinnaker')
    if options.copy_gcloud_config:
        all.append('.config/gcloud')

    if all:
        command = ' '.join([
            'gcloud compute ssh',
            options.instance,
            '--project', get_project(options),
            '--zone', get_zone(options),
            '--command=\'bash -c "for i in {0}; do mkdir -p \\$i; done"\''.format(' '.join(all))])

        try_until_ready(command)

def copy_custom_file(options, source, target):
    command = ' '.join([
        'gcloud compute copy-files',
        '--project', get_project(options),
        '--zone', get_zone(options),
        source,
        '{instance}:{target}'.format(instance=options.instance,
                                     target=target)])
    try_until_ready(command)

def copy_home_file_list(options, type, base_dir, sources):
    have = []
    for file in sources:
        full_path = os.path.abspath(
            os.path.join(os.environ['HOME'], base_dir, file))
        if os.path.exists(full_path):
            have.append('"{0}"'.format(full_path))

    if have:
        print 'Copying {type}...'.format(type=type)
        source_list = ' '.join(have)
        # gcloud will copy permissions as well, however it won't create
        # directories. Assume make_remote_directories was called already.
        copy_custom_file(options, source_list, base_dir)
    else:
        print 'Skipping {type} because there are no files.'.format(type=type)

def maybe_inform(type, test_path, option_to_enable):
    if os.path.exists(os.path.join(os.environ['HOME'], test_path)):
        print 'Skipping {type} because missing {option}.'.format(
            type=type, option=option_to_enable)

def maybe_copy_aws_credentials(options):
    if options.aws_credentials:
      print 'Copying aws credentials...'
      copy_custom_file(options, options.aws_credentials, '.aws/credentials')
    else:
      maybe_inform('aws credentials', '.aws/credentials', '--aws_credentials')

def maybe_copy_gcloud_config(options):
   if options.copy_gcloud_config:
       copy_home_file_list(options,
                           'gcloud credentials',
                           '.config/gcloud',
                           ['application_default_credentials.json',
                            'credentials',
                            'properties'])
   else:
      maybe_inform('gcloud credentials',
                   '.config/gcloud/credentials', '--copy_gcloud_config')

def maybe_copy_git_credentials(options):
    if options.copy_git_credentials:
        copy_home_file_list(options, 'git credentials',
                            '.', ['.git-credentials'])
    else:
        maybe_inform('git credentials',
                     '.git-credentials', '--copy_git_credentials')

def copy_personal_files(options):
   copy_home_file_list(options, 'personal configuration files',
                       '.',
                       ['.gitconfig', '.emacs', '.bashrc', '.screenrc'])
   # Ideally this is part of the above, but it goes into a different directory.
   copy_home_file_list(options, 'gradle configuration',
                       '.gradle', ['gradle.properties'])

def create_instance(options):
    """Creates new GCE VM instance for development."""
    project = get_project(options)
    print 'Creating instance {project}/{zone}/{instance}'.format(
        project=project, zone=get_zone(options), instance=options.instance)
    print ('  with --machine_type={type} and --disk_size={disk_size}...'
           .format(type=options.machine_type, disk_size=options.disk_size))

    google_dev_dir = os.path.join(os.path.dirname(__file__), '../google/dev')
    dev_dir = os.path.dirname(__file__)
    project_dir = os.path.join(dev_dir, '..')

    install_dir = '{dir}/../install'.format(dir=dev_dir)

    startup_command = ['/opt/spinnaker/install/install_spinnaker.sh'
                           ' --dependencies_only',
                       '/opt/spinnaker/install/install_development.sh']
    fd, temp_startup = tempfile.mkstemp()
    os.write(fd, ';'.join(startup_command))
    os.close(fd)

    metadata_files = [
        'startup-script={google_dev_dir}/google_install_loader.py'
        ',sh_bootstrap_dev={dev_dir}/bootstrap_dev.sh'
        ',sh_install_spinnaker={project_dir}/InstallSpinnaker.sh'
        ',sh_install_development={dev_dir}/install_development.sh'
        ',startup_command={temp_startup}'
        .format(google_dev_dir=google_dev_dir,
                dev_dir=dev_dir,
                project_dir=project_dir,
                temp_startup=temp_startup)]

    metadata = ','.join([
        'startup_loader_files='
        'sh_install_spinnaker'
        '+sh_install_development'
        '+sh_bootstrap_dev'])

    command = ['gcloud', 'compute', 'instances', 'create',
               options.instance,
               '--project', get_project(options),
               '--zone', get_zone(options),
               '--machine-type', options.machine_type,
               '--image-family', 'ubuntu-1404-lts',
               '--image-project', 'ubuntu-os-cloud',
               '--scopes', options.scopes,
               '--boot-disk-size={size}'.format(size=options.disk_size),
               '--boot-disk-type={type}'.format(type=options.disk_type),
               '--metadata', metadata,
               '--metadata-from-file={files}'.format(
                   files=','.join(metadata_files))]
    if options.address:
        command.extend(['--address', options.address])

    check_run_quick(' '.join(command), echo=False)

def maybe_copy_master_yml(options):
    """Copy the specified master spinnaker-local.yml, and credentials.

    This will look for paths to credentials within the spinnaker-local.yml, and
    copy those as well. The paths to the credentials (and the reference
    in the config file) will be changed to reflect the filesystem on the
    new instance, which may be different than on this instance.

    Args:
      options [Namespace]: The parser namespace options contain information
        about the instance we're going to copy to, as well as the source
        of the master spinnaker-local.yml file.
    """
    if not options.master_yml:
        maybe_inform('custom spinnaker-local.yml',
                     '.spinnaker/spinnaker-local.yml', '--copy_master_yml')
        return

    bindings = YamlBindings()
    bindings.import_path(options.master_yml)

    try:
      json_credential_path = bindings.get(
          'providers.google.primaryCredentials.jsonPath')
    except KeyError:
      json_credential_path = None

    gcp_home = os.path.join('/home', os.environ['LOGNAME'], '.spinnaker')

    # If there are credentials, write them to this path
    gcp_credential_path = os.path.join(gcp_home, 'google-credentials.json')

    with open(options.master_yml, 'r') as f:
        content = f.read()

    # Replace all the occurrences of the original credentials path with the
    # path that we are going to place the file in on the new instance.
    if json_credential_path:
        if not os.path.exists(json_credential_path):
            raise ValueError('{0} specifies google credentials in {1},'
                             ' which does not exist.'
                                 .format(options.master_yml,
                                         json_credential_path))

        content = content.replace(json_credential_path, gcp_credential_path)

    fd, temp_path = tempfile.mkstemp()
    os.fchmod(fd, os.stat(options.master_yml).st_mode)  # Copy original mode
    os.write(fd, content)
    os.close(fd)
    actual_path = temp_path

    # Copy the credentials here. The cfg file will be copied after.
    copy_custom_file(options, actual_path, '.spinnaker/spinnaker-local.yml')

    if json_credential_path:
        copy_custom_file(options, json_credential_path,
                         '.spinnaker/google-credentials.json')

    if temp_path:
      os.remove(temp_path)

def check_gcloud():
    result = run_quick('gcloud --version', echo=False)
    if not result.returncode:
        return

    sys.stderr.write('ERROR: This program requires gcloud. To obtain gcloud:\n'
                     '       curl https://sdk.cloud.google.com | bash\n')
    sys.exit(-1)

def check_args(options):
    """Fail fast if paths we explicitly want to copy do not exist."""
    for path in [options.aws_credentials, options.master_yml]:
        if path and not os.path.exists(path):
           sys.stderr.write('ERROR: {path} not found.\n'.format(path=path))
           sys.exit(-1)

if __name__ == '__main__':
    check_gcloud()

    parser = argparse.ArgumentParser()
    init_argument_parser(parser)
    options = parser.parse_args()

    check_args(options)
    create_instance(options)

    make_remote_directories(options)
    if options.copy_personal_files:
      copy_personal_files(options)

    maybe_copy_git_credentials(options)
    maybe_copy_aws_credentials(options)
    maybe_copy_gcloud_config(options)
    maybe_copy_master_yml(options)

    print __NEXT_STEP_INSTRUCTIONS.format(
        project=get_project(options),
        zone=get_zone(options),
        instance=options.instance)


text:
using KoinCentrator.MarketData.Providers;
using KoinCentrator.MarketData.ViewModels;
using KoinCentrator.Tools.Web;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace KoinCentrator.MarketData.Controllers
{
    [Route("api/[controller]")]
    public class CoinsController : Controller
    {
        private readonly IEnumerable<ICoinDataProvider> _coinDataProviders;

        public CoinsController(IEnumerable<ICoinDataProvider> coinDataProviders)
        {
            _coinDataProviders = coinDataProviders;
        }

        [HttpGet]
        [Route("all")]
        [ProducesResponseType(typeof(IEnumerable<CoinVm>), 200)]
        public async Task<IActionResult> GetAllCoinsAsync() =>
            Ok((await Task.WhenAll(_coinDataProviders.Select(cdp => cdp.GetAllCoinDatasAsync())))
                .SelectMany(e => e)
                .Select(c => new CoinVm
                {
                    Algorithm = c.Algorithm,
                    ImageUrl = c.ImageUrl,
                    Name = c.Name,
                    ProofType = c.ProofType,
                    SupportedExchangeIds = c.SupportedExchangeIds,
                    Symbol = c.Symbol
                }));

        [HttpGet]
        [ProducesResponseType(typeof(IEnumerable<CoinVm>), 200)]
        public async Task<IActionResult> GetCoinsAsync([CommaSeparated]IEnumerable<string> commaSeparatedExchangeIds) =>
            Ok((await Task.WhenAll(_coinDataProviders.Select(cdp => cdp.GetCoinDatasAsync(commaSeparatedExchangeIds))))
                .SelectMany(e => e)
                .Select(c => new CoinVm
                {
                    Algorithm = c.Algorithm,
                    ImageUrl = c.ImageUrl,
                    Name = c.Name,
                    ProofType = c.ProofType,
                    SupportedExchangeIds = c.SupportedExchangeIds,
                    Symbol = c.Symbol
                }));
    }
}

redpajama_set_name: RedPajamaGithub


text:
"use strict";

const http = require('http');
const querystring = require('querystring');

const google = require('googleapis');

const Types = require('./types');

const youtube = google.youtube('v3');

const apiKey = require('../../google_api.json').apiKey;

const YOUTUBE_DL_SERVICE_HOSTNAME = process.env.YOUTUBE_DL_SERVICE_HOSTNAME || 'localhost';
const YOUTUBE_DL_SERVICE_PORT = process.env.YOUTUBE_DL_SERVICE_PORT || '5000';

class Utils {
  constructor(container) {
    this.container = container;
  }

  zeroPad(n) {
    return n < 10 ? '0' + n : n;
  }

  formatTime(seconds) {
    return Math.floor(seconds / 60) + ':' + this.zeroPad(seconds % 60);
  }

  fetchYoutubeInfo(url) {
    return new Promise((resolve, reject) => {
      const query = querystring.escape(url);
      const urlPath = `/download?v=${query}`;

      const req = http.request({
        method: 'GET',
        hostname: YOUTUBE_DL_SERVICE_HOSTNAME,
        port: YOUTUBE_DL_SERVICE_PORT,
        path: urlPath,
      }, (res) => {
        const buffers = [];

        res.on('error', (err) => {
          reject(err);
        });
        res.on('data', (chunk) => {
          buffers.push(chunk);
        });
        res.on('end', () => {
          const buf = Buffer.concat(buffers);
          if (res.statusCode === 200) {
            const obj = JSON.parse(buf);
            resolve(obj);
          } else {
            reject(`Failed request: ${buf}`);
          }
        });
      });

      req.on('error', (err) => {
        reject(err);
      });

      req.end();
    });
  }

  searchYoutube(searchString) {
    return new Promise((resolve, reject) => {
      youtube.search.list({ key: apiKey, part: 'snippet', q: searchString, maxResults: 10 }, (err, results) => {
        if (err) {
          return reject(err);
        }
        resolve(results);
      });
    });
  }

  formatInfo(self) {
    const time = self.time ? `${this.formatTime(self.time | 0)}/` : '';
    const title = self.title ? `**${self.title}**` : '';

    const owner = this.container.get('bot').client ? (
      this.container.get('bot').client.Users.get(self.ownerId).username
    ) : self.ownerId;

    if (self.type === Types.YTDL) {
      const length = this.formatTime(parseInt(self.duration));

      return `(${time}${length}) \`[${self.encoding}]\` ${title} (${self.id}) (${owner})`;
    }
    return `NON-YTDL \`[${self.encoding}]\` ${title} - ${self.url} (${owner})`;
  }
}

module.exports = Utils;


text:
var game_file_list = [
    //以下为自动修改,请勿修改
    //----auto game_file_list start----
	"libs/modules/egret/egret.js",
	"libs/modules/egret/egret.native.js",
	"libs/modules/res/res.js",
	"libs/modules/eui/eui.js",
	"libs/modules/tween/tween.js",
	"bin-debug/base/core/Emitter.js",
	"bin-debug/base/core/AppEvent.js",
	"bin-debug/base/core/Action.js",
	"bin-debug/base/core/View.js",
	"bin-debug/base/core/Scene.js",
	"bin-debug/base/core/App.js",
	"bin-debug/base/core/Model.js",
	"bin-debug/base/core/ModelEvent.js",
	"bin-debug/base/core/SceneManage.js",
	"bin-debug/base/utils/Fetch.js",
	"bin-debug/base/ui/Dialog.js",
	"bin-debug/base/ui/Toast.js",
	"bin-debug/Main.js",
	"bin-debug/ThemeAdapter.js",
	"bin-debug/LoadingUI.js",
	"bin-debug/AssetAdapter.js",
	"bin-debug/model/AppModel.js",
	"bin-debug/action/gameAction.js",
	"bin-debug/action/GetDataAction.js",
	"bin-debug/view/ExampleView2.js",
	"bin-debug/view/AppScene.js",
	//----auto game_file_list end----
];

var window = this;

egret_native.setSearchPaths([""]);

egret_native.requireFiles = function () {
    for (var key in game_file_list) {
        var src = game_file_list[key];
        require(src);
    }
};

egret_native.egretInit = function () {
    if(egret_native.featureEnable) {
        //控制一些优化方案是否开启
        var result = egret_native.featureEnable({

        });
    }
    egret_native.requireFiles();
    //egret.dom为空实现
    egret.dom = {};
    egret.dom.drawAsCanvas = function () {
    };
};

egret_native.egretStart = function () {
    var option = {
        //以下为自动修改,请勿修改
        //----auto option start----
		entryClassName: "Main",
		frameRate: 30,
		scaleMode: "showAll",
		contentWidth: 640,
		contentHeight: 1136,
		showPaintRect: false,
		showFPS: false,
		fpsStyles: "x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9",
		showLog: false,
		logFilter: "",
		maxTouches: 2,
		textureScaleFactor: 1
		//----auto option end----
    };

    egret.native.NativePlayer.option = option;
    egret.runEgret();
    egret_native.Label.createLabel("/system/fonts/DroidSansFallback.ttf", 20, "", 0);
    egret_native.EGTView.preSetOffScreenBufferEnable(true);
};


text:
'use strict';

module.exports = require('@std/esm')(module)('./mutability.mjs');


text:
Fixed for love2d 0.10.0

# Legal notice
I do not own any of these files, they were modified so people would be able to use them on love2d 0.10.0.

# Screenshot
![screenshot1](http://i.imgur.com/XVtb9Vv.png)


text:
package cn.cerc.mis.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonProcessingException;

import cn.cerc.db.core.DataRow;
import cn.cerc.db.core.Datetime;
import cn.cerc.db.core.ISession;
import cn.cerc.mis.client.ServiceSign;
import cn.cerc.mis.core.Application;
import cn.cerc.mis.core.BookHandle;
import cn.cerc.mis.core.IUserMessage;
import cn.cerc.mis.message.MessageProcess;
import cn.cerc.mis.task.AbstractTask;

/**
 * 处理后台异步任务
 *
 * @author ZhangGong
 */
public class ProcessService extends AbstractTask {
    private static final Logger log = LoggerFactory.getLogger(ProcessService.class);

    // 手动执行所有的预约服务
    public static void main(String[] args) {
        Application.initOnlyFramework();
        ISession session = Application.getSession();

        ProcessService ps = new ProcessService();
        ps.setSession(session);
        ps.run();
    }

    @Override
    public void execute() throws JsonProcessingException {
        IUserMessage um = Application.getBean(this, IUserMessage.class);
        for (String uid : um.getWaitList()) {
            log.info("开始处理异步任务,UID=" + uid);
            processService(uid);
        }
    }

    /**
     * 处理一个服务
     */
    private void processService(String taskId) throws JsonProcessingException {
        // 此任务可能被其它主机抢占
        IUserMessage um = Application.getBean(this, IUserMessage.class);
        DataRow ds = um.readAsyncService(taskId);
        if (ds == null) {
            return;
        }
        String corpNo = ds.getString("corpNo");
        String userCode = ds.getString("userCode");
        String content = ds.getString("content");
        String subject = ds.getString("subject");

        // 读取并标识为工作中,以防被其它用户抢占
        AsyncService async = new AsyncService(this);
        async.read(content);
        async.setProcess(MessageProcess.working);
        updateTaskprocess(async, taskId, subject);
        try {
            // 执行指定的数据服务
            BookHandle handle = new BookHandle(this, corpNo).setUserCode(userCode);
            ServiceSign auto = async.getSign().call(handle, async.dataIn());
            if (auto.isOk()) {
                async.setProcess(MessageProcess.ok);
            } else {
                async.setProcess(MessageProcess.error);
            }
            async.dataOut().appendDataSet(auto.dataOut(), true);
            async.dataOut().head().setValue("_message_", auto.dataOut().message());
            updateTaskprocess(async, taskId, subject);
        } catch (Throwable e) {
            e.printStackTrace();
            async.setProcess(MessageProcess.error);
            async.dataOut().head().setValue("_message_", e.getMessage());
            updateTaskprocess(async, taskId, subject);
        }
    }

    /**
     * 更新队列的消息状态
     */
    private void updateTaskprocess(AsyncService async, String msgId, String subject) {
        async.setProcessTime(new Datetime().toString());
        IUserMessage um = Application.getBean(this, IUserMessage.class);
        if (!um.updateAsyncService(msgId, async.toString(), async.getProcess())) {
            throw new RuntimeException(String.format("msgId %s not find.", msgId));
        }
        log.debug(async.getSign().id() + ":" + subject + ":" + async.getProcess().getTitle());
    }
}


text:
package org.apache.servicecomb.swagger.generator.core;

/**
 * 通过spi自动注入到所有的GeneratorContext实例中去
 */
public interface CommonParameterTypeProcessor extends ParameterTypeProcessor {
  Class<?> getParameterType();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<com.zhuinden.navigationexampleview.screens.HomeView xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical">
        <TextView
            android:layout_margin="32dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Home"
            android:textSize="28sp" />

        <EditText
            android:id="@+id/home_edittext"
            android:gravity="center"
            android:hint="Type some text here"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ems="8"/>
        <Button
            android:id="@+id/home_button"
            android:layout_margin="32dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Go to Other View"/>
    </LinearLayout>

</com.zhuinden.navigationexampleview.screens.HomeView>


text:
These settings apply only when `--nodejs` is specified on the command line.
Please also specify `--node-sdks-folder=<path to root folder of your azure-sdk-for-node clone>`.

``` yaml $(nodejs)
nodejs:
  azure-arm: true
  package-name: azure-arm-eventhub
  output-folder: $(node-sdks-folder)/lib/services/eventHubManagement/lib
```


text:
from __future__ import unicode_literals
import os

AUTHOR = u'Sean Azlin'
SITENAME = u'Sean Azlin'
SITEURL = ''
THEME = './pelican-bootstrap3'
BOOTSTRAP_THEME = 'spacelab'
BOOTSTRAP_NAVBAR_INVERSE = True
CUSTOM_CSS = 'css/custom.css'
PATH = 'content'
TIMEZONE = 'US/Pacific'

DEFAULT_LANG = u'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None

# Blogroll
LINKS = (('Project rheTOracle', 'http://ec2-54-213-173-105.us-west-2.compute.amazonaws.com/'),
               ('Code Fellows - Seattle', 'http://codefellows.org'),
               ('RIT', 'http://rit.edu'),)

# Social widget
SOCIAL = (('Twitter', 'http://twitter.com/SeanAzlin2'),
          ('LinkedIn', 'http://linkedin.com/in/seanazlin'),
          ('GitHub', 'http://github.com/sazlin'),)

OPEN_GRAPH_IMAGE = "../images/sean1.jpg"
AVATAR = "../images/sean1.jpg"
ABOUT_ME = """
Software Engineer with 7 years of experience building world-class software. Microsoft Alum, RIT Alum, Code Fellow, and Certified Scrum Master (CSM).
"""
GITHUB_USER = 'sazlin'
GITHUB_REPO_COUNT = 8

DISPLAY_ARTICLE_INFO_ON_INDEX = False
DISPLAY_PAGES_ON_MENU = True

TAG_CLOUD_STEPS = 1
TAG_CLOUD_MAX_ITEMS = 4

DEFAULT_PAGINATION = False

READERS = {'html': None}

STATIC_PATHS = [
    'images',
    'CNAME',
    'css',
    ]

# # Tell Pelican to change the path to 'static/custom.css' in the output dir
# EXTRA_PATH_METADATA = {
#     'extra/custom.css': {'path': 'static/custom.css'}
# }

GITHUB_URL = 'http://github.com/sazlin'
TWITTER_USERNAME = 'SeanAzlin2'
TWITTER_WIDGET_ID = 485870315860287488

# Where to look for plugins
PLUGIN_PATHS = ['./pelican-plugins']
# Which plugins to enable
PLUGINS = [
    'liquid_tags.img',
    # 'disqus_static'
]

DISQUS_SITENAME = 'seanazlin'
# DISQUS_SECRET_KEY = os.environ.get('DISQUS_API_SECRET')
# DISQUS_PUBLIC_KEY = os.environ.get('DISQUS_API_KEY')

# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Stapelia vetula Masson

### Remarks
null


text:
package com.mikesaurio.pastillero.bean;

/**
 * Bean que contiene todos los datos de una pastilla
 * @author mikesaurio
 *
 */
public class DatosBean {

	String id[];
	String nombre[];
	String fecha_inicio[];
	String fecha_fin[];
	String hora_inicio[];
	String frecuencia[];

	/**
	 * Obtener los id del medicamento
	 * @return (String[]) id de los medicamentos
	 */
	public String[] getId() {
		return id;
	}

	/**
	 * asigna id a los medicamentos
	 * @param id (String)
	 */
	public void setId(String[] id) {
		this.id = id;
	}
	/**
	 * Obtener los nombres del medicamento
	 * @return (String[]) nombres de los medicamentos
	 */
	public String[] getNombre() {
		return nombre;
	}

	/**
	 * asigna nombre a los medicamentos
	 * @param nombre (String)
	 */
	public void setNombre(String[] nombre) {
		this.nombre = nombre;
	}
	/**
	 * Obtener los fecha inicio del medicamento
	 * @return (String[]) fechas inicio de los medicamentos
	 */
	public String[] getFecha_inicio() {
		return fecha_inicio;
	}

	/**
	 * asigna fecha inicio a los medicamentos
	 * @param fecha_inicio (String)
	 */
	public void setFecha_inicio(String[] fecha_inicio) {
		this.fecha_inicio = fecha_inicio;
	}
	/**
	 * Obtener los fecha final del medicamento
	 * @return (String[]) fechas finales de los medicamentos
	 */
	public String[] getFecha_fin() {
		return fecha_fin;
	}

	/**
	 * asigna fecha fin a los medicamentos
	 * @param fecha_fin (String)
	 */
	public void setFecha_fin(String[] fecha_fin) {
		this.fecha_fin = fecha_fin;
	}
	/**
	 * Obtener los hora inicial del medicamento
	 * @return (String[]) horas iniciales de los medicamentos
	 */
	public String[] getHora_inicio() {
		return hora_inicio;
	}

	/**
	 * asigna hora inicio a los medicamentos
	 * @param hora_inicio (String)
	 */
	public void setHora_inicio(String[] hora_inicio) {
		this.hora_inicio = hora_inicio;
	}
	/**
	 * Obtener las frecuencia del medicamento
	 * @return (String[]) frecuencas de los medicamentos
	 */
	public String[] getFrecuencia() {
		return frecuencia;
	}

	/**
	 * asigna frecuencia a los medicamentos
	 * @param frecuencia (String)
	 */
	public void setFrecuencia(String[] frecuencia) {
		this.frecuencia = frecuencia;
	}

}


text:
// Inspired and largely copied from Core (https://github.com/zynga/core) LICENSE-MIT

(function(global) {

	var doc = global.document,
		ua = navigator.userAgent;

	// the following is a feature sniff for the ability to set async=false on dynamically created script elements, as proposed to the W3C
	// RE: http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
	var supportsScriptAsync = doc.createElement("script").async === true;
	var SUPPORTS_PARALLEL = supportsScriptAsync || (ua.indexOf('Gecko') > -1 && ua.indexOf('rv:') > -1);
	var dynamicExtension = "?r=" + Date.now();

	var assignCallback = function(elem, value) {
		elem.onload = elem.onerror = value;
		if (!("onload" in elem)) {
			elem.onreadystatechange = value;
		}
	};

	var loadScript = function(uri, callback, nocache) {

		var head = doc.head;
		var elem = doc.createElement("script");

		// load script via 'src' attribute, set onload/onreadystatechange listeners
		assignCallback(elem, function(e) {
			var errornous = (e || global.event).type === "error";
			if (errornous) {
				console.warn("Could not load script: " + uri);
			} else {
				var readyState = elem.readyState;
				if (readyState && readyState !== "complete" && readyState !== "loaded") {
					return;
				}
			}

			// Prevent memory leaks
			assignCallback(elem, null);

			// Execute callback
			callback(uri, errornous, elem);

		});

		elem.src = nocache ? uri + dynamicExtension : uri;

		if (supportsScriptAsync) {
			elem.async = false;
		}

		head.insertBefore(elem, head.firstChild);

		return elem;

	};

	global.__load = function(uris, callback, nocache) {

		var loading = {}; // Keys are all URIs which are currently loading
		var cache = {}; // Data cache for callback return
		var sequential = []; // List of sequential items sorted by type

		var onLoad = function(uri, errornous, data) {

			delete loading[uri];

			// Make data available for callback
			if (data != null) {
				cache[uri] = data;
			}

			// Check whether there is more to load
			for (var queued in loading) {
				return;
			}

			// Execute callback
			if (callback) {
				callback(cache);
			}
		};

		// Process all URIs
		for (var i = 0, l = uris.length; i < l; i++) {
			var currentUri = uris[i];

			// When script is not being loaded already, then start with it here
			// (Otherwise we just added the callback to the queue and wait for it to be executed)
			if (!loading[currentUri]) {

				// Register globally as loading
				loading[currentUri] = true;

				// Differenciate between loader capabilities
				if (SUPPORTS_PARALLEL) {
					loadScript(currentUri, onLoad, nocache);
				} else {
					// Sort in the URI into a type specific queue
					sequential.push(currentUri);
				}
			}
		}

		var loadNext = function() {
			var uri = sequential.shift();
			if (uri) {
				loadScript(uri, function(uri, errornous, data) {
					onLoad(uri, errornous, data);
					loadNext();
				}, nocache);
			}
		};

		loadNext();

	};

})(this);


text:
import { Meteor } from 'meteor/meteor';
import ApiLogo from '../collection';

Meteor.publish('allApiLogo', () => {
  return ApiLogo.find({
    'metadata._Resumable': {
      $exists: false,
    },
  });
});


text:
using System;
using System.ComponentModel;
using System.Drawing;
using System.ServiceProcess;
using System.Windows.Forms;

namespace ServiceManager
{
    public partial class frmServiceSettings : Form
    {
        private int statusIdx = -1;
        private int startIdx = -1;

        public bool HasChanges { get; private set; }

        public frmServiceSettings(ServiceController control)
        {
            this.InitializeComponent();
            this.currentControl = control;
            this.ResetForm();
        }

        private void btnAPPLY_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Save the changes to service settings?", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                return;
            if (this.cmbStartMode.SelectedIndex != this.startIdx)
            {
                ServiceStartMode mode = (ServiceStartMode)Enum.Parse(typeof(ServiceStartMode), this.cmbStartMode.Text);
                try
                {
                    ServiceHelper.ChangeStartMode(this.currentControl, mode);
                    this.ResetAfterApply();
                }
                catch (Exception)
                {
                    int num = (int)MessageBox.Show("Error occured while trying to set the start mode of the service.\n Try using services console to change start mode.", "Error occured", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    this.cmbStartMode.SelectedIndex = this.startIdx;
                }
            }
            if (this.cmbStatus.SelectedIndex != this.statusIdx)
            {
                if (this.cmbStatus.Text == "Stopped")
                {
                    if (MessageBox.Show(string.Format("Stop the service '{0}' ?.", (object)this.currentControl.DisplayName), "Stop Service", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        this.currentControl.Stop();
                        int num = (int)MessageBox.Show(string.Format("'{0}' service stopped.", (object)this.currentControl.DisplayName), "Service Stopped", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        this.ResetAfterApply();
                    }
                }
                else if (MessageBox.Show(string.Format("Start the service '{0}' ?.", (object)this.currentControl.DisplayName), "Start Service", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    this.currentControl.Start();
                    int num = (int)MessageBox.Show(string.Format("'{0}' service started.", (object)this.currentControl.DisplayName), "Service Stared", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    this.ResetAfterApply();
                }
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            if (this.btnCancel.Text == "Cancel")
            {
                switch (MessageBox.Show("Do you cancel changes? And quit?", "Cancel changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                {
                    case DialogResult.Yes:
                        this.Close();
                        break;

                    case DialogResult.No:
                        this.ResetForm();
                        break;
                }
            }
            else
                this.Close();
        }

        private void cmbStatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbStatus.SelectedIndex == this.statusIdx && this.cmbStartMode.SelectedIndex == this.startIdx)
            {
                this.btnAPPLY.Enabled = false;
                this.btnCancel.Text = "Close";
            }
            else
            {
                this.btnAPPLY.Enabled = true;
                this.btnCancel.Text = "Cancel";
            }
        }

        private void cmbStartMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbStatus.SelectedIndex == this.statusIdx && this.cmbStartMode.SelectedIndex == this.startIdx)
            {
                this.btnAPPLY.Enabled = false;
                this.btnCancel.Text = "Close";
            }
            else
            {
                this.btnAPPLY.Enabled = true;
                this.btnCancel.Text = "Cancel";
            }
        }

        private void ResetAfterApply()
        {
            this.btnAPPLY.Enabled = false;
            this.btnCancel.Text = "Close";
            this.startIdx = this.cmbStartMode.SelectedIndex;
            this.statusIdx = this.cmbStatus.SelectedIndex;
            int num = (int)MessageBox.Show("Service settings Saved", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            this.HasChanges = true;
        }

        private void ResetForm()
        {
            this.txtSN.Text = this.currentControl.ServiceName;
            this.txtDN.Text = this.currentControl.DisplayName;
            this.txtDes.Text = ServiceHelper.GetServiceDescription(this.txtSN.Text);
            this.statusIdx = this.cmbStatus.Items.IndexOf((object)Enum.GetName(typeof(ServiceControllerStatus), (object)this.currentControl.Status));
            this.startIdx = this.cmbStartMode.Items.IndexOf((object)Enum.GetName(typeof(ServiceStartMode), (object)ServiceHelper.GetServiceStartMode(this.txtSN.Text)));
            this.cmbStatus.SelectedIndex = this.statusIdx;
            this.cmbStartMode.SelectedIndex = this.startIdx;
            if (this.currentControl.ServiceName == "EPICentralizedDB")
                this.cmbStartMode.Enabled = false;
            this.HasChanges = false;
            this.btnCancel.Text = "Close";
        }
    }
}


text:
package net.jadler.matchers;

import net.jadler.Request;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;

/**
 * A {@link RequestMatcher} used for matching the request query string.
 */
public class QueryStringRequestMatcher extends RequestMatcher<String> {

    /**
     * Protected constructor useful only when subtyping. For creating instances of this class use
     * {@link #requestQueryString(org.hamcrest.Matcher)} instead.
     * @param pred a predicate to be applied on the query string
     */
    protected QueryStringRequestMatcher(final Matcher<? super String> pred) {
        super(pred);
    }

    /**
     * Retrieves the query string value of the given request. The value is percent-encoded.
     * @param req request to retrieve the query string from
     * @return query string value:
     *

     *
{@code null} for requests without a query string part (no ? character)

     *
an empty string for request with an empty query string part (? is present but there is no actual
     *   query string value)

     *
query string value (without the leading ? character) for requests with a query string part

     *

     */
    @Override
    public String retrieveValue(final Request req) {
        return req.getURI().getRawQuery();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected String provideDescription() {
        return "query string is";
    }

    /**
     * Factory method to create new instance of this matcher.
     * @param pred a predicate to be applied on the request query string
     * @return new instance of this matcher
     */
    @Factory
    public static QueryStringRequestMatcher requestQueryString(final Matcher<? super String> pred) {
        return new QueryStringRequestMatcher(pred);
    }
}


text:
package org.spongepowered.common.mixin.core.entity.passive;

import net.minecraft.entity.passive.EntityHorse;
import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.data.manipulator.DataManipulator;
import org.spongepowered.api.data.manipulator.mutable.entity.HorseData;
import org.spongepowered.api.data.type.HorseColor;
import org.spongepowered.api.data.type.HorseStyle;
import org.spongepowered.api.data.type.HorseVariant;
import org.spongepowered.api.data.value.mutable.Value;
import org.spongepowered.api.entity.living.animal.Horse;
import org.spongepowered.api.text.translation.Translation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.data.manipulator.mutable.entity.SpongeHorseData;
import org.spongepowered.common.data.processor.common.HorseUtils;
import org.spongepowered.common.data.util.DataConstants;
import org.spongepowered.common.data.value.mutable.SpongeValue;

import java.util.List;

@Mixin(EntityHorse.class)
public abstract class MixinEntityHorse extends MixinEntityAnimal implements Horse {

    @Shadow public abstract int getHorseType();

    @Override
    public Translation getTranslation() {
        final HorseData horseData = getHorseData();
        final HorseVariant horseVariant = horseData.variant().get();
        return horseVariant.getTranslation();
    }

    @Override
    public HorseData getHorseData() {
        return new SpongeHorseData(HorseUtils.getHorseColor((EntityHorse) (Object) this),
                HorseUtils.getHorseStyle((EntityHorse) (Object) this),
                HorseUtils.getHorseVariant(this.getHorseType()));
    }

    @Override
    public Value<HorseVariant> variant() {
        return new SpongeValue<>(Keys.HORSE_VARIANT, DataConstants.Horse.DEFAULT_VARIANT);
    }

    @Override
    public Value<HorseStyle> style() {
        return new SpongeValue<>(Keys.HORSE_STYLE, DataConstants.Horse.DEFAULT_STYLE, HorseUtils.getHorseStyle((EntityHorse) (Object) this));
    }

    @Override
    public Value<HorseColor> color() {
        return new SpongeValue<>(Keys.HORSE_COLOR, DataConstants.Horse.DEFAULT_COLOR, HorseUtils.getHorseColor((EntityHorse) (Object) this));
    }

    @Override
    public void supplyVanillaManipulators(List<DataManipulator<?, ?>> manipulators) {
        super.supplyVanillaManipulators(manipulators);
        manipulators.add(getHorseData());
    }
}


text:
import React from "react";
import { PureFarmEvents } from "../farm_events";
import {
  calendarRows,
} from "../../__test_support__/farm_event_calendar_support";
import { render, shallow, mount } from "enzyme";
import { get } from "lodash";
import { defensiveClone } from "../../util";
import { FarmEventProps } from "../../farm_designer/interfaces";

describe("<PureFarmEvents/>", () => {
  const fakeProps = (): FarmEventProps => ({
    timezoneIsSet: true,
    calendarRows,
  });

  it("sorts items correctly", () => {
    const results = render(<PureFarmEvents {...fakeProps()} />);
    const rows = results
      .find(".farm-event-data-time")
      .toArray()
      .map(x => x.children)
      .map(x => x[0])
      .map(x => get(x, "data", "NOT_FOUND"));
    expect(rows).not.toContain("NOT_FOUND");
    expect(rows.length).toEqual(21);
    expect(rows[0]).toEqual("12:05pm");
    expect(rows[2]).toEqual("02:00pm");
  });

  it("renders FarmEvent lacking a subheading", () => {
    const p = fakeProps();
    const row = [defensiveClone(calendarRows[0])];
    row[0].items = [{
      mmddyy: "072417",
      sortKey: 1500915900,
      timeStr: "12:05pm",
      heading: "Every 4 hours",
      executableId: 25,
      subheading: "",
      id: 79,
      color: "gray",
    }];
    p.calendarRows = row;
    const results = render(<PureFarmEvents {...p} />);
    expect(results.text()).toContain("Every 4 hours");
    expect(results.find(".farm-event-data-block").hasClass("gray")).toBeFalsy();
  });

  it("filters farm events: finds none", () => {
    const wrapper = mount(<PureFarmEvents {...fakeProps()} />);
    wrapper.find("input").simulate("change",
      { currentTarget: { value: "no match" } });
    expect(wrapper.text()).not.toContain("every 4 hours");
  });

  it("filters farm events: finds some", () => {
    const wrapper = mount(<PureFarmEvents {...fakeProps()} />);
    wrapper.find("input").simulate("change",
      { currentTarget: { value: "every 4 hours" } });
    expect(wrapper.text().toLowerCase()).toContain("every 4 hours");
  });

  it("resets calendar", () => {
    const mockScrollTo = jest.fn();
    Object.defineProperty(document, "querySelector", {
      value: () => ({ scrollTo: mockScrollTo }), configurable: true
    });
    const wrapper = shallow(<PureFarmEvents {...fakeProps()} />);
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const instance = wrapper.instance() as any;
    instance.setState({ searchTerm: "farm events" });
    instance.resetCalendar();
    expect(mockScrollTo).toHaveBeenCalledWith(0, 0);
    expect(instance.state.searchTerm).toEqual("");
  });

  it("can't find panel", () => {
    Object.defineProperty(document, "querySelector", {
      value: () => { }, configurable: true
    });
    const wrapper = shallow(<PureFarmEvents {...fakeProps()} />);
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const instance = wrapper.instance() as any;
    instance.setState({ searchTerm: "farm events" });
    instance.resetCalendar();
    expect(instance.state.searchTerm).toEqual("");
  });

  it("has add new farm event link", () => {
    const wrapper = mount(<PureFarmEvents {...fakeProps()} />);
    expect(wrapper.html()).toContain("fa-plus");
    expect(wrapper.html()).toContain("/app/designer/events/add");
  });
});


text:
const sensorModuleConstants = require('../../../../../../shared/vm/modules/sensorModuleConstants');
const getImage              = require('../../../../data/images').getImage;
const Sensor                = require('./Sensor').Sensor;

exports.GyroSensor = class extends Sensor {
    initDOM(parentNode) {
        this.initMainDom(
            parentNode,
            'images/ev3/gyro64.png',
            true, // With mode
            [
                this.getNumberValueInput()
            ]
        );
        this._refs.numberValue.className = 'value';
    }

    onChangeValue(value) {
        this._numberInputElement.value = value;
    }

    getContextMenuOptions() {
        return [
            'GYRO_ANGLE',
            'GYRO_RATE',
            'GYRO_FAST',
            'GYRO_RATE_AND_ANGLE',
            'GYRO_CALIBRATION'
        ];
    }

    onConnected() {
        this._numberInputElement.disabled = 'disabled';
    }

    onDisconnected() {
        this._numberInputElement.disabled = '';
    }
};


text:
import { StateStore } from './StateStore';
export declare class State {
    private _id;
    private _data;
    private _created;
    private _request_type;
    constructor({ id, data, created, request_type }?: any);
    get id(): any;
    get data(): any;
    get created(): number;
    get request_type(): any;
    toStorageString(): string;
    static fromStorageString(storageString: string): State;
    static clearStaleState(storage: StateStore, age: number): Promise<void>;
}


text:
/*************************************************************************

         name: indites.pl
      version:
  description: InDiTeS specification file
       author: Staffan Larsson

*************************************************************************/

/*========================================================================
     File Search Paths
========================================================================*/

%:- assertz(user:file_search_path(home, '$HOME')).

:- assertz(user:file_search_path(home, '/users/ling/sl')).

% search path for trindikit infrastructure, datatypes, and modules

:- assertz(user:library_directory(home('Jobb/TRINDI/TRINDIKIT/trindikit1.1'))).
:- assertz(user:library_directory(home('Jobb/TRINDI/TRINDIKIT/trindikit1.1/Datatypes'))).
:- assertz(user:library_directory(home('Jobb/TRINDI/TRINDIKIT/trindikit1.1/Modules'))).
:- assertz(user:library_directory(home('Jobb/TRINDI/InDiTeS'))).

/*========================================================================
     Misc.
========================================================================*/

:- op( 850, xfx, '::' ).

:- ensure_loaded( library(lists) ).

/*========================================================================
   Select datatypes

   Speficies a list of datatypes to be loaded. Each item DataType in the
   list corresponds to a file DataType.pl in the search path.
========================================================================*/

selected_datatypes([standard, record, set, stack, stackset, assocset, indites_datatypes]).

/*========================================================================
   Select modules

   Each module spec has the form Predicate:FileName, where Predicate is the
   unary predicate used to call the module, and FileName.pl is the a file
   in the search path containing the module specification
========================================================================*/

selected_modules([ control: controlT,
		   input : input_simpletext,
		   interpret : interpret_simple1,
		   update : updateT,
		   select : select,
		   generate : generate_simple1,
		   output : output_simpletext
		 ]).

% dme_module/1 - spefifies which modules have unlimited access to TIS

dme_modules([ update, select ]).

/*========================================================================
   Select resources

   Speficies a list of resources to be loaded. Each item
   ResourceFile in the list corresponds to a  a file ResourceFile.pl
   in the search path. The file defines a resource object with the same
   name as the file.
========================================================================*/

selected_resources( [lexicon_homecentre_english, domain_homecentre] ).

/*========================================================================
   Select macro file

   MacroFile.pl is the a file in the search path containing the macro
   definitions

========================================================================*/

selected_macro_file( indites_macros ).

/*========================================================================
   Select type of resource interface: datatypes or predicates
========================================================================*/

% resource_interface( datatypes ).

/*========================================================================
   operations to execute on TIS reset
========================================================================*/

reset_operations( [ set(program_state, run),
		    set( lexicon, lexicon-Domain-Lang ),
		    set( domain, domain-Domain ),
		    % add#rec(shared^com,(task(instruct_exec(reinstall(print_head))))),
		    push#rec(private^agenda, inform(task(instruct_exec(reinstall(print_head)))))]):-
	flag( language, Lang ),
	flag( domain, Domain ).

/*========================================================================
   Load the TRINDIKIT, including selected modules and datatypes

   assumes the following:

   - the trindikit.pl file is available in the search path, in a directory
     which contains the complete and unaltered trindikit

   - selected_modules/1 and selected_datatypes/1 are defined in module user

   - all selected modules and datatypes are in the search path

   - for each datatype D, there is a file D.pl containing the datatype
     definition, and a file print_D.pl defining print_D/1, in the search path

   - for any modules requiring algorithm specifications, these specs are
     in the search path and have the name specified in the module definition

   - there is (may be) a file user_flags.pl in the search path speficying additional
     flags

   - there is a file resource_interfaces.pl in the search path, which imports
     resources and defines resource interfaces as typed objects or
     simple predicates

   - there is a (possibly empty) file macros.pl in the search path

========================================================================*/

:- ensure_loaded( library(trindikit) ).

/*========================================================================
   Set flags
========================================================================*/

:- setflag(version,standalone).
:- setflag(show_rules,yes).
:- setflag(show_state,all).

/*========================================================================
   Run
========================================================================*/

run :-
	setflag( domain, homecentre ),
	setflag( language, english ),
	reset,
	control.


text:
import * as React from 'react';
import * as classNames from 'classnames';
interface TextareaProps extends BizuiProps {
    label?: string | React.ReactNode,
    type?: 'text' | 'tel' | 'number' | 'password',
    name?: string,
    value?: string,
    placeholder?: string,
    disabled?: boolean,
    clear?: boolean,
    max?: number,
    onChange?: Function,
    onBlur?: Function,
    onFocus?: Function,
    error?: boolean,
    onErrorTap?: Function,
    labelWidth?: string,
    onTouchTap?: Function,
    defaultValue?: string,
    rows?: number,
    autoHeight?: boolean,
    maxHeight?: string,
    minHeight?: string,
    showCount?: boolean
}

const styles = {
    shadow: {
        visibility: 'hidden',
        position: 'absolute',
        height: 'initial',
    }
}

export default class TextareaItem extends React.Component<TextareaProps, any>{
    static defaultProps = {
        prefixCls: 'biz-textarea',
        className: '',
        label: '',
        type: 'text',
        placeholder: '',
        disabled: false,
        clear: true,
        onChange: ()=>{},
        onBlur: ()=>{},
        onFocus: ()=>{},
        error: false,
        onErrorTap: ()=>{},
        defaultValue: '',
        rows: 1,
        maxHeight: 'none',
        minHeight: 'none',
        autoHeight: false,
        showCount: false,
    }
    state = {
        value: this.props.defaultValue,
        showClear: false,
        height: 'auto'
    }
    _textarea = null
    _shadow = null
    isFocus = false
    componentWillUnmount(){
        this._textarea && this._textarea.blur();
    }
    componentDidMount() {
        const {value, defaultValue} = this.props;
        const val = value === undefined ? defaultValue : value;
        this.updateState(val as string);
    }
    componentWillReceiveProps(newProps) {
        if (newProps.value !== undefined && newProps.value !== this.state.value) {
            this.updateState(newProps.value);
        }
    }
    getHeight(value){
        this._shadow.value = value
        return this._shadow.scrollHeight
    }
    updateState(val = ''){
        const {clear, autoHeight, max} = this.props;
        if(typeof max === 'number'){
            val = val.slice(0, max || 0);
        }
        const state = {value: val, showClear: this.isFocus && clear && val.length > 0, height: 'auto'}
        if(autoHeight) {
            const height = this.getHeight(val);
            state.height = height;
        }
        this.setState(state);
    }
    onChange = (e) => {
        let val = e.target.value;
        const {clear, onChange, value, max} = this.props;
        if(typeof max === 'number'){
            val = val.slice(0, max || 0);
        }
        if(value !== undefined) {
            onChange(val)
            return;
        }
        if(val !== this.state.value) {
            this.updateState(val);
            onChange(val)
        }
    }
    onFocus = () => {
        this.isFocus = true;
        const {clear, onFocus} = this.props;
        const val = this.state.value;
        onFocus(val);
        this.updateState(val);
    }
    onBlur = () => {
        this.isFocus = false
        const val = this.state.value
        this.props.onBlur(val);
        this.updateState(val);
    }
    clearValue = (e) => {
        e.stopPropagation();
        e.preventDefault();
        if(this.props.value === undefined) {
            this.updateState();
        }
        this.props.onChange('');
    }
    onTouchTap=(e)=>{
        const {disabled, onTouchTap} = this.props;
        onTouchTap && onTouchTap();
    }
    render(){
        const {prefixCls, className, type, label, rows, error, name, placeholder, onErrorTap, max,showCount, labelWidth,minHeight, maxHeight, disabled, clear} = this.props;
        const textareaItemClass = classNames({
            [`${prefixCls}`]: true,
            [className]: true,
            [`${prefixCls}-disabled`]: disabled
        });
        const {height, value, showClear} = this.state;
        const textareaDisabled = disabled ? {disabled: 'disabled'} : '';
        return(

                <div className={`${prefixCls}-label`} style={{width: labelWidth}}>{label}

                <div className={`${prefixCls}-val`}>
                    <textarea
                        style={styles.shadow}
                        ref={(c) => this._shadow = c}
                        defaultValue={this.props.defaultValue}
                        readOnly={true}
                        onChange={()=>{}}
                        rows={1}
                    />
                    <textarea
                        style={{height: height, maxHeight: maxHeight, minHeight: minHeight}}
                        onTouchTap={this.onTouchTap}
                        placeholder={placeholder}
                        ref={(c) => this._textarea = c}
                        type={type}
                        value={value}
                        onChange={this.onChange}
                        onBlur={this.onBlur}
                        onFocus={this.onFocus}
                        name={name}
                        rows={rows}
                        {...textareaDisabled}
                    />
                    {showCount? <span className={`${prefixCls}-count`}>
                        {value.length}/{max}
                     : null}

                {clear ? <div className={`${prefixCls}-clear`} style={{visibility: showClear?'visible':'hidden'}} onTouchTap={this.clearValue}>
 : null}
                {error ? <div className={`${prefixCls}-error`} onTouchTap={onErrorTap}>
 : null}

        )
    }
}


text:
import { ArrayBufferBuilder } from "../../../../utils/ArrayBufferBuilder";
import { PokerCommandHeaderSerializer } from "../../core/serializers/PokerCommandHeaderSerializer";
import { PokerCommandHeader } from "../../core/data/PokerCommandHeader";
import { SrvSSLDataCommand } from "../commands/SrvSSLDataCommand";
import { SrvSSLDataData } from "../data/SrvSSLDataData";
import { SrvSSLDataDataSerializer } from "./SrvSSLDataDataSerializer";

export class SrvSSLDataCommandSerializer {
	public static serialize(buffer: ArrayBufferBuilder, command: SrvSSLDataCommand ): void {
		buffer.pointer += PokerCommandHeader.HEADER_SIZE_BYTES;
		SrvSSLDataDataSerializer.serialize(buffer, command.data);

		PokerCommandHeaderSerializer.serialize(buffer, command.header);
	}

	public static deserialize(buffer: ArrayBufferBuilder, command: SrvSSLDataCommand ): void {
		PokerCommandHeaderSerializer.deserialize(buffer, command.header);

			command.data = new SrvSSLDataData();
            SrvSSLDataDataSerializer.deserialize(buffer, command.data);
	}
}


text:
import { PromiseActionType, PromiseAction } from '../../../utils/redux';
import * as userManageService from '../../../api/user/userManageService';
export const REGIST_USER_INFO = new PromiseActionType('user/userIndex/REGIST_USER_INFO');
export const USER_LOGIN = new PromiseActionType('user/userIndex/USER_LOGIN');
export const RESET = 'user/userIndex/RESET';
export const DECRYPT_MEMBER_CK = new PromiseActionType('user/userIndex/DECRYPT_MEMBER_CK');
export function submitRegist(userRegistInfo) {
    return (dispatch) => {
        dispatch(new PromiseAction(() => userManageService.registUser(userRegistInfo), REGIST_USER_INFO.types));
    };
}
export function userLogin(userName, userPassWord, code) {
    return (dispatch, getState) => {
        dispatch(new PromiseAction(() => userManageService.userLogin(userName, userPassWord, code), USER_LOGIN.types));
    };
}
export function isUserLogin(memberCk) {
    return (dispatch, getState) => {
        dispatch(new PromiseAction(() => userManageService.isUserLogin(memberCk), DECRYPT_MEMBER_CK.types));
    };
}


text:
package protobuf

import "github.com/m3db/m3x/pool"

const (
	defaultInitBufferSize = 2880

	// The maximum supported unaggregated message size is 50MB by default.
	// This is to protect the encoder and the decoder from incurring signicant
	// memory overhead or even OOMing due to excessively large payload or
	// network packet corruption.
	defaultMaxUnaggregatedMessageSize = 50 * 1024 * 1024
)

// UnaggregatedOptions provide a set of options for the unaggregated encoder and iterator.
type UnaggregatedOptions interface {
	// SetBytesPool sets the bytes pool.
	SetBytesPool(value pool.BytesPool) UnaggregatedOptions

	// BytesPool returns the bytes pool.
	BytesPool() pool.BytesPool

	// SetInitBufferSize sets the initial buffer size.
	SetInitBufferSize(value int) UnaggregatedOptions

	// InitBufferSize returns the initial buffer size.
	InitBufferSize() int

	// SetMaxMessageSize sets the maximum message size.
	SetMaxMessageSize(value int) UnaggregatedOptions

	// MaxMessageSize returns the maximum message size.
	MaxMessageSize() int
}

type unaggregatedOptions struct {
	bytesPool      pool.BytesPool
	initBufferSize int
	maxMessageSize int
}

// NewUnaggregatedOptions create a new set of unaggregated options.
func NewUnaggregatedOptions() UnaggregatedOptions {
	p := pool.NewBytesPool(nil, nil)
	p.Init()
	return &unaggregatedOptions{
		bytesPool:      p,
		initBufferSize: defaultInitBufferSize,
		maxMessageSize: defaultMaxUnaggregatedMessageSize,
	}
}

func (o *unaggregatedOptions) SetBytesPool(value pool.BytesPool) UnaggregatedOptions {
	opts := *o
	opts.bytesPool = value
	return &opts
}

func (o *unaggregatedOptions) BytesPool() pool.BytesPool {
	return o.bytesPool
}

func (o *unaggregatedOptions) SetInitBufferSize(value int) UnaggregatedOptions {
	opts := *o
	opts.initBufferSize = value
	return &opts
}

func (o *unaggregatedOptions) InitBufferSize() int {
	return o.initBufferSize
}

func (o *unaggregatedOptions) SetMaxMessageSize(value int) UnaggregatedOptions {
	opts := *o
	opts.maxMessageSize = value
	return &opts
}

func (o *unaggregatedOptions) MaxMessageSize() int {
	return o.maxMessageSize
}


text:
package jls8.ch12;

import helper.UnitTestRunner;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 * Example 12.4.1-2.
 * Only The Class That Declares static Field Is Initialized
 */
public class Eg12_4_1_2 {

    private static class Super {
        static int taxi = 1729;
    }
    private static class Sub extends Super {
        static {
            System.out.print("Sub ");
            if (true) {
                throw new RuntimeException("BAD");
            }
        }
    }

    @Test
    public void test() {
        assertEquals(1729, Sub.taxi);
    }

    public static void main(String[] args) {
        UnitTestRunner.run(Eg12_4_1_2.class);
    }

}


text:
#include "mfcpch.h"
#include          "pithsync.h"
#include          "topitch.h"
#include          "drawtord.h"
#include          "debugwin.h"

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif

#define TO_WIN_XPOS     0       //default window pos
#define TO_WIN_YPOS     0
#define TO_WIN_NAME     "Textord"
                                 //title of window
#define DEBUG_WIN_NAME    "TODebug"
#define DEBUG_XPOS      0
#define DEBUG_YPOS      120
#define DEBUG_XSIZE     80
#define DEBUG_YSIZE     32
#define YMAX        3508
#define XMAX        2550

#define EXTERN

EXTERN BOOL_VAR (textord_show_fixed_cuts, FALSE,
"Draw fixed pitch cell boundaries");
EXTERN STRING_VAR (to_debugfile, DEBUG_WIN_NAME, "Name of debugfile");

EXTERN ScrollView* to_win = NULL;
EXTERN FILE *to_debug = NULL;

/**********************************************************************
 * create_to_win
 *
 * Create the to window used to show the fit.
 **********************************************************************/
#ifndef GRAPHICS_DISABLED

void create_to_win(ICOORD page_tr) {
  to_win = new ScrollView(TO_WIN_NAME, TO_WIN_XPOS, TO_WIN_YPOS,
                          page_tr.x() + 1, page_tr.y() + 1,
                          page_tr.x(), page_tr.y(), true);
}

void close_to_win() {
  // to_win is leaked, but this enables the user to view the contents.
  if (to_win != NULL) {
    to_win->Update();
  }
}

/**********************************************************************
 * create_todebug_win
 *
 * Create the to window used to show the fit.
 **********************************************************************/

void create_todebug_win() {  //make gradients win
  if (strcmp (to_debugfile.string (), DEBUG_WIN_NAME) != 0)
    //              create_debug_window();
    //      else
    to_debug = fopen (to_debugfile.string (), "w");
}

/**********************************************************************
 * plot_box_list
 *
 * Draw a list of blobs.
 **********************************************************************/

void plot_box_list(                      //make gradients win
                   ScrollView* win,           //window to draw in
                   BLOBNBOX_LIST *list,  //blob list
                   ScrollView::Color body_colour    //colour to draw
                  ) {
  BLOBNBOX_IT it = list;         //iterator

  win->Pen(body_colour);
  win->Brush(ScrollView::NONE);
  for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
    it.data ()->bounding_box ().plot (win);
  }
}

/**********************************************************************
 * plot_to_row
 *
 * Draw the blobs of a row in a given colour and draw the line fit.
 **********************************************************************/

void plot_to_row(                 //draw a row
                 TO_ROW *row,     //row to draw
                 ScrollView::Color colour,   //colour to draw in
                 FCOORD rotation  //rotation for line
                ) {
  FCOORD plot_pt;                //point to plot
                                 //blobs
  BLOBNBOX_IT it = row->blob_list ();
  float left, right;             //end of row

  if (it.empty ()) {
    tprintf ("No blobs in row at %g\n", row->parallel_c ());
    return;
  }
  left = it.data ()->bounding_box ().left ();
  it.move_to_last ();
  right = it.data ()->bounding_box ().right ();
  plot_blob_list (to_win, row->blob_list (), colour, ScrollView::BROWN);
  to_win->Pen(colour);
  plot_pt = FCOORD (left, row->line_m () * left + row->line_c ());
  plot_pt.rotate (rotation);
  to_win->SetCursor(plot_pt.x (), plot_pt.y ());
  plot_pt = FCOORD (right, row->line_m () * right + row->line_c ());
  plot_pt.rotate (rotation);
  to_win->DrawTo(plot_pt.x (), plot_pt.y ());
}

/**********************************************************************
 * plot_parallel_row
 *
 * Draw the blobs of a row in a given colour and draw the line fit.
 **********************************************************************/

void plot_parallel_row(                 //draw a row
                       TO_ROW *row,     //row to draw
                       float gradient,  //gradients of lines
                       inT32 left,      //edge of block
                       ScrollView::Color colour,   //colour to draw in
                       FCOORD rotation  //rotation for line
                      ) {
  FCOORD plot_pt;                //point to plot
                                 //blobs
  BLOBNBOX_IT it = row->blob_list ();
  float fleft = (float) left;    //floating version
  float right;                   //end of row

  //      left=it.data()->bounding_box().left();
  it.move_to_last ();
  right = it.data ()->bounding_box ().right ();
  plot_blob_list (to_win, row->blob_list (), colour, ScrollView::BROWN);
  to_win->Pen(colour);
  plot_pt = FCOORD (fleft, gradient * left + row->max_y ());
  plot_pt.rotate (rotation);
  to_win->SetCursor(plot_pt.x (), plot_pt.y ());
  plot_pt = FCOORD (fleft, gradient * left + row->min_y ());
  plot_pt.rotate (rotation);
  to_win->DrawTo(plot_pt.x (), plot_pt.y ());
  plot_pt = FCOORD (fleft, gradient * left + row->parallel_c ());
  plot_pt.rotate (rotation);
  to_win->SetCursor(plot_pt.x (), plot_pt.y ());
  plot_pt = FCOORD (right, gradient * right + row->parallel_c ());
  plot_pt.rotate (rotation);
  to_win->DrawTo(plot_pt.x (), plot_pt.y ());
}

/**********************************************************************
 * draw_occupation
 *
 * Draw the row occupation with points above the threshold in white
 * and points below the threshold in black.
 **********************************************************************/

void
draw_occupation (                //draw projection
inT32 xleft,                     //edge of block
inT32 ybottom,                   //bottom of block
inT32 min_y,                     //coordinate limits
inT32 max_y, inT32 occupation[], //projection counts
inT32 thresholds[]               //for drop out
) {
  inT32 line_index;              //pixel coord
  ScrollView::Color colour;                 //of histogram
  float fleft = (float) xleft;   //float version

  colour = ScrollView::WHITE;
  to_win->Pen(colour);
  to_win->SetCursor(fleft, (float) ybottom);
  for (line_index = min_y; line_index <= max_y; line_index++) {
    if (occupation[line_index - min_y] < thresholds[line_index - min_y]) {
      if (colour != ScrollView::BLUE) {
        colour = ScrollView::BLUE;
	to_win->Pen(colour);
      }
    }
    else {
      if (colour != ScrollView::WHITE) {
        colour = ScrollView::WHITE;
	to_win->Pen(colour);
      }
    }
  to_win->DrawTo(fleft + occupation[line_index - min_y] / 10.0,      (float) line_index);
  }
  colour=ScrollView::STEEL_BLUE;
  to_win->Pen(colour);
  to_win->SetCursor(fleft, (float) ybottom);
  for (line_index = min_y; line_index <= max_y; line_index++) {
     to_win->DrawTo(fleft + thresholds[line_index - min_y] / 10.0,      (float) line_index);
  }
}

/**********************************************************************
 * draw_meanlines
 *
 * Draw the meanlines of the given block in the given colour.
 **********************************************************************/

void draw_meanlines(                  //draw a block
                    TO_BLOCK *block,  //block to draw
                    float gradient,   //gradients of lines
                    inT32 left,       //edge of block
                    ScrollView::Color colour,    //colour to draw in
                    FCOORD rotation   //rotation for line
                   ) {
  FCOORD plot_pt;                //point to plot
                                 //rows
  TO_ROW_IT row_it = block->get_rows ();
  TO_ROW *row;                   //current row
  BLOBNBOX_IT blob_it;           //blobs
  float right;                   //end of row
  to_win->Pen(colour);
  for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
    row = row_it.data ();
    blob_it.set_to_list (row->blob_list ());
    blob_it.move_to_last ();
    right = blob_it.data ()->bounding_box ().right ();
    plot_pt =
      FCOORD ((float) left,
      gradient * left + row->parallel_c () + row->xheight);
    plot_pt.rotate (rotation);
  to_win->SetCursor(plot_pt.x (), plot_pt.y ());
    plot_pt =
      FCOORD ((float) right,
      gradient * right + row->parallel_c () + row->xheight);
    plot_pt.rotate (rotation);
    to_win->DrawTo (plot_pt.x (), plot_pt.y ());
  }
}

/**********************************************************************
 * plot_word_decisions
 *
 * Plot a row with words in different colours and fuzzy spaces
 * highlighted.
 **********************************************************************/

void plot_word_decisions(              //draw words
                         ScrollView* win,   //window tro draw in
                         inT16 pitch,  //of block
                         TO_ROW *row   //row to draw
                        ) {
  ScrollView::Color colour = ScrollView::MAGENTA;       //current colour
  ScrollView::Color rect_colour;            //fuzzy colour
  inT32 prev_x;                  //end of prev blob
  inT16 blob_count;              //blobs in word
  BLOBNBOX *blob;                //current blob
  TBOX blob_box;                  //bounding box
                                 //iterator
  BLOBNBOX_IT blob_it = row->blob_list ();
  BLOBNBOX_IT start_it = blob_it;//word start

  rect_colour = ScrollView::BLACK;
  prev_x = -MAX_INT16;
  blob_count = 0;
  for (blob_it.mark_cycle_pt (); !blob_it.cycled_list (); blob_it.forward ()) {
    blob = blob_it.data ();
    blob_box = blob->bounding_box ();
    if (!blob->joined_to_prev ()
    && blob_box.left () - prev_x > row->max_nonspace) {
      if ((blob_box.left () - prev_x >= row->min_space
        || blob_box.left () - prev_x > row->space_threshold)
      && blob_count > 0) {
        if (pitch > 0 && textord_show_fixed_cuts)
          plot_fp_cells (win, colour, &start_it, pitch, blob_count,
            &row->projection, row->projection_left,
            row->projection_right,
            row->xheight * textord_projection_scale);
        blob_count = 0;
        start_it = blob_it;
      }
      if (colour == ScrollView::MAGENTA)
        colour = ScrollView::RED;
      else
        colour = (ScrollView::Color) (colour + 1);
      if (blob_box.left () - prev_x < row->min_space) {
        if (blob_box.left () - prev_x > row->space_threshold)
          rect_colour = ScrollView::GOLDENROD;
        else
          rect_colour = ScrollView::CORAL;
        //fill_color_index(win, rect_colour);
        win->Brush(rect_colour);
        win->Rectangle (prev_x, blob_box.bottom (),
          blob_box.left (), blob_box.top ());
      }
    }
    if (!blob->joined_to_prev ())
      prev_x = blob_box.right ();
    if (blob->blob () != NULL)
                                 //draw it
      blob->blob ()->plot (win, colour, colour);
    if (blob->cblob () != NULL)
      blob->cblob ()->plot (win, colour, colour);
    if (!blob->joined_to_prev ()
      && (blob->blob () != NULL || blob->cblob () != NULL))
      blob_count++;
  }
  if (pitch > 0 && textord_show_fixed_cuts && blob_count > 0)
    plot_fp_cells (win, colour, &start_it, pitch, blob_count,
      &row->projection, row->projection_left,
      row->projection_right,
      row->xheight * textord_projection_scale);
}

/**********************************************************************
 * plot_fp_cells
 *
 * Make a list of fixed pitch cuts and draw them.
 **********************************************************************/

void plot_fp_cells(                        //draw words
                   ScrollView* win,             //window tro draw in
                   ScrollView::Color colour,          //colour of lines
                   BLOBNBOX_IT *blob_it,   //blobs
                   inT16 pitch,            //of block
                   inT16 blob_count,       //no of real blobs
                   STATS *projection,      //vertical
                   inT16 projection_left,  //edges //scale factor
                   inT16 projection_right,
                   float projection_scale) {
  inT16 occupation;              //occupied cells
  TBOX word_box;                  //bounding box
  FPSEGPT_LIST seg_list;         //list of cuts
  FPSEGPT_IT seg_it;
  FPSEGPT *segpt;                //current point

  if (pitsync_linear_version)
    check_pitch_sync2 (blob_it, blob_count, pitch, 2, projection,
      projection_left, projection_right,
      projection_scale, occupation, &seg_list, 0, 0);
  else
    check_pitch_sync (blob_it, blob_count, pitch, 2, projection, &seg_list);
  word_box = blob_it->data ()->bounding_box ();
  for (; blob_count > 0; blob_count--)
    word_box += box_next (blob_it);
  seg_it.set_to_list (&seg_list);
  for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
    segpt = seg_it.data ();
    if (segpt->faked) {
         colour = ScrollView::WHITE;
         win->Pen(colour);  }
    else {
      win->Pen(colour); }
    win->Line(segpt->position (), word_box.bottom (),segpt->position (), word_box.top ());
  }
}

/**********************************************************************
 * plot_fp_cells2
 *
 * Make a list of fixed pitch cuts and draw them.
 **********************************************************************/

void plot_fp_cells2(                        //draw words
                    ScrollView* win,             //window tro draw in
                    ScrollView::Color colour,          //colour of lines
                    TO_ROW *row,            //for location
                    FPSEGPT_LIST *seg_list  //segments to plot
                   ) {
  TBOX word_box;                  //bounding box
  FPSEGPT_IT seg_it = seg_list;
                                 //blobs in row
  BLOBNBOX_IT blob_it = row->blob_list ();
  FPSEGPT *segpt;                //current point

  word_box = blob_it.data ()->bounding_box ();
  for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
    word_box += box_next (&blob_it);
  for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
    segpt = seg_it.data ();
    if (segpt->faked) {
         colour = ScrollView::WHITE;
         win->Pen(colour); }
    else {
     win->Pen(colour); }
     win->Line(segpt->position (), word_box.bottom (),segpt->position (), word_box.top ());
  }
}

/**********************************************************************
 * plot_row_cells
 *
 * Make a list of fixed pitch cuts and draw them.
 **********************************************************************/

void plot_row_cells(                       //draw words
                    ScrollView* win,            //window tro draw in
                    ScrollView::Color colour,         //colour of lines
                    TO_ROW *row,           //for location
                    float xshift,          //amount of shift
                    ICOORDELT_LIST *cells  //cells to draw
                   ) {
  TBOX word_box;                  //bounding box
  ICOORDELT_IT cell_it = cells;
                                 //blobs in row
  BLOBNBOX_IT blob_it = row->blob_list ();
  ICOORDELT *cell;               //current cell

  word_box = blob_it.data ()->bounding_box ();
  for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
    word_box += box_next (&blob_it);
  win->Pen(colour);
  for (cell_it.mark_cycle_pt (); !cell_it.cycled_list (); cell_it.forward ()) {
    cell = cell_it.data ();
    win->Line(cell->x () + xshift, word_box.bottom (), cell->x () + xshift, word_box.top ());
  }
}

#endif  // GRAPHICS_DISABLED


text:
{% import 'macros/_components.html' as c %}

{% macro text_input(field, errors) %}

  {{ field.label(class='control-label') }}
  {% if field.description %}
    {{ c.hint(field.description) }}
  {% endif %}
  {{ field(class='form-control', placeholder=field.label.text) }}
  {% for error in errors %}
    {{ error }}
  {% endfor %}

{% endmacro %}

{% macro select(field, errors) %}

  {{ field.label(class='control-label') }}
  {% if field.description %}
    {{ c.hint(field.description) }}
  {% endif %}
  {{ field(class='form-control') }}
  {% for error in errors %}
    {{ error }}
  {% endfor %}

{% endmacro %}

{% macro checkbox(field, errors) %}

    {{ field }}
    {{ field.label.text }}
    {% if field.description %}
      {{ c.hint(field.description) }}
    {% endif %}

  {% for error in errors %}
    {{ error }}
  {% endfor %}

{% endmacro %}

{% macro submit(content, class="btn btn-default btn-primary", form_group=True) %}
  {% if form_group %}

  {% endif %}
    <button type="submit" class="{{ class }}">{{ content }}</button>
  {% if form_group %}

  {% endif %}
{% endmacro %}

{% macro textarea(field, errors) %}

  {{ field.label(class='control-label') }}
  {% if field.description %}
    {{ c.hint(field.description) }}
  {% endif %}
  {{ field(class='form-control', placeholder=field.label.text, rows="10") }}
  {% for error in errors %}
    {{ error }}
  {% endfor %}

{% endmacro %}


text:
import * as applicationModule from "application";

var _isInit: boolean = false;

var mCallbackManager;
var loginManager;

export function init(loginBehavior? : any): boolean {
    //fb initialization
  loginManager = FBSDKLoginManager.alloc().init();

  if (loginManager) {
    //This solve the case when user changes accounts error code 304
    loginManager.logOut();
    //Set the loginBehavior if there is one
    if (loginBehavior) {
      loginManager.loginBehavior = loginBehavior;
    }
    _isInit = true;
    return true;
   }
   else {
   return false;
   }
  }

export function registerCallback(successCallback: any, cancelCallback: any, failCallback: any) {
    if (_isInit) {
      mCallbackManager= function(result: FBSDKLoginManagerLoginResult, error: NSError) {

        if (error) {
          failCallback(error);
          return;
        }
        //something went really wrong no error and no result
        if (!result) {
          failCallback("Null error");
          return;
        }

        if (result.isCancelled) {
          cancelCallback();
          return;
        }

        if (result.token) {
          successCallback(result);
        }
        else {
          failCallback("Could not acquire an access token");
          return;
        }
      }
    }
  }
export function logInWithPublishPermissions(permissions: string[]) {
    if (_isInit) {
      loginManager.logInWithPublishPermissionsHandler(permissions, mCallbackManager);
    }
  }
export function logInWithReadPermissions(permissions: string[]) {
    if (_isInit) {
    loginManager.logInWithReadPermissionsHandler(permissions, mCallbackManager);
    }
}


text:
<component name="libraryTable">
  <library name="Maven: org.apache.commons:commons-email:1.1">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-email/1.1/commons-email-1.1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-email/1.1/commons-email-1.1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-email/1.1/commons-email-1.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
require 'sinatra/base'

class TestApp < Sinatra::Base
  get '/' do
    "test app"
  end
end