text:
namespace hobbes {

// get the port number associated with a named port
int lookupPort(const std::string& x) {
  if (str::is<int>(x)) {
    return str::to<int>(x);
  } else {
    struct servent* s = getservbyname(x.c_str(), "tcp");
    if (s != 0) {
      return ntohs(s->s_port);
    } else {
      throw std::runtime_error("Failed to resolve port name: " + x);
    }
  }
}

// create a listening socket on a given port
int allocateServer(int port) {
  int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (s == -1) {
    throw std::runtime_error("Unable to allocate socket: " + std::string(strerror(errno)));
  }

  // make sure that we can quickly restart the server if necessary
  int ra = 1;
  setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&ra, sizeof(ra));

  // bind the new socket to a local address
  sockaddr_in laddr;
  memset(&laddr, 0, sizeof(laddr));

  laddr.sin_family      = AF_INET;
  laddr.sin_port        = htons(port);
  laddr.sin_addr.s_addr = INADDR_ANY;

  if (bind(s, (sockaddr*)&laddr, sizeof(laddr)) == -1) {
    close(s);
    throw std::runtime_error("Unable to bind socket to local address: " + std::string(strerror(errno)));
  }

  // and then start to listen
  if (listen(s, SOMAXCONN) == -1) {
    close(s);
    throw std::runtime_error("Unable to listen on local address: " + std::string(strerror(errno)));
  }

  return s;
}

int allocateServer(const std::string& port) {
  return allocateServer(lookupPort(port));
}

int allocateFileSocketServer(const std::string& filepath) {
  int s = socket(AF_UNIX, SOCK_STREAM, 0);
  if (s == -1) {
    throw std::runtime_error("Unable to allocate socket: " + std::string(strerror(errno)));
  }

  sockaddr_un addr;
  memset(&addr, 0, sizeof(addr));
  addr.sun_family = AF_UNIX;
  unlink(filepath.c_str());
  snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", filepath.c_str());

  if (bind(s, (sockaddr*)&addr, sizeof(addr)) == -1) {
    close(s);
    throw std::runtime_error("Unable to bind socket to file: " + filepath + std::string(" : ") + std::string(strerror(errno)));
  }

  // and then start to listen
  if (listen(s, SOMAXCONN) == -1) {
    close(s);
    throw std::runtime_error("Unable to listen socket on file: " + filepath + std::string(" : ") + std::string(strerror(errno)));
  }

  return s;
}

int connectSocket(int r, sockaddr* saddr, size_t len) {
  if (connect(r, saddr, len) == -1) {
    std::ostringstream ss;
    ss << "Unable to connect socket: " << strerror(errno) << std::flush;
    close(r);
    throw std::runtime_error(ss.str());
  }

  // wait for writeability
  fd_set wd;
  FD_ZERO(&wd);
  FD_SET(r, &wd);

  if (select(r + 1, 0, &wd, 0, 0) == -1) {
    std::ostringstream ss;
    ss << "Failed to connect socket while waiting for writeability: " << strerror(errno) << std::flush;
    close(r);
    throw std::runtime_error(ss.str());
  }

  // we're connected!
  return r;
}

// create a connected socket to a remote process
int connectSocket(hostent* host, int port) {
  int r = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (r == -1) {
    throw std::runtime_error("Unable to allocate socket: " + std::string(strerror(errno)));
  }

  sockaddr_in addr;
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_addr   = *((in_addr*)(host->h_addr_list[0]));
  addr.sin_port   = htons(port);

  return connectSocket(r, (sockaddr*)&addr, sizeof(addr));
}

int connectFileSocket(const std::string& filepath) {
  int r = socket(AF_UNIX, SOCK_STREAM, 0);
  if (r == -1) {
    throw std::runtime_error("Unable to allocate socket: " + std::string(strerror(errno)));
  }

  sockaddr_un addr;
  memset(&addr, 0, sizeof(addr));
  addr.sun_family = AF_UNIX;
  snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", filepath.c_str());

  return connectSocket(r, (sockaddr*)&addr, sizeof(addr));
}

int connectSocket(const std::string& host, int port) {
  if (host.size() > 0 && str::isDigit(host[0])) {
    return connectSocket(gethostbyaddr(host.c_str(), host.size(), AF_INET), port);
  } else {
    return connectSocket(gethostbyname(host.c_str()), port);
  }
}

int connectSocket(const std::string& hostport) {
  str::pair p = str::lsplit(hostport, ":");
  if (p.second.size() > 0)
    return connectSocket(p.first, lookupPort(p.second));
  else
    return connectFileSocket(p.first);
}

// get the name of the host on the other end of this socket
std::string remoteHostname(int c) {
  struct sockaddr_in sin;
  socklen_t len = sizeof(sin);
  if (getpeername(c, (struct sockaddr*)&sin, &len) < 0) {
    throw std::runtime_error("Couldn't get peer name for socket");
  } else {
    struct hostent *host;
    if (struct hostent* host = gethostbyaddr((char*)&sin.sin_addr, sizeof(sin.sin_addr), AF_INET)) {
      return std::string(host->h_name);
    } else {
      throw std::runtime_error("Couldn't get host name for socket");
    }
  }
}

void prepareStrExpr(Server* s, int c, exprid eid, const std::string& expr, const MonoTypes& intys, const MonoTypePtr& outty) {
  auto la = LexicalAnnotation::null();

  if (intys.size() == 0 || (intys.size() == 1 && isUnit(intys[0]))) {
    s->prepare(c, eid, assume(s->readExpr(expr), functy(tuple(intys), outty), la), tuple());
  } else {
    ExprPtr f = assume(s->readExpr(expr), functy(intys, outty), la);
    Exprs args;
    for (size_t i = 0; i < intys.size(); ++i) {
      args.push_back(proj(var("p", la), ".f"+str::from(i), la));
    }
    s->prepare(c, eid, fn(str::strings("p"), fncall(f, args, la), la), tuple(intys));
  }
}

void evaluateNetREPLRequest(int c, void* d) {
  Server* s = (Server*)d;

  try {
    uint8_t cmd = 0;
    fdread(c, &cmd);

    switch (cmd) {
    case 0:
      // prepare a lexical expression with input and output types given
      try {
        exprid eid = 0;
        fdread(c, &eid);

        std::string expr;
        fdread(c, &expr);

        RawData ityd, otyd;
        fdread(c, &ityd);
        fdread(c, &otyd);

        MonoTypePtr itye = decode(ityd);
        MonoTypes itys;
        if (const Record* argl = is<Record>(itye)) {
          itys = selectTypes(argl->members());
        } else {
          itys.push_back(itye);
        }
        prepareStrExpr(s, c, eid, expr, itys, decode(otyd));

        // if we got this far, we have a successful result
        fdwrite(c, uint8_t(1));
      } catch (std::exception& ex) {
        fdwrite(c, uint8_t(0));
        fdwrite(c, std::string(ex.what()));
      }
      break;
    case 1:
      // prepare a serialized expression, also return its type
      try {
        exprid eid = 0;
        fdread(c, &eid);
        RawData exprd;
        fdread(c, &exprd);
        ExprPtr expr;
        decode(exprd, &expr);

        RawData tyd;
        fdread(c, &tyd);
        MonoTypePtr ty = decode(tyd);

        MonoTypePtr rty = s->prepare(c, eid, expr, ty);

        RawData rtyd;
        encode(rty, &rtyd);

        // if we got this far, we have a successful result
        fdwrite(c, uint8_t(1));
        fdwrite(c, rtyd);
      } catch (std::exception& ex) {
        fdwrite(c, uint8_t(0));
        fdwrite(c, std::string(ex.what()));
      }
      break;
    case 2:
      // invoke a prepared expression
      exprid evid;
      fdread(c, &evid);
      s->evaluate(c, evid);
      break;
    default:
      throw std::runtime_error("protocol violation: cmd=" + str::from(cmd));
    }
  } catch (std::exception& ex) {
    // something went wrong, disconnect
    close(c);
    unregisterEventHandler(c);
    s->disconnect(c);
  }
}

void registerNetREPL(int s, Server* svr) {
  registerEventHandler(
    s,
    [](int s, void* d) {
      int c = accept(s, 0, 0);
      if (c != -1) {
        try {
          uint32_t version = 0;
          fdread(c, &version);
          if (version != 0x00010000) {
            close(c);
          }

          ((Server*)d)->connect(c);
          registerEventHandler(c, &evaluateNetREPLRequest, d);
        } catch (std::exception&) {
          close(c);
        }
      }
    },
    svr
  );
}

int installNetREPL(int port, Server* svr) {
  int s = allocateServer(port);
  registerNetREPL(s, svr);
  return s;
}

int installNetREPL(const std::string& filepath, Server* svr) {
  int s = allocateFileSocketServer(filepath);
  registerNetREPL(s, svr);
  return s;
}

class CCServer : public Server {
public:
  CCServer(cc* c) : c(c) {
  }

  void connect(int) { }

  ExprPtr readExpr(const std::string& x) {
    return this->c->readExpr(x);
  }

  MonoTypePtr prepare(int c, exprid eid, const ExprPtr& expr, const MonoTypePtr& inty) {
    const auto& la = expr->la();

    // E(readFrom(in)::T) :: ?
    MonoTypePtr rty = requireMonotype(
      this->c->unsweetenExpression(
        fncall(
          expr,
          list(assume(fncall(var("readFrom", la), list(constant((int)0, la)), la), inty, la)),
          la
        )
      )->type()
    );

    // let x = readFrom(input) :: T in writeTo(output, E(x))
    this->cnetFns[c][eid] =
      this->c->compileFn<void(int)>
      (
        ".c",
        let(".in", assume(fncall(var("readFrom", la), list(var(".c", la)), la), inty, la), fncall(var("writeTo", la), list(var(".c", la),
          fncall(expr, list(var(".in", la)), la)), la), la)
      );

    return rty;
  }

  void evaluate(int c, exprid eid) {
    auto cfns = this->cnetFns[c];
    auto f    = cfns.find(eid);

    if (f != cfns.end()) {
      // perform the call
      f->second(c);
    } else {
      // invalid expression, disconnect
      close(c);
      unregisterEventHandler(c);
      disconnect(c);
    }
  }

  void disconnect(int) { }
private:
  cc* c;

  typedef void (*NetFn)(int); // socket -> ()
  typedef std::map<exprid, NetFn> NetFns;
  typedef std::map<int, NetFns> ConnNetFns;
  ConnNetFns cnetFns;
};

int installNetREPL(int port, cc* c) {
  return installNetREPL(port, new CCServer(c));
}
int installNetREPL(const std::string& filepath, cc* c) {
  return installNetREPL(filepath, new CCServer(c));
}

// connect to a running net REPL
Client::Client(const std::string& hostport) : hostport(hostport), eid(0), rbno(0), reno(0) {
  this->c = connectSocket(hostport);
  fdwrite(this->c, (uint32_t)0x00010000);
}

Client::~Client() {
  close(this->c);
}

const std::string& Client::remoteHost() const {
  return this->hostport;
}

exprid Client::remoteExpr(const ExprPtr& expr, const MonoTypePtr& inty) {
  // have we already exchanged this exprty?
  ExprTy exprty(expr.get(), inty.get());
  auto etid = this->exprTyToID.find(exprty);
  if (etid != this->exprTyToID.end()) {
    return etid->second;
  }

  // first we send the ID, expression, and the input type
  exprid rid = ++this->eid;

  RawData exprd;
  encode(expr, &exprd);

  RawData intyd;
  encode(inty, &intyd);

  fdwrite(this->c, uint8_t(1));
  fdwrite(this->c, rid);
  fdwrite(this->c, exprd);
  fdwrite(this->c, intyd);

  // then we expect to get back a result type
  uint8_t v = 0;
  fdread(this->c, &v);
  if (v == 1) {
    RawData outtyd;
    fdread(this->c, &outtyd);

    ExprDef& ed = this->exprDefs[rid];
    ed.expr  = expr;
    ed.inty  = inty;
    ed.outty = decode(outtyd);

    this->exprTyToID[exprty] = rid;

    return rid;
  } else if (v == 0) {
    std::string errmsg;
    fdread(this->c, &errmsg);
    throw std::runtime_error("Error from server: " + errmsg);
  } else {
    throw std::runtime_error("Received malformed message from server");
  }
}

MonoTypePtr Client::input(exprid ex) const {
  auto ed = this->exprDefs.find(ex);
  if (ed == this->exprDefs.end()) {
    throw std::runtime_error("Remote process has no compiled expression with id=" + str::from(ex));
  } else {
    return ed->second.inty;
  }
}

MonoTypePtr Client::output(exprid ex) const {
  auto ed = this->exprDefs.find(ex);
  if (ed == this->exprDefs.end()) {
    throw std::runtime_error("Remote process has no compiled expression with id=" + str::from(ex));
  } else {
    return ed->second.outty;
  }
}

MonoTypePtr Client::output(const ExprPtr& e, const MonoTypePtr& inty) {
  return output(remoteExpr(e, inty));
}

void Client::show(std::ostream& out) const {
  out << this->hostport << "\n\n";
  str::seqs cs;
  cs.resize(4);

  cs[0].push_back("id");
  for (const auto& ce : this->exprDefs) { cs[0].push_back(str::from(ce.first)); }

  cs[1].push_back("expr");
  for (const auto& ce : this->exprDefs) { cs[1].push_back(hobbes::show(ce.second.expr)); }

  cs[2].push_back("input");
  for (const auto& ce : this->exprDefs) { cs[2].push_back(hobbes::show(ce.second.inty)); }

  cs[3].push_back("output");
  for (const auto& ce : this->exprDefs) { cs[3].push_back(hobbes::show(ce.second.outty)); }

  str::printRightAlignedTable(out, cs);
}

// read response values from the other end of the connection
size_t Client::appendReadFn(ReadFn f) {
  this->readFns.push(f);
  return this->reno++;
}

char* Client::readValue(size_t x) {
  if (x < this->rbno) {
    // too late, we've already read past this
    std::cerr << "Can't read remote value out of sequence." << std::endl;
    abort();
  } else {
    while (x > this->rbno) {
      this->readFns.front()(this->c);
      this->readFns.pop();
      ++this->rbno;
    }

    char* r = this->readFns.front()(this->c);
    this->readFns.pop();
    ++this->rbno;

    // if something happened to the socket, kill the process (too severe?)
    if (unmarkBadFD(this->c)) {
      std::cerr << "I/O error on socket" << std::endl;
      abort();
    }

    // well if we got here then we read the requested value (finally)
    return r;
  }
}

size_t Client::unsafeAppendReadFn(size_t p, ReadFn f) {
  return ((Client*)p)->appendReadFn(f);
}

char* Client::unsafeRead(size_t p, size_t x) {
  return ((Client*)p)->readValue(x);
}

}


text:
namespace MassTransit.EventHubIntegration.Configuration
{
    using System;
    using System.Threading.Tasks;
    using Azure.Messaging.EventHubs;
    using Azure.Messaging.EventHubs.Processor;
    using Azure.Storage.Blobs;
    using MassTransit.Configuration;
    using Transports;

    public class EventHubReceiveEndpointBuilder :
        ReceiveEndpointBuilder
    {
        readonly Func<IStorageSettings, BlobContainerClient> _blobContainerClientFactory;
        readonly IBusInstance _busInstance;
        readonly Func<IHostSettings, BlobContainerClient, EventProcessorClient> _clientFactory;
        readonly IReceiveEndpointConfiguration _configuration;
        readonly IEventHubHostConfiguration _hostConfiguration;
        readonly Func<PartitionClosingEventArgs, Task> _partitionClosingHandler;
        readonly Func<PartitionInitializingEventArgs, Task> _partitionInitializingHandler;
        readonly ReceiveSettings _receiveSettings;

        public EventHubReceiveEndpointBuilder(IEventHubHostConfiguration hostConfiguration, IBusInstance busInstance,
            IReceiveEndpointConfiguration configuration, ReceiveSettings receiveSettings,
            Func<IStorageSettings, BlobContainerClient> blobContainerClientFactory,
            Func<IHostSettings, BlobContainerClient, EventProcessorClient> clientFactory,
            Func<PartitionClosingEventArgs, Task> partitionClosingHandler,
            Func<PartitionInitializingEventArgs, Task> partitionInitializingHandler)
            : base(configuration)
        {
            _hostConfiguration = hostConfiguration;
            _busInstance = busInstance;
            _configuration = configuration;
            _receiveSettings = receiveSettings;
            _blobContainerClientFactory = blobContainerClientFactory;
            _clientFactory = clientFactory;
            _partitionClosingHandler = partitionClosingHandler;
            _partitionInitializingHandler = partitionInitializingHandler;
        }

        public IEventHubReceiveEndpointContext CreateReceiveEndpointContext()
        {
            var context = new EventHubReceiveEndpointContext(_hostConfiguration, _busInstance, _configuration, _receiveSettings, _blobContainerClientFactory,
                _clientFactory, _partitionClosingHandler, _partitionInitializingHandler);

            context.GetOrAddPayload(() => _busInstance.HostConfiguration.Topology);
            context.AddOrUpdatePayload(() => _receiveSettings, _ => _receiveSettings);

            return context;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'rspec'
require File.join(File.dirname(__FILE__), '..', 'lib', 'elro_switch')

RSpec.configure do |config|
  # ...
end


text:
package org.drip.sample.spline;

import org.drip.spline.basis.*;
import org.drip.spline.bspline.*;
import org.drip.spline.params.*;
import org.drip.spline.segment.ConstitutiveState;

/*
 * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 */

/*!
 * Copyright (C) 2014 Lakshmi Krishnamurthy
 * Copyright (C) 2013 Lakshmi Krishnamurthy
 *
 * This file is part of CreditAnalytics, a free-software/open-source library for fixed income analysts and
 * 		developers - http://www.credit-trader.org
 *
 * CreditAnalytics is a free, full featured, fixed income credit analytics library, developed with a special
 * 		focus towards the needs of the bonds and credit products community.
 *
 *  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.
 */

/**
 * BasisSplineSet implements Samples for the Construction and the usage of various basis spline functions. It
 *  demonstrates the following:
 * 	- Construction of segment control parameters - polynomial (regular/Bernstein) segment control,
 * 		exponential/hyperbolic tension segment control, Kaklis-Pandelis tension segment control, and C1
 * 		Hermite.
 * 	- Control the segment using the rational shape controller, and the appropriate Ck.
 * 	- Estimate the node value and the node value Jacobian with the segment, as well as at the boundaries.
 * 	- Calculate the segment monotonicity.

 * @author Lakshmi Krishnamurthy
 */

public class BasisBSplineSet {

	/*
	 * This sample demonstrates construction and usage of B Spline hat functions over solitary segments. It
	 * 	shows the constructions of left/right segments, their calibration, and Jacobian evaluation.
	 *
	 *  	USE WITH CARE: This sample ignores errors and does not handle exceptions.
	 */

	private static final void TestSpline (
		final FunctionSet fs,
		final ResponseScalingShapeControl rssc,
		final SegmentDesignInelasticControl segParams)
		throws Exception
	{
		/*
		 * Construct the left and the right segments
		 */

		ConstitutiveState seg1 = ConstitutiveState.Create (1.0, 1.5, fs, rssc, segParams);

		/*
		 * Calibrate the left segment using the node values, and compute the segment Jacobian
		 */

		System.out.println (seg1.calibrate (25., Double.NaN, 0., Double.NaN, 20.25, Double.NaN, null, null));

		System.out.println ("\tY[" + 1.0 + "]: " + seg1.responseValue (1.));

		System.out.println ("\tY[" + 1.5 + "]: " + seg1.responseValue (1.5));
	}

	/*
	 * This sample demonstrates the construction and usage of the Basis B Spline Set Functionality. It shows
	 * 	the following:
	 * 	- Set up the B Spline Sequence Parameters for the Cubic Rational Hat Type, Linear Shape Controller,
	 * 		using the specified tension and derivative order parameters.
	 * 	- Setup the B Spline Basis Set.
	 * 	- Construct the segment inelastic parameter that is C2 (iK = 2 sets it to C2), with second order
	 * 		curvature penalty, and without constraint.
	 * 	- Construct and Evaluate the B Spline.
	 *
	 *  	USE WITH CARE: This sample ignores errors and does not handle exceptions.
	 */

	private static final void BasisBSplineSetSample()
		throws Exception
	{
		/*
		 * Set up the B Spline Sequence Parameters for the Cubic Rational Hat Type, Linear Shape Controller,
		 * 	using the specified tension and derivative order parameters.
		 */

		BSplineSequenceParams bssp = new BSplineSequenceParams (
			BasisHatPairGenerator.PROCESSED_CUBIC_RATIONAL,
			BasisHatShapeControl.SHAPE_CONTROL_RATIONAL_LINEAR,
			2,
			4,
			1.,
			2);

		/*
		 * Setup the B Spline Basis Set
		 */

		FunctionSet fsBSS = FunctionSetBuilder.BSplineBasisSet (bssp);

		/*
		 * Construct the segment inelastic parameter that is C2 (iK = 2 sets it to C2), with second order
		 *  curvature penalty, and without constraint
		 */

		int iK = 2;
		int iCurvaturePenaltyDerivativeOrder = 2;

		SegmentDesignInelasticControl segParams = SegmentDesignInelasticControl.Create (
			iK,
			iCurvaturePenaltyDerivativeOrder);

		/*
		 * Construct and Evaluate the B Spline
		 */

		TestSpline (fsBSS, null, segParams);
	}

	public static final void main (
		final String[] astrArgs)
		throws Exception
	{
		BasisBSplineSetSample();
	}
}


text:
#ifndef LUMBERJACK_H
#define LUMBERJACK_H

#include <string>

#include "stadicapi.h"

namespace stadic {
enum class Severity {Debug, Info, Warning, Error, Fatal};
}

void STADIC_API STADIC_ERROR(std::string mesg);
void STADIC_API STADIC_WARNING(std::string mesg);
void STADIC_API STADIC_LOG(stadic::Severity severity, std::string mesg);

#endif


text:
package org.sword.wechat4j.util;

import org.sword.wechat4j.exception.WeChatException;
import org.sword.wechat4j.exception.WeChatReturnCode;

import com.alibaba.fastjson.JSONObject;
/**
 * 工具类
 * @author Zhangxs
 * @version 2015-7-4
 */
public class WeChatUtil {
	/**
	 * 判断是否请求成功
	 * @param resultStr
	 * @throws WeChatException
	 */
	public static void isSuccess(String resultStr) throws WeChatException{
		JSONObject jsonObject = JSONObject.parseObject(resultStr);
		Integer errCode =jsonObject.getIntValue("errcode");
		if (errCode!=null && errCode!=0) {
			String errMsg = WeChatReturnCode.getMsg(errCode);
			if (errMsg.equals("")) {
				errMsg = jsonObject.getString("errmsg");
			}
			throw new WeChatException("异常码:"+errCode+";异常说明:"+errMsg);
		}
	}
}


text:
/*
 * Test.cpp
 *	Just to test my WriteArt app.
 *  Created on: Dec 31, 2012
 *      Author: David Zhang
 */

#include "Standard.h"
#include "Converter.h"

using namespace std;

void begin();
void end();

// In progress - for command line stuff
// int main(int argc, char* argv[]) { // or char** argv
//     try {
//         if (argc == 1) {
//             string filename = argv[1]; // argv[0] is the command used to execute the c++, like "./a.out"
//             Converter conv;
//             try {
//                 conv.ConvertFromFile(filename);
//                 cout << "Converted" << endl;
//             } catch (exception &e) {
//              cerr << "Error: " << e.what() << endl;
//             }
//         } else {
//             cerr << "Please pass the filename as an argument." << endl;
//         }
//         return 0;
//     } catch (exception &e) {
//         cerr << e.what() << endl;
//     }
// }

// Working for testfile.txt
int main() {// (int argc, char* argv[]) // or char** argv
    begin();
    Converter conv;
    try {
    	conv.ConvertFromFile("testfile.txt");
    	cout << "Converted" << endl;
    } catch (exception& e) {
    	cerr << "Error: " << e.what() << endl;
    }

    end();
    return 0;
}

// Begins initial output, including welcoming message
void begin() {
    enter(1);
//    cout << tab(1) << "David Zhang" << endl;
}

// Ends with final output
void end() {
    enter(1);
}


text:
#ifndef __TIMECALC_H
#define __TIMECALC_H

typedef struct _entry
{
	char point_max;
	char point_min;
	char point_count;
	char point_from[32];	// ´ÓÄĸöʱ¼ä
	char point_to[32];		// µ½Äĸöʱ¼ä
	char point_space[32];	// ʱ¼ä¼ä¸ô
	char any;
	char unsafe;
} Entry;

typedef struct _timeentry
{
	Entry min;
	Entry hour;
	Entry day;
	Entry mon;
	Entry week;
	time_t mtime;
} TimeEntry;

int time_format( TimeEntry *pTimeEntry, char *pString );
int time_checktime( TimeEntry *pTimeEntry );

#endif


text:
This jQuery plugin was created, because I needed to create select box with thousand of options.
Rendering all of them was slow and not necessary, because it is impossible to scroll through all the options.
I needed something with select box functionality without rendering all options. So I created this plugin.

## Documentation and examples
You can find documentation, examples and FAQ on http://alesjiranek.github.com/autocomplete-choice-input

## Basic Usage

In default selected values are submitted as array.

```javascript
<input type="text" name="example1" class="a-c-i" data-options="{1:"Option 1", 2:"Option 2"}">

$(document).ready(function(){
    $('.a-c-i').autocompleteChoiceInput();
});
```

## Options
You can find list of all options and examples of their usage on http://alesjiranek.github.com/autocomplete-choice-input


text:
`mods.alchemistry.Dissolver`

## Методы
- **[IItemStack](/Vanilla/Items/IItemStack/) input** - The input of the recipe.
- **boolean relativeProbability** - Probability Calculation Boolean
- **int rolls** -  Possibilty of Roles
- **probabilityGroups** - An array of arrays with an double followed by any # of [IItemStack](/Vanilla/Items/IItemStack/)s. The double refers to the probability for its group.

## Сложение
```zenscript
mods.alchemistry.Dissolver.addRecipe(IIngredient input, boolean relativeProbability, int rolls, Object[][] probabilityGroups);
mods.alchemistry.Dissolver.addRecipe(<minecraft:dye:9>, false, 5,
[[10, <minecraft:stone>],
 [20, <minecraft:sand>,<minecraft:iron_ore>]]);
```

## Removal
```zenscript
mods.alchemistry.Dissolver.removeRecipe(IIngredient input);
mods.alchemistry.Dissolver.removeRecipe(<minecraft:ender_pearl>);

mods.alchemistry.Dissolver.removeAllRecipes();
```

# Notes
To ease in the development of modifying existing dissolver recipes there is a command, simply /dissolver that will fetch the crafttweaker recipe for the item that you are holding and copy it into your clipboard

If relative probability is true, then each probability will be calculated based on the sum of all of the probabilities. In the example above that would mean there is a 33.3% chance of outputting stone each roll and a 66.6% chance of outputting a sand and an iron ore each roll.

If relative probability is false, then these numbers are absolute percentages i.e. a 10% chance of outputting stone and a 20% chance of outputting sand and iron ore (regardless of whether or not stone was outputted). Floating-point probabilities are supported, so 4.5 would mean 4.5%


text:
* Add support for ActionController::Parameters and ActiveSupport::Duration

## v0.3.1

* fix validation messages
* relax saas-rails dependency

## v0.3.0

* bootstrap 3.0 support

## v0.2.0

* Case with nil value settings
* Option to customize settings class name

## v0.1.1

* remove less

## v0.1.0

* total refactoring settings helper

## v0.0.2

* select options labels and values from locale
* compatible with rails 4
* compatible with latest rails-settings-cached


text:
package org.crl.utilities;

import org.crl.imagedata.Color;
import org.crl.imagedata.ColorUtilities;
import org.crl.imagedata.Image;
import org.crl.imagedata.Point;
import org.crl.imagedata.StandardColors;

/**
 * Universal chart configuration properties for axised charts
 * including background color and main axis line width
 */
public class ChartConfigurator {

	/** The background color. */
	private Color backgroundColor;

	/** The main line width. */
	private int mainLineWidth;

	/** The image. to be analyzed */
	private Image image;

	/** Useful uilities in working with a specific chart. */
	private ColorUtilities utilities;

	/**
	 *
	 * @param backgroundColor the background color of the image
	 * @param mainLineWidth the main line width
	 */
	public ChartConfigurator(Color backgroundColor, int mainLineWidth) {
		this.backgroundColor=backgroundColor;
	    this.mainLineWidth=mainLineWidth;
	}

	/**
	 * Receives a cropped image.
	 */
	public ChartConfigurator(Image image) {
		this.backgroundColor = StandardColors.WHITE;
		this.mainLineWidth = 1;
		this.image = image;
	}

	public ChartConfigurator() {

		utilities = new ColorUtilities(image);
		backgroundColor = findBackgroundColor();
		mainLineWidth = findMainLineWidth();
	}
/**
 *
 * */
	public Color findBackgroundColor() {
		Color result = null;
		for (int i = 1; i < image.getWidth(); i++) {
			for (int j = 0; j < image.getHeight(); j++) {
				if (utilities.isRegionRectangle(i, j, 10)) {
					return image.getPixel(i, j).getColor();
				}
			}
		}
		// in case of failure white is most likely
		return StandardColors.WHITE;
	}

	/**
	 * Find main line width - the line of crossing axis.
	 *
	 */
	public int findMainLineWidth() {
		int width = 1;
		// the exact crossing of the lines might result in slight color
		// difference
		Color lineColor = image.getPixel(3, 0).getColor();
		for (int j = 1; j < image.getHeight(); j++) {
			if (!image.getPixel(3, j).getColor().isComparableTo(lineColor)) {
				break;
			}
			width++;

		}
		return width;
	}

	public Color getBackgroundColor() {

		return backgroundColor;
	}

	public int getMainLineWidth() {

		return mainLineWidth;
	}

	public void setMainLineWidth(int mainLineWidth) {
		this.mainLineWidth = mainLineWidth;
	}
}


text:
<?php namespace App\Models\Auth;

use Illuminate\Database\Eloquent\Model;

class Login extends Model
{

     protected $fillable = ['username', 'password'];

}
?>


text:
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        Toggle navigation

      </button>
      AndiB

Home

			MitarbeiterDropdown

Mitarbeiter anlegen

Mitarbeiterliste anzeigen

Mitarbeiter anlegen

Mitarbeiterliste anzeigen

Andi B

Erster Gehversuch mit Bootstrap! :-)

	        Button1
	        Button2
	       	Button3

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Überschrift1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

AndiB Oleeeeeeeee

            Mail mir!

Der Mitarbeiter wurde erfolgreich geladen!

                Ok


text:
/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include "config.h"
#include "V8Navigator.h"

#include "ExceptionCode.h"
#include "RuntimeEnabledFeatures.h"
#include "V8Binding.h"
#include "V8BindingMacros.h"
#include "V8BindingState.h"
#include "V8DOMMimeTypeArray.h"
#include "V8DOMPluginArray.h"
#include "V8DOMWrapper.h"
#include "V8Geolocation.h"
#include "V8IsolatedContext.h"
#include "V8Proxy.h"

namespace WebCore {

WrapperTypeInfo V8Navigator::info = { V8Navigator::GetTemplate, V8Navigator::derefObject, 0, 0 };

namespace NavigatorInternal {

template <typename T> void V8_USE(T) { }

static v8::Handle<v8::Value> appCodeNameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.appCodeName._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->appCodeName());
}

static v8::Handle<v8::Value> appNameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.appName._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->appName());
}

static v8::Handle<v8::Value> appVersionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.appVersion._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->appVersion());
}

static v8::Handle<v8::Value> languageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.language._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->language());
}

static v8::Handle<v8::Value> userAgentAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.userAgent._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->userAgent());
}

static v8::Handle<v8::Value> platformAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.platform._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->platform());
}

static v8::Handle<v8::Value> pluginsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.plugins._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    RefPtr<DOMPluginArray> result = imp->plugins();
    v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>();
    if (wrapper.IsEmpty()) {
        wrapper = toV8(result.get());
        if (!wrapper.IsEmpty())
            V8DOMWrapper::setNamedHiddenReference(info.Holder(), "plugins", wrapper);
    }
    return wrapper;
}

static v8::Handle<v8::Value> mimeTypesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.mimeTypes._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    RefPtr<DOMMimeTypeArray> result = imp->mimeTypes();
    v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>();
    if (wrapper.IsEmpty()) {
        wrapper = toV8(result.get());
        if (!wrapper.IsEmpty())
            V8DOMWrapper::setNamedHiddenReference(info.Holder(), "mimeTypes", wrapper);
    }
    return wrapper;
}

static v8::Handle<v8::Value> productAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.product._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->product());
}

static v8::Handle<v8::Value> productSubAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.productSub._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->productSub());
}

static v8::Handle<v8::Value> vendorAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.vendor._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->vendor());
}

static v8::Handle<v8::Value> vendorSubAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.vendorSub._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8String(imp->vendorSub());
}

static v8::Handle<v8::Value> cookieEnabledAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.cookieEnabled._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8Boolean(imp->cookieEnabled());
}

static v8::Handle<v8::Value> onLineAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.onLine._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    return v8Boolean(imp->onLine());
}

static v8::Handle<v8::Value> geolocationAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Navigator.geolocation._get");
    Navigator* imp = V8Navigator::toNative(info.Holder());
    RefPtr<Geolocation> result = imp->geolocation();
    v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>();
    if (wrapper.IsEmpty()) {
        wrapper = toV8(result.get());
        if (!wrapper.IsEmpty())
            V8DOMWrapper::setNamedHiddenReference(info.Holder(), "geolocation", wrapper);
    }
    return wrapper;
}

static v8::Handle<v8::Value> javaEnabledCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Navigator.javaEnabled");
    Navigator* imp = V8Navigator::toNative(args.Holder());
    return v8Boolean(imp->javaEnabled());
}

static v8::Handle<v8::Value> getStorageUpdatesCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Navigator.getStorageUpdates");
    Navigator* imp = V8Navigator::toNative(args.Holder());
    imp->getStorageUpdates();
    return v8::Handle<v8::Value>();
}

static v8::Handle<v8::Value> registerProtocolHandlerCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Navigator.registerProtocolHandler");
    if (args.Length() < 3)
        return throwError("Not enough arguments", V8Proxy::TypeError);
    Navigator* imp = V8Navigator::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, scheme, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, url, MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined));
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, title, MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined));
    imp->registerProtocolHandler(scheme, url, title, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8::Handle<v8::Value>();
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}

} // namespace NavigatorInternal

static const BatchedAttribute NavigatorAttrs[] = {
    // Attribute 'appCodeName' (Type: 'readonly attribute' ExtAttr: '')
    {"appCodeName", NavigatorInternal::appCodeNameAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'appName' (Type: 'readonly attribute' ExtAttr: '')
    {"appName", NavigatorInternal::appNameAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'appVersion' (Type: 'readonly attribute' ExtAttr: '')
    {"appVersion", NavigatorInternal::appVersionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'language' (Type: 'readonly attribute' ExtAttr: '')
    {"language", NavigatorInternal::languageAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'userAgent' (Type: 'readonly attribute' ExtAttr: '')
    {"userAgent", NavigatorInternal::userAgentAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'platform' (Type: 'readonly attribute' ExtAttr: '')
    {"platform", NavigatorInternal::platformAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'plugins' (Type: 'readonly attribute' ExtAttr: '')
    {"plugins", NavigatorInternal::pluginsAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'mimeTypes' (Type: 'readonly attribute' ExtAttr: '')
    {"mimeTypes", NavigatorInternal::mimeTypesAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'product' (Type: 'readonly attribute' ExtAttr: '')
    {"product", NavigatorInternal::productAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'productSub' (Type: 'readonly attribute' ExtAttr: '')
    {"productSub", NavigatorInternal::productSubAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'vendor' (Type: 'readonly attribute' ExtAttr: '')
    {"vendor", NavigatorInternal::vendorAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'vendorSub' (Type: 'readonly attribute' ExtAttr: '')
    {"vendorSub", NavigatorInternal::vendorSubAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'cookieEnabled' (Type: 'readonly attribute' ExtAttr: '')
    {"cookieEnabled", NavigatorInternal::cookieEnabledAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    // Attribute 'onLine' (Type: 'readonly attribute' ExtAttr: '')
    {"onLine", NavigatorInternal::onLineAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
};

static const BatchedCallback NavigatorCallbacks[] = {
    {"javaEnabled", NavigatorInternal::javaEnabledCallback},
    {"getStorageUpdates", NavigatorInternal::getStorageUpdatesCallback},
    {"registerProtocolHandler", NavigatorInternal::registerProtocolHandlerCallback},
};

static v8::Persistent<v8::FunctionTemplate> ConfigureV8NavigatorTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "Navigator", v8::Persistent<v8::FunctionTemplate>(), V8Navigator::internalFieldCount,
        NavigatorAttrs, WTF_ARRAY_LENGTH(NavigatorAttrs),
        NavigatorCallbacks, WTF_ARRAY_LENGTH(NavigatorCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();

    if (RuntimeEnabledFeatures::geolocationEnabled()) {
        static const BatchedAttribute attrData =\
        // Attribute 'geolocation' (Type: 'readonly attribute' ExtAttr: 'EnabledAtRuntime')
        {"geolocation", NavigatorInternal::geolocationAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
        configureAttribute(instance, proto, attrData);
    }
    if (RuntimeEnabledFeatures::webkitGetUserMediaEnabled())
        proto->Set(v8::String::New("webkitGetUserMedia"), v8::FunctionTemplate::New(V8Navigator::webkitGetUserMediaCallback, v8::Handle<v8::Value>(), defaultSignature));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}

v8::Persistent<v8::FunctionTemplate> V8Navigator::GetRawTemplate()
{
    V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
    V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
    if (result != data->rawTemplateMap().end())
        return result->second;

    v8::HandleScope handleScope;
    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
    data->rawTemplateMap().add(&info, templ);
    return templ;
}

v8::Persistent<v8::FunctionTemplate> V8Navigator::GetTemplate()
{
    V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
    V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    if (result != data->templateMap().end())
        return result->second;

    v8::HandleScope handleScope;
    v8::Persistent<v8::FunctionTemplate> templ =
        ConfigureV8NavigatorTemplate(GetRawTemplate());
    data->templateMap().add(&info, templ);
    return templ;
}

bool V8Navigator::HasInstance(v8::Handle<v8::Value> value)
{
    return GetRawTemplate()->HasInstance(value);
}

v8::Handle<v8::Object> V8Navigator::wrapSlow(Navigator* impl)
{
    v8::Handle<v8::Object> wrapper;
    V8Proxy* proxy = 0;
    wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
    if (wrapper.IsEmpty())
        return wrapper;

    impl->ref();
    v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);

    if (!hasDependentLifetime)
        wrapperHandle.MarkIndependent();
    getDOMObjectMap().set(impl, wrapperHandle);
    return wrapper;
}

void V8Navigator::derefObject(void* object)
{
    static_cast<Navigator*>(object)->deref();
}

} // namespace WebCore


text:
<?php

class ByzantineCoinForm extends Pas_Form {

    /** The constructor
     * @access public
     * @param array $options
     * @return void
     */
    public function __construct(array $options = null){

        $rulers = new Rulers();
	$ruler_options = $rulers->getRulersByzantine();

	$denominations = new Denominations();
	$denomination_options = $denominations->getDenomsByzantine();

        $mints = new Mints();
	$mint_options = $mints->getMintsByzantine();

	$statuses = new Statuses();
	$status_options = $statuses->getCoinStatus();

	$dies = new DieAxes();
	$die_options = $dies->getAxes();

	$wears = new WearTypes;
	$wear_options = $wears->getWears();

	parent::__construct($options);

	$this->setName('romancoin');

	$denomination = new Zend_Form_Element_Select('denomination');
	$denomination->setLabel('Denomination: ')
                ->addValidators(array('NotEmpty','Int'))
                ->addMultiOptions(array(
                    null => 'Choose denomination',
                    'Available options' => $denomination_options
                ))
                ->addValidator('InArray', false,
                        array(array_keys($denomination_options)))
                ->setAttribs(array(
                    'class' => 'input-xxlarge selectpicker show-menu-arrow'));

	$denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
	$denomination_qualifier->setLabel('Denomination qualifier: ')
                ->addMultiOptions(array(
                    '1' => 'Certain',
                    '2' => 'Probably',
                    '3' => 'Possibly'
                    ))
                ->setValue(1)
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidator('Int')
                ->setOptions(array('separator' => ''));

	$ruler= new Zend_Form_Element_Select('ruler_id');
	$ruler->setLabel('Ruler: ')
                ->addValidators(array('NotEmpty','Int'))
                ->addMultiOptions(
                        array(
                            null => 'Choose ruler',
                            'Available options' => $ruler_options
                ))
                ->setRegisterInArrayValidator(false)
                ->setAttribs(array(
                    'class' => 'input-xxlarge selectpicker show-menu-arrow'));

	$ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
	$ruler_qualifier->setLabel('Issuer qualifier: ')
                ->addMultiOptions(
                        array(
                            '1' => 'Certain',
                            '2' => 'Probably',
                            '3' => 'Possibly'
                            ))
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty', 'Int'));

	$mint_ID= new Zend_Form_Element_Select('mint_id');
	$mint_ID->setLabel('Issuing mint: ')
                ->addValidators(array('NotEmpty','Int'))
                ->setAttribs(array(
                    'class' => 'input-xxlarge selectpicker show-menu-arrow'))
                ->addMultiOptions(
                        array(
                            null => 'Choose mint',
                            'Available options' => $mint_options
                ))
                ->addValidator('InArray', false, array(array_keys($mint_options)));

	$mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier');
	$mint_qualifier->setLabel('Mint qualifier: ')
                ->addMultiOptions(
                        array(
                            '1' => 'Certain',
                            '2' => 'Probably',
                            '3' => 'Possibly'
                            ))
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty', 'Int'));

	$status = new Zend_Form_Element_Select('status');
	$status->setLabel('Status: ')
                ->setRegisterInArrayValidator(false)
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty', 'Int'))
                ->setValue(1)
                ->setAttribs(array(
                    'class' => 'input-xlarge selectpicker show-menu-arrow'))
                ->addMultiOptions(
                        array(
                            null => 'Choose a status',
                            'Available status options' => $status_options
                ));

	$status_qualifier = new Zend_Form_Element_Radio('status_qualifier');
	$status_qualifier->setLabel('Status qualifier: ')
                ->addMultiOptions(
                        array(
                            '1' => 'Certain',
                            '2' => 'Probably',
                            '3' => 'Possibly'
                            ))
                ->setValue(1)
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty', 'Int'));

	$degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
	$degree_of_wear->setLabel('Degree of wear: ')
                ->addValidator('InArray', false, array(array_keys($wear_options)))
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty', 'Int'))
                ->setAttribs(array(
                    'class' => 'input-xxlarge selectpicker show-menu-arrow'))
                ->addMultiOptions(array(
                    null => 'Choose degree of wear',
                    'Available options' => $wear_options
                ));

	$obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
	$obverse_inscription->setLabel('Obverse inscription: ')
                ->setAttrib('class','span6')
                ->addFilters(array('StripTags','StringTrim'));

	$reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
	$reverse_inscription->setLabel('Reverse inscription: ')
                ->addFilters(array('StripTags','StringTrim'))
                ->setAttrib('class','span6');

	$obverse_description = new Zend_Form_Element_Textarea('obverse_description');
	$obverse_description->setLabel('Obverse description: ')
                ->addValidators(array('NotEmpty'))
                ->setAttrib('rows',8)
                ->setAttrib('cols',80)
                ->setAttrib('class', 'span6')
                ->addFilters(array('StripTags','StringTrim'));

	$reverse_description = new Zend_Form_Element_Textarea('reverse_description');
	$reverse_description->setLabel('Reverse description: ')
                ->addValidators(array('NotEmpty'))
                ->setAttrib('rows',8)
                ->setAttrib('cols',80)
                ->setAttrib('class', 'span6')
                ->addFilters(array('StripTags','StringTrim'));

	$die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
	$die_axis_measurement->setLabel('Die axis measurement: ')
                ->setRegisterInArrayValidator(false)
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty','Int'))
                ->setAttribs(array(
                    'class' => 'input-xxlarge selectpicker show-menu-arrow'))
                ->addMultiOptions(array(
                    null => 'Choose die axis',
                    'Available options' => $die_options
                ));

	$die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
	$die_axis_certainty->setLabel('Die axis certainty: ')
                ->addMultiOptions(
                        array(
                            '1' => 'Certain',
                            '2' => 'Probably',
                            '3' => 'Possibly'
                            ))
                ->addFilters(array('StripTags','StringTrim'))
                ->addValidators(array('NotEmpty','Int'))
                ->setOptions(array('separator' => ''));

	$submit = new Zend_Form_Element_Submit('submit');

	$this->addElements(array(
            $ruler, $denomination, $mint_ID,
            $status, $degree_of_wear, $obverse_description,
            $obverse_inscription, $reverse_description, $reverse_inscription,
            $die_axis_measurement, $die_axis_certainty, $mint_qualifier,
            $ruler_qualifier, $denomination_qualifier, $status_qualifier,
            $submit
                ));

	$this->addDisplayGroup(
                array(
                    'denomination', 'denomination_qualifier', 'ruler_id',
                    'ruler_qualifier', 'mint_id', 'mint_qualifier',
                    'status', 'status_qualifier', 'degree_of_wear',
                    'obverse_description', 'obverse_inscription', 'reverse_description',
                    'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'),
                'details');

	$this->addDisplayGroup(array('submit'), 'buttons');
        parent::init();
	}
}


text:
export default class CoordinateTransforms {
    constructor(offset) {
        this.offset = offset
    }

    canvasToCartesian(point) {
        return CoordinateTransforms.canvasToCartesian(point, this.offset)
    }

    cartesianToCanvas(point) {
        return CoordinateTransforms.cartesianToCanvas(point, this.offset)
    }

    cartesianToPolar(point) {
        return CoordinateTransforms.cartesianToPolar(point)
    }

    polarToCartesian(point) {
        return CoordinateTransforms.polarToCartesian(point)
    }

    polarToCanvaspolar(point) {
        return CoordinateTransforms.polarToCanvas(point)
    }

    canvaspolarToPolar(point) {
        return CoordinateTransforms.polarToCanvas(point)
    }

    static canvasToCartesian(point, offset) {
        return {
            x: point.x - offset.x,
            y: offset.y - point.y
        }
    }

    static cartesianToCanvas(point, offset) {
        return {
            x: point.x + offset.x,
            y: offset.y - point.y
        }
    }

    static cartesianToPolar(point) {
        let theta = Math.atan2(point.y, point.x);
        if (point.y < 0) theta += 2 * Math.PI
        return {
            r: Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2)),
            theta: theta
        }
    }

    static polarToCartesian(point) {
        return {
            x: point.r * Math.cos(point.theta),
            y: point.r * Math.sin(point.theta)
        }
    }

    static polarToCanvas(point) {
        return {
            r: point.r,
            theta: 2 * Math.PI - point.theta
        }
    }

    static eventToCanvas(e) {
        var rect = document.getElementById(e.target.id).getBoundingClientRect();
        return {
            x: e.clientX - rect.left,
            y: e.clientY - rect.top
        };
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.camel</groupId>
    <artifactId>components</artifactId>
    <version>2.21.0-SNAPSHOT</version>
  </parent>

  <artifactId>camel-google-bigquery</artifactId>
  <packaging>jar</packaging>
  <name>Camel :: GoogleBigQuery</name>
  <description>Camel Component for Google Cloud Platform BigQuery</description>

  <properties>
    <camel.osgi.export.pkg>org.apache.camel.component.google.bigquery</camel.osgi.export.pkg>
    <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=google-bigquery</camel.osgi.export.service>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-bigquery</artifactId>
      <version>${google-api-services-bigquery-version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <childDelegation>false</childDelegation>
          <useFile>true</useFile>
          <forkCount>1</forkCount>
          <reuseForks>true</reuseForks>
          <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
          <includes>
            <!-- Here we only run test of  -->
            <include>**/unit/*.java</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>google-bigquery-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <childDelegation>false</childDelegation>
              <useFile>true</useFile>
              <forkCount>1</forkCount>
              <reuseForks>true</reuseForks>
              <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
              <includes>
                <include>**/*Test.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
package org.jboss.weld.tests.interceptors.injectionWithExclusions;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

/**
 * @author Marius Bogoevici
 */
public class EjbInterceptor2 {
    static int count;

    @AroundInvoke
    public Object doInTransaction(InvocationContext invocationContext) throws Exception {
        count = Counter.next();
        return invocationContext.proceed();
    }
}


text:
app.factory('BlankFactory', [function() {}]);

app.service('BlankService', [function() {}]);


text:
package com.example.hosorderproject.model;

import java.io.Serializable;

public class DeptDao implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private int Id;
	private String HospitalId;
	private String DeptId;
	private String DeptName;
	private String ParentId;
	private String ParentName;

	private String TelephoneNo;
	private String Address;
	private String Information;
	private String KeyWord;
	private String LogoUrl;
	private String PictureUrl;
	public int getId() {
		return Id;
	}
	public void setId(int id) {
		Id = id;
	}
	public String getHospitalId() {
		return HospitalId;
	}
	public void setHospitalId(String hospitalId) {
		HospitalId = hospitalId;
	}
	public String getDeptId() {
		return DeptId;
	}
	public void setDeptId(String deptId) {
		DeptId = deptId;
	}
	public String getDeptName() {
		return DeptName;
	}
	public void setDeptName(String deptName) {
		DeptName = deptName;
	}
	public String getParentId() {
		return ParentId;
	}
	public void setParentId(String parentId) {
		ParentId = parentId;
	}
	public String getParentName() {
		return ParentName;
	}
	public void setParentName(String parentName) {
		ParentName = parentName;
	}
	public String getTelephoneNo() {
		return TelephoneNo;
	}
	public void setTelephoneNo(String telephoneNo) {
		TelephoneNo = telephoneNo;
	}
	public String getAddress() {
		return Address;
	}
	public void setAddress(String address) {
		Address = address;
	}
	public String getInformation() {
		return Information;
	}
	public void setInformation(String information) {
		Information = information;
	}
	public String getKeyWord() {
		return KeyWord;
	}
	public void setKeyWord(String keyWord) {
		KeyWord = keyWord;
	}
	public String getLogoUrl() {
		return LogoUrl;
	}
	public void setLogoUrl(String logoUrl) {
		LogoUrl = logoUrl;
	}
	public String getPictureUrl() {
		return PictureUrl;
	}
	public void setPictureUrl(String pictureUrl) {
		PictureUrl = pictureUrl;
	}
	@Override
	public String toString() {
		return "DeptDao [Id=" + Id + ", HospitalId=" + HospitalId + ", DeptId="
				+ DeptId + ", DeptName=" + DeptName + ", ParentId=" + ParentId
				+ ", ParentName=" + ParentName + ", TelephoneNo=" + TelephoneNo
				+ ", Address=" + Address + ", Information=" + Information
				+ ", KeyWord=" + KeyWord + ", LogoUrl=" + LogoUrl
				+ ", PictureUrl=" + PictureUrl + "]";
	}

	public DeptDao(){

	}

	public DeptDao(int id, String hospitalId, String deptId, String deptName,
			String parentId, String parentName, String telephoneNo,
			String address, String information, String keyWord, String logoUrl,
			String pictureUrl) {
		super();
		Id = id;
		HospitalId = hospitalId;
		DeptId = deptId;
		DeptName = deptName;
		ParentId = parentId;
		ParentName = parentName;
		TelephoneNo = telephoneNo;
		Address = address;
		Information = information;
		KeyWord = keyWord;
		LogoUrl = logoUrl;
		PictureUrl = pictureUrl;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return super.hashCode();
	}

}