text:
RSpec.shared_examples 'Neo4j::Relationship' do
  let(:node_a) { Neo4j::Node.create(name: 'a') }
  let(:node_b) { Neo4j::Node.create(name: 'b') }
  let(:node_c) { Neo4j::Node.create(name: 'c') }

  describe 'classmethod: load' do
    it 'returns the relationship' do
      rel = node_a.create_rel(:best_friend, node_b)
      id = rel.neo_id
      expect(Neo4j::Relationship.load(id)).to eq(rel)
    end

    it 'returns nil if not found' do
      expect(Neo4j::Relationship.load(4_299_991)).to be_nil
    end
  end

  describe 'classmethod: _load' do
    it 'returns the unwrapped relationship' do
      rel = node_a.create_rel(:best_friends, node_b)
      id = rel.neo_id
      expect(Neo4j::Relationship._load(id)).to eq(rel)
    end

    it 'returns nil if not found' do
      expect(Neo4j::Relationship._load(4_299_991)).to be_nil
    end
  end

  describe 'classmethod: create' do
    it 'creates a relationship' do
      a = Neo4j::Node.create
      b = Neo4j::Node.create
      r = Neo4j::Relationship.create(:knows, a, b)
      expect(r).not_to be_nil
      expect(a.rel(dir: :outgoing, type: :knows)).to eq(r)
      expect(b.rel(dir: :incoming, type: :knows)).to eq(r)
    end

    it 'can create and set properties' do
      a = Neo4j::Node.create
      b = Neo4j::Node.create
      Neo4j::Relationship.create(:knows, a, b, name: 'a', age: 42)
      expect(a.rel(dir: :outgoing, type: :knows)[:name]).to eq('a')
      expect(b.rel(dir: :incoming, type: :knows)[:age]).to eq(42)
    end
  end

  describe 'rel_type' do
    it 'returns the type' do
      a = Neo4j::Node.create
      b = Neo4j::Node.create
      rel = a.create_rel(:knows, b)
      expect(rel.rel_type).to be(:knows)
    end
  end

  describe 'exist?' do
    it 'is true if it exists' do
      rel = node_a.create_rel(:best_friend, node_b)
      expect(rel.exist?).to be true
    end
  end

  describe '[] and []=' do
    let(:rel_a) { node_a.create_rel(:best_friend, node_b) }

    it 'can set a relation' do
      rel_a[:since] = 2000
      expect(rel_a[:since]).to eq(2000)
    end

    it 'can delete a relationship' do
      rel_a[:since] = 'hej'
      rel_a[:since] = nil
      expect(rel_a[:since]).to be_nil
    end
  end

  describe 'end_node' do
    let(:rel_a) { node_a.create_rel(:best_friend, node_b) }

    it 'returns the end_node' do
      expect(rel_a.end_node).to eq(node_b)
    end
  end

  describe 'other_node' do
    let(:rel_a) { node_a.create_rel(:best_friend, node_b) }

    it 'returns the other node' do
      expect(rel_a.other_node(node_a)).to eq(node_b)
      expect(rel_a.other_node(node_b)).to eq(node_a)
    end
  end

  describe 'start_node' do
    let(:rel_a) { node_a.create_rel(:best_friend, node_b) }

    it 'returns the end_node' do
      expect(rel_a.start_node).to eq(node_a)
    end
  end

  describe 'del' do
    require 'pry'
    let(:rel_a) do
      node_a.create_rel(:best_friend, node_b)
    end

    it 'does not exist after del' do
      expect(rel_a.exist?).to be true
      rel_a.del
      expect(rel_a.exist?).to be false
    end

    it 'does not exist after destroy' do
      expect(rel_a.exist?).to be true
      rel_a.destroy
      expect(rel_a.exist?).to be false
    end

    it 'does not exist after delete' do
      expect(rel_a.exist?).to be true
      rel_a.delete
      expect(rel_a.exist?).to be false
    end
  end

  describe 'update_props' do
    let(:n1) { Neo4j::Node.create }
    let(:n2) { Neo4j::Node.create }

    it 'keeps old properties' do
      a = n1.create_rel(:knows, n2, old: 'a')
      a.update_props({})
      expect(a[:old]).to eq('a')

      a.update_props(new: 'b', name: 'foo')
      expect(a[:old]).to eq('a')
      expect(a[:new]).to eq('b')
      expect(a[:name]).to eq('foo')
    end

    it 'replace old properties' do
      a = n1.create_rel(:knows, n2, old: 'a')
      a.update_props(old: 'b')
      expect(a[:old]).to eq('b')
    end

    it 'replace escape properties' do
      a = n1.create_rel(:knows, n2)
      a.update_props(old: "\"'")
      expect(a[:old]).to eq("\"'")
    end

    it 'allows strange property names' do
      a = n1.create_rel(:knows, n2)
      a.update_props('1' => 2, ' ha ' => 'ho')
      expect(a.props).to eq(:"1" => 2, :" ha " => 'ho')
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
using System;

public class Test {

	public static int Main () {
		object[] array = new object[10];

		if (array.GetType ().IsPublic)
			return 0;

		return 1;
	}

}


text:
/**
 * \file
 * An ndio plugin for writing raw data.
 *
 * \todo Append raw data
 *
 * \author Nathan Clack
 * \date   Aug 2012
 */
#include "nd.h"
#include <stdio.h>
/// @cond DEFINES
#define countof(e) (sizeof(e)/sizeof(*e))
#define ENDL                  "\n"
#define LOG(...)              printf(__VA_ARGS__)
#define TRY(e)                do{if(!(e)) { LOG("%s(%d): %s()"ENDL "\tExpression evaluated as false."ENDL "\t%s"ENDL,__FILE__,__LINE__,__FUNCTION__,#e); goto Error;}} while(0)
#define TRYMSG(e,msg)         do{if(!(e)) {LOG("%s(%d): %s()"ENDL "\tExpression evaluated as false."ENDL "\t%s"ENDL "\t%sENDL",__FILE__,__LINE__,__FUNCTION__,#e,msg); goto Error; }}while(0)
#define FAIL(msg)             do{ LOG("%s(%d): %s()"ENDL "\t%s"ENDL,__FILE__,__LINE__,__FUNCTION__,msg); goto Error;} while(0)
#define RESIZE(type,e,nelem)  TRY((e)=(type*)realloc((e),sizeof(type)*(nelem)))
#define NEW(type,e,nelem)     TRY((e)=(type*)malloc(sizeof(type)*(nelem)))
#define SAFEFREE(e)           if(e){free(e); (e)=NULL;}
/// @endcond
//
//  === HELPERS ===
//
//
/**
 * Set read/write mode flags according to mode string.
 */
static
unsigned parse_mode_string(const char* mode)
{ char *c;
  for(c=(char*)mode;*c;++c)
  { if(*c!='w') FAIL("Invalid mode string");
  }
  return 1;
Error:
  return 0;
}
/** The format name.
    Use the format name to select this format.
*/
static const char* raw_fmt_name(void) { return "raw"; }
/** This format is disabled for autodetection.
    \returns 0.
 */
static unsigned raw_is_fmt(const char* path, const char *mode)
{ return 0;
}
/**
 * Opens a raw file.  Only writing permitted.
 */
static void* raw_open(const char* path, const char* mode)
{ FILE *out=0;
  TRY(parse_mode_string(mode));
  TRY(out=fopen(path,mode));
  return out;
Error:
  LOG("%s(%d): %s()"ENDL "\tCould not open"ENDL "\t\t%s"ENDL "\t\twith mode \"%s\""ENDL,
      __FILE__,__LINE__,__FUNCTION__,path?path:"(null)",mode?mode:"(null)");
  return 0;
}
/** Releases resources */
static void raw_close(ndio_t file)
{ FILE *self=(FILE*)ndioContext(file);
  if(self) fclose(self);
}
/**
 * No read support. \returns 0.
 */
static nd_t raw_shape(ndio_t file)
{ return 0;
}
/**
 * No read support. \returns 0.
 */
static unsigned raw_read(ndio_t file,nd_t dst)
{ return 0;
}
/**
 * Write a file raw.
 */
static unsigned raw_write(ndio_t file, nd_t src)
{ FILE *self=(FILE*)ndioContext(file);
  TRY(ndnelem(src)==fwrite(nddata(src),ndbpp(src),ndnelem(src),self));
  return 1;
Error:
  return 0;
}
/**
 * Seek. No read support. \returns 0.
 */
static unsigned raw_seek(ndio_t file, nd_t dst, size_t *pos)
{ return 0;
}
/**
 * Query which dimensions ares seekable.
 * No read support. \returns 0.
 */
static unsigned raw_canseek(ndio_t file, size_t idim)
{ return 0;
}
//
// === EXPORT ===
//
/// @cond DEFINES
#ifdef _MSC_VER
#define shared __declspec(dllexport)
#else
#define shared
#endif
/// @endcond
#include "src/io/interface.h"
/// Interface function for the ndio-raw plugin.
shared const ndio_fmt_t* ndio_get_format_api(void)
{
  static ndio_fmt_t api=
  { raw_fmt_name,
    raw_is_fmt,
    raw_open,
    raw_close,
    NULL,//raw_shape,
    NULL,//raw_read,
    raw_write,
    NULL, //set
    NULL, //get
    NULL,//raw_canseek,
    NULL,//raw_seek,
    NULL
  };
  return &api;
}


text:
#ifndef __las_hpp__
#error Cannot directly include this file, this is a part of las.hpp
#endif

#define LASZIP_GPSTIME_MULTI 500
#define LASZIP_GPSTIME_MULTI_MINUS -10
#define LASZIP_GPSTIME_MULTI_UNCHANGED (LASZIP_GPSTIME_MULTI - LASZIP_GPSTIME_MULTI_MINUS + 1)
#define LASZIP_GPSTIME_MULTI_CODE_FULL (LASZIP_GPSTIME_MULTI - LASZIP_GPSTIME_MULTI_MINUS + 2)

#define LASZIP_GPSTIME_MULTI_TOTAL (LASZIP_GPSTIME_MULTI - LASZIP_GPSTIME_MULTI_MINUS + 6)

namespace lazperf
{
		// Teach packers how to pack and unpack gps time
		//
		template<>
		struct packers<las::gpstime> {
			inline static las::gpstime unpack(const char *in) {
				uint64_t lower = packers<unsigned int>::unpack(in),
						 upper = packers<unsigned int>::unpack(in + 4);

				return las::gpstime((upper << 32) | lower);
			}

			inline static void pack(const las::gpstime& t, char *buffer) {
				packers<unsigned int>::pack(t.value & 0xFFFFFFFF, buffer);
				packers<unsigned int>::pack(t.value >> 32, buffer + 4);
			}
		};

		// Figure how to compress and decompress GPS time fields
		//
		template<>
		struct field<las::gpstime> {
			typedef las::gpstime type;

			field() : compressor_inited_(false), decompressor_inited_(false) {}

			template<
				typename TEncoder
			>
			inline const char *compressWith(TEncoder& enc, const char *buf)
            {
                las::gpstime this_val = packers<las::gpstime>::unpack(buf);

				if (!compressor_inited_) {
					compressors_.init();
					compressor_inited_ = true;
				}

				if (!common_.have_last_) {
					// don't have the first data yet, just push it to our have last stuff and move on
					common_.have_last_ = true;
					common_.last_gpstime[0] = this_val;

					// write this out to the encoder as it is
					enc.getOutStream().putBytes((const unsigned char*)buf,
                        sizeof(las::gpstime));
                    buf += sizeof(las::gpstime);

					// we are done here
					return buf;
				}

				if (common_.last_gpstime_diff[common_.last] == 0) { // if last integer different was 0
					if (this_val.value == common_.last_gpstime[common_.last].value) {
						enc.encodeSymbol(common_.m_gpstime_0diff, 0);
					}
					else {
						// calculate the difference between the two doubles as an integer
						//
						int64_t curr_gpstime_diff_64 = this_val.value - common_.last_gpstime[common_.last].value;
						int curr_gpstime_diff = static_cast<int>(curr_gpstime_diff_64);

						if (curr_gpstime_diff_64 == static_cast<int64_t>(curr_gpstime_diff)) {
							// this difference is small enough to be represented with 32 bits
							enc.encodeSymbol(common_.m_gpstime_0diff, 1);
							compressors_.ic_gpstime.compress(enc, 0, curr_gpstime_diff, 0);
							common_.last_gpstime_diff[common_.last] = curr_gpstime_diff;
							common_.multi_extreme_counter[common_.last] = 0;
						}
						else { // the difference is huge
							U32 i;

							// maybe the double belongs to another time sequence
							//
							for (i = 1; i < 4; i++) {
								int64_t other_gpstime_diff_64 = this_val.value -
									common_.last_gpstime[(common_.last+i)&3].value;
								int other_gpstime_diff = static_cast<int>(other_gpstime_diff_64);

								if (other_gpstime_diff_64 == static_cast<int64_t>(other_gpstime_diff)) {
									enc.encodeSymbol(common_.m_gpstime_0diff, i+2); // it belongs to another sequence
									common_.last = (common_.last+i)&3;
                                    return compressWith(enc, buf);
								}
							}

							// no other sequence found. start new sequence.
							enc.encodeSymbol(common_.m_gpstime_0diff, 2);
							compressors_.ic_gpstime.compress(enc,
									static_cast<int>(common_.last_gpstime[common_.last].value >> 32),
									static_cast<int>(this_val.value >> 32), 8);

							enc.writeInt(static_cast<unsigned int>(this_val.value));

							common_.next = (common_.next+1)&3;
							common_.last = common_.next;
							common_.last_gpstime_diff[common_.last] = 0;
							common_.multi_extreme_counter[common_.last] = 0;
						}
						common_.last_gpstime[common_.last] = this_val;
					}
				}
				else { // the last integer difference was *not* zero
					if (this_val.value == common_.last_gpstime[common_.last].value) {
						// if the doubles have not changed use a special symbol
						enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI_UNCHANGED);
					}
					else
					{
						// calculate the difference between the two doubles as an integer
						int64_t curr_gpstime_diff_64 = this_val.value -
							common_.last_gpstime[common_.last].value;
						int curr_gpstime_diff = static_cast<int>(curr_gpstime_diff_64);

						// if the current gpstime difference can be represented with 32 bits
						if (curr_gpstime_diff_64 == static_cast<int64_t>(curr_gpstime_diff)) {
							// compute multiplier between current and last integer difference
							float multi_f = (float)curr_gpstime_diff /
								(float)(common_.last_gpstime_diff[common_.last]);
							int multi = I32_QUANTIZE(multi_f);

							// compress the residual curr_gpstime_diff in dependance on the multiplier
							if (multi == 1) {
								// this is the case we assume we get most often for regular spaced pulses
								enc.encodeSymbol(common_.m_gpstime_multi, 1);
								compressors_.ic_gpstime.compress(enc,
										common_.last_gpstime_diff[common_.last], curr_gpstime_diff, 1);
								common_.multi_extreme_counter[common_.last] = 0;
							}
							else if (multi > 0) {
								if (multi < LASZIP_GPSTIME_MULTI) {
									// positive multipliers up to LASZIP_GPSTIME_MULTI are compressed directly
									enc.encodeSymbol(common_.m_gpstime_multi, multi);
									if (multi < 10)
										compressors_.ic_gpstime.compress(enc,
												multi*common_.last_gpstime_diff[common_.last],
												curr_gpstime_diff, 2);
									else
										compressors_.ic_gpstime.compress(enc,
												multi*common_.last_gpstime_diff[common_.last],
												curr_gpstime_diff, 3);
								}
								else {
									enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI);
									compressors_.ic_gpstime.compress(enc,
											LASZIP_GPSTIME_MULTI*common_.last_gpstime_diff[common_.last],
											curr_gpstime_diff, 4);
									common_.multi_extreme_counter[common_.last]++;

									if (common_.multi_extreme_counter[common_.last] > 3) {
										common_.last_gpstime_diff[common_.last] = curr_gpstime_diff;
										common_.multi_extreme_counter[common_.last] = 0;
									}
								}
							}
							else if (multi < 0) {
								if (multi > LASZIP_GPSTIME_MULTI_MINUS) {
									// negative multipliers larger than LASZIP_GPSTIME_MULTI_MINUS are compressed directly
									enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI - multi);
									compressors_.ic_gpstime.compress(enc,
											multi*common_.last_gpstime_diff[common_.last],
											curr_gpstime_diff, 5);
								}
								else {
									enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI - LASZIP_GPSTIME_MULTI_MINUS);
									compressors_.ic_gpstime.compress(enc,
											LASZIP_GPSTIME_MULTI_MINUS*common_.last_gpstime_diff[common_.last],
											curr_gpstime_diff, 6);

									common_.multi_extreme_counter[common_.last]++;
									if (common_.multi_extreme_counter[common_.last] > 3)
									{
										common_.last_gpstime_diff[common_.last] = curr_gpstime_diff;
										common_.multi_extreme_counter[common_.last] = 0;
									}
								}
							}
							else {
								enc.encodeSymbol(common_.m_gpstime_multi, 0);
								compressors_.ic_gpstime.compress(enc, 0, curr_gpstime_diff, 7);
								common_.multi_extreme_counter[common_.last]++;
								if (common_.multi_extreme_counter[common_.last] > 3)
								{
									common_.last_gpstime_diff[common_.last] = curr_gpstime_diff;
									common_.multi_extreme_counter[common_.last] = 0;
								}
							}
						}
						else { // the difference is huge
							int i;
							// maybe the double belongs to another time sequence
							for (i = 1; i < 4; i++)
							{
								int64_t other_gpstime_diff_64 = this_val.value - common_.last_gpstime[(common_.last+i)&3].value;
								int other_gpstime_diff = static_cast<int>(other_gpstime_diff_64);

								if (other_gpstime_diff_64 == static_cast<int64_t>(other_gpstime_diff)) {
									// it belongs to this sequence
									enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI_CODE_FULL+i);
									common_.last = (common_.last+i)&3;
                                    return compressWith(enc, buf);
								}
							}

							// no other sequence found. start new sequence.
							enc.encodeSymbol(common_.m_gpstime_multi, LASZIP_GPSTIME_MULTI_CODE_FULL);
							compressors_.ic_gpstime.compress(
									enc,
									static_cast<int>(common_.last_gpstime[common_.last].value >> 32),
									static_cast<int>(this_val.value >> 32), 8);
							enc.writeInt(static_cast<unsigned int>(this_val.value));
							common_.next = (common_.next+1)&3;
							common_.last = common_.next;
							common_.last_gpstime_diff[common_.last] = 0;
							common_.multi_extreme_counter[common_.last] = 0;
						}

						common_.last_gpstime[common_.last] = this_val;
					}
				}
                return buf + sizeof(las::gpstime);
			}

			template<
				typename TDecoder
			>
			inline char *decompressWith(TDecoder& dec, char *buf) {
				if (!decompressor_inited_) {
					decompressors_.init();
					decompressor_inited_ = true;
				}

				if (!common_.have_last_) {
					// don't have the first data yet, read the whole point out of the stream
					common_.have_last_ = true;

					dec.getInStream().getBytes((unsigned char*)buf,
                        sizeof(las::gpstime));
                    // decode this value
                    common_.last_gpstime[0] = packers<las::gpstime>::unpack(buf);

					// we are done here
					return buf + sizeof(las::gpstime);
				}

				int multi;
				if (common_.last_gpstime_diff[common_.last] == 0) { // if the last integer difference was zero
					multi = dec.decodeSymbol(common_.m_gpstime_0diff);

					if (multi == 1) { // the difference can be represented with 32 bits
						common_.last_gpstime_diff[common_.last] = decompressors_.ic_gpstime.decompress(dec, 0, 0);
						common_.last_gpstime[common_.last].value += common_.last_gpstime_diff[common_.last];
						common_.multi_extreme_counter[common_.last] = 0;
					}
					else if (multi == 2) { // the difference is huge
						common_.next = (common_.next+1)&3;
						common_.last_gpstime[common_.next].value = decompressors_.ic_gpstime.decompress(
								dec,
								(common_.last_gpstime[common_.last].value >> 32), 8);
						common_.last_gpstime[common_.next].value = common_.last_gpstime[common_.next].value << 32;
						common_.last_gpstime[common_.next].value |= dec.readInt();
						common_.last = common_.next;
						common_.last_gpstime_diff[common_.last] = 0;
						common_.multi_extreme_counter[common_.last] = 0;
					}
					else if (multi > 2) { // we switch to another sequence
						common_.last = (common_.last+multi-2)&3;

						decompressWith(dec, buf);
					}
				}
				else {
					multi = dec.decodeSymbol(common_.m_gpstime_multi);
					if (multi == 1) {
						common_.last_gpstime[common_.last].value += decompressors_.ic_gpstime.decompress(
								dec,
								common_.last_gpstime_diff[common_.last], 1);
						common_.multi_extreme_counter[common_.last] = 0;
					}
					else if (multi < LASZIP_GPSTIME_MULTI_UNCHANGED) {
						int gpstime_diff;
						if (multi == 0) {
							gpstime_diff = decompressors_.ic_gpstime.decompress(dec, 0, 7);
							common_.multi_extreme_counter[common_.last]++;
							if (common_.multi_extreme_counter[common_.last] > 3) { common_.last_gpstime_diff[common_.last] = gpstime_diff;
								common_.multi_extreme_counter[common_.last] = 0;
							}
						}
						else if (multi < LASZIP_GPSTIME_MULTI) {
							if (multi < 10)
								gpstime_diff = decompressors_.ic_gpstime.decompress(dec,
										multi*common_.last_gpstime_diff[common_.last], 2);
							else
								gpstime_diff = decompressors_.ic_gpstime.decompress(dec,
										multi*common_.last_gpstime_diff[common_.last], 3);
						}
						else if (multi == LASZIP_GPSTIME_MULTI) {
							gpstime_diff = decompressors_.ic_gpstime.decompress(
									dec,
									LASZIP_GPSTIME_MULTI*common_.last_gpstime_diff[common_.last], 4);
							common_.multi_extreme_counter[common_.last]++;
							if (common_.multi_extreme_counter[common_.last] > 3) {
								common_.last_gpstime_diff[common_.last] = gpstime_diff;
								common_.multi_extreme_counter[common_.last] = 0;
							}
						}
						else {
							multi = LASZIP_GPSTIME_MULTI - multi;
							if (multi > LASZIP_GPSTIME_MULTI_MINUS) {
								gpstime_diff = decompressors_.ic_gpstime.decompress(
										dec,
										multi*common_.last_gpstime_diff[common_.last], 5);
							}
							else
							{
								gpstime_diff = decompressors_.ic_gpstime.decompress(
										dec,
										LASZIP_GPSTIME_MULTI_MINUS*common_.last_gpstime_diff[common_.last], 6);
								common_.multi_extreme_counter[common_.last]++;
								if (common_.multi_extreme_counter[common_.last] > 3) {
									common_.last_gpstime_diff[common_.last] = gpstime_diff;
									common_.multi_extreme_counter[common_.last] = 0;
								}
							}
						}
						common_.last_gpstime[common_.last].value += gpstime_diff;
					}
					else if (multi ==  LASZIP_GPSTIME_MULTI_CODE_FULL) {
						common_.next = (common_.next+1)&3;
						common_.last_gpstime[common_.next].value = decompressors_.ic_gpstime.decompress(
								dec, static_cast<int>(common_.last_gpstime[common_.last].value >> 32), 8);
						common_.last_gpstime[common_.next].value = common_.last_gpstime[common_.next].value << 32;
						common_.last_gpstime[common_.next].value |= dec.readInt();
						common_.last = common_.next;
						common_.last_gpstime_diff[common_.last] = 0;
						common_.multi_extreme_counter[common_.last] = 0;
					}
					else if (multi >=  LASZIP_GPSTIME_MULTI_CODE_FULL) {
						common_.last = (common_.last+multi-LASZIP_GPSTIME_MULTI_CODE_FULL)&3;

						decompressWith(dec, buf);
					}
				}
                packers<las::gpstime>::pack(common_.last_gpstime[common_.last],
                    buf);
                return buf + sizeof(las::gpstime);
			}

			// All the things we need to compress a point, group them into structs
			// so we don't have too many names flying around

			// Common parts for both a compressor and decompressor go here
			struct __common {
				bool have_last_;
				models::arithmetic m_gpstime_multi, m_gpstime_0diff;
				unsigned int last, next;
				std::array<las::gpstime, 4> last_gpstime;
				std::array<int, 4> last_gpstime_diff;
				std::array<int, 4> multi_extreme_counter;

				__common() :
					have_last_(false),
					m_gpstime_multi(LASZIP_GPSTIME_MULTI_TOTAL),
					m_gpstime_0diff(6),
					last(0), next(0) {

					last_gpstime.fill(las::gpstime());
					last_gpstime_diff.fill(0);
					multi_extreme_counter.fill(0);
				}

				~__common() {
				}
			} common_;

			// These compressors are specific to a compressor usage, so we keep them separate here
			struct __compressors {
				compressors::integer ic_gpstime;

				__compressors() :
					ic_gpstime(32, 9) {}

				void init() {
					ic_gpstime.init();
				}
			} compressors_;

			struct __decompressors {
				decompressors::integer ic_gpstime;

				__decompressors() :
					ic_gpstime(32, 9) {}

				void init() {
					ic_gpstime.init();
				}
			} decompressors_;

			bool compressor_inited_;
			bool decompressor_inited_;
		};
} // namespace lazperf


text:
<?php

// This is to help new users to Composer
if (!file_exists('../../vendor/autoload.php')) {
    die("Run 'composer install' from the command line");
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
// This is to help new users to Composer

require_once '../../vendor/autoload.php';

if (file_exists('../config.php')) {
    include '../config.php'; // Has the credentials
}

use AntiMattr\OAuth\RequestSigner;
use AntiMattr\Twitter\Marketplace\Model\Gateway\Stripe\Credentials;
use AntiMattr\Twitter\Marketplace\Model\Gateway\Stripe\Gateway;
use AntiMattr\Twitter\Marketplace\Model\Merchant;
use AntiMattr\Twitter\Marketplace\ProcessorFactory;
use AntiMattr\Twitter\Marketplace\ResponseHandler\ResponseHandlerFactory;
use Buzz\Client\Curl as RESTClient;
use Buzz\Message\Factory\Factory as MessageFactory;
use Doctrine\Common\Collections\ArrayCollection;

$accountId = TWITTER_ACCOUNT_ID; // Assigned By Twitter
$consumerKey = TWITTER_CONSUMER_KEY; // Located in Twitter App Dashboard
$consumerSecret = TWITTER_CONSUMER_SECRET; // Located in Twitter App Dashboard
$host = 'https://cards-staging.twitter.com';
$oAuthToken = TWITTER_OAUTH_TOKEN; // This needs to be generated from Twitter API
$oAuthTokenSecret = TWITTER_OAUTH_TOKEN_SECRET; // This needs to be generated from Twitter API
$authToken = TWITTER_STRIPE_OAUTH_TOKEN; // Assigned by Stripe
$publishableKey = TWITTER_STRIPE_PUBLISHABLE_KEY; // Assigned by Stripe
$processorUserId = TWITTER_STRIPE_USER_ID; // Assigned by Stripe

$error = '';
$success = '';

$client = new RESTClient();
$messageFactory = new MessageFactory();
$signer = new RequestSigner();
$responseHandlerFactory = new ResponseHandlerFactory();
$factory = new ProcessorFactory();
$processor = $factory->getProcessor(
    'default',
    $client,
    $messageFactory,
    $signer,
    $responseHandlerFactory,
    $host
);
$merchant = new Merchant();
$merchant->setAccountId($accountId);

// OAuth
$oAuth = $merchant->getOAuth();
$oAuth->setConsumerKey($consumerKey);
$oAuth->setConsumerSecret($consumerSecret);
$oAuth->setOAuthToken($oAuthToken);
$oAuth->setOAuthTokenSecret($oAuthTokenSecret);

$error = '';
$success = '';

$credentials = new Credentials();
$credentials->setAuthToken($authToken);
$credentials->setPublishableKey($publishableKey);
$credentials->setProcessorUserId($processorUserId);

$gateway = new Gateway();
$gateway->setCredentials($credentials);
$merchant->setGateway($gateway);

if ($_POST) {

    $m = $_POST['merchant'];
    $a = $_POST['address'];
    try {
        // Foreign Reference
        $merchant->setExternalId($m['externalId']);

        // Profile
        $merchant->setName($m['name']);
        $merchant->setEmail($m['email']);
        $merchant->setSupportEmail($m['supportEmail']);
        $domainCollection = new ArrayCollection($m['domains']);
        $merchant->setDomains($domainCollection);

        // Address
        $address = $merchant->getAddress();
        $address->setStreetAddressLine1($a['streetAddressLine1']);
        $address->setLocality($a['locality']);
        $address->setRegion($a['region']);
        $address->setPostalCode($a['postalCode']);
        $address->setCountry($a['country']);

        $processor->createMerchant($merchant);
        $processor->createPaymentProcessor($merchant);
        $success = sprintf('Twitter Merchant with ID %s attached to Payment Processor', $merchant->getId());

    } catch (\Exception $e) {
        $error = sprintf(
            '%s: %s',
            get_class($e),
            $e->getMessage()
        );
    }
}

?>

<!DOCTYPE html>

        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title>Twitter Marketplace | Create Payment Processor | Demo</title>

<?php echo $error ?>

<?php echo $success ?>

        <form action="" method="POST" id="payment-form">
            <fieldset>
                <legend>Profile</legend>

                    External ID
                    <input name="merchant[externalId]" value="xxxxxx" />

                    Name
                    <input name="merchant[name]" value="Test Name" />

                    Email
                    <input name="merchant[email]" value="test@example.com" />

                    Support Email
                    <input name="merchant[supportEmail]" value="support@example.com" />

                    Domain (no protocol)
                    <input name="merchant[domains][0]" value="www.example.com" />

            </fieldset>
            <fieldset>
                <legend>Address</legend>

                    Street
                    <input name="address[streetAddressLine1]" value="99 Gold Street" />

                    City
                    <input name="address[locality]" value="Brooklyn" />

                    State
                    <input name="address[region]" value="NY" />

                    Zip
                    <input name="address[postalCode]" value="11201" />

                    Country
                    <input name="address[country]" value="US" />

            </fieldset>

            <button type="submit" class="submit-button">Submit</button>
        </form>
        <?php if (isset($merchant)) { ?>

Merchant

<?php
print_r($merchant);
?>

        <?php } ?>


text:
```
dotnet add package PeterJuhasz.AspNetCore.Security.Extensions
```

Contains a set of high-performance extensions which can help you make your web applications more secure. You can also install each feature invididually as a separate package.

## Table of contents

Tag Helpers
  - NoOpener
  - Subresource Integrity
  - Upgrade Insecure Resources

Middlewares
  - Features
    - Redirect Policy
    - Require Authenticated Identity
  - Headers
    - Content Security Policy
	- Expect CT
    - Feature Policy
    - Frame Options
    - HTTP Public Key Pinning
    - Permissions Policy
    - Referrer Policy
    - Report To
    - X-Content-Type-Options
    - X-Download-Options
    - X-Permitted-Cross-Domain-Policies
    - X-Robots-Tag
    - X-UA-Compatible
    - X-XSS-Protection

## Features

### Content-Security-Policy

Adds the `Content-Security-Policy` headers to responses with content type `text/html`.

```csharp
services.AddContentSecurityPolicy(new CspOptions
{
    DefaultSrc = CspDirective.None,
    StyleSrc = StyleCspDirective.Self,
    ScriptSrc = ScriptCspDirective.Self
        .AddSource(new Uri("https://az416426.vo.msecnd.net/")), // Application Insights
    ImgSrc = CspDirective.Self
        .AddDataScheme(),
    FontSrc = CspDirective.Self,
    ConnectSrc = CspDirective.Empty
        .AddSource(new Uri("https://dc.services.visualstudio.com/")),
});

// ...

app.UseContentSecurityPolicy();
```

### Cross Origin Resource Sharing

Use the built-in support in ASP.NET Core 3.0.

### Expect-CT

Adds the `Expect-CT` header which allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements.

```csharp
app.UseExpectCT(enforce: true, maxAge: TimeSpan.FromHours(1));
```

### Feature-Policy (deprecated)

Adds the `Feature-Policy` header to responses with content type `text/html`.

```csharp
app.UseFeaturePolicy(
    new FeatureDirectiveList()
        .Add(FeatureDirective.Payment, "https://payment.example.org/")
        .AddNone(FeatureDirective.Microphone)
        .AddSelf(FeatureDirective.FullScreen)
);
```

### Frame Options (deprecated)

Adds the `Frame-Options` and `X-Frame-Options` headers to responses with content type `text/html`.

```csharp
app.UseFrameOptions(FrameOptionsPolicy.Deny);
```

If you want to enable displaying the page in a frame on a particular origin, you can set it like this:

```csharp
app.UseFrameOptions(new Uri("https://www.example.org"));
```

### HTTP Strict Transport Security

Use the built-in support in ASP.NET Core 3.0.

### HTTP Public Key Pinning (deprecated)

Adds the `Public-Key-Pinning` header to all responses.

```csharp
app.UseHttpPublicKeyPinning(options => options
    .Pin(fingerprint1, HttpPublicKeyPinningHashAlgorithm.Sha256)
    .Pin(fingerprint2, HttpPublicKeyPinningHashAlgorithm.Sha256)
);
```

### NoOpener

A tag helper that adds the missing `noopener` link relationship type to your `a` tags that open in another frame and doesn't reference the same origin.

Add an import for the tag helper (in your `_ViewImports.cshtml` if you have one):
```cshtml
@addTagHelper *, PeterJuhasz.AspNetCore.Extensions.Security.NoOpener
```

You don't need any additional changes, the tag helper applies to all links, for example:
```html
<a href="https://example.org/malicious.html" target="_blank">Click here</a>
```

And adds the missing `rel` attribute:
```html
<a href="https://example.org/malicious.html" target="_blank" rel="noopener">Click here</a>
```

### Permissions-Policy

Adds the `Permissions-Policy` header to responses with content type `text/html`.

```csharp
app.UsePermissionsPolicy(
    new PermissionsPolicyDirectiveList()
        .Add(PermissionsPolicyPermissions.Payment, "https://payment.example.org/")
        .AddNone(PermissionsPolicyPermissions.Microphone)
        .AddSelf(PermissionsPolicyPermissions.FullScreen)
);
```

### Redirect Policy

Restricts server-side redirects only to trusted origins.

```csharp
app.UseRedirectPolicy();
```

You can also specify the trusted origins:

```csharp
app.UseRedirectPolicy(allowedBaseUris: "https://www.example.org");
```

### Referrer Policy

Adds the `Referrer-Policy` header to all responses.

```csharp
app.UseReferrerPolicy(ReferrerPolicy.SameOrigin);
```

### Report-To
Add the `Report-To` header to all responses.

```csharp
app.UseReportTo(new ReportingGroup(
    maxAge: TimeSpan.FromDays(30),
    endpoint: "https://example.org/browser-report"
));
```

### Require Authenticated Identity
This is a middleware that you can use to require an authenticated identity on the `HttpContext` to proceed. For example, you can use this middleware to require authentication for static files.

```csharp
app.UseWhen(
    context => context.Request.Path.StartsWithSegments("/dist"),
    branch => branch.UseRequireAuthenticatedIdentity()
);
```

Notes:
 - `401` is returned in case of no authenticated user

### Subresource Integrity
A tag helper that computes the `integrity` attribute for linked styles and scripts from remote origins. It also adds the `crossorigin` attribute with `anonymous` value.

Add the required services (in your `Startup.cs`):
```cs
services.AddSubresourceIntegrity();
```

Add an import for the tag helper (in your `_ViewImports.cshtml` if you have one):
```cshtml
@addTagHelper *, PeterJuhasz.AspNetCore.Extensions.Security.SubresourceIntegrity
```

You don't need any additional changes, the tag helper applies to styles and scripts, for example:
```html
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
```

And adds the `integrity` and `crossorigin` attributes:
```html
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha256-YLGeXaapI0/5IgZopewRJcFXomhRMlYYjugPLSyNjTY=" crossorigin="anonymous" />
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha256-CjSoeELFOcH0/uxWu6mC/Vlrc1AARqbm/jiiImDGV3s=" crossorigin="anonymous"></script>
```

Notes:
 - If the `integrity` attribute is already included, it skips that element and doesn't compute and validate it.
 - In case the remote resource is not available, a warning is logged and the integrity attribute is not included. Page rendering is not interrupted.
 - The hash algorithm used is SHA-256.
 - Hashes are cached in a memory cache indefinitely.

### Upgrade Insecure Resources
A tag helper that upgrades insecure links, style, script and image references to HTTPS.

Add an import for the tag helper (in your `_ViewImports.cshtml` if you have one):
```cshtml
@addTagHelper *, PeterJuhasz.AspNetCore.Extensions.Security.UpgradeInscureResources
```

You don't need any additional changes, the tag helper applies to all `href` and `src` attributes:
```html
<a href="http://example.org/page">Click here</a>
<script src="http://example.org/script.js"></script>
```

Will be rewritten to:
```html
<a href="https://example.org/page">Click here</a>
<script src="https://example.org/script.js"></script>
```

### X-Content-Type-Options

Adds the `X-Content-Type-Options` header to all responses.

```csharp
app.UseXContentTypeOptions(XContentTypeOptions.NoSniff);
```

### X-Download-Options

Adds the `X-Download-Options` header to each file download.

```csharp
app.UseXDownloadOptions(XDownloadOptions.NoOpen);
```

### X-Permitted-Cross-Domain-Policies

Adds `X-Permitted-Cross-Domain-Policies` header to all responses.

```csharp
app.UseXPermittedCrossDomainPolicies(PermittedCrossDomainPolicy.None);
```

### X-Robots-Tag

Adds the `X-Robots-Tag` header to all responses.

```csharp
app.UseXRobotsTag(noIndex: true, noFollow: true);
```

### X-UA-Compatible

Adds the `X-UA-Compatible` header to each response with `text/html` media type.

```csharp
app.UseXUACompatible(InternetExplorerCompatibiltyMode.Edge);
```

### X-XSS-Protection (deprecated)

Adds the `X-XSS-Protection` header to each response with `text/html` media type. The default setting enables protection and sets it to `block` mode.

```csharp
app.UseXXSSProtection();
```

## Performance
 - All middlewares are strongly typed using the [`IMiddleware`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.imiddleware) interface
 - All middlewares are singletons, so they don't have to be instantiated for each and every request
 - Response headers are not parsed into objects, low level APIs are satisfactory while providing the same security
 - Header values are pre-rendered, so middlewares are basically allocation free from now (instead of constructing them on the fly, which resulted in lots of new `String` objects on the heap). *Note: this also means that configuration changes won't take effect while running.*
 - **Breaking change**: middlewares must be registered as services before use.


text:
shared_examples_for "a played cell" do |cell_value|
  let(:played_cell) { TicTacToe::Game::Cell.new(board, cell_value) }
  it "sets #played? to true" do

    expect(played_cell.played?).to be_true

  end
  it "sets #empty? to false" do

    expect(played_cell.empty?).to be_false

  end
  it "sets #content to #{cell_value}" do

    expect(played_cell.value).to eq(cell_value)

  end
end


text:
var jwt = require('../index');

var expect = require('chai').expect;
var assert = require('chai').assert;

describe('HS256', function() {

  describe('when signing a token', function() {
    var secret = 'shhhhhh';

    var token = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' });

    it('should be syntactically valid', function() {
      expect(token).to.be.a('string');
      expect(token.split('.')).to.have.length(3);
    });

    it('should without options', function(done) {
      var callback = function(err, decoded) {
        assert.ok(decoded.foo);
        assert.equal('bar', decoded.foo);
        done();
      };
      callback.issuer = "shouldn't affect";
      jwt.verify(token, secret, callback );
    });

    it('should validate with secret', function(done) {
      jwt.verify(token, secret, function(err, decoded) {
        assert.ok(decoded.foo);
        assert.equal('bar', decoded.foo);
        done();
      });
    });

    it('should throw with invalid secret', function(done) {
      jwt.verify(token, 'invalid secret', function(err, decoded) {
        assert.isUndefined(decoded);
        assert.isNotNull(err);
        done();
      });
    });

    it('should throw with secret and token not signed', function(done) {
      var signed = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'none' });
      var unsigned = signed.split('.')[0] + '.' + signed.split('.')[1] + '.';
      jwt.verify(unsigned, 'secret', function(err, decoded) {
        assert.isUndefined(decoded);
        assert.isNotNull(err);
        done();
      });
    });

    it('should throw when verifying null', function(done) {
      jwt.verify(null, 'secret', function(err, decoded) {
        assert.isUndefined(decoded);
        assert.isNotNull(err);
        done();
      });
    });

    it('should return an error when the token is expired', function(done) {
      var token = jwt.sign({ exp: 1 }, secret, { algorithm: 'HS256' });
      jwt.verify(token, secret, { algorithm: 'HS256' }, function(err, decoded) {
        assert.isUndefined(decoded);
        assert.isNotNull(err);
        done();
      });
    });

    it('should NOT return an error when the token is expired with "ignoreExpiration"', function(done) {
      var token = jwt.sign({ exp: 1, foo: 'bar' }, secret, { algorithm: 'HS256' });
      jwt.verify(token, secret, { algorithm: 'HS256', ignoreExpiration: true }, function(err, decoded) {
        assert.ok(decoded.foo);
        assert.equal('bar', decoded.foo);
        assert.isNull(err);
        done();
      });
    });

  });
});


text:
Julia support in Atom is in a very, very early state – we love to have people kicking the
tires, but be ready to get your hands dirty!

## Help & Bug Reporting

This project is composed of many sub-projects, and it can be hard to know the appropriate
place to file issues. For that reason we prefer that non-developers report issues on the
[Juno discussion forum](http://discuss.junolab.org/) under the "issue" category, and we can
funnel things through to the right places from there.

## Contributing

If you have feature ideas you'd like to implement, or bugs you'd like to fix, feel free to
open a [discussion](http://discuss.junolab.org/) under the "dev" category – we're always happy
to help people flesh out their ideas or get unstuck on problems.

If you look over the GitHub issues for the various packages, you may notice some labelled
"up for grabs". These are features or bugs for which the implementation or fix is reasonably
straightforward – they might take a few hours of effort or more, but they won't involve enormous
expert-level challenges. As above, feel free to open up a discussion on these and we'll help
you get going.

Please read the [developer set up guidelines](docs/) to get started. There's a basic
development tutorial there, but as you get deeper you'll want some more general resources:

* [Julia Documentation](http://docs.julialang.org/en/latest/) – for learning about the Julia
  language.
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript) – by far the best reference
  on the JavaScript language and browser window APIs.
* [CoffeeScript](http://coffeescript.org/) – Atom and its packages use this to make working
  with JS a little more convenient.
* [The Atom Docs](https://atom.io/docs) – the Atom Flight Manual is a very readable introduction
  to Atom's internals, and the API docs are a useful reference.
* [julia-client developer docs](docs/) – These docs go into more detail about the internals
  of this project and the development workflow.

Most open source projects, including ours, use [git](http://git-scm.org) to help work
together. There are plenty of git tutorials around, and the various GUI clients (e.g. GitHub
for Windows/Mac, SourceTree) are very helpful for learning the ropes.


text:
1

2

3


text:
Experiments with C

# TODO

## Major Features

1. Water mesh & shader.
2. Shadow mapping.
3. More realistic lighting.
4. Grass.

## Code Cleanup

1. Make sure there's no code to be reused between Grid and Terrain.
1. Research ways to reuse code between shader files. Possibly some sort of `#include` mechanism.

## Miscellaneous

1. Empty CompilationError is thrown if shaders/<prefix>/vertex.glsl isn't found.
1. Allow Shaders to cache anonymous uniform update requests for when they are activated again.


text:
ZombAI - Zombie AI Simulator
============================

ZombAI is a project exploring level-of-detail as applied to situations
with a high number of autonomous agents that the player is *not*
interacting with.

The LOD aspect is intended to ameliorate potentially heavy demands on
limited system resources - mobile CPUs, for example - while still
allowing for high-quality artificial intelligence algorithms.

Of course, LOD is only one tiny part of this puzzle, but here we are.

Although this project is built in Unity, I will endeavor to partition
the actual algorithms from the bits used to display the simulated world.

----

MIT License

Credits:
I am utilizing ChevyRay's QuadTree project, also under MIT License:
https://github.com/ChevyRay/QuadTree


text:
package com.xiaoaiqinqin.common.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * 时间工具类
 *
 * @author luo.cq
 * @since 2016-05-13
 *
 */
public class DateUtil {

	/**
	 * 默认返回年月日格式
	 *
	 * @param date
	 * @return
	 */
	public static String formatDate(Date date) {
		return formatDateByPattern(date, "yyyy-MM-dd");
	}

	/**
	 * 返回指定格式的时间字符串
	 *
	 * @param date
	 * @param pattern
	 * @return
	 */
	public static String formatDateByPattern(Date date, String pattern) {
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		return sdf.format(date);
	}

	/**
	 * 将sql.date转换成util.date
	 *
	 * @param date
	 * @return
	 */
	public static java.util.Date paraseDate(java.sql.Date date) {
		return date;
	}

	/**
	 * 将util.date转换成sql.date
	 *
	 * @param date
	 * @return
	 */
	public static java.sql.Date parseSqlDate(Date date) {
		if (date != null) {
			return new java.sql.Date(date.getTime());
		}
		return null;
	}

	public static String formatYyyymmddhhmmss(Date date) {
		return formatDateByPattern(date, "yyyy-MM-dd HH:mm:ss");
	}

	public static String formatYyyymmdd(Date date) {
		return formatDateByPattern(date, "yyyy-MM-dd");
	}

	public static int getYear(Date date) {
		Calendar calendar = getCalendar(date);

		return calendar.get(Calendar.YEAR);
	}

	public static int getMonth(Date date) {
		Calendar calendar = getCalendar(date);
		return calendar.get(Calendar.MONTH);
	}

	public static Calendar getCalendar(Date date) {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		return calendar;
	}

	public static int getDay(java.util.Date date) {
		java.util.Calendar c = java.util.Calendar.getInstance();
		c.setTime(date);
		return c.get(java.util.Calendar.DAY_OF_MONTH);
	}

	public static int getHour(java.util.Date date) {
		java.util.Calendar c = java.util.Calendar.getInstance();
		c.setTime(date);
		return c.get(java.util.Calendar.HOUR_OF_DAY);
	}

	public static int getMinute(java.util.Date date) {
		java.util.Calendar c = java.util.Calendar.getInstance();
		c.setTime(date);
		return c.get(java.util.Calendar.MINUTE);
	}

	public static int getSecond(java.util.Date date) {
		java.util.Calendar c = java.util.Calendar.getInstance();
		c.setTime(date);
		return c.get(java.util.Calendar.SECOND);
	}

	public static long getMillis(Date date) {
		Calendar calendar = getCalendar(date);
		return calendar.getTimeInMillis();
	}

	/**
	 * 日期相减
	 *
	 * @param date
	 *            Date
	 * @param date1
	 *            Date
	 * @return int
	 */
	public static int diffDate(java.util.Date date, java.util.Date date1) {
		return (int) ((getMillis(date) - getMillis(date1)) / (24 * 3600 * 1000));
	}

	/**
	 * 日期相减(返回秒值)
	 *
	 * @param date
	 *            Date
	 * @param date1
	 *            Date
	 * @return int
	 * @author
	 */
	public static Long diffDateTime(java.util.Date date, java.util.Date date1) {
		return (Long) ((getMillis(date) - getMillis(date1)) / 1000);
	}

	public static java.util.Date getdate(String date) throws Exception {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		return sdf.parse(date);
	}

	public static java.util.Date getdate(String date, String formatStr) throws Exception {
		SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
		return sdf.parse(date);
	}

	public static java.util.Date getdate1(String date) throws Exception {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.parse(date);
	}

	public static java.util.Date getMaxTimeByStringDate(String date) throws Exception {
		String maxTime = date + " 23:59:59";
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.parse(maxTime);
	}

	/**
	 * 获得当前时间
	 *
	 * @return
	 */
	public static Date getCurrentDateTime() {
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String result = sdf.format(date);
		try {
			return sdf.parse(result);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;

	}

	/**
	 * 获得当前时间
	 *
	 * @return
	 */
	public static Date getCurrentDate() {
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String result = formatDate(date);
		try {
			return sdf.parse(result);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;

	}

	public static String getCurrentDateTimeToStr() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		return sdf.format(getCurrentDateTime());
	}

	public static String getCurrentDateTimeToStr2() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(getCurrentDateTime());
	}

	public static Long getWmsupdateDateTime() {
		Calendar cl = Calendar.getInstance();

		return cl.getTimeInMillis();
	}

	/**
	 *
	 *
	 * @param date
	 * @return
	 * @throws Exception
	 */
	public static Integer getLeftSeconds(String date) throws Exception {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date condition = sdf.parse(date);
		long n = condition.getTime();
		long s = sdf.parse(getCurrentDateTimeToStr2()).getTime();
		// System.out.println("开始时间:"+date+"-->"+(int)((s-n)/1000));
		return (int) ((s - n) / 1000);
	}

	/**
	 * 获得时间戳
	 *
	 * @return
	 * @throws Exception
	 */
	public static String getTime() {
		Date date = new Date();
		return String.valueOf(date.getTime());
	}

	public static void main(String[] args) {
		System.out.println(formatYyyymmdd(new Date()));

	}
}


text:
<!doctype html>
{% extends "base.html" %}
{% import 'bootstrap/wtf.html' as wtf %}
{%  block head %}
{{ super() }}
<link rel='stylesheet' type='text/css' href='{{ url_for('static', filename='styles.css') }}'>

{% endblock%}

{% for message in get_flashed_messages() %}

    <button type='button' class='close' data-dismiss='alert'>×</button>
    {{ message }}

{% endfor %}

{% block page_header %}

這裏只是一個超級簡陋的上傳點還在開發中!

{#

<form action='/save_file' method='post' enctype='multipart/form-data'>
    <input type='file' name='uploaded_file' class="btn btn-default pull-left btn-lg">

    <input value='上傳' type='submit' class='btn btn-default btn-sm' value='Upload'>
</form>
#}
{% endblock %}
{% block page_content %}

{{ wtf.quick_form(form, enctype='multipart/form-data') }}

{% endblock %}


text:
#include "taichi/program/snode_expr_utils.h"
#include "taichi/ir/snode.h"
#include "taichi/ir/frontend_ir.h"

namespace taichi::lang {

namespace {

class GradInfoImpl final : public SNode::GradInfoProvider {
 public:
  explicit GradInfoImpl(FieldExpression *field) : field_(field) {
  }

  bool is_primal() const override {
    return field_->snode_grad_type == SNodeGradType::kPrimal;
  }

  SNodeGradType get_snode_grad_type() const override {
    return field_->snode_grad_type;
  }

  SNode *adjoint_snode() const override {
    auto &adj = field_->adjoint;
    if (adj.expr == nullptr) {
      return nullptr;
    }
    return adj.snode();
  }

  SNode *dual_snode() const override {
    auto &dual = field_->dual;
    if (dual.expr == nullptr) {
      return nullptr;
    }
    return dual.snode();
  }

  SNode *adjoint_checkbit_snode() const override {
    auto &adjoint_checkbit = field_->adjoint_checkbit;
    if (adjoint_checkbit.expr == nullptr) {
      return nullptr;
    }
    return adjoint_checkbit.snode();
  }

 private:
  FieldExpression *field_;
};

}  // namespace

void place_child(Expr *expr_arg,
                 const std::vector<int> &offset,
                 int id_in_bit_struct,
                 SNode *parent,
                 SNodeFieldMap *snode_to_exprs) {
  if (parent->type == SNodeType::root) {
    // never directly place to root
    auto &ds = parent->dense(std::vector<Axis>(), {}, false);
    place_child(expr_arg, offset, id_in_bit_struct, &ds, snode_to_exprs);
  } else {
    TI_ASSERT(expr_arg->is<FieldExpression>());
    auto field = expr_arg->cast<FieldExpression>();
    TI_ERROR_IF(field->snode != nullptr, "This variable has been placed.");
    auto &child = parent->insert_children(SNodeType::place);
    field->set_snode(&child);
    if (field->name == "") {
      child.name = field->ident.raw_name();
    } else {
      child.name = field->name;
    }
    if (field->has_ambient) {
      field->snode->has_ambient = true;
      field->snode->ambient_val = field->ambient_value;
    }
    field->snode->grad_info = std::make_unique<GradInfoImpl>(field.get());
    (*snode_to_exprs)[field->snode] = field;
    child.dt = field->dt;
    child.id_in_bit_struct = id_in_bit_struct;
    if (!offset.empty())
      child.set_index_offsets(offset);
  }
}

void make_lazy_place(SNode *snode,
                     SNodeFieldMap *snode_to_fields,
                     const std::function<void(std::unique_ptr<SNode> &,
                                              std::vector<Expr> &)> &collect) {
  if (snode->type == SNodeType::place)
    return;
  for (auto &c : snode->ch) {
    make_lazy_place(c.get(), snode_to_fields, collect);
  }
  std::vector<Expr> new_places;
  for (auto &c : snode->ch) {
    collect(c, new_places);
  }
  for (auto p : new_places) {
    place_child(&p, /*offset=*/{}, -1, snode, snode_to_fields);
  }
}

}  // namespace taichi::lang


text:
Luzvimin is a gem that lists all regions and provinces in the Philippines

## Installation

Add this line to your application's Gemfile:

    gem 'luzvimin'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install luzvimin

## Usage

To list all regions:

    Luzvimin.regions

To create options for a select tag for all regions:

    Luzvimin.regions_options_for_select

To get details about a region:

    region = Luzvimin.region('NCR')
    region.code is 'NCR'.
    region.name is 'National Capital Region'.

To get a region's provinces:

    region.provinces

To create options for select tag for a region's provinces:

    region.provinces_options_for_select

To get details about a province:

    province = region.province('METRO_MANILA')

    or

    province = Luzvimin.province('NCR', 'METRO_MANILA')

To get the cities of a province:

    cities = province.cities

To create options for select tag for a province's cities:

    province.cities_options_for_select

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
TESTS=hosted_dns selfhosted_dns dyndns zeroconf external

tests:
	echo -n "\033[0;34m First Run tests \033[0;30m\n"
	@$(foreach test,$(TESTS), echo -n $(test):; make -s $(test);)

hosted_dns:
	#clear_first_ran
	cat external_ip_self_hosted_dns.json | engines system do_first_run | engines_test_expects bool true

selfhosted_dns:
	cat internal_ip_self_hosted_dns.json | engines system do_first_run | engines_test_expects bool true

dyndns:
	cat dyndns.json | engines system do_first_run | engines_test_expects bool true

zeroconf:
	cat zeroconf.json  | engines system do_first_run | engines_test_expects bool true

external:
	cat externally_hosted_dns.json | engines system do_first_run | engines_test_expects bool true


text:
module.exports = {
  CDN: `https://cdn.digitallinguistics.io`,
};


text:
(function ($) {
	$.fn.wizard = function(args) {
		return new Wizard(this, args);
	};

	$.fn.wizard.logging = false;

	WizardCard = function(wizard, card, index, prev, next) {
		this.wizard = wizard;
		this.index = index;
		this.prev = prev;
		this.next = next;
		this.el = card;
		this.title = card.find("h3").first().text();
		this.name = card.data("cardname") || this.title;

		this.nav = this._createNavElement(this.title, index);

		this._disabled = false;
		this._loaded = false;
		this._events = {};
	}

	WizardCard.prototype = {

		select: function() {
			this.log("selecting");
			if (!this.isSelected()) {
				this.nav.addClass("active");
				this.el.show();

				if (!this._loaded) {
					this.trigger("loaded");
					this.reload();
				}

				this.trigger("selected");
			}

			/*
			 * this is ugly, but we're handling the changing of the wizard's
			 * buttons here, in the WizardCard select.  so when a card is
			 * selected, we're figuring out if we're the first card or the
			 * last card and changing the wizard's buttons via the guts of
			 * the wizard
			 *
			 * ideally this logic should be encapsulated by some wizard methods
			 * that we can call from here, instead of messing with the guts
			 */
			var w = this.wizard;
			if (this.index >= w._cards.length-1) {
				this.log("on last card, changing next button to submit");

				w.changeNextButton(w.args.buttons.submitText, "btn-green");
				w._readyToSubmit = true;
				w.trigger("readySubmit");
			}
			else {
				w._readyToSubmit = false;
				if (this.index == 0) {
					w.backButton.toggleClass("disabled", true);
				}
				else {
					w.backButton.toggleClass("disabled", false);
				}
				w.changeNextButton(w.args.buttons.nextText, "btn-blue");
			}

			return this;
		},

		//

		//
		//     Name & FQDN
		//

		_createNavElement: function(name, i) {
			var li = $('

');
			var a = $('');
			a.data("navindex", i);
			li.append(a);
			a.append('')
			a.append(name);
			return li;
		},

		markVisited: function() {
			this.log("marking as visited");
			this.nav.addClass("already-visited");
			this.trigger("markVisited");
			return this;
		},

		unmarkVisited: function() {
			this.log("unmarking as visited");
			this.nav.removeClass("already-visited");
			this.trigger("unmarkVisited");
			return this;
		},

		deselect: function() {
			this.nav.removeClass("active");
			this.el.hide();
			this.trigger("deselect");
			return this;
		},

		enable: function() {
			this.log("enabling");
			this.nav.addClass("active");
			this._disabled = false;
			this.trigger("enabled");
			return this;
		},

		disable: function(hideCard) {
			this.log("disabling");
			this._disabled = true;
			this.nav.removeClass("active already-visited");
			if (hideCard) {this.el.hide();}
			this.trigger("disabled");
			return this;
		},

		isDisabled: function() {
			return this._disabled;
		},

		alreadyVisited: function() {
			return this.nav.hasClass("already-visited");
		},

		isSelected: function() {
			return this.nav.hasClass("active");
		},

		reload: function() {
			this._loaded = true;
			this.trigger("reload");
			return this;
		},

		on: function() {
			return this.wizard.on.apply(this, arguments);
		},

		trigger: function() {
			this.callListener("on"+arguments[0]);
			return this.wizard.trigger.apply(this, arguments);
		},

		/*
		 * displays an alert box on the current card
		 */
		toggleAlert: function(msg, toggle) {
			this.log("toggling alert to: " + toggle);

			toggle = typeof(toggle) == "undefined" ? true : toggle;

			if (toggle) {this.trigger("showAlert");}
			else {this.trigger("hideAlert");}

			var div;
			var alert = this.el.children("h3").first().next("div.alert");

			if (alert.length == 0) {
				/*
				 * we're hiding anyways, so no need to create anything.
				 * we'll do that if we ever are actually showing the alert
				 */
				if (!toggle) {return this;}

				this.log("couldn't find existing alert div, creating one");
				div = $("
");
				div.addClass("alert");
				div.addClass("hide");
				div.insertAfter(this.el.find("h3").first());
			}
			else {
				this.log("found existing alert div");
				div = alert.first();
			}

			if (toggle) {
				if (msg != null) {
					this.log("setting alert msg to", msg);
					div.html(msg);
				}
				div.show();
			}
			else {
				div.hide();
			}
			return this;
		},

		/*
		 * this looks for event handlers embedded into the html of the
		 * wizard card itself, in the form of a data- attribute
		 */
		callListener: function(name) {
            // a bug(?) in jquery..can't access data-<name> if name is camelCase
		    name = name.toLowerCase();

			this.log("looking for listener " + name);
			var listener = window[this.el.data(name)];
			if (listener) {
				this.log("calling listener " + name);
				var wizard = this.wizard;

				try {
					var vret = listener(this);
				}
				catch (e) {
					this.log("exception calling listener " + name + ": ", e);
				}
			}
			else {
				this.log("didn't find listener " + name);
			}
		},

		problem: function(toggle) {
			this.nav.find("a").toggleClass("wizard-step-error", toggle);
		},

		validate: function() {
			var failures = false;
			var self = this;

			/*
			 * run all the validators embedded on the inputs themselves
			 */
			this.el.find("[data-validate]").each(function(i, el) {
				self.log("validating individiual inputs");
				el = $(el);

				var v = el.data("validate");
				if (!v) {return;}

				var ret = {
					status: true,
					title: "Error",
					msg: ""
				};

				var vret = window[v](el);
				$.extend(ret, vret);

				if (!ret.status) {
					failures = true;
					el.parent(".control-group").toggleClass("error", true);
					self.wizard.errorPopover(el, ret.msg);
				}
				else {
					el.parent(".control-group").toggleClass("error", false);
					try {
						el.popover("destroy");
					}
					/*
					 * older versions of bootstrap don't have a destroy call
					 * for popovers
					 */
					catch (e) {
						el.popover("hide");
					}
				}
			});
			this.log("after validating inputs, failures is", failures);

			/*
			 * run the validator embedded in the card
			 */
			var cardValidator = window[this.el.data("validate")];
			if (cardValidator) {
				this.log("running html-embedded card validator");
				var cardValidated = cardValidator(this);
				if (typeof(cardValidated) == "undefined" || cardValidated == null) {
					cardValidated = true;
				}
				if (!cardValidated) failures = true;
				this.log("after running html-embedded card validator, failures\
 is", failures);
			}

			/*
			 * run the validate listener
			 */
			this.log("running listener validator");
			var listenerValidated = this.trigger("validate");
			if (typeof(listenerValidated) == "undefined" || listenerValidated == null) {
				listenerValidated = true;
			}
			if (!listenerValidated) failures = true;
			this.log("after running listener validator, failures is", failures);

			var validated = !failures;
			if (validated) {
				this.log("validated, calling listeners");
				this.trigger("validated");
			}
			else {
				this.log("invalid");
				this.trigger("invalid");
			}
			return validated;
		},

		log: function() {
			if (!window.console || !$.fn.wizard.logging) {return;}
			var prepend = "card '"+this.name+"': ";
			var args = [prepend];
			args.push.apply(args, arguments);

			console.log.apply(console, args);
		},

		isActive: function() {
			return this.nav.hasClass("active");
		},
	};

	Wizard = function(markup, args) {
		var wizard_template = [
			'
',
                '
',
                '
',
				'
',
					'<button class="wizard-close close" type="button">x</button>',
					'

',
					'',
				'
',
				'
',
					'
',
						'
',
						'
',
					'
',

					'
',,
						'
',
							'

',
						'
',
					'
',

				'
',

				'<form>',
					'
',
						'
',
						'
',
						'
',
							'
',
								'<button class="btn btn-default wizard-back" type="button">Back</button>',
								'<button class="btn btn-blue wizard-next" type="button">Next</button>',
							'
',
						'
',
					'
',
				'</form>',
                '
',
                '
',
			'
'
		];

		this.args = {
			submitUrl: "",
			width: 750,
			progressBarCurrent: false,
			increaseHeight: 0,
			buttons: {
				nextText: "Next",
				backText: "Back",
				submitText: "Submit",
				submittingText: "Submitting...",
			}
		};
		$.extend(this.args, args || {});

		this.markup = $(markup);
		this.submitCards = this.markup.find(".wizard-error,.wizard-failure,\
.wizard-success,.wizard-loading");
		this.el = $(wizard_template.join("\n"));
		this.el.find(".wizard-card-container")
			.append(this.markup.find(".wizard-card"))
			.append(this.submitCards);
		$("body").append(this.el);

		this.closeButton = this.el.find("button.wizard-close");
		this.footer = this.el.find(".wizard-modal-footer");
		this.backButton = this.footer.find(".wizard-back");
		this.nextButton = this.footer.find(".wizard-next");
		this.progress = this.el.find(".progress");
		this._cards = [];
		this.cards = {};
		this._readyToSubmit = false;
		this.percentComplete = 0;
		this._submitting = false;
		this._events = {};
		this._firstShow = true;

		// construction

		this._createCards();

		this.nextButton.click(this, this._handleNextClick);
		this.backButton.click(this, this._handleBackClick);

		this.backButton.text(this.args.buttons.backText);
		this.nextButton.text(this.args.buttons.nextText);

		/*
		 * adjust the height of the modal, and everything associated with
		 * adjusting the height
		 */
		var baseHeight = 360;
		var navHeight = baseHeight + this.args.increaseHeight;

		this.el.find(".wizard-nav-container").css("height", navHeight);
		this.el.find(".wizard-steps").css("height", (navHeight+65)+"px");
		this.el.find(".wizard-card").css("height", (navHeight-60)+"px");
		this.submitCards.css("height", (navHeight-60)+"px");

        var formHeight = this.el.find(".wizard-steps").height();
        this.el.find("form").css('min-height', formHeight);
        this.el.find(".wizard-card-container").css("min-height", formHeight - 65);
//		this.el.css("margin-top", -(this.el.height() / 2));

		/*
		 * adjust the width of the modal
		 */
//		this.el.css("width", this.args.width);
//		this.el.css("margin-left", -(this.args.width / 2));

		/*
		 * set up slimScroll for our nav, if slimScroll is installed
		 */
		if ($.fn.slimScroll && false) {
			var slimScrollArgs = {
				position: "left",
				height: "360px",
				size: "8px",
				distance: "5px",
				railVisible: true,
				disableFadeOut: true,
			};
			$.extend(slimScrollArgs, this.args.slimScroll || {});
			this.el.find(".wizard-nav-container").slimScroll(slimScrollArgs);
		}

		/*
		 * if the close X is clicked, reset the wizard
		 */
		var self = this;
		this.closeButton.click(function() {
			self.reset();
			self.close();
		})

		this.el.find(".wizard-steps").on(
			"click", "li.already-visited a.wizard-nav-link", this,
			function(event) {
				var index = parseInt($(event.target).data("navindex"));
				event.data.setCard(index);
			});

		var title = this.markup.children("h1").first();
		if (title.length) {this.setTitle(title.text());}

		this.on("submit", this._defaultSubmit);
	}

	Wizard.prototype = {

		errorPopover: function(el, msg) {
			this.log("launching popover on", el);
			var popover = el.popover({
				content: msg,
				trigger: "manual"
			}).popover("show").next(".popover");

			popover.addClass("error-popover");
			return popover;
		},

		eachCard: function(fn) {
			$.each(this._cards, fn);
			return this;
		},

		getActiveCard: function() {
			this.log("getting active card");
			var currentCard = null;

			$.each(this._cards, function(i, card) {
				if (card.isActive()) {
					currentCard = card;
					return false;
				}
			});
			if (currentCard) {this.log("found active card", currentCard);}
			else {this.log("couldn't find an active card");}
			return currentCard;
		},

		setTitle: function(title) {
			this.log("setting title to", title);
			this.el.find(".wizard-title").first().text(title);
			return this;
		},

		setSubtitle: function(title) {
			this.log("setting subtitle to", title);
			this.el.find(".wizard-subtitle").first().text(title);
			return this;
		},

		changeNextButton: function(text, cls) {
			this.log("changing next button, text: " + text, "class: " + cls);
			if (typeof(cls) != "undefined") {
				this.nextButton.removeClass("btn-green btn-blue");
			}

			if (cls) {
				this.nextButton.addClass(cls);
			}
			this.nextButton.text(text);
			return this;
		},

		hide: function() {
			this.log("hiding");
			this.el.modal("hide");
			return this;
		},

		close: function() {
			this.log("closing");
			this.el.modal("hide");
			return this;
		},

		show: function() {
			this.log("showing");
			if (this._firstShow) {
				this.setCard(0);
				this._firstShow = false;
			}
			this.el.modal();
			return this;
		},

		on: function(name, fn) {
			this.log("adding listener to event " + name);
			this._events[name] = fn;
			return this;
		},

		trigger: function() {
			var name = arguments[0];
			var args = Array.prototype.slice.call(arguments);
			args.shift();
			args.unshift(this);

			this.log("firing event " + name);
			var handler = this._events[name];
			var ret = null;

			if (typeof(handler) == "function") {
				this.log("found event handler, calling " + name);
				try {
					ret = handler.apply(this, args);
				}
				catch (e) {
					this.log("event handler " + name + " had an exception");
				}
			}
			else {
				this.log("couldn't find an event handler for " + name);
			}
			return ret;
		},

		reset: function() {
			this.log("resetting");
			this.updateProgressBar(0);
			this.hideSubmitCards();

			this.setCard(0);
			this.lockCards();

			this.enableNextButton();
			this.showButtons();

			this.trigger("reset");
			return this;
		},

		log: function() {
			if (!window.console || !$.fn.wizard.logging) {return;}
			var prepend = "wizard "+this.el.id+": ";
			var args = [prepend];
			args.push.apply(args, arguments);
			console.log.apply(console, args);
		},

		/*
		 * this handles switching to the next card or previous card, taking
		 * care to skip over disabled cards
		 */
		_abstractIncrementStep: function(direction, getNext) {
			var current = this.getActiveCard();
			var next;

			if (current) {
				/*
				 * loop until we find a card that isn't disabled
				 */
			    this.log("searching for valid next card");
				while (true) {
					next = getNext(current);
					if (next) {
						this.log("looking at card", next.index);
						if (next.isDisabled()) {
							this.log("card " + next.index + " is disabled/locked, continuing");
							current = next;
							continue;
						}
						else {
							return this.setCard(current.index+direction);
						}
					}
					else {
						this.log("next card is not defined, breaking");
						break;
					}
				}
			}
			else {
				this.log("current card is undefined");
			}
		},

		incrementCard: function() {
			this.log("incrementing card");
			var card = this._abstractIncrementStep(1, function(current){return current.next;});
			this.trigger("incrementCard");
			return card;
		},

		decrementCard: function() {
			this.log("decrementing card");
			var card = this._abstractIncrementStep(-1, function(current){return current.prev;});
			this.trigger("decrementCard");
			return card;
		},

		setCard: function(i) {
			this.log("setting card to " + i);
			this.hideSubmitCards();
			var currentCard = this.getActiveCard();

			if (this._submitting) {
				this.log("we're submitting the wizard already, can't change cards");
				return currentCard;
			}

			var newCard = this._cards[i];
			if (newCard) {
				if (newCard.isDisabled()) {
					this.log("new card is currently disabled, returning");
					return currentCard;
				}

				if (currentCard) {

					/*
					 * here, we're only validating if we're going forward,
					 * not if we're going backwards in a step
					 */
					if (i > currentCard.index) {
						var cardToValidate = currentCard;
						var ok = false;

						/*
						 * we need to loop over every card between our current
						 * card and the card that we clicked, and re-validate
						 * them.  if there's an error, we need to select the
						 * first card to have an error
						 */
						while (cardToValidate.index != newCard.index) {
							/*
							 * unless we're validating the card that we're
							 * leaving, we need to select the card, so that
							 * any validators that trigger errorPopovers can
							 * display correctly
							 */
							if (cardToValidate.index != currentCard.index) {
								cardToValidate.prev.deselect();
								cardToValidate.prev.markVisited();
								cardToValidate.select();
							}
							ok = cardToValidate.validate();
							if (!ok) {
								return cardToValidate;
							}
							cardToValidate = cardToValidate.next;
						}

						cardToValidate.prev.deselect();
						cardToValidate.prev.markVisited();
					}

					currentCard.deselect();
					currentCard.markVisited();
				}

				newCard.select();

				if (this.args.progressBarCurrent) {
					var last_percent = this.percentComplete;
					this.percentComplete = i * 100.0 / this._cards.length;
					this.updateProgressBar(this.percentComplete);
				}
				else {
					var last_percent = this.percentComplete;
					this.percentComplete = i * 100.0 / this._cards.length;
					this.percentComplete = Math.max(last_percent, this.percentComplete);
					this.updateProgressBar(this.percentComplete);
				}

				return newCard;
			}
			else {
				this.log("couldn't find card " + i);
			}
		},

		updateProgressBar: function(percent) {
			this.log("updating progress to " + percent + "%");
			this.progress.find(".progress-bar").css({width: percent + "%"});
			this.percentComplete = percent;

			this.trigger("progressBar", percent);

			if (percent == 100) {
				this.log("progress is 100, animating progress bar");
				this.progress.addClass("active");
			}
			else if (percent == 0) {
				this.log("progress is 0, disabling animation");
				this.progress.removeClass("active");
			}
		},

		getNextCard: function() {
			var currentCard = this.getActiveCard();
			if (currentCard) return currentCard.next;
		},

		lockCards: function() {
			this.log("locking nav cards");
			this.eachCard(function(i,card){card.unmarkVisited();});
			return this;
		},

		disableCards: function() {
			this.log("disabling all nav cards");
			this.eachCard(function(i,card){card.disable();});
			return this;
		},

		enableCards: function() {
			this.log("enabling all nav cards");
			this.eachCard(function(i,card){card.enable();});
			return this;
		},

		hideCards: function() {
			this.log("hiding cards");
			this.eachCard(function(i,card){card.deselect();});
			this.hideSubmitCards();
			return this;
		},

		hideButtons: function() {
			this.log("hiding buttons");
			this.nextButton.hide();
			this.backButton.hide();
			return this;
		},

		showButtons: function() {
			this.log("showing buttons");
			this.nextButton.show();
			this.backButton.show();
			return this;
		},

		getCard: function(el) {
			var cardDOMEl = $(el).parents(".wizard-card").first()[0];
			if (cardDOMEl) {
				var foundCard = null;
				this.eachCard(function(i, card) {
					if (cardDOMEl == card.el[0]) {
						foundCard = card;
						return false;
					}
					return true;
				});
				return foundCard;
			}
			else {
				return null;
			}
		},

		_createCards: function() {
			var prev = null;
			var next = null;
			var current_i = 0;
			var currentCard = null;
			var wizard = this;
			var self = this;

			var cards = this.el.find(".wizard-cards .wizard-card");
			$.each(cards, function(i, card) {
				card = $(card);

				prev = currentCard;
				currentCard = new WizardCard(wizard, card, i, prev, next);
				self._cards.push(currentCard);
				if (currentCard.name) {
					self.cards[currentCard.name] = currentCard;
				}
				if (prev) {prev.next = currentCard;}

				self.el.find(".wizard-steps .nav-list").append(currentCard.nav);
			});
		},

		showSubmitCard: function(name) {
			this.log("showing "+name+" submit card");

			var card = this.el.find(".wizard-"+name);
			if (card.length) {
				this.hideCards();
				this.el.find(".wizard-"+name).show();
			}
			else {
				this.log("couldn't find submit card "+name);
			}
		},

		hideSubmitCard: function(name) {
			this.log("hiding "+name+" submit card");
			this.el.find(".wizard-"+name).hide();
		},

		hideSubmitCards: function() {
			var wizard = this;
			$.each(["success", "error", "failure", "loading"], function(i, name) {
				wizard.hideSubmitCard(name);
			});
		},

		enableNextButton: function() {
			this.log("enabling next button");
			this.nextButton.removeAttr("disabled");
			return this;
		},

		disableNextButton: function() {
			this.log("disabling next button");
			this.nextButton.attr("disabled", "disabled");
			return this;
		},

		serializeArray: function() {
			var form = this.el.children("form").first();
			return form.serializeArray();
		},

		serialize: function() {
			var form = this.el.children("form").first();
			return form.serialize();
		},

		/*
		 * the next 3 functions are to be called by the custom submit event
		 * handler.  the idea is that after you make an ajax call to submit
		 * your wizard data (or whatever it is you want to do at the end of
		 * the wizard), you call one of these 3 handlers to display a specific
		 * card for either success, failure, or error
		 */
		submitSuccess: function() {
			this.log("submit success");
			this._submitting = false;
    		this.showSubmitCard("success");
    		this.trigger("submitSuccess");
		},

		submitFailure: function() {
			this.log("submit failure");
			this._submitting = false;
    		this.showSubmitCard("failure");
    		this.trigger("submitFailure");
		},

		submitError: function() {
			this.log("submit error");
			this._submitting = false;
    		this.showSubmitCard("error");
    		this.trigger("submitError");
		},

		_submit: function() {
			this.log("submitting wizard");
			this._submitting = true;

			this.lockCards();
			this.backButton.hide();

			this.showSubmitCard("loading");
			this.updateProgressBar(100);

			this.changeNextButton(this.args.buttons.submittingText, false);
			this.disableNextButton();

			var ret = this.trigger("submit");
			this.trigger("loading");
		},

		_onNextClick: function() {
			this.log("handling 'next' button click");

			if (this._readyToSubmit) {
				this._submit();
			}
			else {
				var currentCard = this.incrementCard();
			}
		},

		_onBackClick: function() {
			this.log("handling 'back' button click");
			var currentCard = this.decrementCard();
		},

		_handleNextClick: function(event) {
			var wizard = event.data;
			wizard._onNextClick.call(wizard);
		},

		_handleBackClick: function(event) {
			var wizard = event.data;
			wizard._onBackClick.call(wizard);
		},

		/*
		 * this function is attached by default to the wizard's "submit" event.
		 * if you choose to implement your own custom submit logic, you should
		 * copy how this function works
		 */
		_defaultSubmit: function(wizard) {
	    	$.ajax({
	    		type: "POST",
	    		url: wizard.args.submitUrl,
	    		data: wizard.serialize(),
	    		dataType: "json",
	    		success: function(resp) {
		    		wizard.submitSuccess();
		    		wizard.hideButtons();
		    		wizard.updateProgressBar(0);
		    	},
		    	error: function() {
		    		wizard.submitFailure();
		    		wizard.hideButtons();
		    	},
	    	});
		}

	};

}(window.jQuery));


text:
<?xml version="1.0" encoding="utf-8"?>
<dream xmlns:android="http://schemas.android.com/apk/res/android"
       android:settingsActivity="com.dgmltn.morphclock.app/.MainActivity" />


text: package org.schoellerfamily.gedbrowser.controller.exception.test;


text:
POIPoint::POIPoint(const unsigned int &i)
{
    id = i;
}

POIPoint::POIPoint(const unsigned int &i, const double &x, const double &y,const string &n,const string &a, const string &p,const string &u){
    id = i;
    geoPosition.x(x);
    geoPosition.y(y);
    name = n;
    addr = a;
    photo_path = p;
    user = u;
}

void POIPoint::setGeoPosition(const double &x, const double &y){
    geoPosition.x(x);
    geoPosition.y(y);
}
boost_xy_point& POIPoint::getGeoPosition(){
    return geoPosition;
}

void POIPoint::setCategory(POICategory *c){
    category = c;
}

POICategory* POIPoint::getCategory(){
    return category;
}

unsigned int POIPoint::getId(){
    return id;
}

string POIPoint::getName(){
    return name;
}
string POIPoint::getIconPath(){
    return category->getIconPath();
}
string POIPoint::getAddress(){
    return addr;
}
string POIPoint::getPhotoPath(){
    return photo_path;
}
string POIPoint::getUser(){
    return user;
}
void POIPoint::setName(string n){
    name = n;
}
void POIPoint::setAddress(string a){
    addr = a;
}
void POIPoint::setPhotoPath(string p){
    photo_path=p;
}
void POIPoint::setUser(string u){
    user = u;
}


text:
package net.ninjacat.stubborn.file;

import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import static net.ninjacat.stubborn.file.Consts.CLASS_EXT;

public class JarLister implements ClassLister {
    private final String jarFile;

    public JarLister(String jarFile) {
        this.jarFile = jarFile;
    }

    @Override
    public List<String> list() {
        try {
            Collection<String> results = new ArrayList<>();
            ZipFile file = new ZipFile(jarFile);
            asIterator(file.entries()).forEachRemaining(e -> {
                if (e.getName().endsWith(CLASS_EXT)) {
                    results.add(e.getName());
                }
            });
            return results.parallelStream().map(JarLister::convertPathToClassName).collect(Collectors.toList());
        } catch (IOException ignored) {
            return Collections.emptyList();
        }
    }

    private static Iterator<ZipEntry> asIterator(Enumeration<? extends ZipEntry> entries) {
        return new Iterator<ZipEntry>() {
            @Override
            public boolean hasNext() {
                return entries.hasMoreElements();
            }

            @Override
            public ZipEntry next() {
                return entries.nextElement();
            }
        };
    }

    private static String convertPathToClassName(String p) {
        return p.substring(0, p.length() - CLASS_EXT.length()).replaceAll("/", ".");
    }

}


text:
/***
 Group Database Operations.

 Query the system group database.

@see posix.pwd
@module posix.grp
*/

#include <grp.h>

#include "_helpers.c"

/***
Group record.
@table PosixGroup
@string gr_name name of group
@int gr_gid unique group id
@tfield list gr_mem a list of group members
*/

static int
pushgroup(lua_State *L, struct group *g)
{
	if (!g)
		return lua_pushnil(L), 1;

	lua_createtable(L, 0, 3);
	setintegerfield(g, gr_gid);
	setstringfield(g, gr_name);
	if (g->gr_mem)
	{
		int i;
		lua_newtable(L);
		for (i = 0; g->gr_mem[i] != NULL; i++)
		{
			lua_pushstring(L, g->gr_mem[i]);
			lua_rawseti(L, -2, i + 1);
		}
		lua_setfield(L, -2, "gr_mem");
	}

	settypemetatable("PosixGroup");
	return 1;
}

/***
Release group database resources.
@function endgrent
@see getgrent
*/
static int
Pendgrent(lua_State *L)
{
	checknargs(L, 0);
	endgrent();
	return 0;
}

/***
Fetch next group.
@function getgrent
@treturn PosixGroup next group record
@see endgrent
@usage
  local grp = require "posix.grp"
  t = grp.getgrent ()
  while t ~= nil do
    process (t)
    t = grp.getgrent ()
  end
  grp.endgrent ()
*/
static int
Pgetgrent(lua_State *L)
{
	struct group *g;
	checknargs(L, 0);
	g = getgrent();
	if (!g && errno == 0)
		endgrent();
	return pushgroup(L, g);
}

/***
Fetch group with given group id.
@function getgrgid
@int gid group id
@treturn PosixGroup group record for *gid*
@usage
  local grp = require "posix.grp"
  t = grp.getgrgid (0)
*/
static int
Pgetgrgid(lua_State *L)
{
	gid_t gid = (gid_t) checkint(L, 1);
	struct group *g;
	checknargs(L, 1);

	errno = 0;	/* so we can recognise a successful empty result */
	g = getgrgid(gid);
	if (!g && errno != 0)
		return pusherror(L, "getgrgid");
	return pushgroup(L, g);
}

/***
Fetch named group.
@function getgrnam
@string name group name
@treturn PosixGroup group record for *name*
@usage
  local grp = require "posix.grp"
  t = grp.getgrnam "wheel"
*/
static int
Pgetgrnam(lua_State *L)
{
	const char *name = luaL_checkstring(L, 1);
	struct group *g;
	checknargs(L, 1);

	errno = 0;	/* so we can recognise a successful empty result */
	g = getgrnam (name);
	if (!g && errno != 0)
		return pusherror(L, "getgrnam");
	return pushgroup(L, g);
}

/***
Rewind next @{getgrent} back to start of database.
@function setgrent
@see getgrent
*/
static int
Psetgrent(lua_State *L)
{
	checknargs(L, 0);
	setgrent();
	return 0;
}

static const luaL_Reg posix_grp_fns[] =
{
	LPOSIX_FUNC( Pendgrent		),
	LPOSIX_FUNC( Pgetgrent		),
	LPOSIX_FUNC( Pgetgrgid		),
	LPOSIX_FUNC( Pgetgrnam		),
	LPOSIX_FUNC( Psetgrent		),
	{NULL, NULL}
};

LUALIB_API int
luaopen_posix_grp(lua_State *L)
{
	luaL_register(L, "posix.grp", posix_grp_fns);
	lua_pushstring(L, LPOSIX_VERSION_STRING("grp"));
	lua_setfield(L, -2, "version");

	return 1;
}


text:
package org.thymeleaf.standard.expression;

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;

import org.thymeleaf.context.IExpressionContext;
import org.thymeleaf.context.ITemplateContext;
import org.thymeleaf.expression.Aggregates;
import org.thymeleaf.expression.Arrays;
import org.thymeleaf.expression.Bools;
import org.thymeleaf.expression.Calendars;
import org.thymeleaf.expression.Conversions;
import org.thymeleaf.expression.Dates;
import org.thymeleaf.expression.ExecutionInfo;
import org.thymeleaf.expression.IExpressionObjectFactory;
import org.thymeleaf.expression.Ids;
import org.thymeleaf.expression.Lists;
import org.thymeleaf.expression.Maps;
import org.thymeleaf.expression.Messages;
import org.thymeleaf.expression.Numbers;
import org.thymeleaf.expression.Objects;
import org.thymeleaf.expression.Sets;
import org.thymeleaf.expression.Strings;
import org.thymeleaf.expression.Temporals;
import org.thymeleaf.expression.Uris;

/**
 * <p>
 *   Builds the expression objects to be used by Standard dialects.
 * </p>
 *
 * @author Daniel Fernández
 *
 * @since 3.0.0
 *
 */
public class StandardExpressionObjectFactory implements IExpressionObjectFactory {

    /*
     * Any new objects added here should also be added to the "ALL_EXPRESSION_OBJECT_NAMES" See below.
     */

    public static final String CONTEXT_EXPRESSION_OBJECT_NAME = "ctx";
    public static final String ROOT_EXPRESSION_OBJECT_NAME = "root";
    public static final String VARIABLES_EXPRESSION_OBJECT_NAME = "vars";
    public static final String SELECTION_TARGET_EXPRESSION_OBJECT_NAME = "object";
    public static final String LOCALE_EXPRESSION_OBJECT_NAME = "locale";

    /*
     * These are no longer available, but their names are still used for raising an explanatory exception
     */
    public static final String REQUEST_EXPRESSION_OBJECT_NAME = "request";
    public static final String RESPONSE_EXPRESSION_OBJECT_NAME = "response";
    public static final String SESSION_EXPRESSION_OBJECT_NAME = "session";
    public static final String SERVLET_CONTEXT_EXPRESSION_OBJECT_NAME = "servletContext";

    public static final String CONVERSIONS_EXPRESSION_OBJECT_NAME = "conversions";
    public static final String URIS_EXPRESSION_OBJECT_NAME = "uris";

    /**
     * @since 3.1.0
     */
    public static final String TEMPORALS_EXPRESSION_OBJECT_NAME = "temporals";

    public static final String CALENDARS_EXPRESSION_OBJECT_NAME = "calendars";
    public static final String DATES_EXPRESSION_OBJECT_NAME = "dates";
    public static final String BOOLS_EXPRESSION_OBJECT_NAME = "bools";
    public static final String NUMBERS_EXPRESSION_OBJECT_NAME = "numbers";
    public static final String OBJECTS_EXPRESSION_OBJECT_NAME = "objects";
    public static final String STRINGS_EXPRESSION_OBJECT_NAME = "strings";
    public static final String ARRAYS_EXPRESSION_OBJECT_NAME = "arrays";
    public static final String LISTS_EXPRESSION_OBJECT_NAME = "lists";
    public static final String SETS_EXPRESSION_OBJECT_NAME = "sets";
    public static final String MAPS_EXPRESSION_OBJECT_NAME = "maps";
    public static final String AGGREGATES_EXPRESSION_OBJECT_NAME = "aggregates";
    public static final String MESSAGES_EXPRESSION_OBJECT_NAME = "messages";
    public static final String IDS_EXPRESSION_OBJECT_NAME = "ids";

    public static final String EXECUTION_INFO_OBJECT_NAME = "execInfo";

    protected static final Set<String> ALL_EXPRESSION_OBJECT_NAMES =
            Collections.unmodifiableSet(new LinkedHashSet<String>(java.util.Arrays.asList(
                    new String[]{
                            CONTEXT_EXPRESSION_OBJECT_NAME,
                            ROOT_EXPRESSION_OBJECT_NAME,
                            VARIABLES_EXPRESSION_OBJECT_NAME,
                            SELECTION_TARGET_EXPRESSION_OBJECT_NAME,
                            LOCALE_EXPRESSION_OBJECT_NAME,
                            CONVERSIONS_EXPRESSION_OBJECT_NAME,
                            URIS_EXPRESSION_OBJECT_NAME,
                            TEMPORALS_EXPRESSION_OBJECT_NAME,
                            CALENDARS_EXPRESSION_OBJECT_NAME,
                            DATES_EXPRESSION_OBJECT_NAME,
                            BOOLS_EXPRESSION_OBJECT_NAME,
                            NUMBERS_EXPRESSION_OBJECT_NAME,
                            OBJECTS_EXPRESSION_OBJECT_NAME,
                            STRINGS_EXPRESSION_OBJECT_NAME,
                            ARRAYS_EXPRESSION_OBJECT_NAME,
                            LISTS_EXPRESSION_OBJECT_NAME,
                            SETS_EXPRESSION_OBJECT_NAME,
                            MAPS_EXPRESSION_OBJECT_NAME,
                            AGGREGATES_EXPRESSION_OBJECT_NAME,
                            MESSAGES_EXPRESSION_OBJECT_NAME,
                            IDS_EXPRESSION_OBJECT_NAME,
                            EXECUTION_INFO_OBJECT_NAME,
                            REQUEST_EXPRESSION_OBJECT_NAME,
                            RESPONSE_EXPRESSION_OBJECT_NAME,
                            SESSION_EXPRESSION_OBJECT_NAME,
                            SERVLET_CONTEXT_EXPRESSION_OBJECT_NAME
                    }
            )));

    private static final Uris URIS_EXPRESSION_OBJECT = new Uris();
    private static final Bools BOOLS_EXPRESSION_OBJECT = new Bools();
    private static final Objects OBJECTS_EXPRESSION_OBJECT = new Objects();
    private static final Arrays ARRAYS_EXPRESSION_OBJECT = new Arrays();
    private static final Lists LISTS_EXPRESSION_OBJECT = new Lists();
    private static final Sets SETS_EXPRESSION_OBJECT = new Sets();
    private static final Maps MAPS_EXPRESSION_OBJECT = new Maps();
    private static final Aggregates AGGREGATES_EXPRESSION_OBJECT = new Aggregates();

    public StandardExpressionObjectFactory() {
        super();
    }

    public Set<String> getAllExpressionObjectNames() {
        return ALL_EXPRESSION_OBJECT_NAMES;
    }

    public boolean isCacheable(final String expressionObjectName) {
        // Only #object is non-cacheable (template-scope)
        return (expressionObjectName != null && !expressionObjectName.equals(SELECTION_TARGET_EXPRESSION_OBJECT_NAME));
    }

    public Object buildObject(
            final IExpressionContext context,
            final String expressionObjectName) {

        if (SELECTION_TARGET_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            if (context instanceof ITemplateContext) {
                final ITemplateContext templateContext = (ITemplateContext) context;
                if (templateContext.hasSelectionTarget()) {
                    return templateContext.getSelectionTarget();
                }
            }
            return context;
        }

        if (ROOT_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return context;
        }
        if (VARIABLES_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return context;
        }
        if (CONTEXT_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return context;
        }
        if (LOCALE_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return context.getLocale();
        }
        if (REQUEST_EXPRESSION_OBJECT_NAME.equals(expressionObjectName) ||
                SESSION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName) ||
                SERVLET_CONTEXT_EXPRESSION_OBJECT_NAME.equals(expressionObjectName) ||
                RESPONSE_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            throw new IllegalArgumentException(
                    String.format(
                            "The '%s','%s','%s' and '%s' expression utility objects are no longer available " +
                            "by default for template expressions and their use is not recommended. In cases where " +
                            "they are really needed, they should be manually added as context variables.",
                            REQUEST_EXPRESSION_OBJECT_NAME, SESSION_EXPRESSION_OBJECT_NAME,
                            SERVLET_CONTEXT_EXPRESSION_OBJECT_NAME, RESPONSE_EXPRESSION_OBJECT_NAME));
        }
        if (CONVERSIONS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Conversions(context);
        }
        if (URIS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return URIS_EXPRESSION_OBJECT;
        }
        if (CALENDARS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Calendars(context.getLocale());
        }
        if (TEMPORALS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Temporals(context.getLocale());
        }
        if (DATES_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Dates(context.getLocale());
        }
        if (BOOLS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return BOOLS_EXPRESSION_OBJECT;
        }
        if (NUMBERS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Numbers(context.getLocale());
        }
        if (OBJECTS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return OBJECTS_EXPRESSION_OBJECT;
        }
        if (STRINGS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return new Strings(context.getLocale());
        }
        if (ARRAYS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return ARRAYS_EXPRESSION_OBJECT;
        }
        if (LISTS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return LISTS_EXPRESSION_OBJECT;
        }
        if (SETS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return SETS_EXPRESSION_OBJECT;
        }
        if (MAPS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return MAPS_EXPRESSION_OBJECT;
        }
        if (AGGREGATES_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            return AGGREGATES_EXPRESSION_OBJECT;
        }
        if (MESSAGES_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            if (context instanceof ITemplateContext) {
                return new Messages((ITemplateContext) context);
            }
            return null;
        }
        if (IDS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            if (context instanceof ITemplateContext) {
                return new Ids((ITemplateContext) context);
            }
            return null;
        }
        if (EXECUTION_INFO_OBJECT_NAME.equals(expressionObjectName)) {
            if (context instanceof ITemplateContext) {
                return new ExecutionInfo((ITemplateContext) context);
            }
            return null;
        }

        return null;

    }

}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for D:\appli\wamp\www\centrale_referencement\src/CentraleReferencementBundle/Form/ContactType.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../../css/bootstrap.min.css" rel="stylesheet">
  <link href="../../css/style.css" rel="stylesheet">

D:\appli\wamp\www\centrale_referencement\src

CentraleReferencementBundle

Form

ContactType.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

           0.00% covered (danger)

0.00%

0 / 1

           0.00% covered (danger)

0.00%

0 / 4

      CRAP

           0.00% covered (danger)

0.00%

0 / 19

      ContactType

           0.00% covered (danger)

0.00%

0 / 1

           0.00% covered (danger)

0.00%

0 / 4

      20

           0.00% covered (danger)

0.00%

0 / 19

       buildForm

           0.00% covered (danger)

0.00%

0 / 1

      2

           0.00% covered (danger)

0.00%

0 / 8

       configureOptions

           0.00% covered (danger)

0.00%

0 / 1

      2

           0.00% covered (danger)

0.00%

0 / 5

       getBlockPrefix

           0.00% covered (danger)

0.00%

0 / 1

      2

           0.00% covered (danger)

0.00%

0 / 3

       getName

           0.00% covered (danger)

0.00%

0 / 1

      2

           0.00% covered (danger)

0.00%

0 / 3

1
	<?php

2

3
	namespace CentraleReferencementBundle\Form;

4

5
	use Symfony\Component\Form\Extension\Core\Type;

6
	use Symfony\Component\Form\AbstractType;

7
	use Symfony\Component\Form\FormBuilderInterface;

8
	use Symfony\Component\OptionsResolver\OptionsResolver;

9

10
	class ContactType extends AbstractType

11
	{

12
	    /**

13
	     * {@inheritdoc}

14
	     */

15
	    public function buildForm(FormBuilderInterface $builder, array $options)

16
	    {

17
	        $builder->add('nom')

18
	            ->add('prenom')

19
	            ->add('email', Type\EmailType::class)

20
	            ->add('telephone')

21
	            ->add('message', Type\TextareaType::class)

22
	            ->add('envoyer', Type\SubmitType::class);

23

24
	    }

25

26
	    /**

27
	     * {@inheritdoc}

28
	     */

29
	    public function configureOptions(OptionsResolver $resolver)

30
	    {

31
	        $resolver->setDefaults(array(

32
	            'data_class' => 'CentraleReferencementBundle\Entity\Contact'

33
	        ));

34
	    }

35

36
	    /**

37
	     * {@inheritdoc}

38
	     */

39
	    public function getBlockPrefix()

40
	    {

41
	        return 'centralereferencementbundle_contact';

42
	    }

43

44
	    /**

45
	     * {@inheritdoc}

46
	     */

47
	    public function getName()

48
	    {

49
	        return 'formContact';

50
	    }

51

52

53
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by php-code-coverage 5.0.0 using PHP 7.0.4 with Xdebug 2.4.0 and PHPUnit 6.0.5 at Tue Feb 7 8:45:37 UTC 2017.