text:
package org.apache.asterix.algebra.base;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;

import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.base.Counter;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.StatefulFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.UnnestingFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
import org.apache.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;

public class LogicalExpressionDeepCopyVisitor implements ILogicalExpressionVisitor<ILogicalExpression, Void> {
    private final Counter counter;
    private final Map<LogicalVariable, LogicalVariable> inVarMapping;
    private final Map<LogicalVariable, LogicalVariable> outVarMapping;

    public LogicalExpressionDeepCopyVisitor(Counter counter, Map<LogicalVariable, LogicalVariable> inVarMapping,
            Map<LogicalVariable, LogicalVariable> variableMapping) {
        this.counter = counter;
        this.inVarMapping = inVarMapping;
        this.outVarMapping = variableMapping;
    }

    public ILogicalExpression deepCopy(ILogicalExpression expr) throws AlgebricksException {
        return expr.accept(this, null);
    }

    private void deepCopyAnnotations(AbstractFunctionCallExpression src, AbstractFunctionCallExpression dest) {
        Map<Object, IExpressionAnnotation> srcAnnotations = src.getAnnotations();
        Map<Object, IExpressionAnnotation> destAnnotations = dest.getAnnotations();
        for (Object k : srcAnnotations.keySet()) {
            IExpressionAnnotation annotation = srcAnnotations.get(k).copy();
            destAnnotations.put(k, annotation);
        }
    }

    private void deepCopyOpaqueParameters(AbstractFunctionCallExpression src, AbstractFunctionCallExpression dest) {
        Object[] srcOpaqueParameters = src.getOpaqueParameters();
        Object[] newOpaqueParameters = null;
        if (srcOpaqueParameters != null) {
            newOpaqueParameters = new Object[srcOpaqueParameters.length];
            for (int i = 0; i < srcOpaqueParameters.length; i++) {
                newOpaqueParameters[i] = srcOpaqueParameters[i];
            }
        }
        dest.setOpaqueParameters(newOpaqueParameters);
    }

    public MutableObject<ILogicalExpression> deepCopyExpressionReference(Mutable<ILogicalExpression> exprRef)
            throws AlgebricksException {
        return new MutableObject<ILogicalExpression>(deepCopy(exprRef.getValue()));
    }

    // TODO return List<...>
    public ArrayList<Mutable<ILogicalExpression>> deepCopyExpressionReferenceList(
            List<Mutable<ILogicalExpression>> list) throws AlgebricksException {
        ArrayList<Mutable<ILogicalExpression>> listCopy = new ArrayList<Mutable<ILogicalExpression>>(list.size());
        for (Mutable<ILogicalExpression> exprRef : list) {
            listCopy.add(deepCopyExpressionReference(exprRef));
        }
        return listCopy;
    }

    @Override
    public ILogicalExpression visitAggregateFunctionCallExpression(AggregateFunctionCallExpression expr, Void arg)
            throws AlgebricksException {
        AggregateFunctionCallExpression exprCopy = new AggregateFunctionCallExpression(expr.getFunctionInfo(),
                expr.isTwoStep(), deepCopyExpressionReferenceList(expr.getArguments()));
        deepCopyAnnotations(expr, exprCopy);
        deepCopyOpaqueParameters(expr, exprCopy);
        return exprCopy;
    }

    @Override
    public ILogicalExpression visitConstantExpression(ConstantExpression expr, Void arg) throws AlgebricksException {
        return new ConstantExpression(expr.getValue());
    }

    @Override
    public ILogicalExpression visitScalarFunctionCallExpression(ScalarFunctionCallExpression expr, Void arg)
            throws AlgebricksException {
        ScalarFunctionCallExpression exprCopy = new ScalarFunctionCallExpression(expr.getFunctionInfo(),
                deepCopyExpressionReferenceList(expr.getArguments()));
        deepCopyAnnotations(expr, exprCopy);
        deepCopyOpaqueParameters(expr, exprCopy);
        return exprCopy;

    }

    @Override
    public ILogicalExpression visitStatefulFunctionCallExpression(StatefulFunctionCallExpression expr, Void arg)
            throws AlgebricksException {
        throw new UnsupportedOperationException();
    }

    @Override
    public ILogicalExpression visitUnnestingFunctionCallExpression(UnnestingFunctionCallExpression expr, Void arg)
            throws AlgebricksException {
        UnnestingFunctionCallExpression exprCopy = new UnnestingFunctionCallExpression(expr.getFunctionInfo(),
                deepCopyExpressionReferenceList(expr.getArguments()));
        deepCopyAnnotations(expr, exprCopy);
        deepCopyOpaqueParameters(expr, exprCopy);
        return exprCopy;
    }

    @Override
    public ILogicalExpression visitVariableReferenceExpression(VariableReferenceExpression expr, Void arg)
            throws AlgebricksException {
        LogicalVariable var = expr.getVariableReference();
        LogicalVariable givenVarReplacement = inVarMapping.get(var);
        if (givenVarReplacement != null) {
            outVarMapping.put(var, givenVarReplacement);
            return new VariableReferenceExpression(givenVarReplacement);
        }
        LogicalVariable varCopy = outVarMapping.get(var);
        if (varCopy == null) {
            counter.inc();
            varCopy = new LogicalVariable(counter.get());
            outVarMapping.put(var, varCopy);
        }
        return new VariableReferenceExpression(varCopy);
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace node {

using v8::Context;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Local;
using v8::Object;
using v8::Value;

void HandleWrap::Ref(const FunctionCallbackInfo<Value>& args) {
  HandleWrap* wrap;
  ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());

  if (IsAlive(wrap))
    uv_ref(wrap->GetHandle());
}

void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args) {
  HandleWrap* wrap;
  ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());

  if (IsAlive(wrap))
    uv_unref(wrap->GetHandle());
}

void HandleWrap::HasRef(const FunctionCallbackInfo<Value>& args) {
  HandleWrap* wrap;
  ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
  args.GetReturnValue().Set(HasRef(wrap));
}

void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
  Environment* env = Environment::GetCurrent(args);

  HandleWrap* wrap;
  ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());

  // Guard against uninitialized handle or double close.
  if (!IsAlive(wrap))
    return;

  if (wrap->state_ != kInitialized)
    return;

  CHECK_EQ(false, wrap->persistent().IsEmpty());
  uv_close(wrap->handle_, OnClose);
  wrap->state_ = kClosing;

  if (args[0]->IsFunction()) {
    wrap->object()->Set(env->onclose_string(), args[0]);
    wrap->state_ = kClosingWithCallback;
  }
}

HandleWrap::HandleWrap(Environment* env,
                       Local<Object> object,
                       uv_handle_t* handle,
                       AsyncWrap::ProviderType provider)
    : AsyncWrap(env, object, provider),
      state_(kInitialized),
      handle_(handle) {
  handle_->data = this;
  HandleScope scope(env->isolate());
  env->handle_wrap_queue()->PushBack(this);
}

void HandleWrap::OnClose(uv_handle_t* handle) {
  HandleWrap* wrap = static_cast<HandleWrap*>(handle->data);
  Environment* env = wrap->env();
  HandleScope scope(env->isolate());
  Context::Scope context_scope(env->context());

  // The wrap object should still be there.
  CHECK_EQ(wrap->persistent().IsEmpty(), false);
  CHECK(wrap->state_ >= kClosing && wrap->state_ <= kClosingWithCallback);

  const bool have_close_callback = (wrap->state_ == kClosingWithCallback);
  wrap->state_ = kClosed;

  if (have_close_callback)
    wrap->MakeCallback(env->onclose_string(), 0, nullptr);

  delete wrap;
}

}  // namespace node


text:
module DTK; class ConfigAgent
  class Adapter::Puppet
    class ExternalDependency
      class ParsedForm < Hash
        # TODO: stub to put in logic about matching versions now in
        # server/application/model/module/module/dsl_mixin/external_refs.rb
      end

      def parsed_form?
        @parsed_dependency
      end

      def initialize(name, version_constraints_string)
        @name = name
        @version_constraints_string = version_constraints_string
        @parsed_dependency = nil
        # added protection in case we get unexpected form
        begin
          @parsed_dependency = ParsedForm.new.merge(
            name: name,
            version_constraints: parse_constraints_string(version_constraints_string)
          )
         rescue Exception => e
          Log.error("error parsing version constraints string: #{version_constraints_string}")
          Log.error_pp([e, e.backtrace[0..5]])
        end
      end

      private

      # TODO: too many restrictions; such as that version nums can only be single digit
      def parse_constraints_string(versions_string)
        ret = []
        return ret if versions_string.nil?
        rest_string = parse_one_constraint!(ret, versions_string)
        if rest_string
          parse_one_constraint!(ret, rest_string)
        end
        ret
      end

      ConstraintRegex1 = /^\s*([>=<]+)\s*(\d\.*\d*\.*\d*)\s*(.*$)/
      ConstraintRegex2 = /^\s*(\d)\.x\s*$/
      # returns rest of string after parsing
      # :rest, :match, which has keys :version, :constraint
      def parse_one_constraint!(ret, versions_string)
        rest_string = nil
        if match = versions_string.match(ConstraintRegex1)
          ret << { version: normalize_to_three_parts(match[2]), constraint: match[1] }
          rest_string =  match[3] unless match[3].empty?
        elsif match = versions_string.match(ConstraintRegex2)
          ret << { version: normalize_to_three_parts(match[1]), constraint: '>=' }
          ret << { version: normalize_to_three_parts(match[1].to_i + 1), constraint: '<' }
        else
          fail Error.new("error parsing version constraints string: #{versions_string})")
        end
        rest_string
      end

      # TODO: assumption that version has form
      # x.y.z, x.y, or x
      ThreeParts = /\d\.\d\.\d/
      TwoParts = /\d\.\d/
      def normalize_to_three_parts(version)
        if version.is_a?(Fixnum)
          "#{version}.0.0"
        elsif version =~ ThreeParts
          version
        elsif version =~ TwoParts
          "#{version}.0"
        else
          "#{version}.0.0"
        end
      end
    end
  end
end; end


text:
package com.cubolabs.bibliaofflinearc.ui;

import android.text.Html;
import android.text.Spanned;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Tag;
import org.jsoup.select.Elements;

public class HtmlUtils {
    public static String SmallCapitalize(String htmlText) {
        Document doc = Jsoup.parse(htmlText);
        Elements smallcaps = doc.select("[style~=small-caps]");
        for(Element el: smallcaps) {
            String html = String.format("%s<small>%s</small>",
                    el.text().charAt(0),
                    el.text().substring(1).toUpperCase());
            Element span = new Element(Tag.valueOf("span"), "");
            span.html(html);

            el.replaceWith(span);
        }
        return doc.body().html();
    }

    public static Spanned Smallcaps(String htmlText) {
        return Html.fromHtml(SmallCapitalize(htmlText));
    }
}


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m141222_063039_create_group_activity_table extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }

        $this->createTable('{{%group_activity}}', [
            'id' => Schema::TYPE_PK,
            'group_id' => Schema::TYPE_INTEGER . ' NOT NULL',
            'activity_type_id' => Schema::TYPE_INTEGER . ' NOT NULL',
            'course_id' => Schema::TYPE_INTEGER . ' NOT NULL',
            'instructor_id' => Schema::TYPE_INTEGER . ' NOT NULL',
            'subgroup' => Schema::TYPE_BOOLEAN . ' NULL',
        ], $tableOptions);

        $this->addForeignKey('FK_group_activity_group', '{{%group_activity}}', 'group_id', '{{%group}}', 'id', 'RESTRICT', 'RESTRICT');
        $this->addForeignKey('FK_group_activity_activity_type', '{{%group_activity}}', 'activity_type_id', '{{%activity_type}}', 'id', 'RESTRICT', 'RESTRICT');
        $this->addForeignKey('FK_group_activity_course', '{{%group_activity}}', 'course_id', '{{%course}}', 'id', 'RESTRICT', 'RESTRICT');
        $this->addForeignKey('FK_group_activity_instructor', '{{%group_activity}}', 'instructor_id', '{{%instructor}}', 'id', 'RESTRICT', 'RESTRICT');
    }

    public function down()
    {
        $this->dropForeignKey('FK_group_activity_group', '{{%group_activity}}');
        $this->dropForeignKey('FK_group_activity_activity_type', '{{%group_activity}}');
        $this->dropForeignKey('FK_group_activity_course', '{{%group_activity}}');
        $this->dropForeignKey('FK_group_activity_instructor', '{{%group_activity}}');

        $this->dropTable('{{%group_activity}}');
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WUnderground.Client.Models
{
    public class Features
    {
        public int geolookup { get; set; }
        public int conditions { get; set; }
        public int forecast { get; set; }
        public int hourly { get; set; }
    }

    public class ResponseMetadata
    {
        public string version { get; set; }
        public string termsofService { get; set; }
        public Features features { get; set; }
        public Error error { get; set; }
    }

    public class Error
    {
        public string type { get; set; }
        public string description { get; set; }
    }

    public class Station
    {
        public string city { get; set; }
        public string state { get; set; }
        public string country { get; set; }
        public string icao { get; set; }
        public string lat { get; set; }
        public string lon { get; set; }
        public string neighborhood { get; set; }
        public string id { get; set; }
        public int distance_km { get; set; }
        public int distance_mi { get; set; }
    }

    public class Airport
    {
        public List<Station> station { get; set; }
    }

    public class Pws
    {
        public List<Station> station { get; set; }
    }

    public class NearbyWeatherStations
    {
        public Airport airport { get; set; }
        public Pws pws { get; set; }
    }

    public class Location
    {
        public string type { get; set; }
        public string country { get; set; }
        public string country_iso3166 { get; set; }
        public string country_name { get; set; }
        public string state { get; set; }
        public string city { get; set; }
        public string tz_short { get; set; }
        public string tz_long { get; set; }
        public string lat { get; set; }
        public string lon { get; set; }
        public string zip { get; set; }
        public string magic { get; set; }
        public string wmo { get; set; }
        public string l { get; set; }
        public string requesturl { get; set; }
        public string wuiurl { get; set; }
        public NearbyWeatherStations nearby_weather_stations { get; set; }
    }

    public class Image
    {
        public string url { get; set; }
        public string title { get; set; }
        public string link { get; set; }
    }

    public class DisplayLocation
    {
        public string full { get; set; }
        public string city { get; set; }
        public string state { get; set; }
        public string state_name { get; set; }
        public string country { get; set; }
        public string country_iso3166 { get; set; }
        public string zip { get; set; }
        public string magic { get; set; }
        public string wmo { get; set; }
        public string latitude { get; set; }
        public string longitude { get; set; }
        public string elevation { get; set; }
    }

    public class ObservationLocation
    {
        public string full { get; set; }
        public string city { get; set; }
        public string state { get; set; }
        public string country { get; set; }
        public string country_iso3166 { get; set; }
        public string latitude { get; set; }
        public string longitude { get; set; }
        public string elevation { get; set; }
    }

    public class Estimated
    {
    }

    public class CurrentObservation
    {
        public Image image { get; set; }
        public DisplayLocation display_location { get; set; }
        public ObservationLocation observation_location { get; set; }
        public Estimated estimated { get; set; }
        public string station_id { get; set; }
        public string observation_time { get; set; }
        public string observation_time_rfc822 { get; set; }
        public string observation_epoch { get; set; }
        public string local_time_rfc822 { get; set; }
        public string local_epoch { get; set; }
        public string local_tz_short { get; set; }
        public string local_tz_long { get; set; }
        public string local_tz_offset { get; set; }
        public string weather { get; set; }
        public string temperature_string { get; set; }
        public double temp_f { get; set; }
        public double temp_c { get; set; }
        public string relative_humidity { get; set; }
        public string wind_string { get; set; }
        public string wind_dir { get; set; }
        public int wind_degrees { get; set; }
        public double wind_mph { get; set; }
        public string wind_gust_mph { get; set; }
        public double wind_kph { get; set; }
        public string wind_gust_kph { get; set; }
        public string pressure_mb { get; set; }
        public string pressure_in { get; set; }
        public string pressure_trend { get; set; }
        public string dewpoint_string { get; set; }
        public int dewpoint_f { get; set; }
        public int dewpoint_c { get; set; }
        public string heat_index_string { get; set; }
        public string heat_index_f { get; set; }
        public string heat_index_c { get; set; }
        public string windchill_string { get; set; }
        public string windchill_f { get; set; }
        public string windchill_c { get; set; }
        public string feelslike_string { get; set; }
        public string feelslike_f { get; set; }
        public string feelslike_c { get; set; }
        public string visibility_mi { get; set; }
        public string visibility_km { get; set; }
        public string solarradiation { get; set; }
        public string UV { get; set; }
        public string precip_1hr_string { get; set; }
        public string precip_1hr_in { get; set; }
        public string precip_1hr_metric { get; set; }
        public string precip_today_string { get; set; }
        public string precip_today_in { get; set; }
        public string precip_today_metric { get; set; }
        public string icon { get; set; }
        public string icon_url { get; set; }
        public string forecast_url { get; set; }
        public string history_url { get; set; }
        public string ob_url { get; set; }
        public string nowcast { get; set; }
    }

    public class Forecastday
    {
        public int period { get; set; }
        public string icon { get; set; }
        public string icon_url { get; set; }
        public string title { get; set; }
        public string fcttext { get; set; }
        public string fcttext_metric { get; set; }
        public string pop { get; set; }
        public Date date { get; set; }
        public Temperature high { get; set; }
        public Temperature low { get; set; }
        public string conditions { get; set; }
        public string skyicon { get; set; }
        public Precipitation qpf_allday { get; set; }
        public Precipitation qpf_day { get; set; }
        public Precipitation qpf_night { get; set; }
        public Precipitation snow_allday { get; set; }
        public Precipitation snow_day { get; set; }
        public Precipitation snow_night { get; set; }
        public Wind maxwind { get; set; }
        public Wind avewind { get; set; }
        public int avehumidity { get; set; }
        public int maxhumidity { get; set; }
        public int minhumidity { get; set; }
    }

    public class HourlyForecast
    {
        public Time FCTTIME { get; set; }
        public TemperatureOrPrecipitation temp { get; set; }
        public TemperatureOrPrecipitation dewpoint { get; set; }
        public string condition { get; set; }
        public string icon { get; set; }
        public string icon_url { get; set; }
        public string fctcode { get; set; }
        public string sky { get; set; }
        public TemperatureOrPrecipitation wspd { get; set; }
        public WindDirection wdir { get; set; }
        public string wx { get; set; }
        public string uvi { get; set; }
        public string humidity { get; set; }
        public TemperatureOrPrecipitation windchill { get; set; }
        public TemperatureOrPrecipitation heatindex { get; set; }
        public TemperatureOrPrecipitation feelslike { get; set; }
        public TemperatureOrPrecipitation qpf { get; set; }
        public TemperatureOrPrecipitation snow { get; set; }
        public string pop { get; set; }
        public TemperatureOrPrecipitation mslp { get; set; }
    }

    public class TxtForecast
    {
        public string date { get; set; }
        public List<Forecastday> forecastday { get; set; }
    }

    public class Time
    {
        public string hour { get; set; }
        public string hour_padded { get; set; }
        public string min { get; set; }
        public string min_unpadded { get; set; }
        public string sec { get; set; }
        public string year { get; set; }
        public string mon { get; set; }
        public string mon_padded { get; set; }
        public string mon_abbrev { get; set; }
        public string mday { get; set; }
        public string mday_padded { get; set; }
        public string yday { get; set; }
        public string isdst { get; set; }
        public string epoch { get; set; }
        public string pretty { get; set; }
        public string civil { get; set; }
        public string month_name { get; set; }
        public string month_name_abbrev { get; set; }
        public string weekday_name { get; set; }
        public string weekday_name_night { get; set; }
        public string weekday_name_abbrev { get; set; }
        public string weekday_name_unlang { get; set; }
        public string weekday_name_night_unlang { get; set; }
        public string ampm { get; set; }
        public string tz { get; set; }
        public string age { get; set; }
        public string UTCDATE { get; set; }
    }

    public class Date
    {
        public string epoch { get; set; }
        public string pretty { get; set; }
        public int mday { get; set; }
        public int mon { get; set; }
        public int year { get; set; }
        public int yday { get; set; }
        public int hour { get; set; }
        public int min { get; set; }
        public int sec { get; set; }
        public string isdst { get; set; }
        public string monthname { get; set; }
        public string monthname_short { get; set; }
        public string weekday_short { get; set; }
        public string weekday { get; set; }
        public string ampm { get; set; }
        public string tz_short { get; set; }
        public string tz_long { get; set; }
    }

    public class Temperature
    {
        public string fahrenheit { get; set; }
        public string celsius { get; set; }
    }

    public class TemperatureOrPrecipitation
    {
        public string english { get; set; }
        public string metric { get; set; }
    }

    public class Precipitation
    {
        public double? @in { get; set; }
        public double? mm { get; set; }
    }

    public class WindDirection
    {
        public string dir { get; set; }
        public string degrees { get; set; }
    }

    public class Wind
    {
        public double mph { get; set; }
        public double kph { get; set; }
        public string dir { get; set; }
        public double degrees { get; set; }
    }

    public class Simpleforecast
    {
        public List<Forecastday> forecastday { get; set; }
    }

    public class Forecast
    {
        public TxtForecast txt_forecast { get; set; }
        public Simpleforecast simpleforecast { get; set; }
    }

    public class WeatherResponse
    {
        public ResponseMetadata response { get; set; }
        public Location location { get; set; }
        public CurrentObservation current_observation { get; set; }
        public Forecast forecast { get; set; }
        public List<HourlyForecast> hourly_forecast { get; set; }
        public History history { get; set; }
    }

    public class History
    {
        public Date date { get; set; }
        public Date utcdate { get; set; }
        public List<Observation> observations { get; set; }
        public List<DailySummary> dailysummary { get; set; }
    }

    public class Observation
    {
        public Date date { get; set; }
        public Date utcdate { get; set; }
        public double? tempm { get; set; }
        public double? tempi { get; set; }
        public double? dewptm { get; set; }
        public double? dewpti { get; set; }
        public int hum { get; set; }
        public double? wspdm { get; set; }
        public double? wspdi { get; set; }
        public double? wgustm { get; set; }
        public double? wgusti { get; set; }
        public int wdird { get; set; }
        public string wdire { get; set; }
        public double? vism { get; set; }
        public double? visi { get; set; }
        public double? pressurem { get; set; }
        public double? pressurei { get; set; }
        public double? windchillm { get; set; }
        public double? windchilli { get; set; }
        public double? heatindexm { get; set; }
        public double? heatindexi { get; set; }
        public double? precipm { get; set; }
        public double? precipi { get; set; }
        public string conds { get; set; }
        public string icon { get; set; }
        public int fog { get; set; }
        public int rain { get; set; }
        public int snow { get; set; }
        public int hail { get; set; }
        public int thunder { get; set; }
        public int tornado { get; set; }
        public string metar { get; set; }

        public DateTime dateTime
        {
            get { return new DateTime(utcdate.year, utcdate.mon, utcdate.mday, utcdate.hour, utcdate.min,utcdate.sec); }
        }
    }

    public class DailySummary
    {
        public Date date { get; set; }
        public int fog { get; set; }
        public int rain { get; set; }
        public int snow { get; set; }
        public double? snowfallm { get; set; }
        public double? snowfalli { get; set; }
        public double? monthtodatesnowfallm { get; set; }
        public double? monthtodatesnowfalli { get; set; }
        public double? since1julsnowfallm { get; set; }
        public double? since1julsnowfalli { get; set; }
        public double? snowdepthm { get; set; }
        public double? snowdepthi { get; set; }
        public int hail { get; set; }
        public int thunder { get; set; }
        public int tornado { get; set; }
        public double? meantempm { get; set; }
        public double? meantempi { get; set; }
        public double? meandewptm { get; set; }
        public double? meandewpti { get; set; }
        public double? meanpressurem { get; set; }
        public double? meanpressurei { get; set; }
        public double? meanwindspdm { get; set; }
        public double? meanwindspdi { get; set; }
        public string meanwdire { get; set; }
        public double? meanwdird { get; set; }
        public double? meanvism { get; set; }
        public double? meanvisi { get; set; }
        public double? humidity { get; set; }
        public double? maxtempm { get; set; }
        public double? maxtempi { get; set; }
        public double? mintempm { get; set; }
        public double? mintempi { get; set; }
        public double? maxhumidity { get; set; }
        public double? minhumidity { get; set; }
        public double? maxdewptm { get; set; }
        public double? maxdewpti { get; set; }
        public double? mindewptm { get; set; }
        public double? mindewpti { get; set; }
        public double? maxpressurem { get; set; }
        public double? maxpressurei { get; set; }
        public double? minpressurem { get; set; }
        public double? minpressurei { get; set; }
        public double? maxwspdm { get; set; }
        public double? maxwspdi { get; set; }
        public double? minwspdm { get; set; }
        public double? minwspdi { get; set; }
        public double? maxvism { get; set; }
        public double? maxvisi { get; set; }
        public double? minvism { get; set; }
        public double? minvisi { get; set; }
        public double? gdegreedays { get; set; }
        public double? heatingdegreedays { get; set; }
        public double? coolingdegreedays { get; set; }
        public double? precipm { get; set; }
        public double? precipi { get; set; }
        public string precipsource { get; set; }
        public int? heatingdegreedaysnormal { get; set; }
        public int? monthtodateheatingdegreedays { get; set; }
        public int? monthtodateheatingdegreedaysnormal { get; set; }
        public int? since1sepheatingdegreedays { get; set; }
        public int? since1sepheatingdegreedaysnormal { get; set; }
        public int? since1julheatingdegreedays { get; set; }
        public int? since1julheatingdegreedaysnormal { get; set; }
        public int? coolingdegreedaysnormal { get; set; }
        public int? monthtodatecoolingdegreedays { get; set; }
        public int? monthtodatecoolingdegreedaysnormal { get; set; }
        public int? since1sepcoolingdegreedays { get; set; }
        public int? since1sepcoolingdegreedaysnormal { get; set; }
        public int? since1jancoolingdegreedays { get; set; }
        public int? since1jancoolingdegreedaysnormal { get; set; }
    }
}


text:
The class is defined in **[StringParameterValue.java](../../src/main/java/org/openapitools/model/StringParameterValue.java)**

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**propertyClass** | `String` |  |  [optional property]
**name** | `String` |  |  [optional property]
**value** | `String` |  |  [optional property]


text:
TStringGenerator
================

A command line tool to generate translation tables for FreeSpace 2.


text:
#ifndef _ANDROID_SKIN_KEYSET_H_
#define _ANDROID_SKIN_KEYSET_H_

#include "android/config.h"

/* A SkinKeySet maps keystrokes to specific commands. we have a few hard-coded
 * keysets in the emulator binary, and the user can define its own if he wants
 * to...
 */
typedef struct SkinKeyset  SkinKeyset;

#define  SKIN_KEY_COMMAND_LIST                  \
    _SKIN_KEY_COMMAND(NONE,"no key")            \
    _SKIN_KEY_COMMAND(BUTTON_HOME,"Home button")              \
    _SKIN_KEY_COMMAND(BUTTON_MENU,"Menu (Soft-Left) button")   \
    _SKIN_KEY_COMMAND(BUTTON_STAR,"Star (Soft-Right) button")  \
    _SKIN_KEY_COMMAND(BUTTON_BACK,"Back button")              \
    _SKIN_KEY_COMMAND(BUTTON_CALL,"Call/Dial button")              \
    _SKIN_KEY_COMMAND(BUTTON_HANGUP,"Hangup/EndCall button")            \
    _SKIN_KEY_COMMAND(BUTTON_POWER,"Power button")             \
    _SKIN_KEY_COMMAND(BUTTON_SEARCH,"Search button")            \
    _SKIN_KEY_COMMAND(BUTTON_VOLUME_UP,"Volume up button")         \
    _SKIN_KEY_COMMAND(BUTTON_VOLUME_DOWN,"Volume down button")       \
    _SKIN_KEY_COMMAND(BUTTON_CAMERA,"Camera button")            \
    _SKIN_KEY_COMMAND(CHANGE_LAYOUT_PREV,"Switch to previous layout")       \
    _SKIN_KEY_COMMAND(CHANGE_LAYOUT_NEXT,"Switch to next layout")       \
    _SKIN_KEY_COMMAND(TOGGLE_NETWORK,"Toggle cell network on/off")           \
    _SKIN_KEY_COMMAND(TOGGLE_TRACING,"Toggle code profiling")           \
    _SKIN_KEY_COMMAND(TOGGLE_FULLSCREEN,"Toggle fullscreen mode")        \
    _SKIN_KEY_COMMAND(TOGGLE_TRACKBALL,"Toggle trackball mode")         \
    _SKIN_KEY_COMMAND(SHOW_TRACKBALL,"Show trackball") \
    _SKIN_KEY_COMMAND(BUTTON_DPAD_CENTER,"DPad center")       \
    _SKIN_KEY_COMMAND(BUTTON_DPAD_LEFT,"DPad left") \
    _SKIN_KEY_COMMAND(BUTTON_DPAD_RIGHT,"DPad right")        \
    _SKIN_KEY_COMMAND(BUTTON_DPAD_UP,"DPad up")           \
    _SKIN_KEY_COMMAND(BUTTON_DPAD_DOWN,"DPad down")         \
    _SKIN_KEY_COMMAND(ONION_ALPHA_UP,"Increase onion alpha")           \
    _SKIN_KEY_COMMAND(ONION_ALPHA_DOWN,"Decrease onion alpha")         \
    _SKIN_KEY_COMMAND(BUTTON_TV,"TV button")         \
    _SKIN_KEY_COMMAND(BUTTON_EPG,"EPG button")         \
    _SKIN_KEY_COMMAND(BUTTON_DVR,"DVR button")         \
    _SKIN_KEY_COMMAND(BUTTON_PREV,"Previous button")         \
    _SKIN_KEY_COMMAND(BUTTON_NEXT,"Next button")         \
    _SKIN_KEY_COMMAND(BUTTON_PLAY,"Play button")         \
    _SKIN_KEY_COMMAND(BUTTON_PAUSE,"Pause button")         \
    _SKIN_KEY_COMMAND(BUTTON_STOP,"Stop button")         \
    _SKIN_KEY_COMMAND(BUTTON_REWIND,"Rewind button")         \
    _SKIN_KEY_COMMAND(BUTTON_FFWD,"Fast forward button")         \
    _SKIN_KEY_COMMAND(BUTTON_BOOKMARKS,"Bookmarks button")         \
    _SKIN_KEY_COMMAND(BUTTON_WINDOW,"Window button")         \
    _SKIN_KEY_COMMAND(BUTTON_CHANNELUP,"Channel up button")         \
    _SKIN_KEY_COMMAND(BUTTON_CHANNELDOWN,"Channel down button")         \

/* the list of commands in the emulator */
#define _SKIN_KEY_COMMAND(x,y)  SKIN_KEY_COMMAND_##x,
typedef enum {
    SKIN_KEY_COMMAND_LIST
    SKIN_KEY_COMMAND_MAX  // do not remove
} SkinKeyCommand;
#undef _SKIN_KEY_COMMAND

/* retrieve the textual name of a given command, this is the command name without
 * the "SKIN_KEY_COMMAND_" prefix. returns NULL if command is NONE or invalid
 * the result is a static constant string that must not be freed
 */
extern const char*      skin_key_command_to_str  ( SkinKeyCommand  command );

/* convert a string into a SkinKeyCommand. returns SKIN_COMMAND_NONE if the string
 * is unknown
 */
extern SkinKeyCommand   skin_key_command_from_str( const char*  str, int  len );

/* returns a short human-friendly description of the command */
extern const char*      skin_key_command_description( SkinKeyCommand  cmd );

/* returns the number of keysym string descriptors */
extern int              skin_keysym_str_count( void );

/* return the n-th keysym string descriptor */
extern const char*      skin_keysym_str( int  index );

/* convert a (sym,mod) pair into a descriptive string. e.g. "Ctrl-K" or "Alt-A", etc..
 * result is a static string that is overwritten on each call
 */
extern const char*      skin_key_symmod_to_str   ( int  sym, int  mod );

/* convert a key binding description into a (sym,mod) pair. returns 0 on success, -1
 * if the string cannot be parsed.
 */
extern int              skin_key_symmod_from_str ( const char*  str, int  *psym, int  *pmod );

/* create a new keyset from a configuration tree node */
extern SkinKeyset*      skin_keyset_new ( AConfig*  root );
extern SkinKeyset*      skin_keyset_new_from_text( const char*  text );

/* destroy a given keyset */
extern void             skin_keyset_free( SkinKeyset*  kset );

/* maximum number of key bindings per command. one command can be bound to several
 * key bindings for convenience
 */
#define  SKIN_KEY_COMMAND_MAX_BINDINGS  3

/* a structure that describe a key binding */
typedef struct {
    int  sym;   // really a SDL key symbol
    int  mod;   // really a SDL key modifier
} SkinKeyBinding;

/* return the number of keyboard bindings for a given command. results are placed in the 'bindings' array
 * which must have at least SKIN_KEY_MAX_BINDINGS items */
extern int              skin_keyset_get_bindings( SkinKeyset*      kset,
                                                  SkinKeyCommand   command,
                                                  SkinKeyBinding*  bindings );

/* return the command for a given keypress - SKIN_KEY_COMMAND_NONE is returned if unknown */
extern SkinKeyCommand   skin_keyset_get_command( SkinKeyset*  kset, int  sym, int  mod );

extern const char*      skin_keyset_get_default( void );

/* in android_main.c */
extern SkinKeyset*      android_keyset;

#endif /* _ANDROID_SKIN_KEYSET_H_ */


text:
import PropTypes from 'prop-types';
import { createElement, PureComponent } from 'react';
import { findDOMNode } from 'react-dom';
import cx from 'classnames';

import omit from 'boundless-utils-omit-keys';

const instances = [];

function toI(stringNumber) {
    return parseInt(stringNumber, 10);
}

function rescale(instance) {
    const node = findDOMNode(instance);
    const containerBox = window.getComputedStyle(node.parentNode);
    const fontSize = toI(window.getComputedStyle(node).fontSize);

    if (instance.baseFontSize === null) {
        instance.baseFontSize = fontSize;
    }

    let containerHeight = toI(containerBox.height);
    let containerWidth = toI(containerBox.width);

    // need to account for padding
    if (containerBox.boxSizing === 'border-box' || containerBox.boxSizing === 'padding-box') {
        containerHeight -= toI(containerBox.paddingTop) + toI(containerBox.paddingBottom);
        containerWidth -= toI(containerBox.paddingLeft) + toI(containerBox.paddingRight);
    }

    const optimizeForHeight = Math.floor((fontSize / node.offsetHeight) * containerHeight);
    const optimizeForWidth = Math.floor((fontSize / node.offsetWidth) * containerWidth);

    // if upscaling is allowed, that changes the math a bit
    if (instance.props.upscale) {
        node.style.fontSize = (Math.max(optimizeForHeight, optimizeForWidth) || 1) + 'px';
    } else {
        node.style.fontSize = (Math.min(instance.baseFontSize, optimizeForHeight, optimizeForWidth) || 1) + 'px';
    }
}

function handleWindowResize() {
    instances.forEach((instance) => rescale(instance));
}

function registerInstance(instance) {
    if (instances.length === 0) {
        window.addEventListener('resize', handleWindowResize, true);
    }

    instances.push(instance);
}

function unregisterInstance(instance) {
    instances.splice(instances.indexOf(instance), 1);

    if (instances.length === 0) {
        window.removeEventListener('resize', handleWindowResize, true);
    }
}

/**
This component can be useful in situations where an internationalized string is being placed into the UI and it's unclear if all variations of it will fit without excessive amounts of edge-case CSS. Ultimately, it's good at making sure what you put in doesn't overflow.
 */
export default class FittedText extends PureComponent {
    static propTypes = {
        /**
         * any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes)
         */
        '*': PropTypes.any,

        /**
         * any valid HTML tag name
         */
        component: PropTypes.string,

        /**
         * controls if FittedText will automatically scale up the content to fit the available space; normally the component
         * only scales text down as needed to fit
         */
        upscale: PropTypes.bool,
    }

    static defaultProps = {
        component: 'span',
        upscale: false,
    }

    static internalKeys = Object.keys(FittedText.defaultProps)

    // set during the first rescale() run
    baseFontSize = null

    componentDidMount() {
        rescale(this);

        // there are likely to be multiple instances of this component on a page, so it makes sense to just use
        // a shared global resize listener instead of each component having its own
        registerInstance(this);
    }

    componentDidUpdate() {
        rescale(this);
    }

    componentWillUnmount() {
        unregisterInstance(this);
    }

    render() {
        return (
            <this.props.component
                {...omit(this.props, FittedText.internalKeys)}
                className={cx('b-text', this.props.className)}>
                {this.props.children}
            </this.props.component>
        );
    }
}


text:
using System.Globalization;
using System.Numerics;
using System.Runtime.InteropServices;

namespace SilentHunter
{
	/// <summary>
	/// A special kind of vector that represents XZ.
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	// TODO: this was originally introduced because of VertexStartPosition and some conversions were needed for S3D. Investigate if we can move this to Controller templates instead.
	// ReSharper disable once InconsistentNaming
	public struct Vector2XZ
	{
		/// <summary>
		/// Gets or sets the X component.
		/// </summary>
		public float X;

		/// <summary>
		/// Gets or sets the Y component.
		/// </summary>
		public float Z;

		/// <inheritdoc />
		public override string ToString()
		{
			return string.Format("X: {1}{0} Z: {2}", CultureInfo.CurrentUICulture.TextInfo.ListSeparator, X, Z);
		}

		/// <summary>
		/// </summary>
		public static implicit operator Vector2(Vector2XZ v)
		{
			return new Vector2
			{
				X = v.X,
				Y = v.Z
			};
		}

		/// <summary>
		/// </summary>
		public static implicit operator Vector2XZ(Vector2 v)
		{
			return new Vector2XZ
			{
				X = v.X,
				Z = v.Y
			};
		}

		/// <summary>Determines whether the specified object is equal to the current object.</summary>
		/// <param name="other">The other to compare with the current object.</param>
		/// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
		public bool Equals(Vector2XZ other)
		{
			return X.Equals(other.X) && Z.Equals(other.Z);
		}

		/// <inheritdoc />
		public override bool Equals(object obj)
		{
			return obj is Vector2XZ vector && Equals(vector);
		}

		/// <inheritdoc />
		public override int GetHashCode()
		{
			unchecked
			{
				// ReSharper disable NonReadonlyMemberInGetHashCode
				int hashCode = X.GetHashCode();
				hashCode = (hashCode * 397) ^ Z.GetHashCode();
				// ReSharper restore NonReadonlyMemberInGetHashCode
				return hashCode;
			}
		}

		/// <summary>
		/// Checks for equality.
		/// </summary>
		public static bool operator ==(Vector2XZ left, Vector2XZ right)
		{
			return left.Equals(right);
		}

		/// <summary>
		/// Checks for inequality.
		/// </summary>
		public static bool operator !=(Vector2XZ left, Vector2XZ right)
		{
			return !left.Equals(right);
		}
	}
}


text:
Module for monitoring twin cities lightrail

## install ##
    git clone https://github.com/kjschiroo/lightrail.git
    cd lightrail
    python3 setup.py install

## usage ##
List station codes

    python3 -m lightrail.cmdline -l

Monitor lightrail station

    python3 -m lightrail.cmdline [-x] [-b] <station_code>


text:
import ATV from 'atvjs';
import template from './template.hbs';
import API from 'lib/api';

var MoviesPage = ATV.Page.create({
    name: 'movies',
    url: API.discoverMovies,
    template: template
});

export default MoviesPage;


text:
<!DOCTYPE html>

		<audio id="theAudio"></audio>
		<button id="recordBtn">Record</button>
		<button id="stopRecBtn">Stop Rec</button>
		<button id="playBtn">Play</button>
		<button id="pauseBtn">Pause</button>

Status:


text:
#knplabs-translator-container {
  position: absolute;
  margin: 0;
  padding: 1px 0px;
  right: 0px;

  opacity: 0.80;
  filter: alpha(opacity : 80);

  z-index: 10000;
  white-space: nowrap;
}

#knplabs-translator-container[id] {
  /*position: fixed;*/
}

#knplabs-translator-container .translator-form {
  padding: 0px 10px 0px 10px;
  background-color: #ddd;
  background-repeat:repeat-x;
  font-size: 12px;
  color: black;
  text-align: left;
  line-height: 12px;
}

#knplabs-translator-form input {
    margin-right: 20px;
}

#knplabs-translator-container .error {
    color: #D8000C;
    background-color: #FFBABA;
    border: 1px solid;
    margin: 10px 0px;
    padding:15px 10px 15px 50px;
}

.untranslated {
    color: red;
    border: 1px solid red;
}


text:
/**
 * Make data requests using events, but wrapped in Promise interface.
 * These requests get routed to the web worker thread where one of
 * the service interfaces will handle the AJAX request and process the
 * response.
 *
 * The service name maps to a module defined in `data/web-worker/services/*`,
 * and the service method is the method to invoke in that modules exported
 * object.
 *
 * See the documented **Services** in the navigation menu on the left.
 *
 * To create custom services in plugins refer to the
 * {@link http://docs.visallo.org/tutorials/webplugin.html|Web Plugin Tutorial}.
 *
 * @module dataRequest
 * @classdesc Invoke service requests on Web Worker
 * @example
 * // Invoke the "me" function in "data/web-worker/services/user.js" module
 * dataRequest('user', 'me')
 *  .then(function(user) {
 *      // The current logged in user info
 *  }).catch(function(err) {
 *    // handle error
 *  }
 */
define([
    'util/promise',
    'underscore',
    'jquery',
    'util/requirejs/promise!util/service/dataPromise'
], function(Promise, _, $)
    /**
     * @alias module:dataRequest
     */
{
    'use strict';

    var NO_DATA_RESPONSE_TIMEOUT_SECONDS = 4,
        currentDataRequestId = 0,
        requests = {};

    $(document)
        .on('dataRequestStarted', function(event, data) {
            var request = requests[data.requestId];
            if (request) {
                clearTimeout(request.timeoutTimer);
            }
        })
        .on('dataRequestProgress', function(event, data) {
            var request = requests[data.requestId];
            if (request) {
                request.promiseFulfill.updateProgress(data.progress);
            }
        })
        .on('dataRequestCompleted', function(event, data) {
            var request = cleanRequest(data.requestId);
            if (request) {
                if (data.success) {
                    request.promiseFulfill(data.result);
                } else {
                    var error = data.error;
                    if (_.isString(error)) {
                        error = new Error(error);
                    }
                    request.promiseReject(error);
                }
            }
        });

    function cleanRequest(requestId) {
        var request = requests[requestId];
        if (request) {
            clearTimeout(request.timeoutTimer);
            delete requests[requestId];
            return request;
        }
    }

    /**
     * Make a data request
     *
     * @name module:dataRequest.dataRequest
     * @function
     * @param {string} service The name of service
     * @param {string} method The method to invoke in service
     * @param {...object} [args] arguments to pass to service
     * @returns {Promise} The service request promise
     */
    function dataRequestFromNode(node, service, method /*, args */) {
        if (!service || !method) {
            throw new Error('Service and method parameters required for dataRequest');
        }

        var argsStartIndex = 3,
            thisRequestId = currentDataRequestId++,
            $node = $(node),
            nodeEl = $node[0],
            $nodeInDom = $.contains(document.documentElement, nodeEl) ? $node : $(document),
            args = arguments.length > argsStartIndex ? _.rest(arguments, argsStartIndex) : [],
            promise = new Promise(function(fulfill, reject, onCancel) {
                Promise.require('util/requirejs/promise!util/service/dataPromise')
                    .then(function() {
                        requests[thisRequestId] = {
                            promiseFulfill: fulfill,
                            promiseReject: reject,
                            timeoutTimer: _.delay(function() {
                                console.error('Data request went unhandled', service + '->' + method);
                                $nodeInDom.trigger('dataRequestCompleted', {
                                    requestId: thisRequestId,
                                    success: false,
                                    error: 'No data request handler responded for ' + service + '->' + method
                                })
                            }, NO_DATA_RESPONSE_TIMEOUT_SECONDS * 1000)
                        };

                        $nodeInDom.trigger('dataRequest', {
                            requestId: thisRequestId,
                            service: service,
                            method: method,
                            parameters: args
                        });
                    })
                onCancel(function() {
                    var request = cleanRequest(thisRequestId);
                    if (request) {
                        $nodeInDom.trigger('dataRequestCancel', {
                            requestId: thisRequestId
                        });
                    }
                })
            });

        return promise;
    }
    withDataRequest.dataRequest = _.partial(dataRequestFromNode, document);

    return withDataRequest;

    function withDataRequest() {

        if (!('dataRequest' in this)) {
            this.dataRequest = function(service, method /*, args */) {
                Array.prototype.splice.call(arguments, 0, 0, this.$node);
                return dataRequestFromNode.apply(this, arguments);
            }
        }
    }
});


text:
package org.deeplearning4j.nn.conf.graph;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.val;
import org.deeplearning4j.nn.conf.inputs.InputType;
import org.deeplearning4j.nn.conf.inputs.InvalidInputTypeException;
import org.deeplearning4j.nn.conf.memory.LayerMemoryReport;
import org.deeplearning4j.nn.conf.memory.MemoryReport;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.nd4j.linalg.api.buffer.DataType;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.shade.jackson.annotation.JsonProperty;

@Data
@EqualsAndHashCode(callSuper = false)
public class L2NormalizeVertex extends GraphVertex {
    public static final double DEFAULT_EPS = 1e-8;

    protected int[] dimension;
    protected double eps;

    public L2NormalizeVertex() {
        this(null, DEFAULT_EPS);
    }

    public L2NormalizeVertex(@JsonProperty("dimension") int[] dimension, @JsonProperty("eps") double eps) {
        this.dimension = dimension;
        this.eps = eps;
    }

    @Override
    public L2NormalizeVertex clone() {
        return new L2NormalizeVertex(dimension, eps);
    }

    @Override
    public long numParams(boolean backprop) {
        return 0;
    }

    @Override
    public int minVertexInputs() {
        return 1;
    }

    @Override
    public int maxVertexInputs() {
        return 1;
    }

    @Override
    public org.deeplearning4j.nn.graph.vertex.GraphVertex instantiate(ComputationGraph graph, String name, int idx,
                                                                      INDArray paramsView, boolean initializeParams, DataType networkDatatype) {

        return new org.deeplearning4j.nn.graph.vertex.impl.L2NormalizeVertex(graph, name, idx, dimension, eps, networkDatatype);
    }

    @Override
    public InputType getOutputType(int layerIndex, InputType... vertexInputs) throws InvalidInputTypeException {
        if (vertexInputs.length == 1)
            return vertexInputs[0];
        InputType first = vertexInputs[0];

        return first; //Same output shape/size as
    }

    @Override
    public MemoryReport getMemoryReport(InputType... inputTypes) {
        InputType outputType = getOutputType(-1, inputTypes);
        //norm2 value (inference working mem): 1 per example during forward pass

        //Training working mem: 2 per example + 2x input size + 1 per example (in addition to epsilons)
        val trainModePerEx = 3 + 2 * inputTypes[0].arrayElementsPerExample();

        return new LayerMemoryReport.Builder(null, L2NormalizeVertex.class, inputTypes[0], outputType)
                        .standardMemory(0, 0) //No params
                        .workingMemory(0, 1, 0, trainModePerEx).cacheMemory(0, 0) //No caching
                        .build();
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cryptothamnium usneaeformis Wallr.

### Remarks
null


text:
'use strict';

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

exports.default = function (_ref) {
  var t = _ref.types;

  return {
    visitor: {
      ImportDeclaration(path, state) {
        (0, _noParserImport.noParserImportDeclaration)(path, state);
      },
      CallExpression(path, state) {
        (0, _noParserImport.noParserRequireCallExpression)(path, state);
      },
      TaggedTemplateExpression(path, state) {
        (0, _minify2.default)(path, state);
        (0, _displayNameAndId2.default)(path, state);
        (0, _templateLiterals2.default)(path, state);
      }
    }
  };
};

var _minify = require('./visitors/minify');

var _minify2 = _interopRequireDefault(_minify);

var _displayNameAndId = require('./visitors/displayNameAndId');

var _displayNameAndId2 = _interopRequireDefault(_displayNameAndId);

var _templateLiterals = require('./visitors/templateLiterals');

var _templateLiterals2 = _interopRequireDefault(_templateLiterals);

var _noParserImport = require('./visitors/noParserImport');

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


text:
package org.ros.internal.node.xmlrpc;

import org.ros.internal.node.server.ParameterServer;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * XML-RPC endpoint for a parameter server.
 *
 * @author damonkohler@google.com (Damon Kohler)
 */
public interface ParameterServerXmlRpcEndpoint extends XmlRpcEndpoint {

  /**
   * Deletes a parameter.
   *
   * @param callerId
   *          ROS caller ID
   * @param key
   *          parameter name
   * @return void
   */
  public List<Object> deleteParam(String callerId, String key);

  /**
   * Sets a parameter.
   *
   *

   * NOTE: if value is a dictionary it will be treated as a parameter tree,
   * where key is the parameter namespace. For example
   * {'x':1,'y':2,'sub':{'z':3}} will set key/x=1, key/y=2, and key/sub/z=3.
   * Furthermore, it will replace all existing parameters in the key parameter
   * namespace with the parameters in value. You must set parameters
   * individually if you wish to perform a union update.
   *
   * @param callerId
   *          ROS caller ID
   * @param key
   *          Parameter name.
   * @param value
   *          Parameter value.
   * @return void
   */
  public List<Object> setParam(String callerId, String key, Boolean value);

  public List<Object> setParam(String callerId, String key, Integer value);

  public List<Object> setParam(String callerId, String key, Double value);

  public List<Object> setParam(String callerId, String key, String value);

  public List<Object> setParam(String callerId, String key, List<?> value);

  public List<Object> setParam(String callerId, String key, Map<?, ?> value);

  /**
   * Retrieve parameter value from server.
   *
   *

   * If code is not 1, parameterValue should be ignored. If key is a namespace,
   * the return value will be a dictionary, where each key is a parameter in
   * that namespace. Sub-namespaces are also represented as dictionaries.
   *
   * @param callerId
   *          ROS caller ID
   * @param key
   *          Parameter name. If key is a namespace, getParam() will return a
   *          parameter tree.
   * @return the parameter value
   */
  public List<Object> getParam(String callerId, String key);

  /**
   * Searches for a parameter key on the {@link ParameterServer}.
   *
   *

   * Search starts in caller's namespace and proceeds upwards through parent
   * namespaces until Parameter Server finds a matching key. searchParam()'s
   * behavior is to search for the first partial match. For example, imagine
   * that there are two 'robot_description' parameters /robot_description
   * /robot_description/arm /robot_description/base /pr2/robot_description
   * /pr2/robot_description/base If I start in the namespace /pr2/foo and search
   * for robot_description, searchParam() will match /pr2/robot_description. If
   * I search for robot_description/arm it will return
   * /pr2/robot_description/arm, even though that parameter does not exist
   * (yet).
   *
   * If code is not 1, foundKey should be ignored.
   *
   * @param callerId
   *          ROS caller ID
   * @param key
   *          Parameter name to search for.
   * @return the found key
   */
  public List<Object> searchParam(String callerId, String key);

  /**
   * Retrieves the parameter value from server and subscribe to updates to that
   * param. See paramUpdate() in the Node API.
   *
   *

   * If code is not 1, parameterValue should be ignored. parameterValue is an
   * empty dictionary if the parameter has not been set yet.
   *
   * @param callerId
   *          ROS caller ID
   * @param callerApi
   *          Node API URI of subscriber for paramUpdate callbacks.
   * @param key
   * @return the parameter value
   */
  public List<Object> subscribeParam(String callerId, String callerApi, String key);

  /**
   * Unsubscribes from updates to the specified param. See paramUpdate() in the
   * Node API.
   *
   *

   * A return value of zero means that the caller was not subscribed to the
   * parameter.
   *
   * @param callerId
   *          ROS caller ID
   * @param callerApi
   *          Node API URI of subscriber
   * @param key
   *          Parameter name
   * @return the number of parameters that were unsubscribed
   */
  public List<Object> unsubscribeParam(String callerId, String callerApi, String key);

  /**
   * Check if parameter is stored on server.
   *
   * @param callerId
   *          ROS caller ID.
   * @param key
   *          Parameter name.
   * @return {@code true} if the parameter exists
   */
  public List<Object> hasParam(String callerId, String key);

  /**
   * Gets the list of all parameter names stored on this server.
   *
   * @param callerId
   *          ROS caller ID.
   * @return a {@link Collection} of parameter names
   */
  public List<Object> getParamNames(String callerId);

}


text:
package com.emc.storageos.model.dr;

import javax.xml.bind.annotation.XmlRootElement;

import com.emc.vipr.model.sys.NatCheckParam;

@XmlRootElement(name = "dr_nat_check")
public class DRNatCheckParam extends NatCheckParam {

}


text:
layout: post
title: Data Visualization
date: 2017-09-02 09:00:00

categories: tool
description: Learn from the expert
---

[Visualising data](http://www.visualisingdata.com/)

[Make over Monday](http://www.makeovermonday.co.uk/)

Happy learning!


text:
'''API module for heron state'''
__all__ = ['state', 'stateful_component']

from .state import State, HashMapState
from .stateful_component import StatefulComponent


text:
/* *
 *
 *  (c) 2009-2021 Øystein Moseng
 *
 *  Proxy elements are used to shadow SVG elements in HTML for assistive
 *  technology, such as screen readers or voice input software.
 *
 *  The ProxyElement class represents such an element, and deals with
 *  overlay positioning and mirroring events for the target.
 *
 *  License: www.highcharts.com/license
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
'use strict';
import H from '../Core/Globals.js';
var doc = H.doc;
import U from '../Core/Utilities.js';
var attr = U.attr, css = U.css, merge = U.merge;
import EventProvider from './Utils/EventProvider.js';
import ChartUtilities from './Utils/ChartUtilities.js';
var fireEventOnWrappedOrUnwrappedElement = ChartUtilities.fireEventOnWrappedOrUnwrappedElement;
import HTMLUtilities from './Utils/HTMLUtilities.js';
var cloneMouseEvent = HTMLUtilities.cloneMouseEvent, cloneTouchEvent = HTMLUtilities.cloneTouchEvent, getFakeMouseEvent = HTMLUtilities.getFakeMouseEvent, removeElement = HTMLUtilities.removeElement;
/* *
 *
 *  Class
 *
 * */
/**
 * Represents a proxy element that overlays a target and relays events
 * to its target.
 *
 * @private
 * @class
 */
var ProxyElement = /** @class */ (function () {
    /* *
     *
     *  Constructor
     *
     * */
    function ProxyElement(chart, target, groupType, attributes) {
        this.chart = chart;
        this.target = target;
        this.groupType = groupType;
        this.eventProvider = new EventProvider();
        var wrapperEl = groupType === 'ul' ? doc.createElement('li') : null;
        var btnEl = this.buttonElement = doc.createElement('button');
        if (!chart.styledMode) {
            this.hideButtonVisually(btnEl);
        }
        if (wrapperEl) {
            wrapperEl.appendChild(btnEl);
            this.element = wrapperEl;
        }
        else {
            this.element = btnEl;
        }
        this.updateTarget(target, attributes);
    }
    /* *
     *
     *  Functions
     *
     * */
    /* eslint-disable valid-jsdoc */
    /**
     * Fake a click event on the target.
     */
    ProxyElement.prototype.click = function () {
        var pos = this.getTargetPosition();
        pos.x += pos.width / 2;
        pos.y += pos.height / 2;
        var fakeEventObject = getFakeMouseEvent('click', pos);
        fireEventOnWrappedOrUnwrappedElement(this.target.click, fakeEventObject);
    };
    /**
     * Update the target to be proxied.
     * The position and events are updated to match the new target.
     * @param target The new target definition
     * @param attributes New HTML attributes to apply to the button. Set an attribute to null to remove.
     */
    ProxyElement.prototype.updateTarget = function (target, attributes) {
        this.target = target;
        this.updateCSSClassName();
        attr(this.buttonElement, merge({
            'aria-label': this.getTargetAttr(target.click, 'aria-label')
        }, attributes));
        this.eventProvider.removeAddedEvents();
        this.addProxyEventsToButton(this.buttonElement, target.click);
        this.refreshPosition();
    };
    /**
     * Refresh the position of the proxy element to match the current target
     */
    ProxyElement.prototype.refreshPosition = function () {
        var bBox = this.getTargetPosition();
        css(this.buttonElement, {
            width: (bBox.width || 1) + 'px',
            height: (bBox.height || 1) + 'px',
            left: (Math.round(bBox.x) || 0) + 'px',
            top: (Math.round(bBox.y) || 0) + 'px'
        });
    };
    /**
     * Remove button from DOM, and clear events.
     */
    ProxyElement.prototype.remove = function () {
        this.eventProvider.removeAddedEvents();
        removeElement(this.element);
    };
    // -------------------------- private ------------------------------------
    /**
     * Update the CSS class name to match target
     */
    ProxyElement.prototype.updateCSSClassName = function () {
        var stringHasNoTooltip = function (s) { return s.indexOf('highcharts-no-tooltip') > -1; };
        var legend = this.chart.legend;
        var groupDiv = legend.group && legend.group.div;
        var noTooltipOnGroup = stringHasNoTooltip(groupDiv && groupDiv.className || '');
        var targetClassName = this.getTargetAttr(this.target.click, 'class') || '';
        var noTooltipOnTarget = stringHasNoTooltip(targetClassName);
        this.buttonElement.className = noTooltipOnGroup || noTooltipOnTarget ?
            'highcharts-a11y-proxy-button highcharts-no-tooltip' :
            'highcharts-a11y-proxy-button';
    };
    /**
     * Mirror events for a proxy button to a target
     */
    ProxyElement.prototype.addProxyEventsToButton = function (button, target) {
        var _this = this;
        [
            'click', 'touchstart', 'touchend', 'touchcancel', 'touchmove',
            'mouseover', 'mouseenter', 'mouseleave', 'mouseout'
        ].forEach(function (evtType) {
            var isTouchEvent = evtType.indexOf('touch') === 0;
            _this.eventProvider.addEvent(button, evtType, function (e) {
                var clonedEvent = isTouchEvent ?
                    cloneTouchEvent(e) :
                    cloneMouseEvent(e);
                if (target) {
                    fireEventOnWrappedOrUnwrappedElement(target, clonedEvent);
                }
                e.stopPropagation();
                // #9682, #15318: Touch scrolling didnt work when touching proxy
                if (!isTouchEvent) {
                    e.preventDefault();
                }
            }, { passive: false });
        });
    };
    /**
     * Set visually hidden style on a proxy button
     */
    ProxyElement.prototype.hideButtonVisually = function (button) {
        css(button, {
            borderWidth: 0,
            backgroundColor: 'transparent',
            cursor: 'pointer',
            outline: 'none',
            opacity: 0.001,
            filter: 'alpha(opacity=1)',
            zIndex: 999,
            overflow: 'hidden',
            padding: 0,
            margin: 0,
            display: 'block',
            position: 'absolute',
            '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha(Opacity=1)'
        });
    };
    /**
     * Get the position relative to chart container for the target
     */
    ProxyElement.prototype.getTargetPosition = function () {
        var clickTarget = this.target.click;
        // We accept both DOM elements and wrapped elements as click targets.
        var clickTargetElement = clickTarget.element ?
            clickTarget.element :
            clickTarget;
        var posElement = this.target.visual || clickTargetElement;
        var chartDiv = this.chart.renderTo;
        if (chartDiv && posElement && posElement.getBoundingClientRect) {
            var rectEl = posElement.getBoundingClientRect(), rectDiv = chartDiv.getBoundingClientRect();
            return {
                x: rectEl.left - rectDiv.left,
                y: rectEl.top - rectDiv.top,
                width: rectEl.right - rectEl.left,
                height: rectEl.bottom - rectEl.top
            };
        }
        return { x: 0, y: 0, width: 1, height: 1 };
    };
    /**
     * Get an attribute value of a target
     */
    ProxyElement.prototype.getTargetAttr = function (target, key) {
        if (target.element) {
            return target.element.getAttribute(key);
        }
        return target.getAttribute(key);
    };
    return ProxyElement;
}());
/* *
 *
 *  Default Export
 *
 * */
export default ProxyElement;


text:
interface HumaneOptions {
    queue?: string[];
    baseCls?: string;
    addnCls?: string;
    timeout?: number;
    waitForMove?: bool;
    clickToClose?: bool;
    forceNew?: bool;
}

interface Humane {
    queue: string[];
    baseCls: string;
    addnCls: string;
    timeout: number;
    waitForMove: bool;
    clickToClose: bool;
    forceNew: bool;

    create(options?: HumaneOptions): Humane;
    info: Function;
    error: Function;
    spawn(options: HumaneOptions): Function;
    remove(any): void;
    log(message: string): Humane;
    log(message: string, callback: Function): Humane;
    log(message: string, options: HumaneOptions): Humane;
    log(message: string, callback: Function, options: HumaneOptions): Humane;

    log(listOfMessages: Array): Humane;
}

declare var humane: Humane;


text:
using namespace rsocket;
using namespace yarpl;
using namespace yarpl::single;

DEFINE_int32(port, 9898, "port to connect to");

class HelloFireAndForgetRequestResponder : public rsocket::RSocketResponder {
 public:
  void handleFireAndForget(Payload request, StreamId) override {
    std::cout << "Received fireAndForget: " << request.moveDataToString()
              << std::endl;
  }
};

int main(int argc, char* argv[]) {
  FLAGS_logtostderr = true;
  FLAGS_minloglevel = 0;
  folly::init(&argc, &argv);

  TcpConnectionAcceptor::Options opts;
  opts.address = folly::SocketAddress("::", FLAGS_port);
  opts.threads = 2;

  // RSocket server accepting on TCP
  auto rs = RSocket::createServer(
      std::make_unique<TcpConnectionAcceptor>(std::move(opts)));

  auto rawRs = rs.get();
  auto serverThread = std::thread([=] {
    // start accepting connections
    rawRs->startAndPark([](const rsocket::SetupParameters&) {
      return std::make_shared<HelloFireAndForgetRequestResponder>();
    });
  });

  // Wait for a newline on the console to terminate the server.
  std::getchar();

  rs->unpark();
  serverThread.join();

  return 0;
}


text:
<q-grid header="{{::$details.title}}"
        model="$ctrl.gridModel"
        rows="$ctrl.rows"
        id="demo-persistence">
	<q-grid:columns generation="deep">
		<q-grid:column key="contact.address.zip" type="text"></q-grid:column>
	</q-grid:columns>

	<q-grid:persistence></q-grid:persistence>
</q-grid>


text:
// -----------------------------------------------------------------------
// <copyright file="StorageTests.cs">
// Copyright (c) 2013-2017 Andrey Veselov. All rights reserved.
// License: Apache License 2.0
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace FileWarehouse.AzureBlob.IntegrationTests
{
	using System;
	using System.IO;
	using System.Linq;
	using System.Threading.Tasks;
	using Xunit;

	public class StorageTests : IClassFixture<InitializeAndCleanupFixture>
	{
		private readonly InitializeAndCleanupFixture _fixture;

		public StorageTests(InitializeAndCleanupFixture fixture)
		{
			this._fixture = fixture;

			fixture.TestEmulatorRunnig();
		}

		// ReSharper disable PossibleMultipleEnumeration

		[Fact]
		public async Task AzureStorageCreateAndDeleteContainer()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			const ContainerPermission permission = ContainerPermission.Public;
			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			bool exceptionCaught = false;

			// Act
			var container1 = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, permission, failIfExists: true);
			var container2 = await storage.GetContainerAsync(StorageConsts.Container1Name);
			IStorageContainer container3 = null;
			try {
				container3 = await storage.GetContainerAsync(StorageConsts.Container2Name);
			}
			catch (StorageException ex) {
				if (ex.Reason == StorageExceptionReason.ContainerNotFound)
					exceptionCaught = true;
			}
			catch (AggregateException ex) { // async exception can be aggregate
				if (ex.InnerExceptions.Any(e => e is StorageException))
					exceptionCaught = true;
			}

			var resultPermission1 = await container1.GetPermissionAsync();
			var resultPermission2 = await container2.GetPermissionAsync();

			var containersList1 = await storage.GetContainersListAsync(StorageConsts.ContainerNamesPrefix);
			var containersList2 = await storage.GetContainersListAsync(StorageConsts.Container2Name.Substring(0, 12));

			await storage.DeleteContainerAsync(StorageConsts.Container1Name);

			var containersList3 = await storage.GetContainersListAsync(StorageConsts.ContainerNamesPrefix);

			// Assert
			Assert.NotNull(container1);
			Assert.NotNull(container2);
			Assert.Null(container3);
			Assert.True(exceptionCaught);
			Assert.Equal(permission, resultPermission1);
			Assert.Equal(permission, resultPermission2);
			Assert.NotNull(containersList1);
			Assert.NotNull(containersList2);
			Assert.True(containersList1.Any());
			Assert.True(!containersList2.Any());
			Assert.Equal(1, containersList1.Count() - containersList3.Count());
		}

		[Fact]
		public async Task AzureStorageTryCreateContainerWithEmptyName()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			const ContainerPermission permission = ContainerPermission.Public;
			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			bool exceptionCaught = false;

			// Act
			try {
				await storage.CreateOrGetContainerAsync(null, permission, failIfExists: true);
			}
			catch (Exception) {
				exceptionCaught = true;
			}

			// Arrange
			Assert.True(exceptionCaught);
		}

		[Fact]
		public async Task AzureStorageModifyContainerPermission()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			const ContainerPermission sourcePermission = ContainerPermission.Private;
			const ContainerPermission targetPermission = ContainerPermission.Public;

			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			var container = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, sourcePermission, failIfExists: true);

			// Act
			await container.SetPermissionAsync(targetPermission);
			var resultPermission = await container.GetPermissionAsync();

			// Assert
			Assert.Equal(targetPermission, resultPermission);
		}

		[Fact]
		public async Task AzureStorageCreateAndDeleteDirectory()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			var container = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, ContainerPermission.Private, failIfExists: true);

			// Act
			await container.CreateDirectoryAsync("TestDir");
			await container.DeleteDirectoryAsync("TestDir");
			var dirs = await container.GetDirectoriesAsync("");

			// Assert
			Assert.True(!dirs.Any());
		}

		[Fact]
		public async Task AzureStorageCreateAndDeleteFile()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			byte[] sourceData = this.CreateDataArray(255);
			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			var container = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, ContainerPermission.Private, failIfExists: true);

			// Act
			await container.WriteFileAsync(new MemoryStream(sourceData), StorageConsts.File1Name);
			var files1 = await container.GetFilesAsync(@"/folder1/subfolder/", StorageSearchOption.StripPaths); // first slash should be trimmed.

			await container.DeleteFileAsync(@"folder1/subfolder/fileText1.dat");
			var files2 = await container.GetFilesAsync(@"folder1/subfolder/", StorageSearchOption.StripPaths);

			// Assert
			Assert.True(files1.Count() == 1);
			Assert.Equal("fileText1.dat", files1.First());
			Assert.True(!files2.Any());
		}

		[Fact]
		public async Task AzureStorageWriteAndReadFile()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			byte[] sourceData = this.CreateDataArray(255);
			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			var container = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, ContainerPermission.Private, failIfExists: true);

			// Act
			await container.WriteFileAsync(new MemoryStream(sourceData), StorageConsts.File1Name);
			var dirs1 = await container.GetDirectoriesAsync(@"");
			var dirs2 = await container.GetDirectoriesAsync(@"folder1");
			var files = await container.GetFilesAsync(@"folder1/subfolder/", StorageSearchOption.StripPaths);
			var filesFull = await container.GetFilesAsync(@"folder1/subfolder/", StorageSearchOption.Default);

			var resultStream1 = await container.GetFileStreamAsync(StorageConsts.File1Name);
			var resultData1 = new byte[resultStream1.Length];
			resultStream1.Read(resultData1, 0, resultData1.Length);

			var resultStream2 = new MemoryStream();
			await container.GetFileStreamAsync(resultStream2, @"\folder1/subfolder/fileText1.dat");
			var resultData2 = new byte[resultStream1.Length];
			resultStream2.Read(resultData2, 0, resultData2.Length);

			// Assert
			Assert.True(resultData1.SequenceEqual(sourceData));
			Assert.True(resultData2.SequenceEqual(sourceData));
			Assert.True(dirs1.Count() == 1);
			Assert.Equal("folder1", dirs1.First());
			Assert.True(dirs2.Count() == 1);
			Assert.Equal("subfolder", dirs2.First());
			Assert.True(files.Count() == 1);
			Assert.Equal("fileText1.dat", files.First());
			Assert.Equal(StorageConsts.File1Name, filesFull.First());
		}

		[Fact]
		public async Task AzureStorageCheсkFileUrl()
		{
			// Arrange
			await this._fixture.ContainersCleanup();

			byte[] sourceData = this.CreateDataArray(255);
			IStorage storage = new AzureBlobStorage(StorageConsts.ConnectionString);
			var container = await storage.CreateOrGetContainerAsync(StorageConsts.Container1Name, ContainerPermission.Private, failIfExists: true);

			// Act
			await container.WriteFileAsync(new MemoryStream(sourceData), StorageConsts.File1Name);
			var url = container.GetUrlForFile(StorageConsts.File1Name);
			var uri = new Uri(url);

			// Assert
			Assert.True(url.StartsWith("http://") || url.StartsWith("https://"));
			Assert.True(url.EndsWith("folder1/subfolder/fileText1.dat"));
			Assert.True(StorageConsts.File1Name.Length + "http://".Length < url.Length);
			Assert.NotNull(uri);
		}

		private byte[] CreateDataArray(int length)
		{
			var array = new byte[length];
			var rnd = new Random(DateTime.Now.Millisecond);

			for (var i = 0; i < length; i++)
				array[i] = (byte)rnd.Next(255);

			return array;
		}

		// ReSharper restore PossibleMultipleEnumeration
	}
}


text:
package uk.gov.hmrc.play.events.handlers

import play.api.Logger
import uk.gov.hmrc.play.audit.http.HeaderCarrier
import uk.gov.hmrc.play.events.{Measurable, Recordable}

object DefaultMetricsEventHandler extends MetricsEventHandler {
  override def handleMeasurable(measurable: Measurable) = Logger.info(s"metric:source:${measurable.source}:name:${measurable.name}:data:${measurable.data}")
}

trait MetricsEventHandler extends EventHandler {

  def handleMeasurable(measurable: Measurable)

  override def handle(event: Recordable)(implicit headerCarrier: HeaderCarrier) = {
    event match {
      case measurable: Measurable => handleMeasurable(measurable)
      case _ =>
    }
  }
}


text:
package com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode;

import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine;
import net.minecraftforge.common.util.INBTSerializable;

import javax.vecmath.Point2i;
import java.util.ArrayList;

public abstract class PullMode implements INBTSerializable {

    public static final ArrayList<Class<? extends PullMode>> PULL_MODES;

    public static final Class<? extends PullMode> SINGLE_STEP = PullModeSingleStep.class;
    public static final Class<? extends PullMode> SINGLE_SWEEP = PullModeSingleSweep.class;
    public static final Class<? extends PullMode> AUTOMATIC = PullModeAuto.class;

    static {
        PULL_MODES = new ArrayList<>();

        PULL_MODES.add(0, SINGLE_STEP);
        PULL_MODES.add(1, SINGLE_SWEEP);
        PULL_MODES.add(2, AUTOMATIC);
    }

    private final int id, x, y;
    private final String unlocalizedName;
    private boolean paused;

    public PullMode(int id, int x, int y, String unlocalizedName) {
        this.id = id;
        this.x = x;
        this.y = y;
        this.unlocalizedName = unlocalizedName;
    }

    public int getID() {
        return id;
    }

    public String getTranslationKey() {
        return unlocalizedName;
    }

    public Point2i textureOffset() {
        return new Point2i(x, y);
    }

    public boolean isPaused() {
        return paused;
    }

    public void pause() {
        paused = true;
    }

    public void unpause() {
        paused = false;
    }

    public abstract void onPulse(TileSortingMachine sortingMachine);

    public abstract void onTick(TileSortingMachine sortingMachine);

}


text:
export class TrainingCourse {
    Id: string;
    Title: string;
    Description: string;
    Type: string;
    IsCompleted: boolean;
    CompanyId: string;
    IsAtlasTraining: boolean;
    CourseCode: string;

    constructor() {
        this.Id = "";
        this.Title = "";
        this.Description = "";
        this.Type = "";
        this.IsCompleted = false;
        this.CompanyId = "";
        this.IsAtlasTraining = false;
        this.CourseCode = "";
    }
}


text:
<?php

namespace Dez\Mvc\Controller;

/**
 * Class RuntimeMvcException
 * @package Dez\Mvc\Controller
 */
class RuntimeMvcException extends ReplaceException {}


text:
'use strict';

/**
 * @class
 * Initializes a new instance of the RecommendedElasticPoolListResult class.
 * @constructor
 * Represents the response to a list recommended elastic pool request.
 *
 */
class RecommendedElasticPoolListResult extends Array {
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RecommendedElasticPoolListResult
   *
   * @returns {object} metadata of RecommendedElasticPoolListResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RecommendedElasticPoolListResult',
      type: {
        name: 'Composite',
        className: 'RecommendedElasticPoolListResult',
        modelProperties: {
          value: {
            required: true,
            serializedName: '',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'RecommendedElasticPoolElementType',
                  type: {
                    name: 'Composite',
                    className: 'RecommendedElasticPool'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = RecommendedElasticPoolListResult;


text:
module HopHop
  # This sends an event through Bunny
  # it jsons the data and passes the meta header as is
  class BunnySender
    attr_reader :options

    # @param [Hash] options
    # @option options [String] :host the hostname of the rabbit mq server (localhost)
    # @option options [Integer] :port the port the rabbit mq server (5672)
    # @option options [String] :exchange name of the exchange to bind to (events)
    # @option options [Integer] if set to a number the messages will timeout after this number miliseconds (nil)
    # @option options [Integer] :heartbeat seconds (0 = none, :server means use from server, default: :server)
    # @option options [Integer] :automatically_recover (true)
    # @option options [String]  :user (guest)
    # @option options [String]  :password (guest)

    def initialize(options = {})
      defaults = { host: 'localhost', port: 5672, exchange: 'events', user: 'guest', password: 'guest',
                  heartbeat: :server, automatically_recover: true, ttl: nil }

      @options = defaults.merge(options)
      @exchange_name = options[:events] || 'events'
    end

    # @param [Object] data is an object that responds to to_json
    # @param [Hash] meta a hash of meta informations (see HopHop::Event#meta)
    def publish(data, meta)
      meta = meta.merge(expiration: options[:ttl]) if options[:ttl]
      tries = 3
      begin
        exchange.publish(data.to_json, meta)
        # I have to rescue these and retry as bunny's autoreconnect sometimes simply doesn't work
        # TBD: logging this would be good
      rescue Bunny::ConnectionClosedError, Bunny::ChannelAlreadyClosed
        tries -= 1
        sleep 0.3
        reset
        tries >= 0 ? retry : raise
      end
    end

    private

    def reset
      @exchange = @channel = @connection = nil
    end

    def exchange
      @exchange ||= channel.topic(@exchange_name, durable: true)
    end

    def channel
      @channel ||= connection.create_channel
    end

    def connection
      return @connection if @connection
      @connection = Bunny.new(Helper.slice_hash(options, :host, :port, :user, :password, :heartbeat, :automatically_recover))
      @connection.start
    end
  end
end


text:
<!DOCTYPE html>

<title>pWiki</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

<link rel="manifest" href="manifest.json">

<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Bold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-BoldItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBoldItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Italic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Light.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-LightItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Regular.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Semibold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-SemiboldItalic.ttf">

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


text:
Ruby wrap for working with [Jeff Sackmann's tennis_atp database](https://github.com/JeffSackmann/tennis_atp). You can set it up in Postgres by cloning [this fork](https://github.com/harman28/tennis_atp/tree/psql_support) and running `bash setup/PostgreSQL/convert_postgres.sh`. More instructions for doing that are [here](https://github.com/harman28/tennis_atp/blob/psql_support/setup/PostgreSQL/README.md).

Once you've done that, use this gem to write ruby scripts to query the DB.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'atpruby'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install atpruby

## Usage
Who won the first match of 2014?
````
[1] pry(main)> Match.in_2014.order(:match_date).first.winner.name
=> "Donald Young"
````
List all the left-handed Grand Slam winners.
````
[2] pry(main)> Match.slams.finals.joins(:winner).where(players:{hand:'L'}).pluck("distinct lastname")
=> ["Mcenroe", "Orantes", "Korda", "Laver", "Tanner", "Muster", "Connors", "Nadal", "Gomez", "Ivanisevic", "Vilas"]
````
How many Grand Slam finals has Murray been in?
````
[3] pry(main)> Player.find_by(firstname:'andy',lastname:'Murray').slam_finals.count
=> 8
````
Which players younger than himself has Djokovic lost to in finals?
````
[4] pry(main)> Player.joins(:losses).where(lastname:'Djokovic').where("winner_age<loser_age").where("round='F'").pluck("distinct winner_name")
=> []
````
When was the last time Federer was World #1?
````
[5] pry(main)> Player.find_by(lastname:'Federer').rankings.where(pos:1).order(:ranking_date).last.ranking_date
=> Mon, 29 Oct 2012
````
Which Slams has seen the most five-setters?
````
[6] pry(main)> Match.slams.where("score ilike '%-%-%-%-%-%'").group(:tourney_name).order("count desc").pluck("tourney_name,count(tourney_name)")
=> [["Wimbledon", 1194], ["Roland Garros", 1043], ["US Open", 1023], ["Australian Open", 877], ["Australian Chps.", 13]]
````

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/harman28/atpruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
export default function theFunction(action$, store) {
  return action$.ofType(THE_ACTION).switchMap(action => Observable
    .webSocket({
      url: THE_URL,
      more: stuff(),
      evenMore: stuff({
        value1: true,
        value2: false,
        value3: false
      })
    })
    .filter(data => theFilter(data))
    .map(({ theType, ...data }) => theMap(theType, data))
    .retryWhen(errors => errors));
}

function f() {
  return this._getWorker(workerOptions)({
    filePath,
    hasteImplModulePath: this._options.hasteImplModulePath,
  }).then(
    metadata => {
      // `1` for truthy values instead of `true` to save cache space.
      fileMetadata[H.VISITED] = 1;
      const metadataId = metadata.id;
      const metadataModule = metadata.module;
      if (metadataId && metadataModule) {
        fileMetadata[H.ID] = metadataId;
        setModule(metadataId, metadataModule);
      }
      fileMetadata[H.DEPENDENCIES] = metadata.dependencies || [];
    }
  );
}


text:
<?php
namespace PayPal\PayPalAPI;
use PayPal\EBLBaseComponents\AbstractResponseType;
/**
 * Results of a Transaction Search.
 */
class TransactionSearchResponseType  extends AbstractResponseType
  {

	/**
	 * Results of a Transaction Search.
     * @array
	 * @access public

	 * @namespace ebl

	 * @var PayPal\EBLBaseComponents\PaymentTransactionSearchResultType
	 */
	public $PaymentTransactions;

}