text:
#include "ScrollView.h"
#include "TabView.h"
#include "Roster.h"
#include "Dragger.h"
#include "Archivable.h"

#include <string>
#include <sstream>

#include <Notification.h>

#include "HTGListView.h"
#include "HTStorage.h"
#include "HTTimelineParser.h"
#include "HTSearchParser.h"
#include "twitcurl/twitcurl.h"
#include "HTTweet.h"
//#include "HTGTweetItem.h"
#include "HTGInfoPopperSettingsWindow.h"

#ifndef HTG_TIMELINEVIEW_H
#define HTG_TIMELINEVIEW_H

const int32 TIMELINE_HOME = 'HOME';
const int32 TIMELINE_FRIENDS = 'TML';
const int32 TIMELINE_MENTIONS = 'MNTN';
const int32 TIMELINE_PUBLIC = 'PBLC';
const int32 TIMELINE_USER = 'TUSR';
const int32 TIMELINE_SEARCH = 'TSCH';
const int32 TIMELINE_DIRECT = 'DMSG';
const int32 TIMELINE_HDD = 'THDD';

const int32 kMaximumRetries = 100;

status_t updateTimeLineThread(void *data);

class HTGTimeLineView : public BView {
public:
	HTGTimeLineView(twitCurl *, const int32, BRect, const char * requestInfo = " ", int textSize = BFont().Size(), bool saveTweets = false);
	HTGTimeLineView(const int32, BRect, BList*, int textSize = BFont().Size());
	HTGTimeLineView(BMessage* archive);
	void MessageReceived(BMessage *msg);
	void updateTimeLine();
	void AttachedToWindow();
	void SetFont(const BFont*, uint32 = B_FONT_ALL);
	void AddList(BList *tweets);
	void setSaveTweets(bool);
	void showScrollbar(bool);
	void clearList();
	bool IsReplicant();
	virtual void FrameResized(float width, float height);
	virtual status_t Archive(BMessage* archive, bool deep = true) const;
	BArchivable* Instantiate(BMessage* archive);
	~HTGTimeLineView();

//private:
	void sendNotificationFor(HTTweet *theTweet);
	int32 getSearchID();
	void setSearchID(int32 id);
	void addUnhandledTweets();
	void savedSearchDestoySelf();
	void savedSearchCreateSelf();
	bool _retrieveInfoPopperBoolFromSettings();
	std::string& htmlFormatedString(const char *orig);

	int32 errorCount;			//Not archived

	bool isReplicant;			//Not archived
	bool waitingForUpdate;		//Archived
	bool wantsNotifications;	//Archived
	bool saveTweets;			//Archived
	HTGListView *listView;		//Archived (deep)
	BList *unhandledList;		//Archived (deep)
	BScrollView *theScrollView;	//Not archived

	thread_id previousThread;	//Not archived
	BDragger *dragger;			//Not archived

	int32 searchID;				//Archived
	twitCurl *twitObj;			//Not archived (oauth keys archived instead)
	int32 TYPE;					//Archived
};
#endif


text:
"""Taxonomy resources."""
from import_export import resources
from import_export.fields import Field

from taxonomy import models as tax_models

class TaxonResource(resources.ModelResource):
    """Taxon resource class for REsource download."""

    publication_status = Field(
        attribute='get_publication_status_display',
        column_name='publication_status')
    currently_listed = Field(
        attribute='is_currently_listed',
        column_name='currently_listed')
    currently_listed = Field(
        attribute='is_currently_listed',
        column_name='currently_listed')
    conservation_code_state = Field(
        attribute='conservation_code_state',
        column_name='conservation_code_state')
    conservation_list_state = Field(
        attribute='conservation_list_state',
        column_name='conservation_list_state')
    conservation_category_state = Field(
        attribute='conservation_category_state',
        column_name='conservation_category_state')
    conservation_categories_state = Field(
        attribute='conservation_categories_state',
        column_name='conservation_categories_state')
    conservation_criteria_state = Field(
        attribute='conservation_criteria_state',
        column_name='conservation_criteria_state')
    conservation_category_national = Field(
        attribute='conservation_category_national',
        column_name='conservation_category_national')

    class Meta:
        """Class opts."""

        model = tax_models.Taxon
        fields = [
            "name_id",
            "taxonomic_name",
            "vernacular_names",
            "field_code",
            "publication_status",
            "current",
            "currently_listed",
            "conservation_code_state",
            "conservation_list_state",
            "conservation_category_state",
            "conservation_categories_state",
            "conservation_criteria_state",
            "conservation_category_national",
        ]

class CommunityResource(resources.ModelResource):
    """Community resource class for REsource download."""

    currently_listed = Field(
        attribute='is_currently_listed',
        column_name='currently_listed')
    currently_listed = Field(
        attribute='is_currently_listed',
        column_name='currently_listed')
    conservation_code_state = Field(
        attribute='conservation_code_state',
        column_name='conservation_code_state')
    conservation_list_state = Field(
        attribute='conservation_list_state',
        column_name='conservation_list_state')
    conservation_category_state = Field(
        attribute='conservation_category_state',
        column_name='conservation_category_state')
    conservation_categories_state = Field(
        attribute='conservation_categories_state',
        column_name='conservation_categories_state')
    conservation_criteria_state = Field(
        attribute='conservation_criteria_state',
        column_name='conservation_criteria_state')
    conservation_category_national = Field(
        attribute='conservation_category_national',
        column_name='conservation_category_national')

    class Meta:
        """Class opts."""

        model = tax_models.Community
        fields = [
            "code",
            "name",
            "description",
            "currently_listed",
            "conservation_code_state",
            "conservation_list_state",
            "conservation_category_state",
            "conservation_categories_state",
            "conservation_criteria_state",
            "conservation_category_national",
        ]

redpajama_set_name: RedPajamaGithub


text:
<!-- Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6Q77MCTCTY"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '{{ site.google_analytics }}');
</script>
<!-- End Google Analytics -->


text:
<!DOCTYPE HTML>

<title>Uses of Class picocli.CommandLine.Model.ArgGroupSpec.Builder (picocli 4.7.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Module

Package

Class

Use

Tree

Deprecated

Index

Help

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Uses of Class
picocli.CommandLine.Model.ArgGroupSpec.Builder

Packages that use CommandLine.Model.ArgGroupSpec.Builder

Package
Description

picocli

Provides classes and interfaces for the main picocli command line parsing and
 autocompletion functionality.

Uses of CommandLine.Model.ArgGroupSpec.Builder in picocli

Methods in picocli that return CommandLine.Model.ArgGroupSpec.Builder

Modifier and Type
Method
Description

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.addArg(CommandLine.Model.ArgSpec arg)

Adds the specified argument to the list of options and positional parameters that depend on this group.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.addSpecElement(CommandLine.Model.IAnnotatedElement element)

Adds the specified {@literal @}Spec annotated program element to the list of spec elements for this group.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.addSubgroup(CommandLine.Model.ArgGroupSpec group)

Adds the specified group to the list of subgroups that this group is composed of.

static CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.builder()

Returns a new CommandLine.Model.ArgGroupSpec.Builder.

static CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.builder(CommandLine.Model.IAnnotatedElement annotatedElement)

Returns a new CommandLine.Model.ArgGroupSpec.Builder associated with the specified annotated element.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.exclusive(boolean newValue)

Sets whether this is a mutually exclusive group; true by default.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.getter(CommandLine.Model.IGetter getter)

Sets the CommandLine.Model.IGetter that is responsible for getting the value of the annotated program element associated with this group, and returns this builder.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.heading(String newValue)

Sets the heading of this group (may be null), used when generating the usage documentation.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.headingKey(String newValue)

Sets the heading key of this group, used to get the heading from a resource bundle.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.multiplicity(String newValue)

Sets the multiplicity of this group: how many occurrences it may have on the command line; "0..1" (optional) by default.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.multiplicity(CommandLine.Range newValue)

Sets the multiplicity of this group: how many occurrences it may have on the command line; "0..1" (optional) by default.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.order(int order)

Sets the position in the options list in the usage help message at which this group should be shown, and returns this builder.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.scope(CommandLine.Model.IScope scope)

Sets the CommandLine.Model.IScope that targets where the setter sets the value of the annotated program element associated with this group, and returns this builder.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.setter(CommandLine.Model.ISetter setter)

Sets the CommandLine.Model.ISetter that is responsible for modifying the value of the annotated program element associated with this group, and returns this builder.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.typeInfo(CommandLine.Model.ITypeInfo newValue)

Sets the type info for the annotated program element associated with this group, and returns this builder.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.updateArgGroupAttributes(CommandLine.ArgGroup group)

Updates this builder from the specified annotation values.

CommandLine.Model.ArgGroupSpec.Builder
CommandLine.Model.ArgGroupSpec.Builder.validate(boolean newValue)

Sets whether picocli should validate the rules of this group:
 for a mutually exclusive group this means that no more than one arguments in the group is specified on the command line;
 for a co-ocurring group this means that all arguments in the group are specified on the command line.

Skip navigation links

Overview

Module

Package

Class

Use

Tree

Deprecated

Index

Help

Frames

No Frames

All Classes

JavaScript is disabled on your browser.


text:
namespace chrono {

// -----------------------------------------------------------------------------
// Constructor for a ChVehicle using a default Chrono Chsystem.
// Specify default step size and solver parameters.
// -----------------------------------------------------------------------------
ChVehicle::ChVehicle()
: m_ownsSystem(true),
  m_stepsize(1e-3)
{
  m_system = new ChSystem;

  m_system->Set_G_acc(ChVector<>(0, 0, -9.81));

  // Integration and Solver settings
  m_system->SetLcpSolverType(ChSystem::LCP_ITERATIVE_SOR);
  m_system->SetIterLCPmaxItersSpeed(150);
  m_system->SetIterLCPmaxItersStab(150);
  m_system->SetMaxPenetrationRecoverySpeed(4.0);
}

// -----------------------------------------------------------------------------
// Constructor for a ChVehicle using a default Chrono ChSystem.
// -----------------------------------------------------------------------------
ChVehicle::ChVehicle(ChSystem* system)
: m_system(system),
  m_ownsSystem(false),
  m_stepsize(1e-3)
{
}

// -----------------------------------------------------------------------------
// Destructor for ChVehicle
// -----------------------------------------------------------------------------
ChVehicle::~ChVehicle()
{
  if (m_ownsSystem)
    delete m_system;
}

// -----------------------------------------------------------------------------
// Update the state of this vehicle at the current time.
// The vehicle system is provided the current driver inputs (throttle between
// 0 and 1, steering between -1 and +1, braking between 0 and 1), the torque
// from the powertrain, and tire forces (expressed in the global reference
// frame).
// The default implementation of this function invokes the update functions for
// all vehicle subsystems.
// -----------------------------------------------------------------------------
void ChVehicle::Update(double              time,
                       double              steering,
                       double              braking,
                       double              powertrain_torque,
                       const ChTireForces& tire_forces)
{
  // Apply powertrain torque to the driveline's input shaft.
  m_driveline->Update(powertrain_torque);

  // Let the steering subsystems process the steering input.
  for (unsigned int i = 0; i < m_steerings.size(); i++) {
    m_steerings[i]->Update(time, steering);
  }

  // Apply tire forces to spindle bodies and apply braking.
  for (unsigned int i = 0; i < m_suspensions.size(); i++) {
    m_suspensions[i]->Update(LEFT, tire_forces[2 * i]);
    m_suspensions[i]->Update(RIGHT, tire_forces[2 * i + 1]);

    m_brakes[2 * i]->Update(braking);
    m_brakes[2 * i + 1]->Update(braking);
  }
}

// -----------------------------------------------------------------------------
// Advance the state of the system, taking as many steps as needed to exactly
// reach the specified value 'step'.
// ---------------------------------------------------------------------------- -
void ChVehicle::Advance(double step)
{
  double t = 0;
  while (t < step) {
    double h = std::min<>(m_stepsize, step - t);
    m_system->DoStepDynamics(h);
    t += h;
  }
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
ChSharedPtr<ChBody> ChVehicle::GetWheelBody(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetSpindle(wheel_id.side());
}

const ChVector<>& ChVehicle::GetWheelPos(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetSpindlePos(wheel_id.side());
}

const ChQuaternion<>& ChVehicle::GetWheelRot(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetSpindleRot(wheel_id.side());
}

const ChVector<>& ChVehicle::GetWheelLinVel(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetSpindleLinVel(wheel_id.side());
}

ChVector<> ChVehicle::GetWheelAngVel(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetSpindleAngVel(wheel_id.side());
}

double ChVehicle::GetWheelOmega(const ChWheelID& wheel_id) const
{
  return m_suspensions[wheel_id.axle()]->GetAxleSpeed(wheel_id.side());
}

// -----------------------------------------------------------------------------
// Return the complete state (expressed in the global frame) for the specified
// wheel body.
// -----------------------------------------------------------------------------
ChWheelState ChVehicle::GetWheelState(const ChWheelID& wheel_id) const
{
  ChWheelState state;

  state.pos = GetWheelPos(wheel_id);
  state.rot = GetWheelRot(wheel_id);
  state.lin_vel = GetWheelLinVel(wheel_id);
  state.ang_vel = GetWheelAngVel(wheel_id);

  ChVector<> ang_vel_loc = state.rot.RotateBack(state.ang_vel);
  state.omega = ang_vel_loc.y;

  return state;
}

// -----------------------------------------------------------------------------
// Return the global driver position
// -----------------------------------------------------------------------------
ChVector<> ChVehicle::GetDriverPos() const
{
  return m_chassis->GetCoord().TransformPointLocalToParent(GetLocalDriverCoordsys().pos);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
double ChVehicle::GetDriveshaftSpeed() const
{
  return m_driveline->GetDriveshaftSpeed();
}

// -----------------------------------------------------------------------------
// Log constraint violations
// -----------------------------------------------------------------------------
void ChVehicle::LogConstraintViolations()
{
  GetLog().SetNumFormat("%16.4e");

  // Report constraint violations for the suspension joints
  for (size_t i = 0; i < m_suspensions.size(); i++) {
    GetLog() << "\n---- AXLE " << i << " LEFT side suspension constraint violations\n\n";
    m_suspensions[i]->LogConstraintViolations(LEFT);
    GetLog() << "\n---- AXLE " << i << " RIGHT side suspension constraint violations\n\n";
    m_suspensions[i]->LogConstraintViolations(RIGHT);
  }

  // Report constraint violations for the steering joints
  for (size_t i = 0; i < m_steerings.size(); i++) {
    GetLog() << "\n---- STEERING subsystem " << i << " constraint violations\n\n";
    m_steerings[i]->LogConstraintViolations();
  }

  GetLog().SetNumFormat("%g");

}

}  // end namespace chrono


text:
from muntjac.api import VerticalLayout, ListSelect
from muntjac.data.property import IValueChangeListener

class ListSelectMultipleExample(VerticalLayout, IValueChangeListener):

    _cities = ['Berlin', 'Brussels', 'Helsinki', 'Madrid', 'Oslo',
            'Paris', 'Stockholm']

    def __init__(self):
        super(ListSelectMultipleExample, self).__init__()

        self.setSpacing(True)

        l = ListSelect('Please select some cities')

        for c in self._cities:
            l.addItem(c)

        l.setRows(7)
        l.setNullSelectionAllowed(True)
        l.setMultiSelect(True)
        l.setImmediate(True)
        l.addListener(self, IValueChangeListener)
        self.addComponent(l)

    # Shows a notification when a selection is made.
    def valueChange(self, event):
        self.getWindow().showNotification('Selected cities: %s' %
                list(event.getProperty().getValue()))


text:
package software.amazon.awssdk.enhanced.dynamodb;

import software.amazon.awssdk.annotations.NotThreadSafe;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * Configuration for {@link EnhancedType} of document type
 */
@SdkPublicApi
@ThreadSafe
public final class EnhancedTypeDocumentConfiguration implements ToCopyableBuilder<EnhancedTypeDocumentConfiguration.Builder,
    EnhancedTypeDocumentConfiguration> {
    private final boolean preserveEmptyObject;
    private final boolean ignoreNulls;

    public EnhancedTypeDocumentConfiguration(Builder builder) {
        this.preserveEmptyObject = builder.preserveEmptyObject != null && builder.preserveEmptyObject;
        this.ignoreNulls = builder.ignoreNulls != null && builder.ignoreNulls;
    }

    /**
     * @return whether to initialize the associated {@link EnhancedType} as empty class when
     * mapping it to a Java object
     */
    public boolean preserveEmptyObject() {
        return preserveEmptyObject;
    }

    /**
     * @return whether to ignore attributes with null values in the associated {@link EnhancedType}.
     */
    public boolean ignoreNulls() {
        return ignoreNulls;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        EnhancedTypeDocumentConfiguration that = (EnhancedTypeDocumentConfiguration) o;

        if (preserveEmptyObject != that.preserveEmptyObject) {
            return false;
        }
        return ignoreNulls == that.ignoreNulls;
    }

    @Override
    public int hashCode() {
        int result = (preserveEmptyObject ? 1 : 0);
        result = 31 * result + (ignoreNulls ? 1 : 0);
        return result;
    }

    @Override
    public Builder toBuilder() {
        return builder().preserveEmptyObject(preserveEmptyObject).ignoreNulls(ignoreNulls);
    }

    public static Builder builder() {
        return new Builder();
    }

    @NotThreadSafe
    public static final class Builder implements CopyableBuilder<Builder, EnhancedTypeDocumentConfiguration> {
        private Boolean preserveEmptyObject;
        private Boolean ignoreNulls;

        private Builder() {
        }

        /**
         * Specifies whether to initialize the associated {@link EnhancedType} as empty class when
         * mapping it to a Java object. By default, the value is false
         */
        public Builder preserveEmptyObject(Boolean preserveEmptyObject) {
            this.preserveEmptyObject = preserveEmptyObject;
            return this;
        }

        /**
         * Specifies whether to ignore attributes with null values in the associated {@link EnhancedType}.
         * By default, the value is false
         */
        public Builder ignoreNulls(Boolean ignoreNulls) {
            this.ignoreNulls = ignoreNulls;
            return this;
        }

        @Override
        public EnhancedTypeDocumentConfiguration build() {
            return new EnhancedTypeDocumentConfiguration(this);
        }
    }
}


text:
package org.bdgenomics.adam.api.java;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.bdgenomics.adam.rdd.ADAMContext;
import org.bdgenomics.adam.rdd.feature.FeatureRDD;

/**
 * A simple test class for the JavaADAMRDD/Context. Writes an RDD of features to
 * disk and reads it back.
 */
final class JavaADAMFeatureConduit {
    public static FeatureRDD conduit(final FeatureRDD recordRdd,
                                     final ADAMContext ac) throws IOException {

        // make temp directory and save file
        Path tempDir = Files.createTempDirectory("javaAC");
        String fileName = tempDir.toString() + "/testRdd.feature.adam";
        recordRdd.save(fileName, false, false);

        // create a new adam context and load the file
        JavaADAMContext jac = new JavaADAMContext(ac);
        return jac.loadFeatures(fileName);
    }
}


text:
;(function(factory){
	if(typeof define === 'function' && define.amd) {
		define(['../dd','./basemodel','./dom'], factory);
	} else if (typeof exports === 'object') {
		module.exports = factory(require('../dd'),require('./basemodel'), require('./dom'));
	} else {
		factory($dd, $dd.basemodel);
	}
})(function(lib, basemodel){
	if(lib.hasOwnProperty('view')){
		return;
	}
	var fns = {
		view_fill: function(self,def){
			def = def || {};
			self._view_fill = lib.extend(self._view_fill||{},def);

			return self;
		}
	};

	var ret = function(def){
		var self;

		def = lib.extend({ element: null }, def || {});

		if(def.hasOwnProperty('inherits')){
			self = def.inherits();
			delete def.inherits;

			self.extend(def);

			self.view_fill = function(def){ return fns.view_fill(self, def); };
		} else {
			self = basemodel()(def);
			self.view_fill = function(def){ return fns.view_fill(self, def); };
		}

		self.on_fill(function(_data){
			var template = _data.template || self.template;
			if(!_data.hasOwnProperty('element') && !self.element && template){
				lib.init(function(){
					self.element = lib.dom(lib.dom(template).html());
					if(self._view_fill.hasOwnProperty('element')){
						self._view_fill.element();
					}
				});
			} else if(_data.hasOwnProperty('element')){
				lib.init(function(){
					self.element = lib.dom(_data.element);
				});
			}

			if(!self._view_fill){
				return;
			}

			var ni, mapped;
			for(ni in self._view_fill){
				if(!self.def.hasOwnProperty(ni)){
					continue;
				}
				mapped = self.def[ni].external[0] || ni;
				if(!_data.hasOwnProperty(mapped)){
					continue;
				}

				lib.init(self._view_fill[ni]);
			}
		},1);

		return self;
	};

	lib.mixin({
		view: ret
	});

	return ret;
});


text:
function label_mv=SpatialMajorityVoting(label, sp_label)
% Perform majority voting in superpixels for the input label map
% Input:
%    label: the input label
%    sp_label: superpixel label
% Output:
%    label_mv: label obtained by majority voting
% 2016-10-22, jlfeng
[nr,nc]=size(label);
if (nr~=size(sp_label,1) || nc~=size(sp_label,2))
    error('The size of input label and superpixel label are not equal.')
end
label_mv=zeros(nr,nc);
sp_label_list=unique(sp_label(:));
num_sp=length(sp_label_list);
num_class=max(label(:));
for kk=1:num_sp
    class_vote=zeros(1,num_class);
    idx_sp=(sp_label==sp_label_list(kk));
    label_in_sp=label(idx_sp);
    for ll=1:num_class
        class_vote(ll)=length(find(label_in_sp==ll));
    end
    [~,idx_max_vote]=max(class_vote);
    label_mv(idx_sp)=idx_max_vote;
end


text:
import { IExercise } from './exercise.types';
import { exerciseReducer } from './exercise.reducer';
import { ExerciseFactory } from './exercise.initial-state';

export {
  IExercise,
  exerciseReducer,
  ExerciseFactory,
}


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="Content-Language" content="en-us" />
  <meta http-equiv="imagetoolbar" content="false" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <title>EEme API v1 | GitHub Developer Guide</title>

  <link rel="alternate" type="application/atom+xml" title="API Changes" href="/changes.atom" />

  <link href="/assets/stylesheets/application.css" rel="stylesheet" type="text/css" />

      EEme:Developer

EEme Disaggregation API

Current Version

Authentication

Error Handling

Create a disaggregation task

List disaggregation tasks

Get the disaggregation result

HTTP Status Codes

Usage File Format

Analytics Configuration

Current Version

Currently we only provide v1.

Authentication

API Key (sent in a header)

curl -H "Authorization: Bearer {your api key}" https://api.energyefficiency.me

Error Handling

If an error occurred, in addition to the status code provided in the header portion of the HTTP response, the HTTP response body contains an error object which provides more details on the specific cause of the error and how to resolve it.

{
    "error": {
        "code": ERROR_CODE,
        "message": "Something bad happened",
        "description": "Here are more details about what happened"
    }
}

Create a disaggregation task

POST /home

Input

Name
Type
Description

usage
file

Required. A csv file that contains usage data and time/location information.

config_id
int
The configuration of disaggregation See configuration

Curl Example

curl -0 -X POST \
        -H "Authorization: Bearer {api key}" \
        -F "usage=@usage.csv" \
        -F "config_id=2" \
        https://api.energyefficiency.me/v1/home

Response

{
    "home_id": "f9be1fd7-e288-4b4d-8570-1497d8fce2e3",
    "success": "yes"
}

List disaggregation tasks

GET /home

Curl Example

curl -0 -X GET \
        -H "Authorization: Bearer {api key}" \
        https://api.energyefficiency.me/v1/home

Response

{
    "data": [
        {
            "created_at": "2016-10-22 01:37:35",
            "filename": "samle.csv",
            "id": "b098acb2-c119-45ae-b237-6de5a6a28f9a",
            "process_time": "2.89min",
            "status": "completed"
        },
        {
            "created_at": "2016-10-22 01:37:33",
            "filename": "samle.csv",
            "id": "cc44a8a8-7a5b-4722-bf0b-193daa777740",
            "process_time": "2.62min",
            "status": "completed"
        },
        {
            "created_at": "2016-10-22 01:37:32",
            "filename": "samle.csv",
            "id": "d13c4b4f-7c69-4e70-b80c-2584ab8e4aa7",
            "process_time": "2.27min",
            "status": "completed"
        }
    ],
    "paging": {
        "page": 1,
        "page_size": 3,
        "total_size": 3
    }
}

Get the disaggregation result

GET /home

Curl Example

curl -0 -X GET \
        -H "Authorization: Bearer {api key}" \
        https://api.energyefficiency.me/v1/home/:id

Response

{
    "data": [
        {
            "always_on": 1.138,
            "electric_vehicle": 0.0,
            "hvac": 3.343,
            "lighting": 0.961,
            "pool_pump": 0.0,
            "refrigerator": 1.135,
            "timestamp": "2015-01-01 00:00:00",
            "total_load(kwh)": 11.942,
            "water_heater": 1.157
        },
        {
            "always_on": 1.091,
            "electric_vehicle": 0.0,
            "hvac": 4.671,
            "lighting": 0.768,
            "pool_pump": 0.0,
            "refrigerator": 1.201,
            "timestamp": "2015-01-02 00:00:00",
            "total_load(kwh)": 10.807,
            "water_heater": 0.06
        },
        ...,
        {
            "always_on": 4.735,
            "electric_vehicle": 0.0,
            "hvac": 2.344,
            "lighting": 1.768,
            "pool_pump": 0.0,
            "refrigerator": 0.378,
            "timestamp": "2015-12-31 00:00:00",
            "total_load(kwh)": 11.118,
            "water_heater": 1.191
        }
    ],
    "home_id": "053492d3-75d9-4010-af17-866a742b488a"
}

HTTP Status Codes

The EEme API uses standard HTTP response codes to indicate success or failure of an API request. Codes in the 2xx range indicate success, codes in the 4xx range indicate an error resulting from the provided information, and codes in the 5xx range indicate an error resulting from our servers.

Status Code
Description

200 - OK
Everything worked as expected

201 - Created
Item was created (Successful POST)

202 - Accepted
Item found but analytics results are not ready

400 - Bad Request
Missing or malformed parameter

401 - Unauthorized
No valid API key provided

404 - Not Found
The requested resource does not exist

422 - Unprocessable Entity
Validation error or processing error

5XX - Server Error
Something went wrong on our end

Usage File Format

Usage data is in CSV format. It includes the location, timestamp, and meter reading. The first line is used to indicate the location, followed by the meter readings. The minimun length of data is 6 months.

CSV format

location, Zipcode/City/Address Country

timstamp, meter reading (the unit depends on your analytics configuration)

Example

location,15232 USA

2016-01-01 00:00:00,0.3523

2016-01-01 01:00:00,0.38

2016-01-01 02:00:00,0.4314

2016-01-01 03:00:00,0.4532

2016-01-01 04:00:00,0.5686

2016-01-01 05:00:00,0.5058

Analytics Configuration

ID
Interval
Module
Region
Space
Units

1
15-min
load-disaggregation
US
residential
kw

2
15-min
load-disaggregation
US
residential
kwh

3
15-min
load-disaggregation
EU
residential
kw

4
15-min
load-disaggregation
EU
residential
kwh

5
1-hr
load-disaggregation
US
residential
kw

6
1-hr
load-disaggregation
US
residential
kwh

7
1-hr
load-disaggregation
EU
residential
kw

8
1-hr
load-disaggregation
EU
residential
kwh

9
1-sec
load-disaggregation
US
residential
kw

10
1-min
load-disaggregation
US
residential
kw

11
15-min
load-disaggregation
China
commercial
kwh

<meta http-equiv="refresh" content="0; url=/v1/">

Overview

HTTP Status and Error handling

Callback


text:
namespace iaph.lab10.devices.MeterFramework.Core.Transport
{
    internal interface ITransport
    {
        void Connect();
        bool Connected { get; }
        void Disconnect();
        object Locker { get; }
        int Read(byte[] buffer, int offset, int size);
        void Send(byte[] buffer, int offset, int size);
        void DiscardInBuffer();
    }
}


text:
<?php

declare(strict_types=1);

namespace GrumPHP\Configuration\Compiler;

use GrumPHP\Exception\RuntimeException;
use GrumPHP\Extension\ExtensionInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ExtensionCompilerPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        $extensions = $container->getParameter('extensions');
        $extensions = \is_array($extensions) ? $extensions : [];
        foreach ($extensions as $extensionClass) {
            if (!class_exists($extensionClass)) {
                throw new RuntimeException(sprintf('Invalid extension class specified: %s', $extensionClass));
            }

            $extension = new $extensionClass();
            if (!$extension instanceof ExtensionInterface) {
                throw new RuntimeException(sprintf(
                    'Extension class must implement ExtensionInterface. But `%s` is not.',
                    $extensionClass
                ));
            }

            $extension->load($container);
        }
    }
}


text:
===============================================================================#
const DataWord = UInt32

#==Constants
===============================================================================#
const SIGNAME_BUFSIZE = 256 #Maximum supported length

const WRITEBLOCK_SYNCWORD = DataWord(0x4)
const WRITEBLOCK_HEADERSIZE = 4*sizeof(DataWord)

#TODO: Not convinced this code is really "block type"... or if ids match their meaning.
const BLOCKTYPEID_HEADER = DataWord(0x70)
const BLOCKTYPEID_DATA = DataWord(0x80)

const DATATYPEID_VOLTAGE = 1
const DATATYPEID_CURRENT = 8

const SWEEPDATA_LASTPOINT = 1e30 #Can detect end of data with this.

#==Main Types
===============================================================================#
abstract type Endianness end #Of data file
struct BigEndian <: Endianness; end
struct LittleEndian <: Endianness; end
const NetworkEndianness = BigEndian #Informative only
#=Comment:
Apparently SPICE files used to use network endianness (big-endian), but are now
little-endian.
=#

abstract type SpiceFormat end
struct Format_Unknown <: SpiceFormat; end
struct Format_9601 <: SpiceFormat; end #x: 32-bit floats, y: 32-bit floats
struct Format_9602 <: SpiceFormat; end #x: 64-bit floats, y: 64-bit floats
struct Format_2001 <: SpiceFormat; end #x: 64-bit floats, y: 64-bit floats
struct Format_2013 <: SpiceFormat; end #x: 64-bit floats, y: 32-bit floats
#=Comment:
I believe 9602 is a non-standard format used by CppSim.
=#

struct BlockHeader
	typeid::DataWord #TODO: is this really type id?
	_size::DataWord #Number of bits in current block
end

mutable struct BlockReader{T<:Endianness}
	io::IO
	header::BlockHeader
	endpos::Int
end
#NOTE: Parameterized so we can specialize (dispatch) on endianness.

#Convenience:
Endianness(::BlockReader{E}) where E<:Endianness = E

#TODO: Not sure if the SpiceTags are named correctly:
mutable struct SpiceTags
	id::String
	date::String
	time::String
	comments::String
end
SpiceTags() = SpiceTags("", "", "", "")

#SPICE file reader: Main object
#-------------------------------------------------------------------------------
mutable struct DataReader
	io::IOStream
	filepath::String #Informative only
	format::SpiceFormat
	sweepname::String
	signalnames::Vector{String}
	sweep::Vector
	tags::SpiceTags
	datastart::Int
	rowsize::Int
	endianness::Endianness
end

#==Helper Functions
===============================================================================#

hex(x::Integer) = string(x, base=16)
printable(v::String) = isprint(v) ? v : ""
_reorder(v::T, ::BigEndian) where T = ntoh(v)
_reorder(v::T, ::LittleEndian) where T = ltoh(v)

#Debug: show block header info
function _show(io::IO, hdr::BlockHeader, pos::Int)
	print(io, "Block: 0x", hex(WRITEBLOCK_SYNCWORD))
	print(io, " 0x", hex(hdr.typeid))
	print(io, " 0x", hex(WRITEBLOCK_SYNCWORD))
	print(io, " 0x", hex(hdr._size))
	print(io, " (start 0x", hex(pos), ")")
	println(io)
end

#==Exceptions
===============================================================================#
function corruptword_exception(io::IO, w::DataWord, expected::DataWord)
	pos = position(io) - sizeof(DataWord)
	pos = hex(pos)
	w = hex(w)
	expected = hex(expected)
	return "Corrupt word 0x$w @ 0x$pos (expected 0x$expected)"
end

function stringboundary_exception(io::IO, )
	hpos = hex(position(io))
	return "Reading string across block boundary: 0x$hpos"
end

#==
===============================================================================#

#-------------------------------------------------------------------------------
xtype(::Format_9601) = Float32
ytype(::Format_9601) = Float32

xtype(::Format_9602) = Float64
ytype(::Format_9602) = Float64

xtype(::Format_2001) = Float64
ytype(::Format_2001) = Float64

xtype(::Format_2013) = Float64
ytype(::Format_2013) = Float32

#IO reads
#-------------------------------------------------------------------------------
_read(io::IO, ::Type{T}, endianness::Endianness) where T<:Real =
	_reorder(read(io, T), endianness)

#Read in a WRITEBLOCK_SYNCWORD & validate:
function readsyncword(io::IO, endianness::Endianness)
	w = _read(io, DataWord, endianness)
	if w != WRITEBLOCK_SYNCWORD
		throw(corruptword_exception(io, w, WRITEBLOCK_SYNCWORD))
	end
end

#Read in a block header:
function _read(io::IO, ::Type{BlockHeader}, endianness::Endianness)
	readsyncword(io, endianness)
	typeid = _read(io, DataWord, endianness)
	readsyncword(io, endianness)
	_size = _read(io, DataWord, endianness)
	return BlockHeader(typeid, _size)
end

#Block reader
#-------------------------------------------------------------------------------
bytesleft(r::BlockReader) = (r.endpos - position(r.io))
canread(r::BlockReader, nbytes::Int) = bytesleft(r) >= nbytes

function nextblock(r::BlockReader{E}) where E
	seek(r.io, r.endpos)
	sz = _read(r.io, DataWord, E())
	if sz != r.header._size
		hpos = hex(position(r.io) - 1)
		throw("Inconsistent block size @ 0x$hpos.")
	end
	r.header = _read(r.io, BlockHeader, E())
	r.endpos = position(r.io) + r.header._size
	return r
end

function _skip(r::BlockReader, offset::Int)
	while offset > 0
		rmg = offset - bytesleft(r)
		if rmg > 0
			nextblock(r)
			offset = rmg
		else
			return skip(r.io, offset)
		end
	end
end

function _read(r::BlockReader{E}, ::Type{T}) where {E, T<:Number}
	#NOTE: don't check if bytesleft<0... checked by reading BlockHeader
	if bytesleft(r) < 1
		nextblock(r)
	end

	if !canread(r, sizeof(T))
		hpos = hex(position(r.io))
		throw("Cannot read $T @ 0x$hpos")
	end

	return _read(r.io, T, E())
end

#Read in fixed-length string:
function _read(r::BlockReader, ::Type{String}, nchars::Int)
	if !canread(r, nchars)
		throw(stringboundary_exception(r.io))
	end
	buf = Array{UInt8}(undef, nchars)
	readbytes!(r.io, buf)
	return String(buf)
end

#Read in space-delimited string:
function readsigname(r::BlockReader)
	DELIM = UInt8(' ') #WANTCONST
	buf = Array{UInt8}(undef, SIGNAME_BUFSIZE)

	#TODO: improve test?
	isdelim(v::UInt8) = (v != DELIM)

	lastchar = DELIM
	while DELIM == lastchar
		lastchar = _read(r, UInt8)
	end

	if !isdelim(lastchar)
		hpos = hex(position(r.io)-1)
		throw("Invalid string @ 0x$hpos")
	end

	i = 1
	while isdelim(lastchar)
		buf[i] = lastchar
		lastchar = _read(r, UInt8)
		i+=1
		if i > SIGNAME_BUFSIZE
			throw("Insufficient buffer size: 'SIGNAME_BUFSIZE'")
		end
	end

	buf[i] = 0
	return unsafe_string(pointer(buf))
end

#==Constructors
===============================================================================#
#"Construct" a BlockReader, by reading a header from IO:
function BlockReader(io::IO, endianness::Endianness; start::Int=0)
	seek(io, start)
	hdr = _read(io, BlockHeader, endianness)
	endpos = position(io) + hdr._size
	return BlockReader{typeof(endianness)}(io, hdr, endpos)
end

#==Main functions
===============================================================================#
#Detect endianness from first word:
function _read(io::IO, ::Type{Endianness})
	w = read(io, DataWord)
	for endianness in [LittleEndian(), BigEndian()]
		if WRITEBLOCK_SYNCWORD == _reorder(w, endianness)
			return endianness
		end
	end
	throw(corruptword_exception(io, w, WRITEBLOCK_SYNCWORD))
end

#Read in SPICE data file format:
function _read(r::BlockReader, ::Type{SpiceFormat})
	versiontxt = strip(_read(r, String, 8))

	try
		version = parse(Int, versiontxt)
		if 9601 == version
			return Format_9601()
		elseif 9602 == version
			return Format_9602()
		elseif 2001 == version
			return Format_2001()
		elseif 2013 == version
			return Format_2013()
		end
	catch
	end

	versiontxt = printable(versiontxt)
	throw("SPICE data format not recognized: '$versiontxt'")
end

#Read in signal names:
function readnames(r::BlockReader, datacolumns::Int)
	for i in 1:datacolumns
		sigtype = _read(r, String, 8)
		try
			parse(Int, sigtype)
		catch
			hpos = hex(position(r.io) - 8)
			sigtype = printable(sigtype)
			throw("Non-numerical signal type '$sigtype' @ 0x$hpos")
		end
	end

	sweepname = readsigname(r)
	nsigs = datacolumns - 1

	signalnames = Array{String}(undef, nsigs)
	for i in 1:length(signalnames)
		signalnames[i] = readsigname(r)
	end

	return (sweepname, signalnames)
end

#Read in signal data to vector d.
function readsignal!(r::BlockReader, d::Vector{T}, offset::Int, rowsize::Int) where T
	rowskip = rowsize - sizeof(T)
	_skip(r, offset)
	lastrowcomplete = false
	npoints = 0
	lastpos = 0

	try
		while npoints <= length(d)
			val = _read(r, T)
			npoints += 1
			d[npoints] = val
			lastrowcomplete = false
#lastpos=position(r.io)
			_skip(r, rowskip)
			lastrowcomplete = true
		end
	catch
	end

	#When reading main sweep (offset == 0):
	#Get rid of last value if last row is not completely written:
	if 0 == offset && !lastrowcomplete
#hpos = hex(lastpos); chpos = hex(position(r.io))
#throw("INCOMPLETE DATASET: lastpos @0x$hpos (curpos @0x$chpos)")
		npoints = max(0, npoints-1)
	end

	return resize!(d, npoints)
end

#Read in main sweep vector:
function readsweep(r::BlockReader, fmt::SpiceFormat, rowsize::Int)
	#Compute estimated signal length:
	curpos = position(r.io)
	sz = filesize(r.io)
	estimatedlen = div(sz - curpos, rowsize)

	data = Array{xtype(fmt)}(undef, estimatedlen)
	return readsignal!(r, data, 0, rowsize)
end

#Read in signal by number:
function readsignal(r::DataReader, signum::Int)
	nsigs = length(r.signalnames)
	if signum < 1 || signum > nsigs
		throw("Invalid signal number: $signum ∉ [1, $nsigs].")
	end
	blkreader = BlockReader(r.io, r.endianness, start=r.datastart)
	_xtype = xtype(r.format); _ytype = ytype(r.format)
	offset = sizeof(_xtype) + (signum-1) * sizeof(_ytype)
	data = Array{_ytype}(undef, length(r.sweep))
	return readsignal!(blkreader, data, offset, r.rowsize)
end

#Read in a SPICE file from path:
function _open(filepath::String)
	io = open(filepath, "r")
	endianness = _read(io, Endianness)
	blkreader = BlockReader(io, endianness, start=0)

	#Read in signal counts:
	count1 = _read(blkreader, String, 4)
	#What are other counts for? Are they counts?
	count2 = _read(blkreader, String, 4)
	count3 = _read(blkreader, String, 4)
	count4 = _read(blkreader, String, 4)

	try
		count1 = parse(Int, count1)
		count2 = parse(Int, count2)
	catch
		throw("Invalid signal count.")
	end
	datacolumns = Int(count1)+Int(count2)

	#Read in file format:
	format = _read(blkreader, SpiceFormat)

	#Read in "tags":
	header = SpiceTags(
		strip(_read(blkreader, String, 4*16)), #id
		strip(_read(blkreader, String, 16)), #date
		strip(_read(blkreader, String, 8)), #time
		strip(_read(blkreader, String, 4*16+8)) #comments
	)

	#Read in signal names:
	_skip(blkreader, 5*16) #Why? What is here?
	sweepname, signalnames = readnames(blkreader, datacolumns)

	#Compute row size:
	nsigs = length(signalnames)
	_xtype = xtype(format); _ytype = ytype(format)
	rowsize = sizeof(_xtype) + nsigs*sizeof(_ytype)

	#Move to start of first data block:
	nextblock(blkreader)
	datastart = position(blkreader.io) - WRITEBLOCK_HEADERSIZE

	sweep = readsweep(blkreader, format, rowsize)

	return DataReader(io, filepath, format,
		sweepname, signalnames, sweep,
		header, datastart, rowsize, endianness
	)
end

#==Higher-level interface
===============================================================================#
#_open(filepath::String)
Base.names(r::DataReader) = r.signalnames
Base.read(r::DataReader, signum::Int) = readsignal(r, signum)
function Base.read(r::DataReader, signame::String)
	signum = findfirst(isequal(signame), r.signalnames)
	if nothing == signum
		throw("Signal not found: $signame.")
	end
	return readsignal(r, signum)
end
Base.close(r::DataReader) = close(r.io)

#Last line


text:
__author__ = 'moskupols'

from lang_utils.morphology import morph

def get_parts_of_speech(word):
    """
    Returns a list strings describing parts of speech the given russian word could be.
    The enums are derived from pymorphy2.

    >>> get_parts_of_speech('рогалик')
    ['NOUN']
    >>> get_parts_of_speech('постовой')
    ['ADJF', 'NOUN']
    >>> 'NOUN' in get_parts_of_speech('правил')
    True
    >>> 'ADJF' in get_parts_of_speech('правил')
    False

    :param word: a russian word
    :return: list of pymorphy2 POS enums.
    """
    met = set()
    ret = []
    for p in morph.parse(word):
        # if p.score < .1:
        #     continue
        pos = p.tag.POS
        if pos not in met:
            ret.append(pos)
            met.add(pos)
    return ret


text:
<?php

namespace App\Exceptions;

use Exception;

class MediaLocationException extends Exception
{
}


text:
EEX's utility functions
=======================================

We have fuzzy list matching in the form of this function

.. autofunction:: eex.utility.fuzzy_list_match

We have some nice recursive hashing functionality for floats, lists, and dicts

.. autofunction:: eex.utility.hash


text:
jekyll-plugins
==============

Collection of Jekyll plugins custom made

# Tree Dir Tag
Specify a root index directory (index.html) and the tag will traverse through sub directory structure and output a HTML UL>LI list.

## Usage
- This plugin needs a root directory/page.
- This plugin only supports directory-page style in Jekyll, a single [page-name].html page will not work with this plugin.

## Parameter

### * tree_ignore_link

`true` if this page is not to be linked in listed menu, the link hre will be `#`.

  Useful when this page is only to provide a category-like section
  default to `false`
  **Usage**
  ```
  ---
  layout: default
  title: Dir 3
  tree_ignore_link: true
  ---
  ```

## Example

To use the tag in template:

```html
<div id="dir">
	{% tree_dir_tag root:/dir/index.html %}
</div>
```

# LICENSE
see [license](https://github.com/alexpacer/jekyll-plugins/blob/master/LICENSE)

## Dependencies

### SimpleTree

This plugin take use of [SimpleTree](https://github.com/ealdent/simple-tree) module created by [Jason M. Adams](https://github.com/ealdent) That turns Jekyll::Page into tree-aware-node.

The module is located in `/_plugins/simple_tree.rb`

Please see following LICENSE information for the simple-tree module

---

Copyright (c) 2008, Jason M. Adams
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * The name of Jason M. Adams may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
<?php

namespace psesd\sensors\servers;

class WindowsServer extends Server
{
	public function getObjectTypeDescriptor()
    {
        return 'Windows Server';
    }
}


text:
var client       = require('./redis_client')
  , util         = require('util')
  , EventEmitter = require('events').EventEmitter
  , helper       = require('../lib/global_helpers')
  , getObjectID  = helper.getObjectID;

var BASE_SCORE = 1
  , POST_CREATED_SCORE = BASE_SCORE
  , POST_RELAYED_SCORE = BASE_SCORE*5;

var EventsMonitor = function(){
  EventEmitter.call(this);

  this.keys = {
    popularPosts: "manager:popular_posts",
    post: function(post){
      return "manager:" + getObjectID(post);
    }
  };

  /* Events on userRelayedPost */
  this.on("userRelayedPost", function(err, user, post){
    // Update `popular_posts`
    client.zincrby(this.keys.popularPosts, POST_RELAYED_SCORE, getObjectID(post), function(err, reply){
      if (err) throw err;
    });
  });

  /* Events on userCreatedPost */
  this.on("userCreatedPost", function(err, user, post){
    // Update `popular_posts`
    client.zincrby(this.keys.popularPosts, POST_CREATED_SCORE, getObjectID(post), function(err, reply){
      if (err) throw err;
    });
  });
};

util.inherits(EventsMonitor, EventEmitter);
module.exports = new EventsMonitor();


text:
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="2" failures="0" name="Services.AscSortUtilTest" time="0.005" errors="2" skipped="0">
  <properties>
    <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
    <property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_144\jre\bin"/>
    <property name="java.vm.version" value="25.144-b01"/>
    <property name="java.vm.vendor" value="Oracle Corporation"/>
    <property name="maven.multiModuleProjectDirectory" value="C:\DEV\WorkSpace\Project2"/>
    <property name="java.vendor.url" value="http://java.oracle.com/"/>
    <property name="path.separator" value=";"/>
    <property name="guice.disable.misplaced.annotation.check" value="true"/>
    <property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
    <property name="file.encoding.pkg" value="sun.io"/>
    <property name="user.script" value=""/>
    <property name="user.country" value="RO"/>
    <property name="sun.java.launcher" value="SUN_STANDARD"/>
    <property name="sun.os.patch.level" value=""/>
    <property name="test" value="Services.**.*Test"/>
    <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
    <property name="user.dir" value="C:\DEV\WorkSpace\Project2"/>
    <property name="java.runtime.version" value="1.8.0_144-b01"/>
    <property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
    <property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_144\jre\lib\endorsed"/>
    <property name="os.arch" value="amd64"/>
    <property name="java.io.tmpdir" value="C:\Users\turcuc\AppData\Local\Temp\"/>
    <property name="line.separator" value="
"/>
    <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
    <property name="user.variant" value=""/>
    <property name="os.name" value="Windows 10"/>
    <property name="maven.ext.class.path" value="C:\DEV\IDE\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar"/>
    <property name="classworlds.conf" value="C:\DEV\TOOLS\apache-maven-3.5.0\bin\..\bin\m2.conf"/>
    <property name="sun.jnu.encoding" value="Cp1252"/>
    <property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_144\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jre1.8.0_91\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_91\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\SysWOW64\Empirum;C:\Program Files\Java\jdk1.8.0_91\bin;C:\DEV\TOOLS\apache-maven-3.5.0\bin;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Users\turcuc\AppData\Local\Microsoft\WindowsApps;;."/>
    <property name="maven.conf" value="C:\DEV\TOOLS\apache-maven-3.5.0\bin\../conf"/>
    <property name="java.specification.name" value="Java Platform API Specification"/>
    <property name="java.class.version" value="52.0"/>
    <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
    <property name="os.version" value="10.0"/>
    <property name="library.jansi.path" value="C:\DEV\TOOLS\apache-maven-3.5.0\bin\..\lib\jansi-native\windows64"/>
    <property name="user.home" value="C:\Users\turcuc"/>
    <property name="user.timezone" value="Europe/Athens"/>
    <property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
    <property name="java.specification.version" value="1.8"/>
    <property name="file.encoding" value="UTF-8"/>
    <property name="user.name" value="turcuc"/>
    <property name="java.class.path" value="C:\DEV\TOOLS\apache-maven-3.5.0\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
    <property name="java.vm.specification.version" value="1.8"/>
    <property name="sun.arch.data.model" value="64"/>
    <property name="java.home" value="C:\Program Files\Java\jdk1.8.0_144\jre"/>
    <property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher -Dtest=Services.**.*Test -Dmaven.ext.class.path=C:\DEV\IDE\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar -Dfile.encoding=UTF-8 surefire:test"/>
    <property name="java.specification.vendor" value="Oracle Corporation"/>
    <property name="user.language" value="ro"/>
    <property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
    <property name="java.vm.info" value="mixed mode"/>
    <property name="java.version" value="1.8.0_144"/>
    <property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_144\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
    <property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_144\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_144\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_144\jre\classes"/>
    <property name="java.vendor" value="Oracle Corporation"/>
    <property name="maven.home" value="C:\DEV\TOOLS\apache-maven-3.5.0\bin\.."/>
    <property name="file.separator" value="\"/>
    <property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
    <property name="sun.cpu.endian" value="little"/>
    <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
    <property name="sun.desktop" value="windows"/>
    <property name="sun.cpu.isalist" value="amd64"/>
  </properties>
  <testcase classname="Services.AscSortUtilTest" name="testDefaultCompare" time="0.005">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
	at Services.AscSortUtil.defaultCompare(AscSortUtil.java:24)
	at Services.AscSortUtilTest.testDefaultCompare(AscSortUtilTest.java:53)
</error>
    <system-out>defaultCompare
</system-out>
  </testcase>
  <testcase classname="Services.AscSortUtilTest" name="testCompareTo" time="0">
    <error message="Services.AscSortUtilTest$AscSortUtilImpl cannot be cast to Data.Products" type="java.lang.ClassCastException">java.lang.ClassCastException: Services.AscSortUtilTest$AscSortUtilImpl cannot be cast to Data.Products
	at Services.AscSortUtil.compareTo(AscSortUtil.java:18)
	at Services.AscSortUtilTest.testCompareTo(AscSortUtilTest.java:39)
</error>
    <system-out>compareTo
</system-out>
  </testcase>
</testsuite>


text:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
	/*font-family: Arial, sans-serif; */
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Font Prenton RP */
@font-face {
	font-family:'Prenton';
	src: url('../fonts/eots/PrentonRPCond-Regular.eot'); /* IE9 Compat Modes */
}
@font-face {
	font-family:'Prenton';
	src: url('fonts/Prenton RP Cond.otf?#iefix') format('embedded-opentype'), /* IE6-IE8 */
	     url('fonts/Prenton RP Cond.otf') format('woff'), /* Modern Browsers */
	     url('fonts/Prenton RP Cond.otf')  format('truetype'); /* Safari, Android, iOS */

}

@font-face {
	font-family:'Prenton Medium';
	src: url('fonts/Prenton RP Cond Medium.otf?#iefix') format('embedded-opentype'), /* IE6-IE8 */
	     url('fonts/Prenton RP Cond Medium.otf') format('woff'), /* Modern Browsers */
	     url('fonts/Prenton RP Cond Medium.otf')  format('truetype'); /* Safari, Android, iOS */

}
.fontit {
	font-family: 'Prenton', Arial, sans-serif;
	letter-spacing: 1px;
}
.textshd {
	text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5);
}


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/fuchsia/test_component_context_for_process.h"

#include <fuchsia/io/cpp/fidl.h>
#include <lib/fdio/directory.h>
#include <lib/fidl/cpp/interface_handle.h>
#include <lib/sys/cpp/component_context.h>

#include "base/files/file_enumerator.h"
#include "base/fuchsia/filtered_service_directory.h"
#include "base/fuchsia/fuchsia_logging.h"
#include "base/fuchsia/process_context.h"
#include "base/run_loop.h"

namespace base {

TestComponentContextForProcess::TestComponentContextForProcess(
    InitialState initial_state) {
  // TODO(https://crbug.com/1038786): Migrate to sys::ComponentContextProvider
  // once it provides access to an sys::OutgoingDirectory or PseudoDir through
  // which to publish additional_services().

  // Set up |incoming_services_| to use the ServiceDirectory from the current
  // default ComponentContext to fetch services from.
  context_services_ = std::make_unique<FilteredServiceDirectory>(
      base::ComponentContextForProcess()->svc());

  // Push all services from /svc to the test context if requested.
  if (initial_state == InitialState::kCloneAll) {
    // Calling stat() in /svc is problematic; see https://fxbug.dev/100207. Tell
    // the enumerator not to recurse, to return both files and directories, and
    // to report only the names of entries.
    base::FileEnumerator file_enum(base::FilePath("/svc"), /*recursive=*/false,
                                   base::FileEnumerator::NAMES_ONLY);
    for (auto file = file_enum.Next(); !file.empty(); file = file_enum.Next()) {
      AddService(file.BaseName().value());
    }
  }

  // Create a ServiceDirectory backed by the contents of |incoming_directory|.
  fidl::InterfaceHandle<::fuchsia::io::Directory> incoming_directory;
  zx_status_t status =
      context_services_->ConnectClient(incoming_directory.NewRequest());
  ZX_CHECK(status == ZX_OK, status) << "ConnectClient failed";
  auto incoming_services =
      std::make_shared<sys::ServiceDirectory>(std::move(incoming_directory));

  // Create the ComponentContext with the incoming directory connected to the
  // directory of |context_services_| published by the test, and with a request
  // for the process' root outgoing directory.
  fidl::InterfaceHandle<::fuchsia::io::Directory> published_root_directory;
  old_context_ = ReplaceComponentContextForProcessForTest(
      std::make_unique<sys::ComponentContext>(
          std::move(incoming_services), published_root_directory.NewRequest()));

  // Connect to the "/svc" directory of the |published_root_directory| and wrap
  // that into a ServiceDirectory.
  fidl::InterfaceHandle<::fuchsia::io::Directory> published_services;
  status = fdio_service_connect_at(
      published_root_directory.channel().get(), "svc",
      published_services.NewRequest().TakeChannel().release());
  ZX_CHECK(status == ZX_OK, status) << "fdio_service_connect_at() to /svc";
  published_services_ =
      std::make_shared<sys::ServiceDirectory>(std::move(published_services));
}

TestComponentContextForProcess::~TestComponentContextForProcess() {
  ReplaceComponentContextForProcessForTest(std::move(old_context_));
}

sys::OutgoingDirectory* TestComponentContextForProcess::additional_services() {
  return context_services_->outgoing_directory();
}

void TestComponentContextForProcess::AddService(
    const base::StringPiece service) {
  zx_status_t status = context_services_->AddService(service);
  ZX_CHECK(status == ZX_OK, status) << "AddService(" << service << ") failed";
}

void TestComponentContextForProcess::AddServices(
    base::span<const base::StringPiece> services) {
  for (auto service : services)
    AddService(service);
}

}  // namespace base


text:
typedef struct BlockInfo_t
{
	size_t m_Size;
	struct BlockInfo_t* m_Prev;
	struct BlockInfo_t* m_Next;
	int m_Free;
} BlockInfo;

const size_t kBlockInfoSize = sizeof(BlockInfo);
const size_t kMinBlockSplitSize = sizeof(BlockInfo) * 8;

static BlockInfo* g_BlockListHead = 0;
static BlockInfo* g_BlockListTail = 0;

// sbrk() replacement for Kernel memory
// Uses __heap_start and __stack_top defined in linker script.
// In a hw implementation this is supposed to be the microcontroller's
// build in RAM which is different than the external RAM modules that
// might be attached to it (and which require initialization before
// use).
void* _sbrk(size_t size)
{
	extern char __heap_start;
	extern char __stack_top;
	static char* curProgramBreak = &__heap_start;

	if(size == 0) {
		return curProgramBreak;
	} else if(curProgramBreak + size >= &__stack_top) {
		return (void*)~0u;
	}

	char* ptr = curProgramBreak;
	curProgramBreak += size;
	return ptr;
}

BlockInfo* _ptrToBlock(void* ptr)
{
	return (BlockInfo*)ptr - 1;
}

void* _blockToPtr(BlockInfo* block)
{
	return block + 1;
}

BlockInfo* _allocNewBlock(size_t size)
{
	BlockInfo* block;

	block = _sbrk(0);

	// Align requested size to 16 bytes
	// NOTE: Mask the lower 4 bits of the total size and add 16 (16 * floor(size / 16) + 16)
	const size_t reqSize = ((size + kBlockInfoSize) & 0xFFFFFFF0) + 16;
	void* request = _sbrk(reqSize);
	if (request == (void*)~0u) {
		return 0;
	}

	block->m_Size = size;
	block->m_Prev = 0;
	block->m_Next = 0;
	block->m_Free = 0;

	return block;
}

BlockInfo* _findFreeBlock(BlockInfo* cur, size_t size)
{
	while (cur && !(cur->m_Free && cur->m_Size >= size)) {
		cur = cur->m_Next;
	}

	return cur;
}

int _mergeFreeBlockWithNext(BlockInfo* block)
{
	kassert(block != 0 && block->m_Free != 0, "_mergeFreeBlockWithNext() called with an invalid block");
	if(!block->m_Next || !block->m_Next->m_Free) {
		return 0;
	}

	block->m_Size += block->m_Next->m_Size + kBlockInfoSize;
	block->m_Next = block->m_Next->m_Next;
	if(block->m_Next) {
		block->m_Next->m_Prev = block;
	}

	return 1;
}

int _splitBlock(BlockInfo* block, size_t size)
{
	kassert(block->m_Size >= size, "_splitBlock() called with an invalid block");
	if(block->m_Size < size + kMinBlockSplitSize) {
		return 0;
	}

	uint8_t* blockData = (uint8_t*)_blockToPtr(block);
	blockData += size;

	BlockInfo* newFreeBlock = (BlockInfo*)blockData;
	newFreeBlock->m_Prev = block;
	newFreeBlock->m_Next = block->m_Next;
	if(newFreeBlock->m_Next) {
		newFreeBlock->m_Next->m_Prev = newFreeBlock;
	}
	newFreeBlock->m_Size = block->m_Size - size - kBlockInfoSize;
	newFreeBlock->m_Free = 1;

	block->m_Next = newFreeBlock;
	block->m_Size = size;

	_mergeFreeBlockWithNext(newFreeBlock);

	return 1;
}

void* kmalloc(size_t size)
{
	BlockInfo* block;

	if (size <= 0) {
	  return 0;
	}

	if (!g_BlockListHead) {
		block = _allocNewBlock(size);
		if (!block) {
			return 0;
		}

		g_BlockListHead = block;
		g_BlockListTail = block;
	} else {
		block = _findFreeBlock(g_BlockListHead, size);
		if (!block) {
			block = _allocNewBlock(size);
			if (!block) {
				return 0;
			}

			kassert(g_BlockListTail != 0, "kmalloc(): Invalid block list tail");
			block->m_Prev = g_BlockListTail;
			g_BlockListTail->m_Next = block;
			g_BlockListTail = block;
		} else {
			block->m_Free = 0;

			if(_splitBlock(block, size)) {
				kassert(block->m_Next && block->m_Next->m_Free, "Invalid blocks after split");

				// If this was the last block, update the list tail to point to the new block.
				if(block == g_BlockListTail) {
					g_BlockListTail = block->m_Next;
				}
			}
		}
	}

	return _blockToPtr(block);
}

void kfree(void* ptr)
{
	if (!ptr) {
		return;
	}

	BlockInfo* block = _ptrToBlock(ptr);
	kassert(block->m_Free == 0, "kfree(): Block is already free.");
	block->m_Free = 1;

	// Merge free blocks
	_mergeFreeBlockWithNext(block);
	while(block->m_Prev && block->m_Prev->m_Free == 1) {
		kassert(block->m_Prev->m_Next == block, "Invalid linked list node!");
		_mergeFreeBlockWithNext(block->m_Prev);
		block = block->m_Prev;
	}

	if(!block->m_Next) {
		g_BlockListTail = block;
	}
	if(!block->m_Prev) {
		kassert(block == g_BlockListHead, "Invalid linked list node!");
	}
}

void* krealloc(void* ptr, size_t size)
{
	if (!ptr) {
		return kmalloc(size);
	}

	BlockInfo* block = _ptrToBlock(ptr);
	if (block->m_Size >= size) {
		if(_splitBlock(block, size)) {
			kassert(block->m_Next && block->m_Next->m_Free, "Invalid blocks after split");

			// If this was the last block, update the list tail to point to the new block.
			if(block == g_BlockListTail) {
				g_BlockListTail = block->m_Next;
			}
		}

		return ptr;
	}

	// If the next block is free and it can hold the extra required space
	// merge the two.
	if(block->m_Next && block->m_Next->m_Free) {
		const size_t totalSize = block->m_Size + block->m_Next->m_Size + kBlockInfoSize;
		if(totalSize >= size) {
			block->m_Size = totalSize;
			block->m_Next = block->m_Next->m_Next;
			if(block->m_Next) {
				block->m_Next->m_Prev = block;
			} else {
				// This is the last block in the list.
				g_BlockListTail = block;
			}

			return ptr;
		}
	}

	// We have to allocate a shiny new block and copy the data to it.
	void* newPtr = kmalloc(size);
	if (!newPtr) {
		return 0;
	}

	kmemcpy(newPtr, ptr, block->m_Size);
	kfree(ptr);

	return newPtr;
}


text:
using System;
using MoreMountains.Feedbacks;
using MoreMountains.Tools;
using MoreMountains.CorgiEngine;
using UnityEngine;

namespace StatusSystem
{
    public class CharacterStatusEffectListener : MonoBehaviour, MMEventListener<StatusEffectEvent>
    {
        private Character _character;

        [Serializable]
        public struct StatusEffectFeedbacks
        {
            public StatusEffect StatusEffect;
            public MMFeedbacks StatusEffectStartFeedbacks;
            public MMFeedbacks StatusEffectStopFeedbacks;

            public void OnApply(StatusEffect statusEffect, Character character)
            {
                if (statusEffect != StatusEffect) return;
                StatusEffect.Apply(character);
            }

            public void OnStart(StatusEffect statusEffect)
            {
                if (statusEffect != StatusEffect) return;
                StatusEffectStartFeedbacks?.PlayFeedbacks();
            }

            public void OnStop(StatusEffect statusEffect)
            {
                if (statusEffect != StatusEffect) return;
                StatusEffectStopFeedbacks?.PlayFeedbacks();
            }
        }

        public StatusEffectFeedbacks[] StatusEffectsAndFeedbacks;

        private void Awake()
        {
            _character = GetComponentInParent<Character>();
        }

        public void OnMMEvent(StatusEffectEvent statusEffectEvent)
        {
            if (statusEffectEvent.Character != _character) return;
            switch (statusEffectEvent.Type)
            {
                case StatusEffectEventTypes.Apply:
                    foreach (var statusEffectsFeedback in StatusEffectsAndFeedbacks)
                        statusEffectsFeedback.OnApply(statusEffectEvent.StatusEffect, _character);
                    break;
                case StatusEffectEventTypes.Start:
                    foreach (var statusEffectsFeedback in StatusEffectsAndFeedbacks)
                        statusEffectsFeedback.OnStart(statusEffectEvent.StatusEffect);
                    break;
                case StatusEffectEventTypes.Stop:
                    foreach (var statusEffectsFeedback in StatusEffectsAndFeedbacks)
                        statusEffectsFeedback.OnStop(statusEffectEvent.StatusEffect);
                    break;
            }
        }

        private void OnEnable()
        {
            this.MMEventStartListening();
        }

        private void OnDisable()
        {
            this.MMEventStopListening();
        }
    }
}


text:
EventPipeEvent::EventPipeEvent(
    EventPipeProvider &provider,
    INT64 keywords,
    unsigned int eventID,
    unsigned int eventVersion,
    EventPipeEventLevel level,
    bool needStack,
    BYTE *pMetadata,
    unsigned int metadataLength) : m_pProvider(&provider),
                                   m_keywords(keywords),
                                   m_eventID(eventID),
                                   m_eventVersion(eventVersion),
                                   m_level(level),
                                   m_needStack(needStack),
                                   m_enabledMask(0),
                                   m_pMetadata(nullptr)
{
    CONTRACTL
    {
        THROWS;
        GC_NOTRIGGER;
        MODE_ANY;
        PRECONDITION(&provider != nullptr);
    }
    CONTRACTL_END;

    if (pMetadata != nullptr)
    {
        m_pMetadata = new BYTE[metadataLength];
        memcpy(m_pMetadata, pMetadata, metadataLength);
        m_metadataLength = metadataLength;
    }
    else
    {
        // if metadata is not provided, we have to build the minimum version. It's required by the serialization contract
        m_pMetadata = BuildMinimumMetadata();
        m_metadataLength = MinimumMetadataLength;
    }
}

EventPipeEvent::~EventPipeEvent()
{
    CONTRACTL
    {
        NOTHROW;
        GC_NOTRIGGER;
        MODE_ANY;
    }
    CONTRACTL_END;

    delete[] m_pMetadata;
}

BYTE *EventPipeEvent::BuildMinimumMetadata()
{
    CONTRACTL
    {
        THROWS;
        GC_NOTRIGGER;
        MODE_ANY;
    }
    CONTRACTL_END;

    BYTE *minmumMetadata = new BYTE[MinimumMetadataLength];
    BYTE *currentPtr = minmumMetadata;

    // the order of fields is defined in coreclr\src\mscorlib\shared\System\Diagnostics\Tracing\EventSource.cs DefineEventPipeEvents method
    memcpy(currentPtr, &m_eventID, sizeof(m_eventID));
    currentPtr += sizeof(m_eventID);

    SString eventName = SString::Empty();
    unsigned int eventNameSize = (eventName.GetCount() + 1) * sizeof(WCHAR);
    memcpy(currentPtr, (BYTE *)eventName.GetUnicode(), eventNameSize);
    currentPtr += eventNameSize;

    memcpy(currentPtr, &m_keywords, sizeof(m_keywords));
    currentPtr += sizeof(m_keywords);

    memcpy(currentPtr, &m_eventVersion, sizeof(m_eventVersion));
    currentPtr += sizeof(m_eventVersion);

    memcpy(currentPtr, &m_level, sizeof(m_level));
    currentPtr += sizeof(m_level);

    unsigned int noParameters = 0;
    memcpy(currentPtr, &noParameters, sizeof(noParameters));
    currentPtr += sizeof(noParameters);

    return minmumMetadata;
}

EventPipeProvider *EventPipeEvent::GetProvider() const
{
    LIMITED_METHOD_CONTRACT;
    return m_pProvider;
}

INT64 EventPipeEvent::GetKeywords() const
{
    LIMITED_METHOD_CONTRACT;
    return m_keywords;
}

unsigned int EventPipeEvent::GetEventID() const
{
    LIMITED_METHOD_CONTRACT;
    return m_eventID;
}

unsigned int EventPipeEvent::GetEventVersion() const
{
    LIMITED_METHOD_CONTRACT;
    return m_eventVersion;
}

EventPipeEventLevel EventPipeEvent::GetLevel() const
{
    LIMITED_METHOD_CONTRACT;
    return m_level;
}

bool EventPipeEvent::NeedStack() const
{
    LIMITED_METHOD_CONTRACT;
    return m_needStack;
}

bool EventPipeEvent::IsEnabled() const
{
    LIMITED_METHOD_CONTRACT;
    return m_enabledMask != 0;
}

BYTE *EventPipeEvent::GetMetadata() const
{
    LIMITED_METHOD_CONTRACT;
    return m_pMetadata;
}

unsigned int EventPipeEvent::GetMetadataLength() const
{
    LIMITED_METHOD_CONTRACT;
    return m_metadataLength;
}

void EventPipeEvent::RefreshState()
{
    LIMITED_METHOD_CONTRACT;
    _ASSERTE(EventPipe::IsLockOwnedByCurrentThread());
    m_enabledMask = m_pProvider->ComputeEventEnabledMask(m_keywords, m_level);
}

bool EventPipeEvent::IsEnabled(uint64_t sessionMask) const
{
    LIMITED_METHOD_CONTRACT;
    _ASSERTE(m_pProvider != nullptr);
    return (m_pProvider->IsEnabled(sessionMask) && (m_enabledMask & sessionMask) != 0);
}

#endif // FEATURE_PERFTRACING


text:
<?php

namespace ZfcUser\Options;

use Zend\Stdlib\AbstractOptions;

class ModuleOptions extends AbstractOptions implements
    UserControllerOptionsInterface,
    UserServiceOptionsInterface
{
    /**
     * Turn off strict options mode
     */
    protected $__strictMode__ = false;

    /**
     * @var bool
     */
    protected $useRedirectParameterIfPresent = true;

    /**
     * @var string
     */
    protected $loginRedirectRoute = 'zfcuser';

    /**
     * @var string
     */
    protected $logoutRedirectRoute = 'zfcuser/login';

    /**
     * @var int
     */
    protected $loginFormTimeout = 300;

    /**
     * @var int
     */
    protected $userFormTimeout = 300;

    /**
     * @var bool
     */
    protected $loginAfterRegistration = true;

    /**
     * @var array
     */
    protected $authIdentityFields = array( 'email' );

    /**
     * @var string
     */
    protected $userEntityClass = 'ZfcUser\Entity\User';

    /**
     * @var bool
     */
    protected $enableRegistration = true;

    /**
     * @var bool
     */
    protected $enableUsername = false;

    /**
     * @var bool
     */
    protected $enableDisplayName = false;

    /**
     * @var bool
     */
    protected $useRegistrationFormCaptcha = false;

    /**
     * @var int
     */
    protected $passwordCost = 14;

    /**
     * @var array
     */
    protected $formCaptchaOptions = array(
        'class'   => 'figlet',
        'options' => array(
            'wordLen'    => 5,
            'expiration' => 300,
            'timeout'    => 300,
        ),
    );

    /**
     * set login redirect route
     *
     * @param string $loginRedirectRoute
     * @return ModuleOptions
     */
    public function setLoginRedirectRoute($loginRedirectRoute)
    {
        $this->loginRedirectRoute = $loginRedirectRoute;
        return $this;
    }

    /**
     * get login redirect route
     *
     * @return string
     */
    public function getLoginRedirectRoute()
    {
        return $this->loginRedirectRoute;
    }

    /**
     * set logout redirect route
     *
     * @param string $logoutRedirectRoute
     * @return ModuleOptions
     */
    public function setLogoutRedirectRoute($logoutRedirectRoute)
    {
        $this->logoutRedirectRoute = $logoutRedirectRoute;
        return $this;
    }

    /**
     * get logout redirect route
     *
     * @return string
     */
    public function getLogoutRedirectRoute()
    {
        return $this->logoutRedirectRoute;
    }

    /**
     * set use redirect param if present
     *
     * @param bool $useRedirectParameterIfPresent
     * @return ModuleOptions
     */
    public function setUseRedirectParameterIfPresent($useRedirectParameterIfPresent)
    {
        $this->useRedirectParameterIfPresent = $useRedirectParameterIfPresent;
        return $this;
    }

    /**
     * get use redirect param if present
     *
     * @return bool
     */
    public function getUseRedirectParameterIfPresent()
    {
        return $this->useRedirectParameterIfPresent;
    }

    /**
     * set enable user registration
     *
     * @param bool $enableRegistration
     * @return ModuleOptions
     */
    public function setEnableRegistration($enableRegistration)
    {
        $this->enableRegistration = $enableRegistration;
        return $this;
    }

    /**
     * get enable user registration
     *
     * @return bool
     */
    public function getEnableRegistration()
    {
        return $this->enableRegistration;
    }

    /**
     * set login form timeout
     *
     * @param int $loginFormTimeout
     * @return ModuleOptions
     */
    public function setLoginFormTimeout($loginFormTimeout)
    {
        $this->loginFormTimeout = $loginFormTimeout;
        return $this;
    }

    /**
     * get login form timeout in seconds
     *
     * @return int
     */
    public function getLoginFormTimeout()
    {
        return $this->loginFormTimeout;
    }

    /**
     * set user form timeout in seconds
     *
     * @param int $userFormTimeout
     * @return ModuleOptions
     */
    public function setUserFormTimeout($userFormTimeout)
    {
        $this->userFormTimeout = $userFormTimeout;
        return $this;
    }

    /**
     * get user form timeout in seconds
     *
     * @return int
     */
    public function getUserFormTimeout()
    {
        return $this->userFormTimeout;
    }

    /**
     * set login after registration
     *
     * @param bool $loginAfterRegistration
     * @return ModuleOptions
     */
    public function setLoginAfterRegistration($loginAfterRegistration)
    {
        $this->loginAfterRegistration = $loginAfterRegistration;
        return $this;
    }

    /**
     * get login after registration
     *
     * @return bool
     */
    public function getLoginAfterRegistration()
    {
        return $this->loginAfterRegistration;
    }

    /**
     * set auth identity fields
     *
     * @param array $authIdentityFields
     * @return ModuleOptions
     */
    public function setAuthIdentityFields($authIdentityFields)
    {
        $this->authIdentityFields = $authIdentityFields;
        return $this;
    }

    /**
     * get auth identity fields
     *
     * @return array
     */
    public function getAuthIdentityFields()
    {
        return $this->authIdentityFields;
    }

    /**
     * set enable username
     *
     * @param bool $flag
     * @return ModuleOptions
     */
    public function setEnableUsername($flag)
    {
        $this->enableUsername = (bool) $flag;
        return $this;
    }

    /**
     * get enable username
     *
     * @return bool
     */
    public function getEnableUsername()
    {
        return $this->enableUsername;
    }

    /**
     * set enable display name
     *
     * @param bool $flag
     * @return ModuleOptions
     */
    public function setEnableDisplayName($flag)
    {
        $this->enableDisplayName = (bool) $flag;
        return $this;
    }

    /**
     * get enable display name
     *
     * @return bool
     */
    public function getEnableDisplayName()
    {
        return $this->enableDisplayName;
    }

    /**
     * set use a captcha in registration form
     *
     * @param bool $useRegistrationFormCaptcha
     * @return ModuleOptions
     */
    public function setUseRegistrationFormCaptcha($useRegistrationFormCaptcha)
    {
        $this->useRegistrationFormCaptcha = $useRegistrationFormCaptcha;
        return $this;
    }

    /**
     * get use a captcha in registration form
     *
     * @return bool
     */
    public function getUseRegistrationFormCaptcha()
    {
        return $this->useRegistrationFormCaptcha;
    }

    /**
     * set user entity class name
     *
     * @param string $userEntityClass
     * @return ModuleOptions
     */
    public function setUserEntityClass($userEntityClass)
    {
        $this->userEntityClass = $userEntityClass;
        return $this;
    }

    /**
     * get user entity class name
     *
     * @return string
     */
    public function getUserEntityClass()
    {
        return $this->userEntityClass;
    }

    /**
     * set password cost
     *
     * @param int $passwordCost
     * @return ModuleOptions
     */
    public function setPasswordCost($passwordCost)
    {
        $this->passwordCost = $passwordCost;
        return $this;
    }

    /**
     * get password cost
     *
     * @return int
     */
    public function getPasswordCost()
    {
        return $this->passwordCost;
    }

    /**
     * set form CAPTCHA options
     *
     * @param array $formCaptchaOptions
     * @return ModuleOptions
     */
    public function setFormCaptchaOptions($formCaptchaOptions)
    {
        $this->formCaptchaOptions = $formCaptchaOptions;
        return $this;
    }

    /**
     * get form CAPTCHA options
     *
     * @return array
     */
    public function getFormCaptchaOptions()
    {
        return $this->formCaptchaOptions;
    }
}


text:
package com.project.webshop.model;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * OrderpriceId
 *
 */
@Embeddable
public class OrderpriceId implements java.io.Serializable {

    private int ordNr;
    private String userName;
    private BigDecimal totalPrice;

    public OrderpriceId() {
    }

    public OrderpriceId(int ordNr, String userName) {
        this.ordNr = ordNr;
        this.userName = userName;
    }

    public OrderpriceId(int ordNr, String userName, BigDecimal totalPrice) {
        this.ordNr = ordNr;
        this.userName = userName;
        this.totalPrice = totalPrice;
    }

    @Column(name = "ordNr", nullable = false)
    public int getOrdNr() {
        return this.ordNr;
    }

    public void setOrdNr(int ordNr) {
        this.ordNr = ordNr;
    }

    @Column(name = "userName", nullable = false, length = 20)
    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Column(name = "totalPrice", precision = 42, scale = 0)
    public BigDecimal getTotalPrice() {
        return this.totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof OrderpriceId))
            return false;
        OrderpriceId castOther = (OrderpriceId) other;

        return (this.getOrdNr() == castOther.getOrdNr())
                && ((this.getUserName() == castOther.getUserName()) || (this
                        .getUserName() != null
                        && castOther.getUserName() != null && this
                        .getUserName().equals(castOther.getUserName())))
                && ((this.getTotalPrice() == castOther.getTotalPrice()) || (this
                        .getTotalPrice() != null
                        && castOther.getTotalPrice() != null && this
                        .getTotalPrice().equals(castOther.getTotalPrice())));
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + this.getOrdNr();
        result = 37 * result
                + (getUserName() == null ? 0 : this.getUserName().hashCode());
        result = 37
                * result
                + (getTotalPrice() == null ? 0 : this.getTotalPrice()
                        .hashCode());
        return result;
    }

}


text:
#include "BufferInterfaceManaged.h"

namespace vtStor
{
    namespace Managed
    {
        cBufferInterface::cBufferInterface( IRunTimeDll^ RunTimeDll, U32 SizeInByte )
        {
            GetBufferDelegate getBufferDelegate = (GetBufferDelegate)RunTimeDll->GetFunction("cBuffer_GetBuffer");
            getBufferDelegate(*m_Buffer, SizeInByte);
        }

        cBufferInterface::~cBufferInterface()
        {
        }

        cBufferInterface::!cBufferInterface()
        {
        }

        cBufferInterface::operator void*()
        {
            return(reinterpret_cast<void*>(&(*m_Buffer)));
        }

        void cBufferInterface::SetByteAt( U32 Index, U8 Value )
        {
            return( m_Buffer->SetByteAt( Index, Value ) );
        }

        U8 cBufferInterface::GetByteAt(U32 Index)
        {
            return( m_Buffer->GetByteAt(Index) );
        }

        U32 cBufferInterface::GetSizeInBytes()
        {
            return( m_Buffer->GetSizeInBytes() );
        }

        void cBufferInterface::Memset(U8 Value)
        {
            m_Buffer->Memset(Value);
        }
    }
}


text:
class UsersController < ApplicationController
  before_filter :authenticate_user!

  def new
    @user = User.new
  end

  def show
    @user = User.find(params[:id])
  end

  def geojson
    maps = User.find(params[:user_id]).maps
    @geojson = Array.new
    maps.each do |map|
      map.moments.each do |moment|
        @geojson << {
          type: 'Feature',
          geometry: {
            type: 'Point',
            coordinates: [moment.longitude, moment.latitude]
          },
          properties: {
            'title': map.name,
            'description': moment.memo,
            'image': moment.image.url,
            'marker-color': '#15b3d9',
            'marker-symbol': 'star-stroked',
            'marker-size': 'medium'
          }
        }
      end
    end

     render json: @geojson
  end

  def add_friend
    message = current_user.add_friend(params[:friend_name])
    flash[:notice] = message

    redirect_to user_path(current_user)
  end

  def remove_friend
    current_user.unfriend(params[:friend_id])

    redirect_to user_path(current_user)
  end

end


text:
namespace s3d {

struct StanVariance {
  double roll{};
  double vertical{};
  double panKeystone{};
  double tiltKeystone{};
  double tiltOffset{};
  double zoom{};

  Eigen::VectorXd toVector() const {
    Eigen::VectorXd varianceVector(5);
    varianceVector << vertical, roll, zoom, tiltOffset, panKeystone;
    return varianceVector;
  }
};

}

#endif //FILTER_STAN_VARIANCE_H


text:
<?php
class CBCBackend extends CBBackend
{
    public function endOfStatement()
    {
        return ';';
    }

    public function buildFileHeader(CBFile $file)
    {
        return '';
    }

    public function buildMainFunction($code)
    {
        $code .= $this->cbs->eol.$this->cbs->eol;
        $code .= 'return 0;';

        $lines = Array(
            'int main()',
            '{',
            $this->cbs->indent(1, $code),
            '}',
        );
        return join($this->cbs->eol, $lines);
    }

    public function buildTypeDefinition(CBType $type)
    {
        $r = '';
        if ($type->hasToBeDeclared()) {
            if ($type instanceof CBTypeStruct) {
                $typeName = $type->getName();
                $r = "typedef struct _{$typeName} {".$this->cbs->eol;
                foreach ($type->fieldTypes as $key => $t) {
                    $r .= $this->cbs->indent(1).$this->buildType($t)." {$key};".$this->cbs->eol;
                }
                $r .= "} {$typeName}";
            }
        }

        return $r;
    }

    public function buildVarUninitializedDeclaration(CBVariable $var)
    {
        return $this->buildVarDeclarationWithType($var);
    }

    public function buildVarInitializedDeclaration(CBBaseVariable $var, CBScope $scope)
    {
        return $this->buildAssignment(
            $this->buildVarDeclarationWithType($var)
            , $this->buildVarInitializer($var, $scope));
    }

    public function buildStringVal($string)
    {
        return '"'.str_replace('"', '\"', $string).'"';
    }

    public function buildListInitializer(array $list, CBScope $scope)
    {
        $code = '{' . $this->cbs->eol;
        foreach ($list as $v){
            $valCode = $this->buildVal($v, $scope);
            $valCode .= ',' . $this->cbs->eol;

            $valCode = $this->cbs->indent(1, $valCode);

            $code .= $valCode;
        }
        $code .= '}';

        return $code;
    }

    public function buildListIndexAccessor($index)
    {
        return "[".$index."]";
    }

    public function buildListIterator($pathToList, $pathToItem, $pathToIndex = NULL)
    {
        // @TODO: Implement me!
        $this->error("Implement me", "Implement me");
    }

    public function buildAddToList($pathToList, $pathToItem)
    {
        // @TODO: Implement me!
        $this->error("Implement me", "Implement me");
    }

    public function buildMergeLists($pathToFirstList, $pathToSecondList)
    {
        // @TODO: Implement me!
        $this->error("Implement me", "Implement me");
    }

    public function buildStructInitializer(array $struct, CBScope $scope)
    {
        $code = '{' . $this->cbs->eol;
        foreach ($struct as $k => $v){
            $valCode = '.' . $k;
            $valCode .= " = ";
            $valCode .= $this->buildVal($v, $scope);
            $valCode .= ',' . $this->cbs->eol;

            $valCode = $this->cbs->indent(1, $valCode);

            $code .= $valCode;
        }
        $code .= '}';

        return $code;
    }

    public function buildStructFieldAccessor($fieldName)
    {
        return '.'.$fieldName;
    }

    public function buildThis()
    {
        // @TODO: Implement me!
        $this->error("Implement me", "Implement me");
    }

    /**
     * @param CBBaseVariable $var
     * @return string
     */
    private function buildVarDeclarationWithType(CBBaseVariable $var)
    {
        $typePrefix = NULL;
        $listSuffix = NULL;
        $varName = $this->varName($var);
        $type = $var->getType();

        $typeName = $type->getTypeName();
        if ($typeName !== NULL) {
            $typePrefix = $typeName;
        } else {
            if ($type instanceof CBTypeList) {
                $typePrefix = $this->buildType($type->itemType);
                $listSuffix = '[]';
            } else if ($type instanceof CBTypeStruct) {
                $typePrefix = $this->buildType($type);
            } else if ($type instanceof CBTypeAtomic) {
                $typePrefix = $this->buildType($type);
            }
        }

        if ($typePrefix === NULL) {
            $this->cbs->error(__METHOD__.": unexpected type encountered", CBSettings::ERROR_UNEXPECTED_TYPE);
            return NULL;
        } else {
            $r = 'const '.$typePrefix.' '.$varName;
            if ($listSuffix) {
                $r .= $listSuffix;
            }
            return $r;
        }
    }

    /**
     * @param CBType $type
     * @return null|string
     */
    private function buildType(CBType $type)
    {
        $typeName = $type->getTypeName();
        if ($typeName !== NULL) {
            return $typeName;
        }

        if ($type instanceof CBTypeList) {
            return $this->buildType($type->itemType).'*';
        } else if ($type instanceof CBTypeStruct) {
            // @TODO: implement me!
            $this->cbs->error("Implement me!", CBSettings::ERROR_UNEXPECTED_TYPE);
        } else if ($type instanceof CBTypeAtomic) {
            switch ($type->typeFlag) {
                case CBType::CB_STRING:
                    return 'char*';

                case CBType::CB_INT:
                    return 'int';

                case CBType::CB_FLOAT:
                    return 'double';

                case CBType::CB_BOOL:
                    return 'bool';
            }
        }

        return NULL;
    }
}


text:
module Traceparts
  class Category
    attr_reader :path, :title, :path_caption, :classification_id, :picture_url, :level, :description

    def initialize(client, data)
      @client = client

      @path = data.fetch('path')
      @title = data.fetch('title')
      @path_caption = data.fetch('pathCaption')
      @classification_id = data.fetch('classificationId')
      @picture_url = data.fetch('pictureUrl')
      @level = data.fetch('level')
      @description = data.fetch('description')
    end

    def products
      @client.products(classification_id, path)
    end
  end
end


text:
package org.eclipse.rdf4j.federated.evaluation.join;

import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.eclipse.rdf4j.federated.evaluation.FederationEvalStrategy;
import org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutor;
import org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelTaskBase;
import org.eclipse.rdf4j.query.BindingSet;
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.eclipse.rdf4j.query.algebra.TupleExpr;

/**
 * A task implementation representing a join, i.e. the provided expression is evaluated with the given bindings.
 *
 * @author Andreas Schwarte
 */
public class ParallelJoinTask extends ParallelTaskBase<BindingSet> {

	protected final FederationEvalStrategy strategy;
	protected final TupleExpr expr;
	protected final BindingSet bindings;
	protected final ParallelExecutor<BindingSet> joinControl;

	public ParallelJoinTask(ParallelExecutor<BindingSet> joinControl, FederationEvalStrategy strategy, TupleExpr expr,
			BindingSet bindings) {
		this.strategy = strategy;
		this.expr = expr;
		this.bindings = bindings;
		this.joinControl = joinControl;
	}

	@Override
	protected CloseableIteration<BindingSet, QueryEvaluationException> performTaskInternal() throws Exception {
		return strategy.evaluate(expr, bindings);
	}

	@Override
	public ParallelExecutor<BindingSet> getControl() {
		return joinControl;
	}
}


text:
<?php

namespace Application\Form\View\Helper;
use Zend\Form\View\Helper\FormTextarea as OriginalFormFormTextarea;
use Zend\Form\ElementInterface;

class FormCKEditor extends OriginalFormFormTextarea {

    public function __invoke(ElementInterface $element = null)
    {
        // invoke parent and get form text
        include_once getcwd() . '/public/ckeditor/ckeditor_custom.php';
        include_once getcwd() . '/public/ckfinder/ckfinder.php';
        $name = $element->getName();
        $value = $element->getValue();
        $CKEditor = new \CKEditor();
        $CKFinder = new \CKFinder();
        $attributes = $element->getAttributes();
        foreach ($attributes as $attrKey => $attrValue) {
            switch ($attrKey) {
                case 'width':
                case 'height':
                    $config[$attrKey] = $attrValue;
            }
        }
        $config['toolbar'] = array(
            array( 'Source'),
            array( 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'),
            array( 'Image', 'Smiley', 'Table', 'Link', 'Unlink'),
            array( 'Font','FontSize', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-', 'TextColor', 'BGColor')
        );
        $config['filebrowserBrowseUrl'] = '/ckfinder/ckfinder.html';
        $config['filebrowserImageBrowseUrl'] = '/ckfinder/ckfinder.html?type=Images';
        $config['filebrowserFlashBrowseUrl'] = '/ckfinder/ckfinder.html?type=Flash';
        $config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
        $config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
        $config['filebrowserFlashUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
        $CKEditor->basePath = '/ckeditor/';
        $CKFinder->SetupCKEditorObject($CKEditor);
        return $CKEditor->editor(parent::__invoke($element), $name, $value, $config, null);
    }

}


text:
#ifndef PLATFORM_WINDOWS_SYS_TIME__H
#define PLATFORM_WINDOWS_SYS_TIME__H

#ifdef __cplusplus
extern "C" {
#endif

struct timeval;
struct timezone
{
	int  tz_minuteswest; /* minutes W of Greenwich */
	int  tz_dsttime;     /* type of dst correction */
};

int gettimeofday(struct timeval* tp, struct timezone* tzp);

#ifdef __cplusplus
}
#endif

#endif


text:
import logging

from django.conf import settings

from cleanliness import encoding

from common import exception
from common import throttle
from common import component
from common.protocol import base

class SmsMessage(object):
  sender = None
  target = None
  message = None

  def __init__(self, sender, target, message):
    self.sender = sender
    self.target = target
    self.message = message

  @classmethod
  def from_request(cls, request):
    sms_service = component.best['sms_service']
    return sms_service.from_request(cls, request)

class SmsConnection(base.Connection):
  def filter_targets(self, to_list, message):
    if settings.SMS_MT_WHITELIST:
      to_list = [x for x in to_list if settings.SMS_MT_WHITELIST.match(x)]

    if settings.SMS_MT_BLACKLIST:
      to_list = [x for x in to_list if not settings.SMS_MT_BLACKLIST.match(x)]

    if settings.SMS_TEST_ONLY:
      to_list = [x for x in to_list if x in settings.SMS_TEST_NUMBERS]

    if len(to_list) == 0:
      raise exception.ServiceError('All requested SMS targets are blocked')

    return to_list

  def send_message(self, to_list, message):
    if not to_list:
      return

    try:
      to_list = self.filter_targets(to_list, message)
    except exception.Error:
      exception.log_warning()
      return

    # global monthly sms limit
    # TODO(termie): this means that no messages will be sent if any
    #               will go over the limit, is this really the behavior
    #               we want?
    for i in range(0, len(to_list)):
      throttle.throttle(None,
                        'sms_global_send',
                        month=settings.THROTTLE_SMS_GLOBAL_MONTH)

    message = encoding.smart_str(message)
    sms_service = component.best['sms_service']
    sms_service.send_message(to_list, message)


text:
using System;

namespace Dirigent.iOS.Services {
	public interface IBookmarksManager {
	}
}