text:
from rlib.objectmodel import we_are_translated
from rlib.osext import raw_input

from som.interpreter.bc.frame import create_frame
from som.vm.globals import nilObject

class _Shell(object):

    def __init__(self, universe):
        self._universe = universe

    def start(self):
        from som.vm.universe import std_println, error_println
        counter = 0
        it = nilObject

        std_println("SOM Shell. Type \"quit\" to exit.\n")

        while True:
            try:
                # Read a statement from the keyboard
                stmt = raw_input("---> ")
                if stmt == "quit" or stmt == "":
                    return it
                elif stmt == "\n":
                    continue

                # Generate a temporary class with a run method
                stmt = ("Shell_Class_" + str(counter) +
                        " = ( run: it = ( | tmp | tmp := (" + stmt +
                        " ). 'it = ' print. ^tmp println ) )")
                counter += 1

                # Compile and load the newly generated class
                shell_class = self._universe.load_shell_class(stmt)

                # If success
                if shell_class:
                    shell_object = self._universe.new_instance(shell_class)
                    shell_method = shell_class.lookup_invokable(
                        self._universe.symbol_for("run:"))

                    it = self._exec(shell_object, shell_method, it)
            except Exception as e:
                if not we_are_translated():  # this cannot be done in rpython
                    import traceback
                    traceback.print_exc()
                error_println("Caught exception: %s" % e)

class AstShell(_Shell):

    def _exec(self, shell_object, shell_method, it):
        return shell_method.invoke(shell_object, [it])

class BcShell(_Shell):

    def __init__(self, universe, interpreter, bootstrap_method):
        _Shell.__init__(self, universe)
        self._interpreter = interpreter
        self._bootstrap_method = bootstrap_method
        # Create a fake bootstrap frame
        self._current_frame = create_frame(None, self._bootstrap_method, None)

    def _exec(self, shell_object, shell_method, it):
        self._current_frame.reset_stack_pointer()
        self._current_frame.push(shell_object)

        # Push the old value of "it" on the stack
        self._current_frame.push(it)

        # Invoke the run method
        shell_method.invoke(self._current_frame, self._interpreter)

        return self._current_frame.pop()


text:
package com.tianyu.jty.wechat.util;

/**
 * Created by xtao on 2015/12/2.
 */
public class AccessToken {
    private String access_token;
    private Integer expires_in;

    public AccessToken() {
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public Integer getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(Integer expires_in) {
        this.expires_in = expires_in;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template enable_up_ptr</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../move/reference.html#header.boost.move.unique_ptr_hpp" title="Header <boost/move/unique_ptr.hpp>">
<link rel="prev" href="enable_up_moveconv_constr.html" title="Struct template enable_up_moveconv_constr">
<link rel="next" href="get_cvelement.html" title="Struct template get_cvelement">

Home
Libraries
People
FAQ
More

Struct template enable_up_ptr

boost::move_upd::enable_up_ptr

Synopsis

// In header: <boost/move/unique_ptr.hpp>

template<typename T, typename FromPointer, typename ThisPointer,
         typename Type = bmupmu::nat>
struct enable_up_ptr : public boost::move_upmu::enable_if_c< is_unique_ptr_convertible< bmupmu::is_array< T >::value, FromPointer, ThisPointer >::value, Type >
{
};

Copyright © 2008-2014 Ion Gaztanaga

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
'use strict';
(function() {

  // ----------
  var component = App.HomePage = function(config) {
    var self = this;

    this.$el = config.$el;
    this.$artworkStub = this.$el.find('.artwork-stub');
    this.$intro = this.$el.find('.intro');
    this.$okButton = this.$el.find('.ok-button');

    if (!localStorage.getItem('seen-intro') || App.urlParams.intro) {
      this.$intro.show();
    }

    this.$okButton.on('click', function() {
      self.$intro.slideUp();
      localStorage.setItem('seen-intro', 'true');
    });

    App.request({
      method: 'get-all-artworks',
      success: function(data) {
        // data.artworks = data.artworks.concat(data.artworks);
        data.artworks = _.shuffle(data.artworks);
        App.template('artwork-list', data).appendTo(self.$artworkStub);
      },
      error: function(message) {
        self._error(message);
      }
    });
  };

  // ----------
  component.prototype = {
    // ----------
    _error: function(message) {
      $('.error').text(message);
    }
  };

})();


text:
package org.apache.pdfbox.debugger.streampane;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.LineBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;

import org.apache.pdfbox.debugger.ui.HighResolutionImageIcon;
import org.apache.pdfbox.debugger.ui.ImageUtil;
import org.apache.pdfbox.debugger.ui.RotationMenu;
import org.apache.pdfbox.debugger.ui.ZoomMenu;

/**
 * @author Khyrul Bashar
 *
 * A class that provides the container for the image in case of image showing in stream pane.
 */
class StreamImageView implements ActionListener, AncestorListener
{
    private final BufferedImage image;
    private JScrollPane scrollPane;
    private JLabel label;
    private ZoomMenu zoomMenu;
    private RotationMenu rotationMenu;

    /**
     * constructor.
     * @param image instance of BufferedImage.
     */
    StreamImageView(BufferedImage image)
    {
        this.image = image;
        initUI();
    }

    private void initUI()
    {
        JPanel panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

        zoomMenu = ZoomMenu.getInstance();
        zoomMenu.changeZoomSelection(zoomMenu.getImageZoomScale());

        label = new JLabel();
        label.setBorder(new LineBorder(Color.BLACK));
        label.setAlignmentX(Component.CENTER_ALIGNMENT);
        addImage(zoomImage(image, zoomMenu.getImageZoomScale(), RotationMenu.getRotationDegrees()));

        panel.add(Box.createVerticalGlue());
        panel.add(label);
        panel.add(Box.createVerticalGlue());

        scrollPane = new JScrollPane();
        scrollPane.setPreferredSize(new Dimension(300, 400));
        scrollPane.addAncestorListener(this);
        scrollPane.setViewportView(panel);
    }

    /**
     * Returns the view i.e container containing image.
     * @return A JComponent instance.
     */
    JComponent getView()
    {
        return scrollPane;
    }

    private Image zoomImage(BufferedImage origin, float scale, int rotation)
    {
        BufferedImage rotatedImage = ImageUtil.getRotatedImage(origin, rotation);
        int resizedWidth = (int) (rotatedImage.getWidth() * scale);
        int resizedHeight = (int) (rotatedImage.getHeight() * scale);
        return rotatedImage.getScaledInstance(resizedWidth, resizedHeight, Image.SCALE_SMOOTH);
    }

    @Override
    public void actionPerformed(ActionEvent actionEvent)
    {
        String actionCommand = actionEvent.getActionCommand();
        if (ZoomMenu.isZoomMenu(actionCommand) || RotationMenu.isRotationMenu(actionCommand))
        {
            addImage(zoomImage(image, ZoomMenu.getZoomScale(), RotationMenu.getRotationDegrees()));
            zoomMenu.setImageZoomScale(ZoomMenu.getZoomScale());
        }
    }

    private void addImage(Image img)
    {
        // for JDK9; see explanation in PagePane
        AffineTransform tx = GraphicsEnvironment.getLocalGraphicsEnvironment().
                getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform();
        label.setSize((int) Math.ceil(img.getWidth(null) / tx.getScaleX()),
                      (int) Math.ceil(img.getHeight(null) / tx.getScaleY()));
        label.setIcon(new HighResolutionImageIcon(img, label.getWidth(), label.getHeight()));
        label.revalidate();
    }

    @Override
    public void ancestorAdded(AncestorEvent ancestorEvent)
    {
        zoomMenu.addMenuListeners(this);
        zoomMenu.setEnableMenu(true);

        rotationMenu = RotationMenu.getInstance();
        rotationMenu.addMenuListeners(this);
        rotationMenu.setRotationSelection(RotationMenu.ROTATE_0_DEGREES);
        rotationMenu.setEnableMenu(true);
    }

    @Override
    public void ancestorRemoved(AncestorEvent ancestorEvent)
    {
        zoomMenu.setEnableMenu(false);
        rotationMenu.setEnableMenu(false);
    }

    @Override
    public void ancestorMoved(AncestorEvent ancestorEvent)
    {
    }
}


text:
**NOTE: THIS IS A WORK IN PROGRESS; IT IS NOT YET FULLY FUNCTIONAL.**

A reusable, embeddable VR-mode HTML5 video player in JavaScript.

## Introduction

vrtheater.js is a drop-in JavaScript library that wraps any HTML5 video
element in a player interface made for head-mounted displays like the
Oculus Rift. Embed it into your web pages or web applications for an
easy VR multimedia experience without leaving the browser.

[three.js](http://threejs.org) is required.

See a live demo [here](http://bhspitmonkey.github.io/VRTheater.js/demo.html).

## Quick Start

```html
<script type="text/javascript" src="three.js"></script>
<script type="text/javascript" src="OculusRiftEffect.js"></script>
<script type="text/javascript" src="vrtheater.js"></script>
<script>
    function go() {
        var video = document.getElementById("movie");
        var options = {}; // Optional
        var player = new VRTheater.Player(video, options);
    }
</script>
...
<video id="movie" src="movie.webm"></video>
<button onclick="go()">Start VR Mode</button>
```

When you create a new VRTheater object and pass a video element to its
constructor, a VRTheater canvas will be created containing the VR player.
By default, this player will cover the video element exactly, making itself
the same size.

## Options

| **Name**        | **Default**    | **Description** |
| --------------- | -------------- | --------------- |
| initialSize     | `"coverVideo"` | Covers the video element, matching its size. Other options are `"fillWindow"` (player covers entire viewport) and `"none"` (player canvas is hidden until you explicitly add it to the DOM)|
| startFullScreen | `false`        | If true, the canvas will call requestFullscreen on itself when created. |

## Events

TODO

## User Controls

The player's canvas listens for mouse and keyboard events for
controlling playback and requesting fullscreen mode.

|                    | Keyboard | Mouse        | Gamepad |
| ------------------ | -------- | ------------ | ------- |
| **Zoom in**        | Up       | Scroll up    |         |
| **Zoom out**       | Down     | Scroll down  |         |
| **Play/Pause**     | Space    |              |         |
| **Fullscreen**     |          | Double click |         |
| **Toggle 3D mode** | M        |              |         |

## License

Authors of included third-party code retain all rights to their contributions.
(OculusRiftEffect.js was licensed by its
[original author](http://github.com/troffmo5) under the terms of the MIT
License.)

All other software in this repository is provided under the MIT License.
Please see LICENSE for the full license text.


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Changing field 'Image.shortuuid'
        db.alter_column(u'articles_image', 'shortuuid', self.gf('core.fields.ShortUUIDField')(default='', unique=True, max_length=255))
        # Deleting field 'Article.drupal_id'
        db.delete_column(u'articles_article', 'drupal_id')

        # Changing field 'Article.shortuuid'
        db.alter_column(u'articles_article', 'shortuuid', self.gf('core.fields.ShortUUIDField')(default='', unique=True, max_length=255))

    def backwards(self, orm):

        # Changing field 'Image.shortuuid'
        db.alter_column(u'articles_image', 'shortuuid', self.gf('core.fields.ShortUUIDField')(unique=True, max_length=255, null=True))
        # Adding field 'Article.drupal_id'
        db.add_column(u'articles_article', 'drupal_id',
                      self.gf('django.db.models.fields.IntegerField')(unique=True, null=True, blank=True),
                      keep_default=False)

        # Changing field 'Article.shortuuid'
        db.alter_column(u'articles_article', 'shortuuid', self.gf('core.fields.ShortUUIDField')(unique=True, max_length=255, null=True))

    models = {
        u'articles.article': {
            'Meta': {'ordering': "['-pubdate']", 'object_name': 'Article'},
            'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
            'body': ('django.db.models.fields.TextField', [], {}),
            'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'enable_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'kind': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'lead': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'program': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['programs.Program']", 'null': 'True', 'blank': 'True'}),
            'pubdate': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 9, 6, 0, 0)'}),
            'reviewed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'shortuuid': ('core.fields.ShortUUIDField', [], {'unique': 'True', 'max_length': '255', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
            'status': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
        },
        u'articles.image': {
            'Meta': {'ordering': "['-article__pubdate', '-created']", 'object_name': 'Image'},
            'article': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['articles.Article']"}),
            'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
            'reviewed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'shortuuid': ('core.fields.ShortUUIDField', [], {'unique': 'True', 'max_length': '255', 'blank': 'True'}),
            'status': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'thumbnail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
        },
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'programs.program': {
            'Meta': {'ordering': "['title']", 'object_name': 'Program'},
            'abbr': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'body': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'lead': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'reviewed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'shortuuid': ('core.fields.ShortUUIDField', [], {'unique': 'True', 'max_length': '255', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
            'status': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
        }
    }

    complete_apps = ['articles']


text:
// ***********************************************************************
// <copyright file="WrappedReader.cs" company="ServiceStack, Inc.">
//     Copyright (c) ServiceStack, Inc. All Rights Reserved.
// </copyright>
// <summary>Fork for YetAnotherForum.NET, Licensed under the Apache License, Version 2.0</summary>
// ***********************************************************************
using System;
using System.Collections;
using System.Data;
using System.Data.Common;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace ServiceStack.OrmLite.Dapper;

/// <summary>
/// Class DisposedReader. This class cannot be inherited.
/// Implements the <see cref="System.Data.Common.DbDataReader" />
/// </summary>
/// <seealso cref="System.Data.Common.DbDataReader" />
internal sealed class DisposedReader : DbDataReader
{
    /// <summary>
    /// The instance
    /// </summary>
    internal static readonly DisposedReader Instance = new DisposedReader();
    /// <summary>
    /// Prevents a default instance of the <see cref="DisposedReader"/> class from being created.
    /// </summary>
    private DisposedReader() { }
    /// <summary>
    /// Gets a value indicating the depth of nesting for the current row.
    /// </summary>
    /// <value>The depth.</value>
    public override int Depth => 0;
    /// <summary>
    /// Gets the number of columns in the current row.
    /// </summary>
    /// <value>The field count.</value>
    public override int FieldCount => 0;
    /// <summary>
    /// Gets a value indicating whether the <see cref="T:System.Data.Common.DbDataReader" /> is closed.
    /// </summary>
    /// <value><c>true</c> if this instance is closed; otherwise, <c>false</c>.</value>
    public override bool IsClosed => true;
    /// <summary>
    /// Gets a value that indicates whether this <see cref="T:System.Data.Common.DbDataReader" /> contains one or more rows.
    /// </summary>
    /// <value><c>true</c> if this instance has rows; otherwise, <c>false</c>.</value>
    public override bool HasRows => false;
    /// <summary>
    /// Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
    /// </summary>
    /// <value>The records affected.</value>
    public override int RecordsAffected => -1;
    /// <summary>
    /// Gets the number of fields in the <see cref="T:System.Data.Common.DbDataReader" /> that are not hidden.
    /// </summary>
    /// <value>The visible field count.</value>
    public override int VisibleFieldCount => 0;

    /// <summary>
    /// Throws the disposed.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns>T.</returns>
    /// <exception cref="System.ObjectDisposedException">DbDataReader</exception>
    [MethodImpl(MethodImplOptions.NoInlining)]
    private static T ThrowDisposed<T>() => throw new ObjectDisposedException(nameof(DbDataReader));
    /// <summary>
    /// Throw disposed as an asynchronous operation.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns>A Task<T> representing the asynchronous operation.</returns>
    [MethodImpl(MethodImplOptions.NoInlining)]
    private async static Task<T> ThrowDisposedAsync<T>()
    {
        var result = ThrowDisposed<T>();
        await Task.Yield(); // will never hit this - already thrown and handled
        return result;
    }
    /// <summary>
    /// Closes the <see cref="T:System.Data.Common.DbDataReader" /> object.
    /// </summary>
    public override void Close() { }
    /// <summary>
    /// Returns a <see cref="T:System.Data.DataTable" /> that describes the column metadata of the <see cref="T:System.Data.Common.DbDataReader" />.
    /// </summary>
    /// <returns>A <see cref="T:System.Data.DataTable" /> that describes the column metadata.</returns>
    public override DataTable GetSchemaTable() => ThrowDisposed<DataTable>();
    /// <summary>
    /// Obtains a lifetime service object to control the lifetime policy for this instance.
    /// </summary>
    /// <returns>An object of type <see cref="T:System.Runtime.Remoting.Lifetime.ILease" /> used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the <see cref="P:System.Runtime.Remoting.Lifetime.LifetimeServices.LeaseManagerPollTime" /> property.</returns>
    public override object InitializeLifetimeService() => ThrowDisposed<object>();
    /// <summary>
    /// Releases the managed resources used by the <see cref="T:System.Data.Common.DbDataReader" /> and optionally releases the unmanaged resources.
    /// </summary>
    /// <param name="disposing"><see langword="true" /> to release managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
    protected override void Dispose(bool disposing) { }
    /// <summary>
    /// Gets the value of the specified column as a Boolean.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override bool GetBoolean(int ordinal) => ThrowDisposed<bool>();
    /// <summary>
    /// Reads a stream of bytes from the specified column, starting at location indicated by <paramref name="dataOffset" />, into the buffer, starting at the location indicated by <paramref name="bufferOffset" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <param name="dataOffset">The index within the row from which to begin the read operation.</param>
    /// <param name="buffer">The buffer into which to copy the data.</param>
    /// <param name="bufferOffset">The index with the buffer to which the data will be copied.</param>
    /// <param name="length">The maximum number of characters to read.</param>
    /// <returns>The actual number of bytes read.</returns>
    public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) => ThrowDisposed<long>();
    /// <summary>
    /// Gets the value of the specified column as a single-precision floating point number.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override float GetFloat(int ordinal) => ThrowDisposed<float>();
    /// <summary>
    /// Gets the value of the specified column as a 16-bit signed integer.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override short GetInt16(int ordinal) => ThrowDisposed<short>();
    /// <summary>
    /// Gets the value of the specified column as a byte.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override byte GetByte(int ordinal) => ThrowDisposed<byte>();
    /// <summary>
    /// Gets the value of the specified column as a single character.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override char GetChar(int ordinal) => ThrowDisposed<char>();
    /// <summary>
    /// Reads a stream of characters from the specified column, starting at location indicated by <paramref name="dataOffset" />, into the buffer, starting at the location indicated by <paramref name="bufferOffset" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <param name="dataOffset">The index within the row from which to begin the read operation.</param>
    /// <param name="buffer">The buffer into which to copy the data.</param>
    /// <param name="bufferOffset">The index with the buffer to which the data will be copied.</param>
    /// <param name="length">The maximum number of characters to read.</param>
    /// <returns>The actual number of characters read.</returns>
    public override long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length) => ThrowDisposed<long>();
    /// <summary>
    /// Gets name of the data type of the specified column.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>A string representing the name of the data type.</returns>
    public override string GetDataTypeName(int ordinal) => ThrowDisposed<string>();
    /// <summary>
    /// Gets the value of the specified column as a <see cref="T:System.DateTime" /> object.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override DateTime GetDateTime(int ordinal) => ThrowDisposed<DateTime>();
    /// <summary>
    /// Returns a <see cref="T:System.Data.Common.DbDataReader" /> object for the requested column ordinal that can be overridden with a provider-specific implementation.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>A <see cref="T:System.Data.Common.DbDataReader" /> object.</returns>
    protected override DbDataReader GetDbDataReader(int ordinal) => ThrowDisposed<DbDataReader>();
    /// <summary>
    /// Gets the value of the specified column as a <see cref="T:System.Decimal" /> object.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override decimal GetDecimal(int ordinal) => ThrowDisposed<decimal>();
    /// <summary>
    /// Gets the value of the specified column as a double-precision floating point number.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override double GetDouble(int ordinal) => ThrowDisposed<double>();
    /// <summary>
    /// Returns an <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the rows in the data reader.
    /// </summary>
    /// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the rows in the data reader.</returns>
    public override IEnumerator GetEnumerator() => ThrowDisposed<IEnumerator>();
    /// <summary>
    /// Gets the data type of the specified column.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The data type of the specified column.</returns>
    public override Type GetFieldType(int ordinal) => ThrowDisposed<Type>();
    /// <summary>
    /// Synchronously gets the value of the specified column as a type.
    /// </summary>
    /// <typeparam name="T">Synchronously gets the value of the specified column as a type.</typeparam>
    /// <param name="ordinal">The column to be retrieved.</param>
    /// <returns>The column to be retrieved.</returns>
    public override T GetFieldValue<T>(int ordinal) => ThrowDisposed<T>();
    /// <summary>
    /// Asynchronously gets the value of the specified column as a type.
    /// </summary>
    /// <typeparam name="T">The type of the value to be returned.</typeparam>
    /// <param name="ordinal">The type of the value to be returned.</param>
    /// <param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:System.Data.Common.DbDataReader.GetFieldValueAsync``1(System.Int32)" />. The returned task must be marked as cancelled.</param>
    /// <returns>The type of the value to be returned.</returns>
    public override Task<T> GetFieldValueAsync<T>(int ordinal, CancellationToken cancellationToken) => ThrowDisposedAsync<T>();
    /// <summary>
    /// Gets the value of the specified column as a globally-unique identifier (GUID).
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override Guid GetGuid(int ordinal) => ThrowDisposed<Guid>();
    /// <summary>
    /// Gets the value of the specified column as a 32-bit signed integer.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override int GetInt32(int ordinal) => ThrowDisposed<int>();
    /// <summary>
    /// Gets the value of the specified column as a 64-bit signed integer.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override long GetInt64(int ordinal) => ThrowDisposed<long>();
    /// <summary>
    /// Gets the name of the column, given the zero-based column ordinal.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The name of the specified column.</returns>
    public override string GetName(int ordinal) => ThrowDisposed<string>();
    /// <summary>
    /// Gets the column ordinal given the name of the column.
    /// </summary>
    /// <param name="name">The name of the column.</param>
    /// <returns>The zero-based column ordinal.</returns>
    public override int GetOrdinal(string name) => ThrowDisposed<int>();
    /// <summary>
    /// Returns the provider-specific field type of the specified column.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The <see cref="T:System.Type" /> object that describes the data type of the specified column.</returns>
    public override Type GetProviderSpecificFieldType(int ordinal) => ThrowDisposed<Type>();
    /// <summary>
    /// Gets the value of the specified column as an instance of <see cref="T:System.Object" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override object GetProviderSpecificValue(int ordinal) => ThrowDisposed<object>();
    /// <summary>
    /// Gets all provider-specific attribute columns in the collection for the current row.
    /// </summary>
    /// <param name="values">An array of <see cref="T:System.Object" /> into which to copy the attribute columns.</param>
    /// <returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns>
    public override int GetProviderSpecificValues(object[] values) => ThrowDisposed<int>();
    /// <summary>
    /// Retrieves data as a <see cref="T:System.IO.Stream" />.
    /// </summary>
    /// <param name="ordinal">Retrieves data as a <see cref="T:System.IO.Stream" />.</param>
    /// <returns>The returned object.</returns>
    public override Stream GetStream(int ordinal) => ThrowDisposed<Stream>();
    /// <summary>
    /// Gets the value of the specified column as an instance of <see cref="T:System.String" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override string GetString(int ordinal) => ThrowDisposed<string>();
    /// <summary>
    /// Retrieves data as a <see cref="T:System.IO.TextReader" />.
    /// </summary>
    /// <param name="ordinal">Retrieves data as a <see cref="T:System.IO.TextReader" />.</param>
    /// <returns>The returned object.</returns>
    public override TextReader GetTextReader(int ordinal) => ThrowDisposed<TextReader>();
    /// <summary>
    /// Gets the value of the specified column as an instance of <see cref="T:System.Object" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override object GetValue(int ordinal) => ThrowDisposed<object>();
    /// <summary>
    /// Populates an array of objects with the column values of the current row.
    /// </summary>
    /// <param name="values">An array of <see cref="T:System.Object" /> into which to copy the attribute columns.</param>
    /// <returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns>
    public override int GetValues(object[] values) => ThrowDisposed<int>();
    /// <summary>
    /// Gets a value that indicates whether the column contains nonexistent or missing values.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns><see langword="true" /> if the specified column is equivalent to <see cref="T:System.DBNull" />; otherwise <see langword="false" />.</returns>
    public override bool IsDBNull(int ordinal) => ThrowDisposed<bool>();
    /// <summary>
    /// An asynchronous version of <see cref="M:System.Data.Common.DbDataReader.IsDBNull(System.Int32)" />, which gets a value that indicates whether the column contains non-existent or missing values. Optionally, sends a notification that operations should be cancelled.
    /// </summary>
    /// <param name="ordinal">The zero-based column to be retrieved.</param>
    /// <param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:System.Data.Common.DbDataReader.IsDBNullAsync(System.Int32)" />. The returned task must be marked as cancelled.</param>
    /// <returns><see langword="true" /> if the specified column value is equivalent to <see langword="DBNull" /> otherwise <see langword="false" />.</returns>
    public override Task<bool> IsDBNullAsync(int ordinal, CancellationToken cancellationToken) => ThrowDisposedAsync<bool>();
    /// <summary>
    /// Advances the reader to the next result when reading the results of a batch of statements.
    /// </summary>
    /// <returns><see langword="true" /> if there are more result sets; otherwise <see langword="false" />.</returns>
    public override bool NextResult() => ThrowDisposed<bool>();
    /// <summary>
    /// Advances the reader to the next record in a result set.
    /// </summary>
    /// <returns><see langword="true" /> if there are more rows; otherwise <see langword="false" />.</returns>
    public override bool Read() => ThrowDisposed<bool>();
    /// <summary>
    /// This is the asynchronous version of <see cref="M:System.Data.Common.DbDataReader.NextResult" />. Providers should override with an appropriate implementation. The <paramref name="cancellationToken" /> may optionally be ignored.
    /// The default implementation invokes the synchronous <see cref="M:System.Data.Common.DbDataReader.NextResult" /> method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled <paramref name="cancellationToken" />. Exceptions thrown by <see cref="M:System.Data.Common.DbDataReader.NextResult" /> will be communicated via the returned Task Exception property.
    /// Other methods and properties of the DbDataReader object should not be invoked while the returned Task is not yet completed.
    /// </summary>
    /// <param name="cancellationToken">The cancellation instruction.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    public override Task<bool> NextResultAsync(CancellationToken cancellationToken) => ThrowDisposedAsync<bool>();
    /// <summary>
    /// This is the asynchronous version of <see cref="M:System.Data.Common.DbDataReader.Read" />.  Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored.
    /// The default implementation invokes the synchronous <see cref="M:System.Data.Common.DbDataReader.Read" /> method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken.  Exceptions thrown by Read will be communicated via the returned Task Exception property.
    /// Do not invoke other methods and properties of the <see langword="DbDataReader" /> object until the returned Task is complete.
    /// </summary>
    /// <param name="cancellationToken">The cancellation instruction.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    public override Task<bool> ReadAsync(CancellationToken cancellationToken) => ThrowDisposedAsync<bool>();
    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified ordinal.
    /// </summary>
    /// <param name="ordinal">The ordinal.</param>
    /// <returns>System.Object.</returns>
    public override object this[int ordinal] => ThrowDisposed<object>();
    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified name.
    /// </summary>
    /// <param name="name">The name.</param>
    /// <returns>System.Object.</returns>
    public override object this[string name] => ThrowDisposed<object>();
}

/// <summary>
/// Class WrappedReader.
/// </summary>
internal static class WrappedReader
{
    // the purpose of wrapping here is to allow closing a reader to *also* close
    // the command, without having to explicitly hand the command back to the
    // caller; what that actually looks like depends on what we get: if we are
    // given a DbDataReader, we will surface a DbDataReader; if we are given
    // a raw IDataReader, we will surface that; and if null: null
    /// <summary>
    /// Creates the specified command.
    /// </summary>
    /// <param name="cmd">The command.</param>
    /// <param name="reader">The reader.</param>
    /// <returns>IDataReader.</returns>
    public static IDataReader Create(IDbCommand cmd, IDataReader reader)
    {
        if (cmd == null) return reader; // no need to wrap if no command

        if (reader is DbDataReader dbr) return new DbWrappedReader(cmd, dbr);
        if (reader != null) return new BasicWrappedReader(cmd, reader);
        cmd.Dispose();
        return null; // GIGO
    }
    /// <summary>
    /// Creates the specified command.
    /// </summary>
    /// <param name="cmd">The command.</param>
    /// <param name="reader">The reader.</param>
    /// <returns>DbDataReader.</returns>
    public static DbDataReader Create(IDbCommand cmd, DbDataReader reader)
    {
        if (cmd == null) return reader; // no need to wrap if no command

        if (reader != null) return new DbWrappedReader(cmd, reader);
        cmd.Dispose();
        return null; // GIGO
    }
}
/// <summary>
/// Class DbWrappedReader. This class cannot be inherited.
/// Implements the <see cref="System.Data.Common.DbDataReader" />
/// Implements the <see cref="ServiceStack.OrmLite.Dapper.IWrappedDataReader" />
/// </summary>
/// <seealso cref="System.Data.Common.DbDataReader" />
/// <seealso cref="ServiceStack.OrmLite.Dapper.IWrappedDataReader" />
internal sealed class DbWrappedReader : DbDataReader, IWrappedDataReader
{
    /// <summary>
    /// The reader
    /// </summary>
    private DbDataReader _reader;
    /// <summary>
    /// The command
    /// </summary>
    private IDbCommand _cmd;

    /// <summary>
    /// Obtain the underlying reader
    /// </summary>
    /// <value>The reader.</value>
    IDataReader IWrappedDataReader.Reader => _reader;

    /// <summary>
    /// Obtain the underlying command
    /// </summary>
    /// <value>The command.</value>
    IDbCommand IWrappedDataReader.Command => _cmd;

    /// <summary>
    /// Initializes a new instance of the <see cref="DbWrappedReader"/> class.
    /// </summary>
    /// <param name="cmd">The command.</param>
    /// <param name="reader">The reader.</param>
    public DbWrappedReader(IDbCommand cmd, DbDataReader reader)
    {
        _cmd = cmd;
        _reader = reader;
    }

    /// <summary>
    /// Gets a value that indicates whether this <see cref="T:System.Data.Common.DbDataReader" /> contains one or more rows.
    /// </summary>
    /// <value><c>true</c> if this instance has rows; otherwise, <c>false</c>.</value>
    public override bool HasRows => _reader.HasRows;

    /// <summary>
    /// Closes the <see cref="T:System.Data.Common.DbDataReader" /> object.
    /// </summary>
    public override void Close() => _reader.Close();
    /// <summary>
    /// Returns a <see cref="T:System.Data.DataTable" /> that describes the column metadata of the <see cref="T:System.Data.Common.DbDataReader" />.
    /// </summary>
    /// <returns>A <see cref="T:System.Data.DataTable" /> that describes the column metadata.</returns>
    public override DataTable GetSchemaTable() => _reader.GetSchemaTable();
    /// <summary>
    /// Obtains a lifetime service object to control the lifetime policy for this instance.
    /// </summary>
    /// <returns>An object of type <see cref="T:System.Runtime.Remoting.Lifetime.ILease" /> used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the <see cref="P:System.Runtime.Remoting.Lifetime.LifetimeServices.LeaseManagerPollTime" /> property.</returns>
    public override object InitializeLifetimeService() => _reader.InitializeLifetimeService();

    /// <summary>
    /// Gets a value indicating the depth of nesting for the current row.
    /// </summary>
    /// <value>The depth.</value>
    public override int Depth => _reader.Depth;

    /// <summary>
    /// Gets a value indicating whether the <see cref="T:System.Data.Common.DbDataReader" /> is closed.
    /// </summary>
    /// <value><c>true</c> if this instance is closed; otherwise, <c>false</c>.</value>
    public override bool IsClosed => _reader.IsClosed;

    /// <summary>
    /// Advances the reader to the next result when reading the results of a batch of statements.
    /// </summary>
    /// <returns><see langword="true" /> if there are more result sets; otherwise <see langword="false" />.</returns>
    public override bool NextResult() => _reader.NextResult();

    /// <summary>
    /// Advances the reader to the next record in a result set.
    /// </summary>
    /// <returns><see langword="true" /> if there are more rows; otherwise <see langword="false" />.</returns>
    public override bool Read() => _reader.Read();

    /// <summary>
    /// Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
    /// </summary>
    /// <value>The records affected.</value>
    public override int RecordsAffected => _reader.RecordsAffected;

    /// <summary>
    /// Releases the managed resources used by the <see cref="T:System.Data.Common.DbDataReader" /> and optionally releases the unmanaged resources.
    /// </summary>
    /// <param name="disposing"><see langword="true" /> to release managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing)
        {
            _reader.Close();
            _reader.Dispose();
            _reader = DisposedReader.Instance; // all future ops are no-ops
            _cmd?.Dispose();
            _cmd = null;
        }
    }

    /// <summary>
    /// Gets the number of columns in the current row.
    /// </summary>
    /// <value>The field count.</value>
    public override int FieldCount => _reader.FieldCount;

    /// <summary>
    /// Gets the value of the specified column as a Boolean.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The value of the column.</returns>
    public override bool GetBoolean(int i) => _reader.GetBoolean(i);

    /// <summary>
    /// Gets the 8-bit unsigned integer value of the specified column.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The 8-bit unsigned integer value of the specified column.</returns>
    public override byte GetByte(int i) => _reader.GetByte(i);

    /// <summary>
    /// Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <param name="fieldOffset">The index within the field from which to start the read operation.</param>
    /// <param name="buffer">The buffer into which to read the stream of bytes.</param>
    /// <param name="bufferoffset">The index for <paramref name="buffer" /> to start the read operation.</param>
    /// <param name="length">The number of bytes to read.</param>
    /// <returns>The actual number of bytes read.</returns>
    public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) =>
        _reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length);

    /// <summary>
    /// Gets the character value of the specified column.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The character value of the specified column.</returns>
    public override char GetChar(int i) => _reader.GetChar(i);

    /// <summary>
    /// Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <param name="fieldoffset">The index within the row from which to start the read operation.</param>
    /// <param name="buffer">The buffer into which to read the stream of bytes.</param>
    /// <param name="bufferoffset">The index for <paramref name="buffer" /> to start the read operation.</param>
    /// <param name="length">The number of bytes to read.</param>
    /// <returns>The actual number of characters read.</returns>
    public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) =>
        _reader.GetChars(i, fieldoffset, buffer, bufferoffset, length);

    /// <summary>
    /// Gets the data type information for the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The data type information for the specified field.</returns>
    public override string GetDataTypeName(int i) => _reader.GetDataTypeName(i);

    /// <summary>
    /// Gets the date and time data value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The date and time data value of the specified field.</returns>
    public override DateTime GetDateTime(int i) => _reader.GetDateTime(i);

    /// <summary>
    /// Gets the fixed-position numeric value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The fixed-position numeric value of the specified field.</returns>
    public override decimal GetDecimal(int i) => _reader.GetDecimal(i);

    /// <summary>
    /// Gets the double-precision floating point number of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The double-precision floating point number of the specified field.</returns>
    public override double GetDouble(int i) => _reader.GetDouble(i);

    /// <summary>
    /// Gets the <see cref="T:System.Type" /> information corresponding to the type of <see cref="T:System.Object" /> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)" />.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The <see cref="T:System.Type" /> information corresponding to the type of <see cref="T:System.Object" /> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)" />.</returns>
    public override Type GetFieldType(int i) => _reader.GetFieldType(i);

    /// <summary>
    /// Gets the single-precision floating point number of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The single-precision floating point number of the specified field.</returns>
    public override float GetFloat(int i) => _reader.GetFloat(i);

    /// <summary>
    /// Returns the GUID value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The GUID value of the specified field.</returns>
    public override Guid GetGuid(int i) => _reader.GetGuid(i);

    /// <summary>
    /// Gets the 16-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 16-bit signed integer value of the specified field.</returns>
    public override short GetInt16(int i) => _reader.GetInt16(i);

    /// <summary>
    /// Gets the 32-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 32-bit signed integer value of the specified field.</returns>
    public override int GetInt32(int i) => _reader.GetInt32(i);

    /// <summary>
    /// Gets the 64-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 64-bit signed integer value of the specified field.</returns>
    public override long GetInt64(int i) => _reader.GetInt64(i);

    /// <summary>
    /// Gets the name for the field to find.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The name of the field or the empty string (""), if there is no value to return.</returns>
    public override string GetName(int i) => _reader.GetName(i);

    /// <summary>
    /// Gets the column ordinal given the name of the column.
    /// </summary>
    /// <param name="name">The name of the column.</param>
    /// <returns>The zero-based column ordinal.</returns>
    public override int GetOrdinal(string name) => _reader.GetOrdinal(name);

    /// <summary>
    /// Gets the string value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The string value of the specified field.</returns>
    public override string GetString(int i) => _reader.GetString(i);

    /// <summary>
    /// Return the value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The <see cref="T:System.Object" /> which will contain the field value upon return.</returns>
    public override object GetValue(int i) => _reader.GetValue(i);

    /// <summary>
    /// Populates an array of objects with the column values of the current row.
    /// </summary>
    /// <param name="values">An array of <see cref="T:System.Object" /> into which to copy the attribute columns.</param>
    /// <returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns>
    public override int GetValues(object[] values) => _reader.GetValues(values);

    /// <summary>
    /// Return whether the specified field is set to null.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns><see langword="true" /> if the specified field is set to null; otherwise, <see langword="false" />.</returns>
    public override bool IsDBNull(int i) => _reader.IsDBNull(i);

    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified name.
    /// </summary>
    /// <param name="name">The name.</param>
    /// <returns>System.Object.</returns>
    public override object this[string name] => _reader[name];

    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified i.
    /// </summary>
    /// <param name="i">The i.</param>
    /// <returns>System.Object.</returns>
    public override object this[int i] => _reader[i];

    /// <summary>
    /// Synchronously gets the value of the specified column as a type.
    /// </summary>
    /// <typeparam name="T">Synchronously gets the value of the specified column as a type.</typeparam>
    /// <param name="ordinal">The column to be retrieved.</param>
    /// <returns>The column to be retrieved.</returns>
    public override T GetFieldValue<T>(int ordinal) => _reader.GetFieldValue<T>(ordinal);
    /// <summary>
    /// Asynchronously gets the value of the specified column as a type.
    /// </summary>
    /// <typeparam name="T">The type of the value to be returned.</typeparam>
    /// <param name="ordinal">The type of the value to be returned.</param>
    /// <param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:System.Data.Common.DbDataReader.GetFieldValueAsync``1(System.Int32)" />. The returned task must be marked as cancelled.</param>
    /// <returns>The type of the value to be returned.</returns>
    public override Task<T> GetFieldValueAsync<T>(int ordinal, CancellationToken cancellationToken) => _reader.GetFieldValueAsync<T>(ordinal, cancellationToken);
    /// <summary>
    /// Returns an <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the rows in the data reader.
    /// </summary>
    /// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the rows in the data reader.</returns>
    public override IEnumerator GetEnumerator() => _reader.GetEnumerator();
    /// <summary>
    /// Returns the provider-specific field type of the specified column.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The <see cref="T:System.Type" /> object that describes the data type of the specified column.</returns>
    public override Type GetProviderSpecificFieldType(int ordinal) => _reader.GetProviderSpecificFieldType(ordinal);
    /// <summary>
    /// Gets the value of the specified column as an instance of <see cref="T:System.Object" />.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>The value of the specified column.</returns>
    public override object GetProviderSpecificValue(int ordinal) => _reader.GetProviderSpecificValue(ordinal);
    /// <summary>
    /// Gets all provider-specific attribute columns in the collection for the current row.
    /// </summary>
    /// <param name="values">An array of <see cref="T:System.Object" /> into which to copy the attribute columns.</param>
    /// <returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns>
    public override int GetProviderSpecificValues(object[] values) => _reader.GetProviderSpecificValues(values);
    /// <summary>
    /// Retrieves data as a <see cref="T:System.IO.Stream" />.
    /// </summary>
    /// <param name="ordinal">Retrieves data as a <see cref="T:System.IO.Stream" />.</param>
    /// <returns>The returned object.</returns>
    public override Stream GetStream(int ordinal) => _reader.GetStream(ordinal);
    /// <summary>
    /// Retrieves data as a <see cref="T:System.IO.TextReader" />.
    /// </summary>
    /// <param name="ordinal">Retrieves data as a <see cref="T:System.IO.TextReader" />.</param>
    /// <returns>The returned object.</returns>
    public override TextReader GetTextReader(int ordinal) => _reader.GetTextReader(ordinal);
    /// <summary>
    /// An asynchronous version of <see cref="M:System.Data.Common.DbDataReader.IsDBNull(System.Int32)" />, which gets a value that indicates whether the column contains non-existent or missing values. Optionally, sends a notification that operations should be cancelled.
    /// </summary>
    /// <param name="ordinal">The zero-based column to be retrieved.</param>
    /// <param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:System.Data.Common.DbDataReader.IsDBNullAsync(System.Int32)" />. The returned task must be marked as cancelled.</param>
    /// <returns><see langword="true" /> if the specified column value is equivalent to <see langword="DBNull" /> otherwise <see langword="false" />.</returns>
    public override Task<bool> IsDBNullAsync(int ordinal, CancellationToken cancellationToken) => _reader.IsDBNullAsync(ordinal, cancellationToken);
    /// <summary>
    /// This is the asynchronous version of <see cref="M:System.Data.Common.DbDataReader.NextResult" />. Providers should override with an appropriate implementation. The <paramref name="cancellationToken" /> may optionally be ignored.
    /// The default implementation invokes the synchronous <see cref="M:System.Data.Common.DbDataReader.NextResult" /> method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled <paramref name="cancellationToken" />. Exceptions thrown by <see cref="M:System.Data.Common.DbDataReader.NextResult" /> will be communicated via the returned Task Exception property.
    /// Other methods and properties of the DbDataReader object should not be invoked while the returned Task is not yet completed.
    /// </summary>
    /// <param name="cancellationToken">The cancellation instruction.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    public override Task<bool> NextResultAsync(CancellationToken cancellationToken) => _reader.NextResultAsync(cancellationToken);
    /// <summary>
    /// This is the asynchronous version of <see cref="M:System.Data.Common.DbDataReader.Read" />.  Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored.
    /// The default implementation invokes the synchronous <see cref="M:System.Data.Common.DbDataReader.Read" /> method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken.  Exceptions thrown by Read will be communicated via the returned Task Exception property.
    /// Do not invoke other methods and properties of the <see langword="DbDataReader" /> object until the returned Task is complete.
    /// </summary>
    /// <param name="cancellationToken">The cancellation instruction.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    public override Task<bool> ReadAsync(CancellationToken cancellationToken) => _reader.ReadAsync(cancellationToken);
    /// <summary>
    /// Gets the number of fields in the <see cref="T:System.Data.Common.DbDataReader" /> that are not hidden.
    /// </summary>
    /// <value>The visible field count.</value>
    public override int VisibleFieldCount => _reader.VisibleFieldCount;
    /// <summary>
    /// Returns a <see cref="T:System.Data.Common.DbDataReader" /> object for the requested column ordinal that can be overridden with a provider-specific implementation.
    /// </summary>
    /// <param name="ordinal">The zero-based column ordinal.</param>
    /// <returns>A <see cref="T:System.Data.Common.DbDataReader" /> object.</returns>
    /// <exception cref="System.NotSupportedException"></exception>
    protected override DbDataReader GetDbDataReader(int ordinal) => ((IDataReader)_reader).GetData(ordinal) as DbDataReader ?? throw new NotSupportedException();
}

/// <summary>
/// Class BasicWrappedReader.
/// Implements the <see cref="ServiceStack.OrmLite.Dapper.IWrappedDataReader" />
/// </summary>
/// <seealso cref="ServiceStack.OrmLite.Dapper.IWrappedDataReader" />
internal class BasicWrappedReader : IWrappedDataReader
{
    /// <summary>
    /// The reader
    /// </summary>
    private IDataReader _reader;
    /// <summary>
    /// The command
    /// </summary>
    private IDbCommand _cmd;

    /// <summary>
    /// Obtain the underlying reader
    /// </summary>
    /// <value>The reader.</value>
    IDataReader IWrappedDataReader.Reader => _reader;

    /// <summary>
    /// Obtain the underlying command
    /// </summary>
    /// <value>The command.</value>
    IDbCommand IWrappedDataReader.Command => _cmd;

    /// <summary>
    /// Initializes a new instance of the <see cref="BasicWrappedReader"/> class.
    /// </summary>
    /// <param name="cmd">The command.</param>
    /// <param name="reader">The reader.</param>
    public BasicWrappedReader(IDbCommand cmd, IDataReader reader)
    {
        _cmd = cmd;
        _reader = reader;
    }

    /// <summary>
    /// Closes the <see cref="T:System.Data.IDataReader" /> Object.
    /// </summary>
    void IDataReader.Close() => _reader.Close();

    /// <summary>
    /// Gets a value indicating the depth of nesting for the current row.
    /// </summary>
    /// <value>The depth.</value>
    int IDataReader.Depth => _reader.Depth;

    /// <summary>
    /// Returns a <see cref="T:System.Data.DataTable" /> that describes the column metadata of the <see cref="T:System.Data.IDataReader" />.
    /// </summary>
    /// <returns>A <see cref="T:System.Data.DataTable" /> that describes the column metadata.</returns>
    DataTable IDataReader.GetSchemaTable() => _reader.GetSchemaTable();

    /// <summary>
    /// Gets a value indicating whether the data reader is closed.
    /// </summary>
    /// <value><c>true</c> if this instance is closed; otherwise, <c>false</c>.</value>
    bool IDataReader.IsClosed => _reader.IsClosed;

    /// <summary>
    /// Advances the data reader to the next result, when reading the results of batch SQL statements.
    /// </summary>
    /// <returns><see langword="true" /> if there are more rows; otherwise, <see langword="false" />.</returns>
    bool IDataReader.NextResult() => _reader.NextResult();

    /// <summary>
    /// Advances the <see cref="T:System.Data.IDataReader" /> to the next record.
    /// </summary>
    /// <returns><see langword="true" /> if there are more rows; otherwise, <see langword="false" />.</returns>
    bool IDataReader.Read() => _reader.Read();

    /// <summary>
    /// Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
    /// </summary>
    /// <value>The records affected.</value>
    int IDataReader.RecordsAffected => _reader.RecordsAffected;

    /// <summary>
    /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
    /// </summary>
    void IDisposable.Dispose()
    {
        _reader.Close();
        _reader.Dispose();
        _reader = DisposedReader.Instance;
        _cmd?.Dispose();
        _cmd = null;
    }

    /// <summary>
    /// Gets the number of columns in the current row.
    /// </summary>
    /// <value>The field count.</value>
    int IDataRecord.FieldCount => _reader.FieldCount;

    /// <summary>
    /// Gets the value of the specified column as a Boolean.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The value of the column.</returns>
    bool IDataRecord.GetBoolean(int i) => _reader.GetBoolean(i);

    /// <summary>
    /// Gets the 8-bit unsigned integer value of the specified column.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The 8-bit unsigned integer value of the specified column.</returns>
    byte IDataRecord.GetByte(int i) => _reader.GetByte(i);

    /// <summary>
    /// Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <param name="fieldOffset">The index within the field from which to start the read operation.</param>
    /// <param name="buffer">The buffer into which to read the stream of bytes.</param>
    /// <param name="bufferoffset">The index for <paramref name="buffer" /> to start the read operation.</param>
    /// <param name="length">The number of bytes to read.</param>
    /// <returns>The actual number of bytes read.</returns>
    long IDataRecord.GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) =>
        _reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length);

    /// <summary>
    /// Gets the character value of the specified column.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <returns>The character value of the specified column.</returns>
    char IDataRecord.GetChar(int i) => _reader.GetChar(i);

    /// <summary>
    /// Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <param name="i">The zero-based column ordinal.</param>
    /// <param name="fieldoffset">The index within the row from which to start the read operation.</param>
    /// <param name="buffer">The buffer into which to read the stream of bytes.</param>
    /// <param name="bufferoffset">The index for <paramref name="buffer" /> to start the read operation.</param>
    /// <param name="length">The number of bytes to read.</param>
    /// <returns>The actual number of characters read.</returns>
    long IDataRecord.GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) =>
        _reader.GetChars(i, fieldoffset, buffer, bufferoffset, length);

    /// <summary>
    /// Returns an <see cref="T:System.Data.IDataReader" /> for the specified column ordinal.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The <see cref="T:System.Data.IDataReader" /> for the specified column ordinal.</returns>
    IDataReader IDataRecord.GetData(int i) => _reader.GetData(i);

    /// <summary>
    /// Gets the data type information for the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The data type information for the specified field.</returns>
    string IDataRecord.GetDataTypeName(int i) => _reader.GetDataTypeName(i);

    /// <summary>
    /// Gets the date and time data value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The date and time data value of the specified field.</returns>
    DateTime IDataRecord.GetDateTime(int i) => _reader.GetDateTime(i);

    /// <summary>
    /// Gets the fixed-position numeric value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The fixed-position numeric value of the specified field.</returns>
    decimal IDataRecord.GetDecimal(int i) => _reader.GetDecimal(i);

    /// <summary>
    /// Gets the double-precision floating point number of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The double-precision floating point number of the specified field.</returns>
    double IDataRecord.GetDouble(int i) => _reader.GetDouble(i);

    /// <summary>
    /// Gets the <see cref="T:System.Type" /> information corresponding to the type of <see cref="T:System.Object" /> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)" />.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The <see cref="T:System.Type" /> information corresponding to the type of <see cref="T:System.Object" /> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)" />.</returns>
    Type IDataRecord.GetFieldType(int i) => _reader.GetFieldType(i);

    /// <summary>
    /// Gets the single-precision floating point number of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The single-precision floating point number of the specified field.</returns>
    float IDataRecord.GetFloat(int i) => _reader.GetFloat(i);

    /// <summary>
    /// Returns the GUID value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The GUID value of the specified field.</returns>
    Guid IDataRecord.GetGuid(int i) => _reader.GetGuid(i);

    /// <summary>
    /// Gets the 16-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 16-bit signed integer value of the specified field.</returns>
    short IDataRecord.GetInt16(int i) => _reader.GetInt16(i);

    /// <summary>
    /// Gets the 32-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 32-bit signed integer value of the specified field.</returns>
    int IDataRecord.GetInt32(int i) => _reader.GetInt32(i);

    /// <summary>
    /// Gets the 64-bit signed integer value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The 64-bit signed integer value of the specified field.</returns>
    long IDataRecord.GetInt64(int i) => _reader.GetInt64(i);

    /// <summary>
    /// Gets the name for the field to find.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The name of the field or the empty string (""), if there is no value to return.</returns>
    string IDataRecord.GetName(int i) => _reader.GetName(i);

    /// <summary>
    /// Return the index of the named field.
    /// </summary>
    /// <param name="name">The name of the field to find.</param>
    /// <returns>The index of the named field.</returns>
    int IDataRecord.GetOrdinal(string name) => _reader.GetOrdinal(name);

    /// <summary>
    /// Gets the string value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The string value of the specified field.</returns>
    string IDataRecord.GetString(int i) => _reader.GetString(i);

    /// <summary>
    /// Return the value of the specified field.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns>The <see cref="T:System.Object" /> which will contain the field value upon return.</returns>
    object IDataRecord.GetValue(int i) => _reader.GetValue(i);

    /// <summary>
    /// Populates an array of objects with the column values of the current record.
    /// </summary>
    /// <param name="values">An array of <see cref="T:System.Object" /> to copy the attribute fields into.</param>
    /// <returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns>
    int IDataRecord.GetValues(object[] values) => _reader.GetValues(values);

    /// <summary>
    /// Return whether the specified field is set to null.
    /// </summary>
    /// <param name="i">The index of the field to find.</param>
    /// <returns><see langword="true" /> if the specified field is set to null; otherwise, <see langword="false" />.</returns>
    bool IDataRecord.IsDBNull(int i) => _reader.IsDBNull(i);

    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified name.
    /// </summary>
    /// <param name="name">The name.</param>
    /// <returns>System.Object.</returns>
    object IDataRecord.this[string name] => _reader[name];

    /// <summary>
    /// Gets the <see cref="System.Object"/> with the specified i.
    /// </summary>
    /// <param name="i">The i.</param>
    /// <returns>System.Object.</returns>
    object IDataRecord.this[int i] => _reader[i];
}


text:
from warcio.archiveiterator import ArchiveIterator
from warcio.exceptions import ArchiveLoadFailed

from warcio.warcwriter import WARCWriter
from warcio.bufferedreaders import DecompressingBufferedReader

import tempfile
import shutil
import traceback
import sys

# ============================================================================
class Recompressor(object):
    def __init__(self, filename, output, verbose=False):
        self.filename = filename
        self.output = output
        self.verbose = verbose

    def recompress(self):
        from warcio.cli import main
        try:
            count = 0
            msg = ''
            with open(self.filename, 'rb') as stream:
                try:
                    count = self.load_and_write(stream, self.output)
                    msg = 'No Errors Found!'
                except Exception as e:
                    if self.verbose:
                        print('Parsing Error(s) Found:')
                        print(str(e) if isinstance(e, ArchiveLoadFailed) else repr(e))
                        print()

                    count = self.decompress_and_recompress(stream, self.output)
                    msg = 'Compression Errors Found and Fixed!'

                if self.verbose:
                    print('Records successfully read and compressed:')
                    main(['index', self.output])
                    print('')

                print('{0} records read and recompressed to file: {1}'.format(count, self.output))
                print(msg)

        except:
            if self.verbose:
                print('Exception Details:')
                traceback.print_exc()
                print('')

            print('Recompress Failed: {0} could not be read as a WARC or ARC'.format(self.filename))
            sys.exit(1)

    def load_and_write(self, stream, output):
        count = 0
        with open(output, 'wb') as out:
            writer = WARCWriter(filebuf=out, gzip=True)

            for record in ArchiveIterator(stream,
                                          no_record_parse=False,
                                          arc2warc=True,
                                          verify_http=False):

                writer.write_record(record)
                count += 1

            return count

    def decompress_and_recompress(self, stream, output):
        with tempfile.TemporaryFile() as tout:
            decomp = DecompressingBufferedReader(stream, read_all_members=True)

            # decompress entire file to temp file
            stream.seek(0)
            shutil.copyfileobj(decomp, tout)

            # attempt to compress and write temp
            tout.seek(0)
            return self.load_and_write(tout, output)


text:
{% extends "base.html" %}

{% block content %}
{% load staticfiles %}
{% load i18n %}
    {# Translators: Home Page Copy #}
    {% blocktrans %}

This is the home page

        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
        Nihil eveniet quasi quas tempora natus quis magnam velit accusantium cumque!
        Adipisci dolores consequuntur nobis provident vitae quos rerum id, laudantium asperiores.

    {% endblocktrans %}
{% endblock content %}


text:
exports.name = 'rimraf';
exports.category = 'filesystem';
exports.homepage = 'https://npmjs.org/package/rimraf';


text:
#ifndef  DRIVERS_FUSB_DEF_H
#define  DRIVERS_FUSB_DEF_H

#ifdef __cplusplus
extern "C"
{
#endif

/***************************** Include Files *********************************/

#include "ftypes.h"

/************************** Constant Definitions *****************************/
typedef enum
{
    FUSB_UNKNOWN_SPEED = -1,
    FUSB_FULL_SPEED = 0,
    FUSB_LOW_SPEED = 1,
    FUSB_HIGH_SPEED = 2,
    FUSB_SUPER_SPEED = 3,
    FUSB_SUPER_SPEED_PLUS = 4,
} FUsbSpeed;

typedef enum
{
    FUSB_REQ_HOST_TO_DEVICE = 0,
    FUSB_REQ_DEVICE_TO_HOST = 1
} FUsbReqDirection;

typedef enum
{
    FUSB_REQ_TYPE_STANDARD = 0,
    FUSB_REQ_TYPE_CLASS = 1,
    FUSB_REQ_TYPE_VENDOR = 2,
    FUSB_REQ_TYPE_RESERVED = 3
} FUsbReqType;

typedef enum
{
    FUSB_REQ_RECP_DEV = 0,
    FUSB_REQ_RECP_IF = 1,
    FUSB_REQ_RECP_EP = 2,
    FUSB_REQ_RECP_OTHER = 3
} FUsbReqRecpient;

/* refer to Table 9-5. Descriptor Types in USB spec. for details */
typedef enum
{
    FUSB_DESC_TYPE_NONE = 0,
    FUSB_DESC_TYPE_DEVICE = 1,
    FUSB_DESC_TYPE_CONFIG = 2,
    FUSB_DESC_TYPE_STRING = 3,
    FUSB_DESC_TYPE_INTERFACE = 4,
    FUSB_DESC_TYPE_ENDPOINT = 5,
    FUSB_DESC_TYPE_HUB = 41,
    FUSB_DESC_TYPE_SUPER_SPEED_HUB = 42
} FUsbDescriptorType;

typedef enum
{
    FUSB_GET_STATUS = 0,
    FUSB_CLEAR_FEATURE = 1,
    FUSB_SET_FEATURE = 3,
    FUSB_SET_ADDRESS = 5,
    FUSB_GET_DESCRIPTOR = 6,
    FUSB_SET_DESCRIPTOR = 7,
    FUSB_GET_CONFIGURATION = 8,
    FUSB_SET_CONFIGURATION = 9,
    FUSB_GET_INTERFACE = 10,
    FUSB_SET_INTERFACE = 11,
    FUSB_SYNCH_FRAME = 12
} FUsbRequestCode;

typedef enum
{
    FUSB_ENDPOINT_HALT = 0,
    FUSB_DEVICE_REMOTE_WAKEUP = 1,
    FUSB_TEST_MODE = 2
} FUsbFeatureSelectors;

typedef enum
{
    FUSB_SETUP,
    FUSB_IN,
    FUSB_OUT
} FUsbDirection;

typedef enum
{
    FUSB_CONTROL_EP = 0,
    FUSB_ISOCHRONOUS_EP = 1,
    FUSB_BULK_EP = 2,
    FUSB_INTERRUPT_EP = 3
} FUsbEpType;

typedef enum
{
    FUSB_UNKOWN_DEVICE = 0x0,
    FUSB_AUDIO_DEVICE = 0x01,
    FUSB_COMM_DEVICE = 0x02,
    FUSB_HID_DEVICE = 0x03,
    FUSB_PHYSICAL_DEVICE = 0x05,
    FUSB_IMAGE_DEVICE = 0x06,
    FUSB_PRINTER_DEVICE = 0x07,
    FUSB_MASS_STORAGE_DEVICE = 0x08,
    FUSB_HUB_DEVICE = 0x09,
} FUsbDevClass; /* definition of device class */

/**************************** Type Definitions *******************************/

/* following data structure is defined according to spec. name their member
   may not compliant with code convention */
typedef struct
{
    unsigned char bDescLength;
    unsigned char bDescriptorType;
    unsigned char bNbrPorts; /*  Number of downstream facing ports supports */
    union
    {
        struct
        {
            unsigned long logicalPowerSwitchingMode: 2; /* BIT[1:0] */
            unsigned long isCompoundDevice: 1; /* BIT[2] */
            unsigned long overcurrentProtectionMode: 2; /* BIT[4:3] */
            unsigned long ttThinkTime: 2; /* BIT[6:5] */
            unsigned long arePortIndicatorsSupported: 1; /* BIT[7] */
            unsigned long: 8;
        } __attribute__((packed));
        unsigned short wHubCharacteristics;
    } __attribute__((packed));
    unsigned char bPowerOn2PwrGood; /* in 2 ms intervals */
    unsigned char bHubContrCurrent; /* max current requirements */
    char DeviceRemovable[]; /* indicates if a port has a removable device attached */
} __attribute__((packed)) FUsbHubDescriptor;

typedef struct
{
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned short bcdUSB;
    unsigned char bDeviceClass;
    unsigned char bDeviceSubClass;
    unsigned char bDeviceProtocol;
    unsigned char bMaxPacketSize0;
    unsigned short idVendor;
    unsigned short idProduct;
    unsigned short bcdDevice;
    unsigned char iManufacturer;
    unsigned char iProduct;
    unsigned char iSerialNumber;
    unsigned char bNumConfigurations;
} __attribute__((packed)) FUsbDeviceDescriptor;

typedef struct
{
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned short wTotalLength;
    unsigned char bNumInterfaces;
    unsigned char bConfigurationValue;
    unsigned char iConfiguration;
    unsigned char bmAttributes;
#define FUSB_CONFIG_DESC_ATTR_REMOTE_WEAKUP     BIT(5) /* 1: remote wakeup feature */
#define FUSB_CONFIG_DESC_ATTR_SELF_POWER        BIT(6) /* 1: self-powered 0: bus-powered */
#define FUSB_CONFIG_DESC_ATTR_USB1_COMPATIABLE  BIT(7) /* 1: compatibility with USB 1.0 */
    unsigned char bMaxPower;
    /* configuration descriptor may follow more buffers, need to allocate dynamic memory for all contents */
} __attribute__((packed)) FUsbConfigurationDescriptor;

typedef struct
{
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned char bInterfaceNumber;
    unsigned char bAlternateSetting;
    unsigned char bNumEndpoints;
    unsigned char bInterfaceClass;
    unsigned char bInterfaceSubClass;
    unsigned char bInterfaceProtocol;
    unsigned char iInterface;
} __attribute__((packed)) FUsbInterfaceDescriptor;

typedef struct
{
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned char bEndpointAddress;
    /* Low-speed devices can have a maximum of 3 endpoint, other devices can have 16 (0–15) */
#define FUSB_EP_DESC_EP_NUM(x)      (GENMASK(3, 0) & (x))   /* endpoint number */
#define FUSB_EP_DESC_EP_DIR_IN      BIT(7)                  /* direction, 0: OUT, 1: IN */
    unsigned char bmAttributes;
#define FUSB_EP_DESC_TRANS_TYPE(x)      (GENMASK(1, 0) & (x))
#define FUSB_EP_DESC_TRANS_CTRL     0b00    /* control */
#define FUSB_EP_DESC_TRANS_ISOC     0b01    /* isochronous */
#define FUSB_EP_DESC_TRANS_BULK     0b10    /* bulk */
#define FUSB_EP_DESC_TRANS_INTR     0b11    /* interrupt */
    unsigned short wMaxPacketSize;
#define FUSB_EP_DESC_MAX_PACKET_SZ      GENMASK(10, 0)
    unsigned char bInterval;
} __attribute__((packed)) FUsbEndpointDescriptor;

typedef union
{
    struct
    {
        u8  len;
        u8  type;
    } header;
#define FUSB_DESCRIPTOR_HEADER_SIZE     2
    FUsbConfigurationDescriptor configuration;
    FUsbInterfaceDescriptor     interface;
    FUsbEndpointDescriptor      endpoint;
} __attribute__((packed)) FUsbDescriptor;

typedef struct
{
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned short bcdHID;
    unsigned char bCountryCode;
    unsigned char bNumDescriptors;
    unsigned char bReportDescriptorType;
    unsigned short wReportDescriptorLength;
} __attribute__((packed)) FUsbHidDescriptor;

typedef struct
{
    u8  len;        /* Descriptor size in bytes (variable) */
    u8  type;       /* The constant String (0x03 DESCRIPTOR_STRING) */
    u16 string[0];  /* Unicode UTF- 16LE string */
} __attribute__((packed)) FUsbStringDescriptor;

typedef struct
{
    union
    {
        struct
        {
            FUsbReqRecpient req_recp: 5;
            FUsbReqType req_type: 2;
            FUsbReqDirection data_dir: 1;
        } __attribute__((packed));
        unsigned char bmRequestType;
    } __attribute__((packed));
    unsigned char bRequest;
    unsigned short wValue;
    unsigned short wIndex;
    unsigned short wLength;
} __attribute__((packed)) FUsbDevReq;

/************************** Variable Definitions *****************************/

/***************** Macros (Inline Functions) Definitions *********************/
#define FUSB_DEFAULT_LANG_ID                0x409 /* English */

/************************** Function Prototypes ******************************/

#ifdef __cplusplus
}
#endif

#endif


text:
package com.dekses.cassandra.lock;

/**
 * Generalized lock interface
 */
public interface Lock {

	/**
	 * Try to acquire lock lease
	 * @return True if acquired, False if not (lease taken already)
	 */
	boolean tryLock();

	/**
	 * Releases current lock lease
	 * @throws LockLeaseLostException Thrown in case lock lease lost by the owner
	 */
	void unlock() throws LockLeaseLostException;

	/**
	 * Updates current lock lease
	 * @throws LockLeaseLostException Thrown in case lock lease lost by the owner
	 */
	void keepAlive() throws LockLeaseLostException;

	/** @return Lock owner */
	String getOwner();

	/** @return Lock resource name */
	String getName();

	/** @return Lock TTL */
	int getTTL();
}


text:
package com.thoughtworks.go.helper;

import com.thoughtworks.go.config.Authorization;
import com.thoughtworks.go.config.CaseInsensitiveString;
import com.thoughtworks.go.config.PipelineTemplateConfig;
import com.thoughtworks.go.config.StageConfig;

public class PipelineTemplateConfigMother {
    public static PipelineTemplateConfig createTemplate(String templateName) {
        return createTemplate(templateName, StageConfigMother.custom("defaultStage", "defaultJob"));
    }

    public static PipelineTemplateConfig createTemplate(String templateName, Authorization authorization, StageConfig... stageConfigs) {
        return new PipelineTemplateConfig(new CaseInsensitiveString(templateName), authorization, stageConfigs);
    }

    public static PipelineTemplateConfig createTemplate(String templateName, StageConfig... stageConfigs) {
        return createTemplate(templateName, new Authorization(), stageConfigs);
    }

    public static PipelineTemplateConfig createTemplateWithParams(String templateName, String... paramNameAndValue) {
        PipelineTemplateConfig template = createTemplate(templateName);
        for (String nameAndValue : paramNameAndValue) {
            template.get(0).getJobs().get(0).addVariable(String.format("name-%s", nameAndValue), String.format("value-#{%s}", nameAndValue));
        }
        return template;
    }
}


text:
package android.support.v4.graphics.drawable;

import android.graphics.drawable.Drawable;

// Referenced classes of package android.support.v4.graphics.drawable:
//            DrawableWrapperHoneycomb

class DrawableCompatHoneycomb
{

    DrawableCompatHoneycomb()
    {
    }

    public static void jumpToCurrentState(Drawable drawable)
    {
        drawable.jumpToCurrentState();
    }

    public static Drawable wrapForTinting(Drawable drawable)
    {
        Object obj = drawable;
        if (!(drawable instanceof DrawableWrapperHoneycomb))
        {
            obj = new DrawableWrapperHoneycomb(drawable);
        }
        return ((Drawable) (obj));
    }
}


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "docgenerator.h"

#include "globalostream.h"

using std::endl;

void
DocGenerator::generate(const string &s)
{
  *sout << s ;
}

void
DocGenerator::generateln(const string &s)
{
  *sout << s << endl;
}

void
DocGenerator::generate_start_doc()
{
    bool docTitle = (title.size () > 0);
    bool inputFileName = (input_file_name.size () > 0);

    generate(
        docTemplate.output_begin(
            ( docTitle ? title :
                  ( inputFileName ? input_file_name : "source file" ) ),
            css_url,
            "GNU " PACKAGE " " + string((gen_source_highlight_version ? VERSION : "")) +
            "\nby Lorenzo Bettini\nhttp://www.lorenzobettini.it\nhttp://www.gnu.org/software/src-highlite",
            doc_header,
            doc_footer,
            doc_background
        )
    );
}

void
DocGenerator::generate_end_doc()
{
    generate(
        docTemplate.output_end(
            "",
            css_url,
            "\nby Lorenzo Bettini\nhttp://www.lorenzobettini.it\nhttp://www.gnu.org/software/src-highlite",
            doc_header,
            doc_footer,
            doc_background
        )
    );
}


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

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Uses of Class org.apache.lucene.spatial3d.geom.GeoBaseBBox (Lucene 6.0.1 API)</title>
<meta name="date" content="2016-05-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.lucene.spatial3d.geom.GeoBaseBBox

Packages that use GeoBaseBBox

Package
Description

org.apache.lucene.spatial3d.geom

Shapes implemented using 3D planar geometry.

Uses of GeoBaseBBox in org.apache.lucene.spatial3d.geom

Subclasses of GeoBaseBBox in org.apache.lucene.spatial3d.geom

Modifier and Type
Class and Description

class
GeoDegenerateHorizontalLine

Degenerate bounding box limited on two sides (left lon, right lon).

class
GeoDegenerateLatitudeZone

This GeoBBox represents an area rectangle of one specific latitude with
 no longitude bounds.

class
GeoDegenerateLongitudeSlice

Degenerate longitude slice.

class
GeoDegenerateVerticalLine

Degenerate bounding box limited on two sides (top lat, bottom lat).

class
GeoLatitudeZone

This GeoBBox represents an area rectangle limited only in latitude.

class
GeoLongitudeSlice

Bounding box limited on left and right.

class
GeoNorthLatitudeZone

This GeoBBox represents an area rectangle limited only in south latitude.

class
GeoNorthRectangle

Bounding box limited on three sides (bottom lat, left lon, right lon), including
 the north pole.

class
GeoRectangle

Bounding box limited on four sides (top lat, bottom lat, left lon, right lon).

class
GeoSouthLatitudeZone

This GeoBBox represents an area rectangle limited only in north latitude.

class
GeoSouthRectangle

Bounding box limited on three sides (top lat, left lon, right lon).

class
GeoWideDegenerateHorizontalLine

Degenerate bounding box wider than PI and limited on two sides (left lon, right lon).

class
GeoWideLongitudeSlice

Bounding box wider than PI but limited on left and right sides (
 left lon, right lon).

class
GeoWideNorthRectangle

Bounding box wider than PI but limited on three sides (
 bottom lat, left lon, right lon).

class
GeoWideRectangle

Bounding box wider than PI but limited on four sides (top lat,
 bottom lat, left lon, right lon).

class
GeoWideSouthRectangle

Bounding box wider than PI but limited on three sides (top lat,
 left lon, right lon).

class
GeoWorld

Bounding box including the entire world.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

          Copyright © 2000-2016 Apache Software Foundation.  All Rights Reserved.