text:
using System;
using Common.Exceptions;

namespace Packager.Exceptions
{
    public class FileDirectoryExistsException:AbstractEngineException
    {
        public FileDirectoryExistsException(string baseMessage, params object[] parameters) : base(baseMessage, parameters)
        {
        }

        public FileDirectoryExistsException(Exception innerException, string baseMessage, params object[] parameters) : base(innerException, baseMessage, parameters)
        {
        }
    }
}


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

<title>com.mgnt.utils.textutils</title>
<meta name="date" content="2022-10-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.mgnt.utils.textutils

Classes

Version

VersionComparator

VersionRange

Exceptions

InvalidVersionFormatException

InvalidVersionRangeException

redpajama_set_name: RedPajamaGithub


text:
package org.apache.aries.blueprint.container;

import org.apache.aries.blueprint.ComponentDefinitionRegistry;
import org.apache.aries.blueprint.ExtendedBeanMetadata;
import org.apache.aries.blueprint.PassThroughMetadata;
import org.apache.aries.blueprint.di.*;
import org.apache.aries.blueprint.ext.ComponentFactoryMetadata;
import org.apache.aries.blueprint.ext.DependentComponentFactoryMetadata;
import org.apache.aries.blueprint.reflect.MetadataUtil;
import org.apache.aries.blueprint.utils.ServiceListener;
import org.osgi.service.blueprint.reflect.*;

import java.util.*;

public class NoOsgiRecipeBuilder {

    private final Set<String> names = new HashSet<String>();
    private final BlueprintContainerImpl blueprintContainer;
    private final ComponentDefinitionRegistry registry;
    private final IdSpace recipeIdSpace;

    public NoOsgiRecipeBuilder(BlueprintContainerImpl blueprintContainer, IdSpace recipeIdSpace) {
        this.recipeIdSpace = recipeIdSpace;
        this.blueprintContainer = blueprintContainer;
        this.registry = blueprintContainer.getComponentDefinitionRegistry();
    }

    public BlueprintRepository createRepository() {
        BlueprintRepository repository = new NoOsgiBlueprintRepository(blueprintContainer);
        // Create component recipes
        for (String name : registry.getComponentDefinitionNames()) {
            ComponentMetadata component = registry.getComponentDefinition(name);
            Recipe recipe = createRecipe(component);
            repository.putRecipe(recipe.getName(), recipe);
        }
        repository.validate();
        return repository;
    }

    public Recipe createRecipe(ComponentMetadata component) {

        // Custom components should be handled before built-in ones
        // in case we have a custom component that also implements a built-in metadata

        if (component instanceof DependentComponentFactoryMetadata) {
            return createDependentComponentFactoryMetadata((DependentComponentFactoryMetadata) component);
        } else if (component instanceof ComponentFactoryMetadata) {
            return createComponentFactoryMetadata((ComponentFactoryMetadata) component);
        } else if (component instanceof BeanMetadata) {
            return createBeanRecipe((BeanMetadata) component);
        } else if (component instanceof ServiceMetadata) {
            throw new IllegalArgumentException("OSGi services are not supported");
        } else if (component instanceof ReferenceMetadata) {
            throw new IllegalArgumentException("OSGi references are not supported");
        } else if (component instanceof ReferenceListMetadata) {
            throw new IllegalArgumentException("OSGi references are not supported");
        } else if (component instanceof PassThroughMetadata) {
            return createPassThroughRecipe((PassThroughMetadata) component);
        } else {
            throw new IllegalStateException("Unsupported component type " + component.getClass());
        }
    }

    private Recipe createComponentFactoryMetadata(ComponentFactoryMetadata metadata) {
        return new ComponentFactoryRecipe<ComponentFactoryMetadata>(
                metadata.getId(), metadata, blueprintContainer, getDependencies(metadata));
    }

    private Recipe createDependentComponentFactoryMetadata(DependentComponentFactoryMetadata metadata) {
        return new DependentComponentFactoryRecipe(
                metadata.getId(), metadata, blueprintContainer, getDependencies(metadata));
    }

    private List<Recipe> getDependencies(ComponentMetadata metadata) {
        List<Recipe> deps = new ArrayList<Recipe>();
        for (String name : metadata.getDependsOn()) {
            deps.add(new RefRecipe(getName(null), name));
        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
                passThroughMetadata.getObject());
    }

    private Object getBeanClass(BeanMetadata beanMetadata) {
        if (beanMetadata instanceof ExtendedBeanMetadata) {
            ExtendedBeanMetadata extBeanMetadata = (ExtendedBeanMetadata) beanMetadata;
            if (extBeanMetadata.getRuntimeClass() != null) {
                return extBeanMetadata.getRuntimeClass();
            }
        }
        return beanMetadata.getClassName();
    }

    private boolean allowsFieldInjection(BeanMetadata beanMetadata) {
        if (beanMetadata instanceof ExtendedBeanMetadata) {
            return ((ExtendedBeanMetadata) beanMetadata).getFieldInjection();
        }
        return false;
    }

    private BeanRecipe createBeanRecipe(BeanMetadata beanMetadata) {
        BeanRecipe recipe = new BeanRecipe(
                getName(beanMetadata.getId()),
                blueprintContainer,
                getBeanClass(beanMetadata),
                allowsFieldInjection(beanMetadata));
        // Create refs for explicit dependencies
        recipe.setExplicitDependencies(getDependencies(beanMetadata));
        recipe.setPrototype(MetadataUtil.isPrototypeScope(beanMetadata) || MetadataUtil.isCustomScope(beanMetadata));
        recipe.setInitMethod(beanMetadata.getInitMethod());
        recipe.setDestroyMethod(beanMetadata.getDestroyMethod());
        recipe.setInterceptorLookupKey(beanMetadata);
        List<BeanArgument> beanArguments = beanMetadata.getArguments();
        if (beanArguments != null && !beanArguments.isEmpty()) {
            boolean hasIndex = (beanArguments.get(0).getIndex() >= 0);
            if (hasIndex) {
                List<BeanArgument> beanArgumentsCopy = new ArrayList<BeanArgument>(beanArguments);
                Collections.sort(beanArgumentsCopy, MetadataUtil.BEAN_COMPARATOR);
                beanArguments = beanArgumentsCopy;
            }
            List<Object> arguments = new ArrayList<Object>();
            List<String> argTypes = new ArrayList<String>();
            for (BeanArgument argument : beanArguments) {
                Recipe value = getValue(argument.getValue(), null);
                arguments.add(value);
                argTypes.add(argument.getValueType());
            }
            recipe.setArguments(arguments);
            recipe.setArgTypes(argTypes);
            recipe.setReorderArguments(!hasIndex);
        }
        recipe.setFactoryMethod(beanMetadata.getFactoryMethod());
        if (beanMetadata.getFactoryComponent() != null) {
            recipe.setFactoryComponent(getValue(beanMetadata.getFactoryComponent(), null));
        }
        for (BeanProperty property : beanMetadata.getProperties()) {
            Recipe value = getValue(property.getValue(), null);
            recipe.setProperty(property.getName(), value);
        }
        return recipe;
    }

    private Recipe createRecipe(RegistrationListener listener) {
        BeanRecipe recipe = new BeanRecipe(getName(null), blueprintContainer, ServiceListener.class, false);
        recipe.setProperty("listener", getValue(listener.getListenerComponent(), null));
        if (listener.getRegistrationMethod() != null) {
            recipe.setProperty("registerMethod", listener.getRegistrationMethod());
        }
        if (listener.getUnregistrationMethod() != null) {
            recipe.setProperty("unregisterMethod", listener.getUnregistrationMethod());
        }
        recipe.setProperty("blueprintContainer", blueprintContainer);
        return recipe;
    }

    private Recipe createRecipe(ReferenceListener listener) {
        BeanRecipe recipe = new BeanRecipe(getName(null), blueprintContainer, AbstractServiceReferenceRecipe.Listener.class, false);
        recipe.setProperty("listener", getValue(listener.getListenerComponent(), null));
        recipe.setProperty("metadata", listener);
        recipe.setProperty("blueprintContainer", blueprintContainer);
        return recipe;
    }

    private Recipe getValue(Metadata v, Object groupingType) {
        if (v instanceof NullMetadata) {
            return null;
        } else if (v instanceof ComponentMetadata) {
            return createRecipe((ComponentMetadata) v);
        } else if (v instanceof ValueMetadata) {
            ValueMetadata stringValue = (ValueMetadata) v;
            Object type = stringValue.getType();
            type = (type == null) ? groupingType : type;
            ValueRecipe vr = new ValueRecipe(getName(null), stringValue, type);
            return vr;
        } else if (v instanceof RefMetadata) {
            // TODO: make it work with property-placeholders?
            String componentName = ((RefMetadata) v).getComponentId();
            RefRecipe rr = new RefRecipe(getName(null), componentName);
            return rr;
        } else if (v instanceof CollectionMetadata) {
            CollectionMetadata collectionMetadata = (CollectionMetadata) v;
            Class<?> cl = collectionMetadata.getCollectionClass();
            String type = collectionMetadata.getValueType();
            if (cl == Object[].class) {
                ArrayRecipe ar = new ArrayRecipe(getName(null), type);
                for (Metadata lv : collectionMetadata.getValues()) {
                    ar.add(getValue(lv, type));
                }
                return ar;
            } else {
                CollectionRecipe cr = new CollectionRecipe(getName(null), cl != null ? cl : ArrayList.class, type);
                for (Metadata lv : collectionMetadata.getValues()) {
                    cr.add(getValue(lv, type));
                }
                return cr;
            }
        } else if (v instanceof MapMetadata) {
            return createMapRecipe((MapMetadata) v);
        } else if (v instanceof PropsMetadata) {
            PropsMetadata mapValue = (PropsMetadata) v;
            MapRecipe mr = new MapRecipe(getName(null), Properties.class, String.class, String.class);
            for (MapEntry entry : mapValue.getEntries()) {
                Recipe key = getValue(entry.getKey(), String.class);
                Recipe val = getValue(entry.getValue(), String.class);
                mr.put(key, val);
            }
            return mr;
        } else if (v instanceof IdRefMetadata) {
            // TODO: make it work with property-placeholders?
            String componentName = ((IdRefMetadata) v).getComponentId();
            IdRefRecipe rnr = new IdRefRecipe(getName(null), componentName);
            return rnr;
        } else {
            throw new IllegalStateException("Unsupported value: " + v.getClass().getName());
        }
    }

    private MapRecipe createMapRecipe(MapMetadata mapValue) {
        String keyType = mapValue.getKeyType();
        String valueType = mapValue.getValueType();
        MapRecipe mr = new MapRecipe(getName(null), HashMap.class, keyType, valueType);
        for (MapEntry entry : mapValue.getEntries()) {
            Recipe key = getValue(entry.getKey(), keyType);
            Recipe val = getValue(entry.getValue(), valueType);
            mr.put(key, val);
        }
        return mr;
    }

    private String getName(String name) {
        if (name == null) {
            do {
                name = "#recipe-" + recipeIdSpace.nextId();
            } while (names.contains(name) || registry.containsComponentDefinition(name));
        }
        names.add(name);
        return name;
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<TITLE
>pnm_info</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="LIBIT Documentation"
HREF="index.html"><LINK
REL="UP"
HREF="refmanual.html"><LINK
REL="PREVIOUS"
TITLE="Mat_height"
HREF="man.-mat-height.html"><LINK
REL="NEXT"
TITLE="it_dequantize_mat"
HREF="man.it-dequantize-mat.html">

LIBIT Documentation

Prev		Next

pnm_info

Name
pnm_info -- Get information from a PNM image file

Synopsis

#include <it/io.h>

int pnm_info( const char * filename, char * p_pnm_type, int * p_width, int * p_height, int * p_max_val, char * comments, int length
        );

DESCRIPTION

 This function reads the width, height, type, maximum value and comments from a PNM image file specified by filename. The values of these informations are stored in the corresponding pointers. The length argument gives the maximum size of the comments buffer in which the comments are stored.

EXAMPLE

#include <io.h>

...

int width, height, maxval, type;
char comment[1000];
pnm_info("image.pgm", &type, &width, &height, &maxval, comments, 1000);

Prev	Home	Next

Mat_height	Up	it_dequantize_mat


text:
The project aims to make a better world by finding the truth and facts of reality in all aspect of human knowledge, and present them in a way that is easy to search and understand by laypeople. It aims to do this by finding the truth using a systematic way of contribution and organization of arguments and evidences contrasted with reality and known facts.

An argument or a topic will be broken down into the smallest pieces necessary to rationally discuss and conclude its reliability and truthfulness. A set of contribution and discussion rules will be enforced by the system (automated) to prevent chaotic discussions, along with human critical thinking, moral intent and the collective effort of everyone wanting to find the truth.

This is an open research and an attempt to collect all verifiable facts and allow everyone to contribute, challenge the arguments with all sort of doubts and questions they can think of. Eventually, we can come up with a "golden source" of truth and facts of reality that survived all the challenges, hardened and supported by all available evidences and arguments.

This project does not intend to replace Wikipedia, Quora or other similar internet systems. It intends to provide a place for everyone who are looking for specific truth and facts of reality out of the ocean of information they see in the internet, from the news, search results, crowd-sourced sites, from people around them, and other various sources.

If someone wanted to find information about different topics or explore the vast information on the internet without the strong need for reliability and verifiability, there is Wikipedia, Quora and Google, but to see what is really the truth and reality, there is Wikitruth.

**Assumptions**
* A lot of people are having difficulty to find true information and difficulty to determine which one to believe.
* The world will be a better place if people will know the real truth, can easily find it, and distinguish from random claims and opinions.
* There is lots of information in the world, truth and lies lying around and intertwined together. People cannot easily differentiate between truth and lie because information is highly unorganized and a lot is unverifiable especially in the internet.
* If we can have a place where truth and lies are clearly organized, categories and distinctly separated, then people will easily see the truth and will know what is a lie.
* If people knows the truth, there will be less disagreements, less conflicts, better governance and politics, better education system, only one religion, better environment, better relationship between humans, better health, more love and there will be peace.

**General characteristics of discussions and internet forums for finding the truth**
* Mostly single-sided, controlled by users with admin privileges or by the majority
* Citing unverified or unverifiable sources
* Chaotic, unorganized or uncontrollable
* Ends with disagreements and often offensive and discriminatory in nature
* Cyclic (looping arguments), never-ending (check some Creationist vs Evolutionist discussions)
* Vital points get buried in comments
* Non-sense comments prevail due to number of upvotes
* Truth is hard to find

**Related Systems:**
* Quora
* Wikipedia
* Reddit
* StackExchange
* Yahoo! Answers
* Debate.org
* Citizendium

## Design Documents & Notes
[View via Google Drive](https://drive.google.com/folderview?id=0B_bsKNkSe3qYUzVEdDVrTkhYdzA&usp=sharing)

## Requirements

You need [Node.js](http://nodejs.org/download/) and
[MongoDB](http://www.mongodb.org/downloads) installed and running.

We use [`bcrypt`](https://github.com/ncb000gt/node.bcrypt.js) for hashing
secrets. If you have issues during installation related to `bcrypt` then [refer
to this wiki
page](https://github.com/jedireza/drywall/wiki/bcrypt-Installation-Trouble).

We use [`emailjs`](https://github.com/eleith/emailjs) for email transport. If
you have issues sending email [refer to this wiki
page](https://github.com/jedireza/drywall/wiki/Trouble-sending-email).

## Installation

Install nodejs

```bash
$ git clone git@github.com:wikitruth/wikitruth.git && cd ./wikitruth
$ npm install -g yo generator-kraken bower grunt-cli
$ npm install
$ bower install
$ grunt build
```

## Setup

First you need to edit your config file.

```bash
$ vi ./config.js #set mongodb and email credentials
```

Next, you need a few records in the database to start using the user system.

Run these commands on mongo via the terminal. __Obviously you should use your
email address.__

```js
use wikitruth; // or your mongo db name if different
```

```js
db.admingroups.insert({ _id: 'root', name: 'Root' });
db.admins.insert({ name: {first: 'Root', last: 'Admin', full: 'Root Admin'}, groups: ['root'] });
var rootAdmin = db.admins.findOne();
db.users.save({ username: 'root', isActive: 'yes', email: 'your@email.addy', roles: {admin: rootAdmin._id} });
var rootUser = db.users.findOne();
rootAdmin.user = { id: rootUser._id, name: rootUser.username };
db.admins.save(rootAdmin);
```

## Running the app

```bash
$ npm start

# > wikitruth@0.0.0 start .../wikitruth
# > grunt
# Running "copy:vendor" (copy) task
# ...
# Running "concurrent:dev" (concurrent) task
# Running "watch" task
# Running "nodemon:dev" (nodemon) task
# Waiting...
# [nodemon] v1.3.7
# [nodemon] to restart at any time, enter `rs`
# [nodemon] watching: *.*
# [nodemon] starting `node app.js`
# Server is running on port 8000
```

Now just use the reset password feature to set a password.

 - Go to `http://localhost:8000/login/forgot/`
 - Submit your email address and wait a second.
 - Go check your email and get the reset link.
 - `http://localhost:8000/login/reset/:email/:token/`
 - Set a new password.

Login and enjoy!

## Connect and discuss

Feel free to send feedback to wikitruthproject@gmail.com or join the discussion on [Facebook](https://www.facebook.com/wikitruth.project).


text:
using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Mapping;
public sealed partial class AggregateMetricDoubleProperty : IProperty
{
	[JsonInclude]
	[JsonPropertyName("default_metric")]
	public string DefaultMetric { get; set; }

	[JsonInclude]
	[JsonPropertyName("dynamic")]
	public Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? Dynamic { get; set; }

	[JsonInclude]
	[JsonPropertyName("fields")]
	public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; }

	[JsonInclude]
	[JsonPropertyName("ignore_above")]
	public int? IgnoreAbove { get; set; }

	[JsonInclude]
	[JsonPropertyName("meta")]
	public Dictionary<string, string>? Meta { get; set; }

	[JsonInclude]
	[JsonPropertyName("metrics")]
	public ICollection<string> Metrics { get; set; }

	[JsonInclude]
	[JsonPropertyName("properties")]
	public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; }

	[JsonInclude]
	[JsonPropertyName("time_series_metric")]
	public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; }

	[JsonInclude]
	[JsonPropertyName("type")]
	public string Type => "aggregate_metric_double";
}

public sealed partial class AggregateMetricDoublePropertyDescriptor<TDocument> : SerializableDescriptor<AggregateMetricDoublePropertyDescriptor<TDocument>>, IBuildableDescriptor<AggregateMetricDoubleProperty>
{
	internal AggregateMetricDoublePropertyDescriptor(Action<AggregateMetricDoublePropertyDescriptor<TDocument>> configure) => configure.Invoke(this);
	public AggregateMetricDoublePropertyDescriptor() : base()
	{
	}

	private string DefaultMetricValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; }

	private int? IgnoreAboveValue { get; set; }

	private Dictionary<string, string>? MetaValue { get; set; }

	private ICollection<string> MetricsValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; }

	public AggregateMetricDoublePropertyDescriptor<TDocument> DefaultMetric(string defaultMetric)
	{
		DefaultMetricValue = defaultMetric;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic)
	{
		DynamicValue = dynamic;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields)
	{
		FieldsValue = fields;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Fields(PropertiesDescriptor<TDocument> descriptor)
	{
		FieldsValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Fields(Action<PropertiesDescriptor<TDocument>> configure)
	{
		var descriptor = new PropertiesDescriptor<TDocument>();
		configure?.Invoke(descriptor);
		FieldsValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> IgnoreAbove(int? ignoreAbove)
	{
		IgnoreAboveValue = ignoreAbove;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
	{
		MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Metrics(ICollection<string> metrics)
	{
		MetricsValue = metrics;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties)
	{
		PropertiesValue = properties;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Properties(PropertiesDescriptor<TDocument> descriptor)
	{
		PropertiesValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> Properties(Action<PropertiesDescriptor<TDocument>> configure)
	{
		var descriptor = new PropertiesDescriptor<TDocument>();
		configure?.Invoke(descriptor);
		PropertiesValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor<TDocument> TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric)
	{
		TimeSeriesMetricValue = timeSeriesMetric;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		writer.WritePropertyName("default_metric");
		writer.WriteStringValue(DefaultMetricValue);
		if (DynamicValue is not null)
		{
			writer.WritePropertyName("dynamic");
			JsonSerializer.Serialize(writer, DynamicValue, options);
		}

		if (FieldsValue is not null)
		{
			writer.WritePropertyName("fields");
			JsonSerializer.Serialize(writer, FieldsValue, options);
		}

		if (IgnoreAboveValue.HasValue)
		{
			writer.WritePropertyName("ignore_above");
			writer.WriteNumberValue(IgnoreAboveValue.Value);
		}

		if (MetaValue is not null)
		{
			writer.WritePropertyName("meta");
			JsonSerializer.Serialize(writer, MetaValue, options);
		}

		writer.WritePropertyName("metrics");
		JsonSerializer.Serialize(writer, MetricsValue, options);
		if (PropertiesValue is not null)
		{
			writer.WritePropertyName("properties");
			JsonSerializer.Serialize(writer, PropertiesValue, options);
		}

		if (TimeSeriesMetricValue is not null)
		{
			writer.WritePropertyName("time_series_metric");
			JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options);
		}

		writer.WritePropertyName("type");
		writer.WriteStringValue("aggregate_metric_double");
		writer.WriteEndObject();
	}

	AggregateMetricDoubleProperty IBuildableDescriptor<AggregateMetricDoubleProperty>.Build() => new()
	{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
}

public sealed partial class AggregateMetricDoublePropertyDescriptor : SerializableDescriptor<AggregateMetricDoublePropertyDescriptor>, IBuildableDescriptor<AggregateMetricDoubleProperty>
{
	internal AggregateMetricDoublePropertyDescriptor(Action<AggregateMetricDoublePropertyDescriptor> configure) => configure.Invoke(this);
	public AggregateMetricDoublePropertyDescriptor() : base()
	{
	}

	private string DefaultMetricValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; }

	private int? IgnoreAboveValue { get; set; }

	private Dictionary<string, string>? MetaValue { get; set; }

	private ICollection<string> MetricsValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; }

	private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; }

	public AggregateMetricDoublePropertyDescriptor DefaultMetric(string defaultMetric)
	{
		DefaultMetricValue = defaultMetric;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic)
	{
		DynamicValue = dynamic;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields)
	{
		FieldsValue = fields;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Fields<TDocument>(PropertiesDescriptor<TDocument> descriptor)
	{
		FieldsValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Fields<TDocument>(Action<PropertiesDescriptor<TDocument>> configure)
	{
		var descriptor = new PropertiesDescriptor<TDocument>();
		configure?.Invoke(descriptor);
		FieldsValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove)
	{
		IgnoreAboveValue = ignoreAbove;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
	{
		MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Metrics(ICollection<string> metrics)
	{
		MetricsValue = metrics;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties)
	{
		PropertiesValue = properties;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Properties<TDocument>(PropertiesDescriptor<TDocument> descriptor)
	{
		PropertiesValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor Properties<TDocument>(Action<PropertiesDescriptor<TDocument>> configure)
	{
		var descriptor = new PropertiesDescriptor<TDocument>();
		configure?.Invoke(descriptor);
		PropertiesValue = descriptor.PromisedValue;
		return Self;
	}

	public AggregateMetricDoublePropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric)
	{
		TimeSeriesMetricValue = timeSeriesMetric;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		writer.WritePropertyName("default_metric");
		writer.WriteStringValue(DefaultMetricValue);
		if (DynamicValue is not null)
		{
			writer.WritePropertyName("dynamic");
			JsonSerializer.Serialize(writer, DynamicValue, options);
		}

		if (FieldsValue is not null)
		{
			writer.WritePropertyName("fields");
			JsonSerializer.Serialize(writer, FieldsValue, options);
		}

		if (IgnoreAboveValue.HasValue)
		{
			writer.WritePropertyName("ignore_above");
			writer.WriteNumberValue(IgnoreAboveValue.Value);
		}

		if (MetaValue is not null)
		{
			writer.WritePropertyName("meta");
			JsonSerializer.Serialize(writer, MetaValue, options);
		}

		writer.WritePropertyName("metrics");
		JsonSerializer.Serialize(writer, MetricsValue, options);
		if (PropertiesValue is not null)
		{
			writer.WritePropertyName("properties");
			JsonSerializer.Serialize(writer, PropertiesValue, options);
		}

		if (TimeSeriesMetricValue is not null)
		{
			writer.WritePropertyName("time_series_metric");
			JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options);
		}

		writer.WritePropertyName("type");
		writer.WriteStringValue("aggregate_metric_double");
		writer.WriteEndObject();
	}

	AggregateMetricDoubleProperty IBuildableDescriptor<AggregateMetricDoubleProperty>.Build() => new()
	{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
}


text:
class RenamePlaceToVenue < ActiveRecord::Migration
  def up
    rename_column :lessons, :place_id, :venue_id
  end

  def down
    rename_column :lessons,:venue_id, :place_id
  end
end


text:
package com.baidubce.services.bmr.model;

/**
 * Represent configuration for a hive step.
 * <p>
 * A hive step can be configured with name, actionOnFailure, script, input, output and arguments.
 * The essential options are script and actionOnFailure,
 * and the optional ones are name, input, output and arguments.
 */
public class HiveStepConfig extends StepConfig {
    private static final String HIVE_STEP = "Hive";
    private static final String SCRIPT = "script";
    private static final String INPUT = "input";
    private static final String OUTPUT = "output";
    private static final String ARGUMENTS = "arguments";

    public HiveStepConfig() {
        this.setType(HIVE_STEP);
    }

    /**
     * Configure the input path of the hive step.
     *
     * @param input The input path of the hive step.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withInput(String input) {
        this.addProperty(INPUT, input);
        return this;
    }

    /**
     * Configure the script path of the hive step.
     *
     * @param script The script path of the hive step.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withScript(String script) {
        this.addProperty(SCRIPT, script);
        return this;
    }

    /**
     * Configure the output path of the hive step.
     *
     * @param output The output path of the hive step.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withOutput(String output) {
        this.addProperty(OUTPUT, output);
        return this;
    }

    /**
     * Configure the arguments of the hive step.
     *
     * @param arguments The arguments of the hive step.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withArguments(String arguments) {
        this.addProperty(ARGUMENTS, arguments);
        return this;
    }

    /**
     * Configure the name of the hive step.
     *
     * @param name The name of the hive step.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withName(String name) {
        this.setName(name);
        return this;
    }

    /**
     * Configure the action on failure for the hive step.
     * This property is set to enum value:
     * "Continue": continue to execute other steps.
     * "TerminateCluster": terminate the cluster when this step fails.
     * "CancelAndWait": cancel the other pending steps and set the cluster's status to WAITING.
     *
     * @param actionOnFailure The action on step's failure.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withActionOnFailure(String actionOnFailure) {
        this.setActionOnFailure(actionOnFailure);
        return this;
    }

    /**
     * Configure the additional file for the step.
     *
     * @param remote The remote file of the additional file.
     * @param local  The local file of the additional file.
     *
     * @return HiveStepConfig
     */
    public HiveStepConfig withAdditionalFile(String remote, String local) {
        this.addAdditionalFile(remote, local);
        return this;
    }
}


text:
<?php

final class ArcanistBuildableBuildsHardpointQuery
  extends ArcanistRuntimeHardpointQuery {

  public function getHardpoints() {
    return array(
      ArcanistBuildableRef::HARDPOINT_BUILDREFS,
    );
  }

  protected function canLoadRef(ArcanistRef $ref) {
    return ($ref instanceof ArcanistBuildableRef);
  }

  public function loadHardpoint(array $refs, $hardpoint) {
    $buildable_phids = mpull($refs, 'getPHID');

    $builds = (yield $this->yieldConduitSearch(
      'harbormaster.build.search',
      array(
        'buildables' => $buildable_phids,
      )));

    $build_refs = array();
    foreach ($builds as $build) {
      $build_ref = ArcanistBuildRef::newFromConduit($build);
      $build_refs[] = $build_ref;
    }

    $build_refs = mgroup($build_refs, 'getBuildablePHID');

    $results = array();
    foreach ($refs as $key => $buildable_ref) {
      $buildable_phid = $buildable_ref->getPHID();
      $buildable_builds = idx($build_refs, $buildable_phid, array());
      $results[$key] = $buildable_builds;
    }

    yield $this->yieldMap($results);
  }

}


text:
@implementation GSSquareButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:15];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage imageNamed:@"mainCellBackground"] forState:UIControlStateNormal];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    self.imageView.GS_y = self.GS_height * 0.15;
    self.imageView.GS_height = self.GS_height * 0.5;
    self.imageView.GS_width = self.imageView.GS_height;
    self.imageView.GS_centerX = self.GS_width * 0.5;

    self.titleLabel.GS_x = 0;
    self.titleLabel.GS_y = self.imageView.GS_y+self.imageView.GS_height;
    self.titleLabel.GS_width = self.GS_width;
    self.titleLabel.GS_height = self.GS_height - self.titleLabel.GS_y;
}

- (void)setSquare:(GSMeSquare *)square
{
    _square = square;

    [self setTitle:square.name forState:UIControlStateNormal];
    [self sd_setImageWithURL:[NSURL URLWithString:square.icon] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"setup-head-default"]];
}

@end


text:
/* vi: set sw=4 ts=4: */
/*
 * Monitor a pipe with a simple progress display.
 *
 * Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess
 *
 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
 */
//config:config PIPE_PROGRESS
//config:	bool "pipe_progress"
//config:	default y
//config:	help
//config:	  Display a dot to indicate pipe activity.

//applet:IF_PIPE_PROGRESS(APPLET(pipe_progress, BB_DIR_BIN, BB_SUID_DROP))

//kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o

//usage:#define pipe_progress_trivial_usage NOUSAGE_STR
//usage:#define pipe_progress_full_usage ""

#include "libbb.h"

#define PIPE_PROGRESS_SIZE 4096

/* Read a block of data from stdin, write it to stdout.
 * Activity is indicated by a '.' to stderr
 */
int pipe_progress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int pipe_progress_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
	char buf[PIPE_PROGRESS_SIZE];
	time_t t = time(NULL);
	int len;

	while ((len = safe_read(STDIN_FILENO, buf, PIPE_PROGRESS_SIZE)) > 0) {
		time_t new_time = time(NULL);
		if (new_time != t) {
			t = new_time;
			bb_putchar_stderr('.');
		}
		full_write(STDOUT_FILENO, buf, len);
	}

	bb_putchar_stderr('\n');

	return 0;
}


text:
var os = require('os')
var fs = require('fs')
var p = require('path')
var exec = require('child_process').exec
var spawn = require('child_process').spawn
var helpers = require('./helpers')
var format = require('util').format

var stats = {
  history: {},
  cpu: null, //used to store cpu informations
  proc: function(pid, options, done) {
    var self = this

    if(this.cpu !== null) {
      fs.readFile('/proc/uptime', 'utf8', function(err, uptime) {
        if(err) {
          return done(err, null)
        }

        if(uptime === undefined) {
          console.error("[pidusage] We couldn't find uptime from /proc/uptime")
          self.cpu.uptime = os.uptime()
        } else {
          self.cpu.uptime = uptime.split(' ')[0]
        }

        return self.proc_calc(pid, options, done)
      })
    } else {
      helpers.cpu(function(err, cpu) {
        if(err) {
          return done(err, null)
        }

        self.cpu = cpu
        return self.proc_calc(pid, options, done)
      })
    }
  },
  proc_calc: function(pid, options, done) {
    pid = parseInt(pid, 10)
    var history = this.history[pid] ? this.history[pid] : {}
    var cpu = this.cpu
    var self = this

    //Arguments to path.join must be strings
    fs.readFile(p.join('/proc', ''+pid, 'stat'), 'utf8', function(err, infos) {
      if(err) {
        return done(err, null)
      }

      //https://github.com/arunoda/node-usage/commit/a6ca74ecb8dd452c3c00ed2bde93294d7bb75aa8
      //preventing process space in name by removing values before last ) (pid (name) ...)
      var index = infos.lastIndexOf(')')
      infos = infos.substr(index + 2).split(' ')

      //according to http://man7.org/linux/man-pages/man5/proc.5.html (index 0 based - 2)
      //In kernels before Linux 2.6, start was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks
      var stat = {
          utime: parseFloat(infos[11]),
          stime: parseFloat(infos[12]),
          cutime: parseFloat(infos[13]),
          cstime: parseFloat(infos[14]),
          start: parseFloat(infos[19]) / cpu.clock_tick,
          rss: parseFloat(infos[21])
      }

      //http://stackoverflow.com/questions/16726779/total-cpu-usage-of-an-application-from-proc-pid-stat/16736599#16736599

      var childrens = options.childrens ? stat.cutime + stat.cstime : 0

      var total = stat.stime - (history.stime || 0) + stat.utime - (history.utime || 0) + childrens

      total = total / cpu.clock_tick

      //time elapsed between calls
      var seconds = history.uptime !== undefined ? cpu.uptime - history.uptime : stat.start - cpu.uptime
      seconds = Math.abs(seconds)
      seconds = seconds === 0 ? 1 : seconds //we sure can't divide through 0

      self.history[pid] = stat
      self.history[pid].uptime = cpu.uptime

      return done(null, {
        cpu: (total / seconds) * 100,
        memory: stat.rss * cpu.pagesize
      })
    })
  },
  /**
   * Get pid informations through ps command
   * @param  {int}   pid
   * @return  {Function} done (err, stat)
   * on os x skip headers with pcpu=,rss=
   * on linux it could be --no-header
   * on solaris 11 can't figure out a way to do this properly so...
   */
  ps: function(pid, options, done) {
    pid = parseInt(pid, 10)
    var cmd = 'ps -o pcpu,rss -p '

    if(os.platform() == 'aix')
      cmd = 'ps -o pcpu,rssize -p ' //this one could work on other platforms

    exec(cmd + pid, function(err, stdout, stderr) {
      if(err)
        return done(err, null)

      stdout = stdout.split(os.EOL)[1]
      stdout = stdout.replace(/^\s+/, '').replace(/\s\s+/g, ' ').split(' ')

      return done(null, {
        cpu: parseFloat(stdout[0].replace(',', '.')),
        memory: parseFloat(stdout[1]) * 1024
      })
    })
  },
  /**
   * This is really in a beta stage
   */
  win: function(pid, options, done) {
    pid = parseInt(pid, 10)
    var history = this.history[pid] ? this.history[pid] : {}
		//  http://social.msdn.microsoft.com/Forums/en-US/469ec6b7-4727-4773-9dc7-6e3de40e87b8/cpu-usage-in-for-each-active-process-how-is-this-best-determined-and-implemented-in-an?forum=csharplanguage
    var args = 'PROCESS ' + pid + ' get workingsetsize,usermodetime,kernelmodetime'

    var wmic = spawn('wmic', args.split(' '), {detached: true})
    var stdout = ''
    var stderr = ''
    var self = this
    // Note: On Windows the returned value includes fractions of a second. Use Math.floor() to get whole seconds.
    var uptime = Math.floor(os.uptime())

    wmic.stdout.on('data', function(d) {
     stdout += d.toString()
    })

    wmic.stderr.on('data', function(d) {
      stderr += d.toString()
    })

    wmic.on('error', function(err) {
      console.error('[pidusage] Command "wmic ' + args + '" failed with error %s', err)
    })

    wmic.on('close', function(code) {
      stdout = stdout.trim()
      stderr = stderr.trim()

      if(!stdout || code !== 0) {
        var error = format('%s Wmic errored, please open an issue on https://github.com/soyuka/pidusage with this message.%s', new Date().toString(), os.EOL)
        error += format('Command was "wmic %s" %s System informations: %s - release: %s %s - type %s %s', args, os.EOL, os.EOL, os.release(), os.EOL, os.type(), os.EOL)
        stderr = error + (stderr ? format('Wmic reported the following error: %s.', stderr) : 'Wmic reported no errors (stderr empty).')
        stderr = format('%s%s%sWmic exited with code %d.', os.EOL, stderr, os.EOL, code)
        stderr = format('%s%sStdout was %s', stderr, os.EOL, stdout ? stdout : 'empty')

        return done(new Error(stderr, null))
      }

      stdout = stdout.split(os.EOL)[1].replace(/\s\s+/g, ' ').split(' ')

      var stats = {
        kernelmodetime: parseFloat(stdout[0]),
        usermodetime: parseFloat(stdout[1]),
      }

      var workingsetsize = parseFloat(stdout[2])

      //process usage since last call
      var total = stats.kernelmodetime - (history.kernelmodetime || 0) + stats.usermodetime - (history.usermodetime || 0)
      total = total / 10000000

      //time elapsed between calls
      var seconds = history.uptime !== undefined ? uptime - history.uptime : 0

      var cpu = 0

      if (seconds > 0) {
        cpu = (total / seconds) * 100
      }

      self.history[pid] = stats
      self.history[pid].uptime = uptime

      return done(null, {cpu: cpu, memory: workingsetsize})
    })
    wmic.stdin.end()
  }
}

module.exports = stats;


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using System.Diagnostics;
using System.Globalization;
using System.Threading;

namespace Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting
{
    /// <summary>
    /// Essentially this is a wrapper around another AssemblySymbol that is responsible for retargeting
    /// symbols from one assembly to another. It can retarget symbols for multiple assemblies at the same time.
    ///
    /// For example, compilation C1 references v1 of Lib.dll and compilation C2 references C1 and v2 of Lib.dll.
    /// In this case, in context of C2, all types from v1 of Lib.dll leaking through C1 (through method
    /// signatures, etc.) must be retargeted to the types from v2 of Lib.dll. This is what
    /// RetargetingAssemblySymbol is responsible for. In the example above, modules in C2 do not
    /// reference C1.m_AssemblySymbol, but reference a special RetargetingAssemblySymbol created for
    /// C1 by ReferenceManager.
    ///
    /// Here is how retargeting is implemented in general:
    /// - Symbols from underlying assembly are substituted with retargeting symbols.
    /// - Symbols from referenced assemblies that can be reused as is (i.e. doesn't have to be retargeted) are
    ///   used as is.
    /// - Symbols from referenced assemblies that must be retargeted are substituted with result of retargeting.
    /// </summary>
    internal sealed class RetargetingAssemblySymbol : NonMissingAssemblySymbol
    {
        /// <summary>
        /// The underlying AssemblySymbol, it leaks symbols that should be retargeted.
        /// This cannot be an instance of RetargetingAssemblySymbol.
        /// </summary>
        private readonly SourceAssemblySymbol _underlyingAssembly;

        /// <summary>
        /// The list of contained ModuleSymbol objects. First item in the list
        /// is RetargetingModuleSymbol that wraps corresponding SourceModuleSymbol
        /// from underlyingAssembly.Modules list, the rest are PEModuleSymbols for
        /// added modules.
        /// </summary>
        private readonly ImmutableArray<ModuleSymbol> _modules;

        /// <summary>
        /// An array of assemblies involved in canonical type resolution of
        /// NoPia local types defined within this assembly. In other words, all
        /// references used by a compilation referencing this assembly.
        /// The array and its content is provided by ReferenceManager and must not be modified.
        /// </summary>
        private ImmutableArray<AssemblySymbol> _noPiaResolutionAssemblies;

        /// <summary>
        /// An array of assemblies referenced by this assembly, which are linked (/l-ed) by
        /// each compilation that is using this AssemblySymbol as a reference.
        /// If this AssemblySymbol is linked too, it will be in this array too.
        /// The array and its content is provided by ReferenceManager and must not be modified.
        /// </summary>
        private ImmutableArray<AssemblySymbol> _linkedReferencedAssemblies;

        /// <summary>
        /// Backing field for the map from a local NoPia type to corresponding canonical type.
        /// </summary>
        private ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol> _noPiaUnificationMap;

        /// <summary>
        /// A map from a local NoPia type to corresponding canonical type.
        /// </summary>
        internal ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol> NoPiaUnificationMap =>
            LazyInitializer.EnsureInitialized(ref _noPiaUnificationMap, () => new ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol>(concurrencyLevel: 2, capacity: 0));

        /// <summary>
        /// Assembly is /l-ed by compilation that is using it as a reference.
        /// </summary>
        private readonly bool _isLinked;

        /// <summary>
        /// Retargeted custom attributes
        /// </summary>
        private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="underlyingAssembly">
        /// The underlying AssemblySymbol, cannot be an instance of RetargetingAssemblySymbol.
        /// </param>
        /// <param name="isLinked">
        /// Assembly is /l-ed by compilation that is using it as a reference.
        /// </param>
        public RetargetingAssemblySymbol(SourceAssemblySymbol underlyingAssembly, bool isLinked)
        {
            Debug.Assert((object)underlyingAssembly != null);

            _underlyingAssembly = underlyingAssembly;

            ModuleSymbol[] modules = new ModuleSymbol[underlyingAssembly.Modules.Length];

            modules[0] = new RetargetingModuleSymbol(this, (SourceModuleSymbol)underlyingAssembly.Modules[0]);

            for (int i = 1; i < underlyingAssembly.Modules.Length; i++)
            {
                PEModuleSymbol under = (PEModuleSymbol)underlyingAssembly.Modules[i];
                modules[i] = new PEModuleSymbol(this, under.Module, under.ImportOptions, i);
            }

            _modules = modules.AsImmutableOrNull();
            _isLinked = isLinked;
        }

        private RetargetingModuleSymbol.RetargetingSymbolTranslator RetargetingTranslator
        {
            get
            {
                return ((RetargetingModuleSymbol)_modules[0]).RetargetingTranslator;
            }
        }

        /// <summary>
        /// The underlying AssemblySymbol.
        /// This cannot be an instance of RetargetingAssemblySymbol.
        /// </summary>
        public AssemblySymbol UnderlyingAssembly
        {
            get
            {
                return _underlyingAssembly;
            }
        }

        public override bool IsImplicitlyDeclared
        {
            get { return _underlyingAssembly.IsImplicitlyDeclared; }
        }

        public override AssemblyIdentity Identity
        {
            get
            {
                return _underlyingAssembly.Identity;
            }
        }

        public override Version AssemblyVersionPattern => _underlyingAssembly.AssemblyVersionPattern;

        internal override ImmutableArray<byte> PublicKey
        {
            get { return _underlyingAssembly.PublicKey; }
        }

        public override string GetDocumentationCommentXml(CultureInfo preferredCulture = null, bool expandIncludes = false, CancellationToken cancellationToken = default(CancellationToken))
        {
            return _underlyingAssembly.GetDocumentationCommentXml(preferredCulture, expandIncludes, cancellationToken);
        }

        public override ImmutableArray<ModuleSymbol> Modules
        {
            get
            {
                return _modules;
            }
        }

        internal override bool KeepLookingForDeclaredSpecialTypes
        {
            get
            {
                // RetargetingAssemblySymbol never represents Core library.
                return false;
            }
        }

        public override ImmutableArray<Location> Locations
        {
            get
            {
                return _underlyingAssembly.Locations;
            }
        }

        internal override IEnumerable<ImmutableArray<byte>> GetInternalsVisibleToPublicKeys(string simpleName)
        {
            return _underlyingAssembly.GetInternalsVisibleToPublicKeys(simpleName);
        }

        internal override bool AreInternalsVisibleToThisAssembly(AssemblySymbol other)
        {
            return _underlyingAssembly.AreInternalsVisibleToThisAssembly(other);
        }

        public override ImmutableArray<CSharpAttributeData> GetAttributes()
        {
            return RetargetingTranslator.GetRetargetedAttributes(_underlyingAssembly.GetAttributes(), ref _lazyCustomAttributes);
        }

        /// <summary>
        /// Lookup declaration for FX type in this Assembly.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type)
        {
            // Cor library should not have any references and, therefore, should never be
            // wrapped by a RetargetingAssemblySymbol.
            throw ExceptionUtilities.Unreachable;
        }

        internal override ImmutableArray<AssemblySymbol> GetNoPiaResolutionAssemblies()
        {
            return _noPiaResolutionAssemblies;
        }

        internal override void SetNoPiaResolutionAssemblies(ImmutableArray<AssemblySymbol> assemblies)
        {
            _noPiaResolutionAssemblies = assemblies;
        }

        internal override void SetLinkedReferencedAssemblies(ImmutableArray<AssemblySymbol> assemblies)
        {
            _linkedReferencedAssemblies = assemblies;
        }

        internal override ImmutableArray<AssemblySymbol> GetLinkedReferencedAssemblies()
        {
            return _linkedReferencedAssemblies;
        }

        internal override bool IsLinked
        {
            get
            {
                return _isLinked;
            }
        }

        public override ICollection<string> TypeNames
        {
            get
            {
                return _underlyingAssembly.TypeNames;
            }
        }

        public override ICollection<string> NamespaceNames
        {
            get
            {
                return _underlyingAssembly.NamespaceNames;
            }
        }

        public override bool MightContainExtensionMethods
        {
            get
            {
                return _underlyingAssembly.MightContainExtensionMethods;
            }
        }

        internal sealed override CSharpCompilation DeclaringCompilation // perf, not correctness
        {
            get { return null; }
        }

        internal override bool GetGuidString(out string guidString)
        {
            return _underlyingAssembly.GetGuidString(out guidString);
        }

        internal override NamedTypeSymbol TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol> visitedAssemblies)
        {
            NamedTypeSymbol underlying = _underlyingAssembly.TryLookupForwardedMetadataType(ref emittedName);

            if ((object)underlying == null)
            {
                return null;
            }

            return this.RetargetingTranslator.Retarget(underlying, RetargetOptions.RetargetPrimitiveTypesByName);
        }

        public override AssemblyMetadata GetMetadata() => _underlyingAssembly.GetMetadata();
    }
}


text:
> Delicious light theme with candy colors for [HyperTerm](https://hyper.is/).

![hyperterm-now](screenshot.png)

## Install
Add `hyperterm-candy` to the plugins list in your `~/.hyperterm.js` config file:

```js
plugins: [
	'hyperterm-candy'
]
```

That's it! HyperTerm will automagically fetch and install
the theme from [npm](https://www.npmjs.com/package/hyperterm-candy).

## License
MIT © [Daniël Illouz](https://github.com/danillouz)


text:
namespace blink {

v8::Handle<v8::Value> stringToV8Value(String string)
{
    return v8::Handle<v8::Value>::Cast(v8String(v8::Isolate::GetCurrent(), string));
}

v8::Handle<v8::Value> doubleToV8Value(double number)
{
    return v8::Handle<v8::Value>::Cast(v8::Number::New(v8::Isolate::GetCurrent(), number));
}

void setV8ObjectPropertyAsString(v8::Handle<v8::Object> object, String name, String value)
{
    object->Set(stringToV8Value(name), stringToV8Value(value));
}

void setV8ObjectPropertyAsNumber(v8::Handle<v8::Object> object, String name, double value)
{
    object->Set(stringToV8Value(name), doubleToV8Value(value));
}

} // namespace blink


text:
package mapiserver

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"time"

	"github.com/openebs/maya/pkg/util"
	"github.com/openebs/maya/types/v1"
	yaml "gopkg.in/yaml.v2"
)

const (
	volume_create_timeout = 5 * time.Second
)

// Create a volume by invoking the API call to m-apiserver
func CreateVolume(vname string, size string) error {

	_, err := GetStatus()
	if err != nil {
		return util.MAPIADDRNotSet
	}

	var vs v1.VolumeAPISpec

	vs.Kind = "Volume"
	vs.APIVersion = "v1"
	vs.Metadata.Name = vname
	vs.Metadata.Labels.Storage = size

	//Marshal serializes the value provided into a YAML document
	yamlValue, _ := yaml.Marshal(vs)

	//fmt.Printf("Volume Spec Created:\n%v\n", string(yamlValue))

	url := GetURL() + "/latest/volumes/"
	req, err := http.NewRequest("POST", url, bytes.NewBuffer(yamlValue))
	if err != nil {
		return err
	}

	req.Header.Add("Content-Type", "application/yaml")

	c := &http.Client{
		Timeout: volume_create_timeout,
	}
	resp, err := c.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	_, err = ioutil.ReadAll(resp.Body)
	if err != nil {
		return err
	}
	code := resp.StatusCode

	if code != http.StatusOK {
		return fmt.Errorf("Status error: %v", http.StatusText(code))
	}
	return nil
}


text:
import re

from trac.core import Component, implements
from trac.ticket import model
from trac.web.chrome import add_warning
from trac.config import ListOption

from announcer.api import IAnnouncementSubscriber, istrue
from announcer.api import IAnnouncementPreferenceProvider
from announcer.api import _

from announcer.util.settings import BoolSubscriptionSetting

class TicketComponentSubscriber(Component):
    implements(IAnnouncementSubscriber, IAnnouncementPreferenceProvider)

    def subscriptions(self, event):
        if event.realm != 'ticket':
            return
        if event.category not in ('changed', 'created', 'attachment added'):
            return
        settings = self._settings()
        setting = settings.get(event.target['component'])
        if setting:
            for result in setting.get_subscriptions():
                self.log.debug("TicketComponentSubscriber added '%s " \
                        "(%s)' for component '%s'"%(
                        result[1], result[2], event.target['component']))
                yield result

    def get_announcement_preference_boxes(self, req):
        if req.authname == "anonymous" and 'email' not in req.session:
            return
        yield "joinable_components", _("Ticket Component Subscriptions")

    def render_announcement_preference_box(self, req, panel):
        settings = self._settings()
        if req.method == "POST":
            for attr, setting in settings.items():
                setting.set_user_setting(req.session,
                    value=req.args.get('component_%s'%attr), save=False)
            req.session.save()
        d = {}
        for attr, setting in settings.items():
            d[attr]= setting.get_user_setting(req.session.sid)[1]
        return "prefs_announcer_joinable_components.html", dict(components=d)

    def _settings(self):
        settings = {}
        for component in model.Component.select(self.env):
            settings[component.name] = BoolSubscriptionSetting(
                self.env,
                'component_%s'%component.name
            )
        return settings


text:
<?php

return [
    'controllers' => [
        'invokables' => [
            'ApplicationCoreAuth\Controller\NoAccess' => \ApplicationCoreAuth\Controller\NoAccessController::class,
        ],
    ],
    'controller_plugins' => [
        'factories' => [
            'identity' => \ApplicationCoreAuth\Controller\Plugin\SLFactory\IdentityControllerPluginSLFactory::class,
        ]
    ]
];


text:
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import {
  Changes,
  Description,
  CreatePullRequestUserOptions,
  RepoDomain,
  BranchDomain,
  FileData,
  FileDiffContent,
  CreateReviewCommentUserOptions,
} from './types';
export {Changes} from './types';
import {Octokit} from '@octokit/rest';
import {logger, setupLogger} from './logger';
import {
  addPullRequestDefaults,
  addReviewCommentsDefaults,
} from './default-options-handler';
import * as retry from 'async-retry';
import {createPullRequestReview} from './github/review-pull-request';
import {branch} from './github/branch';
import {fork} from './github/fork';
import {commitAndPush} from './github/commit-and-push';
import {openPullRequest} from './github/open-pull-request';
import {addLabels} from './github/labels';
export {getChanges, getDiffString} from './bin/handle-git-dir-change';

/**
 * Given a set of suggestions, make all the multiline inline review comments on a given pull request given
 * that they are in scope of the pull request. Outof scope suggestions are not made.
 *
 * In-scope suggestions are specifically: the suggestion for a file must correspond to a file in the remote pull request
 * and the diff hunk computed for a file's contents must produce a range that is a subset of the pull request's files hunks.
 *
 * If a file is too large to load in the review, it is skipped in the suggestion phase.
 *
 * If changes are empty then the workflow will not run.
 * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information.
 * @param octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository.
 * @param diffContents A set of changes. The changes may be empty.
 * @param options The configuration for interacting with GitHub provided by the user.
 * @returns the created review's id number, or null if there are no changes to be made.
 */
export async function reviewPullRequest(
  octokit: Octokit,
  diffContents: Map<string, FileDiffContent> | string,
  options: CreateReviewCommentUserOptions
): Promise<number | null> {
  setupLogger(options.logger);
  // if null undefined, or the empty map then no changes have been provided.
  // Do not execute GitHub workflow
  if (
    diffContents === null ||
    diffContents === undefined ||
    (typeof diffContents !== 'string' && diffContents.size === 0)
  ) {
    logger.info(
      'Empty changes provided. No suggestions to be made. Cancelling workflow.'
    );
    return null;
  }
  const gitHubConfigs = addReviewCommentsDefaults(options);
  const remote: RepoDomain = {
    owner: gitHubConfigs.owner,
    repo: gitHubConfigs.repo,
  };
  const reviewNumber = await createPullRequestReview(
    octokit,
    remote,
    gitHubConfigs.pullNumber,
    gitHubConfigs.pageSize,
    diffContents
  );
  return reviewNumber;
}

/**
 * Make a new GitHub Pull Request with a set of changes applied on top of primary branch HEAD.
 * The changes are committed into a new branch based on the upstream repository options using the authenticated Octokit account.
 * Then a Pull Request is made from that branch.
 *
 * Also throws error if git data from the fork is not ready in 5 minutes.
 *
 * From the docs
 * https://developer.github.com/v3/repos/forks/#create-a-fork
 * """
 * Forking a Repository happens asynchronously.
 * You may have to wait a short period of time before you can access the git objects.
 * If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support.
 * """
 *
 * If changes are empty then the workflow will not run.
 * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information.
 * @param {Octokit} octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository
 * @param {Changes | null | undefined} changes A set of changes. The changes may be empty
 * @param {CreatePullRequestUserOptions} options The configuration for interacting with GitHub provided by the user.
 * @returns {Promise<number>} the pull request number. Returns 0 if unsuccessful.
 */
async function createPullRequest(
  octokit: Octokit,
  changes: Changes | null | undefined,
  options: CreatePullRequestUserOptions
): Promise<number> {
  setupLogger(options.logger);
  // if null undefined, or the empty map then no changes have been provided.
  // Do not execute GitHub workflow
  if (changes === null || changes === undefined || changes.size === 0) {
    logger.info(
      'Empty change set provided. No changes need to be made. Cancelling workflow.'
    );
    return 0;
  }
  const gitHubConfigs = addPullRequestDefaults(options);
  logger.info('Starting GitHub PR workflow...');
  const upstream: RepoDomain = {
    owner: gitHubConfigs.upstreamOwner,
    repo: gitHubConfigs.upstreamRepo,
  };
  const origin: RepoDomain =
    options.fork === false ? upstream : await fork(octokit, upstream);
  if (options.fork) {
    // try to sync the fork
    await retry(
      async () =>
        await octokit.repos.mergeUpstream({
          owner: origin.owner,
          repo: origin.repo,
          branch: gitHubConfigs.primary,
        }),
      {
        retries: options.retry,
        factor: 2.8411, // https://www.wolframalpha.com/input/?i=Sum%5B3000*x%5Ek%2C+%7Bk%2C+0%2C+4%7D%5D+%3D+5+*+60+*+1000
        minTimeout: 3000,
        randomize: false,
        onRetry: (e, attempt) => {
          e.message = `Error creating syncing upstream: ${e.message}`;
          logger.error(e);
          logger.info(`Retry attempt #${attempt}...`);
        },
      }
    );
  }
  const originBranch: BranchDomain = {
    ...origin,
    branch: gitHubConfigs.branch,
  };

  // The `retry` flag defaults to `5` to maintain compatibility
  options.retry = options.retry === undefined ? 5 : options.retry;

  const refHeadSha: string = await retry(
    async () =>
      await branch(
        octokit,
        origin,
        upstream,
        originBranch.branch,
        gitHubConfigs.primary
      ),
    {
      retries: options.retry,
      factor: 2.8411, // https://www.wolframalpha.com/input/?i=Sum%5B3000*x%5Ek%2C+%7Bk%2C+0%2C+4%7D%5D+%3D+5+*+60+*+1000
      minTimeout: 3000,
      randomize: false,
      onRetry: (e, attempt) => {
        e.message = `Error creating Pull Request: ${e.message}`;
        logger.error(e);
        logger.info(`Retry attempt #${attempt}...`);
      },
    }
  );

  await commitAndPush(
    octokit,
    refHeadSha,
    changes,
    originBranch,
    gitHubConfigs.message,
    gitHubConfigs.force,
    gitHubConfigs.filesPerCommit
  );

  const description: Description = {
    body: gitHubConfigs.description,
    title: gitHubConfigs.title,
  };
  const prNumber = await openPullRequest(
    octokit,
    upstream,
    originBranch,
    description,
    gitHubConfigs.maintainersCanModify,
    gitHubConfigs.primary,
    options.draft
  );
  logger.info(`Successfully opened pull request: ${prNumber}.`);

  // addLabels will no-op if options.labels is undefined or empty.
  await addLabels(octokit, upstream, originBranch, prNumber, options.labels);

  return prNumber;
}

/**
 * Convert a Map<string,string> or {[path: string]: string}, where the key is the relative file path in the repository,
 * and the value is the text content. The files will be converted to a Map also containing the file mode information '100644'
 * @param {Object<string, string | null> | Map<string, string | null>} textFiles a map/object where the key is the relative file path and the value is the text file content
 * @returns {Changes} Map of the file path to the string file content and the file mode '100644'
 */
function parseTextFiles(
  textFiles: {[path: string]: string | null} | Map<string, string | null>
): Changes {
  const changes = new Map<string, FileData>();
  if (textFiles instanceof Map) {
    textFiles.forEach((content: string | null, path: string) => {
      if (
        typeof path !== 'string' ||
        (content !== null && typeof content !== 'string')
      ) {
        throw TypeError(
          'The file changeset provided must have a string key and a string/null value'
        );
      }
      changes.set(path, new FileData(content));
    });
  } else {
    for (const [path, content] of Object.entries(textFiles)) {
      if (
        typeof path !== 'string' ||
        (content !== null && typeof content !== 'string')
      ) {
        throw TypeError(
          'The file changeset provided must have a string key and a string/null value'
        );
      }
      changes.set(path, new FileData(content));
    }
  }
  return changes;
}

export {
  createPullRequest,
  parseTextFiles,
  CreateReviewCommentUserOptions,
  CreatePullRequestUserOptions,
};


text:
<?php

namespace spec\Money\Calculator;

use Money\Calculator;

/**
 * Mocking with typehints usage won't work here as the trait is autoloaded.
 *
 * @see https://github.com/phpspec/phpspec/issues/825
 */
trait CalculatorBehavior
{
    function it_is_a_calculator()
    {
        $this->shouldImplement(Calculator::class);
    }

    function it_compares_two_values()
    {
        $this->compare(2, 1)->shouldReturn(1);
        $this->compare(1, 2)->shouldReturn(-1);
        $this->compare(1, 1)->shouldReturn(0);
    }

    function it_adds_two_values()
    {
        $this->add(rand(-100, 100), rand(-100, 100))->shouldBeString();
    }

    function it_subtracts_a_value_from_another()
    {
        $this->subtract(rand(-100, 100), rand(-100, 100))->shouldBeString();
    }

    function it_multiplies_a_value_by_another()
    {
        $this->multiply(rand(-100, 100), rand(-100, 100))->shouldBeString();
    }

    function it_divides_a_value_by_another()
    {
        $this->divide(rand(-100, 100), rand(1, 100))->shouldBeString();
    }

    function it_ceils_a_value()
    {
        $this->ceil(rand(-100, 100) / 100)->shouldBeString();
    }

    function it_floors_a_value()
    {
        $this->floor(rand(-100, 100) / 100)->shouldBeString();
    }

    function it_calculates_the_absolute_value()
    {
        $result = $this->absolute(rand(1, 100));

        $result->shouldBeGreaterThanZero();
        $result->shouldBeString();

        $result = $this->absolute(rand(-100, -1));

        $result->shouldBeGreaterThanZero();
        $result->shouldBeString();
    }

    function it_shares_a_value()
    {
        $this->share(10, 2, 4)->shouldBeString();
    }

    function it_calculates_the_modulus()
    {
        $this->mod(11, 5)->shouldBeString();
    }

    public function getMatchers()
    {
        return [
            'beGreaterThanZero' => function ($subject) {
                return $subject > 0;
            },
        ];
    }
}


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

#include <pthread.h>
#include "libcgo.h"

static void* threadentry(void*);

static void
xinitcgo(void)
{
}

void (*initcgo)(void) = xinitcgo;

void
libcgo_sys_thread_start(ThreadStart *ts)
{
	pthread_attr_t attr;
	pthread_t p;
	size_t size;
	int err;

	pthread_attr_init(&attr);
	pthread_attr_getstacksize(&attr, &size);
	ts->g->stackguard = size;
	err = pthread_create(&p, &attr, threadentry, ts);
	if (err != 0) {
		fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
		abort();
	}
}

static void*
threadentry(void *v)
{
	ThreadStart ts;

	ts = *(ThreadStart*)v;
	free(v);

	ts.g->stackbase = (uintptr)&ts;

	/*
	 * libcgo_sys_thread_start set stackguard to stack size;
	 * change to actual guard pointer.
	 */
	ts.g->stackguard = (uintptr)&ts - ts.g->stackguard + 4096;

	/*
	 * Set specific keys.  On FreeBSD/ELF, the thread local storage
	 * is just before %fs:0.  Our dynamic 6.out's reserve 16 bytes
	 * for the two words g and m at %fs:-16 and %fs:-8.
	 */
	asm volatile (
		"movq %0, %%fs:-16\n"	// MOVL g, -16(FS)
		"movq %1, %%fs:-8\n"	// MOVL m, -8(FS)
		:: "r"(ts.g), "r"(ts.m)
	);
	crosscall_amd64(ts.fn);
	return nil;
}


text:
.class public Lcom/umeng/analytics/game/a;
.super Ljava/lang/Object;

# static fields
.field public static a:Z

# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x1

    sput-boolean v0, Lcom/umeng/analytics/game/a;->a:Z

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


text:
class TesteException {

    public static void main(String args[]) {
        Banco banco = new Banco("Globalcode Bank", 1000);
        Agencia agencia = new AgenciaStandard("321", banco);
        Cliente cliente1 = new Cliente("Cliente 1", "1232323");
        ContaEspecial contaEspecial = new ContaEspecial(2000, "876654", cliente1, agencia, 500);
        ContaPoupanca contaPoupanca = new ContaPoupanca(600, "135646", cliente1, agencia, "01/01/2005");
        try{
        contaEspecial.saque(2950.0);
         }catch(SaldoinsuficienteException e){
        	System.out.println("TRY CATCH");
        	System.out.println("Saldo insuficiente");// imprime mensagem atraves do get
        	System.out.println(e.getMessage());

        }

         try {
			contaPoupanca.saque(340.0);
		} catch (SaldoinsuficienteException e) {
			// TODO Auto-generated catch block
			System.out.println("Saldo insuficiente");// imprime mensagem atraves do get
			System.out.println(e.getMessage());
		}

        contaEspecial.imprimeDados();
        contaPoupanca.imprimeDados();
    }
}


text:
rm -rf target/dist
mkdir -p target/dist

mvn versions:set -DgenerateBackupPoms=false

echo "Creating javadocs"
mvn javadoc:aggregate

echo "Creating release bundles"
for module in apt collections hibernate-search jpa jdo lucene3 lucene4 sql sql-codegen
do
  cd querydsl-$module
  mvn -Dtest=X clean assembly:assembly
  cd ..
done

echo "Creating reference documentation"
cd querydsl-docs
mkdir -p ../target/dist/reference
mvn -Dxslthl.config=http://docbook.sourceforge.net/release/xsl/current/highlighting/xslthl-config.xml clean package
cp -R target/docbook/publish/en-US/* ../target/dist/reference/
cd ..

echo "done."


text:
<?php
/*
Plugin Name: InstantClick
Plugin URI: http://cacheglove.com/2014/05/speed-up-your-wordpress-site-with-instantclick/
Description: Dramatically speed up your WordPress site with InstantClick
Version: 1.0.1
Author: Mike Martel
Author URI: http://trenvo.com
*/

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

// Maybe InstantClick is already loaded by another plugin
if ( !class_exists( 'WP_InstantClick' ) )
    require plugin_dir_path( __FILE__ ) . 'class-wp-instantclick.php';

// But the other plugin may not have loaded the options class
if ( !class_exists( 'WP_InstantClick_Options' ) )
    require plugin_dir_path( __FILE__ ) . 'class-wp-instantclick-options.php';

WP_InstantClick::enable();
WP_InstantClick_Options::enable();


text:
package net.thetranquilpsychonaut.hashtagger.sites.facebook.retrofit.pojos;

import java.io.Serializable;

/**
 * Created by itwenty on 6/11/14.
 */
public class Paging implements Serializable
{
    private String previous;
    private String next;

    public String getPrevious()
    {
        return previous;
    }

    public void setPrevious( String previous )
    {
        this.previous = previous;
    }

    public String getNext()
    {
        return next;
    }

    public void setNext( String next )
    {
        this.next = next;
    }
}


text:
package main

import (
	"log"
	"os"
	"strings"

	"bazil.org/fuse"
	"bazil.org/fuse/fs"
	"golang.org/x/net/context"
	"labix.org/v2/mgo/bson"
)

// CollFile implements both Node and Handle for a collection.
type CollFile struct {
	Name string

	Dirent fuse.Dirent
	Fattr  fuse.Attr
}

func (f CollFile) Attr(a *fuse.Attr) {
	log.Printf("CollFile.Attr() for: %+v", f)
	a.Mode = os.ModeDir | 0700
	a.Uid = uint32(os.Getuid())
	a.Gid = uint32(os.Getgid())
}

func (c CollFile) Lookup(ctx context.Context, fname string) (fs.Node, error) {
	log.Printf("CollFile[%s].Lookup(): %s\n", c.Name, fname)

	if !strings.HasSuffix(fname, ".json") {
		return nil, fuse.ENOENT
	}
	fname = fname[0 : len(fname)-5]

	if !bson.IsObjectIdHex(fname) {
		return nil, fuse.ENOENT
	}

	db, s := getDb()
	defer s.Close()

	var f DocumentFile
	err := db.C(c.Name).FindId(bson.ObjectIdHex(fname)).One(&f)
	if err != nil {
		log.Printf("Error while looking up %s: %s \n", fname, err.Error())
		return nil, fuse.EIO
	}

	f.coll = c.Name

	return f, nil
}

func (c CollFile) ReadDirAll(ctx context.Context) (ents []fuse.Dirent, ferr error) {
	log.Println("CollFile.ReadDirAll(): ", c.Name)

	db, s := getDb()
	defer s.Close()

	iter := db.C(c.Name).Find(nil).Select(bson.M{"text": 0}).Iter()

	var f DocumentFile
	for iter.Next(&f) {
		ents = append(ents, fuse.Dirent{Name: f.Id.Hex() + ".json", Type: fuse.DT_File})
	}

	if err := iter.Err(); err != nil {
		log.Panic(err)
		return nil, fuse.EIO
	}

	return ents, nil
}

func (c CollFile) Remove(ctx context.Context, req *fuse.RemoveRequest) error {
	log.Printf("DocumentFile.Remove(): %s/%s \n", c.Name, req.Name)

	if !strings.HasSuffix(req.Name, ".json") {
		return fuse.ENOENT
	}
	id := req.Name[0 : len(req.Name)-5]

	if !bson.IsObjectIdHex(id) {
		return fuse.ENOENT
	}

	db, s := getDb()
	defer s.Close()

	if err := db.C(c.Name).RemoveId(bson.ObjectIdHex(id)); err != nil {
		log.Printf("Could not remove document '%s': %s \n", id, err.Error())
		return fuse.EIO
	}

	return nil
}


text:
using Csla;

namespace Codisa.InterwayDocs.Rules
{
    /// <summary>
    /// Interface that defines search criteria.
    /// </summary>
    public interface ICriteriaDates
    {
        /// <summary>
        /// Gets or sets the criteria start date of the search.
        /// </summary>
        /// <value>
        /// The criteria start date of the search.
        /// </value>
        SmartDate CriteriaStartDate { get; set; }

        /// <summary>
        /// Gets or sets the criteria end date of the search.
        /// </summary>
        /// <value>
        /// The criteria end date of the search.
        /// </value>
        SmartDate CriteriaEndDate { get; set; }

        /// <summary>
        /// Gets or sets the full text.
        /// </summary>
        /// <value>
        /// The full text.
        /// </value>
        string FullText { get; set; }

        /// <summary>
        /// Gets or sets the index of the selected fast date.
        /// </summary>
        /// <value>
        /// The index of the selected fast date.
        /// </value>
        int SelectedFastDateIndex { get; set; }

        /// <summary>
        /// Gets or sets the index of the selected date type.
        /// </summary>
        /// <value>
        /// The index of the selected date type.
        /// </value>
        int SelectedDateTypeIndex { get; set; }
    }
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Microsoft.Build.Shared;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Resources;
using System.Resources.Extensions;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.Build.Tasks.ResourceHandling
{
    internal class FileStreamResource : IResource
    {
        public string Name { get; }
        public string TypeAssemblyQualifiedName { get; }
        public string OriginatingFile { get; }
        public string FileName { get; }

        public string TypeFullName => NameUtilities.FullNameFromAssemblyQualifiedName(TypeAssemblyQualifiedName);

        /// <summary>
        /// Construct a new linked resource.
        /// </summary>
        /// <param name="name">The resource's name</param>
        /// <param name="assemblyQualifiedTypeName">The assembly-qualified type name of the resource (at runtime).</param>
        /// <param name="fileName">The absolute path of the file to be embedded as a resource.</param>
        /// <param name="originatingFile">The absolute path of the file that defined the ResXFileRef to this resource.</param>
        public FileStreamResource(string name, string assemblyQualifiedTypeName, string fileName, string originatingFile)
        {
            Name = name;
            TypeAssemblyQualifiedName = assemblyQualifiedTypeName;
            FileName = fileName;
            OriginatingFile = originatingFile;
        }

        public void AddTo(IResourceWriter writer)
        {
            if (writer is PreserializedResourceWriter preserializedResourceWriter)
            {
                FileStream fileStream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);

                preserializedResourceWriter.AddActivatorResource(Name, fileStream, TypeAssemblyQualifiedName, closeAfterWrite: true);
            }
            else
            {
                throw new PreserializedResourceWriterRequiredException();
            }
        }
    }
}


text:
/**
 *  Set up namespace
 */
namespace Php {

/**
 *  Forward declarations
 */
class ValueIteratorImpl;

/**
 *  Class definition
 */
class PHPCPP_EXPORT ValueIterator
{
public:
    /**
     *  Constructor
     *  @param  impl        Implementation iterator
     */
    ValueIterator(ValueIteratorImpl *impl);

    /**
     *  Copy constructor
     *  @param  that
     */
    ValueIterator(const ValueIterator &that);

    /**
     *  Destructor
     */
    virtual ~ValueIterator();

    /**
     *  Increment position (pre-increment)
     *  @return ValueIterator
     */
    ValueIterator &operator++();

    /**
     *  Increment position (post-increment)
     *  @return ValueIterator
     */
    ValueIterator operator++(int)
    {
        // make a copy
        ValueIterator copy(*this);

        // increment current object
        ++(*this);

        // and return the unchanged original
        return copy;
    }

    /**
     *  Decrement position (pre-decrement)
     *  @return ValueIterator
     */
    ValueIterator &operator--();

    /**
     *  Increment position (post-decrement)
     *  @return ValueIterator
     */
    ValueIterator operator--(int)
    {
        // make a copy
        ValueIterator copy(*this);

        // decrement current object
        --(*this);

        // and return the unchanged original
        return copy;
    }

    /**
     *  Compare with other iterator
     *  @param  that
     *  @return bool
     */
    bool operator==(const ValueIterator &that) const;

    /**
     *  Compare with other iterator
     *  @param  that
     *  @return bool
     */
    bool operator!=(const ValueIterator &that) const;

    /**
     *  Dereference, this returns a std::pair with the current key and value
     *  @return std::pair
     */
    const std::pair<Value,Value> &operator*() const;

    /**
     *  Dereference, this returns a std::pair with the current key and value
     *  @return std::pair
     */
    const std::pair<Value,Value> *operator->() const;

private:
    /**
     *  Pointer to the actual implementation
     *  @var    std::unique_ptr<ValueIteratorImpl>
     */
    std::unique_ptr<ValueIteratorImpl> _impl;

};

/**
 *  End namespace
 */
}


text:
class CreateSummaries < ActiveRecord::Migration
  def change
    create_table :summaries do |t|
      t.integer :user_id
      t.integer :day_id
      t.text :content

      t.timestamps
    end
  end
end