text:
package mezz.jei.common.gui.elements;

import com.google.common.base.Preconditions;
import com.mojang.blaze3d.vertex.PoseStack;
import mezz.jei.api.gui.drawable.IDrawable;

/**
 * Draws an icon at a higher resolution than normal (determined by the scale parameter).
 */
public class HighResolutionDrawable implements IDrawable {
	private final IDrawable drawable;
	private final int scale;

	public HighResolutionDrawable(IDrawable drawable, int scale) {
		int width = drawable.getWidth();
		int height = drawable.getHeight();
		Preconditions.checkArgument(
			width % scale == 0,
			String.format("drawable width %s must be divisible by the scale %s", width, scale)
		);
		Preconditions.checkArgument(
			height % scale == 0,
			String.format("drawable height %s must be divisible by the scale %s", height, scale)
		);

		this.drawable = drawable;
		this.scale = scale;
	}

	@Override
	public int getWidth() {
		return drawable.getWidth() / scale;
	}

	@Override
	public int getHeight() {
		return drawable.getHeight() / scale;
	}

	@Override
	public void draw(PoseStack poseStack, int xOffset, int yOffset) {
		poseStack.pushPose();
		{
			poseStack.translate(xOffset, yOffset, 0);
			poseStack.scale(1 / (float) scale, 1 / (float) scale, 1);
			this.drawable.draw(poseStack);
		}
		poseStack.popPose();
	}

	@Override
	public void draw(PoseStack poseStack) {
		poseStack.pushPose();
		{
			poseStack.scale(1 / (float) scale, 1 / (float) scale, 1);
			this.drawable.draw(poseStack);
		}
		poseStack.popPose();
	}
}


text:
<#
    .SYNOPSIS
    Updates a building.

    .DESCRIPTION
    Updates a building.

    If the result returns null, try the parameter "-Verbose" to get more details.

    .EXAMPLE

    .LINK
    https://github.com/erwindevreugd/PSDataConduIT

    .EXTERNALHELP PSDataConduIT-help.xml
#>
function Set-Building {
    [CmdletBinding()]
    param
    (
        [Parameter(
            Position = 0,
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true,
            HelpMessage = 'The name of the server where the DataConduIT service is running or localhost')]
        [string]
        $Server = $Script:Server,

        [Parameter(
            Position = 1,
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true,
            HelpMessage = 'The credentials used to authenticate the user to the DataConduIT service')]
        [PSCredential]
        $Credential = $Script:Credential,

        [ValidateRange(1, 2147483647)]
        [Parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true,
            HelpMessage = 'Specifies the id of the building to update.')]
        [int]
        $BuildingID,

        [ValidateLength(1, 255)]
        [Parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true,
            HelpMessage = 'Specifies the new name of the building.')]
        [string]
        $Name
    )

    process {
        $query = "SELECT * FROM Lnl_Building WHERE __CLASS='Lnl_Building'"

        if ($BuildingID) {
            $query += " AND ID=$BuildingID"
        }

        LogQuery $query

        $parameters = @{
            ComputerName = $Server;
            Namespace    = $Script:OnGuardNamespace;
            Query        = $query
        }

        if ($Credential -ne $null) {
            $parameters.Add("Credential", $Credential)
        }

        if (($building = Get-WmiObject @parameters) -eq $null) {
            Write-Error -Message ("Building id '$($BuildingID)' not found")
            return
        }

        $updateSet = @{}

        if ($Name -and $Name -ne $building.Name) {
            Write-Verbose -Message ("Updating name '$($building.Name)' to '$($Name)' on building id '$($building.ID)'")
            $updateSet.Add("Name", $Name)
        }

        $badgeStatus | Set-WmiInstance -Arguments $updateSet |
            Select-Object *, @{L = 'BuildingID'; E = {$_.ID}} |
            Get-Building
    }
}

redpajama_set_name: RedPajamaGithub


text:
package dotty.tools.dotc
package transform

import core._
import Contexts._
import Decorators._
import tasty._
import config.Printers.{noPrinter, pickling}
import java.io.PrintStream
import Periods._
import Phases._
import Symbols._
import Flags.Module
import reporting.{ThrowingReporter, Profile, Message}
import collection.mutable
import scala.concurrent.{Future, Await, ExecutionContext}
import scala.concurrent.duration.Duration

object Pickler {
  val name: String = "pickler"
  val description: String = "generates TASTy info"

  /** If set, perform jump target compacting, position and comment pickling,
   *  as well as final assembly in parallel with downstream phases; force
   *  only in backend.
   */
  inline val ParallelPickling = true
}

/** This phase pickles trees */
class Pickler extends Phase {
  import ast.tpd._

  override def phaseName: String = Pickler.name

  override def description: String = Pickler.description

  // No need to repickle trees coming from TASTY
  override def isRunnable(using Context): Boolean =
    super.isRunnable && !ctx.settings.fromTasty.value

  private def output(name: String, msg: String) = {
    val s = new PrintStream(name)
    s.print(msg)
    s.close
  }

  // Maps that keep a record if -Ytest-pickler is set.
  private val beforePickling = new mutable.HashMap[ClassSymbol, String]
  private val picklers = new mutable.HashMap[ClassSymbol, TastyPickler]

  /** Drop any elements of this list that are linked module classes of other elements in the list */
  private def dropCompanionModuleClasses(clss: List[ClassSymbol])(using Context): List[ClassSymbol] = {
    val companionModuleClasses =
      clss.filterNot(_.is(Module)).map(_.linkedClass).filterNot(_.isAbsent())
    clss.filterNot(companionModuleClasses.contains)
  }

  override def run(using Context): Unit = {
    val unit = ctx.compilationUnit
    pickling.println(i"unpickling in run ${ctx.runId}")

    for
      cls <- dropCompanionModuleClasses(topLevelClasses(unit.tpdTree))
      tree <- sliceTopLevel(unit.tpdTree, cls)
    do
      val pickler = new TastyPickler(cls)
      if ctx.settings.YtestPickler.value then
        beforePickling(cls) = tree.show
        picklers(cls) = pickler
      val treePkl = new TreePickler(pickler)
      treePkl.pickle(tree :: Nil)
      Profile.current.recordTasty(treePkl.buf.length)
      val positionWarnings = new mutable.ListBuffer[Message]()
      val pickledF = inContext(ctx.fresh) {
        Future {
          treePkl.compactify()
          if tree.span.exists then
            val reference = ctx.settings.sourceroot.value
            new PositionPickler(pickler, treePkl.buf.addrOfTree, treePkl.treeAnnots, reference)
              .picklePositions(unit.source, tree :: Nil, positionWarnings)

          if !ctx.settings.YdropComments.value then
            new CommentPickler(pickler, treePkl.buf.addrOfTree, treePkl.docString)
              .pickleComment(tree)

          val pickled = pickler.assembleParts()

          def rawBytes = // not needed right now, but useful to print raw format.
            pickled.iterator.grouped(10).toList.zipWithIndex.map {
              case (row, i) => s"${i}0: ${row.mkString(" ")}"
            }

          // println(i"rawBytes = \n$rawBytes%\n%") // DEBUG
          if pickling ne noPrinter then
            pickling.synchronized {
              println(i"**** pickled info of $cls")
              println(TastyPrinter.showContents(pickled, ctx.settings.color.value == "never"))
            }
          pickled
        }(using ExecutionContext.global)
      }
      def force(): Array[Byte] =
        val result = Await.result(pickledF, Duration.Inf)
        positionWarnings.foreach(report.warning(_))
        result

      if !Pickler.ParallelPickling || ctx.settings.YtestPickler.value then force()

      unit.pickled += (cls -> force)
    end for
  }

  override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] = {
    val result = super.runOn(units)
    if ctx.settings.YtestPickler.value then
      val ctx2 = ctx.fresh.setSetting(ctx.settings.YreadComments, true)
      testUnpickler(
        using ctx2
            .setPeriod(Period(ctx.runId + 1, ctx.base.typerPhase.id))
            .setReporter(new ThrowingReporter(ctx.reporter))
            .addMode(Mode.ReadPositions)
            .addMode(Mode.PrintShowExceptions))
    result
  }

  private def testUnpickler(using Context): Unit = {
    pickling.println(i"testing unpickler at run ${ctx.runId}")
    ctx.initialize()
    val unpicklers =
      for ((cls, pickler) <- picklers) yield {
        val unpickler = new DottyUnpickler(pickler.assembleParts())
        unpickler.enter(roots = Set.empty)
        cls -> unpickler
      }
    pickling.println("************* entered toplevel ***********")
    for ((cls, unpickler) <- unpicklers) {
      val unpickled = unpickler.rootTrees
      testSame(i"$unpickled%\n%", beforePickling(cls), cls)
    }
  }

  private def testSame(unpickled: String, previous: String, cls: ClassSymbol)(using Context) =
    import java.nio.charset.StandardCharsets.UTF_8
    def normal(s: String) = new String(s.getBytes(UTF_8), UTF_8)
    val unequal = unpickled.length() != previous.length() || normal(unpickled) != normal(previous)
    if unequal then
      output("before-pickling.txt", previous)
      output("after-pickling.txt", unpickled)
      report.error(em"""pickling difference for $cls in ${cls.source}, for details:
                    |
                    |  diff before-pickling.txt after-pickling.txt""")
  end testSame
}


text:
package it.psd.thundernote.shared;

public class SharedConstants {
	public static String LOGGED_OUT = "logged out";
}


text:
package org.auraframework.test.root.event;

import org.auraframework.def.ComponentDef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.impl.AuraImplTestCase;
import org.auraframework.impl.expression.PropertyReferenceImpl;
import org.auraframework.impl.root.event.EventHandlerDefImpl;
import org.auraframework.impl.system.DefDescriptorImpl;
import org.auraframework.throwable.quickfix.DefinitionNotFoundException;
import org.auraframework.throwable.quickfix.InvalidDefinitionException;
import org.auraframework.throwable.quickfix.InvalidReferenceException;

/**
 * @hierarchy Aura.Unit Tests.Components.EventHandlerDef.Validation
 */
public class EventHandlerDefTest extends AuraImplTestCase {
    public EventHandlerDefTest(String name) {
        super(name);
    }

    public void testSerialize() throws Exception {
        EventHandlerDefImpl eventHandlerDef2 = vendor.makeEventHandlerDefWithNulls(
                vendor.makeEventDefDescriptor("auratest:testevent"), new PropertyReferenceImpl("c.foo", null),
                vendor.makeLocation("filename", 5, 5, 0));
        serializeAndGoldFile(eventHandlerDef2);
    }

    public void testHandlerWithNameAndEventAttribute() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithNameAndEvent", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidDefinitionException");
        } catch (InvalidDefinitionException e) {
            assertEquals("Incorrect exception message",
                    "aura:handler must specify one and only one of name=\"…\" or event=\"…\"", e.getMessage());
        }
    }

    public void testHandlerWithoutNameOrEventAttribute() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithoutNameOrEvent", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidDefinitionException");
        } catch (InvalidDefinitionException e) {
            assertEquals("Incorrect exception message",
                    "aura:handler must specify one and only one of name=\"…\" or event=\"…\"", e.getMessage());
        }
    }

    /**
     * A aura:handler for a component event with event attribute specified is invalid. Should be name attribute that is
     * specified.
     */
    public void testHandlerWithEventAttributeForComponentEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithEventForComponentEvent", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidReferenceException");
        } catch (InvalidReferenceException e) {
            assertEquals(
                    "Incorrect exception message",
                    "A aura:handler that specifies an event=\"\" attribute must handle an application event. Either change the aura:event to have type=\"APPLICATION\" or alternately change the aura:handler to specify a name=\"\" attribute.",
                    e.getMessage());
        }
    }

    /**
     * A aura:handler for an application event with name attribute specified is invalid. Should be event attribute that
     * is specified.
     */
    public void testHandlerWithNameAttributeForApplicationEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithNameForApplicationEvent", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidReferenceException");
        } catch (InvalidReferenceException e) {
            assertEquals(
                    "Incorrect exception message",
                    "A aura:handler that specifies a name=\"\" attribute must handle a component event. Either change the aura:event to have type=\"COMPONENT\" or alternately change the aura:handler to specify an event=\"\" attribute.",
                    e.getMessage());
        }
    }

    public void testHandlerWithInvalidNameAttributeForComponentEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithUnregisteredName", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidReferenceException");
        } catch (InvalidReferenceException e) {
            assertEquals("Incorrect exception message",
                    "aura:handler has invalid name attribute value: ThisIsNotARegisteredEventName", e.getMessage());
        }
    }

    public void testHandlerWithInvalidEventAttributeForApplicationEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = DefDescriptorImpl.getInstance(
                "handleEventTest:handlerWithInvalidEvent", ComponentDef.class);
        try {
            componentDefDescriptor.getDef();
            fail("Expected DefinitionNotFoundException");
        } catch (DefinitionNotFoundException e) {
            assertEquals(
                    "Incorrect exception message",
                    String.format("No EVENT named markup://ThisIsNotAValidEventName found : [%s]",
                            componentDefDescriptor.getQualifiedName()), e.getMessage());
        }
    }

    public void testHandlerWithEmptyNameAttributeForComponentEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = addSourceAutoCleanup(ComponentDef.class,
                "<aura:component><aura:handler name='' action='{!c.handleIt}'/></aura:component>");
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidReferenceException");
        } catch (InvalidReferenceException e) {
            assertEquals("Incorrect exception message", "aura:handler has invalid name attribute value: ",
                    e.getMessage());
        }
    }

    public void testHandlerWithEmptyEventAttributeForApplicationEvent() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = addSourceAutoCleanup(ComponentDef.class,
                "<aura:component><aura:handler event='' action='{!c.handleIt}'/></aura:component>");
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidDefinitionException");
        } catch (InvalidDefinitionException e) {
            assertEquals("Incorrect exception message",
                    "aura:handler must specify one and only one of name=\"…\" or event=\"…\"", e.getMessage());
        }
    }

    /**
     * An aura:handler for a component event with no action parameter declared.
     */
    public void testHandlerWithNoAction() throws Exception {
        DefDescriptor<ComponentDef> componentDefDescriptor = addSourceAutoCleanup(ComponentDef.class,
                "<aura:component><aura:registerevent name='somename' type='handleEventTest:event'/>"
                        + "<aura:handler name='somename' /></aura:component>");
        try {
            componentDefDescriptor.getDef();
            fail("Expected InvalidDefinitionException");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "aura:handler missing attribute: action=\"…\"",
                    componentDefDescriptor.getQualifiedName());
        }
    }

    public void testGetDescription() throws Exception {
        String cmpMarkup = "<aura:component >%s</aura:component>";
        String markup = String
                .format(cmpMarkup,
                        "<aura:handler event='aura:applicationEvent' description='Describe the event handler' action='{!c.dummy}'/>");
        DefDescriptor<ComponentDef> cmpDesc = addSourceAutoCleanup(ComponentDef.class, markup);
        assertEquals("Description of registerevent not processed", "Describe the event handler", cmpDesc.getDef()
                .getHandlerDefs().iterator().next().getDescription());
    }
}


text:
/* A small fake UDP-server.
 */
function MessageCollector(options) {
    this._packetsReceived = [];
    this._expectedPackets = [];
}

MessageCollector.prototype.addMessage = function (msg) {
    var that = this;
    msg.toString().split('\n').forEach(function (part) {
        that._packetsReceived.push(part);
    });
    this.checkMessages();
};

/* Expect `message` to arrive and call `cb` if/when it does.
 */
MessageCollector.prototype.expectMessage = function (message, cb) {
    var that = this;
    this._expectedPackets.push({
        message: message,
        callback: cb
    });
    process.nextTick(function () {
        that.checkMessages();
    });
};

/* Check for expected messages.
 */
MessageCollector.prototype.checkMessages = function () {
    var that = this;
    this._expectedPackets.forEach(function (details, detailIndex) {
        // Is it in there?
        var i = that._packetsReceived.indexOf(details.message);
        if (i !== -1) {
            // Remove message and the listener from their respective lists
            that._packetsReceived.splice(i, 1);
            that._expectedPackets.splice(detailIndex, 1);
            return details.callback();
        }
    });
};

module.exports = MessageCollector;


text:
<?php

namespace Krystal\Application;

final class Input implements InputInterface
{
    /**
     * Holds query data
     *
     * @var array
     */
    private $query = array();

    /**
     * Holds POST variables
     *
     * @var array
     */
    private $post = array();

    /**
     * Holds server information
     *
     * @var array
     */
    private $server = array();

    /**
     * Holds raw files container
     *
     * @var array
     */
    private $files = array();

    /**
     * Holds environment variables
     *
     * @var array
     */
    private $env = array();

    /**
     * Holds native $_REQUEST
     *
     * @var array
     */
    private $request = array();

    /**
     * Sets request array
     *
     * @param array $request
     * @return \Krystal\Application\Input
     */
    public function setRequest(array &$request)
    {
        $this->request =& $request;
        return $this;
    }

    /**
     * Returns request array
     *
     * @return array
     */
    public function &getRequest()
    {
        return $this->request;
    }

    /**
     * Sets query array
     *
     * @param array $query
     * @return \Krystal\Application\Input
     */
    public function setQuery(array &$query)
    {
        $this->query =& $query;
        return $this;
    }

    /**
     * Returns query array
     *
     * @return array
     */
    public function &getQuery()
    {
        return $this->query;
    }

    /**
     * Sets posts array
     *
     * @param array $post
     * @return \Krystal\Application\Input
     */
    public function setPost(array &$post)
    {
        $this->post =& $post;
        return $this;
    }

    /**
     * Returns post data
     *
     * @return array
     */
    public function &getPost()
    {
        return $this->post;
    }

    /**
     * Sets files
     *
     * @param array $files
     * @return \Krystal\Application\Input
     */
    public function setFiles(&$files)
    {
        $this->files =& $files;
        return $this;
    }

    /**
     * Returns files array
     *
     * @return array
     */
    public function &getFiles()
    {
        return $this->files;
    }

    /**
     * Sets server's array
     *
     * @param array $server
     * @return \Krystal\Application\Input
     */
    public function setServer(&$server)
    {
        $this->server =& $server;
        return $this;
    }

    /**
     * Returns server's array
     *
     * @return array
     */
    public function &getServer()
    {
        return $this->server;
    }

    /**
     * Sets environment array
     *
     * @param array $env
     * @return \Krystal\Application\Input
     */
    public function setEnv(array &$env)
    {
        $this->env =& $env;
        return $this;
    }

    /**
     * Returns environment array
     *
     * @return array
     */
    public function &getEnv()
    {
        return $this->env;
    }

    /**
     * Sets cookie array
     *
     * @param array $cookie
     * @return \Krystal\Application\Input
     */
    public function setCookie(array &$cookie)
    {
        $this->cookie =& $cookie;
        return $this;
    }

    /**
     * Returns cookie array
     *
     * @return array
     */
    public function &getCookie()
    {
        return $this->cookie;
    }
}


text:
require 'helper'

class ConnectionTest < Test::Unit::TestCase
  should "connect to the specified channel" do

  end
end


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>vue Autoscroll</title>

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

vue-autoscroll

v-autoscroll:noscroll="{{autoscroll}}"

v-autoscroll:noscroll="'{{autoscroll}}'"

                  <button class="btn btn-sm" @click="autoscrollTest('top')"></button>

                  <button class="btn btn-sm" @click="autoscrollTest('left')"></button>
                  <button class="btn btn-sm" @click="autoscrollTest('center')"></button>
                  <button class="btn btn-sm" @click="autoscrollTest('right')"></button>

                  <button class="btn btn-sm" @click="autoscrollTest('bottom')"></button>

                  <button class="btn" @click="autoscrollTest('top left')"></button>
                  <button class="btn" @click="autoscrollTest('top center')"></button>
                  <button class="btn" @click="autoscrollTest('top right')"></button>

                  <button class="btn" @click="autoscrollTest('left center')"></button>
                  <button class="btn" @click="autoscrollTest('center')"></button>
                  <button class="btn" @click="autoscrollTest('right center')"></button>

                  <button class="btn" @click="autoscrollTest('bottom left')"></button>
                  <button class="btn" @click="autoscrollTest('bottom center')"></button>
                  <button class="btn" @click="autoscrollTest('bottom right')"></button>

                  <select v-model="type" class="custom-select" id="inputGroupSelect01">
                    <option selected value="absolute">absolute</option>
                    <option value="relative">relative</option>
                  </select>

                <input v-model="x" type="text" aria-label="First name" class="form-control" placeholder="x">
                <input v-model="y" type="text" aria-label="Last name" class="form-control" placeholder="y">

                  <button @click="scroll()" class="btn btn-secondary" type="button" id="button-addon2">Scroll</button>

Tips :
 :noscroll argument will set overflow: hidden; to the element, you can use it to hide scrollbars

               View on Github (Documentation)

               CDN : https://unpkg.com/vue-autoscroll

               NPM : npm install --save vue-autoscroll


text:
require "thor"
require "open3"
require "fileutils"
require "yomou/bookshelf"

module Yomou
  module Command

    class Novel < Thor
      namespace :novel

      BASE_URL = "http://api.syosetu.com/novelapi/api/"

      include Yomou::Helper

      desc "get [SUBCOMMAND]", "Get novel data"
      option :ncode
      def get
        p options
        @conf = Yomou::Config.new
        p @conf.directory
        Dir.chdir(@conf.directory) do
          p options["ncode"]
          IO.popen(["narou", "download", options["ncode"]], "r+") do |io|
            io.puts
            io.close_write
            puts io.read
          end
        end
      end

      desc "download [SUBCOMMAND]", "Download novel data"
      option :ncode
      def download(*ncodes)
        @conf = Yomou::Config.new
        downloader = Narou::Downloader.new
        bookshelf = Yomou::Bookshelf.new

        if ncodes.empty?
          novels = Groonga["NarouNovels"]
          records = novels.select("yomou_status:#{YOMOU_NOVEL_NONE}")
          ncodes = []
          records.each do |record|
            ncodes << record._key
          end
        end
        downloader.download(ncodes)
      end

      desc "genre", "Get metadata about genre code"
      option :download
      def genre(arg = nil)
        @conf = Yomou::Config.new
        url = BASE_URL + [
          "gzip=#{@conf.gzip}",
          "out=#{@conf.out}"
        ].join("&")
        codes = extract_codes_from_argument(arg)
        p codes

        downloader = Yomou::Narou::Downloader.new
        bookshelf = Yomou::Bookshelf.new

        codes.each do |code|
          [
            "favnovelcnt",
            "reviewcnt",
            "hyoka",
            "impressioncnt",
            "hyokacnt"
          ].each do |order|
            first = true
            offset = 1
            limit = 500
            allcount = 10
            p code

            while offset < 2000

              of = "of=n-u-g-f-r-a-ah-sa-ka"
              url = sprintf("%s?genre=%d&gzip=%d&out=%s&lim=%d&st=%d&%s&order=%s",
                            BASE_URL, code, @conf.gzip, @conf.out, limit, offset, of, order)
              path = pathname_expanded([@conf.directory,
                                         "novelapi",
                                         "genre_#{code}_#{order}_#{offset}-.yaml.xz"])
              p url
              p path
              save_as(url, path)
              yaml = yaml_xz(path.to_s)
              if first
                allcount = yaml.first["allcount"]
              end
              p allcount
              #pp yaml
              ncodes = yaml[1..-1].collect do |entry|
                entry["ncode"]
              end
              if options["download"]
                downloader.download(ncodes)
              else
                bookshelf.register_ncode(ncodes)
              end
              offset += 500
            end
          end
        end
      end

      desc "keyword", ""
      def keyword(arg)
        case arg
        when "list"
          keywordlist
        end
      end

      desc "keywordlist", ""
      option :download
      option :verbose
      option :nth
      def keywordlist
        @conf = Yomou::Config.new

        @agent = Yomou::Keyword::KeywordList.new
        @agent.download

        if @agent.keywords.empty?
          p "no keywords"
          return
        end

        downloader = Narou::Downloader.new
        bookshelf = Yomou::Bookshelf.new

        @agent.load_keywords.each do |word,index|
          p word
          p index
          @agent.novels_with_keyword(word)
        end
      end

      desc "nopointlist [--download|--makecache]", ""
      option :download
      option :makecache
      def nopointlist
        @conf = Yomou::Config.new

        downloader = Narou::Downloader.new
        bookshelf = Yomou::Bookshelf.new
        nopointlist = Yomou::Novelapi::NoPointList.new

        nopointlist.conf = @conf
        nopointlist.bookshelf = bookshelf
        nopointlist.downloader = downloader

        if options[:download]
          parameters = {
            :min_page => 1,
          }
          nopointlist.download(parameters)
        end
        if options[:makecache]
          nopointlist.makecache
        end
      end

      desc "noimpressionlist [--download|--makecache]", ""
      option :download
      option :makecache
      def noimpressionlist
        @conf = Yomou::Config.new

        noimpressionlist = Yomou::Novelapi::NoImpressionList.new

        no_common_action(noimpressionlist, options)
      end

      private

      def no_common_action(object, options)
        object.conf = @conf
        downloader = Narou::Downloader.new
        bookshelf = Yomou::Bookshelf.new
        object.bookshelf = bookshelf
        object.downloader = downloader

        if options[:download]
          parameters = {
            :min_page => 1,
          }
          object.download(parameters)
        end
        if options[:makecache]
          object.makecache
        end
      end

      def load_keywords_yaml(path, keywords)
        assoc = {}
        if path.exist?
          assoc = yaml_xz(path.to_s)
        else
          keywords.each_with_index do |keyword, index|
            page = 1
            while page <= 100 do
              filename = "#{URI.escape(keyword)}_hyoka_#{page}.html.xz"
              path = pathname_expanded([@conf.directory,
                                         "keyword",
                                         URI.escape(keyword),
                                         filename])
              if path.exist?
                ncodes = extract_ncode_from_each_page_with_keyword(path)
                if assoc[keyword]
                  assoc[keyword].concat(ncodes)
                else
                  assoc[keyword] = ncodes
                end
              end
              page = page + 1
            end
          end
        end
        assoc
      end

    end
  end
end


text:
namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision
{
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for ComputerVisionAPI.
    /// </summary>
    public static partial class ComputerVisionAPIExtensions
    {
            /// <summary>
            /// This operation returns the list of domain-specific models that are
            /// supported by the Computer Vision API.  Currently, the API only supports one
            /// domain-specific model: a celebrity recognizer. A successful response will
            /// be returned in JSON.  If the request failed, the response will contain an
            /// error code and a message to help understand what went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ListModelsResult> ListModelsAsync(this IComputerVisionAPI operations, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListModelsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation extracts a rich set of visual features based on the image
            /// content. Two input methods are supported -- (1) Uploading an image or (2)
            /// specifying an image URL.  Within your request, there is an optional
            /// parameter to allow you to choose which features to return.  By default,
            /// image categories are returned in the response.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='visualFeatures'>
            /// A string indicating what visual feature types to return. Multiple values
            /// should be comma-separated. Valid visual feature types include:Categories -
            /// categorizes image content according to a taxonomy defined in documentation.
            /// Tags - tags the image with a detailed list of words related to the image
            /// content. Description - describes the image content with a complete English
            /// sentence. Faces - detects if faces are present. If present, generate
            /// coordinates, gender and age. ImageType - detects if image is clipart or a
            /// line drawing. Color - determines the accent color, dominant color, and
            /// whether an image is black&white.Adult - detects if the image is
            /// pornographic in nature (depicts nudity or a sex act).  Sexually suggestive
            /// content is also detected.
            /// </param>
            /// <param name='details'>
            /// A string indicating which domain-specific details to return. Multiple
            /// values should be comma-separated. Valid visual feature types
            /// include:Celebrities - identifies celebrities if detected in the image.
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ImageAnalysis> AnalyzeImageAsync(this IComputerVisionAPI operations, string url, IList<VisualFeatureTypes> visualFeatures = default(IList<VisualFeatureTypes>), IList<Details> details = default(IList<Details>), string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AnalyzeImageWithHttpMessagesAsync(url, visualFeatures, details, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a thumbnail image with the user-specified width
            /// and height. By default, the service analyzes the image, identifies the
            /// region of interest (ROI), and generates smart cropping coordinates based on
            /// the ROI. Smart cropping helps when you specify an aspect ratio that differs
            /// from that of the input image. A successful response contains the thumbnail
            /// image binary. If the request failed, the response contains an error code
            /// and a message to help determine what went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='width'>
            /// Width of the thumbnail. It must be between 1 and 1024. Recommended minimum
            /// of 50.
            /// </param>
            /// <param name='height'>
            /// Height of the thumbnail. It must be between 1 and 1024. Recommended minimum
            /// of 50.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='smartCropping'>
            /// Boolean flag for enabling smart cropping.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<Stream> GenerateThumbnailAsync(this IComputerVisionAPI operations, int width, int height, string url, bool? smartCropping = false, CancellationToken cancellationToken = default(CancellationToken))
            {
                var _result = await operations.GenerateThumbnailWithHttpMessagesAsync(width, height, url, smartCropping, null, cancellationToken).ConfigureAwait(false);
                _result.Request.Dispose();
                return _result.Body;
            }

            /// <summary>
            /// Optical Character Recognition (OCR) detects printed text in an image and
            /// extracts the recognized characters into a machine-usable character stream.
            /// Upon success, the OCR results will be returned. Upon failure, the error
            /// code together with an error message will be returned. The error code can be
            /// one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize,
            /// NotSupportedImage,  NotSupportedLanguage, or InternalServerError.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='detectOrientation'>
            /// Whether detect the text orientation in the image. With
            /// detectOrientation=true the OCR service tries to detect the image
            /// orientation and correct it before further processing (e.g. if it's
            /// upside-down).
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='language'>
            /// The BCP-47 language code of the text to be detected in the image. The
            /// default value is 'unk'. Possible values include: 'unk', 'zh-Hans',
            /// 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it',
            /// 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro',
            /// 'sr-Cyrl', 'sr-Latn', 'sk'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<OcrResult> RecognizePrintedTextAsync(this IComputerVisionAPI operations, bool detectOrientation, string url, OcrLanguages language = default(OcrLanguages), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.RecognizePrintedTextWithHttpMessagesAsync(detectOrientation, url, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a description of an image in human readable
            /// language with complete sentences.  The description is based on a collection
            /// of content tags, which are also returned by the operation. More than one
            /// description can be generated for each image.  Descriptions are ordered by
            /// their confidence score. All descriptions are in English. Two input methods
            /// are supported -- (1) Uploading an image or (2) specifying an image URL.A
            /// successful response will be returned in JSON.  If the request failed, the
            /// response will contain an error code and a message to help understand what
            /// went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='maxCandidates'>
            /// Maximum number of candidate descriptions to be returned.  The default is 1.
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ImageDescription> DescribeImageAsync(this IComputerVisionAPI operations, string url, string maxCandidates = "1", string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.DescribeImageWithHttpMessagesAsync(url, maxCandidates, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a list of words, or tags, that are relevant to the
            /// content of the supplied image. The Computer Vision API can return tags
            /// based on objects, living beings, scenery or actions found in images. Unlike
            /// categories, tags are not organized according to a hierarchical
            /// classification system, but correspond to image content. Tags may contain
            /// hints to avoid ambiguity or provide context, for example the tag 'cello'
            /// may be accompanied by the hint 'musical instrument'. All tags are in
            /// English.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<TagResult> TagImageAsync(this IComputerVisionAPI operations, string url, string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.TagImageWithHttpMessagesAsync(url, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation recognizes content within an image by applying a
            /// domain-specific model.  The list of domain-specific models that are
            /// supported by the Computer Vision API can be retrieved using the /models GET
            /// request.  Currently, the API only provides a single domain-specific model:
            /// celebrities. Two input methods are supported -- (1) Uploading an image or
            /// (2) specifying an image URL. A successful response will be returned in
            /// JSON.  If the request failed, the response will contain an error code and a
            /// message to help understand what went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='model'>
            /// The domain-specific content to recognize.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<DomainModelResults> AnalyzeImageByDomainAsync(this IComputerVisionAPI operations, string model, string url, string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AnalyzeImageByDomainWithHttpMessagesAsync(model, url, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Recognize Text operation. When you use the Recognize Text interface, the
            /// response contains a field called 'Operation-Location'. The
            /// 'Operation-Location' field contains the URL that you must use for your Get
            /// Handwritten Text Operation Result operation.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='detectHandwriting'>
            /// If 'true' is specified, handwriting recognition is performed. If this
            /// parameter is set to 'false' or is not specified, printed text recognition
            /// is performed.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<RecognizeTextHeaders> RecognizeTextAsync(this IComputerVisionAPI operations, string url, bool? detectHandwriting = false, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.RecognizeTextWithHttpMessagesAsync(url, detectHandwriting, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Headers;
                }
            }

            /// <summary>
            /// This interface is used for getting text operation result. The URL to this
            /// interface should be retrieved from 'Operation-Location' field returned from
            /// Recognize Text interface.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='operationId'>
            /// Id of the text operation returned in the response of the 'Recognize
            /// Handwritten Text'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<TextOperationResult> GetTextOperationResultAsync(this IComputerVisionAPI operations, string operationId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetTextOperationResultWithHttpMessagesAsync(operationId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation extracts a rich set of visual features based on the image
            /// content.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='visualFeatures'>
            /// A string indicating what visual feature types to return. Multiple values
            /// should be comma-separated. Valid visual feature types include:Categories -
            /// categorizes image content according to a taxonomy defined in documentation.
            /// Tags - tags the image with a detailed list of words related to the image
            /// content. Description - describes the image content with a complete English
            /// sentence. Faces - detects if faces are present. If present, generate
            /// coordinates, gender and age. ImageType - detects if image is clipart or a
            /// line drawing. Color - determines the accent color, dominant color, and
            /// whether an image is black&white.Adult - detects if the image is
            /// pornographic in nature (depicts nudity or a sex act).  Sexually suggestive
            /// content is also detected.
            /// </param>
            /// <param name='details'>
            /// A string indicating which domain-specific details to return. Multiple
            /// values should be comma-separated. Valid visual feature types
            /// include:Celebrities - identifies celebrities if detected in the image.
            /// Possible values include: 'Celebrities', 'Landmarks'
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ImageAnalysis> AnalyzeImageInStreamAsync(this IComputerVisionAPI operations, Stream image, IList<VisualFeatureTypes> visualFeatures = default(IList<VisualFeatureTypes>), string details = default(string), string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AnalyzeImageInStreamWithHttpMessagesAsync(image, visualFeatures, details, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a thumbnail image with the user-specified width
            /// and height. By default, the service analyzes the image, identifies the
            /// region of interest (ROI), and generates smart cropping coordinates based on
            /// the ROI. Smart cropping helps when you specify an aspect ratio that differs
            /// from that of the input image. A successful response contains the thumbnail
            /// image binary. If the request failed, the response contains an error code
            /// and a message to help determine what went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='width'>
            /// Width of the thumbnail. It must be between 1 and 1024. Recommended minimum
            /// of 50.
            /// </param>
            /// <param name='height'>
            /// Height of the thumbnail. It must be between 1 and 1024. Recommended minimum
            /// of 50.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='smartCropping'>
            /// Boolean flag for enabling smart cropping.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<Stream> GenerateThumbnailInStreamAsync(this IComputerVisionAPI operations, int width, int height, Stream image, bool? smartCropping = false, CancellationToken cancellationToken = default(CancellationToken))
            {
                var _result = await operations.GenerateThumbnailInStreamWithHttpMessagesAsync(width, height, image, smartCropping, null, cancellationToken).ConfigureAwait(false);
                _result.Request.Dispose();
                return _result.Body;
            }

            /// <summary>
            /// Optical Character Recognition (OCR) detects printed text in an image and
            /// extracts the recognized characters into a machine-usable character stream.
            /// Upon success, the OCR results will be returned. Upon failure, the error
            /// code together with an error message will be returned. The error code can be
            /// one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize,
            /// NotSupportedImage,  NotSupportedLanguage, or InternalServerError.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='detectOrientation'>
            /// Whether detect the text orientation in the image. With
            /// detectOrientation=true the OCR service tries to detect the image
            /// orientation and correct it before further processing (e.g. if it's
            /// upside-down).
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='language'>
            /// The BCP-47 language code of the text to be detected in the image. The
            /// default value is 'unk'. Possible values include: 'unk', 'zh-Hans',
            /// 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it',
            /// 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro',
            /// 'sr-Cyrl', 'sr-Latn', 'sk'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<OcrResult> RecognizePrintedTextInStreamAsync(this IComputerVisionAPI operations, bool detectOrientation, Stream image, OcrLanguages language = default(OcrLanguages), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.RecognizePrintedTextInStreamWithHttpMessagesAsync(detectOrientation, image, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a description of an image in human readable
            /// language with complete sentences.  The description is based on a collection
            /// of content tags, which are also returned by the operation. More than one
            /// description can be generated for each image.  Descriptions are ordered by
            /// their confidence score. All descriptions are in English. Two input methods
            /// are supported -- (1) Uploading an image or (2) specifying an image URL.A
            /// successful response will be returned in JSON.  If the request failed, the
            /// response will contain an error code and a message to help understand what
            /// went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='maxCandidates'>
            /// Maximum number of candidate descriptions to be returned.  The default is 1.
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ImageDescription> DescribeImageInStreamAsync(this IComputerVisionAPI operations, Stream image, string maxCandidates = "1", string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.DescribeImageInStreamWithHttpMessagesAsync(image, maxCandidates, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation generates a list of words, or tags, that are relevant to the
            /// content of the supplied image. The Computer Vision API can return tags
            /// based on objects, living beings, scenery or actions found in images. Unlike
            /// categories, tags are not organized according to a hierarchical
            /// classification system, but correspond to image content. Tags may contain
            /// hints to avoid ambiguity or provide context, for example the tag 'cello'
            /// may be accompanied by the hint 'musical instrument'. All tags are in
            /// English.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<TagResult> TagImageInStreamAsync(this IComputerVisionAPI operations, Stream image, string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.TagImageInStreamWithHttpMessagesAsync(image, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// This operation recognizes content within an image by applying a
            /// domain-specific model.  The list of domain-specific models that are
            /// supported by the Computer Vision API can be retrieved using the /models GET
            /// request.  Currently, the API only provides a single domain-specific model:
            /// celebrities. Two input methods are supported -- (1) Uploading an image or
            /// (2) specifying an image URL. A successful response will be returned in
            /// JSON.  If the request failed, the response will contain an error code and a
            /// message to help understand what went wrong.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='model'>
            /// The domain-specific content to recognize.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='language'>
            /// The desired language for output generation. If this parameter is not
            /// specified, the default value is &quot;en&quot;.Supported
            /// languages:en - English, Default.ja - Japanese pt - Portuguese zh -
            /// Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<DomainModelResults> AnalyzeImageByDomainInStreamAsync(this IComputerVisionAPI operations, string model, Stream image, string language = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AnalyzeImageByDomainInStreamWithHttpMessagesAsync(model, image, language, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Recognize Text operation. When you use the Recognize Text interface, the
            /// response contains a field called 'Operation-Location'. The
            /// 'Operation-Location' field contains the URL that you must use for your Get
            /// Handwritten Text Operation Result operation.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='detectHandwriting'>
            /// If 'true' is specified, handwriting recognition is performed. If this
            /// parameter is set to 'false' or is not specified, printed text recognition
            /// is performed.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<RecognizeTextInStreamHeaders> RecognizeTextInStreamAsync(this IComputerVisionAPI operations, Stream image, bool? detectHandwriting = false, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.RecognizeTextInStreamWithHttpMessagesAsync(image, detectHandwriting, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Headers;
                }
            }

    }
}


text:
//////////////////////////////////////////////////////////////////////////
// Copyright 2001-2014 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.Words. The source code in this file
// is only intended as a supplement to the documentation, and is provided
// "as is", without warranty of any kind, either expressed or implied.
//////////////////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.IO;

using Aspose.Words;
using Aspose.Words.Tables;
using System.Diagnostics;
using Aspose.Words.MailMerging;
using Aspose.Words.Saving;
using System.Text;

namespace CSharp.Loading_Saving
{
    class LoadTxt
    {
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

            // The encoding of the text file is automatically detected.
            Document doc = new Document(dataDir + "LoadTxt.txt");

            // Save as any Aspose.Words supported format, such as DOCX.
            doc.Save(dataDir + "LoadTxt Out.docx");

            Console.WriteLine("\nText document loaded successfully.\nFile saved at " + dataDir + "LoadTxt Out.docx");
        }
    }
}