text:
'use strict';

angular.module('wuw.controllers')

.controller('EventsCtrl', function($scope, $filter, Events) {
    $scope.loadEvents = function() {
        if (!$scope.events) {
            $scope.initialLoading = true;
        }

        Events.getEvents().then(function(events){
            for (var i = 0; i < events.length; i++) {
                var event = events[i];

                /*
                    Now follows the handling of the different date/time formats.
                    Of course this logic could be written more efficient
                    by using other condition-statements.
                    For readability resons, we want to stick to the following notation.
                */

                var startDate = new Date(event.startTime);
                var endDate = new Date(event.endTime);
                var exactlySame = startDate.getTime() === endDate.getTime();
                var sameDay = startDate.getFullYear() === endDate.getFullYear() &&
                              startDate.getMonth() === endDate.getMonth() &&
                              startDate.getDate() === endDate.getDate();

                // Case: '21.01.2016 Uhr'
                if (exactlySame && startDate.getHours() === 1) {
                    event.dateString = $filter('date')(startDate, 'dd.MM.yyyy');
                    continue;
                }

                // Case: '21.02.2016 19:00'
                if (exactlySame && startDate.getHours() !== 1) {
                    event.dateString = $filter('date')(startDate, 'dd.MM.yyyy');
                    event.dateString += ', ';
                    event.dateString += $filter('date')(startDate, 'HH:mm');
                    event.dateString += ' Uhr';
                    continue;
                }

                // Case: '21.01.2016 - 25.01.2016'
                if (!exactlySame && startDate.getHours() === 1 && endDate.getHours() === 1) {
                    event.dateString = $filter('date')(startDate, 'dd.MM.yyyy');
                    event.dateString += ' - ';
                    event.dateString += $filter('date')(endDate, 'dd.MM.yyyy');
                    continue;
                }

                // Case: '19.03.2016, 11:00 - 12:00 Uhr'
                if (sameDay && startDate.getHours() !== 1 && endDate.getHours() !== 1) {
                    event.dateString = $filter('date')(startDate, 'dd.MM.yyyy');
                    event.dateString += ', ';
                    event.dateString += $filter('date')(startDate, 'HH:mm');
                    event.dateString += ' - ';
                    event.dateString += $filter('date')(endDate, 'HH:mm');
                    event.dateString += ' Uhr';
                    continue;
                }

                // Case: '21.01.2016 - 25.01.2016
                //       '11:00 - 12:00 Uhr'
                if (!sameDay && startDate.getHours() !== 1 && endDate.getHours() !== 1) {
                    event.dateString = $filter('date')(startDate, 'dd.MM.yyyy');
                    event.dateString += ' - ';
                    event.dateString += $filter('date')(endDate, 'dd.MM.yyyy');
                    event.dateString += ',<br>';
                    event.dateString += $filter('date')(startDate, 'HH:mm');
                    event.dateString += ' - ';
                    event.dateString += $filter('date')(endDate, 'HH:mm');
                    event.dateString += ' Uhr';
                    continue;
                }
            }
            $scope.events = events;
        }, function(){
        }).finally(function(){
            $scope.initialLoading = false;
            $scope.$broadcast('scroll.refreshComplete');
        });
    };

    $scope.openEvent = function(url) {
        if (url) {
            window.open(url, '_system', 'location=yes');
        }
    };

    $scope.loadEvents();
});


text:
'use strict';
import React from 'react';
import Moment from 'moment'

class UnprotectedName extends React.Component {

  constructor(props) {
    super(props);
  }

  render() {
    return (
      <li>
        {Moment(this.props.details.addedAt, "x").fromNow()}
      </li>
    );
  }

};

export default UnprotectedName

redpajama_set_name: RedPajamaGithub


text:
{% extends "templates/base-2-col.html" %}

{% block content-body %}
{{ content.body|safe }}
{% endblock %}


text:
import 'reflect-metadata';
import {DefineValidateOptions} from 'sequelize';
import {addAttributeOptions} from "../../services/models";

/**
 * Adds custom validator
 * @param name Name of validator
 * @param validator Validator function
 */
export function Is(name: string, validator: (value: any) => any): Function;
/**
 * Adds custom validator
 * @param validator Validator function
 */
export function Is(validator: (value: any) => any): Function;
/**
 * Will only allow values, that match the string regex or real regex
 */
export function Is(arg: string | Array<string | RegExp> | RegExp | {msg: string, args: string | Array<string | RegExp> | RegExp}): Function;
export function Is(...args: any[]): Function {

  const options: DefineValidateOptions = {};
  const argIsFunction = typeof args[0] === 'function';

  if (argIsFunction || (typeof args[0] === 'string' && typeof args[1] === 'function')) {
    let validator: (value: any) => any;
    let name: string;

    if (argIsFunction) {

      validator = (args[0] as (value: any) => any);
      name = validator.name;

      if (!name) throw new Error(`Passed validator function must have a name`);
    } else {

      name = args[0];
      validator = args[1];
    }

    options[`is${name.charAt(0).toUpperCase() + name.substr(1, name.length)}`] = validator;
  } else {
    options.is = args[0];
  }

  return (target: any, propertyName: string) =>
    addAttributeOptions(target, propertyName, {
      validate: options
    });
}


text:
package org.spanna.material;

import org.spanna.Material;
import org.spanna.block.BlockFace;

/**
 * Represents the cocoa plant
 */
public class CocoaPlant extends MaterialData implements Directional, Attachable {

    public enum CocoaPlantSize {
        SMALL,
        MEDIUM,
        LARGE
    }

    public CocoaPlant() {
        super(Material.COCOA);
    }

    /**
     *
     * @deprecated Magic value
     */
    @Deprecated
    public CocoaPlant(final int type) {
        super(type);
    }

    /**
     *
     * @deprecated Magic value
     */
    @Deprecated
    public CocoaPlant(final int type, final byte data) {
        super(type, data);
    }

    public CocoaPlant(CocoaPlantSize sz) {
        this();
        setSize(sz);
    }

    public CocoaPlant(CocoaPlantSize sz, BlockFace dir) {
        this();
        setSize(sz);
        setFacingDirection(dir);
    }

    /**
     * Get size of plant
     *
     * @return size
     */
    public CocoaPlantSize getSize() {
        switch (getData() & 0xC) {
            case 0:
                return CocoaPlantSize.SMALL;
            case 4:
                return CocoaPlantSize.MEDIUM;
            default:
                return CocoaPlantSize.LARGE;
        }
    }

    /**
     * Set size of plant
     *
     * @param sz - size of plant
     */
    public void setSize(CocoaPlantSize sz) {
        int dat = getData() & 0x3;
        switch (sz) {
            case SMALL:
                break;
            case MEDIUM:
                dat |= 0x4;
                break;
            case LARGE:
                dat |= 0x8;
                break;
        }
        setData((byte) dat);
    }

    public BlockFace getAttachedFace() {
        return getFacing().getOppositeFace();
    }

    public void setFacingDirection(BlockFace face) {
        int dat = getData() & 0xC;
        switch (face) {
            default:
            case SOUTH:
                break;
            case WEST:
                dat |= 0x1;
                break;
            case NORTH:
                dat |= 0x2;
                break;
            case EAST:
                dat |= 0x3;
                break;
        }
        setData((byte) dat);
    }

    public BlockFace getFacing() {
        switch (getData() & 0x3) {
            case 0:
                return BlockFace.SOUTH;
            case 1:
                return BlockFace.WEST;
            case 2:
                return BlockFace.NORTH;
            case 3:
                return BlockFace.EAST;
        }
        return null;
    }

    @Override
    public CocoaPlant clone() {
        return (CocoaPlant) super.clone();
    }

    @Override
    public String toString() {
        return super.toString() + " facing " + getFacing() + " " + getSize();
    }
}


text:
package com.google.api.services.dataplex.v1.model;

/**
 * Metadata stores the entity is compatible with.
 *
 *
This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Dataplex API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudDataplexV1EntityCompatibility
    extends com.google.api.client.json.GenericJson {

  /**
   * Output only. Whether the entity can be represented in BigQuery. The value may be {@code null}.
   */
  @com.google.api.client.util.Key private java.lang.Boolean bigquery;

  /**
   * Output only. Whether the entity can be represented in Hive Metastore. The value may be {@code
   * null}.
   */
  @com.google.api.client.util.Key private java.lang.Boolean hiveMetastore;

  /**
   * Output only. Whether the entity can be represented in BigQuery.
   *
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getBigquery() {
    return bigquery;
  }

  /**
   * Output only. Whether the entity can be represented in BigQuery.
   *
   * @param bigquery bigquery or {@code null} for none
   */
  public GoogleCloudDataplexV1EntityCompatibility setBigquery(java.lang.Boolean bigquery) {
    this.bigquery = bigquery;
    return this;
  }

  /**
   * Output only. Whether the entity can be represented in Hive Metastore.
   *
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getHiveMetastore() {
    return hiveMetastore;
  }

  /**
   * Output only. Whether the entity can be represented in Hive Metastore.
   *
   * @param hiveMetastore hiveMetastore or {@code null} for none
   */
  public GoogleCloudDataplexV1EntityCompatibility setHiveMetastore(
      java.lang.Boolean hiveMetastore) {
    this.hiveMetastore = hiveMetastore;
    return this;
  }

  @Override
  public GoogleCloudDataplexV1EntityCompatibility set(String fieldName, Object value) {
    return (GoogleCloudDataplexV1EntityCompatibility) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudDataplexV1EntityCompatibility clone() {
    return (GoogleCloudDataplexV1EntityCompatibility) super.clone();
  }
}


text:
using System;
using UnityEngine;

namespace NativeClient
{
    public class EntityInfo
    {
        public string Guid;
        public Vector3 Position;
        public Quaternion Orientation;
        public bool IsLocallyCreated = false;

		#region Overrides

		public override bool Equals (object obj)
		{
			EntityInfo other = obj as EntityInfo;

			if (other == null)
				return false;
			else
				return this.Guid.Equals(other.Guid);
		}

		#endregion

		#region Operators

		public static implicit operator bool (EntityInfo exists)
		{
			return exists != null;
		}

		#endregion
    }
}


text:
package org.apache.kafka.streams.scala

import java.util

import org.apache.kafka.common.serialization.{Deserializer, Serde, Serializer, Serdes => JSerdes}
import org.apache.kafka.streams.kstream.WindowedSerdes

object Serdes {
  implicit val String: Serde[String]                             = JSerdes.String()
  implicit val Long: Serde[Long]                                 = JSerdes.Long().asInstanceOf[Serde[Long]]
  implicit val JavaLong: Serde[java.lang.Long]                   = JSerdes.Long()
  implicit val ByteArray: Serde[Array[Byte]]                     = JSerdes.ByteArray()
  implicit val Bytes: Serde[org.apache.kafka.common.utils.Bytes] = JSerdes.Bytes()
  implicit val Float: Serde[Float]                               = JSerdes.Float().asInstanceOf[Serde[Float]]
  implicit val JavaFloat: Serde[java.lang.Float]                 = JSerdes.Float()
  implicit val Double: Serde[Double]                             = JSerdes.Double().asInstanceOf[Serde[Double]]
  implicit val JavaDouble: Serde[java.lang.Double]               = JSerdes.Double()
  implicit val Integer: Serde[Int]                               = JSerdes.Integer().asInstanceOf[Serde[Int]]
  implicit val JavaInteger: Serde[java.lang.Integer]             = JSerdes.Integer()

  implicit def timeWindowedSerde[T]: WindowedSerdes.TimeWindowedSerde[T] = new WindowedSerdes.TimeWindowedSerde[T]()
  implicit def sessionWindowedSerde[T]: WindowedSerdes.SessionWindowedSerde[T] = new WindowedSerdes.SessionWindowedSerde[T]()

  def fromFn[T >: Null](serializer: T => Array[Byte], deserializer: Array[Byte] => Option[T]): Serde[T] =
    JSerdes.serdeFrom(
      new Serializer[T] {
        override def serialize(topic: String, data: T): Array[Byte]                = serializer(data)
        override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = ()
        override def close(): Unit                                                 = ()
      },
      new Deserializer[T] {
        override def deserialize(topic: String, data: Array[Byte]): T              = deserializer(data).orNull
        override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = ()
        override def close(): Unit                                                 = ()
      }
    )

  def fromFn[T >: Null](serializer: (String, T) => Array[Byte],
    deserializer: (String, Array[Byte]) => Option[T]): Serde[T] =
    JSerdes.serdeFrom(
      new Serializer[T] {
        override def serialize(topic: String, data: T): Array[Byte]                = serializer(topic, data)
        override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = ()
        override def close(): Unit                                                 = ()
      },
      new Deserializer[T] {
        override def deserialize(topic: String, data: Array[Byte]): T              = deserializer(topic, data).orNull
        override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = ()
        override def close(): Unit                                                 = ()
      }
    )
}


text:
Paw Extension - Docker Machine IP Address Dynamic Value
---
This is a [Dynamic Value Paw Extension](https://luckymarmot.com/paw/extensions/?extension_type=dynamic_value) that returns the IP address for a given Docker Machine.

_Example Using This For a `HOST` Environment Variable_

![Docker Machine IP - Default](https://cloud.githubusercontent.com/assets/796368/11540736/2014b704-98f4-11e5-9306-3da6f5aaa54e.png)
![Docker Machine IP - Custom](https://cloud.githubusercontent.com/assets/796368/11540737/20285002-98f4-11e5-8917-a689fd32b943.png)

**NOTE: This is a proof-of-concept extension and is currently not functional due to limitations of Paw Extensions ([reference](https://github.com/luckymarmot/Paw-Documentation/issues/20)).**


text:
package parser

import "reflect"

type Node interface {
	children() []Node
}

// Visitor function.
type Visitor func(node Node, next func() error) error

// Visit all nodes in the AST.
func Visit(root Node, visit Visitor) error {
	return visit(root, func() error {
		for _, child := range root.children() {
			pv := reflect.ValueOf(child)
			if pv.Kind() != reflect.Struct && pv.IsNil() {
				continue
			}
			if err := Visit(child, visit); err != nil {
				return err
			}
		}
		return nil
	})
}

func (p *Proto) children() (out []Node) {
	out = append(out, p.Comments.children()...)
	for _, child := range p.Entries {
		out = append(out, child)
	}
	return out
}

func (c *Comments) children() (out []Node) {
	if c == nil {
		return nil
	}
	for _, comment := range c.Comments {
		out = append(out, comment)
	}
	return
}

func (c *Comment) children() (out []Node) {
	return nil
}

func (e *Entry) children() (out []Node) {
	out = append(out, e.Import, e.Message, e.Service, e.Enum, e.Option, e.Extend, e.Comment)
	return
}

func (o *Option) children() (out []Node) {
	out = append(out, o.Comments.children()...)
	for _, name := range o.Name {
		out = append(out, name)
	}
	out = append(out, o.Value)
	return
}

func (v *Value) children() (out []Node) {
	out = []Node{v.ProtoText, v.Array}
	out = append(out, v.TrailingComments.children()...)
	return
}

func (p *ProtoText) children() (out []Node) {
	for _, field := range p.Fields {
		out = append(out, field)
	}
	return
}

func (p *ProtoTextField) children() (out []Node) {
	out = append(out, p.Comments.children()...)
	out = append(out, p.Value)
	return out
}

func (a *Array) children() (out []Node) {
	for _, element := range a.Elements {
		out = append(out, element)
	}
	return
}

func (e *Extensions) children() (out []Node) {
	for _, rng := range e.Extensions {
		out = append(out, rng)
	}
	return
}

func (r *Reserved) children() (out []Node) {
	for _, rng := range r.Ranges {
		out = append(out, rng)
	}
	return
}

func (r *Range) children() (out []Node) {
	return nil
}

func (e *Extend) children() (out []Node) {
	for _, field := range e.Fields {
		out = append(out, field)
	}
	return
}

func (s *Service) children() (out []Node) {
	for _, entry := range s.Entries {
		out = append(out, entry)
	}
	return
}

func (s *ServiceEntry) children() (out []Node) {
	return []Node{s.Option, s.Method, s.Comment}
}

func (m *Method) children() (out []Node) {
	out = []Node{m.Request, m.Response}
	for _, entry := range m.Entries {
		out = append(out, entry)
	}
	return
}

func (m *MethodEntry) children() (out []Node) {
	return []Node{m.Option, m.Comment}
}

func (e *Enum) children() (out []Node) {
	for _, enum := range e.Values {
		out = append(out, enum)
	}
	return
}

func (e *EnumEntry) children() (out []Node) {
	return []Node{e.Value, e.Option, e.Reserved, e.Comment}
}

func (o Options) children() (out []Node) {
	for _, option := range o {
		out = append(out, option)
	}
	return
}

func (e *EnumValue) children() (out []Node) {
	return e.Options.children()
}

func (m *Message) children() (out []Node) {
	for _, entry := range m.Entries {
		out = append(out, entry)
	}
	return
}

func (m *MessageEntry) children() (out []Node) {
	out = append(out, m.Enum, m.Option, m.Message, m.Oneof, m.Extend, m.Reserved, m.Extensions, m.Field, m.Comment)
	return
}

func (o *OneOf) children() (out []Node) {
	for _, entry := range o.Entries {
		out = append(out, entry)
	}
	return
}

func (o *OneOfEntry) children() (out []Node) {
	out = append(out, o.Comments.children()...)
	out = append(out, o.Field, o.Option)
	return
}

func (f *Field) children() (out []Node) {
	out = append(out, f.Comments.children()...)
	out = append(out, f.Group, f.Direct)
	out = append(out, f.TrailingComments.children()...)
	return
}

func (d *Direct) children() (out []Node) {
	out = []Node{d.Type}
	out = append(out, d.Options.children()...)
	return
}

func (g *Group) children() (out []Node) {
	for _, entry := range g.Entries {
		out = append(out, entry)
	}
	return
}

func (t *Type) children() (out []Node) {
	return []Node{t.Map}
}

func (m *MapType) children() (out []Node) {
	return []Node{m.Key, m.Value}
}


text:
using namespace vgui;

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CHudVguiScreenCursor : public CHudElement, public vgui::Panel
{
	DECLARE_CLASS_SIMPLE( CHudVguiScreenCursor, vgui::Panel );
public:
	CHudVguiScreenCursor( const char *pElementName );

	virtual bool	ShouldDraw();

protected:
	virtual void	ApplySchemeSettings( vgui::IScheme *scheme );
	virtual void	Paint();

private:
	// Cursor sprite and color
	CHudTexture		*m_pCursor;
	Color			m_clrCrosshair;
};

DECLARE_HUDELEMENT( CHudVguiScreenCursor );

CHudVguiScreenCursor::CHudVguiScreenCursor( const char *pElementName ) :
	CHudElement( pElementName ), BaseClass( NULL, "VguiScreenCursor" )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );

	m_pCursor = 0;

	m_clrCrosshair = Color( 0, 0, 0, 0 );

	SetHiddenBits( HIDEHUD_PLAYERDEAD );
}

void CHudVguiScreenCursor::ApplySchemeSettings( IScheme *scheme )
{
	BaseClass::ApplySchemeSettings( scheme );

	m_clrCrosshair = scheme->GetColor( "VguiScreenCursor", Color( 255, 255, 255, 255 ) );
	m_pCursor = gHUD.GetIcon( "arrow" );

	SetPaintBackgroundEnabled( false );

	SetSize( ScreenWidth(), ScreenHeight() );
}

//-----------------------------------------------------------------------------
// Purpose: Save CPU cycles by letting the HUD system early cull
// costly traversal.  Called per frame, return true if thinking and
// painting need to occur.
//-----------------------------------------------------------------------------
bool CHudVguiScreenCursor::ShouldDraw( void )
{
	C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
	if ( !pPlayer )
		return false;

	if ( pPlayer->IsInViewModelVGuiInputMode() )
	{
		return false;
	}

	if ( !pPlayer->IsInVGuiInputMode() )
	{
		return false;
	}

	return CHudElement::ShouldDraw();
}

void CHudVguiScreenCursor::Paint( void )
{
	if ( !m_pCursor )
		return;

	float x, y;
	x = ScreenWidth()/2;
	y = ScreenHeight()/2;

	C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
	if ( !pPlayer )
		return;

	if ( pPlayer->IsInViewModelVGuiInputMode() )
	{
		int iX, iY;
		vgui::input()->GetCursorPos(iX, iY);
		x = (float)iX;
		y = (float)iY;
	}

	m_pCursor->DrawSelf(
		x - 0.5f * m_pCursor->Width(),
		y - 0.5f * m_pCursor->Height(),
		m_clrCrosshair );
}


text:
<?php

namespace Joecohens\Now\Requests;

use Joecohens\Now\Resources\File;
use Joecohens\Now\Resources\FileContent;

trait Files
{
    public function files($id)
    {
        return array_map(function ($attributes) {
            return new File($attributes);
        }, $this->client->get('deployments/'.$id.'/files'));
    }

    public function file($id, $fileId)
    {
        return new FileContent(['content' => $this->client->get('deployments/'.$id.'/files/'.$fileId)]);
    }
}


text:
<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--

    DO NOT MODIFY THIS FILE. Use traccar.xml instead.

    -->

    <entry key='web.port'>8082</entry>
    <entry key='web.path'>./web</entry>

    <entry key='geocoder.enable'>false</entry>
    <entry key='geocoder.type'>google</entry>

    <entry key='logger.level'>info</entry>
    <entry key='logger.file'>./logs/tracker-server.log</entry>
    <entry key='logger.rotate'>true</entry>

    <entry key='filter.enable'>true</entry>
    <entry key='filter.future'>86400</entry>

    <entry key='event.ignoreDuplicateAlerts'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>
    <entry key='processing.engineHours.enable'>true</entry>

    <entry key='media.path'>./media</entry>

    <entry key='notificator.types'>web,mail</entry>

    <entry key='server.statistics'>https://www.traccar.org/analytics/</entry>

    <entry key='commands.queueing'>true</entry>

    <entry key='database.ignoreUnknown'>true</entry>
    <entry key='database.generateQueries'>true</entry>
    <entry key='database.changelog'>./schema/changelog-master.xml</entry>

    <entry key='database.loginUser'>
        SELECT * FROM tc_users
        WHERE email = :email OR login = :email
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM tc_positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime
    </entry>

    <entry key='database.selectLatestPositions'>
        SELECT tc_positions.* FROM tc_positions INNER JOIN tc_devices ON tc_positions.id = tc_devices.positionid;
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE tc_devices SET positionId = :id WHERE id = :deviceId
    </entry>

    <entry key='database.selectEvents'>
        SELECT * FROM tc_events WHERE deviceId = :deviceId AND eventTime BETWEEN :from AND :to ORDER BY eventTime
    </entry>

    <entry key='database.selectStatistics'>
        SELECT * FROM tc_statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime
    </entry>

    <entry key='gps103.port'>5001</entry>
    <entry key='tk103.port'>5002</entry>
    <entry key='gl100.port'>5003</entry>
    <entry key='gl200.port'>5004</entry>
    <entry key='t55.port'>5005</entry>
    <entry key='xexun.port'>5006</entry>
    <entry key='xexun.extended'>false</entry>
    <entry key='totem.port'>5007</entry>
    <entry key='enfora.port'>5008</entry>
    <entry key='meiligao.port'>5009</entry>
    <entry key='trv.port'>5010</entry>
    <entry key='suntech.port'>5011</entry>
    <entry key='progress.port'>5012</entry>
    <entry key='h02.port'>5013</entry>
    <entry key='jt600.port'>5014</entry>
    <entry key='huabao.port'>5015</entry>
    <entry key='v680.port'>5016</entry>
    <entry key='pt502.port'>5017</entry>
    <entry key='tr20.port'>5018</entry>
    <entry key='navis.port'>5019</entry>
    <entry key='meitrack.port'>5020</entry>
    <entry key='skypatrol.port'>5021</entry>
    <entry key='gt02.port'>5022</entry>
    <entry key='gt06.port'>5023</entry>
    <entry key='megastek.port'>5024</entry>
    <entry key='navigil.port'>5025</entry>
    <entry key='gpsgate.port'>5026</entry>
    <entry key='teltonika.port'>5027</entry>
    <entry key='mta6.port'>5028</entry>
    <entry key='tzone.port'>5029</entry>
    <entry key='tlt2h.port'>5030</entry>
    <entry key='taip.port'>5031</entry>
    <entry key='wondex.port'>5032</entry>
    <entry key='cellocator.port'>5033</entry>
    <entry key='galileo.port'>5034</entry>
    <entry key='ywt.port'>5035</entry>
    <entry key='tk102.port'>5036</entry>
    <entry key='intellitrac.port'>5037</entry>
    <entry key='gpsmta.port'>5038</entry>
    <entry key='wialon.port'>5039</entry>
    <entry key='carscop.port'>5040</entry>
    <entry key='apel.port'>5041</entry>
    <entry key='manpower.port'>5042</entry>
    <entry key='globalsat.port'>5043</entry>
    <entry key='atrack.port'>5044</entry>
    <entry key='pt3000.port'>5045</entry>
    <entry key='ruptela.port'>5046</entry>
    <entry key='topflytech.port'>5047</entry>
    <entry key='laipac.port'>5048</entry>
    <entry key='aplicom.port'>5049</entry>
    <entry key='gotop.port'>5050</entry>
    <entry key='sanav.port'>5051</entry>
    <entry key='gator.port'>5052</entry>
    <entry key='noran.port'>5053</entry>
    <entry key='m2m.port'>5054</entry>
    <entry key='osmand.port'>5055</entry>
    <entry key='easytrack.port'>5056</entry>
    <entry key='gpsmarker.port'>5057</entry>
    <entry key='khd.port'>5058</entry>
    <entry key='piligrim.port'>5059</entry>
    <entry key='stl060.port'>5060</entry>
    <entry key='cartrack.port'>5061</entry>
    <entry key='minifinder.port'>5062</entry>
    <entry key='haicom.port'>5063</entry>
    <entry key='eelink.port'>5064</entry>
    <entry key='box.port'>5065</entry>
    <entry key='freedom.port'>5066</entry>
    <entry key='telic.port'>5067</entry>
    <entry key='trackbox.port'>5068</entry>
    <entry key='visiontek.port'>5069</entry>
    <entry key='orion.port'>5070</entry>
    <entry key='riti.port'>5071</entry>
    <entry key='ulbotech.port'>5072</entry>
    <entry key='tramigo.port'>5073</entry>
    <entry key='tr900.port'>5074</entry>
    <entry key='ardi01.port'>5075</entry>
    <entry key='xt013.port'>5076</entry>
    <entry key='autofon.port'>5077</entry>
    <entry key='gosafe.port'>5078</entry>
    <entry key='tt8850.port'>5079</entry>
    <entry key='bce.port'>5080</entry>
    <entry key='xirgo.port'>5081</entry>
    <entry key='calamp.port'>5082</entry>
    <entry key='mtx.port'>5083</entry>
    <entry key='tytan.port'>5084</entry>
    <entry key='avl301.port'>5085</entry>
    <entry key='castel.port'>5086</entry>
    <entry key='mxt.port'>5087</entry>
    <entry key='cityeasy.port'>5088</entry>
    <entry key='aquila.port'>5089</entry>
    <entry key='flextrack.port'>5090</entry>
    <entry key='blackkite.port'>5091</entry>
    <entry key='adm.port'>5092</entry>
    <entry key='watch.port'>5093</entry>
    <entry key='t800x.port'>5094</entry>
    <entry key='upro.port'>5095</entry>
    <entry key='auro.port'>5096</entry>
    <entry key='disha.port'>5097</entry>
    <entry key='thinkrace.port'>5098</entry>
    <entry key='pathaway.port'>5099</entry>
    <entry key='arnavi.port'>5100</entry>
    <entry key='nvs.port'>5101</entry>
    <entry key='kenji.port'>5102</entry>
    <entry key='astra.port'>5103</entry>
    <entry key='homtecs.port'>5104</entry>
    <entry key='fox.port'>5105</entry>
    <entry key='gnx.port'>5106</entry>
    <entry key='arknav.port'>5107</entry>
    <entry key='supermate.port'>5108</entry>
    <entry key='appello.port'>5109</entry>
    <entry key='idpl.port'>5110</entry>
    <entry key='huasheng.port'>5111</entry>
    <entry key='l100.port'>5112</entry>
    <entry key='granit.port'>5113</entry>
    <entry key='carcell.port'>5114</entry>
    <entry key='obddongle.port'>5115</entry>
    <entry key='hunterpro.port'>5116</entry>
    <entry key='raveon.port'>5117</entry>
    <entry key='cradlepoint.port'>5118</entry>
    <entry key='arknavx8.port'>5119</entry>
    <entry key='autograde.port'>5120</entry>
    <entry key='oigo.port'>5121</entry>
    <entry key='jpkorjar.port'>5122</entry>
    <entry key='cguard.port'>5123</entry>
    <entry key='fifotrack.port'>5124</entry>
    <entry key='smokey.port'>5125</entry>
    <entry key='extremtrac.port'>5126</entry>
    <entry key='trakmate.port'>5127</entry>
    <entry key='at2000.port'>5128</entry>
    <entry key='maestro.port'>5129</entry>
    <entry key='ais.port'>5130</entry>
    <entry key='gt30.port'>5131</entry>
    <entry key='tmg.port'>5132</entry>
    <entry key='pretrace.port'>5133</entry>
    <entry key='pricol.port'>5134</entry>
    <entry key='siwi.port'>5135</entry>
    <entry key='starlink.port'>5136</entry>
    <entry key='dmt.port'>5137</entry>
    <entry key='xt2400.port'>5138</entry>
    <entry key='dmthttp.port'>5139</entry>
    <entry key='alematics.port'>5140</entry>
    <entry key='gps056.port'>5141</entry>
    <entry key='flexcomm.port'>5142</entry>
    <entry key='vt200.port'>5143</entry>
    <entry key='owntracks.port'>5144</entry>
    <entry key='vtfms.port'>5145</entry>
    <entry key='tlv.port'>5146</entry>
    <entry key='esky.port'>5147</entry>
    <entry key='genx.port'>5148</entry>
    <entry key='flespi.port'>5149</entry>
    <entry key='dway.port'>5150</entry>
    <entry key='recoda.port'>5151</entry>
    <entry key='oko.port'>5152</entry>
    <entry key='ivt401.port'>5153</entry>
    <entry key='sigfox.port'>5154</entry>
    <entry key='t57.port'>5155</entry>
    <entry key='spot.port'>5156</entry>
    <entry key='m2c.port'>5157</entry>
    <entry key='austinnb.port'>5158</entry>
    <entry key='opengts.port'>5159</entry>
    <entry key='cautela.port'>5160</entry>
    <entry key='continental.port'>5161</entry>
    <entry key='egts.port'>5162</entry>
    <entry key='robotrack.port'>5163</entry>
    <entry key='pt60.port'>5164</entry>
    <entry key='telemax.port'>5165</entry>
    <entry key='sabertek.port'>5166</entry>
    <entry key='retranslator.port'>5167</entry>
    <entry key='svias.port'>5168</entry>
    <entry key='eseal.port'>5169</entry>
    <entry key='freematics.port'>5170</entry>
    <entry key='avema.port'>5171</entry>
    <entry key='autotrack.port'>5172</entry>
    <entry key='tek.port'>5173</entry>
    <entry key='wristband.port'>5174</entry>
    <entry key='applet.port'>5175</entry>
    <entry key='milesmate.port'>5176</entry>
    <entry key='anytrek.port'>5177</entry>
    <entry key='smartsole.port'>5178</entry>
    <entry key='its.port'>5179</entry>
    <entry key='xrb28.port'>5180</entry>
    <entry key='c2stek.port'>5181</entry>
    <entry key='nyitech.port'>5182</entry>
    <entry key='neos.port'>5183</entry>
    <entry key='satsol.port'>5184</entry>
    <entry key='globalstar.port'>5185</entry>
    <entry key='sanul.port'>5186</entry>
    <entry key='minifinder2.port'>5187</entry>
    <entry key='radar.port'>5188</entry>
    <entry key='techtlt.port'>5189</entry>
    <entry key='starcom.port'>5190</entry>
    <entry key='mictrack.port'>5191</entry>
    <entry key='plugin.port'>5192</entry>
    <entry key='leafspy.port'>5193</entry>
    <entry key='naviset.port'>5194</entry>
    <entry key='racedynamics.port'>5195</entry>
    <entry key='rst.port'>5196</entry>
    <entry key='pt215.port'>5197</entry>
    <entry key='pacifictrack.port'>5198</entry>
    <entry key='topin.port'>5199</entry>
    <entry key='outsafe.port'>5200</entry>
    <entry key='solarpowered.port'>5201</entry>
    <entry key='motor.port'>5202</entry>
    <entry key='omnicomm.port'>5203</entry>
    <entry key='s168.port'>5204</entry>
    <entry key='vnet.port'>5205</entry>
    <entry key='blue.port'>5206</entry>
    <entry key='pst.port'>5207</entry>
    <entry key='dingtek.port'>5208</entry>
    <entry key='wli.port'>5209</entry>
    <entry key='niot.port'>5210</entry>
    <entry key='portman.port'>5211</entry>
    <entry key='moovbox.port'>5212</entry>
    <entry key='futureway.port'>5213</entry>
    <entry key='polte.port'>5214</entry>
    <entry key='net.port'>5215</entry>
    <entry key='mobilogix.port'>5216</entry>
    <entry key='swiftech.port'>5217</entry>
    <entry key='iotm.port'>5218</entry>
    <entry key='dolphin.port'>5219</entry>
    <entry key='ennfu.port'>5220</entry>
    <entry key='navtelecom.port'>5221</entry>
    <entry key='startek.port'>5222</entry>
    <entry key='gs100.port'>5223</entry>
    <entry key='mavlink2.port'>5224</entry>
    <entry key='uux.port'>5225</entry>
    <entry key='r12w.port'>5226</entry>
    <entry key='flexiblereport.port'>5227</entry>
    <entry key='thinkpower.port'>5228</entry>

</properties>


text:
'use strict';

module.exports = {
    pageTrack: true,
    eventTrack: true,
    setAlias: true,
    setUsername: true,
    setUserProperties: true,
    setUserPropertiesOnce: true,
    setSuperProperties: true,
    setSuperPropertiesOnce: true
};


text:
layout: page
title: Snow Omega Electronics Show
date: 2016-05-24
author: Walter Perry
tags: weekly links, java
status: published
summary: In dui metus, fringilla non.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 10/12/2017
  endDate: 10/13/2017
  ctyhocn: FYMTNHX
  groupCode: SOES
published: true
---
Sed dapibus libero ac sollicitudin sollicitudin. Etiam a justo dapibus, egestas mi at, facilisis ligula. Integer ac aliquet est. Integer nec augue tristique, congue ex non, rhoncus purus. Etiam bibendum ligula dolor, nec posuere mauris sagittis a. Mauris feugiat odio quis augue accumsan blandit. Duis nibh purus, condimentum sit amet ultrices vitae, elementum vel neque.
Sed rutrum pretium nisi et iaculis. Donec aliquet pellentesque dignissim. Aliquam erat volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus hendrerit ultricies erat, a ullamcorper tortor posuere id. Mauris semper tincidunt nibh, vitae ornare urna. Nunc viverra id nisl a bibendum. Nullam aliquet molestie posuere. Duis fringilla viverra eros eget aliquam. Nunc hendrerit orci metus, ultrices gravida neque efficitur faucibus. Duis sit amet nibh consequat, tincidunt arcu vitae, hendrerit mi. Sed convallis sem non libero molestie molestie. Phasellus at sapien auctor, pellentesque felis vel, finibus velit.

* Nam eu elit vitae orci laoreet pulvinar
* Integer non nulla consectetur, rutrum mauris vitae, mattis ipsum
* Nullam efficitur mauris a risus pulvinar blandit
* Phasellus non nisl eu massa convallis mollis in id sapien
* Etiam vel enim id libero elementum sodales nec in enim.

Suspendisse vel rutrum elit, bibendum efficitur odio. Mauris fringilla fermentum magna in mattis. Aliquam metus quam, viverra a lorem ac, imperdiet finibus turpis. Nulla in convallis justo, quis congue ipsum. Vivamus ut facilisis sapien. Nam et sollicitudin est. Suspendisse potenti. Mauris consectetur, odio ac sodales pellentesque, eros felis egestas lorem, sit amet imperdiet nunc erat sed neque.


text:
<?php declare(strict_types=1);

namespace Packagist\WebBundle\SecurityAdvisory;

use Packagist\WebBundle\Entity\SecurityAdvisory;

class RemoteSecurityAdvisory
{
    /** @var string */
    private $id;
    /** @var string */
    private $title;
    /** @var string */
    private $packageName;
    /** @var string */
    private $affectedVersions;
    /** @var string */
    private $link;
    /** @var ?string */
    private $cve;
    /** @var \DateTime */
    private $date;
    /** @var string|null */
    private $composerRepository;

    public function __construct(string $id, string $title, string $packageName, string $affectedVersions, string $link, $cve, \DateTime $date, ?string $composerRepository)
    {
        $this->id = $id;
        $this->title = $title;
        $this->packageName = $packageName;
        $this->affectedVersions = $affectedVersions;
        $this->link = $link;
        $this->cve = $cve;
        $this->date = $date;
        $this->composerRepository = $composerRepository;
    }

    public function getId(): string
    {
        return $this->id;
    }

    public function getTitle(): string
    {
        return $this->title;
    }

    public function getPackageName(): string
    {
        return $this->packageName;
    }

    public function getAffectedVersions(): string
    {
        return $this->affectedVersions;
    }

    public function getLink(): string
    {
        return $this->link;
    }

    public function getCve(): ?string
    {
        return $this->cve;
    }

    public function getDate(): \DateTime
    {
        return $this->date;
    }

    public function getComposerRepository(): ?string
    {
        return $this->composerRepository;
    }

    public static function createFromFriendsOfPhp(string $fileNameWithPath, array $info): RemoteSecurityAdvisory
    {
        $date = null;
        $fallbackYearDate = null;
        if (preg_match('#(\d{4}-\d{2}-\d{2})#', basename($fileNameWithPath), $matches)) {
            $date = new \DateTime($matches[1] . ' 00:00:00');
        } elseif (preg_match('#CVE-(2\d{3})-\d#', basename($fileNameWithPath), $matches)) {
            $fallbackYearDate = new \DateTime($matches[1] . '-01-01 00:00:00');
        }

        $affectedVersions = [];
        $lowestBranchDate = null;
        foreach ($info['branches'] as $branchInfo) {
            $affectedVersions[] = implode(',', $branchInfo['versions']);
            if (!$date && isset($branchInfo['time']) && is_int($branchInfo['time'])) {
                $branchDate = new \DateTime('@' . $branchInfo['time']);
                if (!$lowestBranchDate || $branchDate < $lowestBranchDate) {
                    $lowestBranchDate = $branchDate;
                }
            }
        }

        if (!$date) {
            if ($lowestBranchDate) {
                $date = $lowestBranchDate;
            } elseif ($fallbackYearDate) {
                $date = $fallbackYearDate;
            } else {
                $date = (new \DateTime())->setTime(0, 0, 0);
            }
        }

        // If the value is not set then the default value is https://packagist.org
        $composerRepository = SecurityAdvisory::PACKAGIST_ORG;
        if (isset($info['composer-repository'])) {
            if ($info['composer-repository'] === false) {
                $composerRepository = null;
            } else {
                $composerRepository = $info['composer-repository'];
            }
        }

        return new RemoteSecurityAdvisory(
            $fileNameWithPath,
            $info['title'],
            str_replace('composer://', '', $info['reference']),
            implode('|', $affectedVersions),
            $info['link'],
            $info['cve'] ?? null,
            $date,
            $composerRepository
        );
    }
}


text: export { default } from 'ember-line-clamp/components/line-clamp';


text:
    "#ifdef GL_ES\n"\
    "precision mediump float;\n"\
    "#endif\n"\
    #src
#define SHADER(src) { false, SHADER0(src), }
#define SHADER_EXTERNAL_OES0(src) \
    "#extension GL_OES_EGL_image_external : require\n"\
    "#ifdef GL_ES\n"\
    "precision mediump float;\n"\
    "#endif\n"\
    #src
#define SHADER_EXTERNAL_OES(src) { true, SHADER_EXTERNAL_OES0(src), }

namespace {

const GLfloat kQuadVertices[] = { -1.0f, -1.0f, 0.0f, 1.0f,
                                   1.0f, -1.0f, 0.0f, 1.0f,
                                   1.0f,  1.0f, 0.0f, 1.0f,
                                  -1.0f,  1.0f, 0.0f, 1.0f };

enum ProgramId {
  PROGRAM_COPY_TEXTURE,
  PROGRAM_COPY_TEXTURE_FLIP_Y,
  PROGRAM_COPY_TEXTURE_PREMULTIPLY_ALPHA,
  PROGRAM_COPY_TEXTURE_UNPREMULTIPLY_ALPHA,
  PROGRAM_COPY_TEXTURE_PREMULTIPLY_ALPHA_FLIPY,
  PROGRAM_COPY_TEXTURE_UNPREMULTIPLY_ALPHA_FLIPY,
  PROGRAM_COPY_TEXTURE_OES,
  PROGRAM_COPY_TEXTURE_OES_FLIP_Y,
  PROGRAM_COPY_TEXTURE_OES_PREMULTIPLY_ALPHA,
  PROGRAM_COPY_TEXTURE_OES_UNPREMULTIPLY_ALPHA,
  PROGRAM_COPY_TEXTURE_OES_PREMULTIPLY_ALPHA_FLIPY,
  PROGRAM_COPY_TEXTURE_OES_UNPREMULTIPLY_ALPHA_FLIPY,
};

struct ShaderInfo {
  bool needs_egl_image_external;
  const char* source;
};

const ShaderInfo shader_infos[] = {
  // VERTEX_SHADER_POS_TEX
  SHADER(
    attribute vec4 a_position;
    varying vec2 v_uv;
    void main(void) {
      gl_Position = a_position;
      v_uv = a_position.xy * 0.5 + vec2(0.5, 0.5);
    }),
  // FRAGMENT_SHADER_TEX
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, v_uv.st);
    }),
  // FRAGMENT_SHADER_TEX_FLIP_Y
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
    }),
  // FRAGMENT_SHADER_TEX_PREMULTIPLY_ALPHA
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, v_uv.st);
      gl_FragColor.rgb *= gl_FragColor.a;
    }),
  // FRAGMENT_SHADER_TEX_UNPREMULTIPLY_ALPHA
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, v_uv.st);
      if (gl_FragColor.a > 0.0)
        gl_FragColor.rgb /= gl_FragColor.a;
    }),
  // FRAGMENT_SHADER_TEX_PREMULTIPLY_ALPHA_FLIP_Y
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
      gl_FragColor.rgb *= gl_FragColor.a;
    }),
  // FRAGMENT_SHADER_TEX_UNPREMULTIPLY_ALPHA_FLIP_Y
  SHADER(
    uniform sampler2D u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
      if (gl_FragColor.a > 0.0)
        gl_FragColor.rgb /= gl_FragColor.a;
    }),
  // FRAGMENT_SHADER_TEX_OES
  SHADER_EXTERNAL_OES(
    precision mediump float;
    uniform samplerExternalOES u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, v_uv.st);
    }),
  // FRAGMENT_SHADER_TEX_OES_FLIP_Y
  SHADER_EXTERNAL_OES(
     precision mediump float;
     uniform samplerExternalOES u_texSampler;
     varying vec2 v_uv;
     void main(void) {
       gl_FragColor =
           texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
     }),
  // FRAGMENT_SHADER_TEX_OES_PREMULTIPLY_ALPHA
  SHADER_EXTERNAL_OES(
     precision mediump float;
     uniform samplerExternalOES u_texSampler;
     varying vec2 v_uv;
     void main(void) {
       gl_FragColor = texture2D(u_texSampler, v_uv.st);
       gl_FragColor.rgb *= gl_FragColor.a;
     }),
  // FRAGMENT_SHADER_TEX_OES_UNPREMULTIPLY_ALPHA
  SHADER_EXTERNAL_OES(
    precision mediump float;
    uniform samplerExternalOES u_texSampler;
    varying vec2 v_uv;
    void main(void) {
      gl_FragColor = texture2D(u_texSampler, v_uv.st);
      if (gl_FragColor.a > 0.0)
        gl_FragColor.rgb /= gl_FragColor.a;
    }),
  // FRAGMENT_SHADER_TEX_OES_PREMULTIPLY_ALPHA_FLIP_Y
  SHADER_EXTERNAL_OES(
      precision mediump float;
      uniform samplerExternalOES u_texSampler;
      varying vec2 v_uv;
      void main(void) {
        gl_FragColor =
            texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
        gl_FragColor.rgb *= gl_FragColor.a;
      }),
  // FRAGMENT_SHADER_TEX_OES_UNPREMULTIPLY_ALPHA_FLIP_Y
  SHADER_EXTERNAL_OES(
      precision mediump float;
      uniform samplerExternalOES u_texSampler;
      varying vec2 v_uv;
      void main(void) {
        gl_FragColor =
            texture2D(u_texSampler, vec2(v_uv.s, 1.0 - v_uv.t));
        if (gl_FragColor.a > 0.0)
          gl_FragColor.rgb /= gl_FragColor.a;
      }),
};

const int kNumShaders = arraysize(shader_infos);

// Returns the correct program to evaluate the copy operation for
// the CHROMIUM_flipy and premultiply alpha pixel store settings.
ProgramId GetProgram(
    bool flip_y,
    bool premultiply_alpha,
    bool unpremultiply_alpha,
    bool is_source_external_oes) {
  // If both pre-multiply and unpremultiply are requested, then perform no
  // alpha manipulation.
  if (premultiply_alpha && unpremultiply_alpha) {
    premultiply_alpha = false;
    unpremultiply_alpha = false;
  }

  // bit 0: Flip_y
  // bit 1: Premult
  // bit 2: Unpremult
  // bit 3: External_oes
  static ProgramId program_ids[] = {
    PROGRAM_COPY_TEXTURE,
    PROGRAM_COPY_TEXTURE_FLIP_Y,                         // F
    PROGRAM_COPY_TEXTURE_PREMULTIPLY_ALPHA,              //   P
    PROGRAM_COPY_TEXTURE_PREMULTIPLY_ALPHA_FLIPY,        // F P
    PROGRAM_COPY_TEXTURE_UNPREMULTIPLY_ALPHA,            //     U
    PROGRAM_COPY_TEXTURE_UNPREMULTIPLY_ALPHA_FLIPY,      // F   U
    PROGRAM_COPY_TEXTURE,                                //   P U
    PROGRAM_COPY_TEXTURE,                                // F P U
    PROGRAM_COPY_TEXTURE_OES,                            //       E
    PROGRAM_COPY_TEXTURE_OES_FLIP_Y,                     // F     E
    PROGRAM_COPY_TEXTURE_OES_PREMULTIPLY_ALPHA,          //   P   E
    PROGRAM_COPY_TEXTURE_OES_PREMULTIPLY_ALPHA_FLIPY,    // F P   E
    PROGRAM_COPY_TEXTURE_OES_UNPREMULTIPLY_ALPHA,        //     U E
    PROGRAM_COPY_TEXTURE_OES_UNPREMULTIPLY_ALPHA_FLIPY,  // F   U E
    PROGRAM_COPY_TEXTURE_OES,                            //   P U E
    PROGRAM_COPY_TEXTURE_OES,                            // F P U E
  };

  unsigned index = (flip_y                 ? (1 << 0) : 0) |
                   (premultiply_alpha      ? (1 << 1) : 0) |
                   (unpremultiply_alpha    ? (1 << 2) : 0) |
                   (is_source_external_oes ? (1 << 3) : 0);
  return program_ids[index];
}

}  // namespace

namespace gpu {

void CopyTextureCHROMIUMResourceManager::Initialize(
    const gles2::GLES2Decoder* decoder) {
  COMPILE_ASSERT(
      kVertexPositionAttrib == 0u,
      Position_attribs_must_be_0);

  const char* extensions =
      reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
  bool have_egl_image_external = extensions &&
      strstr(extensions, "GL_OES_EGL_image_external");

  // Initialize all of the GPU resources required to perform the copy.
  glGenBuffersARB(1, &buffer_id_);
  glBindBuffer(GL_ARRAY_BUFFER, buffer_id_);
  glBufferData(GL_ARRAY_BUFFER, sizeof(kQuadVertices), kQuadVertices,
               GL_STATIC_DRAW);

  glGenFramebuffersEXT(1, &framebuffer_);

  // TODO(gman): Init these on demand.
  GLuint shaders[kNumShaders];
  for (int shader = 0; shader < kNumShaders; ++shader) {
    shaders[shader] = glCreateShader(
        shader == 0 ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
    const ShaderInfo& info = shader_infos[shader];
    if (info.needs_egl_image_external && !have_egl_image_external) {
      continue;
    }
    const char* shader_source = shader_infos[shader].source;
    glShaderSource(shaders[shader], 1, &shader_source, 0);
    glCompileShader(shaders[shader]);
#ifndef NDEBUG
    GLint compile_status;
    glGetShaderiv(shaders[shader], GL_COMPILE_STATUS, &compile_status);
    if (GL_TRUE != compile_status)
      DLOG(ERROR) << "CopyTextureCHROMIUM: shader compilation failure.";
#endif
  }

  // TODO(gman): Init these on demand.
  for (int program = 0; program < kNumPrograms; ++program) {
    const ShaderInfo& info = shader_infos[program + 1];
    if (info.needs_egl_image_external && !have_egl_image_external) {
      continue;
    }
    programs_[program] = glCreateProgram();
    glAttachShader(programs_[program], shaders[0]);
    glAttachShader(programs_[program], shaders[program + 1]);

    glBindAttribLocation(programs_[program], kVertexPositionAttrib,
                         "a_position");

    glLinkProgram(programs_[program]);
#ifndef NDEBUG
    GLint linked;
    glGetProgramiv(programs_[program], GL_LINK_STATUS, &linked);
    if (!linked)
      DLOG(ERROR) << "CopyTextureCHROMIUM: program link failure.";
#endif

    sampler_locations_[program] = glGetUniformLocation(programs_[program],
                                                      "u_texSampler");
  }

  for (int shader = 0; shader < kNumShaders; ++shader)
    glDeleteShader(shaders[shader]);

  decoder->RestoreBufferBindings();

  initialized_ = true;
}

void CopyTextureCHROMIUMResourceManager::Destroy() {
  if (!initialized_)
    return;

  glDeleteFramebuffersEXT(1, &framebuffer_);

  for (int program = 0; program < kNumPrograms; ++program)
    glDeleteProgram(programs_[program]);

  glDeleteBuffersARB(1, &buffer_id_);
}

void CopyTextureCHROMIUMResourceManager::DoCopyTexture(
    const gles2::GLES2Decoder* decoder,
    GLenum source_target,
    GLenum dest_target,
    GLuint source_id,
    GLuint dest_id,
    GLint level,
    GLsizei width,
    GLsizei height,
    bool flip_y,
    bool premultiply_alpha,
    bool unpremultiply_alpha) {
  DCHECK(source_target == GL_TEXTURE_2D ||
         source_target == GL_TEXTURE_EXTERNAL_OES);
  if (!initialized_) {
    DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager.";
    return;
  }

  GLuint program = GetProgram(
      flip_y, premultiply_alpha, unpremultiply_alpha,
      source_target == GL_TEXTURE_EXTERNAL_OES);
  glUseProgram(programs_[program]);

#ifndef NDEBUG
  glValidateProgram(programs_[program]);
  GLint validation_status;
  glGetProgramiv(programs_[program], GL_VALIDATE_STATUS, &validation_status);
  if (GL_TRUE != validation_status) {
    DLOG(ERROR) << "CopyTextureCHROMIUM: Invalid shader.";
    return;
  }
#endif

  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, dest_id);
  // NVidia drivers require texture settings to be a certain way
  // or they won't report FRAMEBUFFER_COMPLETE.
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer_);
  glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dest_target,
                            dest_id, level);

#ifndef NDEBUG
  GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER);
  if (GL_FRAMEBUFFER_COMPLETE != fb_status) {
    DLOG(ERROR) << "CopyTextureCHROMIUM: Incomplete framebuffer.";
  } else
#endif
  {
    glEnableVertexAttribArray(kVertexPositionAttrib);

    glBindBuffer(GL_ARRAY_BUFFER, buffer_id_);
    glVertexAttribPointer(kVertexPositionAttrib, 4, GL_FLOAT, GL_FALSE,
                          4 * sizeof(GLfloat), 0);

    glUniform1i(sampler_locations_[program], 0);

    glBindTexture(source_target, source_id);
    glTexParameterf(source_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(source_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(source_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(source_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

    glDisable(GL_DEPTH_TEST);
    glDisable(GL_SCISSOR_TEST);
    glDisable(GL_STENCIL_TEST);
    glDisable(GL_CULL_FACE);
    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
    glDepthMask(GL_FALSE);
    glDisable(GL_BLEND);

    glViewport(0, 0, width, height);
    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
  }

  decoder->RestoreAttribute(kVertexPositionAttrib);
  decoder->RestoreTextureUnitBindings(0);
  decoder->RestoreTextureState(source_id);
  decoder->RestoreTextureState(dest_id);
  decoder->RestoreActiveTexture();
  decoder->RestoreProgramBindings();
  decoder->RestoreBufferBindings();
  decoder->RestoreFramebufferBindings();
  decoder->RestoreGlobalState();
}

}  // namespace


text:
using System;
using Microsoft.SPOT;

using Gadgeteer;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using GHIElectronics.Gadgeteer;

using Verdant.Common;
using Verdant.HAL;
using Verdant.Hub.Drivers;

namespace Verdant.Hub
{
    public partial class Program : Gadgeteer.Program
    {
        private HAL _hal;
        private IAnnunciator _annunciator;

        public static void Main()
        {
            Debug.EnableGCMessages(true);

            // As much as I would like to bury this in the dicontainer setup in Initialize(), this has to happen before
            //   the Program() instance can be created
            DiContainer.Instance.Register(typeof(IMainboard), typeof(Spider1MainBoard)).AsSingleton();
            var mb = (IMainboard)DiContainer.Instance.Resolve(typeof(IMainboard));
            Program.Mainboard = mb.MainboardInstance;

            var p = new Program();
            p.Initialize();
            p.Run();
        }

        private void Initialize()
        {
#if DEBUG
            GHI.Processor.Watchdog.Enable(120000);
#else
            GHI.Processor.WatchDog.Enable(5000);
#endif

            DiContainer.Instance.Install(
                new Verdant.Hub.Drivers.Installer(),
                new Verdant.HAL.HostEnvironmentInstaller()
            );
            GHI.Processor.Watchdog.ResetCounter();

            // initialize legacy drivers
            InitializeHal();
            GHI.Processor.Watchdog.ResetCounter();

            var display = (IDisplay)DiContainer.Instance.Resolve(typeof(IDisplay));
            display.Initialize(this);
            GHI.Processor.Watchdog.ResetCounter();

            _annunciator = (IAnnunciator)DiContainer.Instance.Resolve(typeof(IAnnunciator));

            var wifi = (IWirelessNetworking)DiContainer.Instance.Resolve(typeof(IWirelessNetworking));
            wifi.Initialize();

            GT.Timer timer = new GT.Timer(500); // Create a timer
            timer.Tick += Timer_Tick;
            timer.Start(); // Start the timer

        }

        private void Timer_Tick(Timer timer)
        {
            // Proof of life
            _annunciator.PulseDebug();
            GHI.Processor.Watchdog.ResetCounter();
        }

        private void InitializeHal()
        {

            // legacy gadgeteer drivers
            _hal = new HAL();
            _hal.Initialize();

            Debug.Print("HAL initialization complete...");
        }

        private static Dispatcher _dispatcher = null;
        internal static Dispatcher Dispatcher
        {
            get
            {
                if (_dispatcher == null)
                    _dispatcher = Dispatcher.CurrentDispatcher;
                return _dispatcher;
            }
        }

    }
}


text:
FactoryGirl.define do
  # must use build()
  factory :stock_packer, class: Spree::Stock::Packer do
    ignore do
      stock_location { build(:stock_location) }
      contents []
    end

    initialize_with { new(stock_location, contents) }
  end

  factory :stock_package, class: Spree::Stock::Package do
    ignore do
      stock_location { build(:stock_location) }
      order { create(:order_with_line_items, line_items_count: 2) }
      contents []
    end

    initialize_with { new(stock_location, order, contents) }

    factory :stock_package_fulfilled do
      after(:build) do |package, evaluator|
        evaluator.order.line_items.reload
        evaluator.order.line_items.each do |line_item|
          package.add line_item, line_item.quantity, :on_hand
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
     android:descendantFocusability="blocksDescendants"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:id="@+id/rl_title"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentTop="true"
        android:background="#ee3a43" >

        <TextView
            android:id="@+id/tv_agentpersonal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:paddingLeft="5dp"
            android:text="我的二手房"
            android:textColor="#ffffff"
            android:textSize="14sp" />

        <LinearLayout
            android:id="@+id/ll_back_putongershoulist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:orientation="horizontal" >

            <ImageView
                  android:padding="10dp"
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignTop="@+id/textView1"
                android:src="@drawable/white_left" />

        </LinearLayout>

        <TextView
            android:id="@+id/tv_putongershoulist_submit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="15dp"
            android:text="发布"
            android:textColor="#ffffff"
            android:textSize="14sp" />
    </RelativeLayout>

   <ListView
          android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:divider="@null"
            android:scrollbars="none"
        android:layout_below="@+id/rl_title"
        android:id="@+id/lv_submit_ershou_list1"
        ></ListView>

</RelativeLayout>


text:
package com.experimental.labs.dev;

public class Kuroari implements Puppet{

    @Override
    public String toString(){
	return "Kuroari - Black Ant \r\n";
    }

}


text:
package org.datanucleus.samples.annotations.inheritance;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;

/**
 * Subclass in hierarchy using table-per-class inheritance strategy.
 */
@Entity
@Table(name="JPA_INHERIT_B2")
public class InheritB2 extends InheritB
{
    String name2;
}


text:
package data;

public class HelloWorldPrimitive002 {

	public int getValue() {
		return 37;
	}

	public boolean getValueBoolean() {
		return false;
	}

	public int getValueWithParams(String a, String b) {
		return Integer.valueOf(a) + Integer.valueOf(b);
	}

	public short getValueShort() {
		return 6;
	}

	public float getValueFloat() {
		return 6.0f;
	}

	public double getValueDouble() {
		return 6.0d;
	}

	public long getValueLong() {
		return 6L;
	}

	public byte getValueByte() {
		return 6;
	}

	public char getValueChar() {
		return 'f';
	}

	public int[] getArrayInt() {
		return new int[] { 5 };
	}

	public String[] getArrayString() {
		return new String[] { "DEF" };
	}
}


text:
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using TraceEventSamples.Producer;

/* README FIRST */
// This program is a simple demo that demonstrates how to make EVentSources log to a file as
// as well as how to read that file and parse the resulting events.
//
// The basic flow of the program is
//   Generating of the ETL file:
//     * Create a 'file' TraceEventSession.  This lets you control what events you wish to collect, and
//          tells the session where to put the file.
//     * Enable the ETW providers of interest (in this case Microsoft-Demos-SimpleMonitor)
//     * Kick off EventGenerator to generate some Microsoft-Demos-SimpleMonitor events (normally in another process).
//     * Wait for the generate to generate some events (12 seconds)
//     * End the session
//
//   Parsing of the ETL file
//     * Create an ETWTraceEventSource which gets its data from the data file.   A TraceEventSource
//           represents the stream of events in the file.
//     * Connect a TraceEventParser to the source.    Parsers know how to interpret events from particular
//          ETW providers.  In this case we care about EventSource events and the DynamicTraceEventParser
//          is the parser that cares about it.
//     * Attach callbacks to the Parser for the events you are interested in.  We use the 'All' C# event
//          for this.
//     * Call ETWTraceEventSource.Process() which will loop through all events in the file.  It can
//          be stopped early by calling ETWTraceEventSource.StopProcessing().
//     * Your processing happens in the callbacks
//     * ETWTraceEventSource.Process() returns.
//     * Dispose the ETWTraceEventSource, which closes the files and cleans up resources.
//
namespace TraceEventSamples
{
    /// <summary>
    /// The main program is the 'listener' that listens and processes the events that come from EventGenerator
    /// </summary>
    class SimpleEventSourceFile
    {
        /// <summary>
        /// Where all the output goes.
        /// </summary>
        static TextWriter Out = AllSamples.Out;

        /// <summary>
        /// This is a demo of using TraceEvent to activate a 'real time' provider that is listening to
        /// the MyEventSource above.   Normally this event source would be in a different process,  but
        /// it also works if this process generate the events and I do that here for simplicity.
        /// </summary>
        public static int Run()
        {
            Out.WriteLine("******************** SimpleEventSourceFile DEMO ********************");
            Out.WriteLine("This program generates processes and displays EventSource events");
            Out.WriteLine("using the ETW File based pipeline.  (e.g. for later analysis)");
            Out.WriteLine();

            // Get some data and put it in a file
            CollectData("Microsoft-Demos-SimpleMonitor", "EventSourceData.etl");

            // Process the data in the file.
            ProcessData("EventSourceData.etl");
            return 0;
        }

        /// <summary>
        /// CollectData turn on logging of data from 'eventSourceName' to the file 'dataFileName'.
        /// It will then call EventGenerator.CreateEvents and wait 12 seconds for it to generate some data.
        /// </summary>
        static void CollectData(string eventSourceName, string dataFileName)
        {
            // Today you have to be Admin to turn on ETW events (anyone can write ETW events).
            if (!(TraceEventSession.IsElevated() ?? false))
            {
                Out.WriteLine("To turn on ETW events you need to be Administrator, please run from an Admin process.");
                Debugger.Break();
                return;
            }

            // As mentioned below, sessions can outlive the process that created them.  Thus you need a way of
            // naming the session so that you can 'reconnect' to it from another process.   This is what the name
            // is for.  It can be anything, but it should be descriptive and unique.   If you expect multiple versions
            // of your program to run simultaneously, you need to generate unique names (e.g. add a process ID suffix)
            // however this is dangerous because you can leave data collection on if the program ends unexpectedly.
            //
            // In this case we tell the session to place the data in MonitorToFileData.etl.
            var sessionName = "SimpleMontitorSession";
            Out.WriteLine("Creating a '{0}' session writing to {1}", sessionName, dataFileName);
            Out.WriteLine("Use 'logman query -ets' to see active sessions.");
            Out.WriteLine("Use 'logman stop {0} -ets' to manually stop orphans.", sessionName);
            using (var session = new TraceEventSession(sessionName, dataFileName))      // Since we give it a file name, the data goes there.
            {
                /* BY DEFAULT ETW SESSIONS SURVIVE THE DEATH OF THE PROESS THAT CREATES THEM! */
                // Unlike most other resources on the system, ETW session live beyond the lifetime of the
                // process that created them.   This is very useful in some scenarios, but also creates the
                // very real possibility of leaving 'orphan' sessions running.
                //
                // To help avoid this by default TraceEventSession sets 'StopOnDispose' so that it will stop
                // the ETW session if the TraceEventSession dies.   Thus executions that 'clean up' the TraceEventSession
                // will clean up the ETW session.   This covers many cases (including throwing exceptions)
                //
                // However if the process is killed manually (including control C) this cleanup will not happen.
                // Thus best practices include
                //
                //     * Add a Control C handler that calls session.Dispose() so it gets cleaned up in this common case
                //     * use the same session name run-to-run so you don't create many orphans.
                //
                // By default TraceEventSessions are in 'create' mode where it assumes you want to create a new session.
                // In this mode if a session already exists, it is stopped and the new one is created.
                //
                // Here we install the Control C handler.   It is OK if Dispose is called more than once.
                Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) { session.Dispose(); };

                // Enable my provider, you can call many of these on the same session to get other events.
                var restarted = session.EnableProvider(MyEventSource.Log.Name);
                if (restarted)      // Generally you don't bother with this warning, but for the demo we do.
                    Out.WriteLine("The session {0} was already active, it has been restarted.", sessionName);

                // Start another thread that Causes MyEventSource to create some events
                // Normally this code as well as the EventSource itself would be in a different process.
                EventGenerator.CreateEvents();

                Out.WriteLine("Waiting 12 seconds for events to come in.");
                Thread.Sleep(12000);
            }
        }

        /// <summary>
        /// Process the data in 'dataFileName' printing the events and doing delta computation between 'MyFirstEvent'
        /// and 'MySecondEvent'.
        /// </summary>
        static void ProcessData(string dataFileName)
        {
            // prepare to read from the session, connect the ETWTraceEventSource to the file
            // Notice there is no session at this point (reading and controlling are not necessarily related).
            // YOu can read the file on another machine if you like.
            Out.WriteLine("Opening {0} to see what data is in the file.", dataFileName);
            using (var source = new ETWTraceEventSource(dataFileName))
            {
                if (source.EventsLost != 0)
                    Out.WriteLine("WARNING: there were {0} lost events", source.EventsLost);

                // To demonstrate non-trivial event manipulation, we calculate the time delta between 'MyFirstEvent and 'MySecondEvent'
                // firstEventTimeMSec remembers all the 'MyFirstEvent' arrival times (indexed by their ID)
                var firstEventTimeMSec = new Dictionary<int, double>();

                /*****************************************************************************************************/
                // Hook up events.   To so this first we need a 'Parser. which knows how to part the events of a particular Event Provider.
                // In this case we get a DynamicTraceEventSource, which knows how to parse any EventSource provider.    This parser
                // is so common, that TraceEventSource as a shortcut property called 'Dynamic' that fetches this parsers.

                // For debugging, and demo purposes, hook up a callback for every event that 'Dynamic' knows about (this is not EVERY
                // event only those know about by DynamiceTraceEventParser).   However the 'UnhandledEvents' handler below will catch
                // the other ones.
                source.Dynamic.All += delegate(TraceEvent data)
                {
                    Out.WriteLine(data.PayloadByName("MyName"));
                    Out.WriteLine("GOT EVENT: " + data.ToString());
                };

                // Add logic on what to do when we get "MyFirstEvent"
                source.Dynamic.AddCallbackForProviderEvent("Microsoft-Demos-SimpleMonitor", "MyFirstEvent", delegate(TraceEvent data)
                {
                    // On First Events, simply remember the ID and time of the event
                    firstEventTimeMSec[(int)data.PayloadByName("MyId")] = data.TimeStampRelativeMSec;
                });

                // Add logic on what to do when we get "MySecondEvent"
                source.Dynamic.AddCallbackForProviderEvent("Microsoft-Demos-SimpleMonitor", "MySecondEvent", delegate(TraceEvent data)
                {
                    // On Second Events, if the ID matches, compute the delta and display it.
                    var myID = (int)data.PayloadByName("MyId");
                    double firstEventTime;
                    if (firstEventTimeMSec.TryGetValue(myID, out firstEventTime))
                    {
                        firstEventTimeMSec.Remove(myID);            // We are done with the ID after matching it, so remove it from the table.
                        Out.WriteLine("   >>> Time Delta from first Event = {0:f3} MSec", data.TimeStampRelativeMSec - firstEventTime);
                    }
                    else
                        Out.WriteLine("   >>> WARNING, Found a 'SecondEvent' without a corresponding 'FirstEvent'");
                });

                // Add logic on what to do when we get "Stop"
                source.Dynamic.AddCallbackForProviderEvent("Microsoft-Demos-SimpleMonitor", "Stop", delegate(TraceEvent data)
                {
                    Out.WriteLine("    >>> Got a stop message");
                    // Stop processing after we we see the 'Stop' event
                    source.StopProcessing();
                });

#if DEBUG
                // There may be events that are not handled by ANY of the callbacks above.  This is often a bug in your program
                // (you forgot a callback).  In debug we would like to see these to know that something is probably wrong.
                // The 'UnhandledEvents' callback will be called whenever no other callback has handled the event.   There is
                // also an 'All callback on the source (not a particular parser) that will call back on EVERY event from the source
                source.UnhandledEvents += delegate(TraceEvent data)
                {
                    if ((int)data.ID != 0xFFFE)         // The EventSource manifest events show up as unhandled, filter them out.
                        Out.WriteLine("GOT UNHANDLED EVENT: " + data.Dump());
                };
#endif

                // go into a loop processing events can calling the callbacks.  This will return when the all the events
                // In the file are processed, or the StopProcessing() call is made.
                source.Process();
                Out.WriteLine("Done Processing.");
            }
        }
    }
}


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

<TITLE>
gnu.crypto.sasl.anonymous (GNU cryptographic primitives and tools)
</TITLE>
<META NAME="keywords" CONTENT="gnu.crypto.sasl.anonymous package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

gnu.crypto.sasl.anonymous

Classes

AnonymousClient

AnonymousServer

AnonymousUtil


text:
#pragma config(Sensor, S1,     MICC,                sensorI2CCustom)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

/*
 * $Id: microinfinity-cruizcore-test1.c 123 2012-11-02 16:35:15Z xander $
 */

/**
 * microinfinity-cruizcore.h provides an API for the MicroInfinity CruizCore XG1300L sensor.
 * This program demonstrates how to use that API.
 *
 * Changelog:
 * - 0.1: Initial release
 *
 * Credits:
 * - Big thanks to MicroInfinity for providing me with the hardware necessary to write and test this.
 *
 * License: You may use this code as you wish, provided you give credit where it's due.
 *
 * THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.54 AND HIGHER.
 * Xander Soldaat (xander_at_botbench.com)
 * 29 May 2011
 * version 0.1
 */

#include "drivers/microinfinity-cruizcore.h"

task main () {
  int _x_accel = 0;
  int _y_accel = 0;
  int _z_accel = 0;

  int angleI = 0;
  float angleF = 0.0;

  int rotI = 0;
  float rotF = 0.0;

  nxtDisplayCenteredTextLine(0, "MicroInfinity");
  nxtDisplayTextLine(1, "CruizCore XG1300L");
  nxtDisplayCenteredTextLine(3, "Test 1");
  wait1Msec(2000);
  eraseDisplay();

  // There are 3 ranges the Cruizcore XG1300L can measure in
  // up to 2G
  // up to 4G
  // up to 8G
  MICCsetRange8G(MICC);

  // Make sure you always reset the sensor at the beginning of your program
  // The robot needs to be completely stationary or your heading and gyro
  // data won't be accurate.
  MICCreset(MICC);

  while(bSoundActive) EndTimeSlice();

  nxtDisplayTextLine(0, "CruizCore XG1300L");
  while (true) {
    // Read the relative heading from the sensor.
    angleI = MICCreadRelativeHeading(MICC);
    angleF = angleI / 100.0;

    // Read the rate of turn
    rotI = MICCreadTurnRate(MICC);
    rotF = rotI / 100.0;

    // Read the acceleration data from the sensor
    if (!MICCreadAccel(MICC, _x_accel, _y_accel, _z_accel)) {
      nxtDisplayTextLine(4, "ERROR!!");
      wait1Msec(2000);
      StopAllTasks();
    }

    nxtDisplayTextLine(2, "Heading: %4.2f", angleF);
    nxtDisplayTextLine(3, "RoT:     %4.2f", rotF);
    nxtDisplayTextLine(5, "X:      %5.2f", _x_accel/100.0);
    nxtDisplayTextLine(6, "Y:      %5.2f", _y_accel/100.0);
    nxtDisplayTextLine(7, "Z:      %5.2f", _z_accel/100.0);
    wait1Msec(50);
  }
}

/*
 * $Id: microinfinity-cruizcore-test1.c 123 2012-11-02 16:35:15Z xander $
 */


text:
/* Global Includes */
var testCase   = require('mocha').describe;
var pre        = require('mocha').before;
var preEach    = require('mocha').beforeEach;
var post       = require('mocha').after;
var postEach   = require('mocha').afterEach;
var assertions = require('mocha').it;
var assert     = require('chai').assert;
var validator  = require('validator');
var exec       = require('child_process').execSync;
var artik      = require('../lib/artik-sdk');

/* Test Specific Includes */
var wifi;
var ssid = process.env.WIFI_SSID;
var pwd  = process.env.WIFI_PSK;

/* Test Case Module */
testCase('Wifi', function() {

	pre(function() {
	});

	testCase('#on(started)', function() {

		assertions('Return callback event when the wifi interface is started', function(done) {
			wifi = new (require('../src/wifi'))();
			this.timeout(10000);
			wifi.on('started', function() {
				console.log('onstarted');
				done();
			});

		});

	});

	testCase('#scan_request(), on(scan)', function() {

		assertions('Return callback event when the wifi scan request is performed', function(done) {
			this.timeout(10000);
			wifi.on('scan', function(list) {
				console.log('onscan');
				assert.isNotNull(list);
				done();
			});

			wifi.scan_request();
		});

	});

	testCase('#connect(), on(connected)', function() {

		assertions('Return callback event when the wifi interface is connected to AP', function(done) {

            if (!ssid || !pwd || !ssid.length || !pwd.length)
			    this.skip();

			this.timeout(10000);
			wifi.on('connected', function() {
				console.log('onstarted');
				done();
			});

			wifi.disconnect();
			wifi.connect(ssid, pwd, true);

		});

	});

	post(function() {
	});

});


text:
{-# LANGUAGE BangPatterns, OverloadedStrings, ScopedTypeVariables, CPP #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}

-- | Utilities for reading PBBS data files, etc.

-- TODO:
--  * It is probably a better strategy to shift the slices around to match number
--    boundaries than it is to deal with this whole fragments business.  Try that.

module PBBS.FileReader
       (
         -- * PBBS specific
         readAdjacencyGraph, parseAdjacencyGraph,
         AdjacencyGraph(..), NodeID, nbrs,

         -- * Generally useful utilities
         readNumFile, parReadNats,

         -- * Testing
         t0,t1,t2,t3,t3B,t4,t5,
         unitTests
       ) where

import Control.Monad   (foldM, unless)
import Control.Monad.IO.Class (liftIO)
import Control.DeepSeq (NFData,rnf)
import Control.Exception (evaluate)
import Control.Concurrent (getNumCapabilities)
import Control.Monad.Par
import Control.Monad.Par.Unsafe (unsafeParIO)

import Data.Word
import Data.Char (isSpace)
import Data.Maybe (fromJust)
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as M
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as B
import Data.ByteString.Unsafe (unsafeTail, unsafeHead)
import Data.Time.Clock

import System.IO.Posix.MMap (unsafeMMapFile)
import Test.HUnit
import Prelude hiding (min,max,fst,last)

--------------------------------------------------------------------------------
-- PBBS specific:

data AdjacencyGraph =
  AdjacencyGraph {
    vertOffets :: U.Vector Word,
    allEdges   :: U.Vector Word
  }
 deriving (Read,Show,Eq,Ord)

nbrs :: AdjacencyGraph -> NodeID -> U.Vector NodeID
nbrs AdjacencyGraph{vertOffets, allEdges} nid =
    let ind = vertOffets U.! (fromIntegral nid)
        nxt = vertOffets U.! (fromIntegral (nid+1))
        suff = U.drop (fromIntegral ind) allEdges in
    if fromIntegral nid == U.length vertOffets - 1
    then suff
    else U.take (fromIntegral$ nxt-ind) suff

type NodeID = Word

-- | Read an PBBS AdjacencyGraph file into memory.
readAdjacencyGraph :: String -> IO AdjacencyGraph
readAdjacencyGraph path = do
  bs <- fmap (B.dropWhile isSpace) $
        unsafeMMapFile path
  ncap <- getNumCapabilities
  runParIO $ parseAdjacencyGraph (ncap * overPartition) bs

-- | Parse a PBBS AdjacencyGraph file from a ByteString, in parallel.
parseAdjacencyGraph :: Int -> B.ByteString -> Par AdjacencyGraph
parseAdjacencyGraph chunks bs =
  case B.splitAt (B.length tag) bs of
    (fst, rst) | fst /= tag -> error$ "readAdjacencyGraph: First word in file was not "++B.unpack tag
               | otherwise -> do
      ls <- parReadNats chunks rst
      let vec  = U.concat (sewEnds ls)
          vec' = U.drop 2 vec
      unless (U.length vec >= 2)$  error "readAdjacencyGraph: file ends prematurely."
      let verts   = fromIntegral$ vec U.! 0
          edges   = fromIntegral$ vec U.! 1
          (v1,v2) = U.splitAt verts vec'
      if U.length v1 == verts && U.length v2 == edges
        then return (AdjacencyGraph v1 v2)
        else error "readAdjacencyGraph: file doesn't contain as many entry as the header claims."
 where
   tag = "AdjacencyGraph"

--------------------------------------------------------------------------------

-- | How much should we partition a loop beyond what is necessary to have one task
-- per processor core.
overPartition :: Int
overPartition = 4
-- Overpartitioning definitely makes it faster... over 2X faster.
-- 8 doesn't gain anything over 4 however.. but it may reduce variance.
-- Hyperthreading shows some benefit!!

--------------------------------------------------------------------------------
#if 1
{-# INLINE readNumFile #-}
{-# INLINE parReadNats #-}
{-# INLINE readNatsPartial #-}
#else
{-# NOINLINE readNumFile #-}
{-# NOINLINE parReadNats #-}
{-# NOINLINE readNatsPartial #-}
#endif

-- | A simple front-end to 'parReadNats'.  This @mmap@s the file as a byte string and
-- parses it in parallel.  It returns a list of chunks of arbitrary size that may be
-- concattenated for a final result.
readNumFile :: forall nty . (U.Unbox nty, Integral nty, Eq nty, Show nty, Read nty) =>
               FilePath -> IO [U.Vector nty]
readNumFile path = do
  bs    <- unsafeMMapFile path
  ncpus <- getNumCapabilities
  ls    <- runParIO $ parReadNats (ncpus * overPartition) bs
  return (sewEnds ls)

testReadNumFile :: forall nty . (U.Unbox nty, Integral nty, Eq nty, Show nty, Read nty) =>
                   FilePath -> IO [U.Vector nty]
testReadNumFile path = do
  bs    <- unsafeMMapFile path
  ncpus <- getNumCapabilities
  ls    <- runParIO $ parReadNats (ncpus * overPartition) bs
  consume ls
  let ls' = sewEnds ls
  putStrLn $ "Number of chunks after sewing: "++show (length ls')
  putStrLn $ "Lengths: "++show (map U.length ls')++" sum "++ show(sum$ map U.length ls')
  let flat = U.concat ls'
  if (U.toList flat == map (read . B.unpack) (B.words bs))
   then putStrLn "Sewed version matched expected!!"
   else error "Did not match expected!"
  return ls'

-- | Read all the decimal numbers from a Bytestring.  They must be positive integers.
-- Be warned that this function is very permissive -- all non-digit characters are
-- treated as separators.
parReadNats :: forall nty f . (U.Unbox nty, Num nty, Eq nty) =>
               Int -> S.ByteString -> Par [PartialNums nty]
parReadNats chunks bs = par
  where
    (each,left) = S.length bs `quotRem` chunks
    mapper ind = do
      let howmany = each + if ind==chunks-1 then left else 0
          mychunk = S.take howmany $ S.drop (ind * each) bs
 --              liftIO $ putStrLn$ "(monad-par/tree) Launching chunk of "++show howmany
      partial <- unsafeParIO (readNatsPartial mychunk) -- TODO: move to ST.
      return [partial]
    reducer a b = return (a++b) -- Quadratic, but just at the chunk level.

    par :: Par [PartialNums nty]
    par = do _ <- new
             parMapReduceRangeThresh 1 (InclusiveRange 0 (chunks - 1))
                                  mapper reducer []

--------------------------------------------------------------------------------
-- Partially parsed number fragments
--------------------------------------------------------------------------------

-- | A sequence of parsed numbers with ragged edges.
data PartialNums n = Compound !(Maybe (RightFrag n)) ![U.Vector n] !(Maybe (LeftFrag n))
                   | Single !(MiddleFrag n)
  deriving (Show,Eq,Ord,Read)

-- | This represents the rightmost portion of a decimal number that was interrupted
-- in the middle.
data RightFrag n = RightFrag {
                numDigits    :: {-# UNPACK #-} !Int,
                partialParse :: !n
                -- ^ The partialParse will need to be combined with the other half
                -- through addition (shifting first if it represents a left-half).
                }
  deriving (Show,Eq,Ord,Read)

data LeftFrag n = LeftFrag !n
  deriving (Show,Eq,Ord,Read)

-- | A fragment from the middle of a number, (potentially) missing pieces on both ends.
data MiddleFrag n = MiddleFrag {-# UNPACK #-} !Int !n
  deriving (Show,Eq,Ord,Read)

instance NFData (RightFrag n) where
  rnf (RightFrag _ _) = ()
instance NFData (LeftFrag n) where
  rnf (LeftFrag _) = ()
instance NFData (MiddleFrag n) where
  rnf (MiddleFrag _ _) = ()

instance NFData (PartialNums n) where
  rnf (Compound a b c) = a `seq` b `seq` c `seq` ()
  rnf (Single a)       = rnf a

{-# INLINE sewEnds #-}
-- Sew up a list of ragged-edged fragments into a list of normal vector chunks.
sewEnds :: forall nty . (U.Unbox nty, Integral nty, Eq nty) => [PartialNums nty] -> [U.Vector nty]
sewEnds [] = []
sewEnds origls = loop Nothing origls
 where
   loop _mleft []     = error "Internal error."
   loop mleft [last] =
     case last of
       Single _                  -> error "sewEnds: Got a MiddleFrag at the END!"
       Compound _ _ (Just _)     -> error "sewEnds: Got a LeftFrag at the END!"
       Compound rf ls Nothing    -> sew mleft rf ls

   loop mleft (Compound rf ls lf : rst) =
     sew mleft rf ls ++ loop lf rst

   -- TODO: Test this properly... doesn't occur in most files:
   loop mleft (Single (MiddleFrag nd m) : rst) =
     case mleft of
       Nothing           -> loop (Just (LeftFrag m)) rst
       Just (LeftFrag n) -> loop (Just (LeftFrag (shiftCombine n m nd))) rst

   sew mleft rf ls =
     case (mleft, rf) of
       (Just (LeftFrag n), Just (RightFrag nd m)) -> let num = shiftCombine n m nd in
                                                     U.singleton num : ls
       (Just (LeftFrag n), Nothing)               -> U.singleton n   : ls
       (Nothing, Just (RightFrag _ m))            -> U.singleton m   : ls
       (Nothing, Nothing)                         ->                   ls

   shiftCombine n m nd = n * (10 ^ (fromIntegral nd :: nty)) + m

--------------------------------------------------------------------------------
-- Efficient sequential parsing
--------------------------------------------------------------------------------

-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Word] #-}
-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Word8] #-}
-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Word16] #-}
-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Word32] #-}
-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Word64] #-}
-- {-# SPECIALIZE readNatsPartial :: S.ByteString -> IO [PartialNums Int] #-}
-- | Sequentially reads all the unsigned decimal (ASCII) numbers within a a
-- bytestring, which is typically a slice of a larger bytestring.  Extra complexity
-- is needed to deal with the cases where numbers are cut off at the boundaries.
-- readNatsPartial :: S.ByteString -> IO [PartialNums Word]
readNatsPartial :: forall nty . (U.Unbox nty, Num nty, Eq nty) => S.ByteString -> IO (PartialNums nty)
readNatsPartial bs
 | bs == S.empty = return (Single (MiddleFrag 0 0))
 | otherwise = do
  let hd         = S.head bs
      charsTotal = S.length bs
  initV <- M.new (vecSize charsTotal)
  (vs,lfrg) <- scanfwd charsTotal 0 initV [] hd (S.tail bs)
  -- putStrLn$ " Got back "++show(length vs)++" partial reads"

  -- Once we are done looping we need some logic to figure out the corner cases:
  ----------------------------------------
  let total = sum $ map U.length vs
  if digit hd then
    (let first = U.head $ head vs -- The first (possibly partial) number parsed.
         rest  = U.tail (head vs) : tail vs
         -- If we start in the middle of a number, then the RightFrag goes till the first whitespace:
         rfrag = Just (RightFrag (fromJust$ S.findIndex (not . digit) bs) first) in
     if total == 0
     then case lfrg of
           Nothing           -> return (Compound rfrag [] Nothing)
           Just (LeftFrag w) -> return (Single$ MiddleFrag charsTotal w)
     else return (Compound rfrag   rest lfrg)) -- Rfrag gobbles first.
   else   return (Compound Nothing vs   lfrg) -- May be completely empty (whitespace only).
  ----------------------------------------
 where
   -- Given the number of characters left, how big of a vector chunk shall we allocate?
   -- vecSize n = min chunkSize ((n `quot` 2) + 1) -- At minimum numbers must be one character.
   vecSize n = ((n `quot` 4) + 1) -- Assume at least 3 digit numbers... tunable parameter.

   -- loop :: Int -> Int -> nty -> M.IOVector nty -> Word8 -> S.ByteString ->
   --         IO (M.IOVector nty, Maybe (LeftFrag nty), Int)
   loop !lmt !ind !acc !vec !vecacc !nxt !rst
     -- Extend the currently accumulating number in 'acc':
     | digit nxt =
       let acc' = (10*acc + (fromIntegral nxt-48)) in
       if lmt == 1
       then closeOff vec vecacc ind (Just (LeftFrag acc'))
       else loop (lmt-1) ind acc' vec vecacc (unsafeHead rst) (unsafeTail rst)

     -- When we fill one chunk we move to the next:
     | ind >= M.length vec = do
         -- putStrLn$ " [!] Overflow at "++show ind++", next chunk!"
         -- putStr$ show ind ++ " "
         fresh <- M.new (vecSize$ S.length rst) :: IO (M.IOVector nty)
         vec'  <- U.unsafeFreeze vec
         loop lmt 0 acc fresh (vec':vecacc) nxt rst

     | otherwise =
       do M.write vec ind acc
          if lmt == 1
            then closeOff vec vecacc (ind+1) Nothing
            else scanfwd (lmt-1) (ind+1) vec vecacc (unsafeHead rst) (unsafeTail rst)

   scanfwd !lmt !ind !vec !vecacc !nxt !rst
     | digit nxt = loop lmt ind 0 vec vecacc nxt rst -- We've started a number.
     | otherwise = if lmt == 1
                   then closeOff vec vecacc ind Nothing
                   else scanfwd (lmt-1) ind vec vecacc (unsafeHead rst) (unsafeTail rst)

   digit nxt = nxt >= 48 && nxt <= 57

   closeOff vec vecacc ind frag =
     do vec' <- U.unsafeFreeze (M.take ind vec)
        return (reverse (vec':vecacc), frag)

--------------------------------------------------------------------------------
-- Unit Tests
--------------------------------------------------------------------------------

unitTests :: [Test]
unitTests =
  [ TestCase$ assertEqual "t1" (Compound (Just (RightFrag 3 (123::Word))) [U.fromList []] Nothing) =<<
              readNatsPartial (S.take 4 "123 4")
  , TestCase$ assertEqual "t1" (Compound (Just (RightFrag 3 (123::Word))) [U.fromList []] (Just (LeftFrag 4))) =<<
              readNatsPartial (S.take 5 "123 4")
  , TestCase$ assertEqual "t3" (Single (MiddleFrag 3 (123::Word))) =<<
              readNatsPartial (S.take 3 "123")
  , TestCase$ assertEqual "t4" (Single (MiddleFrag 2 (12::Word))) =<<
              readNatsPartial (S.take 2 "123")
  , TestCase$ assertEqual "t5" (Compound Nothing [] (Just (LeftFrag (12::Word32)))) =<<
              readNatsPartial (S.take 3 " 123")

  , TestCase$ assertEqual "t6"
              (Compound (Just (RightFrag 3 23)) [U.fromList [456]] (Just (LeftFrag (78::Word64)))) =<<
              readNatsPartial (S.take 10 "023 456 789")
  ]

---------------------------
-- Bigger, temporary tests:
---------------------------

t0 :: IO [U.Vector Word]
-- t0 = testReadNumFile "/tmp/grid_1000"
-- t0 = testReadNumFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_1000"
t0 = testReadNumFile "1000_nums"

t1 :: IO [U.Vector Word]
-- t1 = testReadNumFile "/tmp/grid_125000"
t1 = testReadNumFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_125000"

t2 :: IO ()
t2 = do t0_ <- getCurrentTime
        ls <- readNumFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_10000000"
        t1_ <- getCurrentTime
        let v :: U.Vector Word
            v = U.concat ls
        putStrLn$ "Resulting vector has length: "++show (U.length v)
        t2_ <- getCurrentTime
        putStrLn$ "Time parsing/reading "++show (diffUTCTime t1_ t0_)++
                  " and coalescing "++show(diffUTCTime t2_ t1_)

-- This one is fast... but WHY?  It should be the same as the hacked 1-chunk parallel versions.
t3 :: IO [PartialNums Word]
t3 = do bs <- unsafeMMapFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_10000000"
        pn <- readNatsPartial bs
        consume [pn]
        return [pn]

-- | Try it with readFile...
t3B :: IO [PartialNums Word]
t3B = do putStrLn "Sequential version + readFile"
         t0_ <- getCurrentTime
         bs <- S.readFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_10000000"
         t1_ <- getCurrentTime
         putStrLn$ "Time to read file sequentially: "++show (diffUTCTime t1_ t0_)
         pn <- readNatsPartial bs
         consume [pn]
         return [pn]

t4 :: IO [PartialNums Word]
t4 = do putStrLn$ "Using parReadNats + readFile"
        t0_ <- getCurrentTime
        bs <- S.readFile "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_10000000"
        t1_ <- getCurrentTime
        putStrLn$ "Time to read file sequentially: "++show (diffUTCTime t1_ t0_)
        pns <- runParIO $ parReadNats 4 bs
        consume pns
        return pns

t5 :: IO ()
t5 = do t0_ <- getCurrentTime
        AdjacencyGraph v1 v2 <- readAdjacencyGraph "../../pbbs/breadthFirstSearch/graphData/data/3Dgrid_J_10000000"
        t1_ <- getCurrentTime
        putStrLn$ "Read adjacency graph in: "++show (diffUTCTime t1_ t0_)
        putStrLn$ " Edges and Verts: "++show (U.length v1, U.length v2)
        return ()

-- Make sure everything is forced
consume :: (Show n, M.Unbox n) => [PartialNums n] -> IO ()
consume ox = do
    evaluate (rnf ox)
    putStrLn$ "Result: "++show (length ox)++" segments of output"
    mapM_ fn ox
  where
  fn (Single (MiddleFrag c x)) = putStrLn$ " <middle frag "++ show (c,x)++">"
  fn (Compound r uvs l) = putStrLn$ " <segment, lengths "++show (map U.length uvs)++", ends "++show(r,l)++">"