text:
'use strict';

var Heatmap = {};

Heatmap.attributes = require('./attributes');
Heatmap.supplyDefaults = require('./defaults');
Heatmap.calc = require('./calc');
Heatmap.plot = require('./plot');
Heatmap.colorbar = require('./colorbar');
Heatmap.style = require('./style');
Heatmap.hoverPoints = require('./hover');

Heatmap.moduleType = 'trace';
Heatmap.name = 'heatmap';
Heatmap.basePlotModule = require('../../plots/cartesian');
Heatmap.categories = ['cartesian', '2dMap'];
Heatmap.meta = {
    description: [
        'The data that describes the heatmap value-to-color mapping',
        'is set in `z`.',
        'Data in `z` can either be a {2D array} of values (ragged or not)',
        'or a 1D array of values.',

        'In the case where `z` is a {2D array},',
        'say that `z` has N rows and M columns.',
        'Then, by default, the resulting heatmap will have N partitions along',
        'the y axis and M partitions along the x axis.',
        'In other words, the i-th row/ j-th column cell in `z`',
        'is mapped to the i-th partition of the y axis',
        '(starting from the bottom of the plot) and the j-th partition',
        'of the x-axis (starting from the left of the plot).',
        'This behavior can be flipped by using `transpose`.',
        'Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.',
        'If M (N), then the coordinates correspond to the center of the',
        'heatmap cells and the cells have equal width.',
        'If M+1 (N+1), then the coordinates correspond to the edges of the',
        'heatmap cells.',

        'In the case where `z` is a 1D {array}, the x and y coordinates must be',
        'provided in `x` and `y` respectively to form data triplets.'
    ].join(' ')
};

module.exports = Heatmap;


text:
<?xml version="1.0" encoding="utf-8"?>
<!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" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta name="description" content="Executes an SQL query statement for the specified table occurrence within a FileMaker Pro database." />

    <title>ExecuteSQL</title>

    <link rel="StyleSheet" href="../css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="../css/print.css" type="text/css" media="print" />

      FileMaker Pro 13 Help

      Contents
      Next >
      < Previous

      Home >
      Reference >
      Functions reference >
      Logical functions >
      ExecuteSQL

ExecuteSQL

Purpose

Executes an SQL query statement for the specified table occurrence within a FileMaker Pro database.

Format

ExecuteSQL(sqlQuery; fieldSeparator; rowSeparator {;arguments...})

Parameters

sqlQuery - an SQL SELECT statement. The statement can include a Union clause that combines the results of two queries. The statement can contain programmatically generated SQL (dynamic parameters) that indicate where optional arguments are to be used in the query. Use the question mark character (?) to specify a dynamic parameter.

fieldSeparator - the character string used as a separator between fields in the result. If an empty string is specified, the separator is a comma. The field separator is not displayed after the last field in the result.

rowSeparator - the character string used as a separator between records in the result. If an empty string is specified, the separator is a carriage return. The row separator is not displayed after the last row in the result.

arguments- one or more expressions that are evaluated and used as values for the dynamic parameters in the query statement.

Data type returned

text

Originated in

FileMaker Pro 12.0

Description

ExecuteSQL enables you to execute SQL SELECT statements containing dynamic parameters to safely query FileMaker Pro databases in order to avoid security vulnerabilities through injection attacks.

ExecuteSQL does not recognize relationships created in FileMaker Pro, which gives you flexibility to define relationships in SQL statements and retrieve data from any table, independent of the layout context.

ExecuteSQL cannot be used with SQL statements that modify data or the database schema (such as the Insert Into or Delete Table commands).

If an error occurs during query parsing or execution, FileMaker Pro returns ?.

Notes

                 •

To apply the correct formatting to dates in an SQL query, use the DATE statement. If you do not use the DATE statement, ExecuteSQL treats dates as literal strings.

                 •

FileMaker Pro returns date, time, and number data in Unicode/SQL format, not in the locale of the operating system or the file.

                 •

ExecuteSQL accepts only the SQL-92 syntax ISO date and time formats with no braces. ExecuteSQL does not accept the ODBC/JDBC format date, time, and timestamp constants in braces.

                 •

For more details about SELECT statement syntax, supported SQL statements, expressions, and Catalog functions, see the FileMaker ODBC and JDBC Guide and the FileMaker SQL Reference.

Examples

Suppose a database contains two tables, Employees and Salaries, which are related through the EmpID field.

        Note  The Salaries::Salary field is a number field.

You want to add a field to the Employees table that displays the percentage of an employee's salary relative to the total salaries in a department. Though you could use a calculation in FileMaker Pro to generate this value, you can use the ExecuteSQL function to specify this query using dynamic parameters.

Define a calculation field in the Employees table, then use the ExecuteSQL function to specify the following query statement:

100 * Salaries::Salary /  ExecuteSQL ( "select sum ( S.salary ) from Employees E join Salaries S on E.EmpID = S.EmpID where E.Department = ?"; ""; ""; Employees::Department )

Related topics

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas

Was this topic helpful? Send feedback.

redpajama_set_name: RedPajamaGithub


text:
package collider

import (
	"crypto/tls"
	"golang.org/x/net/websocket"
	"encoding/json"
	"errors"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"strconv"
	"strings"
	"time"
)

const registerTimeoutSec = 10

// This is a temporary solution to avoid holding a zombie connection forever, by
// setting a 1 day timeout on reading from the WebSocket connection.
const wsReadTimeoutSec = 60 * 60 * 24

type Collider struct {
	*roomTable
	dash *dashboard
}

func NewCollider(rs string) *Collider {
	return &Collider{
		roomTable: newRoomTable(time.Second*registerTimeoutSec, rs),
		dash:      newDashboard(),
	}
}

// Run starts the collider server and blocks the thread until the program exits.
func (c *Collider) Run(p int, useTls bool) {
	http.Handle("/ws", websocket.Handler(c.wsHandler))
	http.HandleFunc("/status", c.httpStatusHandler)
	http.HandleFunc("/", c.httpHandler)

	var e error

	pstr := ":" + strconv.Itoa(p)
	if useTls {
		config := &tls.Config {
			// Only allow ciphers that support forward secrecy for iOS9 compatibility:
			// https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/
			CipherSuites: []uint16 {
				tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
				tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
				tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
				tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
				tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
				tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
				tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
			},
			PreferServerCipherSuites: true,
		}
		server := &http.Server{ Addr: pstr, Handler: nil, TLSConfig: config }

		e = server.ListenAndServeTLS("/cert/cert.pem", "/cert/key.pem")
	} else {
		e = http.ListenAndServe(pstr, nil)
	}

	if e != nil {
		log.Fatal("Run: " + e.Error())
	}
}

// httpStatusHandler is a HTTP handler that handles GET requests to get the
// status of collider.
func (c *Collider) httpStatusHandler(w http.ResponseWriter, r *http.Request) {
	w.Header().Add("Access-Control-Allow-Origin", "*")
	w.Header().Add("Access-Control-Allow-Methods", "GET")

	rp := c.dash.getReport(c.roomTable)
	enc := json.NewEncoder(w)
	if err := enc.Encode(rp); err != nil {
		err = errors.New("Failed to encode to JSON: err=" + err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
		c.dash.onHttpErr(err)
	}
}

// httpHandler is a HTTP handler that handles GET/POST/DELETE requests.
// POST request to path "/$ROOMID/$CLIENTID" is used to send a message to the other client of the room.
// $CLIENTID is the source client ID.
// The request must have a form value "msg", which is the message to send.
// DELETE request to path "/$ROOMID/$CLIENTID" is used to delete all records of a client, including the queued message from the client.
// "OK" is returned if the request is valid.
func (c *Collider) httpHandler(w http.ResponseWriter, r *http.Request) {
	w.Header().Add("Access-Control-Allow-Origin", "*")
	w.Header().Add("Access-Control-Allow-Methods", "POST, DELETE")

	p := strings.Split(r.URL.Path, "/")
	if len(p) != 3 {
		c.httpError("Invalid path: "+r.URL.Path, w)
		return
	}
	rid, cid := p[1], p[2]

	switch r.Method {
	case "POST":
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			c.httpError("Failed to read request body: "+err.Error(), w)
			return
		}
		m := string(body)
		if m == "" {
			c.httpError("Empty request body", w)
			return
		}
		if err := c.roomTable.send(rid, cid, m); err != nil {
			c.httpError("Failed to send the message: "+err.Error(), w)
			return
		}
	case "DELETE":
		c.roomTable.remove(rid, cid)
	default:
		return
	}

	io.WriteString(w, "OK\n")
}

// wsHandler is a WebSocket server that handles requests from the WebSocket client in the form of:
// 1. { 'cmd': 'register', 'roomid': $ROOM, 'clientid': $CLIENT' },
// which binds the WebSocket client to a client ID and room ID.
// A client should send this message only once right after the connection is open.
// or
// 2. { 'cmd': 'send', 'msg': $MSG }, which sends the message to the other client of the room.
// It should be sent to the server only after 'regiser' has been sent.
// The message may be cached by the server if the other client has not joined.
//
// Unexpected messages will cause the WebSocket connection to be closed.
func (c *Collider) wsHandler(ws *websocket.Conn) {
	var rid, cid string

	registered := false

	var msg wsClientMsg
loop:
	for {
		err := ws.SetReadDeadline(time.Now().Add(time.Duration(wsReadTimeoutSec) * time.Second))
		if err != nil {
			c.wsError("ws.SetReadDeadline error: "+err.Error(), ws)
			break
		}

		err = websocket.JSON.Receive(ws, &msg)
		if err != nil {
			if err.Error() != "EOF" {
				c.wsError("websocket.JSON.Receive error: "+err.Error(), ws)
			}
			break
		}

		switch msg.Cmd {
		case "register":
			if registered {
				c.wsError("Duplicated register request", ws)
				break loop
			}
			if msg.RoomID == "" || msg.ClientID == "" {
				c.wsError("Invalid register request: missing 'clientid' or 'roomid'", ws)
				break loop
			}
			if err = c.roomTable.register(msg.RoomID, msg.ClientID, ws); err != nil {
				c.wsError(err.Error(), ws)
				break loop
			}
			registered, rid, cid = true, msg.RoomID, msg.ClientID
			c.dash.incrWs()

			defer c.roomTable.deregister(rid, cid)
			break
		case "send":
			if !registered {
				c.wsError("Client not registered", ws)
				break loop
			}
			if msg.Msg == "" {
				c.wsError("Invalid send request: missing 'msg'", ws)
				break loop
			}
			c.roomTable.send(rid, cid, msg.Msg)
			break
		default:
			c.wsError("Invalid message: unexpected 'cmd'", ws)
			break
		}
	}
	// This should be unnecessary but just be safe.
	ws.Close()
}

func (c *Collider) httpError(msg string, w http.ResponseWriter) {
	err := errors.New(msg)
	http.Error(w, err.Error(), http.StatusInternalServerError)
	c.dash.onHttpErr(err)
}

func (c *Collider) wsError(msg string, ws *websocket.Conn) {
	err := errors.New(msg)
	sendServerErr(ws, msg)
	c.dash.onWsErr(err)
}


text:
<template name="work">

{{ dict 'work.title' 'Work' }}

                    {{ dict 'work.mission' 'We\'re in the business of delivering' }}

                        {{ dict 'work.highight' 'measurable results.' }}

                {{ dict 'work.projectsStatement' 'Recent Case Studies:' }}

            {{> projects}}

                {{ dict 'work.clientsStatement' 'Clients:' }}

            {{> clients}}

</template>


text:
<?php

namespace Sonata\MediaBundle\Twig\TokenParser;

use Sonata\MediaBundle\Twig\Node\PathNode;

class PathTokenParser extends \Twig_TokenParser
{
    protected $extensionName;

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

    /**
     * Parses a token and returns a node.
     *
     * @param \Twig_Token $token A \Twig_Token instance
     *
     * @return \Twig_NodeInterface A \Twig_NodeInterface instance
     */
    public function parse(\Twig_Token $token)
    {
        $media = $this->parser->getExpressionParser()->parseExpression();

        $this->parser->getStream()->next();

        $format = $this->parser->getExpressionParser()->parseExpression();

        $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE);

        return new PathNode($this->extensionName, $media, $format, $token->getLine(), $this->getTag());
    }

    /**
     * Gets the tag name associated with this token parser.
     *
     * @param string The tag name
     */
    public function getTag()
    {
        return 'path';
    }
}


text:
class AutoBox {
    public static void main(String args[]) {
        Integer iOb = 100;
        Double dOb = 98.6;

        dOb = dOb + iOb;
        System.out.println("dOb after expression: " + dOb);
    }
}


text:
function PhantomReporter() {
  this.jasmineDone = function() {
    window.callPhantom({ state: 'jasmineDone' });
  };

  this.specDone = function(results) {
    window.callPhantom({ state: 'specDone', results: results });
  };

  this.suiteDone = function(results) {
    window.callPhantom({ state: 'suiteDone', results: results });
  };
}

jasmine.getEnv().addReporter(new PhantomReporter());


text:
package org.apache.nutch.api.impl.db;

import java.io.IOException;
import java.util.Map;
import java.util.Set;

import org.apache.avro.util.Utf8;
import org.apache.commons.collections.CollectionUtils;
import org.apache.gora.query.Result;
import org.apache.nutch.storage.Mark;
import org.apache.nutch.storage.WebPage;
import org.apache.nutch.util.NutchJob;
import org.apache.nutch.util.TableUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Sets;
import com.google.common.collect.UnmodifiableIterator;

public class DbIterator extends UnmodifiableIterator<Map<String, Object>> {
  private static final Logger LOG = LoggerFactory.getLogger(DbIterator.class);

  private Result<String, WebPage> result;
  private boolean hasNext;
  private String url;
  private WebPage page;
  private Utf8 batchId;
  private Set<String> commonFields;

  DbIterator(Result<String, WebPage> res, Set<String> fields, String batchId) {
    this.result = res;
    if (batchId != null) {
      this.batchId = new Utf8(batchId);
    }
    if (fields != null) {
      this.commonFields = Sets.newTreeSet(fields);
    }
    try {
      skipNonRelevant();
    } catch (Exception e) {
      LOG.error("Cannot create db iterator!", e);
    }
  }

  private void skipNonRelevant() throws Exception, IOException {
    hasNext = result.next();
    if (!hasNext) {
      return;
    }
    if (batchId == null) {
      return;
    }

    while (hasNext) {
      WebPage page = result.get();
      Utf8 mark = Mark.UPDATEDB_MARK.checkMark(page);
      if (NutchJob.shouldProcess(mark, batchId)) {
        return;
      }

      LOG.debug("Skipping {}; different batch id", result.getKey());
      hasNext = result.next();
    }
  }

  public boolean hasNext() {
    return hasNext;
  }

  public Map<String, Object> next() {
    url = result.getKey();
    page = WebPage.newBuilder(result.get()).build();
    try {
      skipNonRelevant();
      if (!hasNext) {
        result.close();
      }
    } catch (Exception e) {
      LOG.error("Cannot get next result!", e);
      hasNext = false;
      return null;
    }
    return pageAsMap(url, page);
  }

  private Map<String, Object> pageAsMap(String url, WebPage page) {
    Map<String, Object> result = DbPageConverter
        .convertPage(page, commonFields);

//    if (commonFields.size()<=0 || commonFields.contains("url")) {
      if (CollectionUtils.isEmpty(commonFields) || commonFields.contains("url")) {
      result.put("url", TableUtil.unreverseUrl(url));
    }
    return result;
  }

}


text:
package com.google.gson;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Collection;

/**
 * A mechanism for providing custom field naming in Gson.  This allows the client code to translate
 * field names into a particular convention that is not supported as a normal Java field
 * declaration rules.  For example, Java does not support "-" characters in a field name.
 *
 * @author Joel Leitch
 */
abstract class RecursiveFieldNamingPolicy implements FieldNamingStrategy2 {

	public final String translateName(FieldAttributes f) {
		return translateName(f.getName(), f.getDeclaredType(), f.getAnnotations());
	}

	/**
	 * Performs the specific string translation.
	 *
	 * @param target the string object that will be manipulation/translated
	 * @param fieldType the actual type value of the field
	 * @param annotations the annotations set on the field
	 * @return the translated field name
	 */
	protected abstract String translateName(String target, Type fieldType, Collection<Annotation> annotations);
}


text:
package org.poc.ctakes.spark;

//Java imports
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import javax.swing.event.ListSelectionEvent;
import java.util.*;

//UIMA imports
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.cas.impl.XmiCasSerializer;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.util.XMLSerializer;
import org.apache.uima.cas.FSIndex;
import org.apache.uima.cas.FSIterator;
import org.apache.uima.cas.Type;
import org.apache.uima.jcas.cas.FSArray;
import org.apache.uima.jcas.JCas;
import org.apache.uima.UIMAException;

//Apache Spark imports
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.FlatMapFunction;

//Apache cTakes imports
import org.apache.ctakes.typesystem.type.refsem.OntologyConcept;
import org.apache.ctakes.typesystem.type.textsem.*;
import org.apache.ctakes.clinicalpipeline.ClinicalPipelineFactory;

/**
 * @author Yuriy Toropov
 *
 */
//<T,R>
public class CtakesFlatMapFunction implements FlatMapFunction<java.util.Iterator<String>, String> {

	transient JCas jcas = null;
	transient AnalysisEngine ae = null;

	private void setup() throws UIMAException, java.net.MalformedURLException {
		System.setProperty("ctakes.umlsuser", "");
		System.setProperty("ctakes.umlspw", "");
		this.jcas = JCasFactory.createJCas();
		this.ae = AnalysisEngineFactory.createEngine(ClinicalPipelineFactory.getDefaultPipeline());

	}

	private void readObject(ObjectInputStream in) {
		try {
			in.defaultReadObject();
			this.setup();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (UIMAException e) {
			e.printStackTrace();
		}
	}

	@Override
	//return table csv-like output of AnnotationType,code
	public java.util.Iterator<String> call(java.util.Iterator<String> partition) throws Exception {

		CtakesMapFunctionInner analyze=new CtakesMapFunctionInner();
		HashSet<String> analyzed=new HashSet<String>();
		while(partition.hasNext()) {

			String note=(String)partition.next();
			analyzed.addAll(analyze.call(note));

		}

		return analyzed.iterator();
	}

	//this could be done instead as an anonymous function using new Function<String,HashSet<String>>() {...}
	class CtakesMapFunctionInner implements Function<String,HashSet<String>> {

		@Override
		public HashSet<String> call(String paragraph) throws Exception {

			CtakesFlatMapFunction.this.jcas.setDocumentText(paragraph);

			//
			SimplePipeline.runPipeline(CtakesFlatMapFunction.this.jcas, CtakesFlatMapFunction.this.ae);

			FSIndex index = CtakesFlatMapFunction.this.jcas.getAnnotationIndex(IdentifiedAnnotation.type);
			FSIterator iter = index.iterator();

			ArrayList<String> types = new ArrayList<String>();

			// only get the following types of annotations
			types.add("org.apache.ctakes.typesystem.type.textsem.SignSymptomMention");
			types.add("org.apache.ctakes.typesystem.type.textsem.DiseaseDisorderMention");
			types.add("org.apache.ctakes.typesystem.type.textsem.AnatomicalSiteMention");
			types.add("org.apache.ctakes.typesystem.type.textsem.ProcedureMention");
			types.add("org.apache.ctakes.typesystem.type.textsem.MedicationMention");
			HashSet<String> hsAnnotations = new HashSet<String>();

			String type = "";
			FSArray codesArray;

			while (iter.isValid()) {

				// TODO: Check if we correctly iterate over index
				// using https://uima.apache.org/d/uimaj-2.7.0/apidocs/org/apache/uima/cas/FSIterator.html documentation
				IdentifiedAnnotation annotation = (IdentifiedAnnotation) iter.get();
				type = annotation.getType().toString();
				if (types.contains(type)) {

					codesArray = annotation.getOntologyConceptArr();

					for (int i = 0; i < codesArray.size(); i++) {
						hsAnnotations.add(String.format("%s,%s", type,((OntologyConcept) codesArray.get(i)).getCode()));
					}
				}

				iter.moveToNext();
			}

			CtakesFlatMapFunction.this.jcas.reset();
			return hsAnnotations;
		}
	}
}


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#ifndef NATIVE_EXTENSION_VTK_VTKVOLUMEREADERWRAP_H
#define NATIVE_EXTENSION_VTK_VTKVOLUMEREADERWRAP_H

#include <nan.h>

#include <vtkSmartPointer.h>
#include <vtkVolumeReader.h>

#include "vtkImageAlgorithmWrap.h"
#include "../../plus/plus.h"

class VtkVolumeReaderWrap : public VtkImageAlgorithmWrap
{
	public:
		using Nan::ObjectWrap::Wrap;
		static void Init(v8::Local<v8::Object> exports);
		static void InitPtpl();
		static void ConstructorGetter(
			v8::Local<v8::String> property,
			const Nan::PropertyCallbackInfo<v8::Value>& info);

		VtkVolumeReaderWrap(vtkSmartPointer<vtkVolumeReader>);
		VtkVolumeReaderWrap();
		~VtkVolumeReaderWrap( );
		static Nan::Persistent<v8::FunctionTemplate> ptpl;

	private:
		static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);

		static void GetDataOrigin(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetDataSpacing(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetFilePattern(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetFilePrefix(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetImageRange(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetDataOrigin(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetDataSpacing(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetFilePattern(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetFilePrefix(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetImageRange(const Nan::FunctionCallbackInfo<v8::Value>& info);

#ifdef VTK_NODE_PLUS_VTKVOLUMEREADERWRAP_CLASSDEF
		VTK_NODE_PLUS_VTKVOLUMEREADERWRAP_CLASSDEF
#endif
};

#endif


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('payments', '0004_auto_20160904_0048'),
    ]

    operations = [
        migrations.AlterField(
            model_name='subscription',
            name='status',
            field=models.CharField(choices=[('new', 'Created'), ('unconfirmed', 'Waiting for payment'), ('active', 'Active'), ('cancelled', 'Cancelled'), ('error', 'Error')], default='new', max_length=16),
        ),
    ]


text:
package ir

type Tx func(w []byte, r []byte) error

type Reader struct {
	Tx
	Addr    byte
	IRArray *SensorArray
}

func (r *Reader) Get() (Reading, error) {
	read := make([]byte, 3)
	if err := r.Tx([]byte{r.Addr}, read); err != nil {
		return Reading{}, err
	}
	return r.ReadStatus(read)
}

func (r *Reader) ReadStatus(read []byte) (Reading, error) {
	irSensor, err := r.IRArray.Reading(read)
	if err != nil {
		// Not possible to hit this error if read slice is correct size above.
		return Reading{}, err
	}
	return irSensor, nil
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<javascript app="versions"/>


text:
export NODE_ENV="develop"
export AWS_ACCESS_KEY="AKIAJ3NFSU32X33E2HCA"
export AWS_SECRET_KEY="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"
export ENDPOINT_PICTURES_URL="http://localhost:5000"
export ENDPOINT_USERS_URL="http://localhost:5001"
export ENDPOINT_AUTH_URL="http://localhost:5002"
export FACEBOOK_CLIENT_ID="589559601433465"
export FACEBOOK_CLIENT_SECRET="3bf9af6d2495faf4382a93d763c5b46c"
export FACEBOOK_CALLBACK_URL="http://pixelgram.test:5050/auth/facebook/callback"
export PIXELGRAM_SECRET="pixel"
export SOCKET_IO_URL="http://localhost:5151"
export PORT="5050"
npm run build


text:
#include <gtest/gtest.h>

#include <LayerUpdateQueue.h>
#include <RenderNode.h>

#include <tests/common/TestUtils.h>

namespace android {
namespace uirenderer {

TEST(LayerUpdateQueue, construct) {
    LayerUpdateQueue queue;
    EXPECT_TRUE(queue.entries().empty());
}

// sync node properties, so properties() reflects correct width and height
static sp<RenderNode> createSyncedNode(uint32_t width, uint32_t height) {
    sp<RenderNode> node = TestUtils::createNode(0, 0, width, height, nullptr);
    TestUtils::syncHierarchyPropertiesAndDisplayList(node);
    return node;
}

TEST(LayerUpdateQueue, enqueueSimple) {
    sp<RenderNode> a = createSyncedNode(100, 100);
    sp<RenderNode> b = createSyncedNode(200, 200);
    sp<RenderNode> c = createSyncedNode(200, 200);

    LayerUpdateQueue queue;
    queue.enqueueLayerWithDamage(a.get(), Rect(25, 25, 75, 75));
    queue.enqueueLayerWithDamage(b.get(), Rect(100, 100, 300, 300));
    queue.enqueueLayerWithDamage(c.get(), Rect(.5, .5, .5, .5));

    EXPECT_EQ(3u, queue.entries().size());

    EXPECT_EQ(a.get(), queue.entries()[0].renderNode);
    EXPECT_EQ(Rect(25, 25, 75, 75), queue.entries()[0].damage);
    EXPECT_EQ(b.get(), queue.entries()[1].renderNode);
    EXPECT_EQ(Rect(100, 100, 200, 200), queue.entries()[1].damage); // clipped to bounds
    EXPECT_EQ(c.get(), queue.entries()[2].renderNode);
    EXPECT_EQ(Rect(0, 0, 1, 1), queue.entries()[2].damage); // rounded out
}

TEST(LayerUpdateQueue, enqueueUnion) {
    sp<RenderNode> a = createSyncedNode(100, 100);

    LayerUpdateQueue queue;
    queue.enqueueLayerWithDamage(a.get(), Rect(10, 10, 20, 20));
    queue.enqueueLayerWithDamage(a.get(), Rect(30, 30, 40, 40));

    EXPECT_EQ(1u, queue.entries().size());

    EXPECT_EQ(a.get(), queue.entries()[0].renderNode);
    EXPECT_EQ(Rect(10, 10, 40, 40), queue.entries()[0].damage);
}

TEST(LayerUpdateQueue, clear) {
    sp<RenderNode> a = createSyncedNode(100, 100);

    LayerUpdateQueue queue;
    queue.enqueueLayerWithDamage(a.get(), Rect(100, 100));

    EXPECT_FALSE(queue.entries().empty());

    queue.clear();

    EXPECT_TRUE(queue.entries().empty());
}

};
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Markup;
using System.Windows.Data;
using System.Globalization;
using System.Windows.Media.Imaging;
using Archimedes.Patterns.WPF.Imaging;
using System.Windows.Controls;

namespace Archimedes.Patterns.WPF.Converters
{
    public class ImageResizingConverter : MarkupExtension, IMultiValueConverter
    {
        private readonly static CachedImageResizer _cachedimageResizer = new CachedImageResizer();

        public Image ImageControl { get; set; }
        public BitmapSource SourceImg { get; set; }
        public double DecodeWidth { get; set; }
        public double DecodeHeight { get; set; }

        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            this.SourceImg = values[0] as BitmapImage;
            this.ImageControl = values[1] as Image;
            try
            {
                double ydelta = 0;
                double xdelta = 0;

                if (ImageControl != null)
                {
                    var ma = ImageControl.Margin;

                    ydelta = ma.Bottom;
                    xdelta = ma.Right;
                    //ydelta = (ma.Bottom + ma.Top) / 2;
                    //xdelta = (ma.Left + ma.Right) / 2;
                }

                this.DecodeWidth = (double)values[2] - xdelta;
                this.DecodeHeight = (double)values[3] - ydelta;
            }
            catch { }

            return DecodeImage(SourceImg, this.DecodeWidth, this.DecodeHeight);
        }

        private BitmapSource DecodeImage(BitmapSource src, double width, double height)
        {
            return _cachedimageResizer.CachedResize(src, (int)width, (int)height); ;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return this;
        }
    }
}


text:
namespace remoting {

namespace {

class ClipboardTestClient {
 public:
  ClipboardTestClient() : display_(nullptr) {}
  ~ClipboardTestClient() {}

  void Init(Display* display) {
    display_ = display;
    clipboard_.Init(display,
                    base::Bind(&ClipboardTestClient::OnClipboardChanged,
                               base::Unretained(this)));
  }

  void SetClipboardData(const std::string& clipboard_data) {
    clipboard_data_ = clipboard_data;
    clipboard_.SetClipboard(kMimeTypeTextUtf8, clipboard_data);
  }

  void OnClipboardChanged(const std::string& mime_type,
                          const std::string& data) {
    clipboard_data_ = data;
  }

  // Process X events on the connection, returning true if any events were
  // processed.
  bool PumpXEvents() {
    bool result = false;
    while (XPending(display_)) {
      XEvent event;
      XNextEvent(display_, &event);
      clipboard_.ProcessXEvent(&event);
      result = true;
    }
    return result;
  }

  const std::string& clipboard_data() const { return clipboard_data_; }
  Display* display() const { return display_; }

 private:
  std::string clipboard_data_;
  XServerClipboard clipboard_;
  Display* display_;

  DISALLOW_COPY_AND_ASSIGN(ClipboardTestClient);
};

}  // namespace

class XServerClipboardTest : public testing::Test {
 public:
  void SetUp() override {
    // XSynchronize() ensures that PumpXEvents() fully processes all X server
    // requests and responses before returning to the caller.
    Display* display1 = XOpenDisplay(nullptr);
    XSynchronize(display1, True);
    client1_.Init(display1);
    Display* display2 = XOpenDisplay(nullptr);
    XSynchronize(display2, True);
    client2_.Init(display2);
  }

  void TearDown() override {
    XCloseDisplay(client1_.display());
    XCloseDisplay(client2_.display());
  }

  void PumpXEvents() {
    while (true) {
      if (!client1_.PumpXEvents() && !client2_.PumpXEvents()) {
        break;
      }
    }
  }

  ClipboardTestClient client1_;
  ClipboardTestClient client2_;
};

// http://crbug.com/163428
TEST_F(XServerClipboardTest, DISABLED_CopyPaste) {
  // Verify clipboard data can be transferred more than once. Then verify that
  // the code continues to function in the opposite direction (so client1_ will
  // send then receive, and client2_ will receive then send).
  client1_.SetClipboardData("Text1");
  PumpXEvents();
  EXPECT_EQ("Text1", client2_.clipboard_data());

  client1_.SetClipboardData("Text2");
  PumpXEvents();
  EXPECT_EQ("Text2", client2_.clipboard_data());

  client2_.SetClipboardData("Text3");
  PumpXEvents();
  EXPECT_EQ("Text3", client1_.clipboard_data());

  client2_.SetClipboardData("Text4");
  PumpXEvents();
  EXPECT_EQ("Text4", client1_.clipboard_data());
}

}  // namespace remoting


text:
using System.ComponentModel;
using Lottie.Forms;
using Lottie.Forms.Platforms.Wpf;
using LottieSharp;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform.WPF;

[assembly: ExportRenderer(typeof(AnimationView), typeof(AnimationViewRenderer)), Preserve(AllMembers = true)]

namespace Lottie.Forms.Platforms.Wpf
{
    public class AnimationViewRenderer : ViewRenderer<AnimationView, LottieAnimationView>
    {
        private LottieAnimationView _animationView;

        protected override void OnElementChanged(ElementChangedEventArgs<AnimationView> e)
        {
            base.OnElementChanged(e);

            if (e == null)
                return;

            if (e.OldElement != null)
            {
                _animationView.Loaded -= _animationView_Loaded;
                _animationView.MouseDown -= _animationView_MouseDown;
            }

            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    _animationView = new LottieAnimationView
                    {
                        AutoPlay = false,
                        //PlaybackRate = e.NewElement.Speed,
                        //Scale = new System.Numerics.Vector3(e.NewElement.Scale)
                    };
                    _animationView.Loaded += _animationView_Loaded;
                    _animationView.MouseDown += _animationView_MouseDown;

                    //_animationView.FileName = e.NewElement.Animation as string;
                    var composition = e.NewElement.GetAnimation();
                    _animationView.Composition = composition;
                    e.NewElement.InvokeAnimationLoaded(composition);

                    e.NewElement.PlayCommand = new Command(() =>
                    {
                        _animationView.PlayAnimation();
                        e.NewElement.InvokePlayAnimation();
                    });
                    e.NewElement.PauseCommand = new Command(() =>
                    {
                        _animationView.PauseAnimation();
                        e.NewElement.InvokePauseAnimation();
                    });
                    e.NewElement.ResumeCommand = new Command(() =>
                    {
                        _animationView.ResumeAnimation();
                        e.NewElement.InvokeResumeAnimation();
                    });
                    e.NewElement.StopCommand = new Command(() =>
                    {
                        _animationView.CancelAnimation();
                        e.NewElement.InvokeStopAnimation();
                    });
                    e.NewElement.ClickCommand = new Command(() =>
                    {
                        //_animationView.Click();
                        //e.NewElement.InvokeClick();
                    });

                    e.NewElement.PlayMinAndMaxFrameCommand = new Command((object paramter) =>
                    {
                        if (paramter is (int minFrame, int maxFrame))
                        {
                            _animationView.SetMinAndMaxFrame(minFrame, maxFrame);
                            _animationView.PlayAnimation();
                        }
                    });
                    e.NewElement.PlayMinAndMaxProgressCommand = new Command((object paramter) =>
                    {
                        if (paramter is (float minProgress, float maxProgress))
                        {
                            _animationView.SetMinAndMaxProgress(minProgress, maxProgress);
                            _animationView.PlayAnimation();
                        }
                    });
                    e.NewElement.ReverseAnimationSpeedCommand = new Command(() =>
                    {
                        _animationView.ReverseAnimationSpeed();
                    });

                    //e.NewElement.Duration = _animationView.Duration.Ticks;
                    //e.NewElement.IsAnimating = _animationView.IsPlaying;

                    SetNativeControl(_animationView);

                    if (e.NewElement.AutoPlay || e.NewElement.IsAnimating)
                        _animationView.PlayAnimation();
                }
            }
        }

        private void _animationView_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Element?.InvokeClick();
        }

        private void _animationView_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            if (_animationView == null || Element == null || e == null)
                return;

            if (Element.AutoPlay || Element.IsAnimating)
            {
                _animationView.PlayAnimation();

                //await Task.Delay(PlayDelay);
                //_ = _animationView.PlayAsync(0, 1, Element.RepeatMode == RepeatMode.Infinite).AsTask();

                //Element.IsAnimating = _animationView.IsPlaying;
                Element.InvokePlayAnimation();
            }
        }

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (_animationView == null || Element == null || e == null)
                return;

            if (e.PropertyName == AnimationView.AnimationProperty.PropertyName)
            {
                var composition = Element.GetAnimation();
                _animationView.Composition = composition;
                Element.InvokeAnimationLoaded(composition);

                if (Element.AutoPlay || Element.IsAnimating)
                    _animationView.PlayAnimation();
            }

            if (e.PropertyName == AnimationView.AutoPlayProperty.PropertyName)
                _animationView.AutoPlay = Element.AutoPlay;

            //if (e.PropertyName == AnimationView.CacheCompositionProperty.PropertyName)
            //    _animationView.DefaultCacheStrategy = LottieAnimationView.CacheStrategy.Strong (Element.CacheComposition);

            //if (e.PropertyName == AnimationView.FallbackResource.PropertyName)
            //    _animationView.SetFallbackResource(e.NewElement.FallbackResource);

            //if (e.PropertyName == AnimationView.Composition.PropertyName)
            //    _animationView.Composition = e.NewElement.Composition;

            if (e.PropertyName == AnimationView.MinFrameProperty.PropertyName)
                _animationView.MinFrame = Element.MinFrame;

            if (e.PropertyName == AnimationView.MinProgressProperty.PropertyName)
                _animationView.MinProgress = Element.MinProgress;

            if (e.PropertyName == AnimationView.MaxFrameProperty.PropertyName)
                _animationView.MaxFrame = Element.MaxFrame;

            if (e.PropertyName == AnimationView.MaxProgressProperty.PropertyName)
                _animationView.MaxProgress = Element.MaxProgress;

            if (e.PropertyName == AnimationView.SpeedProperty.PropertyName)
                _animationView.Speed = Element.Speed;

            if (e.PropertyName == AnimationView.RepeatModeProperty.PropertyName)
                _animationView.RepeatMode = (LottieSharp.RepeatMode)(int)Element.RepeatMode;

            if (e.PropertyName == AnimationView.RepeatCountProperty.PropertyName)
                _animationView.RepeatCount = Element.RepeatCount;

            //if (e.PropertyName == AnimationView.ImageAssetsFolderProperty.PropertyName && !string.IsNullOrEmpty(Element.ImageAssetsFolder))
            //    _animationView.ImageAssetsFolder = Element.ImageAssetsFolder;

            if (e.PropertyName == AnimationView.ScaleProperty.PropertyName)
                _animationView.Scale = Element.Scale;

            if (e.PropertyName == AnimationView.FrameProperty.PropertyName)
                _animationView.Frame = Element.Frame;

            if (e.PropertyName == AnimationView.ProgressProperty.PropertyName)
                _animationView.Progress = Element.Progress;

            base.OnElementPropertyChanged(sender, e);
        }
    }
}


text:
var sys = require('sys');
var YUI = require("yui3").YUI;

YUI.add('foo', function(Y) {
    Y.log('FOO LOADED');
}, '1.0', { requires: ['external-foo'] });

YUI({
    filter: 'debug',
    debug: true,
    modules: {
        'external-foo': {
            fullpath: __dirname + '/external-module.js'
        }
    }
}).use('base', 'foo', function(Y) {

    Y.log('This is a test of loading internal and external custom YUI3 modules');

});


text:
import operator

from . import proputils

class ValidatedProperty(proputils.Property):
  """Property that provides some type of validation.

  Provide a validation function to validate upon assignment each
  value to property.

    Example:

      class UnsignedInt(Propertied):

        @ValidatedProperty
        def value(value):
          return value >= 0

      i = UnsignedInt()
      i.value = 0
      i.value = 1
      i.value = -1  # Raises ValueError
  """

  def __init__(self, validator=None):
    """Constructor.

    Args:
      validator: Validation function that a value meant for assignment to
        property and returns True if valid, else False.
    """
    self.__validator = validator

  def __set__(self, instance, value):
    """Set value of validated property.

    Args:
      instance: Object that will receive property value.
      value: New value for property.

    Raises:
      ValueError: If property is not correct value.
    """
    if not self.__validator(value):
      raise ValueError('Value \'%r\' is not valid '
                       'for property \'%s\' on \'%s\'' % (
                         value, self.name, self.cls.__name__))
    super(ValidatedProperty, self).__set__(instance, value)

class Validator:
  """Base class validator class.

  Though not required to make a property validator, this class
  helps make writing them easier by providing some basic operator support.

  It is possible to use binary logical operators to construct validators
  from basic ones.

  Example:

    class Person(Propertied):

      # ID is required to be a non-empty string.
      id = ValidatedProperty(not EMPTY & type_validator(str))

      # Name is required to be a non-empty string or None.
      name = ValidatedProperty(NONE | (not EMPTY & type_validator(str)))

      # The operators will also work normally for any function.  For example
      # 'all' is the builtin python function 'all' which has the signature
      # of a validator.
      nicknames = ValidatedProperty(type_validator(tuple) & all)
  """

  def __init__(self, validator_func):
    """Constructor.

    Args:
      validator_func: Function used for validating a new value.
    """
    self.__validator_func = validator_func

  def __call__(self, value):
    """Allows this validator object to be used as a validator function."""
    return self.__validator_func(value)

  def __and__(self, other):
    """Creates a validator requires both validators to be true."""
    @Validator
    def and_validator(value):
      return self(value) and other(value)
    return and_validator

  def __or__(self, other):
    """Creates a validator requires either validator to be true."""
    @Validator
    def or_validator(value):
      return self(value) or other(value)
    return or_validator

  def __invert__(self):
    """Creates inverse of a validator."""
    @Validator
    def not_validator(value):
      return not self(value)
    return not_validator

def validator_def(definition):
  """Makes validator factory functions always return Validators.

  Helper for wrapping functions that returns configured validators so that
  they always return Validator objects.

  Example:

    @validator_decorator
    def regex_validator(regex):
      compiled_regex = re.compile(regex)
      def regex_validator_func(value):
        return bool(compiled_regex.match(value))
      return regex_validator

    # Operators will work.
    email_validator = regex_validator('.+@.+') | NONE

  Args:
    definition: A validator factory function that takes any number of
      parameters and returns a validator function.

  Returns:
    A validator factory function that takes the same parameters as 'definition'
    and returns a Validator object that wraps 'definitions's returned validator.
  """
  def validator_decorator(*args, **kwargs):
    return Validator(definition(*args, **kwargs))
  validator_decorator.__name__ = definition.__name__
  return validator_decorator

@validator_def
def type_validator(property_type):
  """Create validator that requires specific type.

  Args:
    property_type: The type of the validator.

  Returns:
    Validator that only accepts values of a specific type.
  """
  def type_validator_impl(value):
    if not isinstance(value, property_type):
      raise TypeError('Property must be type %s' % property_type.__name__)
    return True
  return type_validator_impl

@Validator
def NONE(value):
  """Constant validator that requires None value."""
  return value is None

@Validator
def EMPTY(value):
  """Constant validator that requires empty values (allows None)."""
  return not bool(value)

class StrictProperty(ValidatedProperty):
  """Property that resticts values to a particular type.

  Attempting to set a value on a strict property that is not of the
  provided type (other than None) will raise a TypeError.

  Example:

    class Point(HasProps):

      x = StrictProperty(float)
      y = StrictProperty(float)

    point = Point()
    point.x = 10
    point.y = 20

    point.x = '30'  # Raises TypeError
  """

  def __init__(self, property_type):
    """Constructor.

    Args:
      property_type: Type of strict property.  All values assigned to
        property must be of this type.
    """
    validator = type_validator(property_type)
    self.__property_type = property_type
    super(StrictProperty, self).__init__(validator)

  @property
  def property_type(self):
    """Type of property."""
    return self.__property_type

class CMPType(type):

    def __lt__(cls, constant):
        return cls(operator.lt, constant)

    def __le__(cls, constant):
        return cls(operator.le, constant)

    def __gt__(cls, constant):
        return cls(operator.gt, constant)

    def __ge__(cls, constant):
        return cls(operator.ge, constant)

class CMP(Validator, metaclass=CMPType):
    """Comparison validator.

    Validation based on a binary operator.  Meta-class has operator methods overloaded so may be combined using normal
    comparison operators.  For example:

        class Point(HasProps):
            '''A point for a grid 100 units by 100 units.'''

            x = CMP >= 0 & CMP <= 100
            y = CMP >= 0 & CMP <= 100
    """

    def __init__(self, binop, constant):
        """Constructor.

        Args:
            binop: A function that takes two parameters and returns boolean value.
        """
        def validator(value):
            return binop(value, constant)
        self.__binop = binop
        super(CMP, self).__init__(validator)

    @property
    def binop(self):
        """Binop associated with this validator."""
        return self.__binop

@validator_def
def is_in(constant):
    """Create validator to check whether value is in a constant set of values."""
    return lambda value: value in constant

def validated_property_def(validator):
    """Helper function for defining reusable validated classes."""
    class _ValidatedProperty(ValidatedProperty):

        def __init__(self):
            super(_ValidatedProperty, self).__init__(validator)
    return _ValidatedProperty


text:
A php class designed to find "dead" columns in a SQL database (Null or only 1 unique value).

##Installation

This library requires PHP 5.1 or later, but it is recommended to use the latest version of PHP.  It does not have any other dependencies.

It can either be autoloaded and installed via Composer [tyty16/sqldeadcolumnfinder](https://packagist.org/packages/tyty16/sqldeadcolumnfinder), or can be downloaded on its own.

##Getting Started

###Instantiation

Instantiate the SQLDeadColumnFinder class with the pdo connection along with the name of the database you would like to check.  Optional parameters include:

-**$all** (boolean value indicating whether to check all tables, or just tables with a created_at column) default:false
-**$months** (integer value for how many months prior to the created_at date to check. Used when all is set to false) default:6
-**$file** (string value for the desired output file name) default:'dead-columns'

####Example

```php

<?php

$db = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$sqlDeadColumnFinder = new SQLDeadColumnFinder($db, 'test', false, 6, 'path/to/dir/deadColumns');

?>

```

###Finding Dead Columns

Call the **find()** method, which will call the individual methods to gather the columns to check, check them, and then export the data to a csv file with either the default file name, or the given file path during instantiation.

####Example

```php

<?php

$sqlDeadColumnFinder->find();

?>

```

##Methods

Methods can be called individually, but must follow the expected array format for the input parameters.

###getTablesToCheck()

Gathers table names from INFORMATION_SCHEMA to be checked.  This will only include tables with a "created_at" column if **$all** is set to true.

####Example

```php

<?php

$tables = array();
$tables = $sqlDeadColumnFinder->getTablesToCheck();

?>

```

####Returned Array Format

```
array(2) {
  [0]=>
  array(2) {
    ["TABLE_NAME"]=>
    string(3) "foo"
    ["TABLE_SCHEMA"]=>
    string(4) "test"
  }
  [1]=>
  array(2) {
    ["TABLE_NAME"]=>
    string(3) "bar"
    ["TABLE_SCHEMA"]=>
    string(4) "test"
  }
}

```

###getColumnsToCheck($tables)

Gathers column names from INFORMATION_SCHEMA to be checked using the $tables array parameter.  **$tables** must be formatted in the same way as the returned array from **getTablesToCheck()**.  This method also increments the **$numColumns** field.

####Example

```php

<?php

$columns = $sqlDeadColumnFinder->getColumnsToCheck($tables);

?>

```

####Returned Array Format

```

array(3) {
  [0]=>
  array(3) {
    ["TABLE_SCHEMA"]=>
    string(4) "test"
    ["TABLE_NAME"]=>
    string(3) "foo"
    ["COLUMN_NAME"]=>
    string(2) "id"
  }
  [1]=>
  array(2) {
    ["TABLE_SCHEMA"]=>
    string(4) "test"
    ["TABLE_NAME"]=>
    string(3) "foo"
    ["COLUMN_NAME"]=>
    string(2) "name"
  }
  [2]=>
  array(2) {
    ["TABLE_SCHEMA"]=>
    string(4) "test"
    ["TABLE_NAME"]=>
    string(3) "bar"
    ["COLUMN_NAME"]=>
    string(2) "address"
  }
}

```

###formatTablesWithColumns($columnsByTable)

Formats columns and table names in a way where nested for loops can be used in **findDeadColumns()**.  The format for $columnsByTable should be the returned array format from **getColumnsToCheck()**.

####Example
```php

<?php

  $formattedTablesWithColumns = sqlDeadColumnFinder->formatTablesWithColumns($unformattedColumns);

?>

```

####Returned Array Format

```

array(1) {
  ["test"]=>
  array(2) {
    ["foo"]=>
    array(2) {
      [0]=>
      string(2) "id"
      [1]=>
      string(4) "name"
    }
    ["bar"]=>
    array(1) {
      [0]=>
      string(7) "address"
    }
  }
}

```

###findDeadColumns($dbWithTablesWithColumns)

Searches the given list of columns parameter and finds columns with either one unique value, or is completely null.  If the **$all** is set to false, then only rows that are recent within the number of **$months** will be included in the search.  **$dbWithTablesWithColumns** must be formatted in the same way as the return array from **formatTablesWithColumns()**.  An array will be returned with the following values for each column:

-distinct (The number of unique values for that column)
-value (The distinct value itself)
-is_null (Whether the column is completely null)

####Example

```php

<?php

  $deadColumns = sqlDeadColumnFinder->formatTablesWithColumns($unformattedColumns);

?>

```

####Returned Array Format

```

array(1) {
  ["test"]=>
  array(1) {
    ["foo"]=>
    array(2) {
      ["id"]=>
        array(3) {
          ["distinct"]=>
          int(1)
          ["value"]=>
          string(1) "1"
          ["is_null"]=>
          int(0)
        }
      ["name"]=>
        array(3) {
          ["distinct"]=>
          int(0)
          ["value"]=>
          string(4) "NULL"
          ["is_null"]=>
          int(1)
        }
    }
  }
}

```

###outputToFile($deadColumns)

Takes a list of dead columns, formats them, and outputs them to a .csv file.  The format of **$deadColumns** must be in the same format as the return array from **findDeadColumns()**.  File will be saved either to the default file path as "dead-columns.csv" or what was specified for **$file** Columns in the .csv are as follows:

-Database: The name of the database contanining the dead column
-Table: The name of the table containing the dead column
-Column: The name of the dead column
-Distinct Values: The number of unique values for the dead column
-Value: The distinct value itself
-In the past x months: Records the **$months** value in the file

####Example

```php

<?php

  sqlDeadColumnFinder->outputToFile($deadColumns);

?>

```


text:
package org.libss.logic.templating

import com.google.inject.Inject
import org.libss.logic.guice.Injection

/**
  * Created by Kaa
  * on 07.06.2016 at 01:54.
  */

class HtmlParserFormatter extends Injection {
  @Inject
  protected var parser: StringToXmlParser = _

  def formatString(str: String) = parser.parseHTMLFragmentString(str)
}


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

namespace Server.Maps
{
    public class MapItem
    {
        DataManager.Maps.MapItem rawItem;

        public DataManager.Maps.MapItem RawItem {
            get {
                return rawItem;
            }
        }

        public MapItem(DataManager.Maps.MapItem rawItem) {
            this.rawItem = rawItem;
        }

        public int Num {
            get { return rawItem.Num; }
            set { rawItem.Num = value; }
        }
        public int Value {
            get { return rawItem.Value; }
            set { rawItem.Value = value; }
        }
        public bool Sticky {
            get { return rawItem.Sticky; }
            set { rawItem.Sticky = value; }
        }
        public bool Hidden {
            get { return rawItem.Hidden; }
            set { rawItem.Hidden = value; }
        }
        public string Tag {
            get { return rawItem.Tag; }
            set { rawItem.Tag = value; }
        }
        public int X {
            get { return rawItem.X; }
            set { rawItem.X = value; }
        }
        public int Y {
            get { return rawItem.Y; }
            set { rawItem.Y = value; }
        }
        public string PlayerFor {
            get { return rawItem.PlayerFor; }
            set { rawItem.PlayerFor = value; }
        }
        public TickCount TimeDropped { get; set; }
    }
}


text:
xpm --> gd1/gd2 conversion test
--SKIPIF--
<?php
	if (!extension_loaded('gd')) {
		die("skip gd extension not available.");
	}

	if (!function_exists("imagecreatefromxpm")) {
		die("skip xpm read support unavailable");
	}
?>
--FILE--
<?php
	$cwd = dirname(__FILE__);

	echo "XPM to GD1 conversion: ";
	echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd1") ? 'ok' : 'failed';
	echo "\n";

	echo "XPM to GD2 conversion: ";
	echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd2") ? 'ok' : 'failed';
	echo "\n";

	@unlink($cwd . "/test.gd1");
	@unlink($cwd . "/test.gd2");
?>
--EXPECT--
XPM to GD1 conversion: ok
XPM to GD2 conversion: ok


text:
/* https://leetcode.com/problems/course-schedule/description/
There are a total of n courses you have to take, labeled from 0 to n - 1.

Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]

Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses?

For example:

    2, [[1,0]]
There are a total of 2 courses to take. To take course 1 you should have finished course 0. So it is possible.

    2, [[1,0],[0,1]]
There are a total of 2 courses to take. To take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible.

Note:
    The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented.
    You may assume that there are no duplicate edges in the input prerequisites.
*/

package lgraph

func canFinish(numCourses int, prereqs [][]int) bool {
	graph := make([][]int, numCourses)
	for i := 0; i < len(prereqs); i++ {
		graph[prereqs[i][1]] = append(graph[prereqs[i][1]], prereqs[i][0])
	}

	visited := make([]int, numCourses)
	for course := range graph {
		if !canFinishHelper(course, graph, visited) {
			return false
		}
	}
	return true
}

func canFinishHelper(course int, graph [][]int, visited []int) bool {
	const (
		partial  = 1
		complete = 2
	)
	if visited[course] == partial {
		return false
	} else if visited[course] == complete {
		return true
	}
	visited[course] = partial
	for _, dependentCourse := range graph[course] {
		if !canFinishHelper(dependentCourse, graph, visited) {
			return false
		}
	}
	visited[course] = complete
	return true
}


text:
package org.onosproject.vtnrsc.cli.routerinterface;

import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.vtnrsc.RouterInterface;
import org.onosproject.vtnrsc.SubnetId;
import org.onosproject.vtnrsc.routerinterface.RouterInterfaceService;

/**
 * Supports for remove a router interface.
 */
@Service
@Command(scope = "onos", name = "routerinterface-remove", description = "Supports for removing a router interface")
public class RouterInterfaceRemoveCommand extends AbstractShellCommand {
    @Option(name = "-s", aliases = "--subnetId", description = "The subnet identifier of router interface",
            required = true, multiValued = false)
    String subnetId = null;

    @Override
    protected void doExecute() {
        RouterInterfaceService service = get(RouterInterfaceService.class);
        try {
            RouterInterface routerInterface = service
                    .getRouterInterface(SubnetId.subnetId(subnetId));
            if (routerInterface == null) {
                print(null, "subnet ID of interface doesn't exist");
                return;
            }
            service.removeRouterInterface(routerInterface);
        } catch (Exception e) {
            print(null, e.getMessage());
        }

    }
}


text:
<?php
/**
 * The Template for displaying product archives, including the main shop page which is a post type archive
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
 * will need to copy the new files to your theme to maintain compatibility. We try to do this.
 * as little as possible, but it does happen. When this occurs the version of the template file will.
 * be bumped and the readme will list any important changes.
 *
 * @see 	    http://docs.woothemes.com/document/template-structure/
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

get_header( 'shop' ); ?>

		<?php
			/**
			 * woocommerce_before_main_content hook.
			 *
			 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
			 * @hooked woocommerce_breadcrumb - 20
			 */
			do_action( 'woocommerce_before_main_content' );
		?>

				<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>

<?php woocommerce_page_title(); ?>

				<?php endif; ?>

			<?php
				/**
				 * woocommerce_archive_description hook.
				 *
				 * @hooked woocommerce_taxonomy_archive_description - 10
				 * @hooked woocommerce_product_archive_description - 10
				 */
				do_action( 'woocommerce_archive_description' );
			?>

			<?php if ( have_posts() ) : ?>

				<?php
					/**
					 * woocommerce_before_shop_loop hook.
					 *
					 * @hooked woocommerce_result_count - 20
					 * @hooked woocommerce_catalog_ordering - 30
					 */
					//do_action( 'woocommerce_before_shop_loop' );
				?>

				<?php woocommerce_product_loop_start(); ?>

					<?php woocommerce_product_subcategories(); ?>

					<?php while ( have_posts() ) : the_post(); ?>

						<?php wc_get_template_part( 'content', 'product' ); ?>

					<?php endwhile; // end of the loop. ?>

				<?php woocommerce_product_loop_end(); ?>

				<?php
					/**
					 * woocommerce_after_shop_loop hook.
					 *
					 * @hooked woocommerce_pagination - 10
					 */
					do_action( 'woocommerce_after_shop_loop' );
				?>

			<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>

				<?php wc_get_template( 'loop/no-products-found.php' ); ?>

			<?php endif; ?>

		<?php
			/**
			 * woocommerce_after_main_content hook.
			 *
			 * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
			 */
			do_action( 'woocommerce_after_main_content' );
		?>

			<div class="sidebar-seccion despacho-seccion"  style="background:url('<?php echo get_template_directory_uri(); ?>/img/delivery-cosas.jpg?>');">

						Cobertura de
						despacho

Cobertura de despacho

                                Provincia Santiago

Santiago

Cerrillos

Cerro Navia

Conchalí

El Bosque

Estación Central

Huechuraba

Independencia

La Cisterna

La Florida

La Pintana

La Granja

La Reina

Las Condes

Lo Barnechea

Lo Espejo

Lo Prado

Macul

Maipú

Ñuñoa

Pedro A. Cerda

Peñalolén

Providencia

Pudahuel

Quilicura

Quinta Normal

Recoleta

Renca

San Joaquín

San Miguel

San Ramón

Vitacura

                                Provincia Cordillera

Puente Alto

                                Provincia Maipo

San Bernardo

			<div class="sidebar-seccion medios-de-pago"  style="background:url('<?php echo get_template_directory_uri(); ?>/img/medios-de-pago-cosas.jpg?>');">

						Medios de
						Pago

Medios de pago

Cheque

Tarjeta de Crédito

Transferencia Electrónica

Depósito bancario

Efectivo

WebPay

PAT (Pago automático tarjeta de crédito) *Debe firmar mandato

<?php get_footer( 'shop' ); ?>


text:
from datetime import datetime

from changes.api.serializer import serialize
from changes.api.serializer.models.testcase import (
    TestCaseWithJobCrumbler, TestCaseWithOriginCrumbler, GeneralizedTestCase
)
from changes.constants import Result
from changes.testutils import TestCase

class TestCaseCrumblerTestCase(TestCase):
    def test_simple(self):
        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            package='test.group.ClassName',
            name='test_foo',
            job=job,
            duration=134,
            result=Result.failed,
            date_created=datetime(2013, 9, 19, 22, 15, 22),
            reruns=1,
        )
        result = serialize(testcase)
        assert result['id'] == str(testcase.id.hex)
        assert result['job']['id'] == str(job.id.hex)
        assert result['project']['id'] == str(project.id.hex)
        assert result['shortName'] == 'test_foo'
        assert result['name'] == 'test_foo'
        assert result['package'] == 'test.group.ClassName'
        assert result['dateCreated'] == '2013-09-19T22:15:22'
        assert result['result']['id'] == 'failed'
        assert result['duration'] == 134
        assert result['numRetries'] == 1

    def test_implicit_package(self):
        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            name='test.group.ClassName.test_foo',
            package=None,
            job=job,
        )

        result = serialize(testcase)

        assert result['shortName'] == 'test_foo'
        assert result['name'] == 'test.group.ClassName.test_foo'
        assert result['package'] == 'test.group.ClassName'

    def test_implicit_package_only_name(self):
        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            name='test_foo',
            package=None,
            job=job
        )
        result = serialize(testcase)
        assert result['shortName'] == 'test_foo'
        assert result['name'] == 'test_foo'
        assert result['package'] is None

class TestCaseWithJobCrumblerTestCase(TestCase):
    def test_simple(self):
        from changes.models.test import TestCase

        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            job=job,
        )
        result = serialize(testcase, {TestCase: TestCaseWithJobCrumbler()})
        assert result['job']['id'] == str(job.id.hex)

class TestCaseWithOriginCrumblerTestCase(TestCase):
    def test_simple(self):
        from changes.models.test import TestCase

        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            job=job,
        )

        result = serialize(testcase, {TestCase: TestCaseWithOriginCrumbler()})
        assert result['origin'] is None

        testcase.origin = 'foobar'
        result = serialize(testcase, {TestCase: TestCaseWithOriginCrumbler()})
        assert result['origin'] == 'foobar'

class GeneralizedTestCaseCrumblerTestCase(TestCase):
    def test_simple(self):
        from changes.models.test import TestCase

        project = self.create_project()
        build = self.create_build(project=project)
        job = self.create_job(build=build)
        testcase = self.create_test(
            job=job,
            package='test.group.ClassName',
            name='test_foo',
            duration=43,
        )
        result = serialize(testcase, {TestCase: GeneralizedTestCase()})
        assert result['hash'] == testcase.name_sha
        assert result['project']['id'] == str(project.id.hex)
        assert result['shortName'] == testcase.short_name
        assert result['name'] == testcase.name
        assert result['package'] == testcase.package
        assert result['duration'] == testcase.duration


text:
<?php
namespace SplashPayments;

use SplashPayments\Exceptions\InvalidRequest;

class apikeys extends BaseResource {
  protected $resourceName = "apikeys";
  /**
   * @string
   * The ID of this resource.
   */
  public $id;

  /**
   * @string
   * The date and time at which this resource was created.
   */
  public $created;

  /**
   * @string
   * The date and time at which this resource was modified.
   */
  public $modified;

  /**
   * @string
   * The identifier of the Login that created this resource.
   */
  public $creator;

  /**
   * @string
   * The identifier of the Login that last modified this resource.
   */
  public $modifier;

  /**
   * @string
   * The login under which to perform this action. If you do not supply a login in this field, then the API defaults to the login that is currently authenticated.
   */
  public $login;

  /**
   * @string
   */
  public $key;

  /**
   * @string
   */
  public $name;

  /**
   * @string
   */
  public $description;

  /**
   * @integer
   * Whether this API key should have access to only public resources.
   * Public resources include Transactions, Tokens, Customers and Items. All other resources are private.
   */
  public $public;

  /**
   * @integer
   * Whether this resource is marked as inactive.
   */
  public $inactive;

  /**
   * @integer
   * Whether this resource is marked as frozen.
   */
  public $frozen;

}


text:
<template name="spinner">

</template>


text:
			Validation Error

	<form>

{{error.errorMessage}}

{{error.errorMessage}}

{{error.errorMessage}}

				<button class="btn btn-def" ng-click="$dismiss()">Ok</button>

	</form>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Mycosphaerella agrimoniae Syd.

### Remarks
null


text:
<!DOCTYPE html>

        <title>CES NewsHub - News</title>

        <link href="lib/bootstrap.css/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="style.css" rel="stylesheet" media="screen">

        <link href="lib/streamhub-backbone/main.css" rel="stylesheet" media="screen">

        <meta property="og:title" content="Livefyre CES NewsHub"/>
        <meta property="og:image"  content="http://ces.livefyre.com/media/newshub-screenshot.png"/>
        <meta property="og:url" content="http://ces.livefyre.com"/>
        <meta property="og:site_name" content="Livefyre CES NewsHub"/>
        <meta property="og:description"
            content="Your real-time news source for the latest tweets, photos
            and articles coming from the Las Vegas show." />
        <meta property="fb:app_id" content="207950602556086" />

        Real-time news and social curation, get your own NewsHub at Livefyre.com

Powered by Livefyre StreamHub

Your real-time source for the hottest CES news from Vegas

Close X

                C
                E
                S
                2
                0
                1
                3

Home

Media

News

Brands

Products

Samsung

Google

Microsoft

Canonical

Apple

Lenovo

Sharp

Panasonic

LG

Vizio

Mashable

Engadget

CNET

TechCrunch

Fox News

Techland

Media 1

Media 2

Media 3

Product 1

Product 2

Product 3

Day 1

Day 2

Day 3

Day 4

Chatter


text:
package nl.ctrlaltdev.json.transform.mapping;

import nl.ctrlaltdev.json.transform.path.ValuePath;
import nl.ctrlaltdev.json.transform.select.Select;
import nl.ctrlaltdev.json.transform.transforms.MappingTransform;
import nl.ctrlaltdev.json.transform.transforms.ValuePathTransform;

/**
 * The select of the Transform select is tested against each node and if
 * it matches, the transform is executed. For arrays and objects the
 * select is tested by default at the start of the node, however for
 * some purposes its best to test at the end of the node. The post
 * boolean makes the transform select execute at the end of the node.
 *
 * Works with the {@link MappingTransform}.
 */
public class TransformSelect {

    private ValuePathTransform transform;
    private Select select;
    private boolean post;

    public TransformSelect(ValuePathTransform transform, Select select) {
        this(transform, select, false);
    }

    public TransformSelect(ValuePathTransform transform, Select select, boolean post) {
        this.transform = transform;
        this.select = select;
        this.post = post;
    }

    public boolean isPost() {
        return post;
    }

    public boolean isMatch(ValuePath path) {
        return select.isMatch(path);
    }

    public void apply(ValuePath source, ValuePath target) {
        transform.apply(source, target);
    }

}


text:
package com.axj.apiw.model;

public class TUser {
    private String id;

    private String username;

    private String password;

    private Integer type;

	private String paymentdate;

    private Integer industryid;

    private Boolean ispayment;

    private String token;

    private String appid;

    private String secret;

    private String useruniquecode;

    private String ghid;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPaymentdate() {
        return paymentdate;
    }

    public void setPaymentdate(String paymentdate) {
        this.paymentdate = paymentdate == null ? null : paymentdate.trim();
    }

    public Integer getIndustryid() {
        return industryid;
    }

    public void setIndustryid(Integer industryid) {
        this.industryid = industryid;
    }

    public Boolean getIspayment() {
        return ispayment;
    }

    public void setIspayment(Boolean ispayment) {
        this.ispayment = ispayment;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token == null ? null : token.trim();
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid == null ? null : appid.trim();
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret == null ? null : secret.trim();
    }

    public String getUseruniquecode() {
        return useruniquecode;
    }

    public void setUseruniquecode(String useruniquecode) {
        this.useruniquecode = useruniquecode == null ? null : useruniquecode.trim();
    }

    public String getGhid() {
        return ghid;
    }

    public void setGhid(String ghid) {
        this.ghid = ghid == null ? null : ghid.trim();
    }

    @Override
	public String toString() {
		return "TUser [id=" + id + ", username=" + username + ", password="
				+ password + ", type=" + type + ", paymentdate=" + paymentdate
				+ ", industryid=" + industryid + ", ispayment=" + ispayment
				+ ", token=" + token + ", appid=" + appid + ", secret="
				+ secret + ", useruniquecode=" + useruniquecode + ", ghid="
				+ ghid + "]";
	}
}


text:
cask 'dungeon-crawl-stone-soup-console' do
  version '0.25.0'
  sha256 '8edd26f9255c49f2c7c3a606bff6e9ecca25466313f67ced4bd8a26c2fcc83c1'

  # github.com/crawl/crawl/releases was verified as official when first introduced to the cask
  url "https://github.com/crawl/crawl/releases/download/#{version}/dcss-#{version}-macos-console.zip"
  appcast 'https://github.com/crawl/crawl/releases.atom'
  name 'Dungeon Crawl Stone Soup'
  homepage 'https://crawl.develz.org/'

  app 'Dungeon Crawl Stone Soup - Console.app'
end


text:
package com.alibaba.csp.sentinel.command.handler;

import com.alibaba.csp.sentinel.command.CommandHandler;
import com.alibaba.csp.sentinel.command.CommandRequest;
import com.alibaba.csp.sentinel.command.CommandResponse;
import com.alibaba.csp.sentinel.command.annotation.CommandMapping;
import com.alibaba.csp.sentinel.util.HostNameUtil;

/**
 * The basic info command returns the runtime properties.
 *
 * @author Eric Zhao
 */
@CommandMapping(name = "basicInfo", desc = "get sentinel config info")
public class BasicInfoCommandHandler implements CommandHandler<String> {

    @Override
    public CommandResponse<String> handle(CommandRequest request) {
        return CommandResponse.ofSuccess(HostNameUtil.getConfigString());
    }
}


text:
namespace base {
class Time;
}

namespace net {
class URLRequestContextGetter;
}

class GoogleServiceAuthError;

// Abstract base class for a service that fetches and caches OAuth2 access
// tokens. Concrete subclasses should implement GetRefreshToken to return
// the appropriate refresh token.
//
// All calls are expected from the UI thread.
//
// To use this service, call StartRequest() with a given set of scopes and a
// consumer of the request results. The consumer is required to outlive the
// request. The request can be deleted. The consumer may be called back
// asynchronously with the fetch results.
//
// - If the consumer is not called back before the request is deleted, it will
//   never be called back.
//   Note in this case, the actual network requests are not canceled and the
//   cache will be populated with the fetched results; it is just the consumer
//   callback that is aborted.
//
// - Otherwise the consumer will be called back with the request and the fetch
//   results.
//
// The caller of StartRequest() owns the returned request and is responsible to
// delete the request even once the callback has been invoked.
class OAuth2TokenService {
 public:
  // Class representing a request that fetches an OAuth2 access token.
  class Request {
   public:
    virtual ~Request();
   protected:
    Request();
  };

  // Class representing the consumer of a Request passed to |StartRequest|,
  // which will be called back when the request completes.
  class Consumer {
   public:
    Consumer();
    virtual ~Consumer();
    // |request| is a Request that is started by this consumer and has
    // completed.
    virtual void OnGetTokenSuccess(const Request* request,
                                   const std::string& access_token,
                                   const base::Time& expiration_time) = 0;
    virtual void OnGetTokenFailure(const Request* request,
                                   const GoogleServiceAuthError& error) = 0;
  };

  // A set of scopes in OAuth2 authentication.
  typedef std::set<std::string> ScopeSet;

  explicit OAuth2TokenService(net::URLRequestContextGetter* getter);
  virtual ~OAuth2TokenService();

  // Checks in the cache for a valid access token, and if not found starts
  // a request for an OAuth2 access token using the OAuth2 refresh token
  // maintained by this instance. The caller owns the returned Request.
  // |scopes| is the set of scopes to get an access token for, |consumer| is
  // the object that will be called back with results if the returned request
  // is not deleted.
  virtual scoped_ptr<Request> StartRequest(const ScopeSet& scopes,
                                           Consumer* consumer);

  // Returns true if a refresh token exists. If false, calls to
  // |StartRequest| will result in a Consumer::OnGetTokenFailure callback.
  bool RefreshTokenIsAvailable();

  // Mark an OAuth2 access token as invalid. This should be done if the token
  // was received from this class, but was not accepted by the server (e.g.,
  // the server returned 401 Unauthorized). The token will be removed from the
  // cache for the given scopes.
  virtual void InvalidateToken(const ScopeSet& scopes,
                               const std::string& invalid_token);

  // Return the current number of entries in the cache.
  int cache_size_for_testing() const;

 protected:
  // Subclasses should return the refresh token maintained.
  // If no token is available, return an empty string.
  virtual std::string GetRefreshToken() = 0;

  // Subclasses can override if they want to report errors to the user.
  virtual void UpdateAuthError(const GoogleServiceAuthError& error);

  // Add a new entry to the cache.
  // Subclasses can override if there are implementation-specific reasons
  // that an access token should ever not be cached.
  virtual void RegisterCacheEntry(const std::string& refresh_token,
                                  const ScopeSet& scopes,
                                  const std::string& access_token,
                                  const base::Time& expiration_date);

  // Returns true if GetCacheEntry would return a valid cache entry for the
  // given scopes.
  bool HasCacheEntry(const ScopeSet& scopes);

  // Posts a task to fire the Consumer callback with the cached token.  Must
  // only be called if HasCacheEntry() returns true.
  scoped_ptr<Request> StartCacheLookupRequest(const ScopeSet& scopes,
                                              Consumer* consumer);

  // Clears the internal token cache.
  void ClearCache();

  // Implements a cancelable |OAuth2TokenService::Request|, which should be
  // operated on the UI thread.
  class RequestImpl : public base::SupportsWeakPtr<RequestImpl>,
                      public Request {
   public:
    // |consumer| is required to outlive this.
    explicit RequestImpl(Consumer* consumer);
    virtual ~RequestImpl();

    // Informs |consumer_| that this request is completed.
    void InformConsumer(const GoogleServiceAuthError& error,
                        const std::string& access_token,
                        const base::Time& expiration_date);

   private:
    // |consumer_| to call back when this request completes.
    Consumer* const consumer_;
  };

 private:
  // Class that fetches an OAuth2 access token for a given set of scopes and
  // OAuth2 refresh token.
  class Fetcher;
  friend class Fetcher;

  // Struct that contains the information of an OAuth2 access token.
  struct CacheEntry {
    std::string access_token;
    base::Time expiration_date;
  };

  // Returns a currently valid OAuth2 access token for the given set of scopes,
  // or NULL if none have been cached. Note the user of this method should
  // ensure no entry with the same |scopes| is added before the usage of the
  // returned entry is done.
  const CacheEntry* GetCacheEntry(const ScopeSet& scopes);

  // Removes an access token for the given set of scopes from the cache.
  // Returns true if the entry was removed, otherwise false.
  bool RemoveCacheEntry(const OAuth2TokenService::ScopeSet& scopes,
                        const std::string& token_to_remove);

  // Called when |fetcher| finishes fetching.
  void OnFetchComplete(Fetcher* fetcher);

  // Getter to use for fetchers.
  scoped_refptr<net::URLRequestContextGetter> request_context_getter_;

  // The cache of currently valid tokens.
  typedef std::map<ScopeSet, CacheEntry> TokenCache;
  TokenCache token_cache_;

  // The parameters (refresh token and scope set) used to fetch an OAuth2 access
  // token.
  typedef std::pair<std::string, ScopeSet> FetchParameters;
  // A map from fetch parameters to a fetcher that is fetching an OAuth2 access
  // token using these parameters.
  std::map<FetchParameters, Fetcher*> pending_fetchers_;

  DISALLOW_COPY_AND_ASSIGN(OAuth2TokenService);
};

#endif  // CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_H_


text:
#include "polycode/view/win32/PolycodeView.h"
#include "polycode/core/PolyWinCore.h"
#include "polycode/core/PolyCoreInput.h"
#include "polycode/core/PolyRenderer.h"
#include <io.h>
#include <fcntl.h>
#include <ios>

using namespace Polycode;

Win32Core *core = NULL;

static void OpenConsole()
{
	int outHandle, errHandle, inHandle;
	FILE *outFile, *errFile, *inFile;
	AllocConsole();
	CONSOLE_SCREEN_BUFFER_INFO coninfo;
	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
	coninfo.dwSize.Y = 9999;
	SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);

	outHandle = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
	errHandle = _open_osfhandle((long)GetStdHandle(STD_ERROR_HANDLE),_O_TEXT);
	inHandle = _open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE),_O_TEXT );

	outFile = _fdopen(outHandle, "w" );
	errFile = _fdopen(errHandle, "w");
	inFile =  _fdopen(inHandle, "r");

	*stdout = *outFile;
	*stderr = *errFile;
	*stdin = *inFile;

	setvbuf( stdout, NULL, _IONBF, 0 );
	setvbuf( stderr, NULL, _IONBF, 0 );
	setvbuf( stdin, NULL, _IONBF, 0 );

	std::ios::sync_with_stdio();

}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int nWidth, nHeight;
	bool useDefault = false;

	if(!core)
		return DefWindowProc(hWnd, message, wParam, lParam);

	switch (message)
	{
	case WM_COPYDATA:
	{
		COPYDATASTRUCT *cp = (COPYDATASTRUCT*)lParam;
		wchar_t *stringData = (wchar_t*)cp->lpData;
		core->copyDataString = String(stringData);
		core->hasCopyDataString = true;
	}
	break;
	case WM_SIZE:
		nWidth = LOWORD(lParam);
		nHeight = HIWORD(lParam);
		if(core) {
			core->handleViewResize(nWidth, nHeight);
		}
	break;

	case WM_MOUSEMOVE:
		if(core)
			core->handleMouseMove(lParam,wParam);
	break;

	case WM_MOUSEWHEEL:
		if(core)
			core->handleMouseWheel(lParam,wParam);
	break;

	case WM_LBUTTONDOWN:
		if(core)
			core->handleMouseDown(CoreInput::MOUSE_BUTTON1, lParam,wParam);
	break;
	case WM_LBUTTONUP:
		if(core)
			core->handleMouseUp(CoreInput::MOUSE_BUTTON1, lParam,wParam);
	break;

	case WM_RBUTTONDOWN:
		if(core)
			core->handleMouseDown(CoreInput::MOUSE_BUTTON2, lParam,wParam);
	break;
	case WM_RBUTTONUP:
		if(core)
			core->handleMouseUp(CoreInput::MOUSE_BUTTON2, lParam,wParam);
	break;

#ifndef NO_TOUCH_API
	#ifdef NO_PEN_API
		case WM_TOUCH:
			if(core) {
				if(core->isMultiTouchEnabled()) {
					core->handleTouchEvent(lParam, wParam);
				}
			}
		break;
	#else
		case WM_POINTERUPDATE:
		case WM_POINTERUP:
		case WM_POINTERDOWN:
			if (core)
				core->handlePointerUpdate(lParam, wParam);
		break;
	#endif
#endif

	case WM_MBUTTONDOWN:
		if(core)
			core->handleMouseDown(CoreInput::MOUSE_BUTTON3, lParam,wParam);
	break;
	case WM_MBUTTONUP:
		if(core)
			core->handleMouseUp(CoreInput::MOUSE_BUTTON3, lParam,wParam);
	break;
	case WM_KEYDOWN:
	case WM_SYSKEYDOWN:
		if(core) {
			wchar_t unicodeChar = 0;
			MSG m;
			m.hwnd = hWnd;
			m.message = message;
			m.wParam = wParam;
			m.lParam = lParam;
			m.time = 0;

			core->handleKeyDown(lParam,wParam);
		}
	break;
	case WM_KEYUP:
	case WM_SYSKEYUP:
		if(core)
			core->handleKeyUp(lParam,wParam);
	break;
	//case WM_UNICHAR:
	//	if (wParam == UNICODE_NOCHAR)
	//		break;
	case WM_CHAR:
		core->handleTextInput(lParam, wParam);
		break;
	case WM_CLOSE:
		if(core)
			core->Shutdown();
		useDefault = true;
	break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case WM_KILLFOCUS:
		core->handleFocusChange(false);
		break;
	case WM_SETFOCUS:
		core->handleFocusChange(true);
		break;
	default:
		useDefault = true;
		break;
	}

	if (useDefault)
		return DefWindowProc(hWnd, message, wParam, lParam);
	else
		return 0;
}

PolycodeView::PolycodeView(HINSTANCE hInstance, int nCmdShow, LPCTSTR windowTitle, bool resizable, bool showDebugConsole) : PolycodeViewBase() {

	/*
	typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
	SetProcessDPIAwarePtr set_process_dpi_aware_func = GetProcAddress(GetModuleHandleA("user32.dll"), "SetProcessDPIAware");
	if (set_process_dpi_aware_func) {
		set_process_dpi_aware_func();
	}
	*/
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX);
	wcex.style			= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
	wcex.lpfnWndProc	= WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, IDI_APPLICATION);
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= NULL;
	wcex.lpszMenuName	= NULL;
	wcex.lpszClassName	= L"POLYCODEAPPLICATION";
	wcex.hIconSm		= LoadIcon(hInstance, IDI_APPLICATION);

	RegisterClassEx(&wcex);

	this->resizable = resizable;

	if(resizable) {
		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPEDWINDOW | WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
	} else {
		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_CAPTION | WS_POPUP | WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
	}

  windowData = (void*)&hwnd;

   ShowWindow(hwnd, nCmdShow);
   UpdateWindow(hwnd);

   if(showDebugConsole) {
		OpenConsole();
   }

}

PolycodeView::~PolycodeView() {

}


text:
'use strict';

const {verifyCssElements} = require('../../../build-system/tasks/visual-diff/helpers');

module.exports = {
  'select a different date': async (page, name) => {
    await page.tap(".i-amphtml-date-picker-container .CalendarMonthGrid_month__horizontal:not(.CalendarMonthGrid_month__hideForAnimation):nth-child(2) .CalendarMonth_table > tbody > tr:nth-child(2) > td:nth-child(2)");
    await verifyCssElements(page, name,
      /* forbiddenCss */ null,
      /* loadingIncompleteCss */ null,
      /* loadingCompleteCss */ [
        ".i-amphtml-date-picker-container .CalendarMonthGrid_month__horizontal:not(.CalendarMonthGrid_month__hideForAnimation):nth-child(2) .CalendarMonth_table > tbody > tr:nth-child(2) > td.CalendarDay__selected:nth-child(2)",
        ".i-amphtml-date-picker-container .CalendarMonthGrid_month__horizontal:not(.CalendarMonthGrid_month__hideForAnimation):nth-child(2) .CalendarMonth_table > tbody > tr:nth-child(3) > td:nth-child(4):not(.CalendarDay__selected)"
      ]);
  },
  'select previous month': async (page, name) => {
    await page.tap(".i-amphtml-date-picker-container button.DayPickerNavigation_button:nth-child(1)");
    await verifyCssElements(page, name,
      /* forbiddenCss */ null,
      /* loadingIncompleteCss */ null,
      /* loadingCompleteCss */ [
        ".i-amphtml-date-picker-container button[aria-label=Thursday\\,\\ November\\ 1\\,\\ 2018]"
      ]);
  },
  'select next month': async (page, name) => {
    await page.tap(".i-amphtml-date-picker-container button.DayPickerNavigation_button:nth-child(2)");
    await verifyCssElements(page, name,
      /* forbiddenCss */ null,
      /* loadingIncompleteCss */ null,
      /* loadingCompleteCss */ [
        ".i-amphtml-date-picker-container button[aria-label=Tuesday\\,\\ January\\ 1\\,\\ 2019]"
      ]);
  },
 };


text:
extern "C" {
#include <string.h>
#include <stdio.h>
}

#include "util/NonCopyable.h"
#include "util/Pin.h"

#include "board.h"
#include "can_server.h"
#include "can.h"

#define TELNET_PORT 23
#define RAW_PORT 2323

// === CanServer ===

CanServer::CanServer()
{
	static const uint16_t ports[] = { TELNET_PORT, RAW_PORT };

	for (size_t i = 0; i < ServerCount; ++i)
	{
		server_fd_[i] = NDK_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
		if (server_fd_[i] == INVALID_SOCKET)
			return;

		struct ::sockaddr_in local_addr;
		::memset(&local_addr, 0, sizeof(local_addr));
		local_addr.sin_family = AF_INET;
		local_addr.sin_addr.s_addr = 0; //htonl(INADDR_ANY);
		local_addr.sin_port = htons(ports[i]);

		if (NDK_bind(server_fd_[i], reinterpret_cast<struct ::sockaddr*>(&local_addr), sizeof(local_addr)) == SOCKET_ERROR)
			return;

		if (NDK_listen(server_fd_[i], MaxClients) == SOCKET_ERROR)
			return;

		int optval = 1;
		if (NDK_setsockopt(server_fd_[i], SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)) == SOCKET_ERROR)
			return;
	}

	started_ = true;
}

CanServer::~CanServer()
{
	for (size_t i = 0; i < ServerCount; ++i)
	{
		if (server_fd_[i] != INVALID_SOCKET)
			fdClose(server_fd_[i]);
	}
}

void CanServer::run()
{
	if (!started_)
		return;

	task_handle_ = ti_sysbios_knl_Task_self();

	fd_set rdset;
	while (true)
	{
		NDK_FD_ZERO(&rdset);

		for (size_t i = 0; i < ServerCount; ++i)
			NDK_FD_SET(server_fd_[i], &rdset);
		for (size_t i = 0; i < MaxClients; ++i)
			if (clients_[i].valid())
				NDK_FD_SET(clients_[i].fd, &rdset);

		// Perform wait operation
		if (fdSelect(0, &rdset, 0, 0, 0) == SOCKET_ERROR)
			break;

		handle_signal();

		for (size_t i = 0; i < ServerCount; ++i)
			if (NDK_FD_ISSET(server_fd_[i], &rdset))
				handle_connect(i);

		for (size_t i = 0; i < MaxClients; ++i)
		{
			if (clients_[i].valid() && NDK_FD_ISSET(clients_[i].fd, &rdset))
				handle_client(i);
		}

		handle_signal();
	}
	task_handle_ = 0;
	util::Pin(EK_TM4C1294XL_D2).toggle();
}

void CanServer::handle_connect(size_t server_index)
{
	// select() returned server_fd as readable socket. Accept incoming connection on it.
	struct ::sockaddr_in client_addr;
	int socklen = sizeof(client_addr);

	SOCKET client_fd = NDK_accept(server_fd_[server_index], reinterpret_cast<struct ::sockaddr*>(&client_addr), &socklen);
	if (client_fd == INVALID_SOCKET)
		return;

	// Find an empty slot for a new connection in a client list.
	for (size_t i = 0; i < MaxClients; ++i)
	{
		if (!clients_[i].valid())
		{
			clients_[i].fd = client_fd;
			clients_[i].interactive = server_index == Server_Interactive;
			greeting(i);
			return;
		}
	}

	// No empty clients found -- reject the connection.
	static const char busy[] = "Busy.\r\n";
	NDK_send(client_fd, (void*)busy, ::strlen(busy), MSG_WAITALL);
	fdClose(client_fd);
}

void CanServer::handle_signal()
{
	util::Pin(EK_TM4C1294XL_D1).toggle();
	CanPacket packet;
	while (CanMaster::instance().receive(packet))
		handle_can_packet(packet);
}

int CanServer::send_to_client(size_t client_index, const char* message, size_t length)
{
	return NDK_send(clients_[client_index].fd, (void*)message, length == (size_t)-1 ? ::strlen(message) : length, MSG_WAITALL);
}

void CanServer::handle_client(size_t client_index)
{
	Client& client = clients_[client_index];

	const ssize_t received = NDK_recv(client.fd, message_, max_message_size, 0);
	if (received < 0)
	{
		client.clear();
		return;
	}

	if (received == 0 || received >= (ssize_t)max_message_size)
		return;
	message_[received] = 0;

	CanPacket packet;
	bool request = false, result = false;

	if (!parse_packet(message_, packet, request))
	{
		if (client.interactive)
		{
			static const char usage[] = "COMMAND SYNTAX:\r\n\tdev:XX  addr:XXXX  =XXXX...\r\n\tdev:XX  addr:XXXX  ?\r\n> ";
			send_to_client(client_index, usage);
		}
		return;
	}

	if (request)
	{
		result = CanMaster::instance().send_request(packet.id);
		if (result)
		{
			struct ::timeval ts = { 0, 10000 };
			bool got_packet = false;
			for (int i = 0; i < 100; i++)
			{
				fdSelect(0, 0, 0, 0, &ts);
				if (CanMaster::instance().receive_response(packet))
				{
					got_packet = true;
					break;
				}
			}
			if (got_packet)
			{
				handle_can_packet(packet);
			}
			else
			{
				CanMaster::instance().clear_request();
				if (client.interactive)
				{
					static const char timeout[] = "Timeout while waiting reply.\r\n> ";
					send_to_client(client_index, timeout);
				}
			}
			return;
		}
	}
	else
	{
		result = CanMaster::instance().send(packet);
	}

	if (client.interactive)
	{
		static const char success[] = "The packet was sent.\r\n> ";
		static const char busy[] = "Busy, try again.\r\n> ";
		const char* reply = result ? success : busy;
		send_to_client(client_index, reply);
	}
}

bool CanServer::parse_packet(const char* message, CanPacket& packet, bool& request)
{
	static const char dev_q[] = "dev-q";
	if (::strncmp(message, dev_q, ::strlen(dev_q)) == 0)
		return parse_dev_id_packet(message, packet, request);

	unsigned int dev_id = 0, address = 0;
	if (::sscanf(message, "dev:%x", &dev_id) != 1 || dev_id > 0xff)
		return false;

	char* ptr = ::strstr(message, "addr:");
	if (ptr == 0 || ::sscanf(ptr, "addr:%x", &address) != 1 || address > 0xffff)
		return false;

	HA_CAN_PacketId packet_id = {0};
	packet_id.device_id = dev_id;
	packet_id.address = address;
	packet.id = HA_CAN_packet_id_to_number(&packet_id);

	request = ::strchr(ptr, '?') != 0;
	if (request)
		return true;

	ptr = ::strchr(ptr, '=');
	if (ptr == 0)
		return false;
	ptr++;

	unsigned byte = 0;
	char buf[4];
	while (packet.length < 8 && *ptr != 0 && *(ptr + 1) != 0)
	{
		buf[0] = *ptr++;
		buf[1] = *ptr++;
		buf[2] = 0;
		if (::sscanf(buf, "%x", &byte) != 1)
			break;
		packet.data[packet.length++] = byte;
	}

	return true;
}

bool CanServer::parse_dev_id_packet(const char* message, CanPacket& packet, bool& request)
{
	packet.id = HA_CAN_SpecialId_Update;

	static const char dev_q[] = "dev-q?";
	if (::strncmp(message, dev_q, strlen(dev_q)) == 0)
	{
		request = true;
		return true;
	}

	unsigned int value = 0;
	if (::sscanf(message, "dev-q!%x", &value) == 1 && value <= 0xffff && (value & 0xff) <= 0x7f)
	{
		packet.data[0] = (value >> 8) & 0xff;
		packet.data[1] = value & 0xff;
		packet.length = 2;
		return true;
	}

	return false;
}

void CanServer::handle_can_packet(const CanPacket& packet)
{
	HA_CAN_PacketId packet_id = {0};
	HA_CAN_number_to_packet_id(packet.id, &packet_id);

	if (packet.id == HA_CAN_SpecialId_Update)
		::strcpy(message_, "=");
	else
		::sprintf(message_, "dev:%.2x  addr:%.4x  =", (unsigned)packet_id.device_id, (unsigned)packet_id.address);
	size_t pos = ::strlen(message_);

	for (size_t i = 0; i < packet.length; ++i)
	{
		if (pos >= max_message_size - 4)
			break;

		::sprintf(&message_[pos], "%.2x", (unsigned)packet.data[i]);
		pos += 2;
	}

	::strcpy(&message_[pos], "\r\n");
	pos += 2;

	for (size_t i = 0; i < MaxClients; ++i)
	{
		if (!clients_[i].valid())
			continue;

		static const char cr[] = "\r";
		static const char prompt[] = "> ";

		if (clients_[i].interactive)
			send_to_client(i, cr);

		ssize_t sent = send_to_client(i, message_, pos); // TODO nonblock?
		if (sent < 0 || (size_t)sent != pos)
			clients_[i].clear();
		else if (clients_[i].interactive)
			send_to_client(i, prompt);
	}
}

void CanServer::greeting(size_t client_index)
{
	Client& client = clients_[client_index];
	if (!client.interactive)
		return;

	// TODO
	static const char message[] = "Welcome to the HA Master Board!\r\nType 'help' for command list.\r\n\r\n> ";
	send_to_client(client_index, message);
}

void CanServer::send_signal()
{
	if (task_handle_)
		fdSelectAbort(task_handle_);
}

CanServer& CanServer::instance()
{
	static CanServer self;
	return self;
}

// === CanServer::Client ===

CanServer::Client::Client() :
	fd(INVALID_SOCKET)
{
}

CanServer::Client::~Client()
{
	clear();
}

void CanServer::Client::clear()
{
	if (!valid())
		return;

	fdClose(fd);
	fd = INVALID_SOCKET;
}

extern "C"
void tcp_server(UArg, UArg)
{
	fdOpenSession( Task_self() );
	CanServer::instance().run();
	fdCloseSession( Task_self() );
}


text:
=====================================================
 vine.backports
=====================================================

.. contents::
    :local:
.. currentmodule:: vine.backports

.. automodule:: vine.backports
    :members:
    :undoc-members: