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

  <testsuite name="skeleton" tests="2" errors="0" failures="2" skip="0">
    <testcase classname="skeleton" name="TestError1" time="0.00">

      <failure type="go.error" message="error">
        <![CDATA[	main_test.go:10: something went wrong]]>
      </failure>    </testcase>
    <testcase classname="skeleton" name="TestError2" time="0.00">

      <failure type="go.error" message="error">
        <![CDATA[	main_test.go:14: something new went wrong]]>
      </failure>    </testcase>
  </testsuite>


text:
namespace lua_tinker
{
	// init LuaTinker
	void	init(lua_State *L);

	void	init_s64(lua_State *L);
	void	init_u64(lua_State *L);

	// string-buffer excution
	void	dofile(lua_State *L, const char *filename);
	void	dostring(lua_State *L, const char* buff);
	void	dobuffer(lua_State *L, const char* buff, size_t sz);

	// debug helpers
	void	enum_stack(lua_State *L);
	int		on_error(lua_State *L);
	void	print_error(lua_State *L, const char* fmt, ...);

	// dynamic type extention
	struct lua_value
	{
		virtual void to_lua(lua_State *L) = 0;
	};

	// type trait
	template<typename T> struct class_name;
	struct table;

	template<bool C, typename A, typename B> struct if_ {};
	template<typename A, typename B>		struct if_<true, A, B> { typedef A type; };
	template<typename A, typename B>		struct if_<false, A, B> { typedef B type; };

	template<typename A>
	struct is_ptr { static const bool value = false; };
	template<typename A>
	struct is_ptr<A*> { static const bool value = true; };

	template<typename A>
	struct is_ref { static const bool value = false; };
	template<typename A>
	struct is_ref<A&> { static const bool value = true; };

	template<typename A>
	struct remove_const { typedef A type; };
	template<typename A>
	struct remove_const<const A> { typedef A type; };

	template<typename A>
	struct base_type { typedef A type; };
	template<typename A>
	struct base_type<A*> { typedef A type; };
	template<typename A>
	struct base_type<A&> { typedef A type; };

	template<typename A>
	struct class_type { typedef typename remove_const<typename base_type<A>::type>::type type; };

	template<typename A>
	struct is_obj { static const bool value = true; };
	template<> struct is_obj<char>					{ static const bool value = false; };
	template<> struct is_obj<unsigned char>			{ static const bool value = false; };
	template<> struct is_obj<short>					{ static const bool value = false; };
	template<> struct is_obj<unsigned short>		{ static const bool value = false; };
	template<> struct is_obj<long>					{ static const bool value = false; };
	template<> struct is_obj<unsigned long>			{ static const bool value = false; };
	template<> struct is_obj<int>					{ static const bool value = false; };
	template<> struct is_obj<unsigned int>			{ static const bool value = false; };
	template<> struct is_obj<float>					{ static const bool value = false; };
	template<> struct is_obj<double>				{ static const bool value = false; };
	template<> struct is_obj<char*>					{ static const bool value = false; };
	template<> struct is_obj<const char*>			{ static const bool value = false; };
	template<> struct is_obj<bool>					{ static const bool value = false; };
	template<> struct is_obj<lua_value*>			{ static const bool value = false; };
	template<> struct is_obj<long long>				{ static const bool value = false; };
	template<> struct is_obj<unsigned long long>	{ static const bool value = false; };
	template<> struct is_obj<table>					{ static const bool value = false; };

	/////////////////////////////////
	enum { no = 1, yes = 2 };
	typedef char (& no_type )[no];
	typedef char (& yes_type)[yes];

	struct int_conv_type { int_conv_type(int); };

	no_type int_conv_tester (...);
	yes_type int_conv_tester (int_conv_type);

	no_type vfnd_ptr_tester (const volatile char *);
	no_type vfnd_ptr_tester (const volatile short *);
	no_type vfnd_ptr_tester (const volatile int *);
	no_type vfnd_ptr_tester (const volatile long *);
	no_type vfnd_ptr_tester (const volatile double *);
	no_type vfnd_ptr_tester (const volatile float *);
	no_type vfnd_ptr_tester (const volatile bool *);
	yes_type vfnd_ptr_tester (const volatile void *);

	template <typename T> T* add_ptr(T&);

	template <bool C> struct bool_to_yesno { typedef no_type type; };
	template <> struct bool_to_yesno<true> { typedef yes_type type; };

	template <typename T>
	struct is_enum
	{
		static T arg;
		static const bool value = ( (sizeof(int_conv_tester(arg)) == sizeof(yes_type)) && (sizeof(vfnd_ptr_tester(add_ptr(arg))) == sizeof(yes_type)) );
	};
	/////////////////////////////////

	// from lua
	template<typename T>
	struct void2val { static T invoke(void* input){ return *(T*)input; } };
	template<typename T>
	struct void2ptr { static T* invoke(void* input){ return (T*)input; } };
	template<typename T>
	struct void2ref { static T& invoke(void* input){ return *(T*)input; } };

	template<typename T>
	struct void2type
	{
		static T invoke(void* ptr)
		{
			return	if_<is_ptr<T>::value
						,void2ptr<typename base_type<T>::type>
						,typename if_<is_ref<T>::value
							,void2ref<typename base_type<T>::type>
							,void2val<typename base_type<T>::type>
						>::type
					>::type::invoke(ptr);
		}
	};

	struct user
	{
		user(void* p) : m_p(p) {}
		virtual ~user() {}
		void* m_p;
	};

	template<typename T>
	struct user2type { static T invoke(lua_State *L, int index) { return void2type<T>::invoke(lua_touserdata(L, index)); } };

	template<typename T>
	struct lua2enum { static T invoke(lua_State *L, int index) { return (T)(int)lua_tonumber(L, index); } };

	template<typename T>
	struct lua2object
	{
		static T invoke(lua_State *L, int index)
		{
			if(!lua_isuserdata(L,index))
			{
				lua_pushstring(L, "no class at first argument. (forgot ':' expression ?)");
				lua_error(L);
			}
			return void2type<T>::invoke(user2type<user*>::invoke(L,index)->m_p);
		}
	};

	template<typename T>
	T lua2type(lua_State *L, int index)
	{
		return	if_<is_enum<T>::value
					,lua2enum<T>
					,lua2object<T>
				>::type::invoke(L, index);
	}

	template<typename T>
	struct val2user : user
	{
		val2user() : user(new T) {}

		template<typename T1>
		val2user(T1 t1) : user(new T(t1)) {}

		template<typename T1, typename T2>
		val2user(T1 t1, T2 t2) : user(new T(t1, t2)) {}

		template<typename T1, typename T2, typename T3>
		val2user(T1 t1, T2 t2, T3 t3) : user(new T(t1, t2, t3)) {}

		template<typename T1, typename T2, typename T3, typename T4>
		val2user(T1 t1, T2 t2, T3 t3, T4 t4) : user(new T(t1, t2, t3,t4)) {}

		template<typename T1, typename T2, typename T3, typename T4, typename T5>
		val2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) : user(new T(t1, t2, t3,t4,t5)) {}

		~val2user() { delete ((T*)m_p); }
	};

	template<typename T>
	struct ptr2user : user
	{
		ptr2user(T* t) : user((void*)t) {}
	};

	template<typename T>
	struct ref2user : user
	{
		ref2user(T& t) : user(&t) {}
	};

	// to lua
	template<typename T>
	struct val2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(input); } };
	template<typename T>
	struct ptr2lua { static void invoke(lua_State *L, T* input){ if(input) new(lua_newuserdata(L, sizeof(ptr2user<T>))) ptr2user<T>(input); else lua_pushnil(L); } };
	template<typename T>
	struct ref2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(ref2user<T>))) ref2user<T>(input); } };

	template<typename T>
	struct enum2lua { static void invoke(lua_State *L, T val) { lua_pushnumber(L, (int)val); } };

	template<typename T>
	struct object2lua
	{
		static void invoke(lua_State *L, T val)
		{
			if_<is_ptr<T>::value
				,ptr2lua<typename base_type<T>::type>
				,typename if_<is_ref<T>::value
					,ref2lua<typename base_type<T>::type>
					,val2lua<typename base_type<T>::type>
				>::type
			>::type::invoke(L, val);

			push_meta(L, class_name<typename class_type<T>::type>::name());
			lua_setmetatable(L, -2);
		}
	};

	template<typename T>
	void type2lua(lua_State *L, T val)
	{
		if_<is_enum<T>::value
			,enum2lua<T>
			,object2lua<T>
		>::type::invoke(L, val);
	}

	// get value from cclosure
	template<typename T>
	T upvalue_(lua_State *L)
	{
		return user2type<T>::invoke(L, lua_upvalueindex(1));
	}

	// read a value from lua stack
	template<typename T>
	T read(lua_State *L, int index)				{ return lua2type<T>(L, index); }

	template<>	char*				read(lua_State *L, int index);
	template<>	const char*			read(lua_State *L, int index);
  template<>	std::string				read(lua_State *L, int index);
  template<>	base::StringPiece				read(lua_State *L, int index);
	template<>	char				read(lua_State *L, int index);
	template<>	unsigned char		read(lua_State *L, int index);
	template<>	short				read(lua_State *L, int index);
	template<>	unsigned short		read(lua_State *L, int index);
	template<>	long				read(lua_State *L, int index);
	template<>	unsigned long		read(lua_State *L, int index);
	template<>	int					read(lua_State *L, int index);
	template<>	unsigned int		read(lua_State *L, int index);
	template<>	float				read(lua_State *L, int index);
	template<>	double				read(lua_State *L, int index);
	template<>	bool				read(lua_State *L, int index);
	template<>	void				read(lua_State *L, int index);
	template<>	long long			read(lua_State *L, int index);
	template<>	unsigned long long	read(lua_State *L, int index);
	template<>	table				read(lua_State *L, int index);

	// push a value to lua stack
	template<typename T>
	void push(lua_State *L, T ret)					{ type2lua<T>(L, ret); }

	template<>	void push(lua_State *L, char ret);
	template<>	void push(lua_State *L, unsigned char ret);
	template<>	void push(lua_State *L, short ret);
	template<>	void push(lua_State *L, unsigned short ret);
	template<>	void push(lua_State *L, long ret);
	template<>	void push(lua_State *L, unsigned long ret);
	template<>	void push(lua_State *L, int ret);
	template<>	void push(lua_State *L, unsigned int ret);
	template<>	void push(lua_State *L, float ret);
	template<>	void push(lua_State *L, double ret);
	template<>	void push(lua_State *L, char* ret);
	template<>	void push(lua_State *L, const char* ret);
  template<>	void push(lua_State *L, std::string ret);
  template<>	void push(lua_State *L, const std::string& ret);
	template<>	void push(lua_State *L, bool ret);
	template<>	void push(lua_State *L, lua_value* ret);
	template<>	void push(lua_State *L, long long ret);
	template<>	void push(lua_State *L, unsigned long long ret);
	template<>	void push(lua_State *L, table ret);

  template<>	void push(lua_State *L, base::StringPiece ret);
  template<>	void push(lua_State *L, const base::StringPiece& ret);

	// pop a value from lua stack
	template<typename T>
	T pop(lua_State *L) { T t = read<T>(L, -1); lua_pop(L, 1); return t; }

	template<>	void	pop(lua_State *L);
	template<>	table	pop(lua_State *L);

	// functor (with return value)
	template<typename RVal, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void>
	struct functor
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5))); return 1; }
	};

	template<typename RVal, typename T1, typename T2, typename T3, typename T4>
	struct functor<RVal,T1,T2,T3,T4>
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4))); return 1; }
	};

	template<typename RVal, typename T1, typename T2, typename T3>
	struct functor<RVal,T1,T2,T3>
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3))); return 1; }
	};

	template<typename RVal, typename T1, typename T2>
	struct functor<RVal,T1,T2>
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2))); return 1; }
	};

	template<typename RVal, typename T1>
	struct functor<RVal,T1>
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1)>(L)(read<T1>(L,1))); return 1; }
	};

	template<typename RVal>
	struct functor<RVal>
	{
		static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)()>(L)()); return 1; }
	};

	// functor (without return value)
	template<typename T1, typename T2, typename T3, typename T4, typename T5>
	struct functor<void, T1, T2, T3, T4, T5>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5)); return 0; }
	};

	template<typename T1, typename T2, typename T3, typename T4>
	struct functor<void, T1, T2, T3, T4>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4)); return 0; }
	};

	template<typename T1, typename T2, typename T3>
	struct functor<void, T1, T2, T3>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3)); return 0; }
	};

	template<typename T1, typename T2>
	struct functor<void, T1, T2>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2)); return 0; }
	};

	template<typename T1>
	struct functor<void, T1>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)(T1)>(L)(read<T1>(L,1)); return 0; }
	};

	template<>
	struct functor<void>
	{
		static int invoke(lua_State *L) { upvalue_<void(*)()>(L)(); return 0; }
	};

	// functor (non-managed)
	template<typename T1>
	struct functor<int, lua_State*, T1>
	{
		static int invoke(lua_State *L) { return upvalue_<int(*)(lua_State*,T1)>(L)(L,read<T1>(L,1)); }
	};

	template<>
	struct functor<int,lua_State*>
	{
		static int invoke(lua_State *L) { return upvalue_<int(*)(lua_State*)>(L)(L); }
	};

	// push_functor
	template<typename RVal>
	void push_functor(lua_State *L, RVal (*func)())
	{
		lua_pushcclosure(L, functor<RVal>::invoke, 1);
	}

	template<typename RVal, typename T1>
	void push_functor(lua_State *L, RVal (*func)(T1))
	{
		lua_pushcclosure(L, functor<RVal,T1>::invoke, 1);
	}

	template<typename RVal, typename T1, typename T2>
	void push_functor(lua_State *L, RVal (*func)(T1,T2))
	{
		lua_pushcclosure(L, functor<RVal,T1,T2>::invoke, 1);
	}

	template<typename RVal, typename T1, typename T2, typename T3>
	void push_functor(lua_State *L, RVal (*func)(T1,T2,T3))
	{
		lua_pushcclosure(L, functor<RVal,T1,T2,T3>::invoke, 1);
	}

	template<typename RVal, typename T1, typename T2, typename T3, typename T4>
	void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4))
	{
		lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4>::invoke, 1);
	}

	template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5>
	void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4,T5))
	{
		lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4,T5>::invoke, 1);
	}

	// member variable
	struct var_base
	{
		virtual void get(lua_State *L) = 0;
		virtual void set(lua_State *L) = 0;
	};

	template<typename T, typename V>
	struct mem_var : var_base
	{
		V T::*_var;
		mem_var(V T::*val) : _var(val) {}
		void get(lua_State *L)	{ push<if_<is_obj<V>::value,V&,V>::type>(L, read<T*>(L,1)->*(_var));	}
		void set(lua_State *L)	{ read<T*>(L,1)->*(_var) = read<V>(L, 3);	}
	};

	// class member functor (with return value)
	template<typename RVal, typename T, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void>
	struct mem_functor
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)));; return 1; }
	};

	template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
	struct mem_functor<RVal,T,T1,T2,T3,T4>
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5))); return 1; }
	};

	template<typename RVal, typename T, typename T1, typename T2, typename T3>
	struct mem_functor<RVal,T,T1,T2,T3>
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4))); return 1; }
	};

	template<typename RVal, typename T, typename T1, typename T2>
	struct mem_functor<RVal,T,T1, T2>
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3))); return 1; }
	};

	template<typename RVal, typename T, typename T1>
	struct mem_functor<RVal,T,T1>
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1)>(L))(read<T1>(L,2))); return 1; }
	};

	template<typename RVal, typename T>
	struct mem_functor<RVal,T>
	{
		static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)()>(L))()); return 1; }
	};

	// class member functor (without return value)
	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
	struct mem_functor<void,T,T1,T2,T3,T4,T5>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)); return 0; }
	};

	template<typename T, typename T1, typename T2, typename T3, typename T4>
	struct mem_functor<void,T,T1,T2,T3,T4>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5)); return 0; }
	};

	template<typename T, typename T1, typename T2, typename T3>
	struct mem_functor<void,T,T1,T2,T3>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4)); return 0; }
	};

	template<typename T, typename T1, typename T2>
	struct mem_functor<void,T,T1,T2>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3)); return 0; }
	};

	template<typename T, typename T1>
	struct mem_functor<void,T,T1>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1)>(L))(read<T1>(L,2)); return 0; }
	};

	template<typename T>
	struct mem_functor<void,T>
	{
		static int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)()>(L))(); return 0; }
	};

	// class member functor (non-managed)
	template<typename T, typename T1>
	struct mem_functor<int,T,lua_State*,T1>
	{
		static int invoke(lua_State *L) { return (read<T*>(L,1)->*upvalue_<int(T::*)(lua_State*,T1)>(L))(L, read<T1>(L,2)); }
	};

	template<typename T>
	struct mem_functor<int,T,lua_State*>
	{
		static int invoke(lua_State *L) { return (read<T*>(L,1)->*upvalue_<int(T::*)(lua_State*)>(L))(L); }
	};

	// push_functor
	template<typename RVal, typename T>
	void push_functor(lua_State *L, RVal (T::*func)())
	{
		lua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1);
	}

	template<typename RVal, typename T>
	void push_functor(lua_State *L, RVal (T::*func)() const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1>
	void push_functor(lua_State *L, RVal (T::*func)(T1))
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1>
	void push_functor(lua_State *L, RVal (T::*func)(T1) const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2))
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2) const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3))
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3) const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4))
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4) const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5))
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1);
	}

	template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
	void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5) const)
	{
		lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1);
	}

	// constructor
	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6));
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	template<typename T, typename T1, typename T2, typename T3, typename T4>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5));
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	template<typename T, typename T1, typename T2, typename T3>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4));
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	template<typename T, typename T1, typename T2>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3));
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	template<typename T, typename T1>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2));
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	template<typename T>
	int constructor(lua_State *L)
	{
		new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>();
		push_meta(L, class_name<typename class_type<T>::type>::name());
		lua_setmetatable(L, -2);

		return 1;
	}

	// destroyer
	template<typename T>
	int destroyer(lua_State *L)
	{
		((user*)lua_touserdata(L, 1))->~user();
		return 0;
	}

	// global function
	template<typename F>
	void def(lua_State* L, const char* name, F func)
	{
		//lua_pushstring(L, name);
		lua_pushlightuserdata(L, (void*)func);
		push_functor(L, func);
		//lua_settable(L, LUA_GLOBALSINDEX);
    lua_setglobal(L,name);
	}

	// global variable
	template<typename T>
	void set(lua_State* L, const char* name, T object)
	{
		// lua_pushstring(L, name);
		push(L, object);
		// lua_settable(L, LUA_GLOBALSINDEX);
    lua_setglobal(L,name);
	}

	template<typename T>
	T get(lua_State* L, const char* name)
	{
		// lua_pushstring(L, name);
		// lua_gettable(L, LUA_GLOBALSINDEX);
    lua_getglobal(L,name);
		return pop<T>(L);
	}

	template<typename T>
	void decl(lua_State* L, const char* name, T object)
	{
		set(L, name, object);
	}

	// call
	template<typename RVal>
	RVal call(lua_State* L, const char* name)
	{
		lua_pushcclosure(L, on_error, 0);
		int errfunc = lua_gettop(L);

		// lua_pushstring(L, name);
		// lua_gettable(L, LUA_GLOBALSINDEX);
		lua_getglobal(L,name);

		if(lua_isfunction(L,-1))
		{
			lua_pcall(L, 0, 1, errfunc);
		}
		else
		{
			print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
		}

		lua_remove(L, errfunc);
		return pop<RVal>(L);
	}

	template<typename RVal, typename T1>
	RVal call(lua_State* L, const char* name, T1 arg)
	{
		lua_pushcclosure(L, on_error, 0);
		int errfunc = lua_gettop(L);

		// lua_pushstring(L, name);
		// lua_gettable(L, LUA_GLOBALSINDEX);
		lua_getglobal(L,name);

		if(lua_isfunction(L,-1))
		{
			push(L, arg);
			lua_pcall(L, 1, 1, errfunc);
		}
		else
		{
			print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
		}

		lua_remove(L, errfunc);
		return pop<RVal>(L);
	}

	template<typename RVal, typename T1, typename T2>
	RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2)
	{
		lua_pushcclosure(L, on_error, 0);
		int errfunc = lua_gettop(L);

		// lua_pushstring(L, name);
		// lua_gettable(L, LUA_GLOBALSINDEX);
    lua_getglobal(L, name);
		if(lua_isfunction(L,-1))
		{
			push(L, arg1);
			push(L, arg2);
			lua_pcall(L, 2, 1, errfunc);
		}
		else
		{
			print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
		}

		lua_remove(L, errfunc);
		return pop<RVal>(L);
	}

	template<typename RVal, typename T1, typename T2, typename T3>
	RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3)
	{
		lua_pushcclosure(L, on_error, 0);
		int errfunc = lua_gettop(L);

		// lua_pushstring(L, name);
		// lua_gettable(L, LUA_GLOBALSINDEX);
		lua_getglobal(L,name);

		if(lua_isfunction(L,-1))
		{
			push(L, arg1);
			push(L, arg2);
			push(L, arg3);
			lua_pcall(L, 3, 1, errfunc);
		}
		else
		{
			print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
		}

		lua_remove(L, errfunc);
		return pop<RVal>(L);
	}

	// class helper
	int meta_get(lua_State *L);
	int meta_set(lua_State *L);
	void push_meta(lua_State *L, const char* name);

	// class init
	template<typename T>
	void class_add(lua_State* L, const char* name)
	{
		class_name<T>::name(name);

		lua_pushstring(L, name);
		lua_newtable(L);

		lua_pushstring(L, "__name");
		lua_pushstring(L, name);
		lua_rawset(L, -3);

		lua_pushstring(L, "__index");
		lua_pushcclosure(L, meta_get, 0);
		lua_rawset(L, -3);

		lua_pushstring(L, "__newindex");
		lua_pushcclosure(L, meta_set, 0);
		lua_rawset(L, -3);

		lua_pushstring(L, "__gc");
		lua_pushcclosure(L, destroyer<T>, 0);
		lua_rawset(L, -3);

		// lua_settable(L, LUA_GLOBALSINDEX);
    lua_setglobal(L, name);
	}

	// Tinker Class Inheritence
	template<typename T, typename P>
	void class_inh(lua_State* L)
	{
		push_meta(L, class_name<T>::name());
		if(lua_istable(L, -1))
		{
			lua_pushstring(L, "__parent");
			push_meta(L, class_name<P>::name());
			lua_rawset(L, -3);
		}
		lua_pop(L, 1);
	}

	// Tinker Class Constructor
	template<typename T, typename F>
	void class_con(lua_State* L,F func)
	{
		push_meta(L, class_name<T>::name());
		if(lua_istable(L, -1))
		{
			lua_newtable(L);
			lua_pushstring(L, "__call");
			lua_pushcclosure(L, func, 0);
			lua_rawset(L, -3);
			lua_setmetatable(L, -2);
		}
		lua_pop(L, 1);
	}

	// Tinker Class Functions
	template<typename T, typename F>
	void class_def(lua_State* L, const char* name, F func)
	{
		push_meta(L, class_name<T>::name());
		if(lua_istable(L, -1))
		{
			lua_pushstring(L, name);
			new(lua_newuserdata(L,sizeof(F))) F(func);
			push_functor(L, func);
			lua_rawset(L, -3);
		}
		lua_pop(L, 1);
	}

	// Tinker Class Variables
	template<typename T, typename BASE, typename VAR>
	void class_mem(lua_State* L, const char* name, VAR BASE::*val)
	{
		push_meta(L, class_name<T>::name());
		if(lua_istable(L, -1))
		{
			lua_pushstring(L, name);
			new(lua_newuserdata(L,sizeof(mem_var<BASE,VAR>))) mem_var<BASE,VAR>(val);
			lua_rawset(L, -3);
		}
		lua_pop(L, 1);
	}

	template<typename T>
	struct class_name
	{
		// global name
		static const char* name(const char* name = NULL)
		{
      static std::string temp;
      // char temp[256] = "";
			if(name) temp = name;
      // strcpy_s(temp, name);
			return temp.c_str();
		}
	};

	// Table Object on Stack
	struct table_obj
	{
		table_obj(lua_State* L, int index);
		~table_obj();

		void inc_ref();
		void dec_ref();

		bool validate();

		template<typename T>
		void set(const char* name, T object)
		{
			if(validate())
			{
				lua_pushstring(m_L, name);
				push(m_L, object);
				lua_settable(m_L, m_index);
			}
		}

		template<typename T>
		T get(const char* name)
		{
			if(validate())
			{
				lua_pushstring(m_L, name);
				lua_gettable(m_L, m_index);
			}
			else
			{
				lua_pushnil(m_L);
			}

			return pop<T>(m_L);
		}

		lua_State*		m_L;
		int				m_index;
		const void*		m_pointer;
		int				m_ref;
	};

	// Table Object Holder
	struct table
	{
		table(lua_State* L);
		table(lua_State* L, int index);
		table(lua_State* L, const char* name);
		table(const table& input);
		~table();

		template<typename T>
		void set(const char* name, T object)
		{
			m_obj->set(name, object);
		}

		template<typename T>
		T get(const char* name)
		{
			return m_obj->get<T>(name);
		}

		table_obj*		m_obj;
	};

} // namespace lua_tinker

#endif //_LUA_TINKER_H_

redpajama_set_name: RedPajamaGithub


text:
import { error } from "../src/error";
test("Should greet with message", () => {
  const NotFound = error("NotFound", { messages: { "zh-CN": "Not Found!" } });
  expect(typeof NotFound === "function").toBeTruthy();
  const notFound = new NotFound("zh-CN");
  expect(notFound.name).toBe("NotFound");
  expect(notFound.message).toBe("Not Found!");
  expect(notFound.stack).toBeTruthy();
});

test("Should greet with message", () => {
  const NotFound = error("NotFound", {
    code: 404,
    messages: {
      en: "Not Found!",
      "zh-CN": "未找到",
    },
  });
  expect(typeof NotFound === "function").toBeTruthy();
  const notFound = new NotFound("zh-CN");
  expect(notFound.code).toBe(404);
  expect(notFound.locale).toBe("zh-CN");
  expect(Object.keys(notFound.messages).length === 2).toBeTruthy();

  const noneLocale = new NotFound();
  expect(noneLocale.code).toBe(404);
  expect(noneLocale.locale).toBeFalsy();
  expect(noneLocale.toJSON()).toBeTruthy();
});


text:
package com.satvaimal.hellopersistence.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="author")
public class Author {

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private long id;

  @Column(nullable = false, length = 50)
  private String name;

  @Column(nullable = false)
  private Date birthdate;

  public void setId( long id ) {
    this.id = id;
  }// End of method

  public long getId() {
    return id;
  }// End of method

  public void setName( String name ) {
    this.name = name;
  }// End of method

  public String getName() {
    return name;
  }// End of method

  public void setBirthdate( Date birthdate ) {
    this.birthdate = birthdate;
  }// End of method

  public Date getBirthdate() {
    return birthdate;
  }// End of method

}// End of class


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="192dp"
    android:background="?attr/colorPrimaryDark"
    android:padding="16dp"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"
    android:gravity="bottom">

    <TextView
        android:id="@+id/text_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Trail App"
        android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>

</LinearLayout>


text:
using namespace std;

namespace LandmarkDetector
{
//===========================================================================
//
// Checking if landmark detection was successful using an SVR regressor
// Using multiple validators trained add different views
// The regressor outputs -1 for ideal alignment and 1 for worst alignment
//===========================================================================
class DetectionValidator
{

public:

	// What type of validator we're using - 0 - linear svr, 1 - feed forward neural net, 2 - convolutional neural net, 3 - new version of convolutional neural net
	int validator_type;

	// The orientations of each of the landmark detection validator
	vector<cv::Vec3d> orientations;

	// Piecewise affine warps to the reference shape (per orientation)
	vector<PAW>     paws;

	//==========================================
	// Linear SVR

	// SVR biases
	vector<double>  bs;

	// SVR weights
	vector<cv::Mat_<double> > ws;

	//==========================================
	// Neural Network

	// Neural net weights
	vector<vector<cv::Mat_<double> > > ws_nn;

	// What type of activation or output functions are used
	// 0 - sigmoid, 1 - tanh_opt, 2 - ReLU
	vector<int> activation_fun;
	vector<int> output_fun;

	//==========================================
	// Convolutional Neural Network

	// CNN layers for each view
	// view -> layer -> input maps -> kernels
	vector<vector<vector<vector<cv::Mat_<float> > > > > cnn_convolutional_layers;
	// Bit ugly with so much nesting, but oh well
	vector<vector<vector<vector<pair<int, cv::Mat_<double> > > > > > cnn_convolutional_layers_dft;
	vector<vector<vector<float > > > cnn_convolutional_layers_bias;
	vector< vector<int> > cnn_subsampling_layers;
	vector< vector<cv::Mat_<float> > > cnn_fully_connected_layers_weights;
	vector< vector<float > > cnn_fully_connected_layers_bias;
	// OLD CNN: 0 - convolutional, 1 - subsampling, 2 - fully connected
	// NEW CNN: 0 - convolutional, 1 - max pooling (2x2 stride 2), 2 - fully connected, 3 - relu, 4 - sigmoid
	vector<vector<int> > cnn_layer_types;

	// Extra params for the new CNN
	vector< vector<cv::Mat_<float>  > > cnn_fully_connected_layers_biases;

	//==========================================

	// Normalisation for face validation
	vector<cv::Mat_<double> > mean_images;
	vector<cv::Mat_<double> > standard_deviations;

	// Default constructor
	DetectionValidator(){;}

	// Copy constructor
	DetectionValidator(const DetectionValidator& other);

	// Given an image, orientation and detected landmarks output the result of the appropriate regressor
	double Check(const cv::Vec3d& orientation, const cv::Mat_<uchar>& intensity_img, cv::Mat_<double>& detected_landmarks);

	// Reading in the model
	void Read(string location);

	// Getting the closest view center based on orientation
	int GetViewId(const cv::Vec3d& orientation) const;

private:

	// The actual regressor application on the image

	// Support Vector Regression (linear kernel)
	double CheckSVR(const cv::Mat_<double>& warped_img, int view_id);

	// Feed-forward Neural Network
	double CheckNN(const cv::Mat_<double>& warped_img, int view_id);

	// Convolutional Neural Network
	double CheckCNN_tbb(const cv::Mat_<double>& warped_img, int view_id);

	// Convolutional Neural Network
	double CheckCNN(const cv::Mat_<double>& warped_img, int view_id);

	// Convolutional Neural Network
	double CheckCNN_old(const cv::Mat_<double>& warped_img, int view_id);

	// A normalisation helper
	void NormaliseWarpedToVector(const cv::Mat_<double>& warped_img, cv::Mat_<double>& feature_vec, int view_id);

};

}
#endif


text:
import { expect } from 'chai';
import MemoryStorage from './';

describe('MemoryStorage', () => {
  it('should be a constructor function', () => {
    expect(MemoryStorage).to.be.a('function');
    expect(() => new MemoryStorage()).to.not.throw();
    const instance = new MemoryStorage();
    expect(instance).to.exist;
    expect(instance instanceof MemoryStorage).to.be.true;
  });
  describe('MemoryStorage instance', () => {
    it('should have function getItem', () => {
      const instance = new MemoryStorage();
      expect(instance.getItem).to.be.a('function');
    });
    it('should have function setItem', () => {
      const instance = new MemoryStorage();
      expect(instance.setItem).to.be.a('function');
    });
    it('should have function removeItem', () => {
      const instance = new MemoryStorage();
      expect(instance.removeItem).to.be.a('function');
    });
    it('should behave similar to localStorage with getItem, setItem, and removeItem', () => {
      const instance = new MemoryStorage();
      instance.setItem('foo', 'bar');
      expect(instance.getItem('foo')).to.equal('bar');
      instance.removeItem('foo');
      expect(instance.getItem('bar')).to.be.undefined;
    });
    it('should have function key', () => {
      const instance = new MemoryStorage();
      expect(instance.key).to.be.a('function');
    });
    it('should have property length', () => {
      const instance = new MemoryStorage();
      expect(instance.length).to.be.a('number');
    });
    it('should have the correct length', () => {
      const instance = new MemoryStorage();
      [1, 2, 3, 4, 5].forEach((num) => {
        instance.setItem(`foo-${num}`, `bar-${num}`);
        expect(instance.length).to.equal(num);
      });
    });
    it('should return storage keys with key function', () => {
      const instance = new MemoryStorage();
      [1, 2, 3, 4, 5].forEach((num, idx) => {
        instance.setItem(`foo-${num}`, `bar-${num}`);
        expect(instance.key(idx)).to.equal(`foo-${num}`);
      });
    });
  });
});


text:
import argparse
import json
import sys

import numpy as np
import torch
import tqdm

from program_synthesis.karel import arguments
from program_synthesis.karel import dataset
from program_synthesis.karel import models
from program_synthesis.karel.dataset import executor
from program_synthesis.common.tools import saver
from program_synthesis.algolisp.tools import evaluation

class EmptyArgs(object):
    pass

def evaluate(args):
    print("Evaluation:")
    print("\tModel type: %s\n\tModel path: %s" %
          (args.model_type, args.model_dir))
    saver.restore_args(args)
    arguments.backport_default_args(args)
    dataset.set_vocab(args)
    m = models.get_model(args)
    if args.eval_final:
        eval_dataset = dataset.get_eval_final_dataset(args, m)
    elif args.eval_train:
        eval_dataset = dataset.get_train_dataset(args, m, for_eval=True)
    else:
        eval_dataset = dataset.get_eval_dataset(args, m)
    if m.last_step == 0:
        raise ValueError('Attempting to evaluate on untrained model')
    m.model.eval()
    the_executor = executor.get_executor(args)()

    top_k_exact = np.zeros(args.max_beam_trees, dtype=int)
    top_k_sem = np.zeros(args.max_beam_trees, dtype=int)
    top_k_gen = np.zeros(args.max_beam_trees, dtype=int)
    exact_ranks = []
    sem_ranks = []
    gen_ranks = []
    outputs = []
    total = 0.0

    iterator = tqdm.tqdm(eval_dataset, dynamic_ncols=True)
    for batch in iterator:
        sequences = m.inference(batch, filtered=False)

        for batch_idx, beams in enumerate(sequences):
            total += 1
            orig_example = batch.orig_examples[batch_idx]
            exact_found, sem_found, gen_found = False, False, False
            exact_rank, sem_rank, gen_rank = None, None, None
            for rank, tokens in enumerate(beams):
                # Exact match
                ref_code = getattr(orig_example, 'code_sequence',
                                   getattr(orig_example, 'goal_code', None))
                if not exact_found and tuple(tokens) == tuple(ref_code):
                    top_k_exact[rank:] += 1
                    exact_found = True
                    exact_rank = rank

                if not sem_found or not exact_found:
                    # Semantic match (passes all input tests)
                    input_tests_eval = executor.evaluate_code(
                        tokens, None, orig_example.input_tests,
                        the_executor.execute)
                    sem_match = input_tests_eval['correct'] == len(
                            orig_example.input_tests)
                    if not sem_found and sem_match:
                        top_k_sem[rank:] += 1
                        sem_found = True
                        sem_rank = rank

                    # Generalization (passes all input tests + other tests)
                    tests_eval = executor.evaluate_code(
                        tokens, None, orig_example.tests, the_executor.execute)
                    gen = sem_match and tests_eval['correct'] == len(
                            orig_example.tests)
                    if not gen_found and gen:
                        top_k_gen[rank:] += 1
                        gen_found = True
                        gen_rank = rank

                if exact_found and sem_found and gen_found:
                    break

            exact_ranks.append(exact_rank)
            sem_ranks.append(sem_rank)
            gen_ranks.append(gen_rank)
            if args.save_beam_outputs:
                outputs.append(beams)

        iterator.set_postfix(
            exact=top_k_exact[0] / total,
            sem=top_k_sem[0] / total,
            gen=top_k_gen[0] / total)

    with open(args.report_path, 'w') as f:
        json.dump({
            # Total number of programs in this report.
            'total': total,
            # List where the Nth entry contains the number of programs with
            # exact match among the top N beam search outputs.
            # Length = args.max_beam_trees.
            'exact': top_k_exact.tolist(),
            # List where the Nth entry contains the number of programs with
            # semantic match (correct on all `input_tests`, given to the model)
            # among the top N beam search outputs.
            # Length = args.max_beam_trees.
            'semantic': top_k_sem.tolist(),
            # List where the Nth entry contains the number of programs with
            # generalization (correct on all `input_tests` and `tests) among the
            # top N beam search outputs.
            # Length = args.max_beam_trees.
            'generalization': top_k_gen.tolist(),
            # For each program, the rank at which the corresponding type of
            # match was found (None if not applicable to any rank).
            'ranks': {
                'exact': exact_ranks,
                'semantic': sem_ranks,
                'generalization': gen_ranks,
            },
            # List of length `total` where each item is a list containing
            # `args.max_beam_trees` programs, as output by the beam search.
            # Can be empty if this output was not saved.
            'beam_outputs': outputs
        }, f)

if __name__ == "__main__":
    parser = arguments.get_arg_parser('Evaluating Text2Code', 'eval')
    args = parser.parse_args()

    assert args.report_path

    args.cuda = not args.no_cuda and torch.cuda.is_available()
    if not args.model_type or (not args.model_dir and
                               args.model_type != 'search'):
        raise ValueError("Specify model_dir and model_type")
    if not args.tag:
        args.tag = args.model_type
    evaluate(args)


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="LogManagerConfigTests.cs">
// Copyright (c) 2011-2016 https://github.com/logjam2.
// </copyright>
// Licensed under the Apache License, Version 2.0;
// you may not use this file except in compliance with the License.
// --------------------------------------------------------------------------------------------------------------------

namespace LogJam.UnitTests.Config
{
    using System;
    using System.IO;

    using LogJam.Config;
    using LogJam.Trace;
    using LogJam.Trace.Format;
    using LogJam.Writer;

    using Xunit;
    using Xunit.Abstractions;

    ///
    /// Exercises <see cref="LogManagerConfig" />.
    ///
    public sealed class LogManagerConfigTests
    {

        private readonly ITestOutputHelper _testOutputHelper;

        public LogManagerConfigTests(ITestOutputHelper testOutputHelper)
        {
            _testOutputHelper = testOutputHelper;
        }

        [Fact]
        public void DefaultLogManagerHasEmptyConfig()
        {
            using (var logManager = new LogManager())
            {
                Assert.Empty(logManager.Config.Writers);
                Assert.False(logManager.IsStarted());
                Assert.True(logManager.IsHealthy);
            }
        }

        ///
        /// Covers cases like "the log file couldn't be opened".
        ///
        [Fact]
        public void LogWriterCreateExceptionIsHandled()
        {
            Func<TextWriter> throwOnCreate = () => { throw new AccessViolationException("Testing what happens when access is denied"); };

            using (var logManager = new LogManager())
            {
                TextWriterLogWriterConfig logWriterConfig = logManager.Config.UseTextWriter(throwOnCreate);
                logWriterConfig.Format(new DefaultTraceFormatter());
                Assert.True(logManager.IsHealthy);

                // Exception is thrown during Start()
                logManager.Start();
                Assert.False(logManager.IsHealthy);
                _testOutputHelper.WriteEntries(logManager.SetupLog);

                ILogWriter logWriter;
                Assert.False(logManager.TryGetLogWriter(logWriterConfig, out logWriter));

                var traceEntryWriter = logManager.GetEntryWriter<TraceEntry>();
                Assert.NotNull(traceEntryWriter);
                Assert.IsType<NoOpEntryWriter<TraceEntry>>(traceEntryWriter);
            }
        }

    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>Cine Tênis Verde</title>
  <meta name="author" content="" />
  <meta name="description"
        content=""/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="Cine Tênis Verde"/>
  <meta itemprop="description"
        content=""/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="Cine Tênis Verde"/>
  <meta property="og:type"
        content="website"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content=""/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:section" content=""/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="Cine Tênis Verde"/>
  <meta name="twitter:description"
        content=""/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link href="http://www.cinetenisverde.com.br/index.xml" rel="alternate" type="application/rss+xml"
        title="Cine Tênis Verde"/>
  <link href="http://www.cinetenisverde.com.br/index.xml" rel="feed" type="application/rss+xml"
        title="Cine Tênis Verde"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

        <input type="checkbox" id="navbar-burger-state"/>

          search

          twitter

          rss

Versos de Um Crime

      Sep 10, 2016
      2 min.

Depois do ótimo Na Estrada (Walter Salles, 2012), o requisitado personagem da vida real Allen Ginsberg, o poeta americano da geração beat dos anos 50, é encarnado por Daniel Radcliffe (da série Harry Potter), e tem ao seu lado o igualmente ótimo Dane DeHaan (Poder Sem Limites, O Lugar Onde Tudo Termina) e um Michael C. Hall (da série Dexter) curioso, mas um tanto ausente. A história é retratada como um drama novelístico e televisivo, com impecável direção de arte, mas uma narrativa burocrática demais para funcionar com poetas que estavam revolucionando o mundo da literatura.

Jovens, Loucos e Mais Rebeldes

      Sep 9, 2016
      2 min.

Mais um filme dirigido e escrito por Richard Linklater (Trilogia do Antes, Boyhood) que analisa pessoas através de sua ficção que lembra um pseudo-documentário, nesse caso de um geração (final dos anos 70).
O diretor já havia feito um outro filme com a mesma temática 23 anos atrás: Jovens, Loucos e Rebeldes (apenas no Brasil o título é o mesmo), mas é curioso como o filme parece uma continuação do protagonista de Boyhood, pois acompanhamos o rapaz até sua adolescência.

Jovens, Loucos e Rebeldes

      Sep 9, 2016
      2 min.

Este é o filme de uma geração de Richard Linklater (Trilogia do Antes, Boyhood), um de seus primeiros, de 1993. Ele conta com um elenco de desconhecidos, onde alguns irá começar a ser mais conhecido. Ele conta uma história simples, que evoca o naturalismo, mas que contém tensão o suficiente para entreter. E ele contém o mais importante: a empatia do público que sabe como é ser jovem, como é experimentar coisas novas e sabe como é estar naquele momento mágico, vivenciando tudo isso, tendo toda a vida pela frente.

Grande Coisa

      Sep 8, 2016
      2 min.

Lembra aquelas comédias meio-thriller, meio-policial e meio-pastelão(?!?). Pois é, em “Grande Coisa”, isso foi pasteurizado, talvez “reimaginado”, e se tornou uma trama pseudo-complexa sobre uma série de acontecimentos inesperados recheados de mentiras deslavadas e reviravoltas impossíveis, a ponto de duvidarmos se tudo aquilo poderia fazer sentido em um filme menos… retardado.
A questão é que não há muito o que fazer para tornar este filme interessante, e talvez por isso mesmo o diretor/roteirista Jean-Baptiste Andrea tenha decidido extravasar todos os clichês de uma vez só.

Star Trek: Sem Fronteiras

      Sep 7, 2016
      3 min.

O reboot megalomaníaco da série de filmes inspirada pela série televisiva nerd dos anos 60 está com muita bala na agulha para poder gastar e pouca vontade de arriscar. Isso quer dizer que o novo filme com Capitão Kirk e Spock tem basicamente o mesmo enredo do filme anterior (Além da Escuridão) tirando a emoção.
Porém, a boa notícia é que os efeitos visuais gerados por computador têm garantidos boas supressas esse ano.

200 Grandes Diretores

      Sep 5, 2016
      37 min.

Pessoas geralmente gostam de se divertir vendo filmes com seus atores favoritos. Geralmente são os que conseguem trazer o riso, a lágrima e performances que conseguem fazê-los se esquecer por um momento da vida real e viver um sonho que é um filme. No entanto, poucos estão habituados à ideia de que o roteirista e o diretor são em grande parte responsáveis pelos efeitos que o elenco consegue reproduzir. Muitos são fãs de um filme X e gostariam de assistir filmes semelhantes, seja pela temática ou pela sensação que o filme traz.

Eungyo - A Musa

      Sep 4, 2016
      4 min.

Uma relação entre uma jovem de 17 anos e um velho escritor aclamado de 70 anos é o tema deste drama que começa lúdico, se desenvolve com uma temática ambiciosa com uma crítica de nossa geração, e termina com um inesperado thriller. A sensação é de que ele é longo demais, quando na verdade parece apenas inacabado.
Parece que o roteirista (e diretor) Ji Woo Chung está brincando com as sensações que giram em torno do mundo do romance e da poesia, pois desde que a lolita Han Eun-gyo (Go-eun Kim) aparece se balançando na cadeira do velho homem tudo lembra o literário, a ficção.

Herança de Sangue

      Sep 4, 2016
      3 min.

Mel Gibson parece ser uma espécie de persona que foi se construindo aos trancos e barrancos através de seus heróis no Cinema e vilões na vida real. O duro na queda Máquina Mortífera e o mártir de Coração Valente encontram o homem violento em suas relações domésticas com o idealizados com tendências anti-semitas, e dessa reunião de diferentes personalidades nasce uma adaptação de romance que tem a sua cara: se sacrificar pela próxima geração é um clichê de Gibson, mas seus trejeitos e referências é um clichê de sua vida real.

O Traidor

      Sep 4, 2016
      3 min.

Uma narradora que é uma velha e que faz graça com a desgraça de uma nação. Belas mulheres asiáticas que são estupradas por um imperador maluco, auxiliado por dois caçadores de beleza, pai e filho, que não confiam um no outro. Uma putaria e violência que começam desenfreadas, mas aos poucos caem no clichê moralista não sei bem por quê. Uma história mais ou menos histórica (Yeonsangun of Joseon, o décimo-rei da Coreia) que falha em uma narrativa sem entender a que veio.

O Concurso

      Aug 28, 2016
      3 min.

Este é mais um dos filmes bobos, praticamente sem graça e datados da Globo Filmes. O Concurso continua fazendo piadas no melhor/pior estilo A Praça é Nossa ou Zorra Total. Pior: sequer tem vergonha de usar um fiapo de história que apenas serve para juntar situações entre humoristas se fazendo de atores com personagens tipicamente rasos.
A história é sobre o concurso público mais disputado no país: juiz federal. Entre as inúmeras fases, apenas quatro foram selecionados para a fase final (o teste oral), e vemos os quatro descobrindo que foram selecionados.

  Previous
  Next

      1

      …

      73

      74

      75

      …

197

Categories

          Blog
          46

          Movies
          1741

          Series
          174


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Identity.Client.Core;
using Windows.Foundation.Metadata;
using Windows.Security.Authentication.Web.Core;
using Windows.Security.Credentials;

#if NET6_WIN
using Microsoft.Identity.Client.Platforms.net6win;
using WebAuthenticationCoreManagerInterop = Microsoft.Identity.Client.Platforms.net6win.WebAuthenticationCoreManagerInterop;
#elif DESKTOP || NET_CORE
using Microsoft.Identity.Client.Platforms;
#endif

namespace Microsoft.Identity.Client.Platforms.Features.WamBroker
{
#if NET6_WIN
    [System.Runtime.Versioning.SupportedOSPlatform("windows10.0.17763.0")]
#endif
    internal class WamProxy : IWamProxy
    {
        private readonly ILoggerAdapter _logger;
        private readonly SynchronizationContext _synchronizationContext;

        public WamProxy(ILoggerAdapter logger, System.Threading.SynchronizationContext synchronizationContext)
        {
            _logger = logger;
            _synchronizationContext = synchronizationContext;
        }

        public async Task<IWebTokenRequestResultWrapper> GetTokenSilentlyAsync(WebAccount webAccount, WebTokenRequest webTokenRequest)
        {
            using (_logger.LogBlockDuration("WAM:GetTokenSilentlyAsync:webAccount"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                    _logger.VerbosePii(webAccount.ToLogString(true), webAccount.ToLogString(false));
                }

                var wamResult = await WebAuthenticationCoreManager.GetTokenSilentlyAsync(webTokenRequest, webAccount);
                return new WebTokenRequestResultWrapper(wamResult);
            }
        }

        public async Task<IWebTokenRequestResultWrapper> GetTokenSilentlyForDefaultAccountAsync(WebTokenRequest webTokenRequest)
        {
            using (_logger.LogBlockDuration("WAM:GetTokenSilentlyAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                }

                var wamResult = await WebAuthenticationCoreManager.GetTokenSilentlyAsync(webTokenRequest);
                return new WebTokenRequestResultWrapper(wamResult);
            }
        }

        public async Task<IWebTokenRequestResultWrapper> RequestTokenForWindowAsync(
            IntPtr _parentHandle,
            WebTokenRequest webTokenRequest)
        {
            using (_logger.LogBlockDuration("WAM:RequestTokenForWindowAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                }
#if WINDOWS_APP
                // UWP requires being on the UI thread
                await _synchronizationContext;

                WebTokenRequestResult wamResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);
#else

                var wamResult = await WebAuthenticationCoreManagerInterop.RequestTokenForWindowAsync(
                    _parentHandle, webTokenRequest);
#endif
                return new WebTokenRequestResultWrapper(wamResult);
            }
        }

        public async Task<IWebTokenRequestResultWrapper> RequestTokenForWindowAsync(
           IntPtr _parentHandle,
           WebTokenRequest webTokenRequest,
           WebAccount wamAccount)
        {
            using (_logger.LogBlockDuration("WAM:RequestTokenForWindowAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                    _logger.VerbosePii(wamAccount.ToLogString(true), wamAccount.ToLogString(false));
                }
#if WINDOWS_APP

                // UWP requires being on the UI thread
                await _synchronizationContext;

                WebTokenRequestResult wamResult = await WebAuthenticationCoreManager.RequestTokenAsync(
                    webTokenRequest,
                    wamAccount);
#else

                var wamResult = await WebAuthenticationCoreManagerInterop.RequestTokenWithWebAccountForWindowAsync(
                _parentHandle, webTokenRequest, wamAccount);
#endif
                return new WebTokenRequestResultWrapper(wamResult);
            }
        }

        public async Task<WebAccount> FindAccountAsync(WebAccountProvider provider, string wamAccountId)
        {
            using (_logger.LogBlockDuration("WAM:FindAccountAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(provider.ToLogString(true), provider.ToLogString(false));
                }

                return await WebAuthenticationCoreManager.FindAccountAsync(provider, wamAccountId);
            }
        }

        public async Task<IReadOnlyList<WebAccount>> FindAllWebAccountsAsync(WebAccountProvider provider, string clientID)
        {
            using (_logger.LogBlockDuration("WAM:FindAllWebAccountsAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(provider.ToLogString(true), provider.ToLogString(false));
                }

                // Win 10 RS3 release and above
                if (!ApiInformation.IsMethodPresent(
                   "Windows.Security.Authentication.Web.Core.WebAuthenticationCoreManager",
                   "FindAllAccountsAsync"))
                {
                    _logger.Info("[WamProxy] FindAllAccountsAsync method does not exist (it was introduced in Win 10 RS3). " +
                        "Returning 0 broker accounts. ");
                    return Enumerable.Empty<WebAccount>().ToList();
                }

                return await LegacyOsWamProxy.FindAllAccountsAsync(provider, clientID, _logger).ConfigureAwait(false);
            }
        }

        public bool TryGetAccountProperty(WebAccount webAccount, string propertyName, out string propertyValue)
        {
            return webAccount.Properties.TryGetValue("Authority", out propertyValue);
        }
    }
}


text:
/*
 * index.js: Top-level include for flatiron-cli-ok
 *
 * (C) 2012, Pavan Kumar Sunkara
 *
 */

var path = require('path');

var cliOk = exports = module.exports;

cliOk.name = 'cli-ok';

cliOk.attach = function (options) {
  var app = this;
  cliOk.options = options || {};

  if (!app.plugins.cli) {
    throw new Error('`cli` plugin is required to use `flatiron-cli-ok`');
  }

  var start = app.start;

  app.start = function (options, cb) {
    if (!cb && typeof options == 'function') {
      cb = options;
      options = null;
    }

    start(options || {}, function (err) {
      if (cb) return cb(err);
      if (err) {
        if (err.message && cliOk.options.show) {
          app.log.error(err.message.red.bold);
        }
        app.log.info(app.name.grey + ' ' + 'not'.red.bold + ' ' + 'ok'.red.bold);
      } else {
        app.log.info(app.name.grey + ' ' + 'ok'.green.bold);
      }
    });
  };

};

cliOk.init = function (done) {
  var app = this;

  app.log.info('Welcome to ' + app.name.grey);
  app.log.info('It worked if it ends with ' + app.name.grey + ' ' + 'ok'.green.bold);

  done();
};


text:
<TITLE>Review for City of Hope (1991)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

City of Hope (1991)

reviewed by
Shane Burridge

City of Hope (1991) 129m.

Mosaic by John Sayles is reflective of his versatility by virtue of
its multifarious nature.  Sayles, a writer-director-actor-editor,
makes pains to experiment with as wide a genre and mood available to
him in the landscape of commercial cinema.  At first glance, CITY OF
HOPE might seem his most 'ordinary': a story of the effect of corrupt
politics and business on different socio-economic levels.
Straightforward enough, but Sayles wants to provide as broad a
spectrum as possible into his two-hour running time, so his constantly
mobile camera drifts in and out of the lives of a huge cast of
characters.  Some provide subplots that rhizomically link together;
some nudge each other in passing; yet others function only as
incidental bystanders.  It's a great dance that Sayles choreographs -
he obviously finds enjoyment in the immeasurable ways in which people
affect each others' lives.  CITY OF HOPE has obvious parallels with
Robert Altman efforts like NASHVILLE and SHORT CUTS, but Sayles'
approach touches base on a more human level.  His characters are for
the most part plain speaking and down to earth, and get an equal
amount of screen time (Vincent Spano has a little more than the rest
of the thirty-plus cast, giving him the film's nominal lead role).

It seems an obvious idea to tell the story of a city by using a
plenitude of voices instead of a sole representative one, but there
aren't many films like this one around.  Sayles shows us that it is
this chorus that unites to provide the one voice of the city itself .
In CITY OF HOPE the people take center stage: the city has no name;
its streets are simply named after letters of the alphabet; we never
see an establishing shot of the city; much of the story is filmed at
street level (when we do see a view out of a high-rise, it's only of
the building opposite); the characters all work in service of the city
to keep its various mechanisms in running order.  When Spano quits his
construction job in the film's opening scene, he is setting himself up
for a fall: without any useful function for the city he automatically
becomes expendable - he fails to emulate the example of several other
characters who want to be recognized as separate identities in their
community (Sayles has everyone use each other's first name
repeatedly).  It's hard to tell if this is a city of hope or a city of
hopelessness - because of its unfixity it best serves as allegory.
Like the building left unfinished halfway through the story, the
separate storylines remain largely unresolved.  Sayles gets away with
this by treating them in such a fragmentary manner that we don't
really expect all the loose ends to tie up anyhow.  Film's last shot
is inspired - it may linger in your memory for days afterwards.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package org.apache.airavata.workflow.core.dag.edge;

import org.apache.airavata.model.EdgeModel;
import org.apache.airavata.workflow.core.dag.port.InPort;
import org.apache.airavata.workflow.core.dag.port.OutPort;

public class DirectedEdge implements Edge {

    private InPort toPort;
    private OutPort fromPort;
    private EdgeModel edgeModel;

    public DirectedEdge(EdgeModel edgeModel) {
        this.edgeModel = edgeModel;
    }

    @Override
    public String getId() {
        return getEdgeModel().getEdgeId();
    }

    @Override
    public void setEdgeModel(EdgeModel edgeModel) {
        this.edgeModel = edgeModel;
    }

    @Override
    public EdgeModel getEdgeModel() {
        return edgeModel;
    }

    @Override
    public InPort getToPort() {
        return toPort;
    }

    @Override
    public void setToPort(InPort inPort) {
        this.toPort = inPort;
    }

    @Override
    public OutPort getFromPort() {
        return fromPort;
    }

    @Override
    public void setFromPort(OutPort outPort) {
        this.fromPort = outPort;
    }
}


text:
select  *  from db_class where class_name = 'db_ha_apply_info';
select attr_name, class_name from db_attribute where class_name = 'db_ha_apply_info' order by 1;


text:
package org.apache.causeway.viewer.restfulobjects.client;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.apache.causeway.viewer.restfulobjects.client.log.ClientConversationFilter;

import lombok.Data;

/**
 * @since 2.0 {@index}
 */
@XmlRootElement(name="restful-client-config")
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class RestfulClientConfig {

    @XmlElement(name="restfulBase")
    private String restfulBase;

    @XmlElement(name="useBasicAuth")
    private boolean useBasicAuth;

    @XmlElement(name="restfulAuthUser")
    private String restfulAuthUser;

    @XmlElement(name="restfulAuthPassword")
    private String restfulAuthPassword;

    @XmlElement(name="useRequestDebugLogging")
    private boolean useRequestDebugLogging;

    @XmlTransient
    private List<ClientConversationFilter> clientConversationFilters = new ArrayList<>();

}


text:
<!DOCTYPE html>

    <title>languages</title>
    <link rel="stylesheet" type="text/css" href="style.css" />

    Programing languages like PHP, Java Script, C# and Java are general-purpose.


text:
package com.vmware.spring.workshop.facade.support.marshal;

import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.Assert;

/**
 * @author lgoldstein
 */
public class JaxbPackagesMarshaller extends AbstractJAXBContextMarshaller {
    private final Set<String>    _packages;
    private final JAXBContext    _jaxbContext;

    public JaxbPackagesMarshaller(final String ... packages) throws JAXBException {
        Assert.state(!ArrayUtils.isEmpty(packages), "No packages specified");
        Assert.noNullElements(packages, "Null packages specified");

        final String    contextPath=StringUtils.join(packages, ':');
        Assert.hasText(contextPath, "Empty context path");
        Assert.state(!contextPath.contains("::"), "Empty context packages");

        _jaxbContext = JAXBContext.newInstance(contextPath);
        _packages = Collections.unmodifiableSet(new TreeSet<String>(Arrays.asList(packages)));
    }

    public final Set<String> getContextPackages () {
        return _packages;
    }

    @Override
    public boolean supports(final Class<?> clazz) {
        final Package        pkg=(clazz == null) ? null : clazz.getPackage();
        final String        pkgName=(pkg == null) ? null : pkg.getName();
        final Set<String>    ctxPackages=getContextPackages();
        if (StringUtils.isBlank(pkgName)
         || CollectionUtils.isEmpty(ctxPackages)
         || (!ctxPackages.contains(pkgName)))
            return false;    // debug breakpoint
        else
            return true;
    }

    @Override
    public JAXBContext getJAXBContext() throws JAXBException {
        return _jaxbContext;
    }

    @Override
    public String toString() {
        return String.valueOf(_packages);
    }
}


text:
<?php

interface PhabricatorSubscribableInterface {

  /**
   * Return true to indicate that the given PHID is automatically subscribed
   * to the object (for example, they are the author or in some other way
   * irrevocably a subscriber). This will, e.g., cause the UI to render
   * "Automatically Subscribed" instead of "Subscribe".
   *
   * @param PHID  PHID (presumably a user) to test for automatic subscription.
   * @return bool True if the object/user is automatically subscribed.
   */
  public function isAutomaticallySubscribed($phid);

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN"
        "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
    <security-role-mapping>
        <role-name>administrator</role-name>
        <principal-name>user1</principal-name>
    </security-role-mapping>
    <security-role-mapping>
        <role-name>manager</role-name>
        <principal-name>user2</principal-name>
    </security-role-mapping>
    <class-loader delegate="true"/>
    <jsp-config>
        <property name="keepgenerated" value="true">
            <description>Keep a copy of the generated servlet class' java code.</description>
        </property>
    </jsp-config>
</glassfish-web-app>


text:
package org.ovirt.engine.ui.uicommonweb.models.hosts;

import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.compat.PropertyChangedEventArgs;
import org.ovirt.engine.core.compat.StringFormat;
import org.ovirt.engine.ui.uicommonweb.models.events.EventListModel;

@SuppressWarnings("unused")
public class HostEventListModel extends EventListModel
{

    @Override
    public VDS getEntity()
    {
        return (VDS) super.getEntity();
    }

    public void setEntity(VDS value)
    {
        super.setEntity(value);
    }

    @Override
    protected void onEntityContentChanged()
    {
        super.onEntityContentChanged();

        if (getEntity() != null)
        {
            getSearchCommand().Execute();
        }
        else
        {
            setItems(null);
        }
    }

    @Override
    public void Search()
    {
        if (getEntity() != null)
        {
            setSearchString(StringFormat.format("events: host.name=%1$s", getEntity().getvds_name())); //$NON-NLS-1$
            super.Search();
        }
    }

    @Override
    protected void EntityPropertyChanged(Object sender, PropertyChangedEventArgs e)
    {
        super.EntityPropertyChanged(sender, e);

        if (e.PropertyName.equals("vds_name")) //$NON-NLS-1$
        {
            getSearchCommand().Execute();
        }
    }
}


text:
@interface UIImageView (RotationAnimation)
-(void) addRotationClockWise:(int)duration andAngle:(double) angle andRepeat:(int) repeatCount;

-(void) addRotationAntiClockWise:(int)duration andAngle:(double) angle andRepeat:(int) repeatCount;
@end


text:
using Bebbs.Harmonize.With.Component;

namespace Bebbs.Harmonize.With.Owl.Intuition.Gateway.Entity
{
    public interface IGatewayActionable : IActionable
    {
    }
}


text:
{
  var root = node.shadowRoot;

  while (root) {
    forSubtree(root, cb);
    root = root.olderShadowRoot;
  }
}


text:
<?php

if (!$info['title'])
    $info['title'] = sprintf('%s: %s', __('Delete User'), Format::htmlchars($user->getName()));

$info['warn'] = __('Deleted users and tickets CANNOT be recovered');

?>

<?php echo $info['title']; ?>

<?php

if ($info['error']) {
    echo sprintf('
%s
', $info['error']);
} elseif ($info['warn']) {
    echo sprintf('
%s
', $info['warn']);
} elseif ($info['msg']) {
    echo sprintf('
%s
', $info['msg']);
} ?>

<?php
if ($user) { ?>

    <?php echo $user->getAvatar(); ?>

<?php
}
else { ?>

<?php
}
    // TODO: Implement change of ownership
    if (0 && $user->getNumTickets()) { ?>
    <a class="action-button pull-right change-user" style="overflow:inherit"
        href="#users/<?php echo $user->getId(); ?>/replace" > <?php echo __('Change Tickets Ownership'); ?>
    <?php
    } ?>

 <?php echo Format::htmlchars($user->getName()->getOriginal()); ?>

<<?php echo $user->getEmail(); ?>>

<?php foreach ($user->getDynamicData() as $entry) {
?>

<?php
         echo $entry->getTitle(); ?>

<?php foreach ($entry->getAnswers() as $a) { ?>

<?php echo Format::htmlchars($a->getField()->get('label'));
         ?>:
    <?php echo $a->display(); ?>

<?php }
}
?>

    <form method="post" class="user"
        action="#users/<?php echo $user->getId(); ?>/delete">
        <input type="hidden" name="id" value="<?php echo $user->getId(); ?>" />

    <?php
    if (($num=$user->tickets->count())) {
        echo '
<input type="checkbox" name="deletetickets" value="1" > '
            .sprintf(__('Delete %1$s %2$s %3$s and any associated attachments and data.'),
                sprintf('',
                    $user->getId()),
                sprintf(_N('one ticket', '%d tickets', $num), $num),
                ''
            )
            .'

';
    }
    ?>

            <input type="reset" value="<?php echo __('Reset'); ?>">
            <input type="button" name="cancel" class="close"
                value="<?php echo __('No, Cancel'); ?>">

            <input type="submit" value="<?php echo __('Yes, Delete User'); ?>">

    </form>


text: from traitsui.wx.image_slice import *


text:
This is the application behind http://contributors.rubyonrails.org.

## System dependencies

MySQL, cmake (o compile rugged).

## How to run the tests

Use the setup script to configure your application to be able to run the tests:

```
bin/setup
```

After this you can use the Rails rake tasks:

```
bin/rake test
```

## License

Released under the MIT License, Copyright (c) 2012–<i>ω</i> Xavier Noria.


text:
/* File: utility_test.h
Unit tests for utility functions.

See Also:
	<utility.h>
*/

#include "cmockery.h"
#include <stdlib.h>
#include <string.h>

#include "utility.h"

/* Function: create_table
Setup function to create a table with test data

The following symbols are defined:
	- foo => foobar
	- ham => eggs and ham
	- _eggs => chickens

Parameters:
	table - A reference to the address where the table should be stored.
*/
void create_table(void **table)
{
	symbol_t *symbol;
	*table = table_new();

	symbol = symbol_new("foo");
	symbol_set_string(symbol, "foobar");
	table_insert(*table, symbol);
	symbol_release(symbol);

	symbol = symbol_new("ham");
	symbol_set_string(symbol, "eggs and ham");
	table_insert(*table, symbol);
	symbol_release(symbol);

	symbol = symbol_new("_eggs");
	symbol_set_string(symbol, "chickens");
	table_insert(*table, symbol);
	symbol_release(symbol);
}

/* Function: table_release
A teardown function to release a table created in create_table()

Parameters:
	table - A reference to the address where the table is stored
*/
void release_table(void **table)
{
	table_release(*table);
}

void test_unquote_simple_string(void **state)
{
	char string[] = "\"foo bar spam eggs ham\"";
	char *parsed = sh_unquote(string);
	assert_string_equal(parsed, "foo bar spam eggs ham");
	free(parsed);
}

void test_unquote_subsequenctly_quoted(void **state)
{
	char string[] = "foo \"bar spam\" eggs ham";
	char *parsed = sh_unquote(string);
	assert_string_equal(parsed, "foo \"bar spam\" eggs ham");
	free(parsed);
}

void test_split_array(void **state)
{
	char *array1 = "(foo bar spam eggs ham)";
	char *array2 = "(spam \"eggs ham\")";
	char **parsed;

	parsed = sh_split_array(array1);
	assert_string_equal(parsed[0], "foo");
	assert_string_equal(parsed[2], "spam");
	assert_string_equal(parsed[4], "ham");
	free(parsed[0]);
	free(parsed[1]);
	free(parsed[2]);
	free(parsed[3]);
	free(parsed[4]);
	free(parsed);

	parsed = sh_split_array(array2);
	assert_string_equal(parsed[1], "\"eggs ham\"");
	free(parsed[0]);
	free(parsed[1]);
	free(parsed);
}

/* TODO: What is expected if an invalid expansion like '${foo' is attempted?
 * Bash returns a "bad substitution" error. This behaviour has to be
 * implemented in the lexer. */
void test_sh_parse_array_simple_expanded(void **table)
{
	char *array = "(${foo} spam \"green $ham\")";
	char **parsed;
	char **ptr;

	parsed = sh_parse_array(*table, array);
	assert_true(parsed != NULL);
	assert_string_equal(parsed[0], "foobar");
	assert_string_equal(parsed[1], "spam");
	assert_string_equal(parsed[2], "green eggs and ham");

	for(ptr = parsed; *ptr != NULL; ptr++) {
		free(*ptr);
	}
	free(parsed);
}


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

<!--
  Copyright 2019 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      https://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/cat_picker_negative_button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="@dimen/cat_picker_demo_padding"
    android:orientation="vertical">

  <TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/cat_picker_negative_button"
      android:textAppearance="?attr/textAppearanceTitleLarge"/>
  <RadioGroup
      android:id="@+id/cat_picker_negative_button_group"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
    <RadioButton
        android:id="@+id/cat_picker_negative_button_default"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="@string/cat_picker_negative_button_default"
        android:textAppearance="?attr/textAppearanceBodyLarge"/>
    <RadioButton
        android:id="@+id/cat_picker_negative_button_custom"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/cat_picker_demo_padding"
        android:layout_marginLeft="@dimen/cat_picker_demo_padding"
        android:text="@string/cat_picker_negative_button_custom"
        android:textAppearance="?attr/textAppearanceBodyLarge"/>

  </RadioGroup>
</LinearLayout>


text:
using std::string;
using std::vector;

TEST_CASE( "splitting strings" ) {
    SECTION( "one word length" ) {
        string line = "baba";
        REQUIRE(splitline(line).size() == 1);
        REQUIRE(splitline(line)[0] == "baba");
    }
    SECTION( "two word length" ) {
        string line = "baba alibaba";
        REQUIRE(splitline(line).size() == 2);
        REQUIRE(splitline(line)[0] == "baba");
        REQUIRE(splitline(line)[1] == "alibaba");
    }
    SECTION( "two word multispace" ) {
        string line = "baba        alibaba";
        REQUIRE(splitline(line).size() == 2);
        REQUIRE(splitline(line)[0] == "baba");
        REQUIRE(splitline(line)[1] == "alibaba");
    }
}

TEST_CASE( "bracketing" ) {
    REQUIRE(bracketed("<>"));
    REQUIRE(bracketed("<fdfd>"));
    REQUIRE(!bracketed("<fdfdfd"));
    REQUIRE(!bracketed("!!>"));
    REQUIRE(!bracketed("gfg"));
    REQUIRE(!bracketed(""));
}


text:
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.llvm.Conventions \
// RUN:   -std=c++14 -verify  %s

#include "Inputs/system-header-simulator-cxx.h"

//===----------------------------------------------------------------------===//
// Forward declarations for StringRef tests.
//===----------------------------------------------------------------------===//

using size_type = size_t;

namespace std {

template <class T>
struct numeric_limits { const static bool is_signed; };

} // end of namespace std

namespace llvm {

template <class T>
struct iterator_range;

template <class Func>
struct function_ref;

struct hash_code;

template <class T>
struct SmallVectorImpl;

struct APInt;

class StringRef {
public:
  static const size_t npos = ~size_t(0);
  using iterator = const char *;
  using const_iterator = const char *;
  using size_type = size_t;

  /*implicit*/ StringRef() = default;
  StringRef(std::nullptr_t) = delete;
  /*implicit*/ StringRef(const char *Str);
  /*implicit*/ constexpr StringRef(const char *data, size_t length);
  /*implicit*/ StringRef(const std::string &Str);

  static StringRef withNullAsEmpty(const char *data);
  iterator begin() const;
  iterator end() const;
  const unsigned char *bytes_begin() const;
  const unsigned char *bytes_end() const;
  iterator_range<const unsigned char *> bytes() const;
  const char *data() const;
  bool empty() const;
  size_t size() const;
  char front() const;
  char back() const;
  template <typename Allocator>
  StringRef copy(Allocator &A) const;
  bool equals(StringRef RHS) const;
  bool equals_lower(StringRef RHS) const;
  int compare(StringRef RHS) const;
  int compare_lower(StringRef RHS) const;
  int compare_numeric(StringRef RHS) const;
  unsigned edit_distance(StringRef Other, bool AllowReplacements = true,
                         unsigned MaxEditDistance = 0) const;
  std::string str() const;
  char operator[](size_t Index) const;
  template <typename T>
  typename std::enable_if<std::is_same<T, std::string>::value,
                          StringRef>::type &
  operator=(T &&Str) = delete;
  operator std::string() const;
  bool startswith(StringRef Prefix) const;
  bool startswith_lower(StringRef Prefix) const;
  bool endswith(StringRef Suffix) const;
  bool endswith_lower(StringRef Suffix) const;
  size_t find(char C, size_t From = 0) const;
  size_t find_lower(char C, size_t From = 0) const;
  size_t find_if(function_ref<bool(char)> F, size_t From = 0) const;
  size_t find_if_not(function_ref<bool(char)> F, size_t From = 0) const;
  size_t find(StringRef Str, size_t From = 0) const;
  size_t find_lower(StringRef Str, size_t From = 0) const;
  size_t rfind(char C, size_t From = npos) const;
  size_t rfind_lower(char C, size_t From = npos) const;
  size_t rfind(StringRef Str) const;
  size_t rfind_lower(StringRef Str) const;
  size_t find_first_of(char C, size_t From = 0) const;
  size_t find_first_of(StringRef Chars, size_t From = 0) const;
  size_t find_first_not_of(char C, size_t From = 0) const;
  size_t find_first_not_of(StringRef Chars, size_t From = 0) const;
  size_t find_last_of(char C, size_t From = npos) const;
  size_t find_last_of(StringRef Chars, size_t From = npos) const;
  size_t find_last_not_of(char C, size_t From = npos) const;
  size_t find_last_not_of(StringRef Chars, size_t From = npos) const;
  bool contains(StringRef Other) const;
  bool contains(char C) const;
  bool contains_lower(StringRef Other) const;
  bool contains_lower(char C) const;
  size_t count(char C) const;
  size_t count(StringRef Str) const;
  template <typename T>
  typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
  getAsInteger(unsigned Radix, T &Result) const;
  template <typename T>
  typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
  getAsInteger(unsigned Radix, T &Result) const;
  template <typename T>
  typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
  consumeInteger(unsigned Radix, T &Result);
  template <typename T>
  typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
  consumeInteger(unsigned Radix, T &Result);
  bool getAsInteger(unsigned Radix, APInt &Result) const;
  bool getAsDouble(double &Result, bool AllowInexact = true) const;
  std::string lower() const;
  std::string upper() const;
  StringRef substr(size_t Start, size_t N = npos) const;
  StringRef take_front(size_t N = 1) const;
  StringRef take_back(size_t N = 1) const;
  StringRef take_while(function_ref<bool(char)> F) const;
  StringRef take_until(function_ref<bool(char)> F) const;
  StringRef drop_front(size_t N = 1) const;
  StringRef drop_back(size_t N = 1) const;
  StringRef drop_while(function_ref<bool(char)> F) const;
  StringRef drop_until(function_ref<bool(char)> F) const;
  bool consume_front(StringRef Prefix);
  bool consume_back(StringRef Suffix);
  StringRef slice(size_t Start, size_t End) const;
  std::pair<StringRef, StringRef> split(char Separator) const;
  std::pair<StringRef, StringRef> split(StringRef Separator) const;
  std::pair<StringRef, StringRef> rsplit(StringRef Separator) const;
  void split(SmallVectorImpl<StringRef> &A,
             StringRef Separator, int MaxSplit = -1,
             bool KeepEmpty = true) const;
  void split(SmallVectorImpl<StringRef> &A, char Separator, int MaxSplit = -1,
             bool KeepEmpty = true) const;
  std::pair<StringRef, StringRef> rsplit(char Separator) const;
  StringRef ltrim(char Char) const;
  StringRef ltrim(StringRef Chars = " \t\n\v\f\r") const;
  StringRef rtrim(char Char) const;
  StringRef rtrim(StringRef Chars = " \t\n\v\f\r") const;
  StringRef trim(char Char) const;
  StringRef trim(StringRef Chars = " \t\n\v\f\r") const;
};

inline bool operator==(StringRef LHS, StringRef RHS);
inline bool operator!=(StringRef LHS, StringRef RHS);
inline bool operator<(StringRef LHS, StringRef RHS);
inline bool operator<=(StringRef LHS, StringRef RHS);
inline bool operator>(StringRef LHS, StringRef RHS);
inline bool operator>=(StringRef LHS, StringRef RHS);
inline std::string &operator+=(std::string &buffer, StringRef string);
hash_code hash_value(StringRef S);

} // end of namespace llvm

//===----------------------------------------------------------------------===//
// Tests for StringRef.
//===----------------------------------------------------------------------===//

void temporarayStringToStringRefAssignmentTest() {
  // TODO: Emit a warning.
  llvm::StringRef Ref = std::string("Yimmy yummy test.");
}

void assigningStringToStringRefWithLongerLifetimeTest() {
  llvm::StringRef Ref;
  {
    // TODO: Emit a warning.
    std::string TmpStr("This is a fine string.");
    Ref = TmpStr;
  }
}

std::string getTemporaryString() {
  return "One two three.";
}

void assigningTempStringFromFunctionToStringRefTest() {
  // TODO: Emit a warning.
  llvm::StringRef Ref = getTemporaryString();
}

//===----------------------------------------------------------------------===//
// Forward declaration for Clang AST nodes.
//===----------------------------------------------------------------------===//

namespace llvm {

template <class T, int Size>
struct SmallVector {};

} // end of namespace llvm

namespace clang {

struct Type;
struct Decl;
struct Stmt;
struct Attr;

} // end of namespace clang

//===----------------------------------------------------------------------===//
// Tests for Clang AST nodes.
//===----------------------------------------------------------------------===//

namespace clang {

struct Type {
  std::string str; // expected-warning{{AST class 'Type' has a field 'str' that allocates heap memory (type std::string)}}
};

} // end of namespace clang

namespace clang {

struct Decl {
  llvm::SmallVector<int, 5> Vec; // expected-warning{{AST class 'Decl' has a field 'Vec' that allocates heap memory (type llvm::SmallVector<int, 5>)}}
};

} // end of namespace clang


text: Go subscriber for vicon ros system


text:
package com.gizrak.ebook.db;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.gizrak.ebook.R;

public class ChaekHelper extends SQLiteOpenHelper {

	private static final int DATABASE_VERSION = 7;
	private static final String DATABASE_NAME = "chaek.db";

	private List<Map<String, String>> ALL_TABLES = new ArrayList<Map<String, String>>();

	/**
	 * Create a helper object for the Events database
	 *
	 * @param context
	 */
	public ChaekHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);

		this.onSetCreateQuery(context);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// Create Table
		for (int i = 0; i < ALL_TABLES.size(); i++) {
			db.execSQL("CREATE TABLE IF NOT EXISTS " + ALL_TABLES.get(i).get("TABLE_NAME") + " ( "
					+ ALL_TABLES.get(i).get("FIELD_NAME") + " );");
		}

		// create Index table
		db.execSQL("DROP TABLE IF EXISTS dual;");
		db.execSQL("CREATE TABLE dual (idx INTEGER PRIMARY KEY, rownum TEXT);");
		db.execSQL("CREATE UNIQUE INDEX idx_rownum ON dual (rownum);");

		// create all tables
		db.beginTransaction();
		try {
			for (int i = 1; i < 100; i++) {
				String idxStr = "0" + i;
				if (i > 9)
					idxStr = idxStr.substring(1);

				db.execSQL("INSERT INTO dual (idx, rownum) VALUES (" + i + ",'" + idxStr + "');");
			}
			db.setTransactionSuccessful();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			db.endTransaction();
		}
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		for (int i = 0; i < ALL_TABLES.size(); i++) {
			db.execSQL("DROP TABLE IF EXISTS " + ALL_TABLES.get(i).get("TABLE_NAME") + ";");
		}
		onCreate(db);
	}

	/**
	 * To Create new Table,

	 *

	 *
Define a new [TABLE_NAME]&[FIELD_NAME] in
	 * /ROOT/res/values/database.xml File,
	 *
Add a new [TABLE_NAME]&[FIELD_NAME] in ALL_TABLES to below Method.
	 *
Update the DATABASE_VERSION value (+1)
	 *

	 *
	 * @param context
	 */
	private void onSetCreateQuery(Context context) {
		Map<String, String> params;

		// 1. BOOK
		params = new HashMap<String, String>();
		params.put("TABLE_NAME", context.getResources().getString(R.string.BOOK_TBL_NAME));
		params.put("FIELD_NAME", context.getResources().getString(R.string.BOOK_TBL_FIELDS));
		ALL_TABLES.add(params);

		// 2. TOC
		params = new HashMap<String, String>();
		params.put("TABLE_NAME", context.getResources().getString(R.string.TOC_TBL_NAME));
		params.put("FIELD_NAME", context.getResources().getString(R.string.TOC_TBL_FIELDS));
		ALL_TABLES.add(params);

		// 3. BOOKMARK
		params = new HashMap<String, String>();
		params.put("TABLE_NAME", context.getResources().getString(R.string.BM_TBL_NAME));
		params.put("FIELD_NAME", context.getResources().getString(R.string.BM_TBL_FIELDS));
		ALL_TABLES.add(params);
	}
}


text:
class Admin < ActiveRecord::Base
  acts_as_stream :activity_attr => :guid, :activity_scope => :actions, :mentions_scope => :notifications
  acts_as_amico
  validates_uniqueness_of :guid
  validates_presence_of :guid

  def all_followers
    get_all(:followers).map{|id| User.find(id.to_i)}.map{|u| u.following_key}
  end

end


text:
#include "parser.h"

Parser::Parser()
{
}

Parser &Parser::addSymbol(const Symbol &symbol)
{
   symbols.push_back(symbol);

   return *this;
}

const Symbol *Parser::findSymbol(const std::string &value) const
{
    for (auto &symbol: symbols) {
        if (symbol.value == value || symbol.value2 == value) {
            return &symbol;
        }
    }

   return nullptr;
}

Symbol Parser::stringToSymbol(const std::string &value) const
{
    auto found = findSymbol(value);
    return found == nullptr
        ? Symbol(value, Symbol::NUMBER, 0, "")
        : *found;
}

Parser &Parser::parse(const std::string &parsed_string, const std::string &separators)
{
   this->parsed_string = parsed_string;

   size_t nPos = parsed_string.find_first_not_of(separators, 0);
   size_t nEndPos;

   elements.clear();

   while (nPos != std::string::npos && (nEndPos = parsed_string.find_first_of(separators, nPos)) != std::string::npos)
   {
      elements.push_back(stringToSymbol(parsed_string.substr(nPos, nEndPos - nPos)));
      nPos = parsed_string.find_first_not_of(separators, nEndPos);
   }

   if (nPos != std::string::npos)
      elements.push_back(stringToSymbol(parsed_string.substr(nPos)));

   return *this;
}

Parser getDefaultParser()
{
    Parser parser;

    /* arithmetic operators */
    parser.addSymbol(Symbol::Addition).addSymbol(Symbol::Division).addSymbol(Symbol::Multiplication).addSymbol(Symbol::Substraction).addSymbol(Symbol::Modulo).addSymbol(Symbol::Power);
    /* comparison operators */
    parser.addSymbol(Symbol::Equal).addSymbol(Symbol::Equal2).addSymbol(Symbol::NotEqual).addSymbol(Symbol::Inferior).addSymbol(Symbol::InferiorStrict).addSymbol(Symbol::Superior).addSymbol(Symbol::SuperiorStrict);
    /* logic operators */
    parser.addSymbol(Symbol::And).addSymbol(Symbol::Or).addSymbol(Symbol::AndNot).addSymbol(Symbol::Xor);
    /* unsigned binary operators */
    parser.addSymbol(Symbol::AndUB).addSymbol(Symbol::OrUB).addSymbol(Symbol::XorUB).addSymbol(Symbol::NegateUB).addSymbol(Symbol::PosShiftUB).addSymbol(Symbol::NegShiftUB);
    /* signed binary operators */
    parser.addSymbol(Symbol::AndSB).addSymbol(Symbol::OrSB).addSymbol(Symbol::XorSB).addSymbol(Symbol::NegateSB).addSymbol(Symbol::PosShiftSB).addSymbol(Symbol::NegShiftSB);
    /* ternary operator */
    parser.addSymbol(Symbol::Interrogation);
    /* function */
    parser.addSymbol(Symbol::Abs).addSymbol(Symbol::Acos).addSymbol(Symbol::Asin).addSymbol(Symbol::Atan).addSymbol(Symbol::Cos).addSymbol(Symbol::Exp).addSymbol(Symbol::Log).addSymbol(Symbol::Sin).addSymbol(Symbol::Tan).addSymbol(Symbol::Min).addSymbol(Symbol::Max).addSymbol(Symbol::Clip);
    /* rounding */
    parser.addSymbol(Symbol::Round).addSymbol(Symbol::Floor).addSymbol(Symbol::Trunc).addSymbol(Symbol::Ceil);
    /* number */
    parser.addSymbol(Symbol::Pi);

    return parser;
}


text:
package com.kevin.agecalculator;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class AboutActivity extends AppCompatActivity {
    @BindView(R.id.toolbar) Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        ButterKnife.bind(this);

        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string name="leave_this_page">"Έξοδος από αυτή τη σελίδα"</string>
<string name="stay_on_this_page">"Παραμονή σε αυτή τη σελίδα"</string>
<string name="reload_this_page">"Εκ νέου φόρτωση αυτής της σελίδας"</string>
<string name="dont_reload_this_page">"Να μην γίνει επαναφ."</string>
<string name="js_modal_dialog_confirm">"OK"</string>
<string name="js_modal_dialog_cancel">"Ακύρωση"</string>
<string name="suppress_js_modal_dialogs">"Αποτροπή δημιουργίας πρόσθετων παραθύρων διαλόγου από αυτήν τη σελίδα"</string>
<string name="accessibility_js_modal_dialog_prompt">"Προτροπή"</string>
<string name="certtitle">"Πρόγραμμα προβ. πιστοποιητικού"</string>
<string name="sync_error_generic">"Σφάλμα συγχρονισμού"</string>
<string name="sync_error_ga">"Ενημερώστε τις λεπτομέρειες της σύνδεσής σας."</string>
<string name="sync_error_connection">"Δεν ήταν δυνατή η σύνδεση στον διακομιστή συγχρονισμού."</string>
<string name="sync_error_domain">"Η υπηρεσία συγχρονισμού δεν είναι διαθέσιμη για τον τομέα σας."</string>
<string name="sync_error_service_unavailable">"Η υπηρεσία δεν είναι διαθέσιμη. Δοκιμάστε ξανά αργότερα."</string>
<string name="policy_dialog_title">"Επιβεβαίωση σύνδεσης"</string>
<string name="policy_dialog_message">"Αυτός ο λογαριασμός τελεί υπό διαχείριση του %1$s.

Έχετε συνδεθεί με έναν διαχειριζόμενο λογαριασμό και παραχωρείτε τον έλεχγο διαχείρισής του μέσω του προφίλ σας Chrome. Τα δεδομένα σας Chrome θα συσχετιστούν μόνιμα με αυτόν το λογαριασμό. Η αποσύνδεση από αυτόν το λογαριασμό θα διαγράψει τα τοπικά δεδομένα Chrome."</string>
<string name="policy_dialog_proceed">"Αποδοχή και σύνδεση"</string>
<string name="policy_dialog_cancel">"Ακύρωση"</string>
<string name="wiping_profile_data_title">"Διαγραφή δεδομένων λογαριασμού"</string>
<string name="wiping_profile_data_message">"Περιμένετε…"</string>
<string name="infobar_close">"Κλείσιμο"</string>
<string name="translate_infobar_text">"This page is in ^1. Translate it to ^2?"</string>
<string name="translate_infobar_change_languages">"Change languages"</string>
<string name="translate_infobar_translation_done">"Translated to %1$s."</string>
<string name="translate_infobar_translation_more_options">"More"</string>
<string name="translate_infobar_translating">"Translating page to %1$s..."</string>
<string name="translate_infobar_error">"Oops. This page could not be translated."</string>
<string name="translate_always_text">"Always translate %1$s"</string>
<string name="translate_never_translate_message_text">"Would you like Google Chrome to offer to translate %1$s pages from this site next time?"</string>
<string name="translate_button">"Translate"</string>
<string name="translate_nope">"Nope"</string>
<string name="translate_show_original">"Show original"</string>
<string name="translate_retry">"Try again"</string>
<string name="translate_options_source_hint">"Page Language: ^1"</string>
<string name="translate_options_target_hint">"Translation Language: ^1"</string>
<string name="translate_button_done">"Done"</string>
<string name="translate_never_translate_site">"Never translate this site"</string>
<string name="translate_never_translate_language">"Never translate %1$s"</string>
</resources>