text:
var kss = require('../index.js'),
	KssStyleguide = kss.KssStyleguide,
	KssSection = kss.KssSection,
	KssModifier = kss.KssModifier,

	path = require('path'),
	assert = require('assert'),

	styleDirectory = path.normalize(__dirname + '/fixtures-styles/'),
	common = require('./common.js')(styleDirectory);

suite('KssModifier', function() {
	common.hasMethod(new KssModifier({}), 'name');
	common.hasMethod(new KssModifier({}), 'description');
	common.hasMethod(new KssModifier({}), 'className');

	suite('#name', function() {
		common.testAllSections('should return data.name', '*.less|*.css', function(section) {
			var modifiers = section.modifiers(),
				i, l = modifiers.length;

			for (i = 0; i < l; i += 1) {
				assert.equal(modifiers[i].data.name, modifiers[i].name());
			}
		});
	});
	suite('#description', function() {
		common.testAllSections('should return data.description', '*.less|*.css', function(section) {
			var modifiers = section.modifiers(),
				i, l = modifiers.length;

			for (i = 0; i < l; i += 1) {
				assert.equal(modifiers[i].data.description, modifiers[i].description());
			}
		});
	});
	suite('#className', function() {
		common.testAllSections('should be valid CSS classes', '*.less|*.css', function(section) {
			var modifiers = section.modifiers(),
				i, l = modifiers.length;

			for (i = 0; i < l; i+= 1) {
				assert.ok(modifiers[i].className().match(/[a-z \-_]/gi));
			}
		});
	});

	suite('#markup', function() {
		common.testAllSections('should return a filtered data.section.markup', '*.less|*.css', function(section) {
			var modifiers = section.modifiers(),
				i, l = modifiers.length;

			for (i = 0; i < l; i += 1) {
				if (!modifiers[i].markup()) continue;

				assert.equal(section.data.markup, modifiers[i].data.section.data.markup);
				assert.equal(
					section.data.markup.replace(/\{\$modifiers\}/g, modifiers[i].className()),
					modifiers[i].markup().replace(/\{\$modifiers\}/g, '')
				);
			}
		});
	});
});


text:
module Rpush
  module Daemon
    module Wns
      class RawRequest
        def self.create(notification, access_token)
          body = notification.data.to_json
          uri = URI.parse(notification.uri)
          post = Net::HTTP::Post.new(
            uri.request_uri,
            "Content-Length" => body.length.to_s,
            "Content-Type" => "application/octet-stream",
            "X-WNS-Type" => "wns/raw",
            "X-WNS-RequestForStatus" => "true",
            "Authorization" => "Bearer #{access_token}"
          )
          post.body = body
          post
        end
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


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

        <title>OR-Tools</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>

        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>

                Google OR-Tools 9.4

C++ Reference

Algorithms

CP-SAT

Graph

Routing

Linear solver

C++ Reference: Routing

- a -

AppendTasksFromIntervals() : operations_research

AppendTasksFromPath() : operations_research

AreAllBooleans() : operations_research

AreAllBound() : operations_research

AreAllBoundOrNull() : operations_research

AreAllBoundTo() : operations_research

AreAllGreaterOrEqual() : operations_research

AreAllLessOrEqual() : operations_research

AreAllNegative() : operations_research

AreAllNull() : operations_research

AreAllOnes() : operations_research

AreAllPositive() : operations_research

AreAllStrictlyNegative() : operations_research

AreAllStrictlyPositive() : operations_research

- b -

BuildModelParametersFromFlags() : operations_research

BuildSearchParametersFromFlags() : operations_research

- c -

CpRandomSeed() : operations_research

- d -

DefaultRoutingModelParameters() : operations_research

DefaultRoutingSearchParameters() : operations_research

DEFINE_INT_TYPE() : operations_research

- f -

FillPathEvaluation() : operations_research

FillTravelBoundsOfVehicle() : operations_research

FillValues() : operations_research

FindErrorInRoutingSearchParameters() : operations_research

FindErrorsInRoutingSearchParameters() : operations_research

- h -

Hash1() : operations_research

- i -

IsArrayBoolean() : operations_research

IsArrayConstant() : operations_research

IsArrayInRange() : operations_research

IsIncreasing() : operations_research

IsIncreasingContiguous() : operations_research

- m -

MakeConstraintDemon0() : operations_research

MakeConstraintDemon1() : operations_research

MakeConstraintDemon2() : operations_research

MakeConstraintDemon3() : operations_research

MakeDelayedConstraintDemon0() : operations_research

MakeDelayedConstraintDemon1() : operations_research

MakeDelayedConstraintDemon2() : operations_research

MakeDimensionFilter() : operations_research

MakeLocalSearchOperator() : operations_research

MakePathStateFilter() : operations_research

MakeRestoreDimensionValuesForUnchangedRoutes() : operations_research

MakeSetValuesFromTargets() : operations_research

MakeVehicleBreaksFilter() : operations_research

MaxVarArray() : operations_research

MinVarArray() : operations_research

- o -

One() : operations_research

operator<<() : operations_research

- p -

ParameterDebugString() : operations_research

PosIntDivDown() : operations_research

PosIntDivUp() : operations_research

- s -

SetAssignmentFromAssignment() : operations_research

SolveModelWithSat() : operations_research

- t -

ToInt64Vector() : operations_research

- z -

Zero() : operations_research


text:
package com.likya.tlossw.model;

import java.io.Serializable;

import com.likya.tlos.model.xmlbeans.webservice.UserAccessProfileDocument.UserAccessProfile;

public class WSAccessInfoTypeClient implements Serializable {

	private static final long serialVersionUID = -6868566540771893293L;

	private UserAccessProfile wsAccessProfile;

	private String serviceName;
	private String description;
	private String userOrRoleList;

	public UserAccessProfile getWsAccessProfile() {
		return wsAccessProfile;
	}
	public void setWsAccessProfile(UserAccessProfile wsAccessProfile) {
		this.wsAccessProfile = wsAccessProfile;
	}
	public String getServiceName() {
		return serviceName;
	}
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getUserOrRoleList() {
		return userOrRoleList;
	}
	public void setUserOrRoleList(String userOrRoleList) {
		this.userOrRoleList = userOrRoleList;
	}

}


text:
<litepal>
    <dbname value="coll_weather"/>
    <version value="1"/>
    <list>
        <mapping class="com.example.coolweather.db.Province"/>
        <mapping class="com.example.coolweather.db.City"/>
        <mapping class="com.example.coolweather.db.County"/>
    </list>
</litepal>


text:
define(["require", "exports", './navigation-plan', './router-configuration'], function (require, exports, navigation_plan_1, router_configuration_1) {
    var RouteLoader = (function () {
        function RouteLoader() {
        }
        RouteLoader.prototype.loadRoute = function (router, config) {
            throw Error('Route loaders must implment "loadRoute(router, config)".');
        };
        return RouteLoader;
    })();
    exports.RouteLoader = RouteLoader;
    var LoadRouteStep = (function () {
        function LoadRouteStep(routeLoader) {
            this.routeLoader = routeLoader;
        }
        LoadRouteStep.inject = function () { return [RouteLoader]; };
        LoadRouteStep.prototype.run = function (navigationContext, next) {
            return loadNewRoute(this.routeLoader, navigationContext)
                .then(next)
                .catch(next.cancel);
        };
        return LoadRouteStep;
    })();
    exports.LoadRouteStep = LoadRouteStep;
    function loadNewRoute(routeLoader, navigationContext) {
        var toLoad = determineWhatToLoad(navigationContext);
        var loadPromises = toLoad.map(function (current) { return loadRoute(routeLoader, current.navigationContext, current.viewPortPlan); });
        return Promise.all(loadPromises);
    }
    exports.loadNewRoute = loadNewRoute;
    function determineWhatToLoad(navigationContext, toLoad) {
        var plan = navigationContext.plan;
        var next = navigationContext.nextInstruction;
        toLoad = toLoad || [];
        for (var viewPortName in plan) {
            var viewPortPlan = plan[viewPortName];
            if (viewPortPlan.strategy == navigation_plan_1.activationStrategy.replace) {
                toLoad.push({
                    viewPortPlan: viewPortPlan,
                    navigationContext: navigationContext
                });
                if (viewPortPlan.childNavigationContext) {
                    determineWhatToLoad(viewPortPlan.childNavigationContext, toLoad);
                }
            }
            else {
                var viewPortInstruction = next.addViewPortInstruction(viewPortName, viewPortPlan.strategy, viewPortPlan.prevModuleId, viewPortPlan.prevComponent);
                if (viewPortPlan.childNavigationContext) {
                    viewPortInstruction.childNavigationContext = viewPortPlan.childNavigationContext;
                    determineWhatToLoad(viewPortPlan.childNavigationContext, toLoad);
                }
            }
        }
        return toLoad;
    }
    function loadRoute(routeLoader, navigationContext, viewPortPlan) {
        var moduleId = viewPortPlan.config.moduleId;
        var next = navigationContext.nextInstruction;
        return loadComponent(routeLoader, navigationContext, viewPortPlan.config).then(function (component) {
            var viewPortInstruction = next.addViewPortInstruction(viewPortPlan.name, viewPortPlan.strategy, moduleId, component);
            var controller = component.executionContext, childRouter = component.childRouter;
            if (childRouter) {
                var path = next.getWildcardPath();
                return childRouter.createNavigationInstruction(path, next)
                    .then(function (childInstruction) {
                    viewPortPlan.childNavigationContext = childRouter.createNavigationContext(childInstruction);
                    return navigation_plan_1.buildNavigationPlan(viewPortPlan.childNavigationContext)
                        .then(function (childPlan) {
                        viewPortPlan.childNavigationContext.plan = childPlan;
                        viewPortInstruction.childNavigationContext = viewPortPlan.childNavigationContext;
                        return loadNewRoute(routeLoader, viewPortPlan.childNavigationContext);
                    });
                });
            }
        });
    }
    function loadComponent(routeLoader, navigationContext, config) {
        var router = navigationContext.router, lifecycleArgs = navigationContext.nextInstruction.lifecycleArgs;
        return routeLoader.loadRoute(router, config).then(function (component) {
            component.router = router;
            component.config = config;
            if ('configureRouter' in component.executionContext) {
                component.childRouter = component.childContainer.getChildRouter();
                var config = new router_configuration_1.RouterConfiguration();
                var result = Promise.resolve((_a = component.executionContext).configureRouter.apply(_a, [config, component.childRouter].concat(lifecycleArgs)));
                return result.then(function () {
                    component.childRouter.configure(config);
                    return component;
                });
            }
            return component;
            var _a;
        });
    }
});


text:
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Runtime.Serialization;
using SevenDigital.Api.Wrapper.Http;

namespace SevenDigital.Api.Wrapper.Requests
{
	[Serializable]
	public class Request : ISerializable
	{
		public Request(HttpMethod method, string url, IDictionary<string, string> headers, RequestPayload body)
		{
			Method = method;
			Url = url;
			Headers = headers;
			Body = body;
		}

		public Request(SerializationInfo info, StreamingContext context)
		{
			Method = HttpMethodHelpers.Parse(info.GetString("Method"));
			Url = info.GetString("Url");
			Body = (RequestPayload)info.GetValue("Body", typeof(RequestPayload));
			Headers = (IDictionary<string, string>)info.GetValue("Headers", typeof(IDictionary<string, string>));
		}

		public HttpMethod Method { get; private set; }

		public string Url { get; private set; }
		public IDictionary<string, string> Headers { get; private set; }
		public RequestPayload Body { get; private set; }

		/// <summary>
		/// we need to override serialisation as 'System.Net.Http.HttpMethod' is not a serializable type
		/// and these objects are attached to exceptions
		/// </summary>

		public void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.AddValue("Method", Method.ToString(), typeof(string));
			info.AddValue("Url", Url, typeof(string));
			info.AddValue("Body", Body);
			info.AddValue("Headers", Headers);
		}
	}
}


text:
#ifndef SPARE_PARTS_H
#define SPARE_PARTS_H
#include <joyos.h>
//#include "vector_math.h"
//int pick_next_point_y(int);

#define waypoints_length 18

enum COMPLETION {ok, error};      /* ok = 0, error = 1 */

typedef struct {
	int x,y;
	}point;

void delay(int);

int dist(int,int,int,int);
#endif


text:
package org.apache.spark.sql.execution.command.v1

import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.catalyst.catalog.CatalogDatabase
import org.apache.spark.sql.execution.command
import org.apache.spark.util.Utils

/**
 * This base suite contains unified tests for the `SHOW NAMESPACES` and `SHOW DATABASES` commands
 * that check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more
 * specific test suites:
 *
 *   - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowNamespacesSuite`
 *   - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowNamespacesSuite`
 */
trait ShowNamespacesSuiteBase extends command.ShowNamespacesSuiteBase {
  override protected def builtinTopNamespaces: Seq[String] = Seq("default")

  override protected def createNamespaceWithSpecialName(ns: String): Unit = {
    // Call `ExternalCatalog` directly to bypass the database name validation in `SessionCatalog`.
    spark.sharedState.externalCatalog.createDatabase(
      CatalogDatabase(
        name = ns,
        description = "",
        locationUri = Utils.createTempDir().toURI,
        properties = Map.empty),
      ignoreIfExists = false)
  }

  test("IN namespace doesn't exist") {
    val errMsg = intercept[AnalysisException] {
      sql("SHOW NAMESPACES in dummy")
    }.getMessage
    assert(errMsg.contains("Namespace 'dummy' not found"))
  }
}

class ShowNamespacesSuite extends ShowNamespacesSuiteBase with CommandSuiteBase {
  override def commandVersion: String = "V2" // There is only V2 variant of SHOW NAMESPACES.
}


text:
@interface FLEXResources : NSObject

#pragma mark - FLEX Toolbar Icons

@property (readonly, class) UIImage *closeIcon;
@property (readonly, class) UIImage *dragHandle;
@property (readonly, class) UIImage *globalsIcon;
@property (readonly, class) UIImage *hierarchyIcon;
@property (readonly, class) UIImage *recentIcon;
@property (readonly, class) UIImage *moveIcon;
@property (readonly, class) UIImage *selectIcon;

#pragma mark - Toolbar Icons

@property (readonly, class) UIImage *bookmarksIcon;
@property (readonly, class) UIImage *openTabsIcon;
@property (readonly, class) UIImage *moreIcon;
@property (readonly, class) UIImage *gearIcon;
@property (readonly, class) UIImage *scrollToBottomIcon;

#pragma mark - Content Type Icons

@property (readonly, class) UIImage *jsonIcon;
@property (readonly, class) UIImage *textPlainIcon;
@property (readonly, class) UIImage *htmlIcon;
@property (readonly, class) UIImage *audioIcon;
@property (readonly, class) UIImage *jsIcon;
@property (readonly, class) UIImage *plistIcon;
@property (readonly, class) UIImage *textIcon;
@property (readonly, class) UIImage *videoIcon;
@property (readonly, class) UIImage *xmlIcon;
@property (readonly, class) UIImage *binaryIcon;

#pragma mark - 3D Explorer Icons

@property (readonly, class) UIImage *toggle2DIcon;
@property (readonly, class) UIImage *toggle3DIcon;
@property (readonly, class) UIImage *rangeSliderLeftHandle;
@property (readonly, class) UIImage *rangeSliderRightHandle;
@property (readonly, class) UIImage *rangeSliderTrack;
@property (readonly, class) UIImage *rangeSliderFill;

#pragma mark - Misc Icons

@property(readonly, class) UIImage *checkerPattern;
@property(readonly, class) UIImage *hierarchyIndentPattern;

@end


text:
namespace Base64 {
template <class T> class DataReference {
    T first;
    size_t second;
public:
    DataReference(T data, size_t size) {
        first=data;
        second=size;
    }
    static DataReference null() {
        return DataReference(NULL,0);
    }
    explicit DataReference(const std::string&s) {
        first=s.data();
        second=s.length();
    }
    template <class U> explicit DataReference(const std::vector<U> &v) {
        if (v.empty()) {
            first=NULL;
            second=0;
        }else {
            first=(T)&v[0];
            second=v.size();
        }
    }
    T begin() const {
        return first;
    }
    T end() const {
        // FIXME: If second really is measured in bytes, why do we use void* and not char*?
        return (void*)(((char*)first)+second);
    }
    T data() const {
        return first;
    }
    size_t size() const {
        return second;
    }
    inline size_t length() const {
        return size();
    }
};

typedef DataReference<const void*> MemoryReference;

BRAIN_CORE_EXPORT void toBase64(std::vector<unsigned char>&retval,
              const MemoryReference&firstInput,
              const MemoryReference&secondInput);
BRAIN_CORE_EXPORT bool fromBase64(std::vector<unsigned char>&retval,
                const MemoryReference&a);
}

#endif


text:
module KenAll
  class OldSchemaException < StandardError
  end

  class Import
    URI = "http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip"

    def initialize(opt = { visualize: true })
      @visualizer = KenAll::Visualizer.new(opt[:visualize])
      return unless old_schema?

      error = <<~ERROR
        KenAll Error.
        This project is using old schema information.
        Type First.
        $ rake ken_all:install:migrations
        $ rake db:migrate
      ERROR
      raise KenAll::OldSchemaException.new(error)
    end

    def from_net
      @visualizer.screen_init do
        Tempfile.open("ken_all.zip") do |f|
          download_file(f)
          csv = zip_to_csv(f)
          import_model(csv)
        end
      end
    end

    def from_file
      if ENV["FILE"].present?
        if File.extname(ENV["FILE"]).downcase == '.zip'
          import_model zip_to_csv(ENV["FILE"])
        else
          CSV.open(ENV["FILE"],:encoding => "Shift_JIS:UTF-8") do |csv|
            import_model(csv)
          end
        end
      else
        puts "Specify FILE arguments."
        puts "rake ken_all:import:file FILE=/path/to/x-ken-all.csv"
      end
    end

    def download_file(file)
      @visualizer.download_status do
        file.binmode
        open(URI, 'rb') do |read_file|
          file.write(read_file.read)
        end
        file.rewind
      end
    end

    def zip_to_csv(zip_file)
      csv = nil
      @visualizer.unzip_status do
        # Use Zip::File for rubyzip >= 1.0.0, Zip::ZipFile for older.
        klass = defined?(Zip::File) ? Zip::File : Zip::ZipFile
        klass.foreach(zip_file) do |entry|
          File.extname(entry.name).downcase == '.csv' or next
          csv = CSV.parse(entry.get_input_stream.read.encode("utf-8", "sjis"))
          break
        end
      end
      csv
    end

    def import_model(csv)
      @visualizer.import_status do
        ActiveRecord::Base.transaction do
          header = [:code, :address1, :address2, :address3, :address_kana1, :address_kana2, :address_kana3]
          list = []
          merge = MergeBox.new
          csv.each do |row|
            post = Post.new(row)
            if post.adr_start?
              merge.add(post)
            elsif post.adr_end?
              merge.add(post)
              list << merge.to_array
              merge.clear
              next
            elsif merge.count > 0
              merge.add(post)
            else
              list << post.to_array
            end
          end
          KenAll::PostalCode.delete_all
          KenAll::PostalCode.import(header, list)
        end
      end
    end

    private

      def old_schema?
        column = KenAll::PostalCode.columns.find { |v| v.name == 'address1' }
        column.sql_type !~ /text/
      end
  end
end


text:
<!DOCTYPE html>

<title>Pretech blog testing web sockets</title>

		<input type="text" id="userinput" />
 <input type="submit"
			value="Send Message to Server" onclick="start()" />


text:
var controlShow = document.querySelectorAll('.control-show')[0];
var controlHide = document.querySelectorAll('.control-hide')[0];
//elements is for the classes your targeting and toggleClass is for the classes you are removing
var blockToggle = function(elements, toggleClass) {

  var blockArray = document.querySelectorAll(elements);
  //Checks through the array of block--fill and removes the hide or includes it
  //It won't remove all the blocks in the array since I'm only checking if greater than 0
  for(var i =  blockArray.length - 1; i > 0; i--) {
    if(blockArray[i].classList.contains('flavin_block--hide') && toggleClass) {
      blockArray[i].classList.remove('flavin_block--hide');
      return;
    } else if(!blockArray[i].classList.contains('flavin_block--hide') && !toggleClass){
      blockArray[i].classList.add('flavin_block--hide');
      return;
    }

  }

};

controlShow.addEventListener('click', function() {
  blockToggle('#flavin-controls .flavin_block--fill', true);
});

controlHide.addEventListener('click', function() {
  blockToggle('#flavin-controls .flavin_block--fill', false);
});


text:
.class Lcom/android/internal/os/storage/ExternalStorageFormatter$UsbStorageFormatterStringGetter;
.super Lcom/android/internal/os/storage/ExternalStorageFormatter$StorageFormatterStringGetter;
.source "ExternalStorageFormatter.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/os/storage/ExternalStorageFormatter;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "UsbStorageFormatterStringGetter"
.end annotation

# direct methods
.method private constructor <init>()V
    .locals 1

    .prologue
    .line 286
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/android/internal/os/storage/ExternalStorageFormatter$StorageFormatterStringGetter;-><init>(Lcom/android/internal/os/storage/ExternalStorageFormatter$1;)V

    return-void
.end method

.method synthetic constructor <init>(Lcom/android/internal/os/storage/ExternalStorageFormatter$1;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 286
    invoke-direct {p0}, Lcom/android/internal/os/storage/ExternalStorageFormatter$UsbStorageFormatterStringGetter;-><init>()V

    return-void
.end method

# virtual methods
.method getStringBadRemoval()I
    .locals 1

    .prologue
    .line 290
    const v0, 0x10400fb

    return v0
.end method

.method getStringFormatError()I
    .locals 1

    .prologue
    .line 314
    const v0, 0x10400fa

    return v0
.end method

.method getStringMediaChecking()I
    .locals 1

    .prologue
    .line 294
    const v0, 0x10400f8

    return v0
.end method

.method getStringMediaRemoved()I
    .locals 1

    .prologue
    .line 298
    const v0, 0x10400fc

    return v0
.end method

.method getStringMediaShared()I
    .locals 1

    .prologue
    .line 302
    const v0, 0x10400fd

    return v0
.end method

.method getStringProgressErasing()I
    .locals 1

    .prologue
    .line 306
    const v0, 0x10400f7

    return v0
.end method

.method getStringProgressUnmounting()I
    .locals 1

    .prologue
    .line 310
    const v0, 0x10400f9

    return v0
.end method


text:
<?php

namespace AppBundle\Form\Type\Api;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TrackType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('number', TextType::class)
            ->add('name', TextType::class)
            ->add('duration', IntegerType::class)
            ->add('bpm', IntegerType::class)
            ->add('album', AlbumSelectorType::class)
            ->add('artists', ArtistSelectorType::class)
        ;
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => \AppBundle\Entity\Track::class,
            'csrf_protection' => false,
        ]);
    }
}


text:
package com.illposed.osc;

import com.illposed.osc.utility.OSCByteArrayToJavaConverter;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author Chandrasekhar Ramakrishnan
 * @see OSCBundle
 */
public class OSCBundleTest {

	private void sendBundleTimestampTestHelper(OSCBundle bundle, Date expectedTimestamp) {
		byte[] byteArray = bundle.getByteArray();
		OSCByteArrayToJavaConverter converter = new OSCByteArrayToJavaConverter();
		OSCBundle packet = (OSCBundle) converter.convert(byteArray, byteArray.length);
		if (!packet.getTimestamp().equals(expectedTimestamp)) {
			Assert.fail("Send Bundle did not receive the correct timestamp " + packet.getTimestamp()
				+ "(" + packet.getTimestamp().getTime() +
				") (should be " + expectedTimestamp +"( " + expectedTimestamp.getTime() + ")) ");
		}
		List<OSCPacket> packets = packet.getPackets();
		OSCMessage msg = (OSCMessage) packets.get(0);
		if (!msg.getAddress().equals("/dummy")) {
			Assert.fail("Send Bundle's message did not receive the correct address");
		}
	}

	@Test
	public void testSendBundle() {
		Date timestampNow = GregorianCalendar.getInstance().getTime();
		List<OSCPacket> packetsSent = new ArrayList<OSCPacket>(1);
		packetsSent.add(new OSCMessage("/dummy"));
		OSCBundle bundle = new OSCBundle(packetsSent, timestampNow);
		sendBundleTimestampTestHelper(bundle, timestampNow);
	}

	@Test
	public void testSendBundleImmediate() {
		List<OSCPacket> packetsSent = new ArrayList<OSCPacket>(1);
		packetsSent.add(new OSCMessage("/dummy"));
		OSCBundle bundle = new OSCBundle(packetsSent);
		sendBundleTimestampTestHelper(bundle, OSCBundle.TIMESTAMP_IMMEDIATE);
	}

	@Test
	public void testSendBundleImmediateExplicit() {
		Date timestampNow = GregorianCalendar.getInstance().getTime();
		List<OSCPacket> packetsSent = new ArrayList<OSCPacket>(1);
		packetsSent.add(new OSCMessage("/dummy"));
		OSCBundle bundle = new OSCBundle(packetsSent, timestampNow);
		bundle.setTimestamp(OSCBundle.TIMESTAMP_IMMEDIATE);
		sendBundleTimestampTestHelper(bundle, OSCBundle.TIMESTAMP_IMMEDIATE);
	}

	@Test
	public void testSendBundleImmediateExplicitNull() {
		Date timestampNow = GregorianCalendar.getInstance().getTime();
		List<OSCPacket> packetsSent = new ArrayList<OSCPacket>(1);
		packetsSent.add(new OSCMessage("/dummy"));
		OSCBundle bundle = new OSCBundle(packetsSent, timestampNow);
		bundle.setTimestamp(null);
		sendBundleTimestampTestHelper(bundle, OSCBundle.TIMESTAMP_IMMEDIATE);
	}
}


text:
package com.grayben.riskExtractor.htmlScorer.partScorers.elementScorers;

import com.grayben.riskExtractor.htmlScorer.partScorers.Scorer;
import com.grayben.riskExtractor.htmlScorer.partScorers.ScorerTest;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Tag;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;

import static com.grayben.riskExtractor.helpers.TestHelper.dummyAttributes;
import static com.grayben.riskExtractor.helpers.TestHelper.stubElement;
import static com.grayben.riskExtractor.helpers.TestHelper.stubTag;

/**
 * Created by beng on 23/12/2015.
 */
@RunWith(MockitoJUnitRunner.class)
public abstract class ElementScorerBaseTest extends ScorerTest<Element> {

    private Scorer<Element> elementScorerSUT;

    @Override
    protected void setScorerSUT(Scorer<Element> elementScorer){
        this.elementScorerSUT = elementScorer;
        super.setScorerSUT(this.elementScorerSUT);

    }

    private Element elementToBeScored;

    @Override
    protected void setArgumentToBeScored(Element elementToBeScored){
        this.elementToBeScored = elementToBeScored;
        super.setArgumentToBeScored(this.elementToBeScored);
    }

    @Before
    public void setUp() throws Exception {
        super.setUp();
    }
    @After
    public void tearDown() throws Exception {
        super.tearDown();
    }

    @Test
    public void
    test_ScoreThrowsIllegalArgumentException_WhenTagIsEmpty() throws Exception {

        Tag tagStub = stubTag("");
        Mockito.when(tagStub.isEmpty()).thenReturn(true);

        Attributes attributes = dummyAttributes();

        elementToBeScored = stubElement(tagStub, attributes);

        thrown.expect(IllegalArgumentException.class);

        elementScorerSUT.score(elementToBeScored);
    }

}


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

namespace dw\template;

/**
 * Allows us to include other Template files by using the dw:partial tag
 */
class PartialAction implements ITemplateAction {

	function __construct() {}

	/**
	 * Parse this action and return it's output as string
	 * @param  \DOMElement $node Input node
	 * @return string|array
	 */
	public function parse( \DOMElement $node ) {
		if ( $node->hasAttribute( 'src' ) ) {
			$src = (string) $node->getAttribute( 'src' );
			$template = new \dw\Template( $src );
			$output = $template->render( true, false );

			if ( $node->hasAttribute( 'stylesheet' ) ) {
				$attr = (string) $node->getAttribute( 'stylesheet' );
				Registry::registerStyle( empty( $attr ) ? $src : $attr );
			}

			if ( $node->hasAttribute( 'javascript' ) ) {
				$attr = (string) $node->getAttribute( 'javascript' );
				Registry::registerScript( empty( $attr ) ? $src : $attr );
			}

			return $output;
		}

		return null;
	}

	/**
	 * Parse an attribute
	 * @param  \string $attributeName
	 * @param  \string $attributeValue
	 * @return string
	 */
	public function parseAttribute( string $attributeName, string $attributeValue ): string {
		return $attributeValue;
	}

}
?>


text:
package org.gluu.oxtrust.model;

import java.util.HashMap;
import java.util.Map;

import org.gluu.site.ldap.persistence.annotation.LdapEnum;

/**
 * Metadata source type
 *
 * @author Yuriy Movchan Date: 11.05.2010
 */
public enum GluuMetadataSourceType implements LdapEnum {

	NONE("none", "None") ,FILE("file", "File"), URI("uri", "URI"), GENERATE("generate", "Generate"), FEDERATION("federation", "Federation");

	private final String value;
	private final String displayName;

	private static final Map<String, GluuMetadataSourceType> mapByValues = new HashMap<String, GluuMetadataSourceType>();
	static {
		for (GluuMetadataSourceType enumType : values()) {
			mapByValues.put(enumType.getValue(), enumType);
		}
	}

	private GluuMetadataSourceType(String value, String displayName) {
		this.value = value;
		this.displayName = displayName;
	}

        @Override
	public String getValue() {
		return value;
	}

	public String getDisplayName() {
		return displayName;
	}

	public static GluuMetadataSourceType getByValue(String value) {
		return mapByValues.get(value);
	}

        @Override
	public Enum<? extends LdapEnum> resolveByValue(String value) {
		return getByValue(value);
	}

	@Override
	public String toString() {
		return value;
	}

}


text:
class CreateTableUsers < DynamoDB::Migration::Unit
  def update
    client.create_table(
      table_name: "users",
      attribute_definitions: [
        {
          attribute_name: "username",
          attribute_type: "S",
        },
      ],
      key_schema: [
        {
          attribute_name: "username",
          key_type: "HASH",
        },
      ],
      provisioned_throughput: {
        read_capacity_units: 1,
        write_capacity_units: 1,
      },
      stream_specification: {
        stream_enabled: true,
        stream_view_type: "NEW_AND_OLD_IMAGES",
      },
    )
  end
end


text:
/**
 * DataHibernatorWorker.java
 *
 * Created on 24 October 2007, 18:10
 *
 * To change this template, choose Tools | Template Manager and open the template in the editor.
 */

package uk.co.sleonard.unison.input;

import java.util.ArrayList;
import java.util.ListIterator;
import java.util.concurrent.LinkedBlockingQueue;

import org.apache.log4j.Logger;
import org.hibernate.Session;

import uk.co.sleonard.unison.UNISoNController;
import uk.co.sleonard.unison.UNISoNException;
import uk.co.sleonard.unison.UNISoNLogger;
import uk.co.sleonard.unison.datahandling.HibernateHelper;

/**
 * The Class DataHibernatorWorker.
 *
 * @author Stephen <github@leonarduk.com>
 * @since v1.0.0
 *
 */
public class DataHibernatorWorker extends SwingWorker {

	/** The logger. */
	private static Logger logger = Logger.getLogger("DataHibernatorWorker");

	/** The number of hibernators. */
	private static int numberofHibernators = 20;

	/** The log. */
	private static UNISoNLogger log;

	/** The workers. */
	private static ArrayList<DataHibernatorWorker> workers = new ArrayList<>();

	/** The reader. */
	private final NewsGroupReader reader;

	/** The save to database. */
	private boolean saveToDatabase = true;

	private final HibernateHelper helper;

	/**
	 * Sets the logger.
	 *
	 * @param logger
	 *            the new logger
	 */
	public static void setLogger(final UNISoNLogger logger) {
		DataHibernatorWorker.log = logger;
	}

	/**
	 * Start hibernators.
	 */
	public synchronized static void startHibernators() {
		while (DataHibernatorWorker.workers.size() < DataHibernatorWorker.numberofHibernators) {
			DataHibernatorWorker.workers
			        .add(new DataHibernatorWorker(UNISoNController.getInstance().getNntpReader()));
		}
	}

	/**
	 * Stop download.
	 */
	static void stopDownload() {
		for (final ListIterator<DataHibernatorWorker> iter = DataHibernatorWorker.workers
		        .listIterator(); iter.hasNext();) {
			iter.next().interrupt();
		}
	}

	/**
	 * Creates a new instance of DataHibernatorWorker.
	 *
	 * @param reader
	 *            the reader
	 */
	private DataHibernatorWorker(final NewsGroupReader reader) {
		super("DataHibernatorWorker");
		this.helper = UNISoNController.getInstance().helper();

		this.reader = reader;
		DataHibernatorWorker.logger
		        .debug("Creating " + this.getClass() + " " + reader.getNumberOfMessages());
		this.start();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see uk.co.sleonard.unison.input.SwingWorker#construct()
	 */
	@Override
	public Object construct() {
		final LinkedBlockingQueue<NewsArticle> queue = UNISoNController.getInstance().getQueue();
		DataHibernatorWorker.logger
		        .debug("construct : " + this.saveToDatabase + " queue " + queue.size());

		try {
			// HAve one session per worker rather than per message
			final Session session = UNISoNController.getInstance().helper().getHibernateSession();
			while (this.saveToDatabase) {
				this.pollQueue(queue, session);
				// wait a second
				Thread.sleep(5000);
				// completed save so close down
				if (queue.isEmpty()) {
					this.saveToDatabase = false;
				}
			}
			DataHibernatorWorker.workers.remove(this);
			if (DataHibernatorWorker.workers.size() == 0) {
				DataHibernatorWorker.log.alert("Download complete");
			}
		}
		catch (@SuppressWarnings("unused") final InterruptedException e) {
			return "Interrupted";
		}
		catch (final UNISoNException e) {
			DataHibernatorWorker.log.alert("Error: " + e.getMessage());
		}
		return "Completed";
	}

	/**
	 * Poll for message.
	 *
	 * @param queue
	 *            the queue
	 * @return the news article
	 */
	private synchronized NewsArticle pollForMessage(final LinkedBlockingQueue<NewsArticle> queue) {
		final NewsArticle article = queue.poll();
		return article;
	}

	private void pollQueue(final LinkedBlockingQueue<NewsArticle> queue, final Session session)
	        throws InterruptedException {
		while (!queue.isEmpty()) {
			if (Thread.interrupted()) {
				this.stopHibernatingData();
				throw new InterruptedException();
			}

			final NewsArticle article = this.pollForMessage(queue);
			if (null != article) {
				DataHibernatorWorker.logger
				        .debug("Hibernating " + article.getArticleId() + " " + queue.size());

				if (this.helper.hibernateData(article, session)) {
					this.reader.incrementMessagesStored();
				}
				else {
					this.reader.incrementMessagesSkipped();
				}
				this.reader.showDownloadStatus();
			}
		}
	}

	/**
	 * Stop hibernating data.
	 */
	private void stopHibernatingData() {
		DataHibernatorWorker.logger.warn("StopHibernatingData");
		this.saveToDatabase = false;
	}
}


text:
export namespace Listing {

    export interface Range {
        Lower: string;
        Upper: string;
    }

    export interface Option {
        Value: string;
        Display: string;
        Count: number;
    }

    export interface Unit {
        Display: string;
        Multiplier: number;
    }

    export interface Attribute {
        Name: string;
        DisplayName: string;
        Value: string;
        Type: number;
        Range: Range;
        MaxStringLength: number;
        Options: Option[];
        Units: Unit[];
        Unit: string;
        IsRequiredForSell: boolean;
        EncodedValue: string;
        GroupName: string;
        DisplayValue: string;
    }

    export interface Contact {
        FullName: string;
        PhoneNumber: string;
        AlternatePhoneNumber: string;
        EMail: string;
        BrandingImageId: number;
        AgentId: string;
    }

    export interface EmbeddedContent {
        YouTubeVideoKey: string;
    }

    export interface Value {
        Thumbnail: string;
        List: string;
        Medium: string;
        Gallery: string;
        Large: string;
        FullSize: string;
        PlusSize: string;
        PhotoId: number;
        OriginalWidth: number;
        OriginalHeight: number;
    }

    export interface Photo {
        PhotoId: number;
        Value: Value;
    }

    export interface RequestBase {
        Category: string;
        Title: string;
        Description: string[];
        Duration?: number;
        EndDateTime?: Date;
        IsClassified: boolean;
        IsFeatured: boolean;
        PhotoIds?: number[];
        Attributes: Attribute[];
        ExternalReferenceId?: string;
        ReturnListingDetails?: boolean;
        EmbeddedContent: EmbeddedContent;
        IsBranded: boolean;
        ShortDescription: string;
        Photos?: Photo[];
    }

    export interface Request extends RequestBase {
        ListingId?: number;
    }

    export interface Response {
        Success: boolean;
        Description: string;
        ListingId: number;
    }

}


text:
namespace Tests.Lexicon
{
    using Xunit;
    using SilverNeedle.Lexicon;

    public class PhraseTemplateTests : RequiresDataFiles
    {
        [Fact]
        public void PhrasesCanCompileTemplates()
        {
            var template = "Hello {{name}}.";
            var phrase = new PhraseTemplate(template);
            var context = new PhraseContext()
            { { "name", "Bob" } };
            var result = phrase.WritePhrase(context);
            Assert.Equal("Hello Bob.", result);

        }

        [Fact]
        public void PhrasesCanCascadeCallsToOtherTemplatesIfNecessary()
        {
            var template = "Good Day, {{name}}.";
            var phrase = new PhraseTemplate(template);
            var context = new PhraseContext() {
                { "name", "{{fullname}}" },
                { "fullname", "Bob Woodward"}
            };
            var result = phrase.WritePhrase(context);
            Assert.Equal("Good Day, Bob Woodward.", result);
        }
    }
}


text:
IS_SANDBOXED = true
APPCAST_PATH = "./appcast.xml"

app = "./CotEditor.app"

unless Dir.exist?(app) then
	puts "Dir not found : #{app}"
	exit
end

version = `/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" #{app}/Contents/Info.plist`.chomp
puts "Version #{version}"

dmg = "./CotEditor_#{version}.dmg"

unless File.exist?(dmg) then
	puts "File not found : #{dmg}"
	exit
end

if File.exist?(APPCAST_PATH) then
	puts "Already exist : #{APPCAST_PATH}"
	exit
end

dsa_priv = "./sparkle/dsa_priv.pem"

unless File.exist?(dsa_priv) then
	puts "File not found : #{dsa_priv}"
	exit
end

# Sparkle signature
dsa = `openssl dgst -sha1 -binary < "#{dmg}" | openssl dgst -dss1 -sign "#{dsa_priv}" | openssl enc -base64`.chomp

# DMG file information
require 'time'
date = File.mtime(dmg).rfc822
length = File.size(dmg)

# craate last item code
if IS_SANDBOXED then
	latest_item = <<-APPCAST_ITEM
		<item>
			<title>CotEditor #{version}</title>
			<sparkle:releaseNotesLink xml:lang="en">http://coteditor.com/releasenotes/#{version}.en.html</sparkle:releaseNotesLink>
			<sparkle:releaseNotesLink xml:lang="ja">http://coteditor.com/releasenotes/#{version}.ja.html</sparkle:releaseNotesLink>
			<pubDate>#{date}</pubDate>
			<sparkle:minimumSystemVersion>10.8</sparkle:minimumSystemVersion>
			<sparkle:version>#{version}</sparkle:version>
            <link>http://coteditor.com/</link>
		</item>
	APPCAST_ITEM
else
	# normal appcast
	latest_item = <<-APPCAST_ITEM
		<item>
			<title>CotEditor #{version}</title>
			<sparkle:releaseNotesLink xml:lang="en">http://coteditor.com/releasenotes/#{version}.en.html</sparkle:releaseNotesLink>
			<sparkle:releaseNotesLink xml:lang="ja">http://coteditor.com/releasenotes/#{version}.ja.html</sparkle:releaseNotesLink>
			<pubDate>#{date}</pubDate>
			<sparkle:minimumSystemVersion>10.8</sparkle:minimumSystemVersion>
			<enclosure url="https://github.com/coteditor/CotEditor/releases/download/#{version}/CotEditor_#{version}.dmg"
			           sparkle:version="#{version}"
			           sparkle:dsaSignature="#{dsa}"
			           length="#{length}"
			           type="application/octet-stream"/>
		</item>
	APPCAST_ITEM
end

# Output appcast
open(APPCAST_PATH, "w") { |file|
file.puts <<APPCAST
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>CotEditor update information</title>
		<link>http://coteditor.com/releasenotes/appcast.xml</link>
		<description>CotEditor update information</description>
#{latest_item}
		<item>
			<title>CotEditor 2.0.3</title>
			<sparkle:releaseNotesLink xml:lang="en">http://coteditor.com/releasenotes/2.0.3.en.html</sparkle:releaseNotesLink>
			<sparkle:releaseNotesLink xml:lang="ja">http://coteditor.com/releasenotes/2.0.3.ja.html</sparkle:releaseNotesLink>
			<pubDate>Sun, 14 Dec 2014 21:19:19 +0900</pubDate>
			<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
			<enclosure url="https://github.com/coteditor/CotEditor/releases/download/2.0.3/CotEditor_2.0.3.dmg"
			           sparkle:version="2.0.3"
			           sparkle:dsaSignature="MC0CFQC/u3nS+yqNHrr1+EghgQksnBlF2AIUfJ5SyL10uO1jSK01ZQgXM3xBE5s="
			           length="14414610"
			           type="application/octet-stream"/>
		</item>
	</channel>
</rss>
APPCAST
}

puts "Created appcast for #{version}."


text:
<script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-33073396-1']);
    _gaq.push(['_trackPageview']);

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

</script>
<script type="text/javascript" charset="utf-8">
    document.onreadystatechange = function() {
        if ( document.readyState == 'complete' ) {
            var active = document.querySelector( 'header nav.main a.active' ).innerHTML.toLowerCase(),
                links = document.querySelectorAll( 'header nav.main li a'),
                selection = document.querySelector( 'header .nav-selection' ),
                subactive = document.querySelector( 'header nav.subnav a.active' ).dataset.subnav,
                sublinks = document.querySelectorAll( 'header nav.subnav li a'),
                subselection = document.querySelector( 'header .subnav-selection' ),
                i, j, link;
            for ( i = 0; i < links.length; i++ ) {
                link = links[ i ];
                link.addEventListener( 'mouseover', function() {
                    selection.className = 'nav-selection';
                    selection.className = 'nav-selection ' + this.innerHTML.toLowerCase();
                });
                link.addEventListener( 'mouseout', function() {
                    selection.className = 'nav-selection ' + active;
                });
            }
            for ( i = 0; i < sublinks.length; i++ ) {
                link = sublinks[ i ];
                link.addEventListener( 'mouseover', function() {
                    subselection.className = 'subnav-selection';
                    subselection.className = 'subnav-selection ' + this.dataset.subnav;
                });
                link.addEventListener( 'mouseout', function() {
                    subselection.className = 'subnav-selection ' + subactive;
                });
            }
        }
    };
</script>


text:
package test.types;

import junit.framework.TestCase;
import org.apache.axis.types.PositiveInteger;

/**
 * Test validation of types.positiveInteger
 */
public class TestPositiveInteger extends TestCase {

    public TestPositiveInteger(String name) {
        super(name);
    }

    /**
     * Run a failure test.  value should be invalid.
     */
    private void runFailTest(String value) throws Exception {
        PositiveInteger oPositiveInteger = null;
        try {
            oPositiveInteger = new PositiveInteger(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        // object is not iNstantiated on bad data value
        assertNull("validation restriction failed [" +
                value + "]. did not restrict bad value.", oPositiveInteger);
    }

    /**
     * Run a successful test.  value should be valid.
     */
    private void runPassTest(String value) throws Exception {
        PositiveInteger oPositiveInteger = null;
        try {
            oPositiveInteger = new PositiveInteger(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        assertEquals("positive integer not equal" +
                value, oPositiveInteger.toString(), value);
    }

    /**
     * Test that a positive value succeeeds
     */
    public void TestPositiveValue() throws Exception {
        runPassTest("12345678901234567890");
    }

    /**
     * Test that a negative number fails
     */
    public void testNegativeValue() throws Exception {
        runFailTest("-123");
    }

    /**
    * Test that a number at MinInclusive succeeds
    */
    public void testMinExclusive() throws Exception {
       runPassTest("1");
    }

    /**
    * Test that a number less than MinInclusive fails
    */
    public void testBelowMinExclusive() throws Exception {
       runFailTest("0");
    }

}


text:
layout: page
title: Jennings Studios Trade Fair
date: 2016-05-24
author: Karen Monroe
tags: weekly links, java
status: published
summary: Aenean dapibus ex a magna eleifend cursus.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 06/13/2017
  endDate: 06/16/2017
  ctyhocn: DENHLHX
  groupCode: JSTF
published: true
---
Quisque dapibus, leo a laoreet euismod, augue diam tincidunt nulla, ac blandit velit odio eu magna. Sed eu pellentesque felis. Maecenas est est, congue vitae lacus sed, dapibus porta ligula. Integer ut tellus accumsan ex suscipit ullamcorper. Quisque sit amet nisi pretium magna cursus gravida et in dui. Vivamus porttitor sapien non mi finibus gravida. Ut a magna mauris. Phasellus eu congue sem. Vestibulum dolor est, laoreet varius nisi a, imperdiet faucibus tellus. Morbi tempus massa ut arcu aliquet lacinia.
Phasellus non diam dictum, commodo diam id, venenatis libero. Mauris lacus dolor, sollicitudin quis eleifend nec, scelerisque et nulla. Ut dignissim neque vitae auctor malesuada. Donec pretium, tortor at sodales tempus, erat velit maximus purus, quis interdum ante enim ac nisl. Etiam tristique, dolor vel laoreet fermentum, ligula felis tempor est, luctus malesuada ipsum nibh a ipsum. Pellentesque commodo tincidunt neque, ut vulputate est volutpat vel. Phasellus quis dolor et massa porta vulputate. Vivamus malesuada diam eget nisi interdum lobortis. Fusce rutrum cursus faucibus. Proin eget sodales nisi, varius euismod turpis. Cras ornare lorem dui, et fringilla lectus egestas vel. Nullam orci elit, dapibus id neque non, convallis vulputate nunc. Fusce hendrerit sapien pellentesque sem volutpat, in feugiat libero commodo. Phasellus interdum dignissim mauris, vitae varius nibh.

1 Praesent quis odio porta, molestie sapien at, elementum eros
1 Donec ultricies turpis vel lorem imperdiet, at mattis felis iaculis
1 Phasellus facilisis nibh nec purus fringilla ultrices
1 Quisque et massa egestas, sodales ipsum vel, sagittis augue
1 Nullam dictum felis at tellus interdum molestie.

Ut purus diam, accumsan nec odio sit amet, feugiat pulvinar nulla. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque urna risus, vehicula a orci quis, malesuada sollicitudin tellus. Proin a dolor maximus, rhoncus risus blandit, placerat risus. Maecenas euismod nec lectus in convallis. Etiam at erat nec quam feugiat hendrerit. Mauris efficitur velit sed velit lacinia, at maximus enim laoreet.


text:
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Alessandro Tasora
// =============================================================================

#include "chrono/assets/ChTexture.h"
#include "chrono/core/ChClassFactory.h"

namespace chrono {

// Register into the object factory, to enable run-time dynamic creation and persistence
CH_FACTORY_REGISTER(ChTexture)

void ChTexture::ArchiveOUT(ChArchiveOut& marchive) {
    // version number
    marchive.VersionWrite<ChTexture>();
    // serialize parent class
    ChAsset::ArchiveOUT(marchive);
    // serialize all member data:
    marchive << CHNVP(filename);
}

void ChTexture::ArchiveIN(ChArchiveIn& marchive) {
    // version number
    /*int version =*/ marchive.VersionRead<ChTexture>();
    // deserialize parent class
    ChAsset::ArchiveIN(marchive);
    // stream in all member data:
    marchive >> CHNVP(filename);
}

}  // end namespace chrono


text:
package org.apache.camel.component.beanstalk.processors;

import com.surftools.BeanstalkClient.Client;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.NoSuchHeaderException;
import org.apache.camel.component.beanstalk.BeanstalkEndpoint;
import org.apache.camel.component.beanstalk.BeanstalkExchangeHelper;
import org.apache.camel.component.beanstalk.Headers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PutCommand extends DefaultCommand {
    private static final Logger LOG = LoggerFactory.getLogger(PutCommand.class);

    public PutCommand(BeanstalkEndpoint endpoint) {
        super(endpoint);
    }

    @Override
    public void act(final Client client, final Exchange exchange) throws NoSuchHeaderException {
        final Message in = exchange.getIn();

        final long priority = BeanstalkExchangeHelper.getPriority(endpoint, in);
        final int delay = BeanstalkExchangeHelper.getDelay(endpoint, in);
        final int timeToRun = BeanstalkExchangeHelper.getTimeToRun(endpoint, in);

        final long jobId = client.put(priority, delay, timeToRun, in.getBody(byte[].class));
        if (LOG.isDebugEnabled()) {
            LOG.debug(String.format("Created job %d with priority %d, delay %d seconds and time to run %d", jobId, priority, delay, timeToRun));
        }

        answerWith(exchange, Headers.JOB_ID, jobId);
    }
}


text:
package org.http4s.blaze.http.http2

import java.nio.ByteBuffer

/** Type that can be polled for the ability to write bytes */
private trait WriteInterest {

  /** Invoked by the [[WriteController]] that this `WriteInterest` is registered with.
    *
    * Before being invoked, `this` must be unregistered from the [[WriteController]] and it is safe
    * to add `this` back as an interest before returning the corresponding data, if desired.
    *
    * @note
    *   this method will be called by the `WriteController` from within the sessions serial
    *   executor.
    */
  def performStreamWrite(): collection.Seq[ByteBuffer]
}


text:
namespace llvm {
namespace codeview {

/// Merges one type stream into another. Returns true on success.
bool mergeTypeStreams(TypeTableBuilder &DestStream, const CVTypeArray &Types);

} // end namespace codeview
} // end namespace llvm

#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H


text:
#ifndef NASM_INSNS_H
#define NASM_INSNS_H

#include "nasm.h"
#include "tokens.h"
#include "iflag.h"

/* if changed, ITEMPLATE_END should be also changed accordingly */
struct itemplate {
    enum opcode     opcode;             /* the token, passed from "parser.c" */
    int             operands;           /* number of operands */
    opflags_t       opd[MAX_OPERANDS];  /* bit flags for operand types */
    decoflags_t     deco[MAX_OPERANDS]; /* bit flags for operand decorators */
    const uint8_t   *code;              /* the code it assembles to */
    uint32_t        iflag_idx;          /* some flags referenced by index */
};

/* Use this helper to test instruction template flags */
static inline bool itemp_has(const struct itemplate *itemp, unsigned int bit)
{
    return iflag_test(&insns_flags[itemp->iflag_idx], bit);
}

/* Disassembler table structure */

/*
 * If n == -1, then p points to another table of 256
 * struct disasm_index, otherwise p points to a list of n
 * struct itemplates to consider.
 */
struct disasm_index {
    const void *p;
    int n;
};

/* Tables for the assembler and disassembler, respectively */
extern const struct itemplate * const nasm_instructions[];
extern const struct disasm_index itable[256];
extern const struct disasm_index * const itable_vex[NASM_VEX_CLASSES][32][4];

/* Common table for the byte codes */
extern const uint8_t nasm_bytecodes[];

/*
 * this define is used to signify the end of an itemplate
 */
#define ITEMPLATE_END {I_none,0,{0,},{0,},NULL,0}

/*
 * Pseudo-op tests
 */
/* DB-type instruction (DB, DW, ...) */
static inline bool const_func opcode_is_db(enum opcode opcode)
{
    return opcode >= I_DB && opcode < I_RESB;
}

/* RESB-type instruction (RESB, RESW, ...) */
static inline bool const_func opcode_is_resb(enum opcode opcode)
{
    return opcode >= I_RESB && opcode < I_INCBIN;
}

/* Width of Dx and RESx instructions */

/*
 * initialized data bytes length from opcode
 */
static inline int const_func db_bytes(enum opcode opcode)
{
    switch (opcode) {
    case I_DB:
        return 1;
    case I_DW:
        return 2;
    case I_DD:
        return 4;
    case I_DQ:
        return 8;
    case I_DT:
        return 10;
    case I_DO:
        return 16;
    case I_DY:
        return 32;
    case I_DZ:
        return 64;
    case I_none:
        return -1;
    default:
        return 0;
    }
}

/*
 * Uninitialized data bytes length from opcode
 */
static inline int const_func resb_bytes(enum opcode opcode)
{
    switch (opcode) {
    case I_RESB:
        return 1;
    case I_RESW:
        return 2;
    case I_RESD:
        return 4;
    case I_RESQ:
        return 8;
    case I_REST:
        return 10;
    case I_RESO:
        return 16;
    case I_RESY:
        return 32;
    case I_RESZ:
        return 64;
    case I_none:
        return -1;
    default:
        return 0;
    }
}

#endif /* NASM_INSNS_H */


text:
require 'diamond/classify'
require 'diamond/download'
require 'diamond/parse'
require 'diamond/dates'


text:
package com.dremio.dac.service.datasets;

import java.security.Principal;
import java.util.List;

import javax.inject.Provider;
import javax.ws.rs.core.SecurityContext;

import org.apache.arrow.memory.BufferAllocator;

import com.dremio.dac.explore.DatasetTool;
import com.dremio.dac.explore.DatasetVersionResource;
import com.dremio.dac.explore.QueryExecutor;
import com.dremio.dac.explore.Transformer;
import com.dremio.dac.explore.model.DatasetPath;
import com.dremio.dac.explore.model.InitialPreviewResponse;
import com.dremio.dac.proto.model.dataset.FromSQL;
import com.dremio.dac.proto.model.dataset.TransformUpdateSQL;
import com.dremio.dac.proto.model.dataset.VirtualDatasetUI;
import com.dremio.dac.util.DatasetsUtil;
import com.dremio.datastore.api.LegacyKVStoreProvider;
import com.dremio.exec.catalog.ViewCreatorFactory;
import com.dremio.exec.server.ContextService;
import com.dremio.exec.store.CatalogService;
import com.dremio.service.InitializerRegistry;
import com.dremio.service.jobs.JobsService;
import com.dremio.service.namespace.NamespaceAttribute;
import com.dremio.service.namespace.NamespaceKey;
import com.dremio.service.namespace.NamespaceService;
import com.dremio.service.namespace.dataset.DatasetVersion;
import com.dremio.service.namespace.dataset.proto.DatasetConfig;
import com.google.common.base.Throwables;

/**
 * Implementation of ViewCreatorFactory for DAC backend
 */
public class DACViewCreatorFactory implements ViewCreatorFactory {
  private final Provider<InitializerRegistry> initializerRegistry;
  private final Provider<LegacyKVStoreProvider> kvStoreProvider;
  private final Provider<JobsService> jobsService;
  private final Provider<NamespaceService.Factory> namespaceServiceFactory;
  private final Provider<ContextService> contextService;
  private final Provider<CatalogService> catalogService;
  private final BufferAllocator allocator;

  public DACViewCreatorFactory(Provider<InitializerRegistry> initializerRegistry,
                                Provider<LegacyKVStoreProvider> kvStoreProvider,
                                Provider<JobsService> jobsService,
                                Provider<NamespaceService.Factory> namespaceServiceFactory,
                                Provider<CatalogService> catalogService,
                                Provider<ContextService> contextService,
                                Provider<BufferAllocator> allocator
  ) {
    this.initializerRegistry = initializerRegistry;
    this.kvStoreProvider = kvStoreProvider;
    this.jobsService = jobsService;
    this.namespaceServiceFactory = namespaceServiceFactory;
    this.catalogService = catalogService;
    this.contextService = contextService;
    this.allocator = allocator.get().newChildAllocator(getClass().getName(), 0, Long.MAX_VALUE);
  }

  @Override
  public ViewCreator get(String userName) {
    return new DACViewCreator(userName);
  }

  /**
   *
   */
  protected class DACViewCreator implements ViewCreator {
    private final String userName;
    private final JobsService jobsService = DACViewCreatorFactory.this.jobsService.get();
    private final DatasetVersionMutator datasetService;
    private final NamespaceService namespaceService;

    DACViewCreator(String userName) {
      this.userName = userName;
      namespaceService = namespaceServiceFactory.get().get(userName);
      datasetService = new DatasetVersionMutator(initializerRegistry.get(), kvStoreProvider.get(), namespaceService,
        jobsService, catalogService.get(), contextService.get().get().getOptionManager());
    }

    @Override
    public void createView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes) {
      SecurityContext securityContext = getSecurityContext();
      QueryExecutor executor = new QueryExecutor(jobsService, null, securityContext);
      DatasetTool tool = newDatasetTool(securityContext, executor);

      try {
        DatasetVersion version = DatasetVersion.newVersion();
        DatasetPath datasetPath = new DatasetPath(path);
        InitialPreviewResponse response = tool.newUntitled(allocator, new FromSQL(sql), version, sqlContext, null,true, 0, true);
        DatasetPath tmpPath = new DatasetPath(response.getDataset().getFullPath());
        VirtualDatasetUI vds = datasetService.getVersion(tmpPath, response.getDataset().getDatasetVersion());
        newDatasetVersionResource(securityContext, tool, version, tmpPath, allocator).save(vds, datasetPath, null, attributes);
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }

    @Override
    public void updateView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes) {
      SecurityContext securityContext = getSecurityContext();
      QueryExecutor executor = new QueryExecutor(jobsService, null, securityContext);
      DatasetVersion version = DatasetVersion.newVersion();

      NamespaceKey namespaceKey = new NamespaceKey(path);

      try {
        DatasetConfig dataset = namespaceService.getDataset(namespaceKey);

        DatasetPath datasetPath = new DatasetPath(path);
        final VirtualDatasetUI virtualDataset = datasetService.get(datasetPath);

        Transformer transformer = new Transformer(contextService.get().get(), jobsService, namespaceService, datasetService, executor, securityContext);
        TransformUpdateSQL transformUpdateSQL = new TransformUpdateSQL();
        transformUpdateSQL.setSql(sql);
        transformUpdateSQL.setSqlContextList(sqlContext);

        VirtualDatasetUI virtualDatasetUI = transformer.transformWithExtract(version, datasetPath, virtualDataset, transformUpdateSQL);

        // copy over VirtualDatasetUI values to the pre-existing DatasetConfig
        dataset.setVirtualDataset(DatasetsUtil.toVirtualDataset(virtualDatasetUI));
        dataset.setRecordSchema(virtualDatasetUI.getRecordSchema());

        namespaceService.addOrUpdateDataset(namespaceKey, dataset, attributes);
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }

    private SecurityContext getSecurityContext() {
      return new SecurityContext() {
        @Override
        public Principal getUserPrincipal() {
          return new Principal() {
            @Override
            public String getName() {
              return userName;
            }
          };
        }

        @Override
        public boolean isUserInRole(String role) {
          return true;
        }

        @Override
        public boolean isSecure() {
          return false;
        }

        @Override
        public String getAuthenticationScheme() {
          return null;
        }
      };
    }

    protected DatasetTool newDatasetTool(SecurityContext securityContext, QueryExecutor executor) {
      return new DatasetTool(datasetService, jobsService, executor, securityContext);
    }

    protected DatasetVersionResource newDatasetVersionResource(SecurityContext securityContext, DatasetTool tool,
        DatasetVersion version, DatasetPath tmpPath, BufferAllocator allocator) {
      return new DatasetVersionResource(null, datasetService, jobsService, null, null, null, tool, null, securityContext, tmpPath, version, allocator);
    }

    @Override
    public void dropView(List<String> path) {
      try {
        DatasetPath datasetPath = new DatasetPath(path);
        final VirtualDatasetUI virtualDataset = datasetService.get(datasetPath);
        String savedTag = virtualDataset.getSavedTag();
        datasetService.deleteDataset(datasetPath, savedTag);
      } catch (Exception e) {
        Throwables.propagate(e);
      }
    }
  }

  @Override
  public void close() {
    allocator.close();
  }

  @Override
  public void start() {}
}


text:
using Grasshopper.Graphics.Materials;
using SharpDX.Direct3D11;
using SharpDX.DXGI;

namespace Grasshopper.SharpDX.Graphics.Materials
{
    class DynamicTexture2DResource : ShaderResource, IDynamicTexture2DResource
    {
        private readonly PixelFormat _pixelFormat;
        private Texture2DDescription _descr;
        private Texture2D _texture;

        public DynamicTexture2DResource(DeviceManager deviceManager, string id, int width, int height, PixelFormat pixelFormat) : base(deviceManager, id)
        {
            _pixelFormat = pixelFormat;
            Width = width;
            Height = height;
        }

        public TextureType TextureType { get { return TextureType.Texture2D; } }
        public TextureDataSource DataSource { get { return TextureDataSource.Dynamic; } }
        public PixelFormat PixelFormat { get { return _pixelFormat; } }
        public int Width { get; private set; }
        public int Height { get; private set; }

        protected override void InitializeInternal()
        {
            _descr = new Texture2DDescription
            {
                CpuAccessFlags = CpuAccessFlags.Write,
                ArraySize = 1,
                BindFlags = BindFlags.ShaderResource,
                Height = Width,
                Width = Height,
                SampleDescription = new SampleDescription(1, 0),
                MipLevels = 1,
                Format = _pixelFormat.ToDXGIFormat(),
                Usage = ResourceUsage.Dynamic
            };
            _texture = new Texture2D(DeviceManager.Device, _descr);
            ShaderResourceView = new ShaderResourceView(DeviceManager.Device, _texture);
        }

        protected override void UninitializeInternal()
        {
            if(ShaderResourceView != null)
            {
                ShaderResourceView.Dispose();
                ShaderResourceView = null;
            }
            if(_texture != null)
            {
                _texture.Dispose();
                _texture = null;
                _descr = default(Texture2DDescription);
            }
        }

        public IShaderResourceWriter BeginWrite()
        {
            return new ShaderResourceWriter<Texture2D>(DeviceManager, _texture);
        }
    }
}


text:
package etc

//go:generate cmd /c go run mkversioninfo.go version.txt version.txt < versioninfo.json > v.json && go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo -icon=nyagos.ico -o ..\nyagos.syso v.json && del v.json


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Map.h"
#include "JsonSerializer.h"
#include "JsonObject.h"
#include "JsonReader.h"

/**
 * Cache class for file settings.
 */
class FSettingsCache
{
public:
	/**
	 * Instance getter.
	 */
	static FSettingsCache& Get();

	/**
	 * Gets setting of given type.
	 *
	 * @param Value Output parameter. If succeeded this parameter will be overwritten with setting JSON value.
	 * @param Name Name to look for.
	 *
	 * @returns True if setting was found. False otherwise.
	 */
	bool GetSetting(TSharedPtr<FJsonValue>& Value, const FString& Name);

	/**
	 * Sets setting of given type to given value.
	 *
	 * @param Name Name of the setting.
	 * @param Value Value of the setting.
	 */
	void SetSetting(const FString& Name, TSharedRef<FJsonValue> Value);

	/**
	 * Saves setting to file.
	 */
	void Save();

	/**
	 * TAddConstIf trait to conditionally add const to reference type.
	 */
	template <bool bCondition, typename Type>
	struct TAddConstIf;

	template <bool bCondition, typename Type>
	struct TAddConstIf<bCondition, Type&>
	{
		typedef typename TChooseClass<bCondition, const Type&, Type&>::Result Result;
	};

	/**
	 * Pointer traits to strip TSharedRef or TSharedPtr and return simple
	 * object reference (T&) to unify calls.
	 */
	template <typename T, bool bIsConst>
	struct TPointerTraits
	{
		typedef typename TAddConstIf<bIsConst, T&>::Result ObjectRefType;
		typedef typename TAddConstIf<bIsConst, T&>::Result ParamType;

		static ObjectRefType GetObject(ParamType Object) { return Object; }
	};

	template <typename T, bool bIsConst>
	struct TPointerTraits<TSharedRef<T>, bIsConst>
	{
		typedef typename TAddConstIf<bIsConst, T&>::Result ObjectRefType;
		typedef typename TAddConstIf<bIsConst, TSharedRef<T>&>::Result ParamType;

		static ObjectRefType GetObject(ParamType Object) { return Object.Get(); }
	};

	template <typename T, bool bIsConst>
	struct TPointerTraits<TSharedPtr<T>, bIsConst>
	{
		typedef typename TAddConstIf<bIsConst, T&>::Result ObjectRefType;
		typedef typename TAddConstIf<bIsConst, TSharedPtr<T>&>::Result ParamType;

		static ObjectRefType GetObject(ParamType Object) { return *Object.Get(); }
	};

	/**
	 * Forwards GetStateAsJSON call to preservable object.
	 *
	 * @param Object Object to forward call for.
	 * @returns Returned JSON value from forwarded call.
	 */
	template <typename TPreservableType>
	static TSharedPtr<FJsonValue> GetStateAsJSON(const TPreservableType Object)
	{
		typedef TPointerTraits<TPreservableType, true> T;
		typename T::ObjectRefType Ref = T::GetObject(Object);

		return Ref.GetStateAsJSON();
	}

	/**
	 * Forwards LoadStateFromJSON call to preservable object.
	 *
	 * @param Object Object to forward call for.
	 * @param Value JSON vale to forward.
	 */
	template <typename TPreservableType, typename TValueType>
	static void LoadStateFromJSON(TPreservableType Object, const TValueType Value)
	{
		typedef TPointerTraits<TPreservableType, false> PT;
		typename PT::ObjectRefType Ref = PT::GetObject(Object);

		typedef TPointerTraits<TValueType, true> VT;
		typename VT::ObjectRefType ValRef = VT::GetObject(Value);

		Ref.LoadStateFromJSON(ValRef);
	}

	/**
	 * Saves single object to JSON.
	 *
	 * @param JSONObject JSON object to save data into.
	 * @param FieldName JSON field name for object's data.
	 * @param Object Object to save.
	 */
	template <typename TPreservableType>
	static void SaveObjectToJSON(TSharedRef<FJsonObject> JSONObject, const FString& FieldName, const TPreservableType Object)
	{
		TSharedPtr<FJsonValue> Value = FSettingsCache::GetStateAsJSON(Object);

		if (Value.IsValid())
		{
			JSONObject->SetField(FieldName, Value);
		}
	}

	/**
	 * Loads single object from JSON.
	 *
	 * @param JSONObject JSON object that's containing data to load.
	 * @param FieldName JSON field name for object's data.
	 * @param Object Object to load.
	 */
	template <typename TPreservableType>
	static void LoadObjectFromJSON(const TSharedRef<FJsonObject> JSONObject, const FString& FieldName, TPreservableType Object)
	{
		TSharedPtr<FJsonValue> Field = JSONObject->TryGetField(FieldName);

		if (Field.IsValid())
		{
			LoadStateFromJSON(Object, Field);
		}
	}

	/**
	 * Save objects serialization action policy.
	 */
	struct FSaveObjectsSerializationActionPolicy
	{
	public:
		FSaveObjectsSerializationActionPolicy(TSharedRef<FJsonObject> InJSON)
			: JSON(MoveTemp(InJSON))
		{}

		/**
		 * Tells what to do on serialization action. It just saves serialized
		 * object to JSON.
		 *
		 * @param FieldName JSON field name.
		 * @param Object Object to save.
		 */
		template <class TPreservableType>
		void Serialize(const FString& FieldName, const TPreservableType Object) const
		{
			FSettingsCache::SaveObjectToJSON(JSON, FieldName, Object);
		}

	private:
		/* Stored JSON object for serialization. */
		TSharedRef<FJsonObject> JSON;
	};

	/**
	 * Saves object to JSON using TSerializationPolicy.
	 *
	 * @template_param TSerializationPolicy Policy that tells the method how to
	 *		serialize Object. This method uses const version, marked by first
	 *		template parameter equals to true.
	 * @param JSON Destination JSON object.
	 * @param Object Source object.
	 */
	template <template <bool> class TSerializationPolicy, typename TObjectToSerializeType>
	static void SerializeToJSON(TSharedRef<FJsonObject> JSON, const TObjectToSerializeType& Object)
	{
		FSaveObjectsSerializationActionPolicy Action(JSON);
		TSerializationPolicy<true>::Serialize(Action, Object);
	}

	/**
	 * Load objects serialization action policy.
	 */
	struct FLoadObjectsSerializationActionPolicy
	{
	public:
		FLoadObjectsSerializationActionPolicy(TSharedRef<FJsonObject> InJSON)
			: JSON(MoveTemp(InJSON))
		{}

		/**
		 * Tells what to do on serialization action. It just loads serialized
		 * object from JSON.
		 *
		 * @param FieldName JSON field name.
		 * @param Object Object to load.
		 */
		template <class TPreservableType>
		void Serialize(const FString& FieldName, TPreservableType Object)
		{
			FSettingsCache::LoadObjectFromJSON(JSON, FieldName, Object);
		}

	private:
		/* Stored JSON object for serialization. */
		TSharedRef<FJsonObject> JSON;
	};

	/**
	 * Loads object from JSON using TSerializationPolicy.
	 *
	 * @template_param TSerializationPolicy Policy that tells the method how to
	 *		serialize Object. This method uses non-const version, marked by
	 *		first template parameter equals to false.
	 * @param JSON Data source.
	 * @param Object Destination object.
	 */
	template <template <bool> class TSerializationPolicy, typename TObjectToSerializeType>
	static void SerializeFromJSON(TSharedRef<FJsonObject> JSON, TObjectToSerializeType& Object)
	{
		FLoadObjectsSerializationActionPolicy Action(JSON);
		TSerializationPolicy<false>::Serialize(Action, Object);
	}

private:
	/**
	 * Constructor.
	 *
	 * Creates the cache from value read from settings file if it exists.
	 */
	FSettingsCache();

	/**
	 * Gets settings file name. For now it's hardcoded.
	 *
	 * @returns Settings file name.
	 */
	static const FString& GetSettingsFileName();

	/** Map of settings' JSON values. */
	TMap<FString, TSharedRef<FJsonValue> > Settings;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToPadding="false"
    android:paddingBottom="8dp"
    >

  <ImageView
      android:id="@+id/venueImage"
      android:layout_width="0dp"
      android:layout_height="250dp"
      android:maxHeight="250dp"
      android:scaleType="centerCrop"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      tools:srcCompat="@mipmap/ic_launcher"
      />

  <TextView
      android:id="@+id/venueTitle"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginEnd="16dp"
      android:layout_marginRight="16dp"
      android:layout_marginTop="8dp"
      android:textAppearance="@style/TextAppearance.AppCompat.Title"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="@+id/guideline"
      app:layout_constraintTop_toBottomOf="@+id/venueImage"
      tools:text="Barcelona"
      />

  <TextView
      android:id="@+id/venueAddress"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginTop="8dp"
      app:layout_constraintEnd_toEndOf="@+id/venueTitle"
      app:layout_constraintStart_toStartOf="@+id/guideline"
      app:layout_constraintTop_toBottomOf="@+id/venueTitle"
      app:layout_goneMarginTop="0dp"
      tools:text="Carrer de Bailen 67"
      style="@style/TextAppearance.AppCompat.Subhead"
      />

  <TextView
      android:id="@+id/venuePhone"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginTop="8dp"
      android:autoLink="phone"
      app:layout_constraintEnd_toEndOf="@+id/venueAddress"
      app:layout_constraintStart_toStartOf="@+id/guideline"
      app:layout_constraintTop_toBottomOf="@+id/venueAddress"
      app:layout_goneMarginTop="0dp"
      tools:text="+34 689 34 34 34"
      style="@style/TextAppearance.AppCompat.Subhead"
      />

  <android.support.constraint.Guideline
      android:id="@+id/guideline"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      app:layout_constraintGuide_begin="16dp"
      />

</android.support.constraint.ConstraintLayout>


text:
from random import SystemRandom
from string import ascii_letters, digits, printable
import Tkinter as tk

class Pass(tk.Frame):

    def __init__(self, master=None):
        tk.Frame.__init__(self, master)
        self.config(bd=1, relief="ridge", width="5i")
        self.pack()

        #symb radio button
        self.symbols = False
        self.truth = tk.IntVar()
        self.check = tk.Checkbutton(master, text="Use Symbols", variable=self.truth,command=self.change_symb)
        self.check.pack(pady="0.1i")

        #slider var and options vars
        self.max = 6

        #slider, #length="4i"
        self.slider = tk.Scale(from_=6, to=62, orient=tk.HORIZONTAL, label="Length", command=self.set_max)
        self.slider.pack(padx="0.1i",pady="0.1i",fill='x')

        #entry
        self.entryfield = tk.Entry()
        self.entryfield.pack(padx="0.1i",pady="0.1i", fill='x')

        #app variable
        self.contents = tk.StringVar()
        self.contents.set("variable")

        #keep an eye on the variable
        self.entryfield["textvariable"] = self.contents

        #get pass btn
        self.buttonpass = tk.Button()
        self.buttonpass["text"] = "Generate Password"
        self.buttonpass["command"] = self.make_pass
        self.buttonpass.pack(pady="0.1i")

    def set_max(self, data):
        #print "yolo"
        self.max = int(data)
        #print self.truth.get()

    def change_symb(self):
        print self.truth.get()
        flag = self.truth.get()
        if flag == 1:
            self.symbols = True
        else:
            self.symbols = False

    def make_pass(self):
        leng = self.max
        symbol = self.symbols

        #self.contents.set("k"+str(leng) + str(symbol))
        if (leng > 0 and leng <= 62):
            if not symbol:
                chars = ''.join(SystemRandom().choice(ascii_letters + digits) for _ in range(leng))
            if symbol:
                syms = printable
                ix = syms.index("~") + 1
                syms = syms[:ix]
                chars = ''.join(SystemRandom().choice(syms) for _ in range(leng))

            self.contents.set(chars)
        else:
            print "incorrect length..."
root = tk.Tk()
root.title("Pass")
app = Pass(master=root)
app.mainloop()


text:
package io.agora.openlive.ui;

import android.test.ActivityInstrumentationTestCase2;

import com.robotium.solo.Solo;

import io.agora.openlive.R;

public class BasicTests extends ActivityInstrumentationTestCase2<MainActivity> {

    private Solo solo;

    public BasicTests() {
        super(MainActivity.class);
    }

    @Override
    public void setUp() throws Exception {
        solo = new Solo(getInstrumentation(), getActivity());
    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
    }

    public String getString(int resId) {
        return solo.getString(resId);
    }

    public void testJoinAsBroadcaster() throws Exception {
        String AUTO_TEST_CHANNEL_NAME = "auto_test_" + System.currentTimeMillis();

        solo.unlockScreen();

        solo.assertCurrentActivity("Expected MainActivity activity", "MainActivity");
        solo.clearEditText(0);
        solo.enterText(0, AUTO_TEST_CHANNEL_NAME);
        solo.waitForText(AUTO_TEST_CHANNEL_NAME, 1, 2000L);

        solo.clickOnView(solo.getView(R.id.button_join));

        solo.waitForDialogToOpen(1000);

        solo.clickOnButton(getString(R.string.label_broadcaster));

        String targetActivity = LiveRoomActivity.class.getSimpleName();

        solo.waitForLogMessage("onJoinChannelSuccess " + AUTO_TEST_CHANNEL_NAME, JOIN_CHANNEL_SUCCESS_THRESHOLD + 1000);

        solo.waitForLogMessage("onFirstLocalVideoFrame ", FIRST_LOCAL_VIDEO_SHOWN_THRESHOLD + 500);

        solo.assertCurrentActivity("Expected " + targetActivity + " activity", targetActivity);
    }

    private static final int FIRST_REMOTE_VIDEO_RECEIVED_THRESHOLD = 5000;
    private static final int FIRST_LOCAL_VIDEO_SHOWN_THRESHOLD = 1500;
    private static final int JOIN_CHANNEL_SUCCESS_THRESHOLD = 5000;

    public void testJoinAsAudience() throws Exception {
        String AUTO_TEST_CHANNEL_NAME = "for_auto_test";

        solo.unlockScreen();

        solo.assertCurrentActivity("Expected MainActivity activity", "MainActivity");
        solo.clearEditText(0);
        solo.enterText(0, AUTO_TEST_CHANNEL_NAME);
        solo.waitForText(AUTO_TEST_CHANNEL_NAME, 1, 2000L);

        solo.clickOnView(solo.getView(R.id.button_join));

        solo.waitForDialogToOpen(1000);

        solo.clickOnButton(getString(R.string.label_audience));

        String targetActivity = LiveRoomActivity.class.getSimpleName();

        solo.waitForLogMessage("onJoinChannelSuccess " + AUTO_TEST_CHANNEL_NAME, JOIN_CHANNEL_SUCCESS_THRESHOLD);

        long firstRemoteVideoTs = System.currentTimeMillis();
        solo.waitForLogMessage("onFirstRemoteVideoDecoded ", FIRST_REMOTE_VIDEO_RECEIVED_THRESHOLD + 1000);

        solo.assertCurrentActivity("Expected " + targetActivity + " activity", targetActivity);

        assertTrue("first remote video frame not received", System.currentTimeMillis() - firstRemoteVideoTs <= FIRST_REMOTE_VIDEO_RECEIVED_THRESHOLD);
    }
}


text:
<?php
use Moaction\Jsonrpc\Client\ClientAbstract;

class ClientAbstractTest extends PHPUnit_Framework_TestCase
{
	/**
	 * @covers \Moaction\Jsonrpc\Client\ClientAbstract::__construct
	 * @covers \Moaction\Jsonrpc\Client\ClientAbstract::getServerUrl
	 */
	public function testConstruct()
	{
		/** @var PHPUnit_Framework_MockObject_MockObject|ClientAbstract $client */
		$client = $this->getMockBuilder('\Moaction\Jsonrpc\Client\ClientAbstract')
			->setConstructorArgs(array('ServerUrl'))
			->getMockForAbstractClass();

		$this->assertEquals('ServerUrl', $client->getServerUrl());
	}
}


text:
<?php
include 'conexion.php';

    $sqlusuarioexiste = "select * from booktubers_usuarios where booktubers_usuarios_email='".$_POST['email']."'";
    $resultusuarioexiste = mysqli_query($conexion, $sqlusuarioexiste);
    if (mysqli_num_rows($resultusuarioexiste) > 0)
    {
        header('Location: ../?ec=2');
    }
    else
    {
        $sqlusuariocrea = "insert into booktubers_usuarios (booktubers_usuarios_nombre,booktubers_usuarios_nombrear, booktubers_usuarios_email,booktubers_usuarios_emailar,booktubers_usuarios_edad, booktubers_usuarios_escuela,booktubers_usuarios_ciudad,booktubers_usuarios_pais,booktubers_usuarios_fecalta,booktubers_usuarios_password) values ('".$_POST['nombre']."','".$_POST['nombrear']."','".$_POST['email']."','".$_POST['emailar']."',".$_POST['edad'].",'".$_POST['escuela']."',".$_POST['ciudad'].",'".$_POST['pais']."','".date("Y-m-d H:i:s")."','".md5($_POST['password'])."')";
        echo $sqlusuariocrea;
        $resultusuariocrea = mysqli_query($conexion, $sqlusuariocrea);

        $sqlusuarioexiste2 = "select * from booktubers_usuarios where booktubers_usuarios_email='".$_POST['email']."' and booktubers_usuarios_password='".md5($_POST['password'])."'";
        $resultusuarioexiste2 = mysqli_query($conexion, $sqlusuarioexiste2);
        if (mysqli_num_rows($resultusuarioexiste2) > 0)
        {
            session_start();
            while($rowp = mysqli_fetch_assoc($resultusuarioexiste2)) {
                $_SESSION['entorno']['usuario_id']=$rowp['booktubers_usuarios_id'];
                $_SESSION['entorno']['usuario_email']=$rowp['booktubers_usuarios_email'];
                $_SESSION['entorno']['usuario_nombre']=$rowp["booktubers_usuarios_nombre"];
                $_SESSION['entorno']['usuario_edad']=$rowp["booktubers_usuarios_edad"];
                $_SESSION['entorno']['usuario_nombrear']=$rowp["booktubers_usuarios_nombrear"];
            }
            header('Location: ../?ec=1');
        }
    }

?>


text:
require "capybara/js/version"

module Capybara
  module DSL
    def js_wait_for_variable name
      # for name = foo.bar.baz wait on foo, then foo.bar, then foo.bar.baz
      elts = name.split '.'
      initial_segments = (1..elts.length).map { |i| elts.take(i).join '.' }

      initial_segments.each do |segment|
        begin
          Timeout::timeout Capybara.default_wait_time do
            while page.evaluate_script("typeof #{segment} === 'undefined'")
              sleep Capybara.default_wait_time / 4
            end
          end
        rescue Timeout::Error
          # provide more information
          raise Timeout::Error.new "Timed out waiting for js var #{segment} in expression #{name}"
        end
      end
    end

    def js_initialize_helper_vars
      page.evaluate_script "window.capybara_js_originals = window.capybara_js_originals || {};"
      page.evaluate_script "window.capybara_js_spy_calls = window.capybara_js_spy_calls || [];"
    end

    def js_spy_on_method method
      js_initialize_helper_vars

      page.js_wait_for_variable method
      # back up original function
      page.evaluate_script "window.capybara_js_originals['#{method}'] = #{method};";
      # replace with a spy that records calls and passes through
      page.evaluate_script <<js
        #{method} = function () {
          window.capybara_js_spy_calls['#{method}'].push(arguments);
          return window.capybara_js_originals['#{method}'].call(this, arguments);
        };
js
    end

    def js_method_invoked? method
      js_initialize_helper_vars
      page.evaluate_script "window.capybara_js_spy_calls['#{method}'] && window.capybara_js_spy_calls['#{method}'].length > 0"
    end

    def js_stub_method method, new_definition

    end

    def js_restore_original_variable name
    end

  end
end


text:
require 'spec_helper'

describe Ponder::Thaum do
  before(:each) do
    @thaum = Ponder::Thaum.new
  end

  context 'creates a correct default callback for' do
    it 'PING PONG' do
      time = Time.now.to_i
      @thaum.should_receive(:notice).with('Peter', "\001PING #{time}\001")
      EM.run do
        @thaum.process_callbacks(:query, {:type => :query, :nick => 'Peter', :message => "\001PING #{time}\001"})
        EM.schedule { EM.stop }
      end
    end

    it 'VERSION' do
      @thaum.should_receive(:notice).with('Peter', "\001VERSION Ponder #{Ponder::VERSION} (https://github.com/tbuehlmann/ponder)\001")
      EM.run do
        @thaum.process_callbacks(:query, {:type => :query, :nick => 'Peter', :message => "\001VERSION\001"})
        EM.schedule { EM.stop }
      end
    end

    it 'TIME' do
      @thaum.should_receive(:notice).with('Peter', "\001TIME #{Time.now.strftime('%a %b %d %H:%M:%S %Y')}\001")
      EM.run do
        @thaum.process_callbacks(:query, {:type => :query, :nick => 'Peter', :message => "\001TIME\001"})
        EM.schedule { EM.stop }
      end
    end
  end

  it 'PING PONGs' do
    time = Time.now.to_i
    @thaum.should_receive(:send_data).with("PONG #{time}")
    @thaum.parse("PING #{time}")
  end

  it 'does not log PING PONGs' do
    time = Time.now.to_i
    @thaum.loggers.should_not_receive(:info).with(/ping/i)
    @thaum.loggers.should_not_receive(:info).with(/pong/i)
    @thaum.should_receive(:send_data).with("PONG #{time}")
    @thaum.parse("PING #{time}")
  end

  it 'logs PING PONGs when configured' do
    @thaum.config.hide_ping_pongs = false
    time = Time.now.to_i
    @thaum.loggers.should_receive(:info).with(/ping/i)
    @thaum.loggers.should_receive(:info).with(/pong/i)
    @thaum.should_receive(:send_data).with("PONG #{time}")
    @thaum.parse("PING #{time}")
  end
end


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxEventsSearchResult extends BxBaseModGroupsSearchResult
{
    function __construct($sMode = '', $aParams = false)
    {
        parent::__construct($sMode, $aParams);

        $this->aCurrent =  array(
            'name' => 'bx_events',
            'module_name' => 'bx_events',
            'object_metatags' => 'bx_events',
            'title' => _t('_bx_events_page_title_browse'),
            'table' => 'sys_profiles',
            'tableSearch' => 'bx_events_data',
            'ownFields' => array(),
            'searchFields' => array(),
            'restriction' => array(
                'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
                'perofileStatus' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
                'perofileType' => array('value' => 'bx_events', 'field' => 'type', 'operator' => '='),
                'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_events_data'),
                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_events_data'),
                'past' => array('value' => '', 'field' => 'date_end', 'operator' => '<', 'table' => 'bx_events_data'),
            ),
            'join' => array (
                'profile' => array(
                    'type' => 'INNER',
                    'table' => 'bx_events_data',
                    'mainField' => 'content_id',
                    'onField' => 'id',
                    'joinFields' => array('id', 'event_name', 'picture', 'cover', 'added', 'author', 'allow_view_to', 'date_start', 'date_end'),
                ),
                'account' => array(
                    'type' => 'INNER',
                    'table' => 'sys_accounts',
                    'mainField' => 'account_id',
                    'onField' => 'id',
                    'joinFields' => array(),
                ),
            ),
            'paginate' => array('perPage' => getParam('bx_events_per_page_browse'), 'start' => 0),
            'sorting' => 'last',
            'rss' => array(
                'title' => '',
                'link' => '',
                'image' => '',
                'profile' => 0,
                'fields' => array (
                    'Guid' => 'link',
                    'Link' => 'link',
                    'Title' => 'event_name',
                    'DateTimeUTS' => 'added',
                    'Desc' => 'event_name',
                    'Image' => 'picture',
                ),
            ),
            'ident' => 'id'
        );

        $this->sFilterName = 'bx_events_data_filter';
        $this->oModule = $this->getMain();

        $CNF = &$this->oModule->_oConfig->CNF;

        $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
        $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';

        $oJoinedProfile = null;
        $bProcessConditionsForPrivateContent = true;

        switch ($sMode) {
            case 'created_entries':
                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile)) {
                    $this->isError = true;
                    break;
                }
                break;

            case 'joined_entries':
                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
                if (!$oJoinedProfile) {
                    $this->isError = true;
                    break;
                }

                $bProcessConditionsForPrivateContent = false;

                $this->aCurrent['join']['fans'] = array(
                    'type' => 'INNER',
                    'table' => 'bx_events_fans',
                    'mainField' => 'id',
                    'onField' => 'content',
                    'joinFields' => array('initiator'),
                );

                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_events_fans');

                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
                $this->aCurrent['title'] = _t('_bx_events_page_title_joined_entries');
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $oJoinedProfile->id();
                break;

            case 'connections':
                if ($this->_setConnectionsConditions($aParams)) {
                    $bProcessConditionsForPrivateContent = false;
                    $oProfile = BxDolProfile::getInstance($aParams['profile']);
                    $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;

                    if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
                        $this->aCurrent['title'] = _t('_bx_events_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
                    elseif ((!isset($aParams['type']) || $aParams['type'] != 'common') && $oProfile)
                        $this->aCurrent['title'] = _t('_bx_events_page_title_browse_connections', $oProfile->getDisplayName());

                    $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $aParams['object'] . '/' . $aParams['type'] . '/' . (int)$aParams['profile'] . '/' . (int)$aParams['profile2'] . '/' . (int)$aParams['mutual'];
                }
                break;

            case 'favorite':
                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
                    $this->isError = true;
                    break;
                }
                break;

            case 'recent':
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_recent');
                $this->aCurrent['sorting'] = 'last';
                $this->sBrowseUrl = 'page.php?i=events-home';
                break;

            case 'featured':
                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_featured');
                $this->aCurrent['restriction']['featured']['value'] = '0';
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
                $this->aCurrent['sorting'] = 'featured';
                break;

            case 'recommended':
                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_recommended');
                $this->aCurrent['restriction']['featured']['value'] = '0';
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
                $this->aCurrent['sorting'] = 'recommended';
                $this->_setConditionsForRecommended();
                break;

            case 'top':
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_top');
                $this->aCurrent['sorting'] = 'top';
                $this->sBrowseUrl = 'page.php?i=events-top';
                break;

            case 'past':
                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_past');
                $this->aCurrent['restriction']['past']['value'] = time();
                $this->aCurrent['sorting'] = 'past';
                $this->sBrowseUrl = 'page.php?i=events-past';
                break;

            case '': // search results
                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
                $this->aCurrent['title'] = _t('_bx_events');
                unset($this->aCurrent['paginate']['perPage'], $this->aCurrent['rss']);
                break;

            default:
                $this->isError = true;
        }

        if ($bProcessConditionsForPrivateContent)
            $this->addConditionsForPrivateContent($CNF, $oJoinedProfile);

        $this->sCenterContentUnitSelector = false;
    }

    function getAlterOrder()
    {
        switch ($this->aCurrent['sorting']) {
        case 'featured':
            return array('order' => ' ORDER BY `bx_events_data`.`featured` DESC ');
        case 'recommended':
            return array('order' => ' ORDER BY RAND() ');
        case 'none':
            return array();
        case 'top':
            return array('order' => ' ORDER BY `bx_events_data`.`views` DESC ');
        case 'past':
            return array('order' => ' ORDER BY `bx_events_data`.`date_start` DESC, `bx_events_data`.`date_end` DESC ');
        case 'last':
        default:
            return array('order' => ' ORDER BY `bx_events_data`.`added` DESC ');
        }
    }

    function _getPseud ()
    {
        return array(
            'id' => 'id',
            'event_name' => 'event_name',
            'added' => 'added',
            'author' => 'author',
            'picture' => 'picture',
        );
    }
}

/** @} */