text:
<?php

namespace Yucca\Component\Selector\SourceFactory;

use \Yucca\Component\Selector\Source\Memcache;
use \Yucca\Component\ConnectionManager;

class MemcacheFactory implements SelectorSourceFactoryInterface
{
    /**
     * @var \Yucca\Component\ConnectionManager
     */
    protected $connectionManager;

    /**
     * Constructor
     * @param \Yucca\Component\ConnectionManager $connectionManager
     */
    public function __construct(ConnectionManager $connectionManager) {
        $this->connectionManager = $connectionManager;
    }

    /**
     * Build source
     * @return \Yucca\Component\Selector\Source\Memcache
     */
    public function getSource() {
        $toReturn = new Memcache();
        $toReturn->setConnectionManager($this->connectionManager);

        return $toReturn;
    }
}


text:
from neutron_lib.api.definitions import agent
from neutron_lib.tests.unit.api.definitions import base

class AgentDefinitionTestCase(base.DefinitionBaseTestCase):
    extension_module = agent
    extension_resources = (agent.COLLECTION_NAME,)
    extension_attributes = ('topic', 'agent_type', 'created_at',
                            'configurations', 'heartbeat_timestamp',
                            'binary', 'started_at', 'host', 'alive',)

redpajama_set_name: RedPajamaGithub


text:
import moment from 'moment'

export interface Service {
  identifier: string
  start: string
  youtube: string
}

export interface Sermon {
  date: string
  series: string
  title: string
  description: string
  speaker: string
  tags: string
  services: Service[]
}

export function getImageUrl(sermon: Sermon): string {
  return `https://i.ytimg.com/vi/${sermon.services[0].youtube}/hqdefault.jpg`
}

export function isToday(sermon: Sermon): boolean {
  const today = moment().startOf('day')
  return today.isSame(moment(sermon.date))
}

type DeepPartial<T> = {
  [P in keyof T]?: DeepPartial<T[P]>
}

export type PartialSermon = DeepPartial<Sermon>


text:
<?php

namespace PHPExiftool\Driver\Tag\Nikon;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class Face6Position extends AbstractTag
{

    protected $Id = 24;

    protected $Name = 'Face6Position';

    protected $FullName = 'Nikon::FaceDetect';

    protected $GroupName = 'Nikon';

    protected $g0 = 'MakerNotes';

    protected $g1 = 'Nikon';

    protected $g2 = 'Image';

    protected $Type = 'int16u';

    protected $Writable = true;

    protected $Description = 'Face 6 Position';

    protected $flag_Permanent = true;

    protected $MaxLength = 4;
}


text:
package com.lingdong.spring4.main;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;

/**
 * Created by lingdong on 2016/5/7 0007.
 */
public class OpenSession {
    private static final SessionFactory ourSessionFactory ;
    private static final ServiceRegistry serviceRegistry ;
    static {
        try {
            Configuration configuration = new Configuration();
            configuration.configure(); //加载默认配置文件
            serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
            ourSessionFactory = configuration.buildSessionFactory(serviceRegistry);
        }catch (Throwable ex){
            throw new ExceptionInInitializerError(ex) ;
        }

    }

    public static Session getSession() throws HibernateException {
        return ourSessionFactory.openSession();
    }
}


text:
// Copyright (c) Cragon. All rights reserved.

namespace GameCloud.Orleans.Gateway
{
    using System;
    using System.Collections.Concurrent;
    using System.Collections.Generic;
    using System.Net;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using DotNetty.Buffers;
    using DotNetty.Transport.Channels;
    using DotNetty.Transport.Channels.Groups;
    using GameCloud.Unity.Common;

    public class GatewayChannelHandler : ChannelHandlerAdapter
    {
        //---------------------------------------------------------------------
        private GatewaySessionFactory factory;
        private GatewaySession session;

        //---------------------------------------------------------------------
        public GatewayChannelHandler(GatewaySessionFactory factory)
        {
            this.factory = factory;
        }

        //---------------------------------------------------------------------
        public override void ChannelActive(IChannelHandlerContext context)
        {
            this.session = (GatewaySession)this.factory.createRpcSession(null);
            this.session.ChannelActive(context);

            IChannelGroup g = Gateway.Instance.ChannelGroup;
            if (g == null)
            {
                lock (this)
                {
                    if (Gateway.Instance.ChannelGroup == null)
                    {
                        g = Gateway.Instance.ChannelGroup = new DefaultChannelGroup(context.Executor);
                    }
                }
            }

            Gateway.Instance.ChannelGroup.Add(context.Channel);
        }

        //---------------------------------------------------------------------
        public override void ChannelInactive(IChannelHandlerContext context)
        {
            IChannelGroup g = Gateway.Instance.ChannelGroup;
            if (g != null)
            {
                g.Remove(context.Channel);
            }

            if (this.session != null)
            {
                this.session.ChannelInactive(context);
                this.session = null;
            }
        }

        //---------------------------------------------------------------------
        public override void ChannelRegistered(IChannelHandlerContext context)
        {
        }

        //---------------------------------------------------------------------
        public override void ChannelUnregistered(IChannelHandlerContext context)
        {
        }

        //---------------------------------------------------------------------
        public override void ChannelRead(IChannelHandlerContext context, object message)
        {
            var msg = message as IByteBuffer;
            msg.WithOrder(ByteOrder.BigEndian);

            if (this.session != null)
            {
                session.onRecvData(msg.ToArray());
            }
        }

        //---------------------------------------------------------------------
        public override void ChannelReadComplete(IChannelHandlerContext context)
        {
            context.Flush();
        }

        //---------------------------------------------------------------------
        public override void ExceptionCaught(IChannelHandlerContext context, Exception exception)
        {
            IChannelGroup g = Gateway.Instance.ChannelGroup;
            if (g != null)
            {
                g.Remove(context.Channel);
            }

            if (exception is System.ObjectDisposedException)
            {
                // do nothting
            }
            else
            {
                Console.WriteLine("Exception: \n" + exception);
            }

            context.CloseAsync();
        }
    }
}


text:
package org.jdw.blog.common.executable;

import org.jdw.blog.common.annotation.HystrixWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class NoInterface {

    final static Logger log = LoggerFactory.getLogger(NoInterface.class);

    public long getCurrentThreadId() {
        long currentThreadId = Thread.currentThread().getId();
        log.info("---");
        log.info("Now inside " + getClass().getSimpleName() + ".getCurrentThreadId");
        log.info("Current thread ID: " + currentThreadId);
        Thread.dumpStack();
        return currentThreadId;
    }

    @HystrixWrapper(commandGroupKey = "blog")
    public long hystrixWrappedGetCurrentThreadId() {
        return getCurrentThreadId();
    }

    public long nestedHystrixWrappedGetCurrentThreadId() {
        return hystrixWrappedGetCurrentThreadId();
    }

}


text:
import html5lib
from asgiref.local import Local
from django.http import HttpResponse
from django.test import Client, RequestFactory, TestCase, TransactionTestCase

from debug_toolbar.toolbar import DebugToolbar

class ToolbarTestClient(Client):
    def request(self, **request):
        # Use a thread/async task context-local variable to guard against a
        # concurrent _created signal from a different thread/task.
        data = Local()
        data.toolbar = None

        def handle_toolbar_created(sender, toolbar=None, **kwargs):
            data.toolbar = toolbar

        DebugToolbar._created.connect(handle_toolbar_created)
        try:
            response = super().request(**request)
        finally:
            DebugToolbar._created.disconnect(handle_toolbar_created)
        response.toolbar = data.toolbar

        return response

rf = RequestFactory()

class BaseMixin:
    client_class = ToolbarTestClient

    panel_id = None

    def setUp(self):
        super().setUp()
        self._get_response = lambda request: HttpResponse()
        self.request = rf.get("/")
        self.toolbar = DebugToolbar(self.request, self.get_response)
        self.toolbar.stats = {}

        if self.panel_id:
            self.panel = self.toolbar.get_panel_by_id(self.panel_id)
            self.panel.enable_instrumentation()
        else:
            self.panel = None

    def tearDown(self):
        if self.panel:
            self.panel.disable_instrumentation()
        super().tearDown()

    def get_response(self, request):
        return self._get_response(request)

    def assertValidHTML(self, content):
        parser = html5lib.HTMLParser()
        parser.parseFragment(content)
        if parser.errors:
            msg_parts = ["Invalid HTML:"]
            lines = content.split("\n")
            for position, errorcode, datavars in parser.errors:
                msg_parts.append("  %s" % html5lib.constants.E[errorcode] % datavars)
                msg_parts.append("    %s" % lines[position[0] - 1])
            raise self.failureException("\n".join(msg_parts))

class BaseTestCase(BaseMixin, TestCase):
    pass

class BaseMultiDBTestCase(BaseMixin, TransactionTestCase):
    databases = {"default", "replica"}

class IntegrationTestCase(TestCase):
    """Base TestCase for tests involving clients making requests."""

    def setUp(self):
        # The HistoryPanel keeps track of previous stores in memory.
        # This bleeds into other tests and violates their idempotency.
        # Clear the store before each test.
        for key in list(DebugToolbar._store.keys()):
            del DebugToolbar._store[key]
        super().setUp()


text:
package vend

import _ "p"


text:
version 0.1

This little js app get the most urgent cards from alll the boards you are in in Trello and show them on just one list, ordered by due date, so you can focus on the most urgent tasks.

Cards should have you as Member and a Due date.

# Installation
Get your Trello API key

Rename config.js.dist and write your Trello API KEY.

# Options

## Teams
In case you are part of a Team, you can get the name of the boards of your team.

## Scrum points
In case you use the scrum system and you add "(done/total)" to the title of your card, you can have a total.


text:
package com.alibaba.dubbo.rpc.cluster.filter;

/**
 * TestService
 */

public class DemoServiceLocal implements DemoService {

    public DemoServiceLocal(DemoService demoService) {
    }

    public String sayHello(String name) {
        return name;
    }

    public int plus(int a, int b) {
        return a + b;
    }

    public void ondisconnect() {

    }

    public void onconnect() {

    }
}


text:
"""
mygeotab.dates
~~~~~~~~~~~~~~

Date helper objects for timezone shifting and date formatting for the MyGeotab API.
"""

from datetime import datetime

import arrow
import pytz

MIN_DATE = pytz.utc.localize(datetime(1, 1, 1))
MAX_DATE = pytz.utc.localize(datetime(9999, 12, 31, 23, 59, 59, 999999))

def format_iso_datetime(datetime_obj):
    """Formats the given datetime as a UTC-zoned ISO 8601 date string.

    :param datetime_obj: The datetime or date object.
    :type datetime_obj: datetime
    :return: The datetime object in 8601 string form.
    :rtype: datetime
    """
    if not isinstance(datetime_obj, datetime):
        return datetime_obj.isoformat()
    datetime_obj = localize_datetime(datetime_obj, pytz.utc)
    if datetime_obj < MIN_DATE:
        datetime_obj = MIN_DATE
    elif datetime_obj > MAX_DATE:
        datetime_obj = MAX_DATE
    return arrow.get(datetime_obj).format("YYYY-MM-DDTHH:mm:ss.SSS") + "Z"

def localize_datetime(datetime_obj, tz=pytz.utc):
    """Converts a naive or UTC-localized date into the provided timezone.

    :param datetime_obj: The datetime object.
    :type datetime_obj: datetime
    :param tz: The timezone. If blank or None, UTC is used.
    :type tz: datetime.tzinfo
    :return: The localized datetime object.
    :rtype: datetime
    """
    if not datetime_obj.tzinfo:
        return tz.localize(datetime_obj)
    else:
        try:
            return datetime_obj.astimezone(tz)
        except OverflowError:
            if datetime_obj < datetime(2, 1, 1, tzinfo=pytz.utc):
                return MIN_DATE.astimezone(pytz.utc)
            return MAX_DATE.astimezone(pytz.utc)


text:
using System.Windows.Media;

namespace VSConsole.PowerPack.Core
{
    public interface IConsole
    {
        IHost Host { get; set; }

        IConsoleDispatcher Dispatcher { get; }

        int ConsoleWidth { get; }

        void Write(string text);

        void WriteLine(string text);

        void Write(string text, Color? foreground, Color? background);

        void Clear();
    }
}


text:
class ArticleScopedProgram < Course
  has_many(:revisions, lambda do |course|
    where('date >= ?', course.start)
    .where('date <= ?', course.end)
    .where(article_id: course.scoped_article_ids)
  end, through: :students)

  def wiki_course_page_enabled?
    true
  end

  def string_prefix
    'courses_generic'
  end

  def use_start_and_end_times
    true
  end

  def multiple_roles_allowed?
    true
  end

  def passcode_required?
    false
  end
end


text:
package net.spy.memcached.internal;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Simple thread factory that can set daemon status on threads and give them names.
 */
public class BasicThreadFactory implements ThreadFactory {

	private static final AtomicInteger poolNumber = new AtomicInteger(1);
	private final AtomicInteger threadNumber = new AtomicInteger(1);
	private final String namePrefix;
	private final boolean daemon;

	public BasicThreadFactory(String name, boolean daemon) {
		this.namePrefix = name + "-" + poolNumber.getAndIncrement() + "-";
		this.daemon = daemon;
	}

	public Thread newThread(Runnable r) {
		Thread t = new Thread(r, namePrefix + threadNumber.getAndIncrement());
		t.setDaemon(daemon);
		return t;
	}

}


text:
class QMqttNetworkRequest;
class QString;
class QByteArray;
class QMqttClientPrivate;
class QTMQTT_EXPORT QMqttClient : public QObject
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(QMqttClient)
    Q_DISABLE_COPY(QMqttClient)

public:
    QMqttClient(const QString &clientId, const QSet<QSslError> &allowedSslErrors = QSet<QSslError>(), QObject *parent = nullptr);
    virtual ~QMqttClient();

    using QObject::connect;
    void connect(const QMqttNetworkRequest &request, const QMqttWill &will = QMqttWill(), const QString &userName = QString(), const QByteArray &password = QByteArray());
    using QObject::disconnect;
    void disconnect();

    void subscribe(const QString &topic, QMqttProtocol::QoS qos, std::function<void(bool)> cb);
    void unsubscribe(const QString &topic, std::function<void(bool)> cb);
    void publish(const QString &topic, const QByteArray &message);
    void publish(const QString &topic, const QByteArray &message, std::function<void(bool)> cb);

    QHostAddress localAddress() const;
    quint16 localPort() const;

Q_SIGNALS:
    void stateChanged(QMqttProtocol::State);
    void connected();
    void disconnected();
    void messageReceived(const QString &topicName, const QByteArray &message);
    void error(QMqttProtocol::Error err, const QString &errorMessage);

private:
    QScopedPointer<QMqttClientPrivate> d_ptr;
};


text:
{% extends "base.html" %}

{% block content %}

{{ title }}

Use the form below to create or edit an account:

        {% if error %}

                Error: {{ error }}

        {% endif %}
        <form class="ui form" method="post">

                    <input type="text" placeholder="Name" name="Name" value="{{ form.Name }}">

            <button type="submit" class="ui primary button">{{ action }}</button>
        </form>

{% endblock %}


text:
// Type definitions for kafka-node 1.3.3
// Project: https://github.com/SOHU-Co/kafka-node/
// Definitions by: Daniel Imrie-Situnayake <https://github.com/dansitu/>, Bill <https://github.com/bkim54>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// # Classes
export declare class Client {
    constructor(connectionString: string, clientId: string, options?: ZKOptions);
    close(callback?: Function): void;
    topicExists(topics: Array<string>, callback: Function): void;
    refreshMetadata(topics: Array<string>, cb?: (error: any, data: any) => any): void;
    close(cb: (error: any) => any): void;
}

export declare class Producer {
    constructor(client: Client, options?: any, customPartitioner?: any);
    on(eventName: string, cb: () => any): void;
    on(eventName: string, cb: (error: any) => any): void;
    send(payloads: Array<ProduceRequest>, cb: (error: any, data: any) => any): void;
    createTopics(topics: Array<string>, async: boolean, cb?: (error: any, data: any) => any): void;
    close(cb: (error: any) => any): void;
}

export declare class HighLevelProducer {
    constructor(client: Client, options?: any, customPartitioner?: any);
    on(eventName: string, cb: () => any): void;
    on(eventName: string, cb: (error: any) => any): void;
    send(payloads: Array<ProduceRequest>, cb: (error: any, data: any) => any): void;
    createTopics(topics: Array<string>, async: boolean, cb?: (error: any, data: any) => any): void;
    close(cb: (error: any) => any): void;
}

export declare class Consumer {
    constructor(client: Client, fetchRequests: Array<OffsetFetchRequest>, options: ConsumerOptions);
    on(eventName: string, cb: (message: string) => any): void;
    on(eventName: string, cb: (error: any) => any): void;
    addTopics(topics: Array<string>, cb: (error: any, added: boolean) => any): void;
    addTopics(topics: Array<Topic>, cb: (error: any, added: boolean) => any, fromOffset: boolean): void;
    removeTopics(topics: Array<string>, cb: (error: any, removed: boolean) => any): void;
    commit(cb: (error: any, data: any) => any): void;
    setOffset(topic: string, partition: number, offset: number): void;
    pause(): void;
    resume(): void;
    pauseTopics(topics: Array<any> /* Array<string|Topic> */): void;
    resumeTopics(topics: Array<any> /* Array<string|Topic> */): void;
    close(force: boolean, cb: () => any): void;
}

export declare class HighLevelConsumer {
    constructor(client: Client, payloads: Array<Topic>, options: ConsumerOptions);
    on(eventName: string, cb: (message: string) => any): void;
    on(eventName: string, cb: (error: any) => any): void;
    addTopics(topics: Array<string>, cb: (error: any, added: boolean) => any): void;
    addTopics(topics: Array<Topic>, cb: (error: any, added: boolean) => any, fromOffset: boolean): void;
    removeTopics(topics: Array<string>, cb: (error: any, removed: boolean) => any): void;
    commit(cb: (error: any, data: any) => any): void;
    setOffset(topic: string, partition: number, offset: number): void;
    pause(): void;
    resume(): void;
    pauseTopics(topics: Array<any> /* Array<string|Topic> */): void;
    resumeTopics(topics: Array<any> /* Array<string|Topic> */): void;
    close(force: boolean, cb: () => any): void;
}

export declare class ConsumerGroup extends HighLevelConsumer {
    constructor(options: ConsumerGroupOptions, topics: string[]);
    on(eventName: string, cb: (message: string) => any): void;
    on(eventName: string, cb: (error: any) => any): void;
    close(force: boolean, cb: (error: any) => any): void;
}

export declare class Offset {
    constructor(client: Client);
    on(eventName: string, cb: () => any): void;
    fetch(payloads: Array<OffsetRequest>, cb: (error: any, data: any) => any): void;
    commit(groupId: string, payloads: Array<OffsetCommitRequest>, cb: (error: any, data: any) => any): void;
    fetchCommits(groupId: string, payloads: Array<OffsetFetchRequest>, cb: (error: any, data: any) => any): void;
    fetchLatestOffsets(topics: Array<string>, cb: (error: any, data: any) => any): void;
    fetchEarliestOffsets(topics: Array<string>, cb: (error: any, data: any) => any): void;
    on(eventName: string, cb: (error: any) => any): void;
}

export declare class KeyedMessage {
    constructor(key: string, message: string);
}

// # Interfaces
export interface AckBatchOptions {
    noAckBatchSize: number | null,
    noAckBatchAge: number | null
}

export interface ZKOptions {
    sessionTimeout?: number;
    spinDelay?: number;
    retries?: number;
}

export interface ProduceRequest {
    topic: string;
    messages: any; // Array<string> | Array<KeyedMessage> | string | KeyedMessage
    key?: any;
    partition?: number;
    attributes?: number;
}

export interface ConsumerOptions {
    groupId?: string;
    id?: string;
    autoCommit?: boolean;
    autoCommitIntervalMs?: number;
    fetchMaxWaitMs?: number;
    fetchMinBytes?: number;
    fetchMaxBytes?: number;
    fromOffset?: boolean;
    encoding?: string;
}

export interface CustomPartitionAssignmentProtocol {
    name: string;
    version: number;
    userData: {};
    assign: (topicPattern: any, groupMembers: any, callback: (error: any, result: any) => void) => void;
}

export interface ConsumerGroupOptions {
    host: string;
    zk?: ZKOptions;
    batch?: AckBatchOptions;
    ssl?: boolean;
    id: string;
    groupId: string;
    sessionTimeout?: number;
    protocol?: Array<"roundrobin" | "range" | CustomPartitionAssignmentProtocol>;
    fromOffset?: "earliest" | "latest" | "none";
    migrateHLC?: boolean;
    migrateRolling?: boolean;
    autoCommit?: boolean;
    autoCommitIntervalMs?: number;
    fetchMaxWaitMs?: number;
    paused?: boolean;
    maxNumSegments?: number;
    fetchMinBytes?: number;
    fetchMaxBytes?: number;
    retries?: number;
    retryFactor?: number;
    retryMinTimeout?: number;
    connectOnReady?: boolean;
}

export interface Topic {
    topic: string;
    offset?: number;
    encoding?: string;
    autoCommit?: boolean;
}

export interface OffsetRequest {
    topic: string;
    partition?: number;
    time?: number;
    maxNum?: number;
}

export interface OffsetCommitRequest {
    topic: string;
    partition?: number;
    offset: number;
    metadata?: string;
}

export interface OffsetFetchRequest {
    topic: string;
    partition?: number;
    offset?: number;
}


text:
@(branchInfo: Seq[(
    gitbucket.core.util.JGitUtil.BranchInfo,
    Option[(gitbucket.core.model.PullRequest, gitbucket.core.model.Issue)],
    Boolean,
    Option[(gitbucket.core.model.CommitState, List[gitbucket.core.model.CommitStatus])]
  )],
  hasWritePermission: Boolean,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@gitbucket.core.html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
  @gitbucket.core.html.menu("branches", repository){

          All branches

      @branchInfo.map { case (branch, prs, isProtected, status) =>

            @if(isProtected){  }
            @branch.name

              Updated @gitbucket.core.helper.html.datetimeago(branch.commitTime, false)
                by @helpers.user(branch.committerName, branch.committerEmailAddress, "muted-link")

            @status.map { case (summary, statuses) =>
              @gitbucket.core.helper.html.commitstatus(branch.commitId, summary, statuses)
            }

            @if(repository.repository.defaultBranch == branch.name){
              Default
            } else {
              @branch.mergeInfo.map{ info =>

@info.ahead

@info.behind

              }
            }

              @if(repository.repository.defaultBranch != branch.name){
                @branch.mergeInfo.map{ info =>
                  @prs.map{ case (pull, issue) =>
                    #@issue.issueId
                    @if(issue.closed) {
                      @if(info.isMerged){
                        Merged
                      } else {
                        Closed
                      }
                    } else {
                      Open
                    }
                  }.getOrElse{
                    @if(context.loginAccount.isDefined){

                        helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch)
                      }.getOrElse {
                        helpers.encodeRefName(repository.repository.defaultBranch)
                      }}...@{helpers.encodeRefName(branch.name)}?expand=1" class="btn btn-default btn-sm">New Pull request
                    } else {

                        helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch)
                      }.getOrElse {
                        helpers.encodeRefName(repository.repository.defaultBranch)
                      }}...@{helpers.encodeRefName(branch.name)}" class="btn btn-default btn-sm">Compare
                    }
                  }
                  @if(hasWritePermission){

                    @if(prs.map(!_._2.closed).getOrElse(false)){

                    } else {
                      @if(isProtected){

                      } else {

                      }
                    }

                  }
                }
              }

      }

  }
}


text:
package com.sinodata.evaluate.activities;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;

import com.sinodata.evaluate.BaseActivity;
import com.sinodata.evaluate.R;

public class WebViewActivity2 extends BaseActivity {

	private ImageView iv_back;
	private String url;
	private WebView webView;

	private ProgressDialog progressBar;

	@SuppressLint("SetJavaScriptEnabled")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_webview2);
		setProgressBarVisibility(true);
		url = getIntent().getAction();

		initView();
		initEvent();
	}
	@Override
	public void initView() {
		// TODO Auto-generated method stub
		iv_back = (ImageView) findViewById(R.id.iv_webview2_back);
		webView = (WebView) findViewById(R.id.webview2);

	}

	@Override
	public void initEvent() {
		// TODO Auto-generated method stub
		iv_back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});

        progressBar = ProgressDialog.show(WebViewActivity2.this, "正在加载页面,请耐心等待!", "Loading...");

		webView.setWebChromeClient(new WebChromeClient(){
			@Override
			public void onProgressChanged(WebView view, int newProgress) {
				// TODO Auto-generated method stub
				super.onProgressChanged(view, newProgress);
				if(newProgress ==100){
					setProgressBarVisibility(false);
				}
			}
		});

		webView.setWebViewClient(new WebViewClient(){

			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				// TODO Auto-generated method stub
				view.loadUrl(url);
				return true;
			}

			@Override
			public void onPageFinished(WebView view, String url) {
				// TODO Auto-generated method stub
				super.onPageFinished(view, url);
				 if (progressBar.isShowing()) {
	                    progressBar.dismiss();
	                }
			}

		});
		webView.getSettings().setJavaScriptEnabled(true);
		webView.loadUrl(url);

	}
	@Override
    //设置回退
    //覆盖Activity类的onKeyDown(int keyCoder,KeyEvent event)方法
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) {
            webView.goBack(); //goBack()表示返回WebView的上一页面
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}


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

package com.google.android.gcm.demo.app;

public final class R {
    public static final class attr {
        /**
Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cameraBearing=0x7f010001;
        /**
Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cameraTargetLat=0x7f010002;
        /**
Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cameraTargetLng=0x7f010003;
        /**
Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cameraTilt=0x7f010004;
        /**
Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cameraZoom=0x7f010005;
        /**
Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

none	0

normal	1

satellite	2

terrain	3

hybrid	4

         */
        public static final int mapType=0x7f010000;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiCompass=0x7f010006;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiRotateGestures=0x7f010007;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiScrollGestures=0x7f010008;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiTiltGestures=0x7f010009;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiZoomControls=0x7f01000a;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int uiZoomGestures=0x7f01000b;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int useViewLifecycle=0x7f01000c;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int zOrderOnTop=0x7f01000d;
    }
    public static final class color {
        public static final int common_action_bar_splitter=0x7f040009;
        /**  Sign-in Button Colors
         */
        public static final int common_signin_btn_dark_text_default=0x7f040000;
        public static final int common_signin_btn_dark_text_disabled=0x7f040002;
        public static final int common_signin_btn_dark_text_focused=0x7f040003;
        public static final int common_signin_btn_dark_text_pressed=0x7f040001;
        public static final int common_signin_btn_default_background=0x7f040008;
        public static final int common_signin_btn_light_text_default=0x7f040004;
        public static final int common_signin_btn_light_text_disabled=0x7f040006;
        public static final int common_signin_btn_light_text_focused=0x7f040007;
        public static final int common_signin_btn_light_text_pressed=0x7f040005;
        public static final int common_signin_btn_text_dark=0x7f04000a;
        public static final int common_signin_btn_text_light=0x7f04000b;
    }
    public static final class drawable {
        public static final int common_signin_btn_icon_dark=0x7f020000;
        public static final int common_signin_btn_icon_disabled_dark=0x7f020001;
        public static final int common_signin_btn_icon_disabled_focus_dark=0x7f020002;
        public static final int common_signin_btn_icon_disabled_focus_light=0x7f020003;
        public static final int common_signin_btn_icon_disabled_light=0x7f020004;
        public static final int common_signin_btn_icon_focus_dark=0x7f020005;
        public static final int common_signin_btn_icon_focus_light=0x7f020006;
        public static final int common_signin_btn_icon_light=0x7f020007;
        public static final int common_signin_btn_icon_normal_dark=0x7f020008;
        public static final int common_signin_btn_icon_normal_light=0x7f020009;
        public static final int common_signin_btn_icon_pressed_dark=0x7f02000a;
        public static final int common_signin_btn_icon_pressed_light=0x7f02000b;
        public static final int common_signin_btn_text_dark=0x7f02000c;
        public static final int common_signin_btn_text_disabled_dark=0x7f02000d;
        public static final int common_signin_btn_text_disabled_focus_dark=0x7f02000e;
        public static final int common_signin_btn_text_disabled_focus_light=0x7f02000f;
        public static final int common_signin_btn_text_disabled_light=0x7f020010;
        public static final int common_signin_btn_text_focus_dark=0x7f020011;
        public static final int common_signin_btn_text_focus_light=0x7f020012;
        public static final int common_signin_btn_text_light=0x7f020013;
        public static final int common_signin_btn_text_normal_dark=0x7f020014;
        public static final int common_signin_btn_text_normal_light=0x7f020015;
        public static final int common_signin_btn_text_pressed_dark=0x7f020016;
        public static final int common_signin_btn_text_pressed_light=0x7f020017;
        public static final int ic_launcher=0x7f020018;
        public static final int ic_stat_gcm=0x7f020019;
    }
    public static final class id {
        public static final int clear=0x7f050006;
        public static final int display=0x7f050007;
        public static final int hybrid=0x7f050004;
        public static final int none=0x7f050000;
        public static final int normal=0x7f050001;
        public static final int satellite=0x7f050002;
        public static final int send=0x7f050005;
        public static final int terrain=0x7f050003;
    }
    public static final class layout {
        public static final int main=0x7f030000;
    }
    public static final class string {
        public static final int already_registered=0x7f060017;
        public static final int app_name=0x7f060015;
        /**   Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=70]
         */
        public static final int auth_client_availability_notification_title=0x7f06000f;
        /**   Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=42]
         */
        public static final int auth_client_play_services_err_notification_msg=0x7f060010;
        /**   Requested by string saying which app requested the notification. [CHAR LIMIT=42]
         */
        public static final int auth_client_requested_by_msg=0x7f060011;
        public static final int c2d=0x7f060025;
        public static final int clear=0x7f060027;
        /**  Button in confirmation dialog to enable Google Play services.  Clicking it
        will direct user to application settings of Google Play services where they
        can enable it [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_enable_button=0x7f060006;
        /**  Message in confirmation dialog informing user they need to enable
        Google Play services in application settings [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_enable_text=0x7f060005;
        /**  Title of confirmation dialog informing user they need to enable
        Google Play services in application settings [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_enable_title=0x7f060004;
        /**  Button in confirmation dialog for installing Google Play services [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_install_button=0x7f060003;
        /**  (For phones) Message in confirmation dialog informing user that
        they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_install_text_phone=0x7f060001;
        /**  (For tablets) Message in confirmation dialog informing user that
        they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_install_text_tablet=0x7f060002;
        /**  Title of confirmation dialog informing user that they need to install
        Google Play services (from Play Store) [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_install_title=0x7f060000;
        /**  Message in confirmation dialog informing user there is an unknown issue in Google Play
        services [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_unknown_issue=0x7f060009;
        /**  Message in confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_unsupported_text=0x7f06000b;
        /**  Title of confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_unsupported_title=0x7f06000a;
        /**  Button in confirmation dialog for updating Google Play services [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_update_button=0x7f06000c;
        /**  Message in confirmation dialog informing user that they need to update
        Google Play services (from Play Store) [CHAR LIMIT=NONE]
         */
        public static final int common_google_play_services_update_text=0x7f060008;
        /**  Title of confirmation dialog informing user that they need to update
        Google Play services (from Play Store) [CHAR LIMIT=40]
         */
        public static final int common_google_play_services_update_title=0x7f060007;
        /**  Sign-in button text [CHAR LIMIT=15]
         */
        public static final int common_signin_button_text=0x7f06000d;
        /**  Long form sign-in button text [CHAR LIMIT=30]
         */
        public static final int common_signin_button_text_long=0x7f06000e;
        public static final int error_config=0x7f060016;
        public static final int gcm_deleted=0x7f06001d;
        public static final int gcm_error=0x7f06001b;
        public static final int gcm_message=0x7f06001a;
        public static final int gcm_recoverable_error=0x7f06001c;
        public static final int gcm_registered=0x7f060018;
        public static final int gcm_unregistered=0x7f060019;
        /**  Location client code resources (prefix with location_client)

        Begin strings for location.reporting

        Some InactiveReason names.  See more in OneUp/package/location/res/values/strings.xml

         */
        public static final int location_client_ulr_inactive_age_under_13=0x7f060012;
        public static final int location_client_ulr_inactive_age_unknown=0x7f060013;
        public static final int location_client_ulr_inactive_unknown_restriction=0x7f060014;
        public static final int options_clear=0x7f060023;
        public static final int options_exit=0x7f060024;
        public static final int send=0x7f060026;
        public static final int server_register_error=0x7f060021;
        public static final int server_registered=0x7f06001f;
        public static final int server_registering=0x7f06001e;
        public static final int server_unregister_error=0x7f060022;
        public static final int server_unregistered=0x7f060020;
    }
    public static final class styleable {
        /** Attributes that can be used with a MapAttrs.

Includes the following attributes:

           <colgroup align="left" />
           <colgroup align="left" />

Attribute	Description

{@link #MapAttrs_cameraBearing com.google.android.gcm.demo.app:cameraBearing}

{@link #MapAttrs_cameraTargetLat com.google.android.gcm.demo.app:cameraTargetLat}

{@link #MapAttrs_cameraTargetLng com.google.android.gcm.demo.app:cameraTargetLng}

{@link #MapAttrs_cameraTilt com.google.android.gcm.demo.app:cameraTilt}

{@link #MapAttrs_cameraZoom com.google.android.gcm.demo.app:cameraZoom}

{@link #MapAttrs_mapType com.google.android.gcm.demo.app:mapType}

{@link #MapAttrs_uiCompass com.google.android.gcm.demo.app:uiCompass}

{@link #MapAttrs_uiRotateGestures com.google.android.gcm.demo.app:uiRotateGestures}

{@link #MapAttrs_uiScrollGestures com.google.android.gcm.demo.app:uiScrollGestures}

{@link #MapAttrs_uiTiltGestures com.google.android.gcm.demo.app:uiTiltGestures}

{@link #MapAttrs_uiZoomControls com.google.android.gcm.demo.app:uiZoomControls}

{@link #MapAttrs_uiZoomGestures com.google.android.gcm.demo.app:uiZoomGestures}

{@link #MapAttrs_useViewLifecycle com.google.android.gcm.demo.app:useViewLifecycle}

{@link #MapAttrs_zOrderOnTop com.google.android.gcm.demo.app:zOrderOnTop}

           @see #MapAttrs_cameraBearing
           @see #MapAttrs_cameraTargetLat
           @see #MapAttrs_cameraTargetLng
           @see #MapAttrs_cameraTilt
           @see #MapAttrs_cameraZoom
           @see #MapAttrs_mapType
           @see #MapAttrs_uiCompass
           @see #MapAttrs_uiRotateGestures
           @see #MapAttrs_uiScrollGestures
           @see #MapAttrs_uiTiltGestures
           @see #MapAttrs_uiZoomControls
           @see #MapAttrs_uiZoomGestures
           @see #MapAttrs_useViewLifecycle
           @see #MapAttrs_zOrderOnTop
         */
        public static final int[] MapAttrs = {
            0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003,
            0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007,
            0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b,
            0x7f01000c, 0x7f01000d
        };
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#cameraBearing}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:cameraBearing
        */
        public static final int MapAttrs_cameraBearing = 1;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#cameraTargetLat}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:cameraTargetLat
        */
        public static final int MapAttrs_cameraTargetLat = 2;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#cameraTargetLng}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:cameraTargetLng
        */
        public static final int MapAttrs_cameraTargetLng = 3;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#cameraTilt}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:cameraTilt
        */
        public static final int MapAttrs_cameraTilt = 4;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#cameraZoom}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:cameraZoom
        */
        public static final int MapAttrs_cameraZoom = 5;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#mapType}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

none	0

normal	1

satellite	2

terrain	3

hybrid	4

          @attr name android:mapType
        */
        public static final int MapAttrs_mapType = 0;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiCompass}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiCompass
        */
        public static final int MapAttrs_uiCompass = 6;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiRotateGestures}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiRotateGestures
        */
        public static final int MapAttrs_uiRotateGestures = 7;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiScrollGestures}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiScrollGestures
        */
        public static final int MapAttrs_uiScrollGestures = 8;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiTiltGestures}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiTiltGestures
        */
        public static final int MapAttrs_uiTiltGestures = 9;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiZoomControls}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiZoomControls
        */
        public static final int MapAttrs_uiZoomControls = 10;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#uiZoomGestures}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:uiZoomGestures
        */
        public static final int MapAttrs_uiZoomGestures = 11;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#useViewLifecycle}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:useViewLifecycle
        */
        public static final int MapAttrs_useViewLifecycle = 12;
        /**

This symbol is the offset where the {@link com.google.android.gcm.demo.app.R.attr#zOrderOnTop}
          attribute's value can be found in the {@link #MapAttrs} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name android:zOrderOnTop
        */
        public static final int MapAttrs_zOrderOnTop = 13;
    };
}


text:
**Robot Name:** Anaconda

**Description:**
Robot code to control the robot for FIRST FRC's Aerial Assist 2014 game.

**Modules:**
*Drive:*

*Shooter:*

*Arm:*

*Compressor:*

**Authors:**
Ben Evans, Michael Chin, Ankith Uppunda


text:
 body
{
background-color:tan;
}
.box
{
background-color:#3d4543;
height:300px;
width:250px;
border-radius:10px;
position:relative;
top:80px;
left:40%;
}

.display
{
background-color:#222;
width:220px;
position:relative;
left:15px;
top:20px;
height:40px;
}
.display input
{
position:relative;
left:2px;
top:2px;
height:35px;
color:black;
background-color:#bccd95;
font-size:21px;
text-align:right;
}

.keys
{
position:relative;
top:15px;
}
.button
{
width:40px;
height:30px;
border:none;
border-radius:8px;
margin-left:17px;
cursor:pointer;
border-top:2px solid transparent;
}
.button.gray
{
color:white;
background-color:#6f6f6f;
border-bottom:black 2px solid;
border-top:2px #6f6f6f solid;
}
.button.pink
{
color:black;
background-color:#ff4561;
border-bottom:black 2px solid;
}
.button.black
{
color:white;
background-color:303030;
border-bottom:black 2px solid;
border-top:2px 303030 solid;
}
.button.orange
{
color:black;
background-color:FF9933;
border-bottom:black 2px solid;
border-top:2px FF9933 solid;
}
.gray:active
{
border-top:black 2px solid;
border-bottom:2px #6f6f6f solid;
}
.pink:active
{
border-top:black 2px solid;
border-bottom:#ff4561 2px solid;
}
.black:active
{
border-top:black 2px solid;
border-bottom:#303030 2px solid;
}
.orange:active
{
border-top:black 2px solid;
border-bottom:FF9933 2px solid;
}
p
{
line-height:10px;
}


text:
layout: page
title: Wild Bolt Music Party
date: 2016-05-24
author: Brittany Madden
tags: weekly links, java
status: published
summary: Nam ornare nisi sagittis, dignissim arcu.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/02/2018
  endDate: 01/05/2018
  ctyhocn: BLXOSHX
  groupCode: WBMP
published: true
---
Ut eu orci id eros cursus rhoncus. Maecenas ac dolor congue, elementum dolor eget, accumsan diam. Etiam non nunc tortor. Donec efficitur, est sed sagittis aliquet, justo odio gravida ante, a luctus leo nunc et massa. Aliquam pretium est non bibendum tempor. Integer porta tempus massa sit amet pretium. Quisque placerat augue neque, ullamcorper pharetra risus rutrum at. Fusce porttitor, purus in imperdiet scelerisque, turpis lorem ullamcorper libero, vel convallis sapien arcu sit amet urna. Mauris iaculis, elit a luctus elementum, libero eros ornare elit, sit amet euismod tellus dolor eget diam. Duis viverra efficitur libero eget accumsan. Pellentesque at aliquam dolor. Mauris ultricies, ex vitae convallis dignissim, arcu eros bibendum purus, sed lobortis nisl lacus quis libero. Donec bibendum malesuada dignissim. Maecenas lacinia ligula et sem fermentum, quis luctus ipsum scelerisque.

* Vestibulum sodales augue vitae lectus ornare elementum
* Vestibulum in erat non orci rhoncus finibus in ac nisl.

Praesent at ornare tellus. Etiam ullamcorper convallis turpis, vel facilisis dui ultricies ac. Etiam viverra justo at felis consequat facilisis. Vivamus vitae lacus pulvinar, luctus ligula non, molestie libero. Suspendisse tempus, nisl nec vestibulum elementum, eros est gravida est, et rhoncus ex felis a ex. Sed imperdiet massa ut tristique ultrices. Fusce vehicula sapien non velit tincidunt, id mattis nisl congue.


text:
"use strict";

module Affecto.Login
{
    export class AuthenticatedUser
    {
        constructor(public name: string, public accountName: string, public roles: Array<string>, public permissions: Array<string>, public customProperties: Array<CustomProperty>)
        {
        }

        public hasPermission(permission: string): boolean
        {
            if (this.permissions == null)
            {
                return false;
            }
            return this.permissions.indexOf(permission) >= 0;
        }
    }
}


text:
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Dropdown;

use kartik\icons\Icon;

?>
<?php $form = ActiveForm::begin([
  //'method'=>'POST',
  'action'=>'',
]); ?>

Filter Events:

    <?=$form->field($model,'nameStartsWith')?>

        <?=$form->field($model,'orderBy')->dropDownList($model->getOrderByTypes());?>
        <?=$form->field($model,'offset')->hiddenInput()->label(false)?>

        <?=$form->field($model,'limit')->dropDownList($model->getLimitByTypes());?>
        <?=$form->field($model,'seriesId')->hiddenInput()->label(false)?>

<?php echo Html::submitButton(Icon::show('filter').' Filter', ['class' => 'btn btn-success shadow']) ?>

<?php ActiveForm::end(); ?>


text:
typedef struct _VPAttribute
{
	unsigned int NameOffset;
	unsigned int Index;
} realityVertexProgramAttribute;

union _VPFloatUInt
{
	unsigned int u;
	float f;
};

typedef struct _VPConstant
{
	unsigned int NameOffset;
	unsigned int Index;
	unsigned char Type;
	unsigned char Internal;	//Is an internal constant? (unnamed but needs to be set)
	union _VPFloatUInt Values[4];
} realityVertexProgramConstant;

typedef struct _realityVertexProgram
{
	unsigned short Magic;		//Magic text 'VP'
	unsigned short NumInsts;	//Number of vertex program instructions
	unsigned int UCodeOffset;	//Microcode offset (16 bytes per instruction)
	unsigned short NumConstants;	//Number of named constants (parameters)
	unsigned short NumAttributes;	//Number of named attributes (inputs)
	unsigned int ConstantsOffset;
	unsigned int AttributesOffset;
	unsigned int InputMask;			//Used input attributes
	unsigned int OutputMask;		//Used output registers

	//data (constants, attributes, ucode)
} realityVertexProgram;

#pragma pack(pop)

void *realityVertexProgramGetUCode(realityVertexProgram *vertexprogram);

unsigned int realityVertexProgramGetInputMask(realityVertexProgram *vertexprogram);

unsigned int realityVertexProgramGetOutputMask(realityVertexProgram *vertexprogram);

realityVertexProgramAttribute *realityVertexProgramGetAttributes(realityVertexProgram *vertexprogram);

int realityVertexProgramGetInputAttribute(realityVertexProgram *vertexprogram,const char *name);

realityVertexProgramConstant *realityVertexProgramGetConstants(realityVertexProgram *vertexprogram);

int realityVertexProgramGetConstant(realityVertexProgram *vertexprogram,const char *name);

#endif


text:
<TITLE>STIX Font Table for STIXIntegralsSm-Bold</TITLE>

STIXIntegralsSm-Bold Character Tables

Basic Latin: 0000 - 007F

0	1	2	3	4	5	6	7

8	9	A	B	C	D	E	F

002

003

004

005

006

007

Latin-1 Supplement: 0080 - 00FF

0	1	2	3	4	5	6	7

8	9	A	B	C	D	E	F

00A

00B

00C

00D

00E

00F

Mathematical Operators: 2200 - 22FF

0	1	2	3	4	5	6	7

8	9	A	B	C	D	E	F

220

221

222

∫
∬
∭
∮
∯

223
∰
∱
∲
∳

224

225

226

227

228

229

22A

22B

22C

22D

22E

22F

Supplemental Mathematical Operators: 2A00 - 2AFF

0	1	2	3	4	5	6	7

8	9	A	B	C	D	E	F

2A0

⨌
⨍
⨎
⨏

2A1
⨐
⨑
⨒
⨓
⨔
⨕
⨖
⨗

⨘
⨙
⨚
⨛
⨜

2A2

2A3

2A4

2A5

2A6

2A7

2A8

2A9

2AA

2AB

2AC

2AD

2AE

2AF

Supplemental Mathematical Operators
/\

IntegralsSm
<

O

>
IntegralsUp

..


text:
SHELL=/bin/sh

DESTDIR?=/usr/local
prefix?=${DESTDIR}

# files that need mode 755
EXEC_FILES=git-mudge

all:
	@echo "Usage:\n\tsudo make install\n\tsudo make uninstall"

install:
	install -d -m 0755 $(prefix)/bin
	install -m 0755 $(EXEC_FILES) $(prefix)/bin

uninstall:
	test -d $(prefix)/bin && cd $(prefix)/bin && rm -f $(EXEC_FILES)


text:
package io.crate.integrationtests;

import static io.crate.protocols.postgres.PGErrorStatus.UNDEFINED_TABLE;
import static io.crate.testing.Asserts.assertThrowsMatches;
import static io.crate.testing.SQLErrorMatcher.isSQLError;
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.elasticsearch.test.IntegTestCase;
import org.junit.Before;
import org.junit.Test;

public class StaticInformationSchemaQueryTest extends IntegTestCase {

    @Before
    public void tableCreation() throws Exception {
        execute("create table t1 (col1 integer, col2 string) clustered into 7 shards");
        execute("create table t2 (col1 integer, col2 string) clustered into 10 shards");
        execute("create table t3 (col1 integer, col2 string) clustered into 4 shards");
    }

    @Test
    public void testSelectZeroLimit() throws Exception {
        execute("select * from information_schema.columns limit 0");
        assertEquals(0L, response.rowCount());
    }

    @Test
    public void testSelectSysColumnsFromInformationSchema() throws Exception {
        assertThrowsMatches(() -> execute("select sys.nodes.id, table_name, number_of_replicas from information_schema.tables"),
                     isSQLError(is("Relation 'sys.nodes' unknown"),
                                UNDEFINED_TABLE,
                                NOT_FOUND,
                                4041));
    }

    @Test
    public void testGroupByOnInformationSchema() throws Exception {
        execute("select count(*) from information_schema.columns where table_schema = ? group by table_name order by count(*) desc", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(3L, response.rowCount());

        execute("select count(*) from information_schema.columns where table_schema = ? group by column_name order by count(*) desc", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(2L, response.rowCount());
        assertEquals(3L, response.rows()[0][0]);
    }

    @Test
    public void testSelectStar() throws Exception {
        execute("select * from information_schema.tables where table_schema = ?", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(3L, response.rowCount());
    }

    @Test
    public void testLike() throws Exception {
        execute("select * from information_schema.tables where table_schema = ? and table_name like 't%'", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(3L, response.rowCount());
    }

    @Test
    public void testIsNull() throws Exception {
        execute("select * from information_schema.tables where table_name is null");
        assertEquals(0L, response.rowCount());
    }

    @Test
    public void testIsNotNull() throws Exception {
        execute("select * from information_schema.tables where table_name is not null and table_schema = ?", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(3L, response.rowCount());
    }

    @Test
    public void testWhereAnd() throws Exception {
        execute("select table_name from information_schema.tables where table_name='t1' and " +
                "number_of_shards > 0");
        assertEquals(1L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
    }

    @Test
    public void testWhereAnd2() throws Exception {
        execute("select table_name from information_schema.tables where number_of_shards >= 7 and " +
                "number_of_replicas != '8' order by table_name asc");
        assertEquals(2L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
        assertEquals("t2", response.rows()[1][0]);
    }

    @Test
    public void testWhereAnd3() throws Exception {
        execute("select table_name from information_schema.tables where table_name is not null and " +
                "number_of_shards > 6 order by table_name asc");
        assertEquals(2L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
        assertEquals("t2", response.rows()[1][0]);
    }

    @Test
    public void testWhereOr() throws Exception {
        execute("select table_name from information_schema.tables where table_name='t1' or table_name='t3' " +
                "order by table_name asc");
        assertEquals(2L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
        assertEquals("t3", response.rows()[1][0]);
    }

    @Test
    public void testWhereOr2() throws Exception {
        execute("select table_name from information_schema.tables where table_name='t1' or table_name='t3' " +
                "or table_name='t2'" +
                "order by table_name desc");
        assertEquals(3L, response.rowCount());
        assertEquals("t3", response.rows()[0][0]);
        assertEquals("t2", response.rows()[1][0]);
        assertEquals("t1", response.rows()[2][0]);
    }

    @Test
    public void testWhereIn() throws Exception {
        execute("select table_name from information_schema.tables where table_name in ('t1', 't2') order by table_name asc");
        assertEquals(2L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
        assertEquals("t2", response.rows()[1][0]);
    }

    @Test
    public void testNotEqualsString() throws Exception {
        execute("select table_name from information_schema.tables where table_schema = ? and table_name != 't1'", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(2L, response.rowCount());
        assertTrue(!response.rows()[0][0].equals("t1"));
        assertTrue(!response.rows()[1][0].equals("t1"));
    }

    @Test
    public void testNotEqualsNumber() throws Exception {
        execute("select table_name, number_of_shards from information_schema.tables where table_schema = ? and number_of_shards != 7", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(2L, response.rowCount());
        assertTrue((int) response.rows()[0][1] != 7);
        assertTrue((int) response.rows()[1][1] != 7);
    }

    @Test
    public void testEqualsNumber() throws Exception {
        execute("select table_name from information_schema.tables where table_schema = ? and number_of_shards = 7", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(1L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
    }

    @Test
    public void testEqualsString() throws Exception {
        execute("select table_name from information_schema.tables where table_name = 't1'");
        assertEquals(1L, response.rowCount());
        assertEquals("t1", response.rows()[0][0]);
    }

    @Test
    public void testGtNumber() throws Exception {
        execute("select table_name from information_schema.tables where number_of_shards > 7");
        assertEquals(1L, response.rowCount());
        assertEquals("t2", response.rows()[0][0]);
    }

    @Test
    public void testOrderByStringAndLimit() throws Exception {
        execute("select table_name, number_of_shards, number_of_replicas from information_schema.tables " +
                " where table_schema = ? order by table_name desc limit 2", new Object[]{sqlExecutor.getCurrentSchema()});
        assertEquals(2L, response.rowCount());
        assertEquals("t3", response.rows()[0][0]);
        assertEquals("t2", response.rows()[1][0]);
    }

    @Test
    public void testOrderByNumberAndLimit() throws Exception {
        execute("select table_name, number_of_shards, number_of_replicas from information_schema.tables " +
                " order by number_of_shards desc nulls last limit 2");
        assertEquals(2L, response.rowCount());
        assertEquals(10, response.rows()[0][1]);
        assertEquals("t2", response.rows()[0][0]);
        assertEquals(7, response.rows()[1][1]);
        assertEquals("t1", response.rows()[1][0]);
    }

    @Test
    public void testLimit1() throws Exception {
        execute("select * from information_schema.tables limit 1");
        assertEquals(1L, response.rowCount());
    }

    @Test
    public void testSelectUnknownTableFromInformationSchema() throws Exception {
        assertThrowsMatches(() -> execute("select * from information_schema.non_existent"),
                     isSQLError(is("Relation 'information_schema.non_existent' unknown"),
                                UNDEFINED_TABLE,
                                NOT_FOUND,
                                4041));
    }
}


text:
// 439. Segment Tree Build II
// https://www.lintcode.com/problem/segment-tree-build-ii/description
// https://www.jiuzhang.com/solutions/segment-tree-build-ii#tag-highlight-lang-cpp

/*
 * Segment Tree
 *
 */

/**
 * Definition of SegmentTreeNode:
 * class SegmentTreeNode {
 * public:
 *     int start, end, max;
 *     SegmentTreeNode *left, *right;
 *     SegmentTreeNode(int start, int end, int max) {
 *         this->start = start;
 *         this->end = end;
 *         this->max = max;
 *         this->left = this->right = NULL;
 *     }
 * }
 */

class Solution {
public:
    /**
     * @param A: a list of integer
     * @return: The root of Segment Tree
     */
    SegmentTreeNode * build(vector<int> &A) {
        // write your code here
        return buildTree(A, 0, A.size()-1);
    }

private:
    SegmentTreeNode * buildTree(vector<int>& A, int start, int end) {
        if (start > end) return NULL;

        SegmentTreeNode *node = new SegmentTreeNode(start, end, A[start]);
        if (start == end) return node;

        int mid = (start + end) / 2;
        node->left = buildTree(A, start, mid);
        node->right = buildTree(A, mid+1, end);
        if (node->left && node->left->max > node->max)
            node->max = node->left->max;
        if (node->right && node->right->max > node->max)
            node->max = node->right->max;
        return node;
    }
};


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

<TITLE>
All Classes
</TITLE>

<META NAME="date" CONTENT="2012-06-17">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

BDDSQLite

CarteGMapActivity

GeolocalisationService

MapOverlay

ParamActivity

PosItemizedOverlay

Position

PositionBDD

SelectionDateActivity

SmsIntentReceiver

UTBMSuiviGPSActivity


text:
'use strict';

/**
 * Module dependencies.
 */
var users = require('../../app/controllers/users.server.controller'),
	points = require('../../app/controllers/points.server.controller');

module.exports = function(app) {
	// Article Routes
	app.route('/points')
		.get(points.list)
		.post(users.requiresLogin, points.create);

	app.route('/points/:pointId')
		.get(points.read)
		.put(users.requiresLogin, points.hasAuthorization, points.update)
		.delete(users.requiresLogin, points.hasAuthorization, points.delete);

	// Finish by binding the point middleware
	app.param('pointId', points.pointByID);
};


text:
<!DOCTYPE html>

<meta charset="UTF-8">

<title>class RDoc::RDoc - RDoc Documentation</title>

<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">

    Home

    Pages
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Parent

Object

Methods

::add_generator

::current

::current=

::new

#document

#error

#gather_files

#generate

#handle_pipe

#install_siginfo_handler

#list_files_in_directory

#load_options

#normalized_file_list

#output_flag_file

#parse_dot_doc_file

#parse_file

#parse_files

#remove_siginfo_handler

#remove_unparseable

#setup_output_dir

#store=

#update_output_dir

    class RDoc::RDoc

This is the driver for generating RDoc output.  It
handles file parsing and generation of output.

To use this class to generate RDoc output via the
API, the recommended way is:

rdoc = RDoc::RDoc.new
options = rdoc.load_options # returns an RDoc::Options instance
# set extra options
rdoc.document options

You can also generate output like the rdoc executable:

rdoc = RDoc::RDoc.new
rdoc.document argv

Where argv is an array of strings, each corresponding to an
argument you'd give rdoc on the command line.  See <tt>rdoc
–help<tt> for details.

Constants

GENERATORS

This is the list of supported output generators

Attributes

          exclude[RW]

File pattern to exclude

          generator[RW]

Generator instance used for creating output

          last_modified[R]

Hash of files and their last modified times.

          options[RW]

RDoc options

          stats[R]

Accessor for statistics.  Available after each call to #parse_files

          store[R]

The current documentation store

Public Class Methods

          add_generator(klass)

          click to toggle source

Add klass that can generate output after parsing

# File lib/rdoc/rdoc.rb, line 70
def self.add_generator(klass)
  name = klass.name.sub(/^RDoc::Generator::/, '').downcase
  GENERATORS[name] = klass
end

          current()

          click to toggle source

Active RDoc::RDoc instance

# File lib/rdoc/rdoc.rb, line 78
def self.current
  @current
end

          current=(rdoc)

          click to toggle source

Sets the active RDoc::RDoc instance

# File lib/rdoc/rdoc.rb, line 85
def self.current= rdoc
  @current = rdoc
end

          new()

          click to toggle source

Creates a new RDoc::RDoc instance.  Call document to parse files and generate
documentation.

# File lib/rdoc/rdoc.rb, line 93
def initialize
  @current       = nil
  @exclude       = nil
  @generator     = nil
  @last_modified = {}
  @old_siginfo   = nil
  @options       = nil
  @stats         = nil
  @store         = nil
end

Public Instance Methods

          document(options)

          click to toggle source

Generates documentation or a coverage report depending upon the settings in
options.

options can be either an RDoc::Options instance or an array of strings
equivalent to the strings that would be passed on the command line like
%w[-q -o doc -t My\ Doc\ Title].  document will automatically call RDoc::Options#finish if an options
instance was given.

For a list of options, see either RDoc::Options
or rdoc --help.

By default, output will be stored in a directory called "doc" below the
current directory, so make sure you're somewhere writable before
invoking.

# File lib/rdoc/rdoc.rb, line 457
def document options
  self.store = RDoc::Store.new

  if RDoc::Options === options then
    @options = options
    @options.finish
  else
    @options = load_options
    @options.parse options
  end

  if @options.pipe then
    handle_pipe
    exit
  end

  @exclude = @options.exclude

  unless @options.coverage_report then
    @last_modified = setup_output_dir @options.op_dir, @options.force_update
  end

  @store.encoding = @options.encoding if @options.respond_to? :encoding
  @store.dry_run  = @options.dry_run
  @store.main     = @options.main_page
  @store.title    = @options.title
  @store.path     = @options.op_dir

  @start_time = Time.now

  @store.load_cache

  file_info = parse_files @options.files

  @options.default_title = "RDoc Documentation"

  @store.complete @options.visibility

  @stats.coverage_level = @options.coverage_report

  if @options.coverage_report then
    puts

    puts @stats.report.accept RDoc::Markup::ToRdoc.new
  elsif file_info.empty? then
    $stderr.puts "\nNo newer files." unless @options.quiet
  else
    gen_klass = @options.generator

    @generator = gen_klass.new @store, @options

    generate
  end

  if @stats and (@options.coverage_report or not @options.quiet) then
    puts
    puts @stats.summary.accept RDoc::Markup::ToRdoc.new
  end

  exit @stats.fully_documented? if @options.coverage_report
end

          error(msg)

          click to toggle source

Report an error message and exit

# File lib/rdoc/rdoc.rb, line 107
def error(msg)
  raise RDoc::Error, msg
end

          gather_files(files)

          click to toggle source

Gathers a set of parseable files from the files and directories listed in
files.

# File lib/rdoc/rdoc.rb, line 115
def gather_files files
  files = ["."] if files.empty?

  file_list = normalized_file_list files, true, @exclude

  file_list = file_list.uniq

  file_list = remove_unparseable file_list

  file_list.sort
end

          generate()

          click to toggle source

Generates documentation for file_info (from parse_files) into the output dir
using the generator selected by the RDoc options

# File lib/rdoc/rdoc.rb, line 524
def generate
  Dir.chdir @options.op_dir do
    unless @options.quiet then
      $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
    end

    @generator.generate
    update_output_dir '.', @start_time, @last_modified
  end
end

          handle_pipe()

          click to toggle source

Turns RDoc from stdin into HTML

# File lib/rdoc/rdoc.rb, line 130
def handle_pipe
  @html = RDoc::Markup::ToHtml.new @options

  parser = RDoc::Text::MARKUP_FORMAT[@options.markup]

  document = parser.parse $stdin.read

  out = @html.convert document

  $stdout.write out
end

          install_siginfo_handler()

          click to toggle source

Installs a siginfo handler that prints the current filename.

# File lib/rdoc/rdoc.rb, line 145
def install_siginfo_handler
  return unless Signal.list.include? 'INFO'

  @old_siginfo = trap 'INFO' do
    puts @current if @current
  end
end

          list_files_in_directory(dir)

          click to toggle source

Return a list of the files to be processed in a directory. We know that
this directory doesn't have a .document file, so we're looking for
real files. However we may well contain subdirectories which must be tested
for .document files.

# File lib/rdoc/rdoc.rb, line 332
def list_files_in_directory dir
  files = Dir.glob File.join(dir, "*")

  normalized_file_list files, false, @options.exclude
end

          load_options()

          click to toggle source

Loads options from .rdoc_options if the file exists, otherwise creates a
new RDoc::Options instance.

# File lib/rdoc/rdoc.rb, line 157
def load_options
  options_file = File.expand_path '.rdoc_options'
  return RDoc::Options.new unless File.exist? options_file

  RDoc.load_yaml

  parse_error = if Object.const_defined? :Psych then
                  Psych::SyntaxError
                else
                  ArgumentError
                end

  begin
    options = YAML.load_file '.rdoc_options'
  rescue *parse_error
  end

  raise RDoc::Error, "#{options_file} is not a valid rdoc options file" unless
    RDoc::Options === options

  options
end

          normalized_file_list(relative_files, force_doc = false, exclude_pattern = nil)

          click to toggle source

Given a list of files and directories, create a list of all the Ruby files
they contain.

If force_doc is true we always add the given files, if false,
only add files that we guarantee we can parse.  It is true when looking at
files given on the command line, false when recursing through
subdirectories.

The effect of this is that if you want a file with a non-standard extension
parsed, you must name it explicitly.

# File lib/rdoc/rdoc.rb, line 287
def normalized_file_list(relative_files, force_doc = false,
                         exclude_pattern = nil)
  file_list = []

  relative_files.each do |rel_file_name|
    next if rel_file_name.end_with? 'created.rid'
    next if exclude_pattern && exclude_pattern =~ rel_file_name
    stat = File.stat rel_file_name rescue next

    case type = stat.ftype
    when "file" then
      next if last_modified = @last_modified[rel_file_name] and
              stat.mtime.to_i <= last_modified.to_i

      if force_doc or RDoc::Parser.can_parse(rel_file_name) then
        file_list << rel_file_name.sub(/^\.\//, '')
        @last_modified[rel_file_name] = stat.mtime
      end
    when "directory" then
      next if rel_file_name == "CVS" || rel_file_name == ".svn"

      created_rid = File.join rel_file_name, "created.rid"
      next if File.file? created_rid

      dot_doc = File.join rel_file_name, RDoc::DOT_DOC_FILENAME

      if File.file? dot_doc then
        file_list << parse_dot_doc_file(rel_file_name, dot_doc)
      else
        file_list << list_files_in_directory(rel_file_name)
      end
    else
      warn "rdoc can't parse the #{type} #{rel_file_name}"
    end
  end

  file_list.flatten
end

          output_flag_file(op_dir)

          click to toggle source

Return the path name of the flag file in an output directory.

# File lib/rdoc/rdoc.rb, line 252
def output_flag_file(op_dir)
  File.join op_dir, "created.rid"
end

          parse_dot_doc_file(in_dir, filename)

          click to toggle source

The .document file contains a list of file and directory name patterns,
representing candidates for documentation. It may also contain comments
(starting with '#')

# File lib/rdoc/rdoc.rb, line 261
def parse_dot_doc_file in_dir, filename
  # read and strip comments
  patterns = File.read(filename).gsub(/#.*/, '')

  result = []

  patterns.split.each do |patt|
    candidates = Dir.glob(File.join(in_dir, patt))
    result.concat normalized_file_list(candidates)
  end

  result
end

          parse_file(filename)

          click to toggle source

Parses filename and returns an RDoc::TopLevel

# File lib/rdoc/rdoc.rb, line 341
  def parse_file filename
    if Object.const_defined? :Encoding then
      encoding = @options.encoding
      filename = filename.encode encoding
    end

    @stats.add_file filename

    return if RDoc::Parser.binary? filename

    content = RDoc::Encoding.read_file filename, encoding

    return unless content

    filename_path = Pathname(filename).expand_path
    relative_path = filename_path.relative_path_from @options.root

    if @options.page_dir and
       relative_path.to_s.start_with? @options.page_dir.to_s then
      relative_path =
        relative_path.relative_path_from @options.page_dir
    end

    top_level = @store.add_file filename, relative_path.to_s

    parser = RDoc::Parser.for top_level, filename, content, @options, @stats

    return unless parser

    parser.scan

    # restart documentation for the classes & modules found
    top_level.classes_or_modules.each do |cm|
      cm.done_documenting = false
    end

    top_level

  rescue Errno::EACCES => e
    $stderr.puts <<-EOF
Unable to read #{filename}, #{e.message}

Please check the permissions for this file.  Perhaps you do not have access to
it or perhaps the original author's permissions are to restrictive.  If the
this is not your library please report a bug to the author.
    EOF
  rescue => e
    $stderr.puts <<-EOF
Before reporting this, could you check that the file you're documenting
has proper syntax:

  #{Gem.ruby} -c #{filename}

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

\t(#{e.class}) #{e.message}

    EOF

    $stderr.puts e.backtrace.join("\n\t") if $DEBUG_RDOC

    raise e
    nil
  end

          parse_files(files)

          click to toggle source

Parse each file on the command line, recursively entering directories.

# File lib/rdoc/rdoc.rb, line 411
def parse_files files
  file_list = gather_files files
  @stats = RDoc::Stats.new @store, file_list.length, @options.verbosity

  return [] if file_list.empty?

  @stats.begin_adding

  file_info = file_list.map do |filename|
    @current = filename
    parse_file filename
  end.compact

  @stats.done_adding

  file_info
end

          remove_siginfo_handler()

          click to toggle source

Removes a siginfo handler and replaces the previous

# File lib/rdoc/rdoc.rb, line 538
def remove_siginfo_handler
  return unless Signal.list.key? 'INFO'

  handler = @old_siginfo || 'DEFAULT'

  trap 'INFO', handler
end

          remove_unparseable(files)

          click to toggle source

Removes file extensions known to be unparseable from files and
TAGS files for emacs and vim.

# File lib/rdoc/rdoc.rb, line 433
def remove_unparseable files
  files.reject do |file|
    file =~ /\.(?:class|eps|erb|scpt\.txt|ttf|yml)$/i or
      (file =~ /tags$/i and
       open(file, 'rb') { |io|
         io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/
       })
  end
end

          setup_output_dir(dir, force)

          click to toggle source

Create an output dir if it doesn't exist. If it does exist, but
doesn't contain the flag file created.rid then we refuse
to use it, as we may clobber some manually generated documentation

# File lib/rdoc/rdoc.rb, line 185
  def setup_output_dir(dir, force)
    flag_file = output_flag_file dir

    last = {}

    if @options.dry_run then
      # do nothing
    elsif File.exist? dir then
      error "#{dir} exists and is not a directory" unless File.directory? dir

      begin
        open flag_file do |io|
          unless force then
            Time.parse io.gets

            io.each do |line|
              file, time = line.split "\t", 2
              time = Time.parse(time) rescue next
              last[file] = time
            end
          end
        end
      rescue SystemCallError, TypeError
        error <<-ERROR

Directory #{dir} already exists, but it looks like it isn't an RDoc directory.

Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op <dir>
option)

        ERROR
      end unless @options.force_output
    else
      FileUtils.mkdir_p dir
      FileUtils.touch flag_file
    end

    last
  end

          store=(store)

          click to toggle source

Sets the current documentation tree to store and sets the
store's rdoc driver to this instance.

# File lib/rdoc/rdoc.rb, line 230
def store= store
  @store = store
  @store.rdoc = self
end

          update_output_dir(op_dir, time, last = {})

          click to toggle source

Update the flag file in an output directory.

# File lib/rdoc/rdoc.rb, line 238
def update_output_dir(op_dir, time, last = {})
  return if @options.dry_run or not @options.update_output_dir

  open output_flag_file(op_dir), "w" do |f|
    f.puts time.rfc2822
    last.each do |n, t|
      f.puts "#{n}\t#{t.rfc2822}"
    end
  end
end

Validate

Generated by RDoc 4.2.0.

Based on Darkfish by Michael Granger.


text:
import { IpcRenderer } from 'electron'

declare global {
  // eslint-disable-next-line @typescript-eslint/no-namespace
  namespace NodeJS {
    interface Global {
      ipcRenderer: IpcRenderer
    }
  }
}

export type User = {
  id: number
  name: string
}


text:
<?php

namespace denar90\lazyloading\controllers;

use Yii;
use yii\web\Controller;

class LazyLoadingController extends Controller {

    /**
     * Action for getting data.
     * @param boolean $getDataFlag
     * @param string $limit How many items get from table
     * @param string $offset
     * @return json $data Data with items
     */
    public function actionIndex($getDataFlag = false, $limit = 10, $offset = 0) {
        if ($getDataFlag) {
            $module = $this->module;
            //create instance of model with items
            $items = new $module->modelNamespace;
            $data = [
                'additionalData' => [
                    'limit' => $limit,
                    'offset' => $offset,
                    'mode' => $module->mode
                ]
            ];

            //build additional urls depends on mode
            switch($module->mode) {
                case 'list':
                    break;
                case 'view':
                    $viewItemLink = $module->additionalLinks['view']['controller'] . '/' . $module->additionalLinks['view']['action'];
                    $data['additionalData']['urls'] = [
                        'viewItem' => Yii::$app->urlManager->createUrl([$viewItemLink]),
                    ];
                    break;
                case 'edit':
                    $viewItemLink = $module->additionalLinks['view']['controller'] . '/' . $module->additionalLinks['view']['action'];
                    $removeItemLink = $module->additionalLinks['delete']['controller'] . '/' . $module->additionalLinks['delete']['action'];
                    $data['additionalData']['urls'] = [
                        'viewItem' => Yii::$app->urlManager->createUrl([$viewItemLink]),
                        'removeItem' => Yii::$app->urlManager->createUrl([$removeItemLink])
                    ];
                    break;
            }

            //get data method from own model
            $data['items'] = $items->getAllItems($limit, $offset);
            Yii::$app->response->format = 'json';
            return $data;
        } else {
            return $this->render('index');
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: Dynamoid::Associations::ManyAssociation

    — Documentation by YARD 0.7.5

</title>

  <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

    Index (M) »
    Dynamoid » Associations
     »
    ManyAssociation

(no frames)

    Class List

    Method List

    File List

Module: Dynamoid::Associations::ManyAssociation

Includes:

Association, Enumerable

Included in:

HasAndBelongsToMany, HasMany

Defined in:

lib/dynamoid/associations/many_association.rb

Instance Attribute Summary (collapse)

      - (Object) query

Returns the value of attribute query.

Attributes included from Association

#loaded, #name, #options, #source

      Instance Method Summary
      (collapse)

      - (Dynamoid::Document) <<(object)

Add an object or array of objects to an association.

      - (Boolean) ==(other)

Is this array equal to the association's records?.

      - (Dynamoid::Document) create(attributes = {})

Create a new instance of the target class and add it directly to the association.

      - (Dynamoid::Document) create!(attributes = {})

Create a new instance of the target class and add it directly to the association.

      - (Dynamoid::Document) delete(object)

Deletes an object or array of objects from the association.

      - (Object) delete_all

Deletes all members of the association and removes them from the association.

      - (Object) destroy_all

Destroys all members of the association and removes them from the association.

      - (Dynamoid::Document) each(&block)

Create a new instance of the target class and add it directly to the association.

      - (Object) find_target

The records associated to the source.

      - (Boolean) include?(object)

Delegate include? to the records.

      - (ManyAssociation) initialize(*args)

A new instance of ManyAssociation.

      - (Object) method_missing(method, *args)

Delegate methods we don't find directly to the records array.

      - (Object) records

      (also: #all)

      - (Dynamoid::Document) setter(object)

Replace an association with object or array of objects.

      - (Dynamoid::Association) where(args)

Naive association filtering.

Methods included from Association

#loaded?, #reset, #target

Dynamic Method Handling

    This class handles dynamic methods through the <tt>method_missing</tt> method

    - (<tt>Object</tt>) method_missing(method, *args)

Delegate methods we don't find directly to the records array.

Since:

0.2.0

164
165
166
167
168
169
170

# File 'lib/dynamoid/associations/many_association.rb', line 164

def method_missing(method, *args)
  if records.respond_to?(method)
    records.send(method, *args)
  else
    super
  end
end

Instance Attribute Details

    - (<tt>Object</tt>) query

Returns the value of attribute query

8
9
10

# File 'lib/dynamoid/associations/many_association.rb', line 8

def query
  @query
end

Instance Method Details

  <p class="signature first" id="<<-instance_method">

    - (<tt>Dynamoid::Document</tt>) <<(object)

Add an object or array of objects to an association. This preserves the current records in the association (if any)
and adds the object to the target association if it is detected to exist.

Parameters:

        object

        (<tt>Dynamoid::Document</tt>)

        —

the object (or array of objects) to add to the association

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the added object

Since:

0.2.0

69
70
71
72
73

# File 'lib/dynamoid/associations/many_association.rb', line 69

def <<(object)
  source.update_attribute(source_attribute, source_ids.merge(Array(object).collect(&:id)))
  Array(object).each {|o| self.send(:associate_target, o)} if target_association
  object
end

    - (<tt>Boolean</tt>) ==(other)

Is this array equal to the association's records?

Returns:

        (<tt>Boolean</tt>)

        —

true/false

Since:

0.2.0

157
158
159

# File 'lib/dynamoid/associations/many_association.rb', line 157

def ==(other)
  records == Array(other)
end

    - (<tt>Dynamoid::Document</tt>) create(attributes = {})

Create a new instance of the target class and add it directly to the association.

Parameters:

        attribute

        (<tt>Hash</tt>)

        —

hash for the new object

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the newly-created object

Since:

0.2.0

107
108
109

# File 'lib/dynamoid/associations/many_association.rb', line 107

def create(attributes = {})
  self << target_class.create(attributes)
end

    - (<tt>Dynamoid::Document</tt>) create!(attributes = {})

Create a new instance of the target class and add it directly to the association. If the create fails an exception will be raised.

Parameters:

        attribute

        (<tt>Hash</tt>)

        —

hash for the new object

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the newly-created object

Since:

0.2.0

96
97
98

# File 'lib/dynamoid/associations/many_association.rb', line 96

def create!(attributes = {})
  self << target_class.create!(attributes)
end

    - (<tt>Dynamoid::Document</tt>) delete(object)

Deletes an object or array of objects from the association. This removes their records from the association field on the source,
and attempts to remove the source from the target association if it is detected to exist.

Parameters:

        object

        (<tt>Dynamoid::Document</tt>)

        —

the object (or array of objects) to remove from the association

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the deleted object

Since:

0.2.0

54
55
56
57
58

# File 'lib/dynamoid/associations/many_association.rb', line 54

def delete(object)
  source.update_attribute(source_attribute, source_ids - Array(object).collect(&:id))
  Array(object).each {|o| self.send(:disassociate_target, o)} if target_association
  object
end

    - (<tt>Object</tt>) delete_all

Deletes all members of the association and removes them from the association.

Since:

0.2.0

134
135
136
137
138

# File 'lib/dynamoid/associations/many_association.rb', line 134

def delete_all
  objs = target
  source.update_attribute(source_attribute, nil)
  objs.each(&:delete)
end

    - (<tt>Object</tt>) destroy_all

Destroys all members of the association and removes them from the association.

Since:

0.2.0

125
126
127
128
129

# File 'lib/dynamoid/associations/many_association.rb', line 125

def destroy_all
  objs = target
  source.update_attribute(source_attribute, nil)
  objs.each(&:destroy)
end

    - (<tt>Dynamoid::Document</tt>) each(&block)

Create a new instance of the target class and add it directly to the association. If the create fails an exception will be raised.

Parameters:

        attribute

        (<tt>Hash</tt>)

        —

hash for the new object

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the newly-created object

Since:

0.2.0

118
119
120

# File 'lib/dynamoid/associations/many_association.rb', line 118

def each(&block)
  records.each(&block)
end

    - (<tt>Object</tt>) find_target

The records associated to the source.

Returns:

the association records; depending on which association this is, either a single instance or an array

Since:

0.2.0

24
25
26

# File 'lib/dynamoid/associations/many_association.rb', line 24

def find_target
  Array(target_class.find(source_ids.to_a))
end

    - (<tt>Boolean</tt>) include?(object)

Delegate include? to the records.

Returns:

        (<tt>Boolean</tt>)

42
43
44

# File 'lib/dynamoid/associations/many_association.rb', line 42

def include?(object)
  records.include?(object)
end

    - (<tt>ManyAssociation</tt>) initialize(*args)

A new instance of ManyAssociation

10
11
12
13

# File 'lib/dynamoid/associations/many_association.rb', line 10

def initialize(*args)
  @query = {}
  super
end

    - (<tt>Object</tt>) records

    Also known as:
    all

28
29
30
31
32
33
34

# File 'lib/dynamoid/associations/many_association.rb', line 28

def records
  if query.empty?
    target
  else
    results_with_query(target)
  end
end

    - (<tt>Dynamoid::Document</tt>) setter(object)

Replace an association with object or array of objects. This removes all of the existing associated records and replaces them with
the passed object(s), and associates the target association if it is detected to exist.

Parameters:

        object

        (<tt>Dynamoid::Document</tt>)

        —

the object (or array of objects) to add to the association

Returns:

        (<tt>Dynamoid::Document</tt>)

        —

the added object

Since:

0.2.0

83
84
85
86
87

# File 'lib/dynamoid/associations/many_association.rb', line 83

def setter(object)
  target.each {|o| delete(o)}
  self << (object)
  object
end

    - (<tt>Dynamoid::Association</tt>) where(args)

Naive association filtering.

Parameters:

        A

        (<tt>Hash</tt>)

        —

hash of attributes; each must match every returned object's attribute exactly.

Returns:

        (<tt>Dynamoid::Association</tt>)

        —

the association this method was called on (for chaining purposes)

Since:

0.2.0

147
148
149
150

# File 'lib/dynamoid/associations/many_association.rb', line 147

def where(args)
  args.each {|k, v| query[k] = v}
  self
end

  Generated on Thu Apr 26 01:26:26 2012 by
  yard
  0.7.5 (ruby-1.9.3).