text:
import webpack from 'webpack';
import path from 'path';

export default {
  devtool: 'inline-source-map',
  entry: [
    'eventsource-polyfill', // necessary for hot reloading with IE
    'webpack-hot-middleware/client?reload=true', //note that it reloads the page if hot module reloading fails.
    path.resolve(__dirname, 'src/index')
  ],
  target: 'web',
  output: {
    path: __dirname + '/dist', // Note: Physical files are only output by the production build task `npm run build`.
    publicPath: '/',
    filename: 'bundle.js'
  },
  devServer: {
    noInfo: false,
    contentBase: path.resolve(__dirname, 'src')
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoEmitOnErrorsPlugin()
  ],
  module: {
    loaders: [
      {test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['react-hot-loader', 'babel-loader']},
      {test: /(\.css)$/, loaders: ['style-loader', 'css-loader']},
      {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'},
      {test: /\.(woff|woff2)$/, loader: 'url-loader?prefix=font/&limit=5000'},
      {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream'},
      {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml'}
    ]
  }
};


text:
package gedi.util.math.quadrature;

import java.util.function.DoubleUnaryOperator;

/** qagse.java, qags.java, qelg.java, qk21.java, and qpsrt.java are
 * derivative works (translations) of Fortran code by Robert Piessens
 * and Elise de Doncker. These five files are released under GPL
 * by permission of Robert Piessens. In response to my question,
 *

 *  >I would like to have your permission to distribute my
 *  >Java translation of your QUADPACK routines under the
 *  >terms of the GPL. Do I have your permission to do so?
 *

 * Robert Piessens writes:
 *

 *  Date:  Mon, 28 Jan 2002 14:41:58 +0100
 *  To: "Robert Dodier" <robert_dodier@yahoo.com>
 *  From: "Robert Piessens" <Robert.Piessens@cs.kuleuven.ac.be>
 *  Subject: Re: Permission to redistribute QUADPACK translation?
 *
 *  OK, You have my permission.
 *
 *  Robert Piessens
 *

 */
public class Qags implements java.io.Serializable
{
	public int[] iwork = null;
	public double[] work = null;
	public int[] neval = new int[1], last = new int[1];

	public boolean verbose_errors = false;

	public void do_qags ( DoubleUnaryOperator f,double a,double b,double epsabs,double epsrel,double [ ] result,double [ ] abserr, int [ ] ier, int limit ) throws Exception
	{
		int lenw = 4*limit;
		if ( iwork == null || iwork.length != limit ) iwork = new int[ limit ];
		if ( work == null || work.length != lenw ) work = new double[ lenw ];

		int lvl = 0,l1,l2,l3;

		ier [ 0 ] = 6;
		neval[0] = 0;
		last[0] = 0;
		result [ 0 ] = 0;
		abserr [ 0 ] = 0;
		if ( ! ( limit < 1 || lenw < limit * 4 ) )
		{
			l1 = limit+1;
			l2 = limit+l1;
			l3 = limit+l2;

			double[] alist = new double[ limit ];
			double[] blist = new double[ limit ];
			double[] rlist = new double[ limit ];
			double[] elist = new double[ limit ];

			Qagse.do_qagse ( f , a , b , epsabs , epsrel , limit , result , abserr , neval , ier , alist , blist , rlist , elist , iwork , last );

			System.arraycopy( alist, 0, work, 0, limit );
			System.arraycopy( blist, 0, work, limit, limit );
			System.arraycopy( rlist, 0, work, 2*limit, limit );
			System.arraycopy( elist, 0, work, 3*limit, limit );

			lvl = 0;
		}
		if ( ier [ 0 ] == 6 ) lvl = 1;
		if ( ier [ 0 ] != 0 && verbose_errors ) System.err.println ( xerror ( "abnormal return from do_qags" ,ier [ 0 ] ,lvl ) );
		return;
	}

	public static String xerror ( String message, int errno, int level )
	{
		String level_msg;
		switch ( level )
		{
			case -1:
				level_msg = "(one-time warning)";
				break;
			case 0:
				level_msg = "(warning)";
				break;
			case 1:
				level_msg = "(recoverable error)";
				break;
			case 2:
				level_msg = "(fatal error)";
				break;
			default:
				level_msg = "(unknown level: " +level+ ")";
		}
		return message+ ", error number: " +errno+ " " +level_msg;
	}

	public static void main( String[] args )
	{
		double a, b;
		double epsabs = 1e-6, epsrel = 1e-6;
		double[] result = new double[1];
		double[] abserr = new double[1];
		double[] resabs = new double[1];
		double[] resasc = new double[1];

		a = Double.parseDouble( args[0] );
		b = Double.parseDouble( args[1] );
		int limit = Integer.parseInt( args[2] );
		System.err.println( "a: "+a+"  b: "+b+"  limit: "+limit );
		DoubleUnaryOperator integrand = new Gaussian_bump();

		int[] ier = new int[1];
		int lenw = 4*limit;

		Qags q = new Qags();

		try
		{
			q.do_qags( integrand, a, b, epsabs, epsrel, result, abserr, ier, limit );
		}
		catch (Exception e) { e.printStackTrace(); return; }

		System.err.println( "result: "+result[0] );
		System.err.println( "abserr: "+abserr[0] );
		System.err.println( "neval:  "+q.neval[0] );
		System.err.println( "ier:    "+ier[0] );

		System.err.println( "limit: "+limit+" last: "+q.last[0] );
		int i;
		System.err.print( "iwork: " );
		for ( i = 0; i < q.iwork.length; i++ ) System.err.print( q.iwork[i]+" " );
		System.err.println("");
		System.err.println( "a\tb\tI\terr  (from work):" );
		for ( i = 0; i < q.last[0]; i++ )
		{
			System.err.println( q.work[i]+"\t"+q.work[limit+i]+"\t"+q.work[2*limit+i]+"\t"+q.work[3*limit+i] );
		}
	}
}

class Gaussian_bump implements DoubleUnaryOperator
{
	public double applyAsDouble( double x )
	{
		return Math.exp( -(1/2.0)*x*x )/Math.sqrt( 2*Math.PI );
	}
}

redpajama_set_name: RedPajamaGithub


text:
require 'stringio'

require 'fs/fat32/directory_entry'

require 'memory_buffer'

# ////////////////////////////////////////////////////////////////////////////
# // Data definitions.

# A Directory is basically a helper for dealing with directories. It doesn't
# really have a structure of it's own, but builds structure when it needs to
# using DirectoryEntry instances.

# ////////////////////////////////////////////////////////////////////////////
# // Class.

module Fat32
  class Directory
    # Maximum LFN entry span in bytes (LFN entries *can* span clusters).
    MAX_ENT_SIZE = 640

    # Find entry flags.
    FE_DIR = 0
    FE_FILE = 1
    FE_EITHER = 2

    # Get free entry behaviors.
    # Windows 98 returns the first deleted or unallocated entry.
    # Windows XP returns the first unallocated entry.
    # Advantage W98: less allocation, advantage WXP: deleted entries are not overwritten.
    GF_W98 = 0
    GF_WXP = 1

    # Initialization
    def initialize(bs, cluster = nil)
      raise "Nil boot sector" if bs.nil?
      cluster = bs.rootCluster if cluster.nil?

      @bs = bs
      # Allocate one cluster if cluster is zero.
      cluster = @bs.allocClusters(0) if cluster == 0
      @cluster = cluster
      @data, @all_clusters = getDirData
    end

    # ////////////////////////////////////////////////////////////////////////////
    # // Class helpers & accessors.

    # Return all names in directory as a sorted string array.
    def globNames
      names = []
      cluster = @cluster
      mf = StringIO.new(@bs.getCluster(cluster))
      loop do
        (@bs.bytesPerCluster / DIR_ENT_SIZE - 1).times do
          de = DirectoryEntry.new(mf.read)
          break if de.name == ''
          names << de.name.downcase if de.name !=
                                       DirectoryEntry::AF_DELETED && de.name[0] != DirectoryEntry::AF_DELETED
          mf = StringIO.new(de.unused)
          break if mf.size == 0
        end
        data = @bs.getNextCluster(cluster)
        break if data.nil?
        cluster = data[0]
        mf = StringIO.new(data[1])
      end
      names.sort!
    end

    # Return a DirectoryEntry for a specific file (or subdirectory).
    def findEntry(name, flags = FE_EITHER)
      de = nil # found directory entry.
      skip_next = found = false
      offset = 0

      # Look for appropriate records.
      0.step(@data.length - 1, DIR_ENT_SIZE) do|offset|
        # Check allocation status (ignore if deleted, done if not allocated).
        alloc_flags = @data[offset]
        next if alloc_flags == DirectoryEntry::AF_DELETED
        break if alloc_flags == DirectoryEntry::AF_NOT_ALLOCATED

        # Skip LFN entries unless it's the first (last iteration already chewed them all up).
        attrib = @data[offset + ATTRIB_OFFSET]
        if attrib == DirectoryEntry::FA_LFN && (alloc_flags & DirectoryEntry::AF_LFN_LAST != DirectoryEntry::AF_LFN_LAST)
          # Also skip the next entry (it's the base entry for the last dir ent).
          skip_next = true; next
        end
        if skip_next
          skip_next = false; next
        end

        # If a specific type of record was requested, look for only that type.
        # NOTE: You know, it's possible to look ahead and see what the base entry is.
        if flags != FE_EITHER && attrib != DirectoryEntry::FA_LFN
          next if flags == FE_DIR && (attrib & DirectoryEntry::FA_DIRECTORY == 0)
          next if flags == FE_FILE && (attrib & DirectoryEntry::FA_DIRECTORY != 0)
        end

        # Potential match... get a DirectoryEntry & stop if found.
        de = DirectoryEntry.new(@data[offset, MAX_ENT_SIZE])
        # TODO: - what if the name ends with a dot & there's another dot in the name?
        if de.name.downcase == name.downcase || de.shortName.downcase == name.downcase
          found = true
          break
        end
      end
      return nil unless found
      parentLoc = offset.divmod(@bs.bytesPerCluster)
      de.parentCluster = @all_clusters[parentLoc[0]].number
      de.parentOffset = parentLoc[1]
      de
    end

    def mkdir(name)
      dir = createFile(name)
      data = FileData.new(dir, @bs)
      dir.setAttribute(DirectoryEntry::FA_ARCHIVE, false)
      dir.setAttribute(DirectoryEntry::FA_DIRECTORY)
      dir.writeEntry(@bs)

      # Write dot and double dot directories.
      dot = DirectoryEntry.new; dotdot = DirectoryEntry.new
      dot.name = "."; dotdot.name = ".."
      dot.setAttribute(DirectoryEntry::FA_ARCHIVE, false)
      dot.setAttribute(DirectoryEntry::FA_DIRECTORY)
      dotdot.setAttribute(DirectoryEntry::FA_ARCHIVE, false)
      dotdot.setAttribute(DirectoryEntry::FA_DIRECTORY)
      buf = dot.raw + dotdot.raw
      data.write(buf)
      dir.firstCluster = data.firstCluster
      dir.writeEntry(@bs)

      # Update firsCluster in . and .. (if .. is root then it's 0, not 2).
      dot.firstCluster = dir.firstCluster
      dotdot.firstCluster = dir.parentCluster == 2 ? 0 : dir.parentCluster
      buf = dot.raw + dotdot.raw
      data.rewind
      data.write(buf)
    end

    def createFile(name)
      de = DirectoryEntry.new; de.name = name
      until findEntry(de.shortName).nil?
        raise "Duplicate file name: #{de.shortName}" unless de.shortName.include?("~")
        de.incShortName
      end
      de.parentOffset, de.parentCluster = getFirstFreeEntry(de.numEnts)
      de.writeEntry(@bs)
      @data, @all_clusters = getDirData
      de
    end

    # ////////////////////////////////////////////////////////////////////////////
    # // Utility functions.

    # Get free entry or entries in directory data. If not exist, allocate cluster.
    def getFirstFreeEntry(num_entries = 1, behavior = GF_W98)
      0.step(@data.size - 1, DIR_ENT_SIZE) do |offset|
        next if @data[offset] != DirectoryEntry::AF_NOT_ALLOCATED && @data[offset] != DirectoryEntry::AF_DELETED
        num = countFreeEntries(behavior, @data[offset..-1])
        return offset.divmod(@bs.bytesPerCluster)[1], getClusterStatus(offset).number if num >= num_entries
      end

      # Must allocate another cluster.
      cluster = @bs.allocClusters(@cluster)
      @data += MemoryBuffer.create(@bs.bytesPerCluster)
      @all_clusters << mkClusterStatus(cluster, 0)
      return 0, cluster
    end

    # Return the number of contiguous free entries starting at buf[0] according to behavior.
    def countFreeEntries(behavior, buf)
      num_free = 0
      0.step(buf.size - 1, DIR_ENT_SIZE) do |offset|
        if isFree(buf[offset], behavior)
          num_free += 1
        else
          return num_free
        end
      end
      num_free
    end

    def isFree(allocStatus, behavior)
      if behavior == GF_W98
        return true if allocStatus == DirectoryEntry::AF_NOT_ALLOCATED || allocStatus == DirectoryEntry::AF_DELETED
      elsif behavior == GF_WXP
        return true if allocStatus == DirectoryEntry::AF_NOT_ALLOCATED
      else
        raise "Fat32Directory#isFree: Unknown behavior: #{behavior}"
      end
      false
    end

    def getDirData
      allClusters = []
      clus = @cluster
      allClusters << mkClusterStatus(clus, 0)
      buf = @bs.getCluster(clus); data = nil
      while (data = @bs.getNextCluster(clus)) != nil
        clus = data[0]; buf += data[1]
        allClusters << mkClusterStatus(clus, 0)
      end
      return buf, allClusters
    end

    # TODO: - Loose this idea.
    def mkClusterStatus(num, dirty)
      status = OpenStruct.new
      status.number = num
      status.dirty = dirty
      status
    end

    def getClusterStatus(offset)
      idx = offset.divmod(@bs.bytesPerCluster)[0]
      @all_clusters[idx]
    end
  end
end # module Fat32


text:
@implementation CoverStoryDocumentController

// Allow us to open folders
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel
                      forTypes:(NSArray *)extensions {
  [openPanel setCanChooseDirectories:YES];
  return [openPanel runModalForTypes:extensions];
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="#xslt"?>
<!DOCTYPE xsl:stylesheet [<!ATTLIST xsl:stylesheet id ID #IMPLIED>]>
<xsl:stylesheet id="xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="xsl:template">
<xsl:if test="//result[ancestor::xsl:stylesheet and parent::xsl:if[contains(@test,'ancestor::')]]"><result><xsl:value-of select="'PASS'"/></result></xsl:if>
</xsl:template>
</xsl:stylesheet>


text:
<?php
/**
 * @author Alexey Samoylov <alexey.samoylov@gmail.com>
 */

namespace Tigris\Telegram\Types\Scalar;

use Tigris\Telegram\Types\Base\BaseScalar;

/**
 * Class ScalarInteger
 * @package Tigris\Types
 */
abstract class ScalarInteger extends BaseScalar
{
    /**
     * @inheritdoc
     * @return integer
     */
    public static function readData($data)
    {
        return (integer)$data;
    }
}


text:
var parseLink = require('parse-link-header')
  , through = require('through')
  , request = require('request')
  , async = require('async')
  , url = require('url')

module.exports = createStream

function createStream(opts) {
  opts = opts || {}
  opts.host = opts.host || 'api.github.com'
  opts.pathPrefix = opts.pathPrefix || ''
  if (!opts.user) throw new Error('"user" must be supplied')
  if (!opts.repo) throw new Error('"repo" must be supplied')

  // I'd like to switch this over to es.readable
  // or the streams2 API in the future, but for
  // now this works just fine :)
  var stream = through()

  stream.writable = false
  delete stream.write

  var lastlink = false
    , nextlink = url.format({
        protocol: 'https'
      , hostname: opts.host
      , pathname: opts.pathPrefix + '/repos/' + opts.user + '/' + opts.repo + '/commits'
      , query: options({
          per_page: String(opts.per_page || 30)
        , since: opts.since
        , until: opts.until
        , sha: opts.sha
        , author: opts.author
      })
    })

  async.whilst(function() {
    return !lastlink
  }, function(next) {
    request.get(nextlink, {
      headers: opts.token ? {
        'User-Agent': 'github-commit-stream'
      , 'Authorization': 'token ' + opts.token
      } : {'User-Agent': 'github-commit-stream'}
    }, function(err, res, body) {
      if (err) return next(err)

      try {
        body = JSON.parse(body)
      } catch(e) {
        return next(err)
      }

      var link = parseLink(res.headers.link || '')
      nextlink = link && link.next && link.next.url
      lastlink = !nextlink

      if (body.message) return next(new Error(body.message))

      body.forEach(function(commit) {
        stream.queue(commit)
      })

      next()
    })
  }, function(err) {
    if (err) return stream.emit('error', err)
    stream.queue(null)
  })

  return stream
}

// Returns a copy of "obj" containing
// only the keys with truthy values.
function options(obj) {
  return Object.keys(obj).reduce(function(memo, key) {
    if (obj[key]) memo[key] = obj[key]
    return memo
  }, {})
}


text:
#include <platform.hpp>
#include <kernel_headers/set.hpp>
#include <traits.hpp>
#include <mutex>
#include <map>
#include <backend.hpp>

using cl::Buffer;
using cl::Program;
using cl::Kernel;
using cl::make_kernel;
using cl::EnqueueArgs;
using cl::NDRange;
using std::string;

namespace opencl {
namespace kernel {

//TODO: Build only once for each instance of a kernel.  NOTE: Static objects in
//      different instances of templates are the same.
template<typename T>
void
set(Buffer &ptr, T val, const size_t &elements)
{
    try {
        static std::once_flag compileFlags[DeviceManager::MAX_DEVICES];
        static std::map<int, Program*>   setProgs;
        static std::map<int, Kernel *> setKernels;

        int device = getActiveDeviceId();

        std::call_once( compileFlags[device], [device] () {
                    Program::Sources setSrc;
                    setSrc.emplace_back(set_cl, set_cl_len);

                    setProgs[device] = new Program(getContext(), setSrc);

                    string opt = string("-D T=") + dtype_traits<T>::getName();
                    if (std::is_same<T, double>::value ||
                        std::is_same<T, cdouble>::value) {
                        opt << " -D USE_DOUBLE";
                    }
                    setProgs[device]->build(opt.c_str());

                    setKernels[device] = new Kernel(*setProgs[device], "set");
                });

        auto setKern = make_kernel<Buffer, T, const unsigned long>(setKernels[device]);
        setKern(EnqueueArgs(getQueue(), NDRange(elements)), ptr, val, elements);
        CL_DEBUG_FINISH(getQueue());
    } catch (cl::Error &err) {
        CL_TO_AF_ERROR(err);
        throw;
    }
}

}
}


text:
FactoryGirl.define do
  factory :user do
    email "test@example.com"
    coordinates "POINT(112.5 5655.6)"
  end
end


text: puts File.expand_path('../../lib', __FILE__)


text:
namespace LibGui
{
	partial class RunningGraphControl
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Component Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.maxValueLabel = new System.Windows.Forms.Label();
			this.minValueLabel = new System.Windows.Forms.Label();
			this.panel1 = new System.Windows.Forms.Panel();
			this.panel1.SuspendLayout();
			this.SuspendLayout();
			//
			// maxValueLabel
			//
			this.maxValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.maxValueLabel.BackColor = System.Drawing.Color.Transparent;
			this.maxValueLabel.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.maxValueLabel.ForeColor = System.Drawing.Color.Yellow;
			this.maxValueLabel.Location = new System.Drawing.Point(0, 0);
			this.maxValueLabel.Name = "maxValueLabel";
			this.maxValueLabel.Size = new System.Drawing.Size(25, 10);
			this.maxValueLabel.TabIndex = 0;
			this.maxValueLabel.Text = "-";
			this.maxValueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			//
			// minValueLabel
			//
			this.minValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.minValueLabel.BackColor = System.Drawing.Color.Transparent;
			this.minValueLabel.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.minValueLabel.ForeColor = System.Drawing.Color.Yellow;
			this.minValueLabel.Location = new System.Drawing.Point(0, 140);
			this.minValueLabel.Name = "minValueLabel";
			this.minValueLabel.Size = new System.Drawing.Size(25, 13);
			this.minValueLabel.TabIndex = 1;
			this.minValueLabel.Text = "-";
			this.minValueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			//
			// panel1
			//
			this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)));
			this.panel1.BackColor = System.Drawing.Color.Transparent;
			this.panel1.Controls.Add(this.maxValueLabel);
			this.panel1.Controls.Add(this.minValueLabel);
			this.panel1.Location = new System.Drawing.Point(0, 0);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(25, 150);
			this.panel1.TabIndex = 2;
			//
			// RunningGraphControl
			//
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.panel1);
			this.Name = "RunningGraphControl";
			this.Size = new System.Drawing.Size(517, 150);
			this.Paint += new System.Windows.Forms.PaintEventHandler(this.RunningGraphControl_Paint);
			this.panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}

		#endregion

		private System.Windows.Forms.Label maxValueLabel;
		private System.Windows.Forms.Label minValueLabel;
		private System.Windows.Forms.Panel panel1;
	}
}


text:
/*
 * renderer.h
 *
 *  Created on: Oct 16, 2014
 *      Author: kenaco
 */

#ifndef RENDERER_H_
#define RENDERER_H_

#include <SDL.h>
#include <SDL_video.h>
#include <assimp/scene.h>
#include <glm/glm.hpp>
#include <string>

#include "shader.hpp"
#include "scene.hpp"
#include "texture.hpp"

#include "camera.hpp"

enum class Target { WINDOW, SHADOWMAP };

/**
 * Trieda implementuje zakladne vykreslenie sceny,
 * sluzi ako zaklad pre dalsie odvodene renderovacie triedy
 */
class Renderer {
protected:
	//view
	SDL_GLContext gl;

	// model
	Scene* scene;
	std::string activeCamera;

	Shader* shader;
	unsigned int mvpUniformId_;
	unsigned int modelUniformId_;
	unsigned int viewUniformId_;
	unsigned int depthBiasmvpUniformId_;
	unsigned int shadowMapUniformId_;
	unsigned int lightInvDirectionUniformId_;

	Camera lightCamera;
	ShadowMap* shadowMap_;
	Shader* shadowMapShader_;
	unsigned int depthmvpUniformId_;

	unsigned int qvbo;
	Shader* qshader;
	unsigned int qTextureUniformId;

//	unsigned int lightPositionUniformId_;
//	unsigned int lightColorUniformId_;
//	unsigned int lightIntensityUniformId_;

public:
	//TODO toto nwm ci tu musi byt, popremyslat o tom
	unsigned int width;
	unsigned int height;

	Renderer(SDL_Window* window, const char* vertexShader, const char* fragShader,
			 unsigned int width, unsigned int height);
	virtual ~Renderer();

	void setScene(Scene* scene);
	Camera* getActiveCamera();

	virtual void render();
};

#endif /* RENDERER_H_ */


text:
/**
 * 对应接口文档地址
 * http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html
 */
package wechat.message;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import play.Logger;
import utils.HttpUtils;
import wechat.message.template.TemplateMsgBody;
import wechat.message.template.TemplateMsgData;
import wechat.token.TokenProxy;

/**
 * 模板消息接口
 * @author ChengNing
 * @date   2014年12月24日
 */
public class TemplateMsg {

	//设置所属行业接口地址
	public static final String SET_INDUSTRY_URL = "https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=";
	//添加模板id接口地址
	public static final String GET_TEMPLATE_ID_URL = "https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=";
	//发送模板消息接口地址
	public static final String SEND_MSG_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";

	private String accessToken;

	public TemplateMsg(){
		this.accessToken = TokenProxy.accessToken();
	}

	/**
	 * 设置所属行业
	 * 接口说明中没有给出
	 */
	public void setIndustry(String...industrys){
		String url = SET_INDUSTRY_URL + this.accessToken;
		JsonObject json = new JsonObject();
		for(int i=0;i<industrys.length;i++){
			json.addProperty("industry_id" + i, industrys[i]);
		}
		String data = json.toString();
		HttpUtils.post(url, data);
	}

	/**
	 * 获得模板ID
	 * @param templateIdShort    template_id_short
	 * @return                   template_id
	 */
	public String getTemplateId(String templateIdShort){
		Logger.info("get template id,short template id is:" + templateIdShort);
		//构造请求数据
		String url = GET_TEMPLATE_ID_URL + this.accessToken;
		JsonObject json = new JsonObject();
		json.addProperty("template_id_short", templateIdShort);
		String data = json.toString();
		String result = HttpUtils.post(url, data);
		Logger.info("post result:" + result);
		//解析请求数据
		JsonObject resultJson = new JsonParser().parse(result).getAsJsonObject();
		if(resultJson.get("errcode").getAsString().equals("0"))
			return resultJson.get("template_id").getAsString();
		Logger.error("get template id error:" + resultJson.get("errmsg").getAsString());
		return null;
	}

	/**
	 * 发送模板消息
	 */
	public String send(TemplateMsgBody postData){
		Logger.info("send template message");
		//构造请求数据
		String url = SEND_MSG_URL + this.accessToken;
		JsonObject json = new JsonObject();
		json.addProperty("touser", postData.getTouser());
		json.addProperty("template_id", postData.getTemplateId());
		json.addProperty("url", postData.getUrl());
		json.addProperty("topcolor", postData.getTopcolor());
		JsonObject jsonData = new JsonObject();
		for (TemplateMsgData data : postData.getData()) {
			JsonObject keynote = new JsonObject();
			keynote.addProperty("value", data.getValue());
			keynote.addProperty("color", data.getColor());
			jsonData.add(data.getName(), keynote);
		}
		json.add("data", jsonData);

		String data = json.toString();
		String result = HttpUtils.post(url, data);
		Logger.info("post result:" + result);
		//解析请求数据

		JsonObject resultJson = new JsonParser().parse(result).getAsJsonObject();
		if(resultJson.get("errcode").getAsString().equals("0"))
			return resultJson.get("msgid").getAsString();
		Logger.error("send template message error:" + resultJson.get("errmsg").getAsString());
		return null;
	}

}


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

import java.awt.Component;

import javax.swing.JButton;

import org.junit.Before;
import org.junit.Test;

import docking.DialogComponentProvider;
import docking.action.DockingActionIf;
import generic.test.AbstractGenericTest;
import ghidra.app.plugin.core.instructionsearch.InstructionSearchPlugin;
import ghidra.app.plugin.core.instructionsearch.ui.*;
import ghidra.app.plugin.core.table.TableComponentProvider;

/**
 * Screenshots for help/topics/Search/Search_Instruction_Patterns.htm
 */
public class InstructionPatternSearchScreenShots extends AbstractSearchScreenShots {

	private InstructionSearchPlugin instructionSearchPlugin;

	@Override
	@Before
	public void setUp() throws Exception {

		super.setUp();

		instructionSearchPlugin = env.getPlugin(InstructionSearchPlugin.class);

		env.showTool();
	}

	@Test
	public void testSearchInstructionsManualSearchDialog() {

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);

		waitForSwing();

		DialogComponentProvider dialog = getDialog();
		JButton manualEntryButton =
			(JButton) AbstractGenericTest.findComponentByName(dialog.getComponent(),
				"manual entry");
		pressButton(manualEntryButton);

		InsertBytesWidget comp = waitForDialogComponent(InsertBytesWidget.class);

		captureComponent(comp.getComponent());
	}

	/**
	 * Grabs a screenshot of the full {@link InstructionSearchDialog} window.
	 */
	@Test
	public void testSearchInstructionPatterns() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		captureDialog(DialogComponentProvider.class, 900, 461);
	}

	/**
	 * Grabs a screenshot of the {@link InstructionTable} panel within the main
	 * instruction search dialog.
	 */
	@Test
	public void testSearchInstructionPatternsInstructionTable() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		Component instrTable =
			findComponentByName(this.getDialog().getComponent(), "InstructionTablePanel");

		captureComponent(instrTable);
	}

	/**
	 * Grabs a screenshot of the {@link PreviewTable} panel within the main
	 * instruction search dialog.
	 */
	@Test
	public void testSearchInstructionPatternsPreviewTable() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		Component previewTable =
			findComponent(this.getDialog().getComponent(), PreviewTablePanel.class);

		captureComponent(previewTable);
	}

	/**
	 * Grabs a screenshot of the {@link ControlPanel} within the main instruction search dialog.
	 */
	@Test
	public void testSearchInstructionPatternsControlPanel() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		Component controlPanel =
			findComponent(this.getDialog().getComponent(), ControlPanel.class);

		captureComponent(controlPanel);
	}

	/**
	 * Grabs a screenshot of the toolbar for the {@link InstructionTable} within the main
	 * instruction search dialog.
	 */
	@Test
	public void testSearchInstructionPatternsInstructionTableToolbar() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		Component instructionTable =
			findComponent(this.getDialog().getComponent(), InstructionTable.class);

		InstructionTable instrTable = (InstructionTable) instructionTable;
		captureComponent(instrTable.getToolbar());
	}

	/**
	 * Grabs a screenshot of the toolbar for the {@link PreviewTable} within the main
	 * instruction search dialog.
	 */
	@Test
	public void testSearchInstructionPatternsPreviewTableToolbar() {
		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		Component previewTable =
			findComponent(this.getDialog().getComponent(), PreviewTable.class);

		PreviewTable prevTable = (PreviewTable) previewTable;
		captureComponent(prevTable.getToolbar());
	}

	/**
	 * Grabs a screenshot of the results table displayed when performing a search using the
	 * {@link InstructionSearchDialog}.
	 */
	@Test
	public void testSearchInstructionPatternsResultsTable() {

		moveTool(500, 500);

		goToListing(0x00401221, "Address", false);
		makeSelection(0x00401221, 0x00401236);
		waitForSwing();

		DockingActionIf openSearchDialogAction =
			getAction(instructionSearchPlugin, "Search Instruction Patterns");
		performAction(openSearchDialogAction, true);
		waitForSwing();

		DialogComponentProvider dialog = getDialog();
		JButton searchButton =
			(JButton) AbstractGenericTest.findAbstractButtonByText(dialog.getComponent(),
				"Search All");
		pressButton(searchButton);

		waitForComponentProvider(TableComponentProvider.class);

		captureIsolatedProvider(TableComponentProvider.class, 500, 450);
	}
}


text:
package org.apache.geronimo.jee.security;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import org.apache.geronimo.jee.application.AbstractSecurity;
import org.apache.geronimo.jee.deployment.Pattern;

/**
 *
 *                 Reference to security element in a parent module.
 *
 *
 *
Java class for security-refType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="security-refType">
 *   <complexContent>
 *     <extension base="{http://geronimo.apache.org/xml/ns/j2ee/application-2.0}abstract-securityType">
 *       <choice>
 *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ref" type="{http://geronimo.apache.org/xml/ns/deployment-1.2}patternType"/>
 *       </choice>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "security-refType", propOrder = {
    "name",
    "ref"
})
public class SecurityRef
    extends AbstractSecurity
    implements Serializable
{

    private final static long serialVersionUID = 12343L;
    protected String name;
    protected Pattern ref;

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the ref property.
     *
     * @return
     *     possible object is
     *     {@link Pattern }
     *
     */
    public Pattern getRef() {
        return ref;
    }

    /**
     * Sets the value of the ref property.
     *
     * @param value
     *     allowed object is
     *     {@link Pattern }
     *
     */
    public void setRef(Pattern value) {
        this.ref = value;
    }

}


text:
package com.java110.dto.service;

import com.java110.dto.PageDto;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName FloorDto
 * @Description 服务实现数据层封装
 * @Author wuxw
 * @Date 2019/4/24 8:52
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class ServiceBusinessDto extends PageDto implements Serializable {

    private String businessTypeCd;
private String invokeType;
private String messageTopic;
private String retryCount;
private String serviceBusinessId;
private String url;
private String timeout;
private String name;
private String description;

    private Date createTime;

    private String statusCd = "0";

    public String getBusinessTypeCd() {
        return businessTypeCd;
    }
public void setBusinessTypeCd(String businessTypeCd) {
        this.businessTypeCd = businessTypeCd;
    }
public String getInvokeType() {
        return invokeType;
    }
public void setInvokeType(String invokeType) {
        this.invokeType = invokeType;
    }
public String getMessageTopic() {
        return messageTopic;
    }
public void setMessageTopic(String messageTopic) {
        this.messageTopic = messageTopic;
    }
public String getRetryCount() {
        return retryCount;
    }
public void setRetryCount(String retryCount) {
        this.retryCount = retryCount;
    }
public String getServiceBusinessId() {
        return serviceBusinessId;
    }
public void setServiceBusinessId(String serviceBusinessId) {
        this.serviceBusinessId = serviceBusinessId;
    }
public String getUrl() {
        return url;
    }
public void setUrl(String url) {
        this.url = url;
    }
public String getTimeout() {
        return timeout;
    }
public void setTimeout(String timeout) {
        this.timeout = timeout;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getStatusCd() {
        return statusCd;
    }

    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }

    public String getName() {
        return name;
    }

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

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}


text:
#ifndef _WORDEXP_H_
#define	_WORDEXP_H_

#include <sys/cdefs.h>
#include <sys/_types.h>

#if __XSI_VISIBLE && !defined(_SIZE_T_DECLARED)
typedef	__size_t	size_t;
#define	_SIZE_T_DECLARED
#endif

typedef struct {
	__size_t	we_wordc;	/* count of words matched */
	char		**we_wordv;	/* pointer to list of words */
	__size_t	we_offs;	/* slots to reserve in we_wordv */
	char		*we_strings;	/* storage for wordv strings */
	__size_t	we_nbytes;	/* size of we_strings */
} wordexp_t;

/*
 * Flags for wordexp().
 */
#define	WRDE_APPEND	0x1		/* append to previously generated */
#define	WRDE_DOOFS	0x2		/* we_offs member is valid */
#define	WRDE_NOCMD	0x4		/* disallow command substitution */
#define	WRDE_REUSE	0x8		/* reuse wordexp_t */
#define	WRDE_SHOWERR	0x10		/* don't redirect stderr to /dev/null */
#define	WRDE_UNDEF	0x20		/* disallow undefined shell vars */

/*
 * Return values from wordexp().
 */
#define	WRDE_BADCHAR	1		/* unquoted special character */
#define	WRDE_BADVAL	2		/* undefined variable */
#define	WRDE_CMDSUB	3		/* command substitution not allowed */
#define	WRDE_NOSPACE	4		/* no memory for result */
#if __XSI_VISIBLE
#define	WRDE_NOSYS	5		/* obsolete, reserved */
#endif
#define	WRDE_SYNTAX	6		/* shell syntax error */

__BEGIN_DECLS
int	wordexp(const char * __restrict, wordexp_t * __restrict, int);
void	wordfree(wordexp_t *);
__END_DECLS

#endif /* !_WORDEXP_H_ */


text:
package org.dspace.xoai.exceptions;

/**
 *
 * @author Lyncode Development Team <dspace@lyncode.com>
 */
@SuppressWarnings("serial")
public class CompilingException extends Exception
{

    public CompilingException()
    {
    }

    public CompilingException(String arg0)
    {
        super(arg0);
    }

    public CompilingException(Throwable arg0)
    {
        super(arg0);
    }

    public CompilingException(String arg0, Throwable arg1)
    {
        super(arg0, arg1);
    }

}


text:
package de.tudarmstadt.informatik.tk.assistance.sdk.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.telephony.TelephonyManager;

/**
 * @author Wladimir Schmidt (wlsc.dev@gmail.com)
 * @date 31.10.2015
 */
public enum ConnectionUtils {
    ;

    /**
     * Returns device's network information state
     *
     * @param context
     * @return
     */
    private static NetworkInfo getActiveNetwork(Context context) {

        ConnectivityManager connectivityManager = getConnectivityManager(context);
        return connectivityManager.getActiveNetworkInfo();
    }

    /**
     * Supplies a connectivity manager
     *
     * @param context
     * @return
     */
    private static ConnectivityManager getConnectivityManager(Context context) {

        return (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
    }

    /**
     * Checks if mobile is connected / active
     *
     * @param context
     * @return
     */
    public static boolean isConnectedMobile(Context context) {

        NetworkInfo activeNetwork = getActiveNetwork(context);

        if (activeNetwork != null) {
            if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
                return true;
            }
        }

        return false;
    }

    /**
     * Checks if Wi-Fi is connected / active
     *
     * @param context
     * @return
     */
    public static boolean isConnectedWifi(Context context) {

        NetworkInfo activeNetwork = getActiveNetwork(context);

        if (activeNetwork != null) {
            if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
                return true;
            }
        }

        return false;
    }

    /**
     * Checks if device is connected to the internet
     *
     * @param context
     * @return
     */
    public static boolean isOnline(Context context) {

        NetworkInfo networkInfo = getActiveNetwork(context);
        return networkInfo != null && networkInfo.isConnectedOrConnecting();
    }

    /**
     * Checks if airplane mode enabled right now
     *
     * @param context
     * @return
     */
    public static boolean isAirplaneModeEnabled(Context context) {

        if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {

            return Settings.System.getInt(context.getContentResolver(),
                    Global.AIRPLANE_MODE_ON,
                    0) == 1;
        } else {
            return Settings.System.getInt(context.getContentResolver(),
                    Settings.System.AIRPLANE_MODE_ON,
                    0) == 1;
        }
    }

    /**
     * Checks if current connection with the internet is metered (charges apply)
     *
     * @param context
     * @return
     */
    public static boolean isConnectionMetered(Context context) {

        ConnectivityManager manager = getConnectivityManager(context);
        return manager != null && manager.isActiveNetworkMetered();
    }

    /**
     * Gives current network connection type
     *
     * @param context
     * @return
     */
    public static int getConnectionType(Context context) {

        int result = -1;
        NetworkInfo networkInfo = getActiveNetwork(context);
        TelephonyManager telephonyManager =
                (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        if (networkInfo == null) {
            return -1;
        }

        int networkType = networkInfo.getType();

        switch (networkType) {
            case ConnectivityManager.TYPE_WIMAX:
                result = ConnectivityManager.TYPE_WIMAX;
                break;
            case ConnectivityManager.TYPE_MOBILE:
                switch (telephonyManager.getNetworkType()) {
                    case TelephonyManager.NETWORK_TYPE_LTE:
                        result = TelephonyManager.NETWORK_TYPE_LTE;
                        break;
                    case TelephonyManager.NETWORK_TYPE_HSPA:
                        result = TelephonyManager.NETWORK_TYPE_HSPA;
                        break;
                    case TelephonyManager.NETWORK_TYPE_HSPAP:
                        result = TelephonyManager.NETWORK_TYPE_HSPAP;
                        break;
                    case TelephonyManager.NETWORK_TYPE_HSDPA:
                        result = TelephonyManager.NETWORK_TYPE_HSDPA;
                        break;
                    case TelephonyManager.NETWORK_TYPE_EDGE:
                        result = TelephonyManager.NETWORK_TYPE_EDGE;
                        break;
                    case TelephonyManager.NETWORK_TYPE_GPRS:
                        result = TelephonyManager.NETWORK_TYPE_GPRS;
                        break;
                    case TelephonyManager.NETWORK_TYPE_CDMA:
                        result = TelephonyManager.NETWORK_TYPE_CDMA;
                        break;
                    case TelephonyManager.NETWORK_TYPE_UMTS:
                        result = TelephonyManager.NETWORK_TYPE_UMTS;
                        break;
                    default:
                        break;
                }
                break;
            default:
                break;
        }

        return result;
    }
}


text:
namespace boost
{

void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined

} // namespace boost

#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))

#else
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
# define BOOST_ASSERT(expr) assert(expr)
#endif


text:
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/oidc`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'omniauth-oidc'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install omniauth-oidc

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-oidc.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
    <?php
        function current_week($date_of_firstday="2011-2-10"){
            $year = substr($date_of_firstday,0,4);
            $month = substr($date_of_firstday,5,1);
            $day = substr($date_of_firstday,7,2);
            $timestamp_of_first_day = mktime(0,0,0,$month,$day,$year);
            $timestamp_of_current_day = mktime(0,0,0,date('n'),date('d'),date('Y'));
            $cha = ($timestamp_of_current_day-$timestamp_of_first_day)/60/60/24;
            $zhou = (int)(($cha)/7 +1);
            return $zhou;
        }
        $sdate = current_week('2017-8-21'); //开学第一周星期一的日期

        $attributes = array('class' => 'form-horizontal', 'id' => 'survey');
        $hidden = array('name' => $this->session->userdata('name'), 'survey' => $sdate);
        echo form_open('survey/post', $attributes, $hidden);
    ?>

01. 你对科任老师的教学责任感的评价

A. 很负责    B. 负责     C. 不够负责

                    <select name="Q101" id="Q101" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q102" id="Q102" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q103" id="Q103" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q104" id="Q104" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q105" id="Q105" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q106" id="Q106" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q107" id="Q107" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q108" id="Q108" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q109" id="Q109" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

02. 你对科任老师的喜欢程度是

A. 很喜欢    B. 喜欢     C. 不喜欢

                    <select name="Q201" id="Q201" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q202" id="Q202" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q203" id="Q203" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q204" id="Q204" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q205" id="Q205" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q206" id="Q206" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q207" id="Q207" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q208" id="Q208" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q209" id="Q209" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

03. 你觉得你的科任老师上课的容量大多数时候是

A. 适中     B. 太大     C. 太小

                    <select name="Q301" id="Q301" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q302" id="Q302" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q303" id="Q303" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q304" id="Q304" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q305" id="Q305" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q306" id="Q306" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q307" id="Q307" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q308" id="Q308" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q309" id="Q309" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

04. 你觉得科任老师布置的作业量大多数时候是

A. 没有     B. 偶尔有    C. 经常有

                    <select name="Q401" id="Q401" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q402" id="Q402" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q403" id="Q403" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q404" id="Q404" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q405" id="Q405" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q406" id="Q406" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q407" id="Q407" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q408" id="Q408" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q409" id="Q409" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

05. 你的老师有在教室抽烟或接听手机的行为吗?

A. 没有     B. 偶尔有    C. 经常有

                    <select name="Q501" id="Q501" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q502" id="Q502" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q503" id="Q503" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q504" id="Q504" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q505" id="Q505" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q506" id="Q506" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q507" id="Q507" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q508" id="Q508" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q509" id="Q509" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

06. 你的作业老师是怎样批改的?

A. 全收全改   B. 部分收改   C. 很少批改

                    <select name="Q601" id="Q601" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q602" id="Q602" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q603" id="Q603" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q604" id="Q604" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q605" id="Q605" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q606" id="Q606" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q607" id="Q607" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q608" id="Q608" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q609" id="Q609" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

07. 你认为你的科任老师晚自习辅导到位吗?

A. 很到位    B. 一般     C. 不爱进教室

                    <select name="Q701" id="Q701" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q702" id="Q702" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q703" id="Q703" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q704" id="Q704" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q705" id="Q705" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q706" id="Q706" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q707" id="Q707" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q708" id="Q708" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q709" id="Q709" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

08. 你认为你的老师爱找学生谈话或辅导吗?

A. 经常     B. 偶尔     C. 基本不谈

                    <select name="Q801" id="Q801" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q802" id="Q802" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q803" id="Q803" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q804" id="Q804" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q805" id="Q805" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q806" id="Q806" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q807" id="Q807" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q808" id="Q808" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q809" id="Q809" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

09. 你认为你的老师对导学稿的使用好吗?

A. 好      B. 一般     C. 不行

                    <select name="Q901" id="Q901" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q902" id="Q902" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q903" id="Q903" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q904" id="Q904" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q905" id="Q905" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q906" id="Q906" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q907" id="Q907" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q908" id="Q908" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q909" id="Q909" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

10. 你认为老师上课时课堂教学互动(师生、生生)的情况如何?

A. 活跃     B. 一般     C. 没有

                    <select name="Q1001" id="Q1001" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">语文</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1002" id="Q1002" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">数学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1003" id="Q1003" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">英语</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1004" id="Q1004" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">物理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1005" id="Q1005" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">化学</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1006" id="Q1006" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">生物</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1007" id="Q1007" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">政治</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1008" id="Q1008" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">历史</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

                    <select name="Q1009" id="Q1009" class="selectpicker form-control" validate="required:true" min="1">
                        <option value="0">地理</option><option value="3">A</option><option value="2">B</option><option value="1">C</option>
                    </select>

你的建议

                <textarea id="content" name="content" class="form-control col-md-12" rows="5" style="resize:none;"></textarea>

                <button type="submit" class="btn btn-success">提交答卷</button>

    </form>


text:
#ifndef OVR_Std_h
#define OVR_Std_h

#include "OVR_Types.h"
#include <stdarg.h> // for va_list args
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#if !defined(OVR_OS_WINCE) && defined(OVR_CC_MSVC) && (OVR_CC_MSVC >= 1400)
#define OVR_MSVC_SAFESTRING
#include <errno.h>
#endif

// Wide-char funcs
#include <wchar.h>
#include <wctype.h>

namespace OVR {

#if defined(OVR_OS_WIN32)
inline char* OVR_CDECL OVR_itoa(int val, char *dest, UPInt destsize, int radix)
{
#if defined(OVR_MSVC_SAFESTRING)
    _itoa_s(val, dest, destsize, radix);
    return dest;
#else
    OVR_UNUSED(destsize);
    return itoa(val, dest, radix);
#endif
}
#else // OVR_OS_WIN32
inline char* OVR_itoa(int val, char* dest, unsigned int len, int radix)
{
    if (val == 0)
    {
        if (len > 1)
        {
            dest[0] = '0';
            dest[1] = '\0';
        }
        return dest;
    }

    int cur = val;
    unsigned int i    = 0;
    unsigned int sign = 0;

    if (val < 0)
    {
        val = -val;
        sign = 1;
    }

    while ((val != 0) && (i < (len - 1 - sign)))
    {
        cur    = val % radix;
        val   /= radix;

        if (radix == 16)
        {
            switch(cur)
            {
            case 10:
                dest[i] = 'a';
                break;
            case 11:
                dest[i] = 'b';
                break;
            case 12:
                dest[i] = 'c';
                break;
            case 13:
                dest[i] = 'd';
                break;
            case 14:
                dest[i] = 'e';
                break;
            case 15:
                dest[i] = 'f';
                break;
            default:
                dest[i] = (char)('0' + cur);
                break;
            }
        }
        else
        {
            dest[i] = (char)('0' + cur);
        }
        ++i;
    }

    if (sign)
    {
        dest[i++] = '-';
    }

    for (unsigned int j = 0; j < i / 2; ++j)
    {
        char tmp        = dest[j];
        dest[j]         = dest[i - 1 - j];
        dest[i - 1 - j] = tmp;
    }
    dest[i] = '\0';

    return dest;
}

#endif

// String functions

inline UPInt OVR_CDECL OVR_strlen(const char* str)
{
    return strlen(str);
}

inline char* OVR_CDECL OVR_strcpy(char* dest, UPInt destsize, const char* src)
{
#if defined(OVR_MSVC_SAFESTRING)
    strcpy_s(dest, destsize, src);
    return dest;
#elif defined(OVR_OS_ANDROID)
	strlcpy( dest, src, destsize );
	return dest;
#else
    OVR_UNUSED(destsize);
    return strcpy(dest, src);
#endif
}

inline char* OVR_CDECL OVR_strncpy(char* dest, UPInt destsize, const char* src, UPInt count)
{
	// handle an invalid destination the same way for all cases
	if ( destsize == 0 || dest == NULL || src == NULL )
	{
		OVR_ASSERT( dest != NULL && destsize > 0 && src != NULL );
		return dest;
	}
	if ( dest == src )
	{
		return dest;
	}
	// special case if count is 0, just set the first character to null byte
	if ( count == 0 )
	{
		dest[0] = '\0';
		return dest;
	}

	if ( count >= destsize )
	{
		// if count is larger than or equal to the destination buffer size, completely fill the
		// destination buffer and put the zero byte at the end
		strncpy( dest, src, destsize );
		dest[destsize - 1] = '\0';
	}
	else
	{
		// otherwise place it right after the count
		strncpy(dest, src, count);
		dest[count] = '\0';
	}
	return dest;
}

inline char * OVR_CDECL OVR_strcat(char* dest, UPInt destsize, const char* src)
{
#if defined(OVR_MSVC_SAFESTRING)
    strcat_s(dest, destsize, src);
    return dest;
#elif defined(OVR_OS_ANDROID)
	strlcat( dest, src, destsize );
	return dest;
#else
    OVR_UNUSED(destsize);
    return strcat(dest, src);
#endif
}

inline int OVR_CDECL OVR_strcmp(const char* dest, const char* src)
{
    return strcmp(dest, src);
}

inline const char* OVR_CDECL OVR_strchr(const char* str, char c)
{
    return strchr(str, c);
}

inline char* OVR_CDECL OVR_strchr(char* str, char c)
{
    return strchr(str, c);
}

inline const char* OVR_strrchr(const char* str, char c)
{
    UPInt len = OVR_strlen(str);
    for (UPInt i=len; i>0; i--)
        if (str[i]==c)
            return str+i;
    return 0;
}

inline const UByte* OVR_CDECL OVR_memrchr(const UByte* str, UPInt size, UByte c)
{
    for (SPInt i = (SPInt)size - 1; i >= 0; i--)
    {
        if (str[i] == c)
            return str + i;
    }
    return 0;
}

inline char* OVR_CDECL OVR_strrchr(char* str, char c)
{
    UPInt len = OVR_strlen(str);
    for (UPInt i=len; i>0; i--)
        if (str[i]==c)
            return str+i;
    return 0;
}

double OVR_CDECL OVR_strtod(const char* string, char** tailptr);

inline long OVR_CDECL OVR_strtol(const char* string, char** tailptr, int radix)
{
    return strtol(string, tailptr, radix);
}

inline long OVR_CDECL OVR_strtoul(const char* string, char** tailptr, int radix)
{
    return strtoul(string, tailptr, radix);
}

inline int OVR_CDECL OVR_strncmp(const char* ws1, const char* ws2, UPInt size)
{
    return strncmp(ws1, ws2, size);
}

inline UInt64 OVR_CDECL OVR_strtouq(const char *nptr, char **endptr, int base)
{
#if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
    return _strtoui64(nptr, endptr, base);
#else
    return strtoull(nptr, endptr, base);
#endif
}

inline SInt64 OVR_CDECL OVR_strtoq(const char *nptr, char **endptr, int base)
{
#if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
    return _strtoi64(nptr, endptr, base);
#else
    return strtoll(nptr, endptr, base);
#endif
}

inline SInt64 OVR_CDECL OVR_atoq(const char* string)
{
#if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
    return _atoi64(string);
#else
    return atoll(string);
#endif
}

inline UInt64 OVR_CDECL OVR_atouq(const char* string)
{
  return OVR_strtouq(string, NULL, 10);
}

// Implemented in GStd.cpp in platform-specific manner.
int OVR_CDECL OVR_stricmp(const char* dest, const char* src);
int OVR_CDECL OVR_strnicmp(const char* dest, const char* src, UPInt count);

inline int OVR_CDECL OVR_sprintf(char *dest, UPInt destsize, const char* format, ...)
{
	if ( destsize <= 0 || dest == NULL )
	{
		OVR_ASSERT( destsize > 0 );
		return -1;
	}
    va_list argList;
    va_start(argList,format);
    int ret;
#if defined(OVR_CC_MSVC)
    #if defined(OVR_MSVC_SAFESTRING)
        ret = _vsnprintf_s(dest, destsize, _TRUNCATE, format, argList);
    #else
		// FIXME: this is a security issue on Windows platforms that don't have _vsnprintf_s
        OVR_UNUSED(destsize);
        ret = _vsnprintf(dest, destsize - 1, format, argList); // -1 for space for the null character
        dest[destsize-1] = 0;	// may leave trash in the destination...
    #endif
#else
    ret = vsnprintf( dest, destsize, format, argList );
	// In the event of the output string being greater than the buffer size, vsnprintf should
	// return the size of the string before truncation. In that case we zero-terminate the
	// string to ensure that the result is the same as _vsnprintf_s would return for the
	// MSVC compiler. vsnprintf is supposed to zero-terminate in this case, but to be sure
	// we zero-terminate it ourselves.
	if ( ret >= (int)destsize )
	{
		dest[destsize - 1] = '\0';
	}
#endif
	// If an error occurs, vsnprintf should return -1, in which case we set zero byte to null character.
	OVR_ASSERT( ret >= 0 );	// ensure the format string is not malformed
	if ( ret < 0 )
	{
		dest[0] ='\0';
	}
    va_end(argList);
    return ret;
}

inline UPInt OVR_CDECL OVR_vsprintf(char *dest, UPInt destsize, const char * format, va_list argList)
{
    UPInt ret;
#if defined(OVR_CC_MSVC)
    #if defined(OVR_MSVC_SAFESTRING)
        dest[0] = '\0';
        int rv = vsnprintf_s(dest, destsize, _TRUNCATE, format, argList);
        if (rv == -1)
        {
            dest[destsize - 1] = '\0';
            ret = destsize - 1;
        }
        else
            ret = (UPInt)rv;
    #else
        OVR_UNUSED(destsize);
        int rv = _vsnprintf(dest, destsize - 1, format, argList);
        OVR_ASSERT(rv != -1);
        ret = (UPInt)rv;
        dest[destsize-1] = 0;
    #endif
#else
    OVR_UNUSED(destsize);
    ret = (UPInt)vsprintf(dest, format, argList);
    OVR_ASSERT(ret < destsize);
#endif
    return ret;
}

// Returns the number of characters in the formatted string.
inline UPInt OVR_CDECL OVR_vscprintf(const char * format, va_list argList)
{
    UPInt ret;
#if defined(OVR_CC_MSVC)
    ret = (UPInt) _vscprintf(format, argList);
#else
    ret = (UPInt) vsnprintf(NULL, 0, format, argList);
#endif
    return ret;
}

wchar_t* OVR_CDECL OVR_wcscpy(wchar_t* dest, UPInt destsize, const wchar_t* src);
wchar_t* OVR_CDECL OVR_wcsncpy(wchar_t* dest, UPInt destsize, const wchar_t* src, UPInt count);
wchar_t* OVR_CDECL OVR_wcscat(wchar_t* dest, UPInt destsize, const wchar_t* src);
UPInt    OVR_CDECL OVR_wcslen(const wchar_t* str);
int      OVR_CDECL OVR_wcscmp(const wchar_t* a, const wchar_t* b);
int      OVR_CDECL OVR_wcsicmp(const wchar_t* a, const wchar_t* b);

inline int OVR_CDECL OVR_wcsicoll(const wchar_t* a, const wchar_t* b)
{
#if defined(OVR_OS_WIN32)
#if defined(OVR_CC_MSVC) && (OVR_CC_MSVC >= 1400)
    return ::_wcsicoll(a, b);
#else
    return ::wcsicoll(a, b);
#endif
#else
    // not supported, use regular wcsicmp
    return OVR_wcsicmp(a, b);
#endif
}

inline int OVR_CDECL OVR_wcscoll(const wchar_t* a, const wchar_t* b)
{
#if defined(OVR_OS_WIN32) || defined(OVR_OS_LINUX)
    return wcscoll(a, b);
#else
    // not supported, use regular wcscmp
    return OVR_wcscmp(a, b);
#endif
}

#ifndef OVR_NO_WCTYPE

inline int OVR_CDECL UnicodeCharIs(const UInt16* table, wchar_t charCode)
{
    unsigned offset = table[charCode >> 8];
    if (offset == 0) return 0;
    if (offset == 1) return 1;
    return (table[offset + ((charCode >> 4) & 15)] & (1 << (charCode & 15))) != 0;
}

extern const UInt16 UnicodeAlnumBits[];
extern const UInt16 UnicodeAlphaBits[];
extern const UInt16 UnicodeDigitBits[];
extern const UInt16 UnicodeSpaceBits[];
extern const UInt16 UnicodeXDigitBits[];

// Uncomment if necessary
//extern const UInt16 UnicodeCntrlBits[];
//extern const UInt16 UnicodeGraphBits[];
//extern const UInt16 UnicodeLowerBits[];
//extern const UInt16 UnicodePrintBits[];
//extern const UInt16 UnicodePunctBits[];
//extern const UInt16 UnicodeUpperBits[];

inline int OVR_CDECL OVR_iswalnum (wchar_t charCode) { return UnicodeCharIs(UnicodeAlnumBits,  charCode); }
inline int OVR_CDECL OVR_iswalpha (wchar_t charCode) { return UnicodeCharIs(UnicodeAlphaBits,  charCode); }
inline int OVR_CDECL OVR_iswdigit (wchar_t charCode) { return UnicodeCharIs(UnicodeDigitBits,  charCode); }
inline int OVR_CDECL OVR_iswspace (wchar_t charCode) { return UnicodeCharIs(UnicodeSpaceBits,  charCode); }
inline int OVR_CDECL OVR_iswxdigit(wchar_t charCode) { return UnicodeCharIs(UnicodeXDigitBits, charCode); }

// Uncomment if necessary
//inline int OVR_CDECL OVR_iswcntrl (wchar_t charCode) { return UnicodeCharIs(UnicodeCntrlBits,  charCode); }
//inline int OVR_CDECL OVR_iswgraph (wchar_t charCode) { return UnicodeCharIs(UnicodeGraphBits,  charCode); }
//inline int OVR_CDECL OVR_iswlower (wchar_t charCode) { return UnicodeCharIs(UnicodeLowerBits,  charCode); }
//inline int OVR_CDECL OVR_iswprint (wchar_t charCode) { return UnicodeCharIs(UnicodePrintBits,  charCode); }
//inline int OVR_CDECL OVR_iswpunct (wchar_t charCode) { return UnicodeCharIs(UnicodePunctBits,  charCode); }
//inline int OVR_CDECL OVR_iswupper (wchar_t charCode) { return UnicodeCharIs(UnicodeUpperBits,  charCode); }

int OVR_CDECL OVR_towupper(wchar_t charCode);
int OVR_CDECL OVR_towlower(wchar_t charCode);

#else // OVR_NO_WCTYPE

inline int OVR_CDECL OVR_iswspace(wchar_t c)
{
    return iswspace(c);
}

inline int OVR_CDECL OVR_iswdigit(wchar_t c)
{
    return iswdigit(c);
}

inline int OVR_CDECL OVR_iswxdigit(wchar_t c)
{
    return iswxdigit(c);
}

inline int OVR_CDECL OVR_iswalpha(wchar_t c)
{
    return iswalpha(c);
}

inline int OVR_CDECL OVR_iswalnum(wchar_t c)
{
    return iswalnum(c);
}

inline wchar_t OVR_CDECL OVR_towlower(wchar_t c)
{
    return (wchar_t)towlower(c);
}

inline wchar_t OVR_towupper(wchar_t c)
{
    return (wchar_t)towupper(c);
}

#endif // OVR_NO_WCTYPE

// ASCII versions of tolower and toupper. Don't use "char"
inline int OVR_CDECL OVR_tolower(int c)
{
    return (c >= 'A' && c <= 'Z') ? c - 'A' + 'a' : c;
}

inline int OVR_CDECL OVR_toupper(int c)
{
    return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c;
}

inline double OVR_CDECL OVR_wcstod(const wchar_t* string, wchar_t** tailptr)
{
#if defined(OVR_OS_OTHER)
    OVR_UNUSED(tailptr);
    char buffer[64];
    char* tp = NULL;
    UPInt max = OVR_wcslen(string);
    if (max > 63) max = 63;
    unsigned char c = 0;
    for (UPInt i=0; i < max; i++)
    {
        c = (unsigned char)string[i];
        buffer[i] = ((c) < 128 ? (char)c : '!');
    }
    buffer[max] = 0;
    return OVR_strtod(buffer, &tp);
#else
    return wcstod(string, tailptr);
#endif
}

inline long OVR_CDECL OVR_wcstol(const wchar_t* string, wchar_t** tailptr, int radix)
{
#if defined(OVR_OS_OTHER)
    OVR_UNUSED(tailptr);
    char buffer[64];
    char* tp = NULL;
    UPInt max = OVR_wcslen(string);
    if (max > 63) max = 63;
    unsigned char c = 0;
    for (UPInt i=0; i < max; i++)
    {
        c = (unsigned char)string[i];
        buffer[i] = ((c) < 128 ? (char)c : '!');
    }
    buffer[max] = 0;
    return strtol(buffer, &tp, radix);
#else
    return wcstol(string, tailptr, radix);
#endif
}

} // OVR

#endif // OVR_Std_h


text:
cask 'capto' do
  version '1.2.11,1548837086'
  sha256 '8e2e94a6c4d1f0e7abcf3dd26be2317b123a2039c7fdb72fe3c37cb744948ac9'

  # dl.devmate.com/com.globaldelight.Capto was verified as official when first introduced to the cask
  url "https://dl.devmate.com/com.globaldelight.Capto/#{version.before_comma}/#{version.after_comma}/Capto-#{version.before_comma}.dmg"
  appcast 'https://updates.devmate.com/com.globaldelight.Capto.xml'
  name 'Capto'
  homepage 'https://www.globaldelight.com/capto/'

  app 'Capto.app'
end


text:
class Cell {
friend class Ocean;

protected:
  Coordinate *offset;
  char image;

  Cell *getCellAt(Coordinate aCoord);
  void assignCellAt(Coordinate aCoord, Cell *aCell);
  Cell *getNeighborWithImage(char anImage);
  Coordinate getEmptyNeighborCoord(void);
  Coordinate getPreyNeighborCoord(void);
  Cell *north(void);
  Cell *south(void);
  Cell *east(void);
  Cell *west(void);
  virtual Cell *reproduce(Coordinate anOffset);

public:
  Cell(const Coordinate &aCoord) {
    offset = new Coordinate(aCoord);
    image = DefaultImage;
  }
  Cell(void) {}
  virtual ~Cell(void) {delete offset;}
  Coordinate &getOffset(void) {return *offset;}
  void setOffset(Coordinate &anOffset) {offset = new Coordinate(anOffset);}
  char getImage(void) { return image;}
  void display(void);
  virtual void process(void) {}
};

#endif


text:
#region license
//Copyright (c) 2011-2013 <comparator@gmx.de>; Wassili Hense

//This file is part of the X13.Home project.
//https://github.com/X13home

//BSD License
//See LICENSE.txt file for license details.
#endregion license

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace X13.lib {
  public class Log {
    private static bool _useDiagnostic;
    private static bool _useConsole;

    static Log() {
      if(!Directory.Exists("../log")) {
        Directory.CreateDirectory("../log");
      }
      _useDiagnostic=System.Diagnostics.Debugger.IsAttached;
      _useConsole=Environment.UserInteractive;
    }
    public static void Debug(string format, params object[] arg) {
      onWrite(LogLevel.Debug, format, arg);
    }
    public static void Info(string format, params object[] arg) {
      onWrite(LogLevel.Info, format, arg);
    }
    public static void Warning(string format, params object[] arg) {
      onWrite(LogLevel.Warning, format, arg);
    }
    public static void Error(string format, params object[] arg) {
      onWrite(LogLevel.Error, format, arg);
    }
    public static void onWrite(LogLevel ll, string format, params object[] arg) {
      string msg=string.Format(format, arg);
      DateTime now=DateTime.Now;
      if(Write!=null) {
        Write(ll, now, msg);
      }
      if(_useConsole || _useDiagnostic) {
        string dts=now.ToString("HH:mm:ss.ff");
        if(_useDiagnostic) {
          System.Diagnostics.Debug.WriteLine(string.Format("{0}[{1}] {2}", dts, ll.ToString(), msg));
        }
        if(_useConsole) {
          switch(ll) {
          case LogLevel.Debug:
            Console.ForegroundColor=ConsoleColor.Gray;
            Console.WriteLine(dts+"[D] "+msg);
            break;
          case LogLevel.Info:
            Console.ForegroundColor=ConsoleColor.White;
            Console.WriteLine(dts+"[I] "+msg);
            break;
          case LogLevel.Warning:
            Console.ForegroundColor=ConsoleColor.Yellow;
            Console.WriteLine(dts+"[W] "+msg);
            break;
          case LogLevel.Error:
            Console.ForegroundColor=ConsoleColor.Red;
            Console.WriteLine(dts+"[E] "+msg);
            break;
          }
        }
      }
    }
    public static event Action<LogLevel, DateTime, string> Write;
  }
  public enum LogLevel {
    Debug,
    Info,
    Warning,
    Error
  }
}