text:
Customer Chat
========================
This project is a simple example showing a customer chat app using JAX-RS 2.0 async client and server apis.

System Requirements:
-------------------------
- Maven 3.0.4 or higher

Running the project:
-------------------------
1. In root directory

mvn jetty:run

This will start the web server

2. In a different window

mvn exec:java -Dexec.mainClass=ChatClient -Dexec.args="<Your first name>"

You must specify your first name you will use in the chat.  When this comes up, enter your messages.  You can
also open up another window to have a conversation.

redpajama_set_name: RedPajamaGithub


text:
module Impulse
  class ApplicationController < ActionController::Base
  end
end


text:
package com.asksunny.protocol.rpc;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import com.asksunny.cli.utils.CLICommand;
import com.asksunny.io.utils.StreamCopier;

public class RPCJavaEnvelope extends AbstractRPCEnvelope {

	byte[] jarSource;
	String className;

	public RPCJavaEnvelope() {
		super.envelopeType = (RPC_ENVELOPE_TYPE_JAVA);
		super.rpcType = RPC_TYPE_REQUEST;
	}

	public static RPCJavaEnvelope createJavaEnvelope(CLICommand rcmd) {

		RPCJavaEnvelope envelope = new RPCJavaEnvelope();
		envelope.setRpcType(RPC_TYPE_REQUEST);
		String jar = rcmd.peek();
		if (jar.endsWith(".jar")) {
			envelope.setJarSource(rcmd.shift());
		}
		envelope.setClassName(rcmd.shift());
		for (String cmd : rcmd.getCmdArray()) {

			envelope.addRpcObjects(cmd);
		}
		return envelope;

	}

	public byte[] getJarSource() {
		return jarSource;
	}

	public RPCJavaEnvelope setJarSource(Object jarSource) {
		if (jarSource != null) {
			if (jarSource instanceof String || jarSource instanceof File) {
				File jarFile = null;
				if (jarSource instanceof String) {
					jarFile = new File((String) jarSource);
				} else {
					jarFile = (File) jarSource;
				}
				FileInputStream fin = null;
				ByteArrayOutputStream bout = new ByteArrayOutputStream();
				try {
					fin = new FileInputStream(jarFile);
					StreamCopier.copy(fin, bout);
					this.jarSource = bout.toByteArray();
				} catch (Exception ex) {
					throw new RuntimeException("File to load Jar file:"
							+ jarSource, ex);
				} finally {
					if (fin != null) {
						try {
							fin.close();
						} catch (IOException e) {
							;
						}
					}
				}
			} else if (jarSource instanceof byte[]) {
				this.jarSource = (byte[]) jarSource;
			} else if (jarSource instanceof InputStream) {
				InputStream fin = (InputStream) jarSource;
				ByteArrayOutputStream bout = new ByteArrayOutputStream();
				try {
					StreamCopier.copy(fin, bout);
					this.jarSource = bout.toByteArray();
				} catch (IOException ex) {
					throw new RuntimeException(
							"File to load Jar from inputstream:", ex);
				} finally {
					if (fin != null) {
						try {
							fin.close();
						} catch (IOException e) {
							;
						}
					}
				}

			}

		}
		return this;
	}

	public String getClassName() {
		return className;
	}

	public RPCJavaEnvelope setClassName(String className) {
		this.className = className;
		return this;
	}

}


text:
<link rel="import" href="../../bower_components/iron-collapse/iron-collapse.html">
<link rel="import" href="../../bower_components/paper-item/paper-item.html">
<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">

<dom-module id="request-previewer">

  <template>
    <iron-collapse id="httpPreview">

Request URL: https://gcm-http.googleapis.com/gcm/send

Request Method: POST

Request Headers

Content-Type: application/json

Authorization: key=YOUR_API_KEY

Request Body

        <paper-textarea value="{{body}}"></paper-textarea>

    </iron-collapse>

    <iron-collapse id="xmppPreview">

XMPP stanza

        <paper-textarea value="{{body}}"></paper-textarea>

    </iron-collapse>

  </template>

</dom-module>


text:
public class ValueOfString {
	public static int findValue(String s) {
		int stringValue = 0;

		for (int i = 0; i < s.length(); ++i) {
			int currentCharValue = ((int) s.charAt(i)) - 96; // 'a' has an ASCII code of 97
			for (int j = 0; j < s.length(); ++j) {
				int charValue = ((int) s.charAt(j)) - 96;
				if (charValue <= currentCharValue) {
					stringValue += currentCharValue;
				}
			}
		}

		return stringValue;
	}
}


text:
package org.bouncycastle.crypto.test;

import java.util.Collections;

import org.bouncycastle.crypto.CryptoServiceConstraintsException;
import org.bouncycastle.crypto.CryptoServicesRegistrar;
import org.bouncycastle.crypto.constraints.BitsOfSecurityConstraint;
import org.bouncycastle.crypto.constraints.LegacyBitsOfSecurityConstraint;
import org.bouncycastle.crypto.engines.DESEngine;
import org.bouncycastle.crypto.engines.DESedeEngine;
import org.bouncycastle.crypto.engines.RC4Engine;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.SimpleTest;

public class CryptoServiceConstraintsTest
    extends SimpleTest
{
    public String getName()
    {
        return "CryptoServiceConstraintsTest";
    }

    public void performTest()
        throws Exception
    {
        test112bits();
        test128bits();
        testLegacy128bits();
    }

    private void test112bits()
    {
        CryptoServicesRegistrar.setServicesConstraints(new BitsOfSecurityConstraint(112));

        try
        {
            new RC4Engine();
            fail("no exception!");
        }
        catch (CryptoServiceConstraintsException e)
        {
            isEquals("service does not provide 112 bits of security only 20", e.getMessage());
        }

        // try with exception for RC4/ARC4
        CryptoServicesRegistrar.setServicesConstraints(new BitsOfSecurityConstraint(112, Collections.singleton("ARC4")));

        new RC4Engine();

        try
        {
            new DESEngine();
            fail("no exception!");
        }
        catch (CryptoServiceConstraintsException e)
        {
            isEquals("service does not provide 112 bits of security only 56", e.getMessage());
        }

        new DESedeEngine();

        CryptoServicesRegistrar.setServicesConstraints(null);
    }

    private void test128bits()
    {
        CryptoServicesRegistrar.setServicesConstraints(new BitsOfSecurityConstraint(128));

        try
        {
            new DESedeEngine();
            fail("no exception!");
        }
        catch (CryptoServiceConstraintsException e)
        {
            isEquals("service does not provide 128 bits of security only 112", e.getMessage());
        }

        // add exception for DESede
        CryptoServicesRegistrar.setServicesConstraints(new BitsOfSecurityConstraint(128, Collections.singleton("DESede")));

        new DESedeEngine();

        CryptoServicesRegistrar.setServicesConstraints(null);
    }

    private void testLegacy128bits()
    {
        CryptoServicesRegistrar.setServicesConstraints(new LegacyBitsOfSecurityConstraint(128));

        DESedeEngine eng = new DESedeEngine();
        KeyParameter dKey = new KeyParameter(Hex.decode("01020304050607080102030405060708"));

        try
        {
            eng.init(true, dKey);
            fail("no exception");
        }
        catch (CryptoServiceConstraintsException e)
        {
            isEquals("service does not provide 128 bits of security only 80", e.getMessage());
        }

        eng.init(false, dKey);     // this should work as we are decrypting

        CryptoServicesRegistrar.setServicesConstraints(null);
    }

    public static void main(
        String[] args)
    {
        runTest(new CryptoServiceConstraintsTest());
    }
}


text:
package com.bbva.kltt.apirest.core.ant;

/**
 * ------------------------------------------------
 * @author Francisco Manuel Benitez Chico
 * ------------------------------------------------
 */
public class MyAntExecutor extends AbstractAntExecutor
{
    /**
     * @param generatorBuilderPath with the generator builder path
     * @param antFile              with the ant file
     * @param translatorType       with the translator type
     * @param fullPkgLauncherClass with the full package launcher class
     * @param parserType           with the parser type
     * @param deliverableFileName  with the deliverable file name
     */
    public MyAntExecutor(final String generatorBuilderPath,
                         final String antFile,
                         final String translatorType,
                         final String fullPkgLauncherClass,
                         final String parserType,
                         final String deliverableFileName)
    {
		super(generatorBuilderPath, antFile, translatorType, fullPkgLauncherClass, parserType, deliverableFileName) ;
	}

}


text:
const stripe = require('stripe')(process.argv[2]);

try {
  throw new stripe.errors.StripeError({
    charge: 'foo',
    unknown_prop: 'bar',
  });
} catch (e) {
  if (e instanceof stripe.errors.StripeError) {
    console.log("Caught StripeError");
  } else {
    throw e;
  }
}

async function exampleFunction(args) {
  try {
    await stripe.paymentIntents.create(args);
  } catch (e) {
    if (e instanceof stripe.errors.StripeInvalidRequestError) {
      console.log("Caught StripeInvalidRequestError");
    } else {
      throw e;
    }
  }
}

exampleFunction({
  // The required parameter currency is missing
  amount: 2000,
  confirm: true,
  payment_method: 'pm_card_visa',
});


text:
package sqlline;

/**
 * Abstract OutputFormat.
 */
public abstract class AbstractOutputFormat implements OutputFormat {
  protected final SqlLine sqlLine;

  public AbstractOutputFormat(SqlLine sqlLine) {
    this.sqlLine = sqlLine;
  }

  public int print(Rows rows) {
    int count = 0;
    Rows.Row header = rows.next();

    if (sqlLine.getOpts().getShowHeader()) {
      printHeader(header);
    }
    while (rows.hasNext()) {
      printRow(rows, header, rows.next());
      count++;
    }

    printFooter(header);

    return count;
  }

  abstract void printHeader(Rows.Row header);

  abstract void printFooter(Rows.Row header);

  abstract void printRow(Rows rows, Rows.Row header, Rows.Row row);
}

// End AbstractOutputFormat.java


text:
package jstreamserver.utils;

import jstreamserver.ffmpeg.FFMpegConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

import java.io.*;
import java.text.MessageFormat;
import java.util.*;

/**
 * POJO which holds config settings for the server.
 *
 * @author Sergey Prilukin
 */
@Component
public final class Config implements ConfigReader, InitializingBean {
    public static String ROOT_DIR_PREFIX = "rootdir.";
    public static String HTML5_SUPPORTED_VIDEO_TYPES_PREFIX = "html5SupportedVideoTypes.";
    public static String SUPPORTS_LIVE_STREAM_PREFIX = "supportsLiveStream.";
    public static String DEFAULT_KEY = "default";

    private final Log log = LogFactory.getLog(this.getClass());

    private int port;
    private String host;
    private Map<String, String> rootDirs = new LinkedHashMap<String, String>();
    private String ffmpegLocation;
    private String ffmpegParams;
    private String segmenterLocation;
    private int segmentDurationInSec;
    private int segmentWindowSize;
    private int segmenterSearchKillFile;
    private int segmenterMaxtimeout;
    private String defaultTextCharset;
    private int ftpPort;
    public Map<String, List<String>> videoTypesForHTML5 = new LinkedHashMap<String, List<String>>();
    public Map<String, Boolean> supportsLiveStream = new HashMap<String, Boolean>();
    private int maxLiveStreams;

    public Config() {
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        String pathToProperties = System.getProperty("jsproperties");

        if (pathToProperties != null) {
            Reader reader = new BufferedReader(new FileReader(pathToProperties));
            Properties properties = new Properties();
            properties.load(reader);
            setFromProperties(properties);
        }

        setFromProperties(System.getProperties());

        if (log.isInfoEnabled()) {
            log.info(this.toString());
        }
    }

    @Value(value = "classpath:jstreamserver.properties")
    public void setResource(Resource resource) throws IOException {
        Properties properties = new Properties();
        properties.load(resource.getInputStream());
        setFromProperties(properties);
    }

    private Integer getIntValueFromProperties(Properties props, String key, Integer defValue) {
        String value = props.getProperty(key);
        return value != null ? Integer.parseInt(value) : defValue;
    }

    private void setFromProperties(Properties props) {
        setPort(getIntValueFromProperties(props, "port", port));
        setHost(props.getProperty("host", host));
        setFfmpegLocation(props.getProperty("ffmpegLocation", ffmpegLocation));
        setFfmpegParams(props.getProperty("ffmpegParams", ffmpegParams));
        setSegmenterLocation(props.getProperty("segmenterLocation", segmenterLocation));
        setSegmentDurationInSec(getIntValueFromProperties(props, "segmentDurationInSec", segmentDurationInSec));
        setSegmentWindowSize(getIntValueFromProperties(props, "segmentWindowSize", segmentWindowSize));
        setSegmenterSearchKillFile(getIntValueFromProperties(props, "segmenterSearchKillFile", segmenterSearchKillFile));
        setSegmenterMaxtimeout(getIntValueFromProperties(props, "segmenterMaxtimeout", segmenterMaxtimeout));
        setDefaultTextCharset(props.getProperty("defaultTextCharset", defaultTextCharset));
        setFtpPort(getIntValueFromProperties(props, "ftpPort", ftpPort));
        setMaxLiveStreams(getIntValueFromProperties(props, "maxLiveStreams", maxLiveStreams));

        for (Map.Entry entry: props.entrySet()) {
            String key = (String)entry.getKey();
            String value = (String)entry.getValue();

            if (key.startsWith(ROOT_DIR_PREFIX)) {
                rootDirs.put(key.substring(ROOT_DIR_PREFIX.length()), value);
            } else if (key.startsWith(HTML5_SUPPORTED_VIDEO_TYPES_PREFIX)) {
                    videoTypesForHTML5.put(key.substring(HTML5_SUPPORTED_VIDEO_TYPES_PREFIX.length()),
                            Arrays.asList(value.split("[,\\s]+")));
            } else {
                if (key.startsWith(SUPPORTS_LIVE_STREAM_PREFIX)) {
                    supportsLiveStream.put(key.substring(SUPPORTS_LIVE_STREAM_PREFIX.length()),
                            Boolean.valueOf(value));
                }
            }
        }
    }

    public int getPort() {
        return port;
    }

    public String getHost() {
        return host;
    }

    public Map<String, String> getRootDirs() {
        return rootDirs;
    }

    public String getFfmpegLocation() {
        return ffmpegLocation;
    }

    public String getFfmpegParams() {
        return MessageFormat.format(FFMpegConstants.FFMPEG_PARAMS_FORMAT, ffmpegParams);
    }

    public String getSegmenterLocation() {
        return segmenterLocation;
    }

    public int getSegmentDurationInSec() {
        return segmentDurationInSec;
    }

    public int getSegmentWindowSize() {
        return segmentWindowSize;
    }

    public int getSegmenterSearchKillFile() {
        return segmenterSearchKillFile;
    }

    public int getSegmenterMaxtimeout() {
        return segmenterMaxtimeout;
    }

    public String getDefaultTextCharset() {
        return defaultTextCharset;
    }

    public int getFtpPort() {
        return ftpPort;
    }

    @Override
    public List<String> getVideoTypesForHTML5(String userAgent) {
        List<String> types = this.videoTypesForHTML5.get(DEFAULT_KEY);

        for (Map.Entry<String, List<String>> entry: this.videoTypesForHTML5.entrySet()) {
            if (userAgent.contains(entry.getKey())) {
                types = entry.getValue();
                break;
            }
        }

        return Collections.unmodifiableList(types);
    }

    @Override
    public Boolean getSupportsLiveStream(String userAgent) {
        for (Map.Entry<String, Boolean> entry: this.supportsLiveStream.entrySet()) {
            if (userAgent.contains(entry.getKey())) {
                return entry.getValue();
            }
        }

        return this.supportsLiveStream.get(DEFAULT_KEY);
    }

    public String getSegmenterParams() {
        return MessageFormat.format(
                FFMpegConstants.SEGMENTER_PARAMS_FORMAT,
                String.valueOf(segmentDurationInSec),
                String.valueOf(segmentWindowSize),
                String.valueOf(segmenterSearchKillFile));
    }

    public int getMaxLiveStreams() {
        return maxLiveStreams;
    }

    public void setPort(Integer port) {
        if (port != null) {
            this.port = port;
        }
    }

    public void setHost(String host) {
        if (host != null) {
            this.host = host;
        }
    }

    public void setRootDirs(Map<String, String> rootDirs) {
        if (rootDirs != null) {
            this.rootDirs.clear();
            this.rootDirs.putAll(rootDirs);
        }
    }

    public void setFfmpegLocation(String ffmpegLocation) {
        if (ffmpegLocation != null) {
            this.ffmpegLocation = ffmpegLocation
                    .replaceFirst("\\$\\{work\\.dir\\}", getUserDir());
        }
    }

    public void setFfmpegParams(String ffmpegParams) {
        if (ffmpegParams != null) {
            this.ffmpegParams = ffmpegParams;
        }
    }

    public void setSegmenterLocation(String segmenterLocation) {
        if (segmenterLocation != null) {
            this.segmenterLocation = segmenterLocation
                    .replaceFirst("\\$\\{work\\.dir\\}", getUserDir());
        }
    }

    public void setSegmentDurationInSec(Integer segmentDurationInSec) {
        if (segmentDurationInSec != null) {
            this.segmentDurationInSec = segmentDurationInSec;
        }
    }

    public void setSegmentWindowSize(Integer segmentWindowSize) {
        if (segmentWindowSize != null) {
            this.segmentWindowSize = segmentWindowSize;
        }
    }

    public void setSegmenterSearchKillFile(Integer segmenterSearchKillFile) {
        if (segmenterSearchKillFile != null) {
            this.segmenterSearchKillFile = segmenterSearchKillFile;
        }
    }

    public void setSegmenterMaxtimeout(Integer segmenterMaxtimeout) {
        if (segmenterMaxtimeout != null) {
            this.segmenterMaxtimeout = segmenterMaxtimeout;
        }
    }

    public void setDefaultTextCharset(String defaultTextCharset) {
        if (defaultTextCharset != null) {
            this.defaultTextCharset = defaultTextCharset;
        }
    }

    public void setFtpPort(Integer ftpPort) {
        if (ftpPort != null) {
            this.ftpPort = ftpPort;
        }
    }

    public void setVideoTypesForHTML5(Map<String, List<String>> videoTypesForHTML5) {
        if (videoTypesForHTML5 != null) {
            this.videoTypesForHTML5.clear();
            this.videoTypesForHTML5.putAll(videoTypesForHTML5);
        }
    }

    public void setSupportsLiveStream(Map<String, Boolean> supportsLiveStream) {
        if (supportsLiveStream != null) {
            this.supportsLiveStream.clear();
            this.supportsLiveStream.putAll(supportsLiveStream);
        }
    }

    public void setMaxLiveStreams(Integer maxLiveStreams) {
        if (maxLiveStreams != null) {
            this.maxLiveStreams = maxLiveStreams;
        }
    }

    private String getUserDir() {
        return System.getProperty("user.dir").replaceAll("\\\\", "/");
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("\r\nJstreamserver config:\r\n");
        sb.append("listening on: ").append(host).append(":").append(port).append("\r\n");
        sb.append("default text charset: ").append(defaultTextCharset).append("\r\n");
        sb.append("Built-in FTP server listen on: ").append(ftpPort).append("\r\n");
        if (ffmpegLocation != null) {
            sb.append("ffmpegLocation: ").append(ffmpegLocation).append("\r\n");
            sb.append("ffmpegParams: ").append(ffmpegParams).append("\r\n");
        } else {
            sb.append("ffmpegLocation not set - HTTP Live Streaming is not available\r\n");
        }

        if (segmenterLocation != null) {
            sb.append("segmenterLocation: ").append(segmenterLocation).append("\r\n");
            //sb.append("segmenterParams: ").append(segmenterParams).append("\r\n");
            sb.append("segmentDurationInSec: ").append(segmentDurationInSec).append("\r\n");
            sb.append("segmentWindowSize: ").append(segmentWindowSize).append("\r\n");
            sb.append("segmenterSearchKillFile: ").append(segmenterSearchKillFile).append("\r\n");
            sb.append("segmenterMaxtimeout: ").append(segmenterMaxtimeout).append("\r\n");
        } else {
            sb.append("segmenterLocation not set - HTTP Live Streaming is not available\r\n");
        }

        sb.append("rootDirs:\r\n");
        for (Map.Entry<String, String> entry: rootDirs.entrySet()) {
            sb.append("\"").append(entry.getValue()).append("\"").append(" with label: ").append(entry.getKey()).append("\r\n");
        }

        return sb.append("\r\n").toString();
    }
}


text:
cask :v1 => 'yandexdisk' do
  version :latest
  sha256 :no_check

  url 'https://disk.yandex.com/download/Yandex.Disk.Mac.dmg'
  homepage 'https://disk.yandex.com/'
  license :unknown    # todo: improve this machine-generated value

  app 'Yandex.Disk.app'
end


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

{% block title %}{% trans "Registration" %}{% endblock %}

{% block content %}

{% trans "Registration" %}

    {% if account_verification_active %}

            {% blocktrans %}Your registration was successful. We send you a e-mail including a link.

            Please click the link to activate your account. Thank you!

            The link is valid for {{ expiration_days }} days.{% endblocktrans %}

    {% else %}

            {% blocktrans %}Your registration was successful.{% endblocktrans %}

    {% endif %}
{% endblock %}


text:
/**
 * @file cli_test.cpp
 * @author Matthew Amidon, Ryan Curtin
 *
 * Test for the CLI input parameter system.
 */

#include <iostream>
#include <sstream>

#ifndef _WIN32
  #include <sys/time.h>
#endif

// For Sleep().
#ifdef _WIN32
  #include <windows.h>
#endif

#include <mlpack/core.hpp>

#define DEFAULT_INT 42

#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"

#define BASH_RED "\033[0;31m"
#define BASH_GREEN "\033[0;32m"
#define BASH_YELLOW "\033[0;33m"
#define BASH_CYAN "\033[0;36m"
#define BASH_CLEAR "\033[0m"

using namespace mlpack;
using namespace mlpack::util;

BOOST_AUTO_TEST_SUITE(CLITest);

/**
 * Tests that CLI works as intended, namely that CLI::Add propagates
 * successfully.
 */
BOOST_AUTO_TEST_CASE(TestCLIAdd)
{
  // Check that the CLI::HasParam returns false if no value has been specified
  // on the commandline and ignores any programmatical assignments.
  CLI::Add<bool>("global/bool", "True or False", "alias/bool");

  // CLI::HasParam should return false here.
  BOOST_REQUIRE(!CLI::HasParam("global/bool"));

  // Check the description of our variable.
  BOOST_REQUIRE_EQUAL(CLI::GetDescription("global/bool").compare(
      std::string("True or False")) , 0);

  // Check that our aliasing works.
  BOOST_REQUIRE_EQUAL(CLI::HasParam("global/bool"),
      CLI::HasParam("alias/bool"));
  BOOST_REQUIRE_EQUAL(CLI::GetDescription("global/bool").compare(
      CLI::GetDescription("alias/bool")), 0);
  BOOST_REQUIRE_EQUAL(CLI::GetParam<bool>("global/bool"),
      CLI::GetParam<bool>("alias/bool"));
}

/**
 * Test the output of CLI.  We will pass bogus input to a stringstream so that
 * none of it gets to the screen.
 */
BOOST_AUTO_TEST_CASE(TestPrefixedOutStreamBasic)
{
  std::stringstream ss;
  PrefixedOutStream pss(ss, BASH_GREEN "[INFO ] " BASH_CLEAR);

  pss << "This shouldn't break anything" << std::endl;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "This shouldn't break anything\n");

  ss.str("");
  pss << "Test the new lines...";
  pss << "shouldn't get 'Info' here." << std::endl;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR
      "Test the new lines...shouldn't get 'Info' here.\n");

  pss << "But now I should." << std::endl << std::endl;
  pss << "";
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR
      "Test the new lines...shouldn't get 'Info' here.\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "But now I should.\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "");
}

/**
 * Tests that the various PARAM_* macros work properly.
 */
BOOST_AUTO_TEST_CASE(TestOption)
{
  // This test will involve creating an option, and making sure CLI reflects
  // this.
  PARAM(int, "test_parent/test", "test desc", "", DEFAULT_INT, false);

  BOOST_REQUIRE_EQUAL(CLI::GetDescription("test_parent/test"), "test desc");
  BOOST_REQUIRE_EQUAL(CLI::GetParam<int>("test_parent/test"), DEFAULT_INT);
}

/**
 * Ensure that a Boolean option which we define is set correctly.
 */
BOOST_AUTO_TEST_CASE(TestBooleanOption)
{
  PARAM_FLAG("flag_test", "flag test description", "");

  BOOST_REQUIRE_EQUAL(CLI::HasParam("flag_test"), false);

  BOOST_REQUIRE_EQUAL(CLI::GetDescription("flag_test"),
      "flag test description");

  // Now check that CLI reflects that it is false by default.
  BOOST_REQUIRE_EQUAL(CLI::GetParam<bool>("flag_test"), false);

  // Now, if we specify this flag, it should be true.
  int argc = 2;
  char* argv[2];
  argv[0] = strcpy(new char[strlen("programname") + 1], "programname");
  argv[1] = strcpy(new char[strlen("--flag_test") + 1], "--flag_test");

  CLI::ParseCommandLine(argc, argv);

  BOOST_REQUIRE_EQUAL(CLI::GetParam<bool>("flag_test"), true);
  BOOST_REQUIRE_EQUAL(CLI::HasParam("flag_test"), true);

  delete[] argv[0];
  delete[] argv[1];
}

/**
 * Test that we can correctly output Armadillo objects to PrefixedOutStream
 * objects.
 */
BOOST_AUTO_TEST_CASE(TestArmadilloPrefixedOutStream)
{
  // We will test this with both a vector and a matrix.
  arma::vec test("1.0 1.5 2.0 2.5 3.0 3.5 4.0");

  std::stringstream ss;
  PrefixedOutStream pss(ss, BASH_GREEN "[INFO ] " BASH_CLEAR);

  pss << test;
  // This should result in nothing being on the current line (since it clears
  // it).
  BOOST_REQUIRE_EQUAL(ss.str(), BASH_GREEN "[INFO ] " BASH_CLEAR "   1.0000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   1.5000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   2.0000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   2.5000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   3.0000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   3.5000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   4.0000\n");

  ss.str("");
  pss << trans(test);
  // This should result in there being stuff on the line.
  BOOST_REQUIRE_EQUAL(ss.str(), BASH_GREEN "[INFO ] " BASH_CLEAR
      "   1.0000   1.5000   2.0000   2.5000   3.0000   3.5000   4.0000\n");

  arma::mat test2("1.0 1.5 2.0; 2.5 3.0 3.5; 4.0 4.5 4.99999");
  ss.str("");
  pss << test2;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "   1.0000   1.5000   2.0000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   2.5000   3.0000   3.5000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   4.0000   4.5000   5.0000\n");

  // Try and throw a curveball by not clearing the line before outputting
  // something else.  The PrefixedOutStream should not force Armadillo objects
  // onto their own lines.
  ss.str("");
  pss << "hello" << test2;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "hello   1.0000   1.5000   2.0000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   2.5000   3.0000   3.5000\n"
      BASH_GREEN "[INFO ] " BASH_CLEAR "   4.0000   4.5000   5.0000\n");
}

/**
 * Test that we can correctly output things in general.
 */
BOOST_AUTO_TEST_CASE(TestPrefixedOutStream)
{
  std::stringstream ss;
  PrefixedOutStream pss(ss, BASH_GREEN "[INFO ] " BASH_CLEAR);

  pss << "hello world I am ";
  pss << 7;

  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "hello world I am 7");

  pss << std::endl;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "hello world I am 7\n");

  ss.str("");
  pss << std::endl;
  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR "\n");
}

/**
 * Test format modifiers.
 */
BOOST_AUTO_TEST_CASE(TestPrefixedOutStreamModifiers)
{
  std::stringstream ss;
  PrefixedOutStream pss(ss, BASH_GREEN "[INFO ] " BASH_CLEAR);

  pss << "I have a precise number which is ";
  pss << std::setw(6) << std::setfill('0') << (int)156;

  BOOST_REQUIRE_EQUAL(ss.str(),
      BASH_GREEN "[INFO ] " BASH_CLEAR
      "I have a precise number which is 000156");
}

/**
 * We should be able to start and then stop a timer multiple times and it should
 * save the value.
 */
BOOST_AUTO_TEST_CASE(MultiRunTimerTest)
{
  Timer::Start("test_timer");

  // On Windows (or, at least, in Windows not using VS2010) we cannot use
  // usleep() because it is not provided.  Instead we will use Sleep() for a
  // number of milliseconds.
  #ifdef _WIN32
  Sleep(10);
  #else
  usleep(10000);
  #endif

  Timer::Stop("test_timer");

  BOOST_REQUIRE_GE(Timer::Get("test_timer").count(), 10000);

  // Restart it.
  Timer::Start("test_timer");

  #ifdef _WIN32
  Sleep(10);
  #else
  usleep(10000);
  #endif

  Timer::Stop("test_timer");

  BOOST_REQUIRE_GE(Timer::Get("test_timer").count(), 20000);

  // Just one more time, for good measure...
  Timer::Start("test_timer");

  #ifdef _WIN32
  Sleep(20);
  #else
  usleep(20000);
  #endif

  Timer::Stop("test_timer");

  BOOST_REQUIRE_GE(Timer::Get("test_timer").count(), 40000);
}

BOOST_AUTO_TEST_CASE(TwiceStartTimerTest)
{
  Timer::Start("test_timer");

  BOOST_REQUIRE_THROW(Timer::Start("test_timer"), std::runtime_error);
}

BOOST_AUTO_TEST_CASE(TwiceStopTimerTest)
{
  Timer::Stop("test_timer");

  BOOST_REQUIRE_THROW(Timer::Stop("test_timer"), std::runtime_error);
}

BOOST_AUTO_TEST_SUITE_END();


text:
package com.organic.maynard.outliner.menus.edit;

import com.organic.maynard.outliner.menus.*;
import com.organic.maynard.outliner.*;
import com.organic.maynard.outliner.guitree.*;
import com.organic.maynard.outliner.dom.*;
import com.organic.maynard.outliner.event.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import org.xml.sax.*;

/**
 * @author  $Author: maynardd $
 * @version $Revision: 1.2 $, $Date: 2004/02/02 10:17:41 $
 */

public class EditDocumentAttributesMenuItem extends AbstractOutlinerMenuItem implements DocumentRepositoryListener, ActionListener, GUITreeComponent {

	// DocumentRepositoryListener Interface
	public void documentAdded(DocumentRepositoryEvent e) {}

	public void documentRemoved(DocumentRepositoryEvent e) {}

	public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {
		if (e.getDocument() == null) {
			setEnabled(false);
		} else {
			setEnabled(true);
		}
	}

	// GUITreeComponent interface
	public void startSetup(Attributes atts) {
		super.startSetup(atts);

		setEnabled(false);

		addActionListener(this);
		Outliner.documents.addDocumentRepositoryListener(this);
	}

	// ActionListener Interface
	public void actionPerformed(ActionEvent e) {
		Outliner.documentAttributes.configureAndShow(Outliner.documents.getMostRecentDocumentTouched().getTree());
	}
}


text:
package com.sophia.domain;

import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by root on 2015/10/27.
 */
public class Api {
    String name;
    String uri;
    RequestMethod method;
    String ctrlName;
    String paramJson;
    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public RequestMethod getMethod() {
        return method;
    }

    public void setMethod(RequestMethod method) {
        this.method = method;
    }

    public String getCtrlName() {
        return ctrlName;
    }

    public void setCtrlName(String ctrlName) {
        this.ctrlName = ctrlName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getParamJson() {
        return paramJson;
    }

    public void setParamJson(String paramJson) {
        this.paramJson = paramJson;
    }
}


text:
@interface CCLoginManager()<CCAPIManagerValidator,CCAPIManager>

@end

@implementation CCLoginManager

- (instancetype)init{
    self = [super init];
    if (self) {
        self.validator = self;
        self.child = self;
    }
    return self;
}

- (NSDictionary *)reformParams:(NSDictionary *)param{
    return param;
}

- (BOOL)manager:(CCAPIBaseManager *)manager isCorrectWithParamsData:(NSDictionary *)data{
    return YES;
}

- (BOOL)manager:(CCAPIBaseManager *)manager isCorrectWithCallbackData:(NSDictionary *)data{
    return YES;
}

- (NSString *)methodName{
    return @"auctions";
}

- (NSString *)serviceType{

    return @"CCServiceBase";
}

- (CCAPIManagerRequestType)requestType{
    return 1;
}

-(BOOL)shouldCache{
    return NO;
}

@end


text:
package cn.mejhwu.bo;

/**
 * Created with IntelliJ IDEA.
 * Author: mejhwu
 * Email:  mejhwu@163.com
 * Date:   2017/6/6
 * Time:   0:32
 * Description:
 */
public class EntityType {

    public final static int ENTITY_ARTICLE = 0;
    public final static int ENTITY_COMMENT = 1;

}


text:
<!DOCTYPE html>
<html ng-app="taskGoogle">
	<head>
		<title>Google Tasks</title>

		<meta charset="UTF-8">

		<script type="text/javascript" src="js/lib/angular.min.js"></script>
		<script type="text/javascript" src="js/i18n/angular-locale_pt-br.js"></script>
		<script type="text/javascript" src="js/lib/angular.resource.min.js"></script>

		<script type="text/javascript" src="js/app.js"></script>
		<script type="text/javascript" src="js/service/connectGoogleWithDeferred.js"></script>
		<script type="text/javascript" src="js/controller/main.js"></script>
	</head>
	<body ng-controller="main">
		{{urlTeste | json}}
	</body>
</html>


text:
module Azure::CDN::Mgmt::V2020_09_01
  module Models
    #
    # Rankings Response
    #
    class RankingsResponse

      include MsRestAzure

      # @return [DateTime]
      attr_accessor :date_time_begin

      # @return [DateTime]
      attr_accessor :date_time_end

      # @return [Array<RankingsResponseTablesItem>]
      attr_accessor :tables

      #
      # Mapper for RankingsResponse class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'RankingsResponse',
          type: {
            name: 'Composite',
            class_name: 'RankingsResponse',
            model_properties: {
              date_time_begin: {
                client_side_validation: true,
                required: false,
                serialized_name: 'dateTimeBegin',
                type: {
                  name: 'DateTime'
                }
              },
              date_time_end: {
                client_side_validation: true,
                required: false,
                serialized_name: 'dateTimeEnd',
                type: {
                  name: 'DateTime'
                }
              },
              tables: {
                client_side_validation: true,
                required: false,
                serialized_name: 'tables',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'RankingsResponseTablesItemElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'RankingsResponseTablesItem'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
Rails.application.routes.draw do
  namespace :proxy_engine do
    get 'utils/proxy/', to: 'utils#proxy', :as => 'proxy'
  end
end


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

<TITLE>
javax.annotation.concurrent Class Hierarchy
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Hierarchy For Package javax.annotation.concurrent

Package Hierarchies:
All Packages

Annotation Type Hierarchy

javax.annotation.concurrent.ThreadSafe (implements java.lang.annotation.Annotation)

javax.annotation.concurrent.NotThreadSafe (implements java.lang.annotation.Annotation)

javax.annotation.concurrent.Immutable (implements java.lang.annotation.Annotation)

javax.annotation.concurrent.GuardedBy (implements java.lang.annotation.Annotation)

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
Generating Query Results
########################

There are several ways to generate query results:

.. contents::
    :local:
    :depth: 2

*************
Result Arrays
*************

**result()**

This method returns the query result as an array of **objects**, or
**an empty array** on failure. Typically you'll use this in a foreach
loop, like this::

	$query = $this->db->query("YOUR QUERY");

	foreach( $query->result() as $row)
	{
		echo $row->title;
		echo $row->name;
		echo $row->body;
	}

The above method is an alias of ``result_object()``.

You can also pass a string to ``result()`` which represents a class to
instantiate for each result object (note: this class must be loaded)

::

	$query = $this->db->query("SELECT * FROM users;");

	foreach( $query->result( 'User') as $user)
	{
		echo $user->name; // access attributes
		echo $user->reverse_name(); // or methods defined on the 'User' class
	}

**result_array()**

This method returns the query result as a pure array, or an empty
array when no result is produced. Typically you'll use this in a foreach
loop, like this::

	$query = $this->db->query("YOUR QUERY");

	foreach( $query->result_array() as $row)
	{
		echo $row[ 'title' ];
		echo $row[ 'name' ];
		echo $row[ 'body' ];
	}

***********
Result Rows
***********

**row()**

This method returns a single result row. If your query has more than
one row, it returns only the first row. The result is returned as an
**object**. Here's a usage example::

	$query = $this->db->query("YOUR QUERY");

	$row = $query->row();

	if( isset( $row ) )
	{
		echo $row->title;
		echo $row->name;
		echo $row->body;
	}

If you want a specific row returned you can submit the row number as a
digit in the first parameter::

	$row = $query->row(5);

You can also add a second String parameter, which is the name of a class
to instantiate the row with::

	$query = $this->db->query("SELECT * FROM users LIMIT 1;");
	$row = $query->row(0, 'User');

	echo $row->name; // access attributes
	echo $row->reverse_name(); // or methods defined on the 'User' class

**row_array()**

Identical to the above ``row()`` method, except it returns an array.
Example::

	$query = $this->db->query("YOUR QUERY");

	$row = $query->row_array();

	if( isset( $row ) )
	{
		echo $row[ 'title' ];
		echo $row[ 'name' ];
		echo $row[ 'body' ];
	}

If you want a specific row returned you can submit the row number as a
digit in the first parameter::

	$row = $query->row_array(5);

In addition, you can walk forward/backwards/first/last through your
results using these variations:

	| **$row = $query->first_row()**
	| **$row = $query->last_row()**
	| **$row = $query->next_row()**
	| **$row = $query->previous_row()**

By default they return  an object unless you put the word "array" in the
parameter:

	| **$row = $query->first_row( 'array')**
	| **$row = $query->last_row( 'array')**
	| **$row = $query->next_row( 'array')**
	| **$row = $query->previous_row( 'array')**

.. note:: All the methods above will load the whole result into memory
	(prefetching). Use ``unbuffered_row()`` for processing large
	result sets.

**unbuffered_row()**

This method returns a single result row without prefetching the whole
result in memory as ``row()`` does. If your query has more than one row,
it returns the current row and moves the internal data pointer ahead.

::

	$query = $this->db->query("YOUR QUERY");

	while( $row = $query->unbuffered_row( ) )
	{
		echo $row->title;
		echo $row->name;
		echo $row->body;
	}

You can optionally pass 'object' (default) or 'array' in order to specify
the returned value's type::

	$query->unbuffered_row();		// object
	$query->unbuffered_row( 'object');	// object
	$query->unbuffered_row( 'array');	// associative array

*********************
Custom Result Objects
*********************

You can have the results returned as an instance of a custom class instead
of a ``stdClass`` or array, as the ``result()`` and ``result_array()``
methods allow. This requires that the class is already loaded into memory.
The object will have all values returned from the database set as properties.
If these have been declared and are non-public then you should provide a
``__set()`` method to allow them to be set.

Example::

	class User {

		public $id;
		public $email;
		public $username;

		protected $last_login;

		public function last_login( $format)
		{
			return  $this->last_login->format( $format);
		}

		public function __set( $name, $value)
		{
			if( $name === 'last_login')
			{
				$this->last_login = DateTime::createFromFormat( 'U', $value);
			}
		}

		public function __get( $name)
		{
			if( isset( $this->$name ) )
			{
				return  $this->$name;
			}
		}
	}

In addition to the two methods listed below, the following methods also can
take a class name to return  the results as: ``first_row()``, ``last_row()``,
``next_row()``, and ``previous_row()``.

**custom_result_object()**

Returns the entire result set as an array of instances of the class requested.
The only parameter is the name of the class to instantiate.

Example::

	$query = $this->db->query("YOUR QUERY");

	$rows = $query->custom_result_object( 'User');

	foreach( $rows as $row)
	{
		echo $row->id;
		echo $row->email;
		echo $row->last_login( 'Y-m-d');
	}

**custom_row_object()**

Returns a single row from your query results. The first parameter is the row
number of the results. The second parameter is the class name to instantiate.

Example::

	$query = $this->db->query("YOUR QUERY");

	$row = $query->custom_row_object(0, 'User');

	if( isset( $row ) )
	{
		echo $row->email;   // access attributes
		echo $row->last_login( 'Y-m-d');   // access class methods
	}

You can also use the ``row()`` method in exactly the same way.

Example::

	$row = $query->custom_row_object(0, 'User');

*********************
Result Helper Methods
*********************

**num_rows()**

The number of rows returned by the query. Note: In this example, $query
is the variable that the query result object is assigned to::

	$query = $this->db->query( 'SELECT * FROM my_table');

	echo $query->num_rows();

.. note:: Not all database drivers have a native way of getting the total
	number of rows for a result set. When this is the case, all of
	the data is prefetched and ``count()`` is manually called on the
	resulting array in order to achieve the same result.

**num_fields()**

The number of FIELDS (columns) returned by the query. Make sure to call
the method using your query result object::

	$query = $this->db->query( 'SELECT * FROM my_table');

	echo $query->num_fields();

**free_result()**

It frees the memory associated with the result and deletes the result
resource ID. Normally PHP frees its memory automatically at the end of
script execution. However, if you are running a lot of queries in a
particular script you might want to free the result after each query
result has been generated in order to cut down on memory consumption.

Example::

	$query = $this->db->query( 'SELECT title FROM my_table');

	foreach( $query->result() as $row)
	{
		echo $row->title;
	}

	$query->free_result();  // The $query result object will no longer be available

	$query2 = $this->db->query( 'SELECT name FROM some_table');

	$row = $query2->row();
	echo $row->name;
	$query2->free_result(); // The $query2 result object will no longer be available

**data_seek()**

This method sets the internal pointer for the next result row to be
fetched. It is only useful in combination with ``unbuffered_row()``.

It accepts a positive integer value, which defaults to 0 and returns
TRUE on success or FALSE on failure.

::

	$query = $this->db->query( 'SELECT `field_name` FROM `table_name`');
	$query->data_seek(5); // Skip the first 5 rows
	$row = $query->unbuffered_row();

.. note:: Not all database drivers support this feature and will return  FALSE.
	Most notably - you won't be able to use it with PDO.

***************
Class Reference
***************

.. php:class:: CI_DB_result

	.. php:method:: result([$type = 'object' ])

		:param	string	$type: Type of requested results - array, object, or class name
		:returns:	Array containing the fetched rows
		:rtype:	array

		A wrapper for the ``result_array()``, ``result_object()``
		and ``custom_result_object()`` methods.

		Usage: see `Result Arrays`_.

	.. php:method:: result_array()

		:returns:	Array containing the fetched rows
		:rtype:	array

		Returns the query results as an array of rows, where each
		row is itself an associative array.

		Usage: see `Result Arrays`_.

	.. php:method:: result_object()

		:returns:	Array containing the fetched rows
		:rtype:	array

		Returns the query results as an array of rows, where each
		row is an object of type ``stdClass``.

		Usage: see `Result Arrays`_.

	.. php:method:: custom_result_object( $class_name)

		:param	string	$class_name: Class name for the resulting rows
		:returns:	Array containing the fetched rows
		:rtype:	array

		Returns the query results as an array of rows, where each
		row is an instance of the specified class.

	.. php:method:: row([$n = 0[, $type = 'object' ]])

		:param	int	$n: Index of the query results row to be returned
		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	The requested row or NULL if it doesn't exist
		:rtype:	mixed

		A wrapper for the ``row_array()``, ``row_object() and
		``custom_row_object()`` methods.

		Usage: see `Result Rows`_.

	.. php:method:: unbuffered_row([$type = 'object' ])

		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	Next row from the result set or NULL if it doesn't exist
		:rtype:	mixed

		Fetches the next result row and returns it in the
		requested form.

		Usage: see `Result Rows`_.

	.. php:method:: row_array([$n = 0])

		:param	int	$n: Index of the query results row to be returned
		:returns:	The requested row or NULL if it doesn't exist
		:rtype:	array

		Returns the requested result row as an associative array.

		Usage: see `Result Rows`_.

	.. php:method:: row_object([$n = 0])

		:param	int	$n: Index of the query results row to be returned
                :returns:	The requested row or NULL if it doesn't exist
		:rtype:	stdClass

		Returns the requested result row as an object of type
		``stdClass``.

		Usage: see `Result Rows`_.

	.. php:method:: custom_row_object( $n, $type)

		:param	int	$n: Index of the results row to return
		:param	string	$class_name: Class name for the resulting row
		:returns:	The requested row or NULL if it doesn't exist
		:rtype:	$type

		Returns the requested result row as an instance of the
		requested class.

	.. php:method:: data_seek([$n = 0])

		:param	int	$n: Index of the results row to be returned next
		:returns:	TRUE on success, FALSE on failure
		:rtype:	bool

		Moves the internal results row pointer to the desired offset.

		Usage: see `Result Helper Methods`_.

	.. php:method:: set_row( $key[, $value = NULL])

		:param	mixed	$key: Column name or array of key/value pairs
		:param	mixed	$value: Value to assign to the column, $key is a single field name
		:rtype:	void

		Assigns a value to a particular column.

	.. php:method:: next_row([$type = 'object' ])

		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	Next row of result set, or NULL if it doesn't exist
		:rtype:	mixed

		Returns the next row from the result set.

	.. php:method:: previous_row([$type = 'object' ])

		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	Previous row of result set, or NULL if it doesn't exist
		:rtype:	mixed

		Returns the previous row from the result set.

	.. php:method:: first_row([$type = 'object' ])

		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	First row of result set, or NULL if it doesn't exist
		:rtype:	mixed

		Returns the first row from the result set.

	.. php:method:: last_row([$type = 'object' ])

		:param	string	$type: Type of the requested result - array, object, or class name
		:returns:	Last row of result set, or NULL if it doesn't exist
		:rtype:	mixed

		Returns the last row from the result set.

	.. php:method:: num_rows()

		:returns:	Number of rows in the result set
		:rtype:	int

		Returns the number of rows in the result set.

		Usage: see `Result Helper Methods`_.

	.. php:method:: num_fields()

		:returns:	Number of fields in the result set
		:rtype:	int

		Returns the number of fields in the result set.

		Usage: see `Result Helper Methods`_.

	.. php:method:: field_data()

		:returns:	Array containing field meta-data
		:rtype:	array

		Generates an array of ``stdClass`` objects containing
		field meta-data.

	.. php:method:: free_result()

		:rtype:	void

		Frees a result set.

		Usage: see `Result Helper Methods`_.

	.. php:method:: list_fields()

		:returns:	Array of column names
		:rtype:	array

		Returns an array containing the field names in the
		result set.