text:
package graphene.web.components;

//This is based on Tapestry's Output component.

import java.text.Format;

import org.apache.tapestry5.Binding;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.services.ComponentDefaultProvider;
import org.joda.time.DateTime;
import org.joda.time.base.AbstractInstant;
import org.joda.time.base.AbstractPartial;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

/**
 * A component for formatting for output of JodaTime objects. It supports
 * subclasses of AbstractInstant and AbstractPartial. If the component is
 * represented in the template using an element, then the element (plus any
 * informal parameters) will be output around the formatted value.
 */
@SupportsInformalParameters
public class JodaTimeOutput {
	/**
	 * The value to be output (before formatting). If the formatted value is
	 * blank, no output is produced.
	 */
	@Parameter(required = true)
	private Object value;

	/** The format to be applied to the object. */
	@Parameter(required = false)
	private DateTimeFormatter formatter;

	/** The format to be applied to the object. */
	@Parameter(required = false, defaultPrefix = BindingConstants.LITERAL)
	private String style;

	/** The format to be applied to the object. */
	@Parameter(required = false, defaultPrefix = BindingConstants.LITERAL)
	private String pattern;

	/**
	 * This is declared so we catch slip-ups - an error will point the developer
	 * to formatter instead.
	 */
	@Parameter(required = false, defaultPrefix = BindingConstants.LITERAL)
	private Format format;

	/**
	 * The element name, derived from the component template. This can even be
	 * overridden manually if desired (for example, to sometimes render a
	 * surrounding element and other times not).
	 */
	@Parameter("componentResources.elementName")
	private String elementName;

	@Inject
	private ComponentDefaultProvider defaultProvider;

	@Inject
	private ComponentResources componentResources;

	Binding defaultValue() {
		return defaultProvider.defaultBinding("value", componentResources);
	}

	void setupRender() {

		if (format != null) {
			throw new IllegalArgumentException(
					"JodaTimeOutput does not allow \"format\" parameter.  Valid parameters are \"style\", \"formatter\", and \"pattern\".  Formatter type is DateTimeFormatter.");
		}

		int formatParams = 0;

		if (style != null) {
			formatParams += 1;
		}
		if (formatter != null) {
			formatParams += 1;
		}
		if (pattern != null) {
			formatParams += 1;
		}

		if (formatParams > 1) {
			throw new IllegalArgumentException(
					"JodaTimeOutput can optionally receive \"style\" parameter, \"formatter\" parameter, or \"pattern\" parameter, but no more than one of them.  Received  "
							+ formatParams + " of them.");
		}

	}

	boolean beginRender(MarkupWriter writer) {

		String formatted = (value == null ? "" : format(value));

		if (InternalUtils.isNonBlank(formatted)) {
			if (elementName != null) {
				writer.element(elementName);

				componentResources.renderInformalParameters(writer);
			}

			writer.write(formatted);

			if (elementName != null)
				writer.end();
		}

		return false;
	}

	private String format(Object value) {
		String formatted = "";

		if (value != null) {

			// If value is an AbstractInstant - includes DateTime and
			// DateMidnight
			if (value instanceof Long) {
				DateTime d = new DateTime((long) value);
				if (style != null) {
					formatted = DateTimeFormat.forStyle(style).print(d);
				} else if (formatter != null) {
					formatted = d.toString(formatter);
				} else if (pattern != null) {
					formatted = DateTimeFormat.forPattern(pattern).print(d);
				} else {
					formatted = value.toString();
				}
			} else if (value instanceof AbstractInstant) {
				AbstractInstant ai = ((AbstractInstant) value);
				if (style != null) {
					formatted = DateTimeFormat.forStyle(style).print(ai);
				} else if (formatter != null) {
					formatted = ai.toString(formatter);
				} else if (pattern != null) {
					formatted = DateTimeFormat.forPattern(pattern).print(ai);
				} else {
					formatted = value.toString();
				}
			}

			// Else if value is an AbstractPartial - includes LocalDate,
			// LocalTime,
			// LocalDateTime, YearMonthDay, and TimeOfDay

			else if (value instanceof AbstractPartial) {
				AbstractPartial ap = ((AbstractPartial) value);
				if (style != null) {
					formatted = DateTimeFormat.forStyle(style).print(ap);
				} else if (formatter != null) {
					formatted = ap.toString(formatter);
				} else if (pattern != null) {
					formatted = DateTimeFormat.forPattern(pattern).print(ap);
				} else {
					formatted = value.toString();
				}
			}

			// Else value is an unsupported type

			else {
				throw new IllegalArgumentException(
						"JodaTimeOutput received a value of the wrong type.  Supported types are subclasses of AbstractInstant and AbstractPartial or instances of Long.  Type found is "
								+ value.getClass().getName() + ".");
			}
		}

		return formatted;
	}

	// For testing.

	void setup(Object value, String style, DateTimeFormatter formatter,
			String pattern, String elementName,
			ComponentResources componentResources) {
		this.value = value;
		this.style = style;
		this.formatter = formatter;
		this.pattern = pattern;
		this.elementName = elementName;
		this.componentResources = componentResources;
	}
}


text:
package com.microsoft.azure.management.datamigration.v2018_07_15_preview;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Results for query analysis comparison between the source and target.
 */
public class QueryAnalysisValidationResult {
    /**
     * List of queries executed and it's execution results in source and
     * target.
     */
    @JsonProperty(value = "queryResults")
    private QueryExecutionResult queryResults;

    /**
     * Errors that are part of the execution.
     */
    @JsonProperty(value = "validationErrors")
    private ValidationError validationErrors;

    /**
     * Get list of queries executed and it's execution results in source and target.
     *
     * @return the queryResults value
     */
    public QueryExecutionResult queryResults() {
        return this.queryResults;
    }

    /**
     * Set list of queries executed and it's execution results in source and target.
     *
     * @param queryResults the queryResults value to set
     * @return the QueryAnalysisValidationResult object itself.
     */
    public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) {
        this.queryResults = queryResults;
        return this;
    }

    /**
     * Get errors that are part of the execution.
     *
     * @return the validationErrors value
     */
    public ValidationError validationErrors() {
        return this.validationErrors;
    }

    /**
     * Set errors that are part of the execution.
     *
     * @param validationErrors the validationErrors value to set
     * @return the QueryAnalysisValidationResult object itself.
     */
    public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) {
        this.validationErrors = validationErrors;
        return this;
    }

}

redpajama_set_name: RedPajamaGithub


text:
by Brett

## What is LiMux?

LiMux is a project by the city of Munich, Germany to migrate their software to an open sourced model centred around Linux.  The objective of the project was to reduce Munich's reliance on closed-source and coupled software to more open-sourced and uncoupled software.  It consists of three main components:

* **Operating System**:  A customized release of Ubuntu 12.04 LTS and KDE SC 4.12 as Desktop.
* **Productivity Software:**  Mozilla Firefox (ESR), Mozilla Thunderbird (ESR), and LibreOffice 4.1.
* **Proprietary Software:**  Munich had a free Java application developed called **WoolMux** which does the following according to the Munich Government's Standards and Practices:
    * Letterhead System
    * Form Creation System
    * Specially Formatted Text Blocks
    * Aids for Dispositions
    * Document Merge Control.

**A Screenshot of LiMux's Desktop:**

![LiMux's Desktop](https://upload.wikimedia.org/wikipedia/commons/6/66/LiMux2014.png "LiMux's Desktop")

## Stakeholders

The City of Munich created the LiMux project to address their IT concerns.  Munich has a relatively socialist government compared to the more conservative cities in the rest of Germany.  This has led to the more government operations like IT being managed in house rather than outsourced.  Because of this way of working, the City Council of Munich was much more aware of the state of their IT operations.

The LiMux project was lead by Peter Hoffman.  He directed an in-house team that selected and developed the components of LiMux.  They evaluated bids from Open Source providers.

Ultimately it was Peter's Team decided on **Debian** for its Linux platform, **Mozilla** for Internet browsing and email, and **OpenOffice** for its productivity suite.  Late in the project **OpenOffice** was replaced by **LibreOffice.**

## Why Go Open Source?

The City Council of Munich first considered going open source in 2003, when Microsoft announced it will no longer provide full support to Windows NT 4, which Munich was using.  Munich would have to replace the OS on their systems, which would affect the software their used.  Rather than sticking with Microsoft's eco-system of products, Munich considered a model where its software was more independent and uncoupled from its operating system.

This consideration of an Open Source model did not go unnoticed by Microsoft.  In winter of 2003 Microsoft's then CEO Steve Ballmer, went to speak personally with Munich's Mayor Christian Ude.  Ballmer warned Ude about the disadvantages about migrating away from Microsoft's products.  The City Council ultimately ignored Ballmer's warnings and moved ahead with a study on adopting Open Source.  By June 2004 the study was complete and the City Council voted in favour of migration to open-source and to open bidding.

## Achievements of LiMux

* LiMux was successfully implemented from 2006 to 2013.
* As of October 2013 15,000 (of about 18, 000) desktop PC's were migrated to LiMux from Windows NT 4 or Windows 2000.
* LiMux is the first Linux desktop distribution to be certified for industry use according to ISO 9241.
* LiMux is estimated to have cost a total of 19 Million Euros, but saved an estimated 10 Millions Euros in Microsoft License fees.
* LiMux has inspired other governments to adopt Open Source for IT needs like: China ([Kylin](https://en.wikipedia.org/wiki/Kylin_(operating_system))), France ([GendBuntu](https://en.wikipedia.org/wiki/GendBuntu)), Amsterdam (Open.Amsterdam), and Zargoza Spain (AZLinux).

## Criticisms of LiMux

### Long Migration

LiMux took approximately 7 years to complete its migration.  Many critics, including Microsoft, have pointed out that this long duration is why the migration was a bad idea.  Hewlett Packard (HP) created a report for Microsoft claiming it could migrate 50 to 500 PCs a day compared to the average of 8 a day that Peter Hoffman's team was achieved.  However Peter Hoffman believes the slow pace was the reason the migration was successful.

Peter believes the slow migration limited the downtime of individual offices and departments because the plan did not require large groups to be down at the same time.  This meant the team didn't have to rush an individual migration and could take the time to get it right.

They also had Munich workers first migrate from Microsoft Office to OpenOffice while still using Windows on their PC's.  This helped the users understand the software they would be primarly using in a more familiar interface, before having to learn the Linux interface.

Peter's team also took their time building the custom Linux distribution and interface of LiMux.  This was done to ensure that system would be as stable as possible.  This has led to a reduction and service calls from about 70/month during to Microsoft era to 50/month once LiMux was implemented.

### Reduction in Productivity

In 2014 unnamed officials in the Munich Government started to report that LiMux was a failure because it was reducing the productivity of its employees.  Claims that employees were "suffering" because of compatibility issues involving OpenOffice.  These issues were enough for Munich's Deputy Mayor Josef Schmid to call for a review of Munich's use of open source software.

These compatibility issues were addressed by switching to LibreOffice.  Because of the open source model it was very easy and quick to switch from OpenOffice to LibreOffice and this was done in under a year.

It was later revealed that loss of productivity was largely overblown and politically motivated.  The Mayor Dieter Reiter was a stakeholder in a proposal by Microsoft to move its German headquarters to Munich by 2016.  This would bring valuable jobs to Munich but also put pressure on the government to be more Microsoft friendly.

## Future of LiMux

Recently the City Council of Munich has considered abandoning LiMux.  Munich is considering moving away from open source and going back to Microsoft's products.  This is largerly attributed to factors:
* Munich's ongoing IT issues.
* Munich still uses about 4000 PC's running necessary Microsoft Products that LiMux cannot run.

In 2014 Munich as an independent consultant Accenture to do a review of its IT systems.  In 2017 Accenture released a report that identified serious concerns about Munich IT.  These problems however were not attributed to the use of LiMux, but instead the lack of compatible IT policies adopted by the various sub groups of Munich's IT department.

There are concerns that moving forward it will cost more to train employees on how to use LiMux or another open source solution.  The argument is that since Microsoft products are more common in an office work environment, new employees are more likely to be familiar with them and thus require less training.  This concerns are at odds with the fact the existing Munich workforce is already experienced with LiMux and LibreOffice and would be well equipped to assist new employees.

This November 2017 Munich will vote on how they should proceed in the future.  They will be considering Microsoft's products, Upgrading LiMux, or adopting something entirely new like using more Web Based applications.

## Further Reading

* [LiMux's Wikipedia Page](https://en.wikipedia.org/wiki/LiMux):  A very good place to start to learn about LiMux.
* [GiraffeDog's Article on LiMux](http://www.giraffedog.com/blog/ubuntu-linux-hints-tips/city-munich-successfully-ditches-microsoft-favour-linux-open-source/):  A good article explain the motivation of LiMux and the migration process.
* [Arstechnica Article on LiMux](https://arstechnica.com/information-technology/2014/08/linux-on-the-desktop-pioneer-munich-now-considering-a-switch-back-to-windows/):  This article explains Schmid's and Reiter's concerns about LiMux and their preference for Microsoft products.
* [TechRepublic's Article](https://www.techrepublic.com/article/ditching-windows-for-linux-led-to-major-difficulties-says-open-source-champion-munich/?bhid=23124162725615626537083707093141&ftag=TRE475558a):  This is good a recent article explaining when Munich is considering moving away from LiMux.


text:
#ifndef __BI_SEARCH_TREE_H
#define __BI_SEARCH_TREE_H 1

#include "bitree.h"

#define BI_S_TREE BITREE

void bi_search_tree_init(BI_S_TREE *b, int (*compare)(void *d1, void *d2));

int bi_search_tree_destroy(BI_S_TREE *b);

/* bi_search_tree_insert
 * success: return 0
 * fail   : return -1
 */
int bi_search_tree_insert(BI_S_TREE *b, void *data);

/* bi_search_tree_remove
 * success: return -1
 * fail   : return 0
 */
int bi_search_tree_remove(BI_S_TREE *b, void *data);

/* bi_search_tree_search
 * success: return pointer of data
 * fail   : return NULL
 */
void * bi_search_tree_search(BI_S_TREE *b, void *data);

#endif /* __BI_SEARCH_TREE_H */


text:
A ruby gem to give you random snippets of wisdom.

## Installation

Install:

    $ gem install butternut_squash

## Usage

Get some random advice

    $ butternut

Or explore your options

    $ butternut -h

## Contributing

1. Fork it ( https://github.com/[my-github-username]/butternut_squash/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
package com.adefruandta.plotandroid;

/**
 * Created by HappyFresh on 8/19/16.
 */
public class Constant {

    public interface KEYS {

        String PLOT_INT = "PLOT_INT";
        String PLOT_DOUBLE = "PLOT_DOUBLE";
        String PLOT_FLOAT = "PLOT_FLOAT";
        String PLOT_BYTE = "PLOT_BYTE";
        String PLOT_BOOLEAN = "PLOT_BOOLEAN";
        String PLOT_CHAR = "PLOT_CHAR";
        String PLOT_STRING = "PLOT_STRING";
        String PLOT_USER_PARCELABLE = "PLOT_USER_PARCELABLE";
        String PLOT_USER_PARCELER = "PLOT_USER_PARCELER";
        String PLOT_USER_SERIALIZABLE = "PLOT_USER_SERIALIZABLE";
        String PLOT_INTEGER_ARRAY = "PLOT_INTEGER_ARRAY";
        String PLOT_INTEGER_ARRAYLIST = "PLOT_INTEGER_ARRAYLIST";
        String PLOT_STRING_ARRAY = "PLOT_STRING_ARRAY";
        String PLOT_STRING_ARRAYLIST = "PLOT_STRING_ARRAYLIST";
        String PLOT_STRING_LIST = "PLOT_STRING_LIST";
        String PLOT_MAP = "PLOT_MAP";
    }
}


text:
The `protoc-gen-swift` program is a _plugin_ to Google's protoc
compiler that works with protoc to translate proto files into
Swift code.

## Getting Started

If you've worked with Protocol Buffers before, adding Swift support is
very simple: you just need to build the `protoc-gen-swift` program and
copy it into any directory in your PATH.  The protoc program will find
and use it automatically, allowing you to build Swift sources for your
proto files.  You will also, of course, need to add the corresponding
Swift runtime library to your project.

### System Requirements

To use Swift with Protocol buffers, you'll need:

* A recent Swift 3.2 compiler that includes the Swift Package Manager.
  We recommend using the latest release build from
  [Swift.org](https://swift.org) or the command-line tools included
  with the latest version of Xcode.

* Google's protoc compiler.  You can get recent versions from
  [Google's github repository](https://github.com/protocolbuffers/protobuf).

### Build and Install

Building the plugin should be simple on any supported Swift platform:

```
$ git clone https://github.com/apple/swift-protobuf
$ cd swift-protobuf
$ swift build -c release -Xswiftc -static-stdlib
```

This will create a binary called `protoc-gen-swift` in the
`.build/release` directory.  To install, just copy this one executable
anywhere in your PATH.

### Converting .proto files into Swift

To generate Swift output for your .proto files, you run the `protoc`
command as usual, using the `--swift_out=<directory>` option:

```
$ protoc --swift_out=. my.proto
```

The `protoc` program will automatically look for `protoc-gen-swift` in your
`PATH` and use it.

Each `.proto` input file will get translated to a corresponding `.pb.swift` file
in the output directory.

#### How to Specify Code-Generation Options

The plugin tries to use reasonable default behaviors for the code it
generates, but there are a few things that can be configured to
specific needs.

You can use the `--swift_opt` argument to `protoc` to pass options to the
Swift code generator as follows:
```
$ protoc --swift_opt=[NAME]=[VALUE] --swift_out:. foo/bar/*.proto mumble/*.proto
```

If you need to specify multiple options, you can use more than one
`--swift_opt` argument:
```
$ protoc \
    --swift_opt=[NAME1]=[VALUE1] \
    --swift_opt=[NAME2]=[VALUE2] \
    --swift_out=. foo/bar/*.proto mumble/*.proto
```

_NOTE:_ protoc 3.2.0 does not recognize `--swift_opt` if you rely on
`protoc-gen-swift` being found on the `PATH`. To work around this, you need to
explicitly add the argument `--plugin=[PATH-TO-protoc-gen-swift]` to the
command line, then the `--swift-opt` argument will be understood.  If you are
using protoc 3.2.1 or later, then this workaround is _not_ needed.

##### Generation Option: `FileNaming` - Naming of Generated Sources

By default, the paths to the proto files are maintained on the
generated files.  So if you pass `foo/bar/my.proto`, you will get
`foo/bar/my.pb.swift` in the output directory. The Swift plugin
supports an option to control the generated file names, the option is
given as part of the `--swift_out` argument like this:

```
$ protoc --swift_opt=FileNaming=[value] --swift_out=. foo/bar/*.proto mumble/*.proto
```

The possible values for `FileNaming` are:

* `FullPath` (default): Like all other languages, "foo/bar/baz.proto" makes
  "foo/bar/baz.pb.swift.
* `PathToUnderscores`: To help with things like the Swift Package
  Manager where someone might want all the files in one directory;
  "foo/bar/baz.proto" makes "foo_bar_baz.pb.swift".
* `DropPath`: Drop the path from the input and just write all files
  into the output directory; "foo/bar/baz.proto" makes "baz.pb.swift".

##### Generation Option: `Visibility` - Visibility of Generated Types

By default, SwiftProtobuf does not specify a visibility for the
generated types, methods, and properties.  As a result, these will end
up with the default (`internal`) access.  You can change this with the
`Visibility` option:

```
$ protoc --swift_opt=Visibility=[value] --swift_out=. foo/bar/*.proto mumble/*.proto
```

The possible values for `Visibility` are:

* `Internal` (default): No visibility is set for the types, so they get the
  default internal visibility.
* `Public`: The visibility on the types is set to `public` so the types will
  be exposed outside the module they are compiled into.

##### Generation Option: `ProtoPathModuleMappings` - Swift Module names for proto paths

By default, the code generator assumes all of the resulting Swift files will
be put into the same module. However, since protos can reference types from
another proto file, those generated files might end up in different modules.
This option allows you to specify that the code generated from the proto
files will be distributed in multiple modules. This data is used during
generation to then `import` the module and scope the types. This option
takes the path of a file providing the mapping:

```
$ protoc --swift_opt=ProtoPathModuleMappings=[path.asciipb] --swift_out=. foo/bar/*.proto
```

The format of that mapping file is defined in
[swift_protobuf_module_mappings.proto](../Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto),
and files would look something like:

```
mapping {
  module_name: "MyModule"
  proto_file_path: "foo/bar.proto"
}
mapping {
  module_name: "OtherModule"
  proto_file_path: "mumble.proto"
  proto_file_path: "other/file.proto"
}
```

The `proto_file_path` values here should match the paths used in the proto file
`import` statements.

### Building your project

After copying the `.pb.swift` files into your project, you will need
to add the
[SwiftProtobuf library](https://github.com/apple/swift-protobuf) to
your project to support the generated code.  If you are using the
Swift Package Manager, you should first check what version of
`protoc-gen-swift` you are currently using:

```
$ protoc-gen-swift --version
protoc-gen-swift 1.0.1
```

And then add a dependency to your Package.swift file.  Adjust the
`Version()` here to match the `protoc-gen-swift` version you checked
above:

```swift
dependencies: [
        .Package(url: "https://github.com/apple/swift-protobuf.git", Version(1,0,1))
]
```

If you are using Xcode, then you should:

* Add the Swift source files generated from your protos directly to your
  project.
* Clone the SwiftProtobuf package.
* Add the SwiftProtobuf target from the Xcode project from that package to your
  project.


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.ytx.ican.ytxplayer.activity.SettingActivity">

    <com.ytx.ican.ytxplayer.view.LabelLayout
        android:paddingTop="20dp"
        android:id="@+id/llDecode"
        style="@style/ItemButtonLabelLayoutStyle"
        app:layout_indicatorType="layout_switch"
        app:layout_title="@string/video_hard_decode" />

</LinearLayout>


text:
alter table question_group_instance add event_source_id integer not null;

update question_group_instance set event_source_id = (select event_source_id from question_group_event_sources as events where events.question_group_id = question_group_id limit 1);


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('oscar_fancypages', '0002_handpickedproductspromotionblock_offerblock'),
        ('promotions', '__first__'),
    ]

    operations = [
        migrations.AddField(
            model_name='handpickedproductspromotionblock',
            name='promotion',
            field=models.ForeignKey(verbose_name='Hand Picked Products Promotion', to_field='id', to='promotions.HandPickedProductList', null=True),
            preserve_default=True,
        ),
    ]


text:
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ec2/model/ResponseMetadata.h>
#include <aws/ec2/model/ReservedInstancesOffering.h>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Xml
{
  class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{
  /**
   *
Contains the output of DescribeReservedInstancesOfferings.

   */
  class AWS_EC2_API DescribeReservedInstancesOfferingsResponse
  {
  public:
    DescribeReservedInstancesOfferingsResponse();
    DescribeReservedInstancesOfferingsResponse(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
    DescribeReservedInstancesOfferingsResponse& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);

    /**
     *
A list of Reserved Instances offerings.

     */
    inline const Aws::Vector<ReservedInstancesOffering>& GetReservedInstancesOfferings() const{ return m_reservedInstancesOfferings; }

    /**
     *
A list of Reserved Instances offerings.

     */
    inline void SetReservedInstancesOfferings(const Aws::Vector<ReservedInstancesOffering>& value) { m_reservedInstancesOfferings = value; }

    /**
     *
A list of Reserved Instances offerings.

     */
    inline void SetReservedInstancesOfferings(Aws::Vector<ReservedInstancesOffering>&& value) { m_reservedInstancesOfferings = value; }

    /**
     *
A list of Reserved Instances offerings.

     */
    inline DescribeReservedInstancesOfferingsResponse& WithReservedInstancesOfferings(const Aws::Vector<ReservedInstancesOffering>& value) { SetReservedInstancesOfferings(value); return *this;}

    /**
     *
A list of Reserved Instances offerings.

     */
    inline DescribeReservedInstancesOfferingsResponse& WithReservedInstancesOfferings(Aws::Vector<ReservedInstancesOffering>&& value) { SetReservedInstancesOfferings(value); return *this;}

    /**
     *
A list of Reserved Instances offerings.

     */
    inline DescribeReservedInstancesOfferingsResponse& AddReservedInstancesOfferings(const ReservedInstancesOffering& value) { m_reservedInstancesOfferings.push_back(value); return *this; }

    /**
     *
A list of Reserved Instances offerings.

     */
    inline DescribeReservedInstancesOfferingsResponse& AddReservedInstancesOfferings(ReservedInstancesOffering&& value) { m_reservedInstancesOfferings.push_back(value); return *this; }

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextToken = value; }

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(const char* value) { m_nextToken.assign(value); }

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline DescribeReservedInstancesOfferingsResponse& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline DescribeReservedInstancesOfferingsResponse& WithNextToken(Aws::String&& value) { SetNextToken(value); return *this;}

    /**
     *
The token to use to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline DescribeReservedInstancesOfferingsResponse& WithNextToken(const char* value) { SetNextToken(value); return *this;}

    inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }

    inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; }

    inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = value; }

    inline DescribeReservedInstancesOfferingsResponse& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}

    inline DescribeReservedInstancesOfferingsResponse& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(value); return *this;}

  private:
    Aws::Vector<ReservedInstancesOffering> m_reservedInstancesOfferings;
    Aws::String m_nextToken;
    ResponseMetadata m_responseMetadata;
  };

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
@interface PodsDummy_Pods_OriginateSlideshow_Tests : NSObject
@end
@implementation PodsDummy_Pods_OriginateSlideshow_Tests
@end


text:
package stsc.general.statistic;

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

/**
 * Collection of positions used into {@link EquityProcessor}. <br/>
 * To store opened positions for calculating equity and {@link Metrics} for trading strategy.
 */
final class PositionCollection {

	private final double commision;

	PositionCollection(final StatisticsProcessor statisticsProcessor) {
		this.commision = statisticsProcessor.getCommision();
	}

	final class Position {
		int shares = 0;
		private double spentMoney = 0.0;
		private int tradesAmount = 1;

		public Position(int shares, double spentMoney) {
			super();
			this.shares = shares;
			this.spentMoney = spentMoney;
		}

		public void increment(int shares, double spentMoney) {
			this.shares += shares;
			this.spentMoney += spentMoney;
			this.tradesAmount += 1;
		}

		public boolean decrement(int shares, double spentMoney) {
			this.shares -= shares;
			this.spentMoney -= spentMoney;
			this.tradesAmount += 1;
			return this.shares == 0;
		}

		public double sharePrice() {
			return spentMoney / shares;
		}

		public int getTradesAmount() {
			return tradesAmount;
		}

		@Override
		public String toString() {
			return Double.toString(shares);
		}
	}

	public HashMap<String, Position> positions = new HashMap<>();

	/**
	 * Create or increment already created position for selected stock with selected by algorithm shares amount according to selected shares price.
	 */
	void increment(String stockName, int shares, double sharesPrice) {
		Position position = positions.get(stockName);
		if (position != null)
			position.increment(shares, sharesPrice);
		else
			positions.put(stockName, new Position(shares, sharesPrice));
	}

	/**
	 * Decrement and if necessary delete fully - closed position (if remainder part is zero). Returns zero if position is still not closed, and amount of trades
	 * that was created during this position.
	 */
	public int decrement(String stockName, int shares, double sharesPrice) {
		Position position = positions.get(stockName);
		if (position.decrement(shares, sharesPrice)) {
			positions.remove(stockName);
			return position.getTradesAmount();
		}
		return 0;
	}

	public double sharePrice(String stockName) {
		Position position = positions.get(stockName);
		return position.sharePrice();
	}

	public double cost(HashMap<String, Double> prices) {
		double result = 0.0;
		for (Entry<String, Position> i : positions.entrySet()) {
			final int tradesAmount = i.getValue().getTradesAmount();
			final double price = prices.get(i.getKey());
			double sharesPrices = price * i.getValue().shares;
			sharesPrices -= sharesPrices * commision * tradesAmount;
			result += sharesPrices;
		}
		return result;
	}

	public int size() {
		return positions.size();
	}

	@Override
	public String toString() {
		return "(" + Integer.toString(positions.size()) + "): " + positions.toString();
	}

}


text:
package com.intellij.openapi.progress;

import com.intellij.openapi.diagnostic.ControlFlowException;
import org.jetbrains.annotations.NotNull;

public class ProcessCanceledException extends RuntimeException implements ControlFlowException {
  public ProcessCanceledException() { }

  public ProcessCanceledException(@NotNull Throwable cause) {
    super(cause);
  }
}


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\Routing;

use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\Config\Exception\FileLoaderLoadException;
use Symfony\Component\Config\Loader\DelegatingLoader as BaseDelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolverInterface;
use Psr\Log\LoggerInterface;

/**
 * DelegatingLoader delegates route loading to other loaders using a loader resolver.
 *
 * This implementation resolves the _controller attribute from the short notation
 * to the fully-qualified form (from a:b:c to class::method).
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class DelegatingLoader extends BaseDelegatingLoader
{
    protected $parser;
    protected $logger;
    private $loading = false;

    /**
     * Constructor.
     *
     * Ability to pass a LoggerInterface instance as second argument will be removed in 3.0.
     *
     * @param ControllerNameParser    $parser   A ControllerNameParser instance
     * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
     */
    public function __construct(ControllerNameParser $parser, $resolver, $r = null)
    {
        $this->parser = $parser;

        if (!$resolver instanceof LoaderResolverInterface) {
            $this->logger = $resolver;
            $resolver = $r;

            @trigger_error('Passing a LoggerInterface instance as the second argument of the '.__METHOD__.' method is deprecated since version 2.8 and will not be supported anymore in 3.0.', E_USER_DEPRECATED);
        }

        parent::__construct($resolver);
    }

    /**
     * {@inheritdoc}
     */
    public function load($resource, $type = null)
    {
        if ($this->loading) {
            // This can happen if a fatal error occurs in parent::load().
            // Here is the scenario:
            // - while routes are being loaded by parent::load() below, a fatal error
            //   occurs (e.g. parse error in a controller while loading annotations);
            // - PHP abruptly empties the stack trace, bypassing all catch blocks;
            //   it then calls the registered shutdown functions;
            // - the ErrorHandler catches the fatal error and re-injects it for rendering
            //   thanks to HttpKernel->terminateWithException() (that calls handleException());
            // - at this stage, if we try to load the routes again, we must prevent
            //   the fatal error from occurring a second time,
            //   otherwise the PHP process would be killed immediately;
            // - while rendering the exception page, the router can be required
            //   (by e.g. the web profiler that needs to generate an URL);
            // - this handles the case and prevents the second fatal error
            //   by triggering an exception beforehand.

            throw new FileLoaderLoadException($resource);
        }
        $this->loading = true;

        try {
            $collection = parent::load($resource, $type);
        } catch (\Exception $e) {
            $this->loading = false;
            throw $e;
        } catch (\Throwable $e) {
            $this->loading = false;
            throw $e;
        }

        $this->loading = false;

        foreach ($collection->all() as $route) {
            if (!$controller = $route->getDefault('_controller')) {
                continue;
            }

            try {
                $controller = $this->parser->parse($controller);
            } catch (\InvalidArgumentException $e) {
                // unable to optimize unknown notation
            }

            $route->setDefault('_controller', $controller);
        }

        return $collection;
    }
}


text:
layout: default
title: CAS - SMS Messaging
category: Notifications
---

# SMS Messaging

CAS presents the ability to notify users on select actions via SMS messaging. Example actions include notification of risky authentication attempts
or password reset links/tokens. SMS providers supported by CAS are listed below. Note that an active/professional subscription may be required for certain
providers.

## Groovy

Send text messages using an external Groovy script.

```groovy
import java.util.*

def run(Object[] args) {
    def from = args[0]
    def to = args[1]
    def message = args[2]
    def logger = args[3]

    logger.debug("Sending message ${message} to ${to} from ${from}")
    true
}
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#groovy).

## REST

  Send text messages using a RESTful API. This is a `POST` with the following parameters:

| Field               | Description
|---------------------|---------------------------------------------------
| `clientIpAddress`   | The client IP address.
| `serverIpAddress`   | The server IP address.
| `from`              | The from address of the text message.
| `to`                | The target recipient of the text message.

The request body contains the actual message. A status code of `200` is expected from the endpoint.

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#rest).

## Twilio

To learn more, [visit this site](https://www.twilio.com/).

```xml
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sms-twilio</artifactId>
    <version>${cas.version}</version>
</dependency>
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#twilio).

## TextMagic

To learn more, [visit this site](https://www.textmagic.com/).

```xml
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sms-textmagic</artifactId>
    <version>${cas.version}</version>
</dependency>
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#textmagic).

## Clickatell

To learn more, [visit this site](http://www.clickatell.com/).

```xml
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sms-clickatell</artifactId>
    <version>${cas.version}</version>
</dependency>
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#clickatell).

## Amazon SNS

To learn more, [visit this site](https://docs.aws.amazon.com/sns).

```xml
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sms-aws-sns</artifactId>
    <version>${cas.version}</version>
</dependency>
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#amazon-sns).

## Nexmo

To learn more, [visit this site](https://dashboard.nexmo.com/).

```xml
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sms-nexmo</artifactId>
    <version>${cas.version}</version>
</dependency>
```

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#nexmo).


text:
<!doctype html>

<meta charset="utf-8">
<title>$i18n{componentsTitle}</title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="components.css">
<if expr="lacros or chromeos">
  <link rel="stylesheet" href="chrome://resources/css/os_header.css">
</if>

  <if expr="lacros or chromeos">

        $i18n{os-components-text1}

          $i18n{os-components-link}

        $i18n{os-components-text2}

  </if>

$i18n{componentsTitle}

        $i18n{componentsTitle}
         0">()

$i18n{noComponents}

 0">

                  - $i18n{componentVersion}

            $i18n{statusLabel}
            -

            <button class="button-check-update" guest-disabled
                jsvalues=".id:id">
              $i18n{checkUpdate}
            </button>


text:
package com.quattroresearch.antibody;

import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import org.roche.antibody.services.PreferencesService;

/**
 * Dialog for Antibody-Chain Input <p> Implements all Buttons for "Antibody Sequence Editor", content panel is
 * AntibodyEditor. Calls AntibodyFindDialog.
 *
 * @author <b>Anne Mund</b>, quattro research GmbH
 *
 */

public class AntibodyEditorDialog extends javax.swing.JDialog {

  /** Generated UID */
  private static final long serialVersionUID = -906998216945176364L;

  /** The Logger for this class */
  // private static final Logger logger = LoggerFactory
  // .getLogger(AntibodyEditorDialog.class);

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JButton closeButton;

  private javax.swing.JButton clearButton;

  private javax.swing.JButton findButton;

  private JButton openButton;

  private JScrollPane scroller;

  private AntibodyEditor antibodyEditor;

// private MacromoleculeEditor editor;
  private JFrame parentFrame;

  private AntibodyFindDialog findDialog;

  // End of variables declaration//GEN-END:variables

  public AntibodyEditorDialog(JFrame parentFrame, boolean modal) {
    super(parentFrame, modal);

    this.parentFrame = parentFrame;
    customInit();
    initComponents();
  }

  protected JFrame getParentFrame() {
    return parentFrame;
  }

  private void customInit() {
    antibodyEditor = new AntibodyEditor();
    JPanel contentPanel = new JPanel();
    contentPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    contentPanel.setLayout(new java.awt.BorderLayout());
    contentPanel.add(antibodyEditor);
    scroller = new JScrollPane(contentPanel);
  }

  // <editor-fold defaultstate="collapsed"
  // desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    closeButton = new javax.swing.JButton();
    clearButton = new javax.swing.JButton();
    findButton = new javax.swing.JButton();
    openButton = new JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Antibody Sequence Editor");
    setMinimumSize(new java.awt.Dimension(700, 500));

    closeButton.setText("Close");
    closeButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        closeButtonActionPerformed(evt);
      }
    });

    clearButton.setText("Clear All");
    clearButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        clearButtonActionPerformed(evt);
      }
    });

    findButton.setText("Find Domains");
    findButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        findButtonActionPerformed();
      }
    });

    openButton.setText("Open File");
    openButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        openButtonActionPerformed(evt);
      }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
        getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout
        .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(org.jdesktop.layout.GroupLayout.TRAILING,
            layout.createSequentialGroup()
                .add(openButton)
                .addContainerGap()
                .add(clearButton)
                .addPreferredGap(
                    org.jdesktop.layout.LayoutStyle.RELATED,
                    520, Short.MAX_VALUE).add(findButton)
                .addContainerGap().add(closeButton)
                .addContainerGap())
        .add(scroller, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
            710, Short.MAX_VALUE));
    layout.setVerticalGroup(layout
        .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(org.jdesktop.layout.GroupLayout.TRAILING,
            layout.createSequentialGroup()
                .add(scroller,
                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                    300, Short.MAX_VALUE)
                .addPreferredGap(
                    org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout
                    .createParallelGroup(
                        org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(closeButton).add(openButton)
                    .add(clearButton).add(findButton))
                .addContainerGap()));

    pack();
  }// </editor-fold>//GEN-END:initComponents

  private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_closeButtonActionPerformed
    setVisible(false);
  }// GEN-LAST:event_closeButtonActionPerformed

  private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {
    antibodyEditor.clearAll();
  }

  /**
   * Displays Dialog for domain-matching. <p> If there already exists a FindDialog, it is dismissed because the data
   * could have changed.
   *
   */

  private void findButtonActionPerformed() {
    if (findDialog == null) {
      findDialog = new AntibodyFindDialog(this, false);
    }
    try {
      this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      if (findDialog.processData(antibodyEditor.getNames(),
          antibodyEditor.getChains())) {
        findDialog.setLocationRelativeTo(parentFrame);
        findDialog.setVisible(true);
        this.setVisible(false);
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(parentFrame, "An error occurred while initiating domain detection.", "Domain Detection failed", JOptionPane.ERROR_MESSAGE);
    } finally {
      this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }

  }

  public void openButtonActionPerformed(ActionEvent e) {
    // Handle open button action.
    Preferences userPref = PreferencesService.getInstance().getUserPrefs();
    JFileChooser chooser = new JFileChooser();
    chooser.setCurrentDirectory(new File(userPref.get(
        PreferencesService.LAST_FILE_FOLDER,
        System.getProperty("user.home"))));
    int returnVal = chooser.showOpenDialog(this);

    if (returnVal == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      List<String> foundNames = new ArrayList<String>();
      List<String> foundChains = new ArrayList<String>();
      List<String>[] result = null;
      try {
        result = antibodyEditor.readFile(file);

        foundNames.addAll(result[0]);
        foundChains.addAll(result[1]);
        antibodyEditor.setChains(foundNames, foundChains);
      } catch (Exception e1) {
        e1.printStackTrace();
      }
      userPref.put(PreferencesService.LAST_FILE_FOLDER, file.getParent());
    }

  }

}


text:
/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2002-2008, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.data.store;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

import com.vividsolutions.jts.geom.Envelope;

/**
 *
 *
 * @source $URL$
 */
public class EmptyFeatureCollection extends DataFeatureCollection {

	/**
	 * null bounds
	 */
	static ReferencedEnvelope bounds = new ReferencedEnvelope(new Envelope(),null);
	static {
		bounds.setToNull();
	}

	public EmptyFeatureCollection( SimpleFeatureType schema ) {
		super(null,schema);
	}

	public ReferencedEnvelope getBounds() {
		return bounds;
	}

	public int getCount() throws IOException {
		return 0;
	}

	protected Iterator openIterator() {
		return new EmptyIterator();
	}

	protected void closeIterator(Iterator close) {
		//do nothing
	}

	//read only access
	public boolean add(SimpleFeature object) {
		return false;
	}

	public boolean remove(Object object) {
		return false;
	}

	public boolean removeAll(Collection collection) {
		return false;
	}
	public boolean isValid() {
	    return true;
	}

}


text:
layout: post
title: Hyperlinking to Commits on GitHub
summary: An approach to hyperlinking to commits for GitHub repositories
hn-discussion:
tags:
- github
- git
---

I recently wrote a post about how
[GitHub's auto-linking of commit SHAs]({% post_url 2013-05-03-Limited-Commit-SHA-Auto-Linking-in-GitHub-Issues %})
is a bit
limited. The auto-linking of commit SHAs is a nice feature of GitHub's
issues, but, as you can see in my previous post, each issue links a maximum
of 10 commit SHAs. This is not a problem though because the links can be
created without GitHub's help by using markdown links.

<!-- more -->

## Linking to Commits

If GitHub won't link to the commits for us, then we can create the links
ourselves using markdown links. The URL to a given commit for a GitHub
repository looks like this:

    https://github.com/<username>/<reponame>/commit/<sha>

If we know the username and the name of the repository as well as the SHA
for the commit we are interested in linking to, then we can throw together a
markdown link like the following:

{% raw %}
    [9d110a8acdfa317076bf183964cdff2a249dad63](https://github.com/jbranchaud/gistory/commit/9d110a8acdfa317076bf183964cdff2a249dad63)
{% endraw %}

We can then jam a list of these markdown links into an issue or a markdown
file.

## Automating the Process

It is easy enough to automate the generation of a markdown link list like
this. I wrote a small python script for it using the GitPython library. You
can check out the script,
[CommitLinker.py](https://github.com/jbranchaud/gistory/blob/master/CommitLinker.py),
to see exactly how I did it.

Given the local repository path, the username, and the repository name,
the process involves a few simple steps:

- Access the git repository at the specified path
- Grab all the commits for that repository
- Construct a partial URL with the username and repository name
  (`https://github.com/<username>/<reponame>/commit/`)
- For each commit, append the commit's SHA to the partial URL and then
  output it as a markdown link

To see this at work, I generated a list of these for my
[gistory](https://github.com/jbranchaud/gistory)
repository and committed it as
[commits.md](https://github.com/jbranchaud/gistory/blob/master/commits.md).

Take that auto-linking!


text:
namespace performance_manager {

class FrameNodeImpl;
class PageNodeImpl;

// This tab helper maintains a page node, and its associated tree of frame nodes
// in the performance manager graph. It also sources a smattering of attributes
// into the graph, including visibility, title, and favicon bits.
// In addition it handles forwarding interface requests from the render frame
// host to the frame graph entity.
class PerformanceManagerTabHelper
    : public content::WebContentsObserver,
      public content::WebContentsUserData<PerformanceManagerTabHelper>,
      public WebContentsProxyImpl {
 public:
  // Observer interface to be notified when a PerformanceManagerTabHelper is
  // being teared down.
  class DestructionObserver {
   public:
    virtual ~DestructionObserver() = default;
    virtual void OnPerformanceManagerTabHelperDestroying(
        content::WebContents*) = 0;
  };

  PerformanceManagerTabHelper(const PerformanceManagerTabHelper&) = delete;
  PerformanceManagerTabHelper& operator=(const PerformanceManagerTabHelper&) =
      delete;

  ~PerformanceManagerTabHelper() override;

  // Returns the PageNode associated with the primary page. This can change
  // during the WebContents lifetime.
  PageNodeImpl* primary_page_node() { return primary_page_->page_node.get(); }

  // Returns the PageNode assicated with the given RenderFrameHost, or nullptr
  // if it doesn't exist.
  PageNodeImpl* GetPageNodeForRenderFrameHost(content::RenderFrameHost* rfh);

  // Registers an observer that is notified when the PerformanceManagerTabHelper
  // is destroyed. Can only be set to non-nullptr if it was previously nullptr,
  // and vice-versa.
  void SetDestructionObserver(DestructionObserver* destruction_observer);

  // Must be invoked prior to detaching a PerformanceManagerTabHelper from its
  // WebContents.
  void TearDown();

  // WebContentsObserver overrides.
  void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
  void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
  void RenderFrameHostChanged(content::RenderFrameHost* old_host,
                              content::RenderFrameHost* new_host) override;
  void OnVisibilityChanged(content::Visibility visibility) override;
  void OnAudioStateChanged(bool audible) override;
  void OnFrameAudioStateChanged(content::RenderFrameHost* render_frame_host,
                                bool is_audible) override;
  void DidFinishNavigation(
      content::NavigationHandle* navigation_handle) override;
  void TitleWasSet(content::NavigationEntry* entry) override;
  void InnerWebContentsAttached(content::WebContents* inner_web_contents,
                                content::RenderFrameHost* render_frame_host,
                                bool is_full_page) override;
  void InnerWebContentsDetached(
      content::WebContents* inner_web_contents) override;
  void WebContentsDestroyed() override;
  void DidUpdateFaviconURL(
      content::RenderFrameHost* render_frame_host,
      const std::vector<blink::mojom::FaviconURLPtr>& candidates) override;

  // WebContentsProxyImpl overrides. Note that `LastNavigationId()` and
  // `LastNewDocNavigationId()` refer to navigations associated with the
  // primary page.
  content::WebContents* GetWebContents() const override;
  int64_t LastNavigationId() const override;
  int64_t LastNewDocNavigationId() const override;

  void BindDocumentCoordinationUnit(
      content::RenderFrameHost* render_frame_host,
      mojo::PendingReceiver<mojom::DocumentCoordinationUnit> receiver);

  // Retrieves the frame node associated with |render_frame_host|. Returns
  // nullptr if none exist for that frame.
  FrameNodeImpl* GetFrameNode(content::RenderFrameHost* render_frame_host);

  class Observer : public base::CheckedObserver {
   public:
    // Invoked when a frame node is about to be removed from the graph.
    virtual void OnBeforeFrameNodeRemoved(
        PerformanceManagerTabHelper* performance_manager,
        FrameNodeImpl* frame_node) = 0;
  };

  // Adds/removes an observer.
  void AddObserver(Observer* observer);
  void RemoveObserver(Observer* observer);

 private:
  friend class content::WebContentsUserData<PerformanceManagerTabHelper>;
  friend class PerformanceManagerRegistryImpl;
  friend class WebContentsProxyImpl;
  FRIEND_TEST_ALL_PREFIXES(PerformanceManagerFencedFrameBrowserTest,
                           FencedFrameDoesNotHaveParentFrameNode);

  explicit PerformanceManagerTabHelper(content::WebContents* web_contents);

  // Make CreateForWebContents private to restrict usage to
  // PerformanceManagerRegistry.
  using WebContentsUserData<PerformanceManagerTabHelper>::CreateForWebContents;

  void OnMainFrameNavigation(int64_t navigation_id, bool same_doc);

  // Data that is tracked per page.
  struct PageData {
    PageData();
    ~PageData();

    // The actual page node.
    std::unique_ptr<PageNodeImpl> page_node;

    // The frame tree node ID of the main frame of this PageNode. This is the
    // primary sort key for the PageNode, as it remains constant over its
    // lifetime.  It allows an abitrary RFH to be mapped to the appropriate
    // page via RFH::GetMainFrame()->GetFrameTreeNodeId().
    // TODO(crbug.com/1211368): This is not true under MPArch, because the
    // frame tree node ID of a prerendered RFH changes when it's activated.
    // (Also, until PM's MPArch support is finished, the "main" FrameNode for a
    // PageNode can change.) Fortunately `main_frame_tree_node_id` is currently
    // only used as a DCHECK that pages are not added twice to the `pages_`
    // set. Make `pages_` a simple list, or a set keyed on something else.
    int main_frame_tree_node_id = 0;

    // The UKM source ID for this page.
    ukm::SourceId ukm_source_id = ukm::kInvalidSourceId;

    // Favicon and title are set when a page is loaded, we only want to send
    // signals to the page node about title and favicon update from the previous
    // title and favicon, thus we want to ignore the very first update since it
    // is always supposed to happen.
    bool first_time_favicon_set = false;
    bool first_time_title_set = false;

    // The last navigation ID that was committed to a main frame in this web
    // contents.
    int64_t last_navigation_id = 0;
    // Similar to the above, but for the last non same-document navigation
    // associated with this WebContents. This is always for a navigation that is
    // older or equal to |last_navigation_id_|.
    int64_t last_new_doc_navigation_id = 0;
  };

  // A transparent comparator for PageData. These are keyed by FrameTreeNodeId,
  // which is unique per Page.
  struct PageDataComparator {
    using is_transparent = void;

    bool operator()(const std::unique_ptr<PageData>& pd1,
                    const std::unique_ptr<PageData>& pd2) const {
      return pd1->main_frame_tree_node_id < pd2->main_frame_tree_node_id;
    }

    bool operator()(const std::unique_ptr<PageData>& pd1,
                    int main_frame_tree_node_id2) const {
      return pd1->main_frame_tree_node_id < main_frame_tree_node_id2;
    }

    bool operator()(int main_frame_tree_node_id1,
                    const std::unique_ptr<PageData>& pd2) const {
      return main_frame_tree_node_id1 < pd2->main_frame_tree_node_id;
    }
  };

  // Stores data related to all pages associated with this WebContents. Multiple
  // pages may exist due to things like BFCache, Portals, Prerendering, etc.
  // Exactly *one* page will be primary.
  base::flat_set<std::unique_ptr<PageData>, PageDataComparator> pages_;

  // Tracks the primary page associated with this WebContents.
  raw_ptr<PageData> primary_page_ = nullptr;

  // Maps from RenderFrameHost to the associated PM node. This is a single
  // map across all pages associated with this WebContents.
  std::map<content::RenderFrameHost*, std::unique_ptr<FrameNodeImpl>> frames_;

  raw_ptr<DestructionObserver> destruction_observer_ = nullptr;
  base::ObserverList<Observer, true, false> observers_;

  WEB_CONTENTS_USER_DATA_KEY_DECL();

  base::WeakPtrFactory<PerformanceManagerTabHelper> weak_factory_{this};
};

}  // namespace performance_manager

#endif  // COMPONENTS_PERFORMANCE_MANAGER_PERFORMANCE_MANAGER_TAB_HELPER_H_


text:
import { STRING, INTEGER, ENUM, TEXT, DATE } from 'sequelize'

export default {
  up: (queryInterface, Sequelize) => queryInterface.createTable('Boletos', {
    id: {
      type: STRING,
      primaryKey: true,
      allowNull: false
    },

    token: {
      type: STRING,
      allowNull: false
    },

    queue_url: {
      type: STRING,
      allowNull: false
    },

    status: {
      type: ENUM,
      allowNull: false,
      values: [
        'issued',
        'pending_registration',
        'registered',
        'refused'
      ],
      defaultValue: 'issued'
    },

    expiration_date: {
      type: DATE,
      allowNull: false
    },

    amount: {
      type: INTEGER,
      allowNull: false
    },

    paid_amount: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 0
    },

    instructions: {
      type: TEXT
    },

    issuer: {
      type: STRING,
      allowNull: false
    },

    issuer_id: {
      type: STRING
    },

    title_id: {
      type: INTEGER,
      allowNull: false,
      autoIncrement: true
    },

    reference_id: {
      type: STRING
    },

    barcode: {
      type: STRING
    },

    payer_name: {
      type: STRING
    },

    payer_document_type: {
      type: ENUM,
      values: ['cpf', 'cnpj']
    },

    payer_document_number: {
      type: STRING
    },

    company_name: {
      type: STRING,
      allowNull: false
    },

    company_document_number: {
      type: STRING,
      allowNull: false
    },

    bank_response_code: {
      type: STRING
    },

    created_at: {
      type: DATE,
      allowNull: false
    },

    updated_at: {
      type: DATE,
      allowNull: false
    }
  })
  .then(() => queryInterface.addIndex('Boletos', ['queue_url']))
  .then(() => queryInterface.addIndex('Boletos', ['status'])),

  down: (queryInterface, Sequelize) => queryInterface.dropTable('Boletos')
}


text:
/*************************************************************************/
/*  xr_nodes.h                                                           */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef XR_NODES_H
#define XR_NODES_H

#include "scene/3d/camera_3d.h"
#include "servers/xr/xr_positional_tracker.h"

/*
	XRCamera is a subclass of camera which will register itself with its parent XROrigin and as a result is automatically positioned
*/

class XRCamera3D : public Camera3D {
	GDCLASS(XRCamera3D, Camera3D);

protected:
	// The name and pose for our HMD tracker is currently the only hardcoded bit.
	// If we ever are able to support multiple HMDs we may need to make this settable.
	StringName tracker_name = "head";
	StringName pose_name = "default";
	Ref<XRPositionalTracker> tracker;

	void _bind_tracker();
	void _unbind_tracker();
	void _changed_tracker(const StringName p_tracker_name, int p_tracker_type);
	void _removed_tracker(const StringName p_tracker_name, int p_tracker_type);
	void _pose_changed(const Ref<XRPose> &p_pose);

public:
	PackedStringArray get_configuration_warnings() const override;

	virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const override;
	virtual Point2 unproject_position(const Vector3 &p_pos) const override;
	virtual Vector3 project_position(const Point2 &p_point, real_t p_z_depth) const override;
	virtual Vector<Plane> get_frustum() const override;

	XRCamera3D();
	~XRCamera3D();
};

/*
	XRNode3D is a helper node that implements binding to a tracker.

	It must be a child node of our XROrigin node
*/

class XRNode3D : public Node3D {
	GDCLASS(XRNode3D, Node3D);

private:
	StringName tracker_name;
	StringName pose_name = "default";
	bool is_active = true;

protected:
	Ref<XRPositionalTracker> tracker;

	static void _bind_methods();

	virtual void _bind_tracker();
	virtual void _unbind_tracker();
	void _changed_tracker(const StringName p_tracker_name, int p_tracker_type);
	void _removed_tracker(const StringName p_tracker_name, int p_tracker_type);

	void _pose_changed(const Ref<XRPose> &p_pose);

public:
	void _validate_property(PropertyInfo &p_property) const;
	void set_tracker(const StringName p_tracker_name);
	StringName get_tracker() const;

	void set_pose_name(const StringName p_pose);
	StringName get_pose_name() const;

	bool get_is_active() const;
	bool get_has_tracking_data() const;

	void trigger_haptic_pulse(const String &p_action_name, double p_frequency, double p_amplitude, double p_duration_sec, double p_delay_sec = 0);

	Ref<XRPose> get_pose();

	PackedStringArray get_configuration_warnings() const override;

	XRNode3D();
	~XRNode3D();
};

/*
	XRController3D is a helper node that automatically updates its position based on tracker data.

	It must be a child node of our XROrigin node
*/

class XRController3D : public XRNode3D {
	GDCLASS(XRController3D, XRNode3D);

private:
protected:
	static void _bind_methods();

	virtual void _bind_tracker() override;
	virtual void _unbind_tracker() override;

	void _button_pressed(const String &p_name);
	void _button_released(const String &p_name);
	void _input_value_changed(const String &p_name, float p_value);
	void _input_axis_changed(const String &p_name, Vector2 p_value);

public:
	bool is_button_pressed(const StringName &p_name) const;
	float get_value(const StringName &p_name) const;
	Vector2 get_axis(const StringName &p_name) const;

	XRPositionalTracker::TrackerHand get_tracker_hand() const;

	XRController3D() {}
	~XRController3D() {}
};

/*
	XRAnchor3D is a helper node that automatically updates its position based on anchor data, it represents a real world location.
	It must be a child node of our XROrigin3D node
*/

class XRAnchor3D : public XRNode3D {
	GDCLASS(XRAnchor3D, XRNode3D);

private:
	Vector3 size;

protected:
	static void _bind_methods();

public:
	Vector3 get_size() const;
	Plane get_plane() const;

	XRAnchor3D() {}
	~XRAnchor3D() {}
};

/*
	XROrigin3D is special spatial node that acts as our origin point mapping our real world center of our tracking volume into our virtual world.

	It is this point that you will move around the world as the player 'moves while standing still', i.e. the player moves through teleporting or controller inputs as opposed to physically moving.

	Our camera and controllers will always be child nodes and thus place relative to this origin point.
	This node will automatically locate any camera child nodes and update its position while our XRController3D node will handle tracked controllers.
*/

class XROrigin3D : public Node3D {
	GDCLASS(XROrigin3D, Node3D);

private:
	bool current = false;
	static Vector<XROrigin3D *> origin_nodes; // all origin nodes in tree

protected:
	void _notification(int p_what);
	static void _bind_methods();

public:
	PackedStringArray get_configuration_warnings() const override;

	real_t get_world_scale() const;
	void set_world_scale(real_t p_world_scale);

	void set_current(bool p_enabled);
	bool is_current() const;

	XROrigin3D() {}
	~XROrigin3D() {}
};

#endif // XR_NODES_H


text:
from polyaxon import settings
from polyaxon.api import (
    ADMIN_V1_LOCATION,
    API_V1_LOCATION,
    SSO_V1_LOCATION,
    UI_V1_LOCATION,
)
from polyaxon.proxies.schemas.base import clean_config, get_config
from polyaxon.proxies.schemas.urls import (
    get_header_host,
    get_service_proxy,
    get_service_url,
    get_ssl_server_name,
)

OPTIONS = r"""
location {path} {{
    {auth}
    {resolver}
    {ssl_server_name}
    proxy_pass {service};
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Origin "";
    proxy_set_header X-Real-IP $remote_addr;
    {header_host}
    proxy_buffering off;
}}
"""  # noqa

def get_api_config(
    path: str,
    service: str,
    resolver: str,
    auth: str,
    ssl_server_name: str,
    header_host: str,
):
    return get_config(
        options=OPTIONS,
        path=path,
        service=service,
        resolver=resolver,
        auth=auth,
        ssl_server_name=ssl_server_name,
        header_host=header_host,
    )

def get_api_location_config(resolver: str, auth=str):
    service = get_service_url(
        host=settings.PROXIES_CONFIG.api_host,
        port=settings.PROXIES_CONFIG.api_port,
    )
    if not settings.PROXIES_CONFIG.api_use_resolver:
        resolver = ""
    if not settings.PROXIES_CONFIG.auth_external:
        auth = ""
    ssl_server_name = get_ssl_server_name(service)
    header_host = get_header_host(service)
    if settings.PROXIES_CONFIG.has_forward_proxy:
        service = get_service_proxy()
    config = [
        get_api_config(
            path="= /",
            service=service,
            resolver=resolver,
            auth=auth,
            ssl_server_name=ssl_server_name,
            header_host=header_host,
        ),
        get_api_config(
            path=API_V1_LOCATION,
            service=service,
            resolver=resolver,
            auth=auth,
            ssl_server_name=ssl_server_name,
            header_host=header_host,
        ),
        get_api_config(
            path=UI_V1_LOCATION,
            service=service,
            resolver=resolver,
            auth="",
            ssl_server_name=ssl_server_name,
            header_host=header_host,
        ),
        get_api_config(
            path=SSO_V1_LOCATION,
            service=service,
            resolver=resolver,
            auth="",
            ssl_server_name=ssl_server_name,
            header_host=header_host,
        ),
        get_api_config(
            path="/static/",
            service=service,
            resolver=resolver,
            auth="",
            ssl_server_name=ssl_server_name,
            header_host=header_host,
        ),
    ]
    if settings.PROXIES_CONFIG.ui_admin_enabled:
        config.append(
            get_api_config(
                path=ADMIN_V1_LOCATION,
                service=service,
                resolver=resolver,
                auth=auth,
                ssl_server_name=ssl_server_name,
                header_host=header_host,
            )
        )
    return clean_config(config)


text:
/*
 * 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
 *
 * http://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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.osconfig.v1.model;

/**
 * Patch configuration specifications. Contains details on how to apply the patch(es) to a VM
 * instance.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the OS Config API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class PatchConfig extends com.google.api.client.json.GenericJson {

  /**
   * Apt update settings. Use this setting to override the default `apt` patch rules.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private AptSettings apt;

  /**
   * Goo update settings. Use this setting to override the default `goo` patch rules.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GooSettings goo;

  /**
   * The `ExecStep` to run after the patch update.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ExecStep postStep;

  /**
   * The `ExecStep` to run before the patch update.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ExecStep preStep;

  /**
   * Post-patch reboot settings.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String rebootConfig;

  /**
   * Windows update settings. Use this override the default windows patch rules.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private WindowsUpdateSettings windowsUpdate;

  /**
   * Yum update settings. Use this setting to override the default `yum` patch rules.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private YumSettings yum;

  /**
   * Zypper update settings. Use this setting to override the default `zypper` patch rules.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ZypperSettings zypper;

  /**
   * Apt update settings. Use this setting to override the default `apt` patch rules.
   * @return value or {@code null} for none
   */
  public AptSettings getApt() {
    return apt;
  }

  /**
   * Apt update settings. Use this setting to override the default `apt` patch rules.
   * @param apt apt or {@code null} for none
   */
  public PatchConfig setApt(AptSettings apt) {
    this.apt = apt;
    return this;
  }

  /**
   * Goo update settings. Use this setting to override the default `goo` patch rules.
   * @return value or {@code null} for none
   */
  public GooSettings getGoo() {
    return goo;
  }

  /**
   * Goo update settings. Use this setting to override the default `goo` patch rules.
   * @param goo goo or {@code null} for none
   */
  public PatchConfig setGoo(GooSettings goo) {
    this.goo = goo;
    return this;
  }

  /**
   * The `ExecStep` to run after the patch update.
   * @return value or {@code null} for none
   */
  public ExecStep getPostStep() {
    return postStep;
  }

  /**
   * The `ExecStep` to run after the patch update.
   * @param postStep postStep or {@code null} for none
   */
  public PatchConfig setPostStep(ExecStep postStep) {
    this.postStep = postStep;
    return this;
  }

  /**
   * The `ExecStep` to run before the patch update.
   * @return value or {@code null} for none
   */
  public ExecStep getPreStep() {
    return preStep;
  }

  /**
   * The `ExecStep` to run before the patch update.
   * @param preStep preStep or {@code null} for none
   */
  public PatchConfig setPreStep(ExecStep preStep) {
    this.preStep = preStep;
    return this;
  }

  /**
   * Post-patch reboot settings.
   * @return value or {@code null} for none
   */
  public java.lang.String getRebootConfig() {
    return rebootConfig;
  }

  /**
   * Post-patch reboot settings.
   * @param rebootConfig rebootConfig or {@code null} for none
   */
  public PatchConfig setRebootConfig(java.lang.String rebootConfig) {
    this.rebootConfig = rebootConfig;
    return this;
  }

  /**
   * Windows update settings. Use this override the default windows patch rules.
   * @return value or {@code null} for none
   */
  public WindowsUpdateSettings getWindowsUpdate() {
    return windowsUpdate;
  }

  /**
   * Windows update settings. Use this override the default windows patch rules.
   * @param windowsUpdate windowsUpdate or {@code null} for none
   */
  public PatchConfig setWindowsUpdate(WindowsUpdateSettings windowsUpdate) {
    this.windowsUpdate = windowsUpdate;
    return this;
  }

  /**
   * Yum update settings. Use this setting to override the default `yum` patch rules.
   * @return value or {@code null} for none
   */
  public YumSettings getYum() {
    return yum;
  }

  /**
   * Yum update settings. Use this setting to override the default `yum` patch rules.
   * @param yum yum or {@code null} for none
   */
  public PatchConfig setYum(YumSettings yum) {
    this.yum = yum;
    return this;
  }

  /**
   * Zypper update settings. Use this setting to override the default `zypper` patch rules.
   * @return value or {@code null} for none
   */
  public ZypperSettings getZypper() {
    return zypper;
  }

  /**
   * Zypper update settings. Use this setting to override the default `zypper` patch rules.
   * @param zypper zypper or {@code null} for none
   */
  public PatchConfig setZypper(ZypperSettings zypper) {
    this.zypper = zypper;
    return this;
  }

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

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

}


text:
#ifndef __CC_PLATFORM_THREAD_H__
#define __CC_PLATFORM_THREAD_H__

#include <functional>
#include <list>
#include <mutex>
#include "2d/platform/CCCommon.h"
#include "base/CCPlatformMacros.h"
#include "2d/CCDirector.h"

NS_CC_BEGIN

/**
 * @addtogroup platform
 * @{
 */

/* On iOS, should create autorelease pool when create a new thread
 * and release it when the thread end.
 */

class CC_DLL ThreadHelper
{
public:
    friend DisplayLinkDirector;

    /** Create an autorelease pool for objective-c codes.
     * @js NA
     * @lua NA
     */
    static void* createAutoreleasePool();

    /**
     * @js NA
     * @lua NA
    */
    static void releaseAutoreleasePool(void *autoreleasePool);
};

// end of platform group
/// @}

NS_CC_END

#endif    // __CC_PLATFORM_THREAD_H__


text:
package models

import (
	"time"
)

type Inspector struct {
	Id       int       `xorm:"not null pk autoincr INTEGER"`
	Username string    `xorm:"not null default '' VARCHAR(256)"`
	Password string    `xorm:"not null default '' VARCHAR(256)"`
	Created  time.Time `xorm:"not null default now() DATETIME"`
}

func (m *Inspector) TableName() string {
	return "inspector"
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Didymella pilifera Fautrey & Lambotte

### Remarks
null


text:
namespace dst
{

  class SurfaceNormalNode : public pipeline2::ComputeNode
  {
  public:
    typedef pcl::PointCloud<pcl::Normal> Normals;
    pipeline2::Outlet<Normals::Ptr> normals_otl_;

    SurfaceNormalNode(pipeline2::Outlet<KdTreeNode::Output>* kdtree_otl,
                      pipeline2::Outlet<DepthProjector::Output>* index_otl,
                      double radius = 0.025);

  protected:
    pipeline2::Outlet<KdTreeNode::Output>* kdtree_otl_;
    pipeline2::Outlet<DepthProjector::Output>* index_otl_;
    double radius_;
    Normals::Ptr normals_;

    void normalToColor(const pcl::Normal& normal,
                       cv::Vec3b* color) const;
    void _compute();
    void _display() const;
    void _flush();
    std::string _getName() const;
  };

}

#endif // SURFACE_NORMAL_NODE_H


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             */
/*                                                                            */
/* 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                                                   */
/*                                                                            */
/* http://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.                                             */
/* -------------------------------------------------------------------------- */

#ifndef HOST_POOL_H_
#define HOST_POOL_H_

#include "PoolSQL.h"
#include "Host.h"

#include <time.h>
#include <sstream>

#include <iostream>

#include <vector>

using namespace std;

/**
 *  The Host Pool class.
 */
class HostPool : public PoolSQL
{
public:
    HostPool(SqlDB *                   db,
             vector<const Attribute *> hook_mads,
             const string&             hook_location,
             const string&             remotes_location);

    ~HostPool(){};

    /**
     *  Function to allocate a new Host object
     *    @param oid the id assigned to the Host
     *    @return the oid assigned to the object or -1 in case of failure
     */
    int allocate (
        int *  oid,
        const string& hostname,
        const string& im_mad_name,
        const string& vmm_mad_name,
        const string& vnm_mad_name,
        const string& tm_mad_name,
        string& error_str);

    /**
     *  Function to get a Host from the pool, if the object is not in memory
     *  it is loaded from the DB
     *    @param oid Host unique id
     *    @param lock locks the Host mutex
     *    @return a pointer to the Host, 0 if the Host could not be loaded
     */
    Host * get(
        int     oid,
        bool    lock)
    {
        return static_cast<Host *>(PoolSQL::get(oid,lock));
    };

    /**
     *  Function to get a Host from the pool, if the object is not in memory
     *  it is loaded from the DB
     *    @param hostname
     *    @param lock locks the Host mutex
     *    @return a pointer to the Host, 0 if the Host could not be loaded
     */
    Host * get(string name, bool lock)
    {
        // The owner is set to -1, because it is not used in the key() method
        return static_cast<Host *>(PoolSQL::get(name,-1,lock));
    };

    /**
     *  Generate an index key for the object
     *    @param name of the object
     *    @param uid owner of the object, only used if needed
     *
     *    @return the key, a string
     */
    string key(const string& name, int uid)
    {
        // Name is enough key because Hosts can't repeat names.
        return name;
    };

    /**
     *  Bootstraps the database table(s) associated to the Host pool
     *    @return 0 on success
     */
    static int bootstrap(SqlDB *_db)
    {
        return Host::bootstrap(_db);
    };

    /**
     * Get the least monitored hosts
     *   @param discovered hosts, map to store the retrieved hosts hids and
     *   hostnames
     *   @param host_limit max. number of hosts to monitor at a time
     *   @return int 0 if success
     */
    int discover(map<int, string> * discovered_hosts, int host_limit);

    /**
     * Allocates a given capacity to the host
     *   @param oid the id of the host to allocate the capacity
     *   @param cpu amount of CPU
     *   @param mem amount of main memory
     *   @param disk amount of disk
     */
    void add_capacity(int oid,int cpu, int mem, int disk)
    {
        Host *  host = get(oid, true);

        if ( host != 0 )
        {
          host->add_capacity(cpu, mem, disk);

          update(host);

          host->unlock();
        }
    };

    /**
     * De-Allocates a given capacity to the host
     *   @param oid the id of the host to allocate the capacity
     *   @param cpu amount of CPU
     *   @param mem amount of main memory
     *   @param disk amount of disk
     */
    void del_capacity(int oid,int cpu, int mem, int disk)
    {
        Host *  host = get(oid, true);

        if ( host != 0 )
        {
            host->del_capacity(cpu, mem, disk);

            update(host);

            host->unlock();
        }
    };

    int drop(PoolObjectSQL * objsql, string& error_msg)
    {
        Host * host = static_cast<Host *>(objsql);

        if ( host->get_share_running_vms() > 0 )
        {
            error_msg = "Can not remove a host with running VMs";
            return -1;
        }

        return PoolSQL::drop(objsql, error_msg);
    };

    /**
     *  Dumps the HOST pool in XML format. A filter can be also added to the
     *  query
     *  @param oss the output stream to dump the pool contents
     *  @param where filter for the objects, defaults to all
     *
     *  @return 0 on success
     */
    int dump(ostringstream& oss, const string& where)
    {
        return PoolSQL::dump(oss, "HOST_POOL", Host::table, where);
    };

    /**
     *  Finds a set objects that satisfies a given condition
     *   @param oids a vector with the oids of the objects.
     *   @param the name of the DB table.
     *   @param where condition in SQL format.
     *
     *   @return 0 on success
     */
    int search(vector<int>& oids, const string& where)
    {
        return PoolSQL::search(oids, Host::table, where);
    };

private:

    /**
     *  Factory method to produce Host objects
     *    @return a pointer to the new Host
     */
    PoolObjectSQL * create()
    {
        return new Host;
    };

    /**
     *  Callback function to get the IDs of the hosts to be monitored
     *  (Host::discover)
     *    @param num the number of columns read from the DB
     *    @param names the column names
     *    @param vaues the column values
     *    @return 0 on success
     */
    int discover_cb(void * _map, int num, char **values, char **names);
};

#endif /*HOST_POOL_H_*/


text:
package broken.shotgun.throwthemoon.actors;

import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.TextureLoader;
import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.Animation.PlayMode;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable;

public class Background extends Actor {
    private static final String TEXTURE_FILENAME = "bg_tiles.png";
    private static final int FRAME_WIDTH = 256;
    private static final int FRAME_HEIGHT = 256;

    private final Texture texture;
    private final Animation animation;
    private final TiledDrawable background;
    private float stateTime = 0f;

    public Background(AssetManager manager) {
        manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
        manager.load(TEXTURE_FILENAME, Texture.class);
        manager.finishLoading();

        texture = manager.get(TEXTURE_FILENAME);

        TextureRegion[] frames = TextureRegion.split(texture, FRAME_WIDTH, FRAME_HEIGHT)[0];
        animation = new Animation(0.1f, frames[0], frames[1], frames[2]);
        animation.setPlayMode(PlayMode.LOOP);

        setWidth(FRAME_WIDTH);
        setHeight(FRAME_HEIGHT);

        background = new TiledDrawable(animation.getKeyFrame(0f));
    }

    @Override
    public void act(float delta) {
        super.act(delta);
        background.setRegion(animation.getKeyFrame(stateTime));
        stateTime += delta;
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
        super.draw(batch, parentAlpha);
        background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }
}


text:
import * as React from "react";

import { tr } from "../utils/translate";

interface OpenInCodapViewProps {
  disabled: boolean;
}

interface OpenInCodapViewState {}

export class OpenInCodapView extends React.Component<OpenInCodapViewProps, OpenInCodapViewState> {

  public static displayName = "OpenInCodapView";

  public render() {
    const {disabled} = this.props;

    return (
      <span className="link">
        <a
          href={this.link()}
          className={disabled ? "disabled" : undefined}
          onClick={disabled ? this.handleDisabledLink : undefined}
        >
          {tr("~OPEN_IN_CODAP.TITLE")}
        </a>
      </span>
    );
  }

  private link() {
    const encodedUrl = encodeURIComponent(window.location.toString());
    return `http://codap.concord.org/releases/latest/static/dg/en/cert/index.html?documentServer=http://document-store.herokuapp.com/&di=${encodedUrl}`;
  }

  private handleDisabledLink = (e: React.MouseEvent<HTMLAnchorElement>) => {
    e.preventDefault();
    alert(tr("~OPEN_IN_CODAP.DISABLED"));
  }
}


text:
MongoDB\Driver\WriteResult::isAcknowledged()
--SKIPIF--
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
<?php skip_if_not_live(); ?>
<?php skip_if_not_clean(); ?>
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";

$manager = create_test_manager();

$wcs = [
    new MongoDB\Driver\WriteConcern(0),
    new MongoDB\Driver\WriteConcern(1),
];

foreach ($wcs as $wc) {
    $bulk = new MongoDB\Driver\BulkWrite;
    $bulk->insert(['x' => 1]);

    $result = $manager->executeBulkWrite(NS, $bulk, $wc);

    var_dump($result->isAcknowledged());
}

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(false)
bool(true)
===DONE===