text:
String Pdb::Hex(adr_t a)
{
#ifdef CPU_64
	return Format64Hex(a);
#else
	return FormatIntHex(a);
#endif
}

void Pdb::Error()
{
	LLOG("ERROR: " << DeQtf(GetLastErrorMessage()));
	Exclamation("Error!&" + DeQtf(GetLastErrorMessage()));
	running = false;
	Stop();
}

void Pdb::UnloadModuleSymbols()
{
	for(int i = 0; i < module.GetCount(); i++) {
		ModuleInfo& f = module[i];
		if(f.symbols) {
			SymUnloadModule64(hProcess, f.base);
			LLOG("Unloaded symbols for " << f.path << ' ' << Hex(module[i].base) << '/' << hProcess);
		}
	}
}

int  Pdb::FindModuleIndex(adr_t base)
{
	for(int i = 0; i < module.GetCount(); i++)
		if(module[i].base == base)
			return i;
	return -1;
}

static Vector<String> test;

BOOL CALLBACK Pdb::EnumGlobals(PSYMBOL_INFO pSym, ULONG SymbolSize, PVOID UserContext)
{
//	LocalsCtx& c = *(GlobalsCtx *)UserContext;
	if(pSym->Tag == SymTagData)
		test.Add(pSym->Name);
	return TRUE;
}

void Pdb::LoadModuleInfo()
{
	ModuleInfo f;
	dword cb = 1;
	HMODULE  h;
	if(!EnumProcessModules(hProcess, &h, sizeof(HMODULE), &cb)) {
		Error();
		return;
	}
	int n = cb / sizeof(HMODULE);
	Buffer<HMODULE> m(n);
	if(!EnumProcessModules(hProcess, m, cb, &cb)) {
		Error();
		return;
	}
	Vector<ModuleInfo> nm;
	for (int i = 0; i < n; i++) {
		MODULEINFO mi;
		if(GetModuleInformation(hProcess, m[i], &mi, sizeof(mi))) {
			ModuleInfo& f = nm.Add();
			f.base = (adr_t)mi.lpBaseOfDll;
			f.size = mi.SizeOfImage;
			int q = FindModuleIndex(f.base);
			if(q >= 0) {
				ModuleInfo& of = module[q];
				f.path = of.path;
				f.symbols = of.symbols;
				of.symbols = false;
				LLOG("Stable " << FormatIntHex(f.base) << " (" << Hex(f.size) << "): " << f.path);
			}
			else {
				char name[MAX_PATH];
				if(GetModuleFileNameEx(hProcess, m[i], name, MAX_PATH)) {
					f.path = name;
					if(FileExists(ForceExt(f.path, ".pdb"))) {
						adr_t w = (adr_t)SymLoadModule64(hProcess, NULL, name, 0, f.base, f.size);
						if(w) {
							LLOG("Loading symbols " << Hex(f.base) << '/' << hProcess << " returned base " << FormatIntHex(w));
							f.symbols = true;
						#if 0
							TimeStop t;
						    SymEnumSymbols(hProcess, w, 0, &EnumGlobals, 0);
						#endif
						}
					}
				}
				LLOG(Hex(f.base) << " (" << Hex(f.size) << "): " << f.path);
			}
		}
	}
	UnloadModuleSymbols();
	module = nm;
	refreshmodules = false;
}

bool Pdb::AddBp(adr_t address)
{
	LLOG("AddBp: " << Hex(address));
	if(bp_set.Find(address) >= 0)
		return true;
	byte prev;
	if(!ReadProcessMemory(hProcess, (LPCVOID) address, &prev, 1, NULL))
		return false;
	LLOG("ReadProcessMemory OK");
	byte int3 = 0xcc;
	if(!WriteProcessMemory(hProcess, (LPVOID) address, &int3, 1, NULL))
		return false;
	LLOG("WriteProcessMemory OK");
	FlushInstructionCache (hProcess, (LPCVOID)address, 1);
	bp_set.Put(address, prev);
	return true;
}

bool Pdb::RemoveBp(adr_t address)
{
	int pos = bp_set.Find(address);
	if(pos < 0)
		return true;
	if(!WriteProcessMemory(hProcess, (LPVOID)address, &bp_set[pos], 1, NULL))
		return false;
	FlushInstructionCache(hProcess, (LPCVOID)address, 1);
	bp_set.Unlink(pos);
	return true;
}

bool Pdb::RemoveBp()
{
	for(int i = bp_set.GetCount(); --i >= 0;)
		if(!bp_set.IsUnlinked(i)) {
			adr_t address = bp_set.GetKey(i);
			if(!WriteProcessMemory(hProcess, (LPVOID)address, &bp_set[i], 1, NULL))
				return false;
			FlushInstructionCache(hProcess, (LPCVOID)address, 1);
			bp_set.Unlink(i);
		}
	bp_set.Clear();
	return true;
}

void Pdb::Lock()
{
	if(lock == 0) {
		IdeHidePtr();
		IdeDebugLock();
		watches.Disable();
		locals.Disable();
		framelist.Disable();
		dlock.Show();
		IdeSetBar();
	}
	lock++;
}

void Pdb::Unlock()
{
	lock--;
	if(lock == 0) {
		IdeDebugUnLock();
		watches.Enable();
		locals.Enable();
		framelist.Enable();
		dlock.Hide();
		IdeSetBar();
	}
}

void Pdb::AddThread(dword dwThreadId, HANDLE hThread)
{
	if(threads.Find(dwThreadId) >= 0)
		return;
	CONTEXT ctx;
	ctx.ContextFlags = CONTEXT_FULL;
	GetThreadContext(hThread, &ctx);
	Thread& f = threads.GetAdd(dwThreadId);
	#ifdef CPU_32
	f.sp = ctx.Esp;
	#else
	f.sp = ctx.Rsp;
	#endif
	f.hThread = hThread;
	LLOG("Adding thread " << dwThreadId << ", Thread SP: " << Hex(f.sp) << ", handle: " << FormatIntHex((dword)(hThread)));
}

void Pdb::RemoveThread(dword dwThreadId)
{
	int q = threads.Find(dwThreadId);
	if(q >= 0) {
		Thread& f = threads[q];
		LLOG("Closing thread " << dwThreadId << ", handle: " << FormatIntHex((dword)(f.hThread)));
		CloseHandle(f.hThread);
		threads.Remove(q);
	}
}

#define EXID(id)       { id, #id },

struct {
	adr_t code;
	const char *text;
}
ex_desc[] = {
	EXID(EXCEPTION_ACCESS_VIOLATION)
	EXID(EXCEPTION_ARRAY_BOUNDS_EXCEEDED)
	EXID(EXCEPTION_DATATYPE_MISALIGNMENT)
	EXID(EXCEPTION_FLT_DENORMAL_OPERAND)
	EXID(EXCEPTION_FLT_DIVIDE_BY_ZERO)
	EXID(EXCEPTION_FLT_INEXACT_RESULT)
	EXID(EXCEPTION_FLT_INVALID_OPERATION)
	EXID(EXCEPTION_FLT_OVERFLOW)
	EXID(EXCEPTION_FLT_STACK_CHECK)
	EXID(EXCEPTION_FLT_UNDERFLOW)
	EXID(EXCEPTION_ILLEGAL_INSTRUCTION)
	EXID(EXCEPTION_IN_PAGE_ERROR)
	EXID(EXCEPTION_INT_DIVIDE_BY_ZERO)
	EXID(EXCEPTION_INT_OVERFLOW)
	EXID(EXCEPTION_INVALID_DISPOSITION)
	EXID(EXCEPTION_NONCONTINUABLE_EXCEPTION)
	EXID(EXCEPTION_PRIV_INSTRUCTION)
	EXID(EXCEPTION_STACK_OVERFLOW )
};

void Pdb::RestoreForeground()
{
	if(hWnd) {
		SetForegroundWindow(hWnd);
		LLOG("Restored foreground window: " << FormatIntHex((dword)hWnd));
	}
	hWnd = NULL;
}

void Pdb::SaveForeground()
{
	HWND hwnd = GetForegroundWindow();
	if(hwnd) {
		DWORD pid;
		GetWindowThreadProcessId(hwnd, &pid);
		if(pid == processid) {
			hWnd = hwnd;
			LLOG("Saved foreground window: " << FormatIntHex((adr_t)hWnd));
		}
	}
}

bool Pdb::RunToException()
{
	LLOG("RUN TO EXCEPTION");
	TimeStop ts;
	bool disasfocus = disas.HasFocus();
	bool locked = false;
	bool frestored = false;
	invalidpage.Clear();
	mempage.Clear();
	int opn = 0;
	for(;;) {
		if(terminated) {
			if(locked)
				Unlock();
			return false;
		}
		opn++;
		if(WaitForDebugEvent(&event, 0)) {
			opn = 0;
			running = false;
			switch(event.dwDebugEventCode) {
			case EXCEPTION_DEBUG_EVENT: {
				SaveForeground();
				const EXCEPTION_RECORD& x = event.u.Exception.ExceptionRecord;
				if(x.ExceptionCode != EXCEPTION_BREAKPOINT && x.ExceptionCode != EXCEPTION_SINGLE_STEP) {
					if(event.u.Exception.dwFirstChance) {
						LLOG("First chance " << FormatIntHex(x.ExceptionCode));
						break;
					}
					String desc = Format("Exception: [* %X] at [* %08X]&",
					                     (int64)x.ExceptionCode, (int64)x.ExceptionAddress);
					for(int i = 0; i < __countof(ex_desc); i++)
						if(ex_desc[i].code == x.ExceptionCode)
							desc << "[* " << DeQtf(ex_desc[i].text) << "]&";
					if(x.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
						desc << (x.ExceptionInformation[0] ? "[*@3 writing]" : "[*@4 reading]");
						desc << Format(" at [* %08X]", (int)x.ExceptionInformation[1]);
					}
					PromptOK(desc);// better owner!!!
				}
				TopWindow *w = GetTopWindow();
				if(w && !w->IsForeground()) {
					LLOG("Setting theide as foreground");
					GetTopWindow()->SetForeground();
				}
				if(disasfocus)
					disas.SetFocus();
				if(locked)
					Unlock();
				if(refreshmodules)
					LoadModuleInfo();
				LLOG("event.dwThreadId = " << event.dwThreadId);
				for(int i = 0; i < threads.GetCount(); i++) {
					CONTEXT& c = threads[i].context;
					c.ContextFlags = CONTEXT_FULL;
					GetThreadContext(threads[i].hThread, &c);
					if(event.dwThreadId == threads.GetKey(i))
						context = c;
				}
				if(event.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT
				&& bp_set.Find((adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress) >= 0)
					#ifdef CPU_32
					context.Eip = (adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress;
					#else
					context.Rip = (adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress;
					#endif

				RemoveBp();
				LLOG("Exception: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionCode) <<
				     " at: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionAddress) <<
				     " first: " << event.u.Exception.dwFirstChance);
				return true;
			}
			case CREATE_THREAD_DEBUG_EVENT:
				LLOG("Create thread: " << event.dwThreadId);
				AddThread(event.dwThreadId, event.u.CreateThread.hThread);
				break;
			case EXIT_THREAD_DEBUG_EVENT:
				LLOG("Exit thread: " << event.dwThreadId);
				RemoveThread(event.dwThreadId);
				break;
			case CREATE_PROCESS_DEBUG_EVENT:
				LLOG("Create process: " << event.dwProcessId);
				processid = event.dwProcessId;
				AddThread(event.dwThreadId, event.u.CreateProcessInfo.hThread);
				CloseHandle(event.u.CreateProcessInfo.hFile);
				CloseHandle(event.u.CreateProcessInfo.hProcess);
				break;
			case EXIT_PROCESS_DEBUG_EVENT:
				LLOG("Exit process: " << event.dwProcessId);
				if(locked)
					Unlock();
				terminated = true;
				CleanupOnExit();
				if(ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE))
					LLOG("ContinueDebugEvent(EXIT_PROCESS_DEBUG_EVENT) -> OK");
				else
					LLOG("ContinueDebugEvent -> " << GetErrorMessage(GetLastError()));
				return false;
			case LOAD_DLL_DEBUG_EVENT: {
				LLOG("Load dll: " << event.u.LoadDll.lpBaseOfDll);
				CloseHandle(event.u.LoadDll.hFile);
				refreshmodules = true;
				break;
			}
			case UNLOAD_DLL_DEBUG_EVENT:
				LLOG("UnLoad dll: " << event.u.UnloadDll.lpBaseOfDll);
				refreshmodules = true;
				break;
			case RIP_EVENT:
				LLOG("RIP!");
				Exclamation("Process being debugged died unexpectedly!");
				terminated = true;
				if(locked)
					Unlock();
				return false;
			}
			ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_EXCEPTION_NOT_HANDLED);
			running = true;
		}
		if(ts.Elapsed() > 200) {
			if(!lock) {
				Lock();
				locked = true;
			}
			if(!frestored) {
				RestoreForeground();
				frestored = true;
			}
		}
		if(lock) {
			GuiSleep(opn < 1000 ? 0 : 100);
			Ctrl::ProcessEvents();
		}
		else
			Sleep(opn < 1000 ? 0 : 100);
	}
}

const CONTEXT& Pdb::CurrentContext()
{
	return threads.Get((int)~threadlist).context;
}

void Pdb::WriteContext(dword cf)
{
	context.ContextFlags = cf;
	HANDLE hThread = threads.Get(event.dwThreadId).hThread;
	SetThreadContext(hThread, &context);
}

bool Pdb::SingleStep()
{
	LLOG("SINGLE STEP 0");
	context.EFlags |= 0x100;
	WriteContext();
	running = true;
	ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE);
	if(!RunToException())
		return false;
	context.EFlags &= ~0x100;
	WriteContext();
	return true;
}

bool Pdb::Continue()
{
	running = true;
	ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE);
	return RunToException();
}

void Pdb::SetBreakpoints()
{
	RemoveBp();
	for(int i = 0; i < breakpoint.GetCount(); i++)
		AddBp(breakpoint[i]);
}

void Pdb::BreakRunning()
{
	stop = true;
	if(running) {
		BOOL (WINAPI *debugbreak)(HANDLE Process);
		debugbreak = (BOOL (WINAPI *)(HANDLE))
		             GetProcAddress(GetModuleHandle("kernel32.dll"), "DebugBreakProcess");
		if(debugbreak)
			(*debugbreak)(hProcess);
		else
			for(int i = 0; i < threads.GetCount(); i++) {
				HANDLE hThread = threads[i].hThread;
				SuspendThread(hThread);
				CONTEXT ctx;
				ctx.ContextFlags = CONTEXT_CONTROL;
				GetThreadContext(hThread, &ctx);
				ctx.EFlags |= 0x100;
				SetThreadContext(hThread, &ctx);
				GetThreadContext(hThread, &ctx);
				ResumeThread(hThread);
			}
	}
}

void Pdb::Stop()
{
	terminated = true;
}

bool Pdb::IsFinished()
{
	return terminated;
}

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<display-name></display-name>
	<servlet>
		<description>This is the description of my J2EE component</description>
		<display-name>This is the display name of my J2EE component</display-name>
		<servlet-name>P2PInvestServlet</servlet-name>
		<servlet-class>com.itcast.wh.P2PInvestServlet</servlet-class>
	</servlet>
	<servlet>
		<description>This is the description of my J2EE component</description>
		<display-name>This is the display name of my J2EE component</display-name>
		<servlet-name>LoginServlet</servlet-name>
		<servlet-class>com.itcast.wh.LoginServlet</servlet-class>
	</servlet>

	<servlet>
		<description>This is the description of my J2EE component</description>
		<display-name>This is the display name of my J2EE component</display-name>
		<servlet-name>ProductServlet</servlet-name>
		<servlet-class>com.itcast.wh.ProductServlet</servlet-class>
	</servlet>
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>IndexServlet</servlet-name>
    <servlet-class>com.itcast.wh.IndexServlet</servlet-class>
  </servlet>

	<servlet-mapping>
		<servlet-name>ProductServlet</servlet-name>
		<url-pattern>/product</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>P2PInvestServlet</servlet-name>
		<url-pattern>/test</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>LoginServlet</servlet-name>
		<url-pattern>/login</url-pattern>
	</servlet-mapping>
  <servlet-mapping>
    <servlet-name>IndexServlet</servlet-name>
    <url-pattern>/index</url-pattern>
  </servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
</web-app>

redpajama_set_name: RedPajamaGithub


text:
package com.xxzhwx.core.utils;

import java.io.ByteArrayOutputStream;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;
import java.util.zip.Inflater;

public final class ZipUtils {
    private static final int BUFFER_SIZE = 512;

    public static byte[] compress(byte[] input) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        Deflater deflater = new Deflater();
        deflater.setInput(input);
        deflater.finish();

        byte[] buf = new byte[BUFFER_SIZE];
        while (!deflater.finished()) {
            int numOfBytes = deflater.deflate(buf);
            bos.write(buf, 0, numOfBytes);
        }

        return bos.toByteArray();
    }

    public static byte[] decompress(byte[] input) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        Inflater inflater = new Inflater();
        inflater.setInput(input);

        try {
            byte[] buf = new byte[BUFFER_SIZE];
            while (!inflater.finished()) {
                int numOfBytes = inflater.inflate(buf);
                bos.write(buf, 0, numOfBytes);
            }
        } catch (DataFormatException e) {
            e.printStackTrace();
            return input;
        }

        return bos.toByteArray();
    }
}


text:
<!DOCTYPE html>
<meta charset="utf-8">

<html ng-app="geek-chef">
<head>
  <title>Hello World in AngularJS</title>
</head>
<bod>

<div ng-view></div>

<script src="node_modules/angular/angular.js"></script>
<script src="node_modules/angular-route/angular-route.js"></script>
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="app/services/RecipieListService.js"></script>
<script type="text/javascript" src="app/controllers/Recipie.js"></script>
</body>
</html>


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.Script.Serialization;
using Redmine.Net.Api.Types;
using Redmine.Net.Api.Extensions;

namespace Redmine.Net.Api.JSonConverters
{
    internal class IssueCustomFieldConverter : JavaScriptConverter
    {
        #region Overrides of JavaScriptConverter

        /// <summary>
        ///     When overridden in a derived class, converts the provided dictionary into an object of the specified type.
        /// </summary>
        /// <param name="dictionary">
        ///     An <see cref="T:System.Collections.Generic.IDictionary`2" /> instance of property data stored
        ///     as name/value pairs.
        /// </param>
        /// <param name="type">The type of the resulting object.</param>
        /// <param name="serializer">The <see cref="T:System.Web.Script.Serialization.JavaScriptSerializer" /> instance.</param>
        /// <returns>
        ///     The deserialized object.
        /// </returns>
        public override object Deserialize(IDictionary<string, object> dictionary, Type type,
            JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var customField = new IssueCustomField();

                customField.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                customField.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
                customField.Multiple = dictionary.GetValue<bool>(RedmineKeys.MULTIPLE);

                var val = dictionary.GetValue<object>(RedmineKeys.VALUE);

                if (val != null)
                {
                    if (customField.Values == null) customField.Values = new List<CustomFieldValue>();
                    var list = val as ArrayList;
                    if (list != null)
                    {
                        foreach (var value in list)
                        {
                            customField.Values.Add(new CustomFieldValue {Info = Convert.ToString(value)});
                        }
                    }
                    else
                    {
                        customField.Values.Add(new CustomFieldValue {Info = Convert.ToString(val)});
                    }
                }
                return customField;
            }

            return null;
        }

        /// <summary>
        ///     When overridden in a derived class, builds a dictionary of name/value pairs.
        /// </summary>
        /// <param name="obj">The object to serialize.</param>
        /// <param name="serializer">The object that is responsible for the serialization.</param>
        /// <returns>
        ///     An object that contains key/value pairs that represent the object's data.
        /// </returns>
        public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            var entity = obj as IssueCustomField;

            var result = new Dictionary<string, object>();

            if (entity == null) return result;
            if (entity.Values == null) return null;
            var itemsCount = entity.Values.Count;

            result.Add(RedmineKeys.ID, entity.Id);
            if (itemsCount > 1)
            {
                result.Add(RedmineKeys.VALUE, entity.Values.Select(x => x.Info).ToArray());
            }
            else
            {
                result.Add(RedmineKeys.VALUE, itemsCount > 0 ? entity.Values[0].Info : null);
            }

            return result;
        }

        /// <summary>
        ///     When overridden in a derived class, gets a collection of the supported types.
        /// </summary>
        public override IEnumerable<Type> SupportedTypes
        {
            get { return new List<Type>(new[] {typeof(IssueCustomField)}); }
        }

        #endregion
    }
}


text:
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace RiotSharp.Misc.Converters
{
    class TimeSpanConverterFromSeconds : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return objectType == typeof(int);
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var token = JToken.Load(reader);
            if (token.Value<int?>() != null)
            {
                return TimeSpan.FromSeconds(token.Value<int>());
            }
            return null;
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            serializer.Serialize(writer, (long)(((TimeSpan)value).TotalSeconds));
        }
    }
}


text:
package pacman.definition;

import pacman.ActivityWithResult;
import pacman.statements.ExistsInCollection;
import pacman.statements.ExistsInMap;

public class ExistsInDefinition extends ActivityWithResultDefinition {
	private InArgumentDefinition to;
	private InArgumentDefinition item;
	private InArgumentDefinition key;
	private boolean isMap;

	public ExistsInDefinition() {
		this("ExistsIn");
	}

	public ExistsInDefinition(String displayName) {
		super(displayName);
	}

	public ExistsInDefinition List(Object input) {
		this.to = DefinitionUtilities.parseInArgument(input);
		return this;
	}

	public ExistsInDefinition Map(Object input) {
		this.isMap = true;
		this.to = DefinitionUtilities.parseInArgument(input);
		return this;
	}

	public ExistsInDefinition Item(Object input) {
		this.item = DefinitionUtilities.parseInArgument(input);
		return this;
	}

	public ExistsInDefinition Key(Object input) {
		this.key = DefinitionUtilities.parseInArgument(input);
		return this;
	}

	@Override
	public ActivityWithResult internalToActivityWithResult(ActivityDefinition parent, DefinitionValidator validator) {
		if (this.to == null)
			validator.addError("Map or List not set");
		if (this.isMap && this.key == null)
			validator.addError("Key not set");
		if (!this.isMap && this.item == null)
			validator.addError("Item not set");
		if (validator.hasError())
			return null;

		if (this.isMap) {
			ExistsInMap map = new ExistsInMap();
			map.Map = this.to.toArgument(parent, validator);
			map.Key = this.key.toArgument(parent, validator);
			return map;
		}

		ExistsInCollection collection = new ExistsInCollection();
		collection.Collection = this.to.toArgument(parent, validator);
		collection.Item = this.item.toArgument(parent, validator);
		return collection;
	}

}


text:
//
//  bridgeHeader.h
//  WACustomSwitchExample
//
//  Created by Wendy Abrantes on 07/10/2015.
//  Copyright © 2015 ABRANTES DIGITAL LTD. All rights reserved.
//

#import <POP/POP.h>

#ifndef bridgeHeader_h
#define bridgeHeader_h

#endif /* bridgeHeader_h */


text:
package org.apache.uima.cas.impl;

import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.uima.UIMAFramework;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.internal.util.CopyOnWriteObjHashSet;
import org.apache.uima.internal.util.Misc;
import org.apache.uima.jcas.cas.TOP;

class FsIterator_bag<T extends FeatureStructure> extends FsIterator_singletype<T> {

  private static final AtomicInteger moveToCount = new AtomicInteger(0);

  protected CopyOnWriteObjHashSet<T> bag;
  final protected FsIndex_bag<T> fsBagIndex; // just an optimization, is == to fsLeafIndexImpl from
                                             // super class, allows dispatch w/o casting

  private int position = -1;

  private boolean isGoingForward = true;

  FsIterator_bag(FsIndex_bag<T> fsBagIndex, TypeImpl ti, CopyOnWriteIndexPart<T> cow_wrapper) {
    super(ti);
    this.fsBagIndex = fsBagIndex; // need for copy()
    bag = (CopyOnWriteObjHashSet<T>) cow_wrapper;
    moveToFirst();
  }

  @Override
  public boolean maybeReinitIterator() {
    if (!bag.isOriginal()) {
      bag = (CopyOnWriteObjHashSet<T>) fsBagIndex.getNonNullCow();
      return true;
    }
    return false;
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.FSIterator#isValid()
   */
  @Override
  public boolean isValid() {
    return (position >= 0) && (position < bag.getCapacity());
  }

  @Override
  public T getNvc() {
    // checkConcurrentModification();
    return (T) bag.get(position);
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.FSIterator#moveToFirst()
   */
  @Override
  public void moveToFirstNoReinit() {
    // resetConcurrentModification();
    isGoingForward = true;
    position = (bag.size() == 0) ? -1 : bag.moveToNextFilled(0);
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.FSIterator#moveToLast() If empty, make position -1 (invalid)
   */
  @Override
  public void moveToLastNoReinit() {
    // resetConcurrentModification();
    isGoingForward = false;
    position = (bag.size() == 0) ? -1 : bag.moveToPreviousFilled(bag.getCapacity() - 1);
  }

  @Override
  public void moveToNextNvc() {
    // checkConcurrentModification();
    isGoingForward = true;
    position = bag.moveToNextFilled(++position);
  }

  @Override
  public void moveToPreviousNvc() {
    // checkConcurrentModification();
    isGoingForward = false;
    position = bag.moveToPreviousFilled(--position);
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.FSIterator#moveTo(org.apache.uima.cas.FeatureStructure)
   */
  @Override
  public void moveToNoReinit(FeatureStructure fs) {
    // throw new UnsupportedOperationException("MoveTo operations for unordered iterators is not
    // supported");
    Misc.decreasingWithTrace(moveToCount,
            "MoveTo operations on iterators over Bag indexes are likely mistakes.",
            UIMAFramework.getLogger());
    // resetConcurrentModification();
    // for backwards compatibility
    position = bag.moveTo(fs);
    if (position >= 0) {
      if (getNvc() == null) {
        position = -1; // mark invalid
      }
    }
  }

  // public void moveToExactNoReinit(FeatureStructure fs) {
  // position = bag.moveTo(fs);
  // }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.FSIterator#copy()
   */
  @Override
  public FsIterator_bag<T> copy() {
    FsIterator_bag<T> copy = new FsIterator_bag<>(this.fsBagIndex, this.ti, bag);
    copyCommonSetup(copy);
    return copy;
  }

  protected void copyCommonSetup(FsIterator_bag<T> copy) {
    copy.position = position;
    copy.isGoingForward = isGoingForward;
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.impl.LowLevelIterator#ll_indexSize()
   */
  @Override
  public int ll_indexSizeMaybeNotCurrent() {
    return bag.size();
  }

  @Override
  public int ll_maxAnnotSpan() {
    return Integer.MAX_VALUE;
  }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.impl.LowLevelIterator#ll_getIndex()
   */
  @Override
  public LowLevelIndex<T> ll_getIndex() {
    return fsBagIndex;
  }

  // /* (non-Javadoc)
  // * @see org.apache.uima.cas.impl.FsIterator_singletype#getModificationCountFromIndex()
  // */
  // @Override
  // protected int getModificationCountFromIndex() {
  // return bag.getModificationCount();
  // }

  /*
   * (non-Javadoc)
   *
   * @see org.apache.uima.cas.impl.LowLevelIterator#isIndexesHaveBeenUpdated()
   */
  @Override
  public boolean isIndexesHaveBeenUpdated() {
    return bag != fsBagIndex.getCopyOnWriteIndexPart();
  }

  @Override
  public Comparator<TOP> getComparator() {
    return null; // not used for bag
  }

  @Override
  public int size() {
    return bag.size();
  }

}


text:
package tingyun

import (
	"encoding/json"
	"time"

	"github.com/TingYunAPM/go/utils/list"
)

type structActionTrace struct {
	name          string
	uri           string
	txId          string
	statusCode    uint16
	requestParams map[string]string
	customParams  map[string]interface{}
	time          timeRange
	components    list.List
}

func clearComponent(nlist *list.List) {
	for nlist.Size() > 0 {
		v, _ := nlist.PopFront()
		v.(*Component).destroy()
	}
}
func appendComponent(nlist *list.List, new_component *Component) {
	//  front                                               back
	//{time.begin:1}<-{time.begin:2}<-{time.begin:3}<-{time.begin:4}
	//
	for iter := nlist.Back(); !iter.IsEnd(); iter.MoveFront() {
		curr, _ := iter.Value()
		//新增项不早于当前项
		if !new_component.time.begin.Before(curr.(*Component).time.begin) {
			iter.InsertBack(new_component)
			iter.Destroy()
			return
		}
	}
	nlist.PushFront(new_component)
}

func (c *Component) appendSub(sub *Component) {
	appendComponent(&c.subs, sub)
}
func (a *structActionTrace) AddSegment(component *Component) {
	if component.pre == nil {
		appendComponent(&a.components, component)
	} else {
		component.pre.appendSub(component)
	}
}
func (a *structActionTrace) Empty() bool { return a.components.Size() == 0 }
func newStructActionTrace(time *timeRange, uri string, statusCode uint16) *structActionTrace {
	r := &structActionTrace{name: "", uri: uri, txId: "", statusCode: statusCode, requestParams: nil, customParams: nil, time: *time}
	r.components.Init()
	return r
}
func serialJson(components *list.List, begin time.Time, txid string) []interface{} {
	if components.Size() == 0 {
		return []interface{}{}
	}
	ret := make([]interface{}, components.Size())
	for i, it := 0, components.Front(); !it.IsEnd(); it.MoveBack() {
		v, _ := it.Value()
		ret[i] = v.(*Component).serialJson(begin, txid)
		i++
	}
	return ret
}
func (c *Component) serialJson(begin time.Time, txid string) interface{} {
	segment := make([]interface{}, 9)
	start := c.time.begin.Sub(begin) / time.Millisecond
	segment[0] = start
	segment[1] = start + c.time.duration/time.Millisecond
	segment[2] = c.metricName()
	segment[3] = c.getURL()
	segment[4] = 1
	segment[5], segment[6] = parseMethod(c.method)
	params := make(map[string]interface{})
	if c.callStack != nil {
		sql := c.getSQL()
		if sql != "" {
			params["sql"] = sql
		}
		params["stacktrace"] = c.callStack
	}
	if c.exId {
		params["externalId"] = c.unicId()
		params["txId"] = txid
		if len(c.txdata) > 0 {
			params["txData"] = c.txdata
		}
	}
	segment[7] = params
	segment[8] = serialJson(&c.subs, begin, txid)
	return segment
}
func (p *structActionTrace) Read() interface{} {
	var traceData [4]interface{}
	traceData[0] = p.time.begin.Unix()
	traceData[1] = p.requestParams
	traceData[2] = p.customParams
	var rootSegment [9]interface{}
	rootSegment[0] = 0
	rootSegment[1] = p.time.duration / time.Millisecond
	rootSegment[2] = ""
	rootSegment[3] = p.uri
	rootSegment[4] = 1
	rootSegment[5] = "Go"
	rootSegment[6] = "execute"
	rootSegment[7] = make(map[string]interface{})
	rootSegment[8] = serialJson(&p.components, p.time.begin, p.txId)
	traceData[3] = &rootSegment
	var traceItem [7]interface{}
	traceItem[0] = p.time.begin.Unix()
	traceItem[1] = p.time.duration / time.Millisecond
	traceItem[2] = p.name
	traceItem[3] = p.uri
	traceByte, _ := json.Marshal(&traceData)
	//traceData释放内存
	for i := 0; i < 4; i++ {
		traceData[i] = nil
	}
	for i := 0; i < 9; i++ {
		rootSegment[i] = nil
	}
	//traceData End
	traceString := string(traceByte)
	traceItem[4] = traceString
	traceItem[5] = p.txId
	traceItem[6] = md5sum(p.name + md5sum(traceString) + p.time.begin.String() + p.time.duration.String())

	return &traceItem
}
func formatList(components *list.List) time.Duration {
	ret := time.Duration(0)
	for it := components.Front(); !it.IsEnd(); it.MoveBack() {
		v, _ := it.Value()
		component := v.(*Component)
		ret += component.time.duration
		if component._type == ComponentDefault {
			component.aloneTime = component.time.duration - formatList(&component.subs)
			if component.aloneTime < 0 {
				component.aloneTime = 0
			}
		}
	}
	return ret
}
func segmentForEach(components *list.List, cb func(*Component)) {
	if components != nil {
		for it := components.Front(); !it.IsEnd(); it.MoveBack() {
			v, _ := it.Value()
			component := v.(*Component)
			cb(component)
			segmentForEach(&component.subs, cb)
		}
	}
}
func (p *structActionTrace) forEachComponent(cb func(*Component)) {
	segmentForEach(&p.components, cb)
}
func (p *structActionTrace) formatComponent() {
	formatList(&p.components)
}
func (p *structActionTrace) destroy() {
	clearComponent(&p.components)
	p.txId = ""
	p.name = ""
	p.uri = ""
	p.requestParams = nil
	p.customParams = nil
}


text:
<!doctype html>

    <title>Elf Sorcerer</title>

    <link href="spectre.min.css" rel="stylesheet">

Elf Sorcerer

      <canvas id="canvas"></canvas>

Amusement. That is the only emotion an elf feels in times like these.
      Lesser races fall into disarray when facing the smallest disruptions. Elven Sorcerer's have witnessed the ebb and flow of civilizations
      for milleniums and seldomly as bystanders.

        Starting ability: Lightning Bolt


text:
export default {
  LOGIN_URL: '/login',
  LOGIN_REDIRECT_PATH: '/instances',
  SOCIAL_NETWORKS_LOGIN: ['facebook', 'google', 'github'],
  SOCIAL_NETWORKS_SIGNUP: ['google', 'github']
};


text:
package strategy

import (
	"github.com/kyma-project/kyma/components/compass-runtime-agent/internal/kyma/applications"
	"github.com/kyma-project/kyma/components/compass-runtime-agent/internal/kyma/model"
)

func convertToModelCSRInfo(appCredentials *applications.Credentials) *model.CSRFInfo {
	if appCredentials == nil || appCredentials.CSRFInfo == nil {
		return nil
	}

	return &model.CSRFInfo{
		TokenEndpointURL: appCredentials.CSRFInfo.TokenEndpointURL,
	}
}

func toAppCSRFInfo(credentials *model.Credentials) *applications.CSRFInfo {

	convertFromModel := func(csrfInfo *model.CSRFInfo) *applications.CSRFInfo {
		if csrfInfo == nil {
			return nil
		}

		return &applications.CSRFInfo{
			TokenEndpointURL: csrfInfo.TokenEndpointURL,
		}
	}

	if credentials == nil {
		return nil
	}

	return convertFromModel(credentials.CSRFInfo)
}


text:
'use strict';

var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');

var NoscriptGenerator = module.exports = function NoscriptGenerator(args, options) {
    yeoman.generators.Base.apply(this, arguments);

    this.on('end', function () {
        this.installDependencies({ skipInstall: options['skip-install'] });
    });

    this.on('error', function (err) {
        this.log.error(err.message || err);
    });

    this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(NoscriptGenerator, yeoman.generators.Base);

NoscriptGenerator.prototype.askFor = function askFor() {
    var done = this.async();

    var welcome = [
        '                               _       __ ',
        '   ____  ____  _______________(_)___  / /_',
        '  / __ \\/ __ \\/ ___/ ___/ ___/ / __ \\/ __/',
        ' / / / / /_/ (__  ) /__/ /  / / /_/ / /_  ',
        '/_/ /_/\\____/____/\\___/_/  /_/ .___/\\__/  ',
        '                            /_/           '
    ].join('\n');

    console.log(welcome);

    var prompts = [
        {
            name: 'projectName',
            message: 'Project name:'
        },
        {
            type: 'confirm',
            name: 'bare',
            message: 'Generate sample views?',
            default: 'y/N'
        }
    ];

    this.prompt(prompts, function (err, props) {
        if (err) {
            return this.emit('error', err);
        }

        this.projectName = props.projectName;
        this.bare = /n/gi.test(props.bare);

        done();
    }.bind(this));
};

NoscriptGenerator.prototype.app = function app() {
    this.mkdir('app');

    this.mkdir('tests');
    this.mkdir('tests/spec');

    this.copy('app/app.js', 'app/app.js');
    this.copy('app/view-app.js', 'app/view-app.js');
    this.template('app/init.js', 'app/init.js');
    this.template('app/layout-main.js', 'app/layout-main.js');
    this.template('app/layout-not-found.js', 'app/layout-not-found.js');

    if (!this.bare) {
        this.copy('app/view-welcome.js', 'app/view-welcome.js');
        this.template('app/view-welcome.yate', 'app/view-welcome.yate');

        this.copy('app/view-not-found.js', 'app/view-not-found.js');
        this.copy('app/view-not-found.yate', 'app/view-not-found.yate');
    }

    this.template('tests/tests.html', 'tests/tests.html');
    this.copy('tests/spec/router.js', 'tests/spec/router.js');
};

NoscriptGenerator.prototype.server = function server() {
    this.mkdir('server');

    this.copy('server/server.js', 'server/server.js');
    this.copy('server/route-index.js', 'server/route-index.js');
    this.copy('server/route-models.js', 'server/route-models.js');
    this.copy('server/engine-yate.js', 'server/engine-yate.js');
    this.template('server/page-index.yate', 'server/page-index.yate');
};

NoscriptGenerator.prototype.styles = function styles() {
    this.mkdir('styles');

    this.template('styles/main.styl', 'styles/main.styl');
};

NoscriptGenerator.prototype.projectfiles = function projectfiles() {
    this.template('_package.json', 'package.json');
    this.template('_README.md', 'README.md');

    this.copy('Gruntfile.js', 'Gruntfile.js');

    this.copy('editorconfig', '.editorconfig');
    this.copy('jshintrc', '.jshintrc');
    this.copy('gitignore', '.gitignore');
};


text:
package uk.co.imallan.tuchongdaily.provider;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;

import uk.co.imallan.tuchongdaily.db.Table;

/**
 * Created by allan on 15/2/25.
 */
public class ImageProvider extends AbstractProvider {

	private static final String POST_TABLE_NAME = Table.Post.TABLE_NAME;

	private static final String TABLE_NAME = Table.Image.TABLE_NAME;

	private static final int URI_IMAGES = 1;

	private static final int URI_IMAGE_ID = 2;

	private static final int URI_IMAGES_POST_ID = 3;

	protected static Uri getContentUri() {
		return Uri.parse(CONTENT_URI_BASE + getAuthority(ImageProvider.class) + "/" + TABLE_NAME);
	}

	public static Uri uriImages() {
		return getContentUri();
	}

	public static Uri uriImage(String id) {
		return Uri.withAppendedPath(getContentUri(), id);
	}

	public static Uri uriPostImages(String id) {
		return Uri.withAppendedPath(Uri.withAppendedPath(getContentUri(), POST_TABLE_NAME), id);
	}

	@Override
	public boolean onCreate() {
		boolean result = super.onCreate();
		final String authority = getAuthority(this.getClass());
		uriMatcher.addURI(authority, TABLE_NAME, URI_IMAGES);
		uriMatcher.addURI(authority, TABLE_NAME + "/#", URI_IMAGE_ID);
		uriMatcher.addURI(authority, TABLE_NAME + "/" + POST_TABLE_NAME + "/#", URI_IMAGES_POST_ID);
		return result;
	}

	@Override
	public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
		Cursor c = null;
		final SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
		switch (uriMatcher.match(uri)) {
			case URI_IMAGE_ID:
				qb.setTables(TABLE_NAME);
				qb.appendWhere(Table.Image.COLUMN_ID + "=\"" + uri.getLastPathSegment() + "\"");
				c = qb.query(getReadableDatabase(), projection, selection, selectionArgs, null, null, sortOrder);
				break;
			case URI_IMAGES_POST_ID:
				qb.setTables(TABLE_NAME);
				qb.appendWhere(Table.Image.COLUMN_POST_ID + "=\"" + uri.getLastPathSegment() + "\"");
				c = qb.query(getReadableDatabase(), projection, selection, selectionArgs, null, null, sortOrder);
				break;
		}
		return c;
	}

	@Override
	public String getType(Uri uri) {
		switch (uriMatcher.match(uri)) {
			case URI_IMAGE_ID:
				return TYPE_ITEM_BASE + TABLE_NAME;
			case URI_IMAGES:
			case URI_IMAGES_POST_ID:
				return TYPE_LIST_BASE + TABLE_NAME;
			default:
				throw new IllegalArgumentException("Unsupported URI: " + uri);
		}
	}

	@Override
	public Uri insert(Uri uri, ContentValues values) {
		switch (uriMatcher.match(uri)) {
			case URI_IMAGES:
			case URI_IMAGE_ID:
				getWritableDatabase().insert(TABLE_NAME, null, values);
				break;
		}
		return null;
	}

	@Override
	public int delete(Uri uri, String selection, String[] selectionArgs) {
		int deleted = 0;
		switch (uriMatcher.match(uri)) {
			case URI_IMAGES:
				deleted = getWritableDatabase().delete(TABLE_NAME, null, null);
				break;
			case URI_IMAGE_ID:
				deleted = getWritableDatabase().delete(TABLE_NAME, Table.Image.COLUMN_POST_ID + "=?", new String[]{uri.getLastPathSegment()});
				break;
		}
		return deleted;
	}

	@Override
	public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
		return 0;
	}
}


text:
package search

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

import (
	"github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
	"net/http"
	"net/url"
)

// AdminKeysClient is the client that can be used to manage Azure Search
// services and API keys.
type AdminKeysClient struct {
	ManagementClient
}

// NewAdminKeysClient creates an instance of the AdminKeysClient client.
func NewAdminKeysClient(subscriptionID string) AdminKeysClient {
	return NewAdminKeysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// NewAdminKeysClientWithBaseURI creates an instance of the AdminKeysClient
// client.
func NewAdminKeysClientWithBaseURI(baseURI string, subscriptionID string) AdminKeysClient {
	return AdminKeysClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// List returns the primary and secondary API keys for the given Azure Search
// service.
//
// resourceGroupName is the name of the resource group within the current
// subscription. serviceName is the name of the Search service for which to
// list admin keys.
func (client AdminKeysClient) List(resourceGroupName string, serviceName string) (result AdminKeyResult, ae error) {
	req, err := client.ListPreparer(resourceGroupName, serviceName)
	if err != nil {
		return result, autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure preparing request")
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure sending request")
	}

	result, err = client.ListResponder(resp)
	if err != nil {
		ae = autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure responding to request")
	}

	return
}

// ListPreparer prepares the List request.
func (client AdminKeysClient) ListPreparer(resourceGroupName string, serviceName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceGroupName": url.QueryEscape(resourceGroupName),
		"serviceName":       url.QueryEscape(serviceName),
		"subscriptionId":    url.QueryEscape(client.SubscriptionID),
	}

	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	return autorest.Prepare(&http.Request{},
		autorest.AsJSON(),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listAdminKeys"),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters))
}

// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client AdminKeysClient) ListSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, http.StatusOK)
}

// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client AdminKeysClient) ListResponder(resp *http.Response) (result AdminKeyResult, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		autorest.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}


text:
package org.wso2.carbon.bpel.b4p.coordination.configuration;

import java.io.*;

import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlbeans.XmlException;
import org.wso2.carbon.bpel.b4p.coordination.config.*;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.securevault.SecretResolver;
import org.wso2.securevault.SecretResolverFactory;

public class CoordinationConfiguration {

    private static Log log = LogFactory.getLog(CoordinationConfiguration.class);

    private static CoordinationConfiguration coordinationConfiguration = null;

    public static final String HUMAN_TASK_COORDINATION_CONFIG_FILE = "b4p-coordination-config.xml";
    public static final String PROTOCOL_HANDLER_USERNAME_ALIAS = "HumanTask.ProtocolHandler.Username";
    public static final String PROTOCOL_HANDLER_PASSWORD_ALIAS = "HumanTask.ProtocolHandler.Password";

    private boolean humantaskCoordinationEnabled = false;

    private boolean registrationServiceEnabled = false;

    // HumanTask engine's protocol handler related configs
    private String protocolHandlerAdminUser;
    private String protocolHandlerAdminPassword;

    //Persistence related configs
    private boolean showSQL = false;
    private boolean generateDdl = false;
    private String daoConnectionFactoryClass;

    private boolean clusteredTaskEngines = false;
    private String loadBalancerURL;

    private CoordinationConfiguration() {

        File htCoordinationConfigFile = getHumanTaskCoordinationConfigurationFile();

        HumanTaskCoordinationConfigurationDocument humanTaskCoordinationConfigurationDocument = readConfigFile(htCoordinationConfigFile);

        if (humanTaskCoordinationConfigurationDocument == null
                || humanTaskCoordinationConfigurationDocument.getHumanTaskCoordinationConfiguration() == null) {
            log.info("HumanTask Coordination disabled !");
            this.humantaskCoordinationEnabled = false;
            return;
        }

        // Reading values
        THtCoordinationConfig tHtCoordinationConfig = humanTaskCoordinationConfigurationDocument.getHumanTaskCoordinationConfiguration();

        this.humantaskCoordinationEnabled = tHtCoordinationConfig.getTaskCoordinationEnabled();
        this.registrationServiceEnabled = tHtCoordinationConfig.getRegistrationServiceEnabled();
        if (tHtCoordinationConfig.getTaskProtocolHandlerAuthentication() != null) {
            // Reading secured password
            getAuthenticationConfig(htCoordinationConfigFile, tHtCoordinationConfig.getTaskProtocolHandlerAuthentication());
        } else {
            log.warn("Error occurred while retrieving TaskEngineProtocolHandler configuration. ");
        }

        if (tHtCoordinationConfig.getPersistenceConfig() != null) {
            parsePersistenceConfig(tHtCoordinationConfig.getPersistenceConfig());
        }

        if (tHtCoordinationConfig.getClusteredTaskEngines() != null) {
            this.clusteredTaskEngines = true;
            parseClusterData(tHtCoordinationConfig.getClusteredTaskEngines());
        }
    }

    /**
     * Get protocol handler admin username and password from secure vault. If secure vault not set then
     * parse authentication configuration and extract protocol handler admin username and password
     *
     * @param file
     * @param authentication
     */
    private void getAuthenticationConfig(File file, TTaskAuthenticationConfig authentication) {
        //Since secretResolver only accept Element we have to build Element here.
        SecretResolver secretResolver = null;
        InputStream in = null;
        try {
            in = new FileInputStream(file);
            StAXOMBuilder builder = new StAXOMBuilder(in);
            secretResolver = SecretResolverFactory.create(builder.getDocumentElement(), true);
        } catch (Exception e) {
            log.warn("Error occurred while retrieving secured TaskEngineProtocolHandler configuration.", e);
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                log.error(e.getLocalizedMessage(), e);
            }
        }
        // Get Username
        if (secretResolver != null && secretResolver.isInitialized()
                && secretResolver.isTokenProtected(PROTOCOL_HANDLER_USERNAME_ALIAS)) {
            protocolHandlerAdminUser = secretResolver.resolve(PROTOCOL_HANDLER_USERNAME_ALIAS);
            if (log.isDebugEnabled()) {
                log.debug("Loaded TaskEngine's protocol handler username from secure vault");
            }
        } else {
            if (authentication.getUsername() != null) {
                this.protocolHandlerAdminUser = authentication.getUsername();
            }
        }
        // Get Password
        if (secretResolver != null && secretResolver.isInitialized()
                && secretResolver.isTokenProtected(PROTOCOL_HANDLER_PASSWORD_ALIAS)) {
            protocolHandlerAdminPassword = secretResolver.resolve(PROTOCOL_HANDLER_PASSWORD_ALIAS);
            if (log.isDebugEnabled()) {
                log.debug("Loaded TaskEngine's protocol handler password from secure vault");
            }
        } else {
            if (authentication.getPassword() != null) {
                this.protocolHandlerAdminPassword = authentication.getPassword();
            }
        }
    }

    private void parsePersistenceConfig(TPersistenceConfig persistenceConfig) {
        this.generateDdl = persistenceConfig.getGenerateDdl();
        this.showSQL = persistenceConfig.getShowSql();

        if (persistenceConfig.getDAOConnectionFactoryClass() != null) {
            this.daoConnectionFactoryClass = persistenceConfig.getDAOConnectionFactoryClass();
        }
    }

    private void parseClusterData(TClusterConfig clusterConfig) {
        if (clusterConfig.getLoadBalancerURL() != null) {
            this.loadBalancerURL = clusterConfig.getLoadBalancerURL();
        } else {
            this.clusteredTaskEngines = false;
        }
    }

    public static CoordinationConfiguration getInstance() {
        if (coordinationConfiguration == null) {
            coordinationConfiguration = new CoordinationConfiguration();
        }
        return coordinationConfiguration;
    }

    private HumanTaskCoordinationConfigurationDocument readConfigFile(File aFile) {
        try {
            return HumanTaskCoordinationConfigurationDocument.Factory.parse(new FileInputStream(aFile));
        } catch (XmlException e) {
            log.error("Error Parsing HumanTask Coordination configuration File.", e);
        } catch (FileNotFoundException e) {
            log.warn("Cannot find HumanTask Coordination configuration in location " + aFile.getPath() + ".");
        } catch (IOException e) {
            log.warn("Error while reading HumanTask coordination configuration file.");
        }

        return null;
    }

    /**
     * Calculate htCoordination-config.xml path and returns config file.
     *
     * @return HT-coordination config file
     */
    private File getHumanTaskCoordinationConfigurationFile() {
        return new File(CarbonUtils.getCarbonConfigDirPath() + File.separator + HUMAN_TASK_COORDINATION_CONFIG_FILE);
    }

    public boolean isHumantaskCoordinationEnabled() {
        return humantaskCoordinationEnabled;
    }

    public boolean isRegistrationServiceEnabled() {
        return registrationServiceEnabled;
    }

    public String getProtocolHandlerAdminUser() {
        return protocolHandlerAdminUser;
    }

    public String getProtocolHandlerAdminPassword() {
        return protocolHandlerAdminPassword;
    }

    public boolean isShowSQL() {
        return showSQL;
    }

    public boolean isGenerateDdl() {
        return generateDdl;
    }

    public String getDaoConnectionFactoryClass() {
        return daoConnectionFactoryClass;
    }

    public boolean isClusteredTaskEngines() {
        return clusteredTaskEngines;
    }

    public String getLoadBalancerURL() {
        return loadBalancerURL;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pleospora stellariae Bubák

### Remarks
null


text:
import * as validator from '../core/Validator';
import * as list from '../core/List';
import * as utils from '../core/Utils';
import * as helper from '../core/Helper';
import * as extension from './Extension';

export class Presence extends helper.Helper {

    createUrl(options?:IPresenceOptions, id?:string) {

        options = options || {};

        return '/account/~/extension/' + (id || '~') + '/presence' + (options.detailed ? '?detailedTelephonyState=true' : '');

    }

    getId(presence:IPresence) {
        return presence && (extension.extension.getId(presence.extension) || presence.extensionId);
    }

    isAvailable(presence:IPresence) {
        return presence && presence.presenceStatus == 'Available';
    }

    addEventToSubscription(subscription, options?:IPresenceOptions, id?:string) { //TODO Type

        return subscription.setEventFilters([this.createUrl(options, id)]);

    }

    updateSubscription(subscription, //TODO Type
                       presences:IPresence[],
                       options?:IPresenceOptions) {

        var events = presences.map(this.getId, this).map((id) => {
            return this.createUrl(options, id);
        }, this);

        subscription.addEventFilters(events);

        return subscription;

    }

    attachToExtensions(extensions:extension.IExtension[], presences:IPresence[], merge?:boolean) {

        var index = this.index(presences);

        extensions.forEach((ex:extension.IExtension) => {

            var presence = index[extension.extension.getId(ex)];

            if (presence) {
                if ('presence' in ex && merge) {
                    utils.extend(ex.presence, presence);
                } else {
                    ex.presence = presence;
                }
            }

        }, this);

        return this;

    }

    isCallInProgress(presenceCall:IPresenceCall) {
        return (presenceCall && presenceCall.telephonyStatus != 'NoCall');
    }

}

export var presence = new Presence();

export interface IPresence extends helper.IHelperObject {
    extension?:extension.IExtension;
    activeCalls?:IPresenceCall[];
    presenceStatus?:string; // Offline, Busy, Available
    telephonyStatus?:string; // NoCall, CallConnected, Ringing, OnHold
    userStatus?:string; // Offline, Busy, Available
    dndStatus?:string; // TakeAllCalls, DoNotAcceptAnyCalls, DoNotAcceptDepartmentCalls, TakeDepartmentCallsOnly
    allowSeeMyPresence?:boolean;
    ringOnMonitoredCall?:boolean;
    pickUpCallsOnHold?:boolean;
    extensionId?:string;
    sequence?:number;
}

export interface IPresenceCall {
    direction?:string;
    from?:string;
    to?:string;
    sessionId?:string;
    id?:string;
    telephonyStatus?:string;
}

export interface IPresenceOptions {
    detailed?:boolean;
}


text:
var annotated =
[
    [ "_TidyAllocator", "struct__TidyAllocator.html", "struct__TidyAllocator" ],
    [ "_TidyAllocatorVtbl", "struct__TidyAllocatorVtbl.html", "struct__TidyAllocatorVtbl" ],
    [ "_TidyBuffer", "struct__TidyBuffer.html", "struct__TidyBuffer" ],
    [ "_TidyInputSource", "struct__TidyInputSource.html", "struct__TidyInputSource" ],
    [ "_TidyOutputSink", "struct__TidyOutputSink.html", "struct__TidyOutputSink" ],
    [ "TidyAttr", "structTidyAttr.html", null ],
    [ "TidyDoc", "structTidyDoc.html", null ],
    [ "TidyNode", "structTidyNode.html", null ],
    [ "TidyOption", "structTidyOption.html", null ]
];


text:
package org.onosproject.pipelines.fabric.impl.behaviour;

import com.google.common.collect.ImmutableList;
import org.junit.Before;
import org.junit.Test;
import org.onlab.packet.MacAddress;
import org.onlab.packet.MplsLabel;
import org.onlab.packet.VlanId;
import org.onlab.util.ImmutableByteSequence;
import org.onosproject.net.DeviceId;
import org.onosproject.net.PortNumber;
import org.onosproject.net.flow.DefaultTrafficTreatment;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.packet.DefaultOutboundPacket;
import org.onosproject.net.packet.OutboundPacket;
import org.onosproject.net.pi.model.PiPacketOperationType;
import org.onosproject.net.pi.runtime.PiAction;
import org.onosproject.net.pi.runtime.PiActionParam;
import org.onosproject.net.pi.runtime.PiPacketMetadata;
import org.onosproject.net.pi.runtime.PiPacketOperation;
import org.onosproject.pipelines.fabric.FabricConstants;

import java.nio.ByteBuffer;
import java.util.Collection;

import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertEquals;

/**
 * Test for fabric interpreter.
 */
public class FabricInterpreterTest {
    private static final VlanId VLAN_100 = VlanId.vlanId("100");
    private static final PortNumber PORT_1 = PortNumber.portNumber(1);
    private static final MacAddress SRC_MAC = MacAddress.valueOf("00:00:00:00:00:01");
    private static final MacAddress DST_MAC = MacAddress.valueOf("00:00:00:00:00:02");
    private static final MplsLabel MPLS_10 = MplsLabel.mplsLabel(10);
    private static final DeviceId DEVICE_ID = DeviceId.deviceId("device:1");
    private static final int PORT_BITWIDTH = 9;

    private FabricInterpreter interpreter;

    FabricCapabilities allCapabilities;

    @Before
    public void setup() {
        allCapabilities = createNiceMock(FabricCapabilities.class);
        expect(allCapabilities.hasHashedTable()).andReturn(true).anyTimes();
        expect(allCapabilities.supportDoubleVlanTerm()).andReturn(true).anyTimes();
        replay(allCapabilities);
        interpreter = new FabricInterpreter(allCapabilities);
    }

    /* Forwarding control block */

    /**
     * Map empty treatment for routing v4 table.
     */
    @Test
    public void testRoutingV4TreatmentEmpty() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_FORWARDING_ROUTING_V4);
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ROUTING_V4)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /**
     * Map empty treatment to NOP for ACL table.
     */
    @Test
    public void testAclTreatmentEmpty() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_ACL_ACL);
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_ACL_NOP_ACL)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /**
     * Map wipeDeferred treatment to DROP for ACL table.
     */
    @Test
    public void testAclTreatmentWipeDeferred() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                .wipeDeferred()
                .build();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_ACL_ACL);
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_ACL_DROP)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /* Next control block */

    /**
     * Map treatment to output action.
     */
    @Test
    public void testNextTreatmentSimpleOutput() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                .setOutput(PORT_1)
                .build();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_NEXT_SIMPLE);
        PiActionParam param = new PiActionParam(FabricConstants.PORT_NUM, PORT_1.toLong());
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_NEXT_OUTPUT_SIMPLE)
                .withParameter(param)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /**
     * Map treatment for hashed table to routing v4 action.
     */
    @Test
    public void testNextTreatmentHashedRoutingV4() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                .setEthSrc(SRC_MAC)
                .setEthDst(DST_MAC)
                .setOutput(PORT_1)
                .build();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_NEXT_HASHED);
        PiActionParam ethSrcParam = new PiActionParam(FabricConstants.SMAC, SRC_MAC.toBytes());
        PiActionParam ethDstParam = new PiActionParam(FabricConstants.DMAC, DST_MAC.toBytes());
        PiActionParam portParam = new PiActionParam(FabricConstants.PORT_NUM, PORT_1.toLong());
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_NEXT_ROUTING_HASHED)
                .withParameters(ImmutableList.of(ethSrcParam, ethDstParam, portParam))
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /**
     * Map treatment to set_vlan_output action.
     */
    @Test
    public void testNextVlanTreatment() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                .setVlanId(VLAN_100)
                .build();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_PRE_NEXT_NEXT_VLAN);
        PiActionParam vlanParam = new PiActionParam(
                FabricConstants.VLAN_ID, VLAN_100.toShort());
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_PRE_NEXT_SET_VLAN)
                .withParameter(vlanParam)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    /**
     * Map treatment to set_mpls action.
     */
    @Test
    public void testNextMplsTreatment() throws Exception {
        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                .setMpls(MPLS_10)
                .build();
        PiAction mappedAction = interpreter.mapTreatment(
                treatment, FabricConstants.FABRIC_INGRESS_PRE_NEXT_NEXT_MPLS);
        PiActionParam mplsParam = new PiActionParam(
                FabricConstants.LABEL, MPLS_10.toInt());
        PiAction expectedAction = PiAction.builder()
                .withId(FabricConstants.FABRIC_INGRESS_PRE_NEXT_SET_MPLS_LABEL)
                .withParameter(mplsParam)
                .build();
        assertEquals(expectedAction, mappedAction);
    }

    @Test
    public void testMapOutboundPacketWithoutForwarding()
            throws Exception {
        PortNumber outputPort = PortNumber.portNumber(1);
        TrafficTreatment outputTreatment = DefaultTrafficTreatment.builder()
                .setOutput(outputPort)
                .build();
        ByteBuffer data = ByteBuffer.allocate(64);
        OutboundPacket outPkt = new DefaultOutboundPacket(DEVICE_ID, outputTreatment, data);
        Collection<PiPacketOperation> result = interpreter.mapOutboundPacket(outPkt);
        assertEquals(result.size(), 1);

        ImmutableList.Builder<PiPacketMetadata> builder = ImmutableList.builder();
        builder.add(PiPacketMetadata.builder()
                .withId(FabricConstants.EGRESS_PORT)
                .withValue(ImmutableByteSequence.copyFrom(outputPort.toLong())
                        .fit(PORT_BITWIDTH))
                .build());

        PiPacketOperation expectedPktOp = PiPacketOperation.builder()
                .withType(PiPacketOperationType.PACKET_OUT)
                .withData(ImmutableByteSequence.copyFrom(data))
                .withMetadatas(builder.build())
                .build();

        assertEquals(expectedPktOp, result.iterator().next());
    }

    @Test
    public void testMapOutboundPacketWithForwarding()
            throws Exception {
        PortNumber outputPort = PortNumber.TABLE;
        TrafficTreatment outputTreatment = DefaultTrafficTreatment.builder()
                .setOutput(outputPort)
                .build();
        ByteBuffer data = ByteBuffer.allocate(64);
        OutboundPacket outPkt = new DefaultOutboundPacket(DEVICE_ID, outputTreatment, data);
        Collection<PiPacketOperation> result = interpreter.mapOutboundPacket(outPkt);
        assertEquals(result.size(), 1);

        ImmutableList.Builder<PiPacketMetadata> builder = ImmutableList.builder();
        builder.add(PiPacketMetadata.builder()
                .withId(FabricConstants.DO_FORWARDING)
                .withValue(ImmutableByteSequence.copyFrom(1)
                        .fit(1))
                .build());

        PiPacketOperation expectedPktOp = PiPacketOperation.builder()
                .withType(PiPacketOperationType.PACKET_OUT)
                .withData(ImmutableByteSequence.copyFrom(data))
                .withMetadatas(builder.build())
                .build();

        assertEquals(expectedPktOp, result.iterator().next());
    }
}


text:
module Prawn
  # This is used to differentiate strings that must be encoded as
  # a *literal* string, versus those that can be encoded in
  # the PDF hexadecimal format.
  #
  # Some features of the PDF format appear to require that literal
  # strings be used. One such feature is the /Dest key of a link
  # annotation; if a hex encoded string is used there, the links
  # do not work (as tested in Mac OS X Preview, and Adobe Acrobat
  # Reader).
  class LiteralString < String #:nodoc:
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.valensas.veaconsdk.app">

    <application tools:replace="android:name"
        android:name=".Application"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="com.valensas.veaconsdk.app.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>


text:
package org.jkiss.dbeaver.ext.oracle.model;

import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameterKind;
import org.jkiss.utils.CommonUtils;

/**
* Parameter/argument mode
*/
public enum OracleParameterMode {
    IN(DBSProcedureParameterKind.IN),
    OUT(DBSProcedureParameterKind.OUT),
    INOUT(DBSProcedureParameterKind.INOUT);
    private final DBSProcedureParameterKind parameterKind;

    OracleParameterMode(DBSProcedureParameterKind parameterKind)
    {
        this.parameterKind = parameterKind;
    }

    public static OracleParameterMode getMode(String modeName)
    {
        if (CommonUtils.isEmpty(modeName)) {
            return null;
        } else if ("IN".equals(modeName)) {
            return IN;
        } else if ("OUT".equals(modeName)) {
            return OracleParameterMode.OUT;
        } else {
            return OracleParameterMode.INOUT;
        }
    }

    public DBSProcedureParameterKind getParameterKind()
    {
        return parameterKind;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <artifactId>htrace-htraced</artifactId>
  <packaging>jar</packaging>

  <parent>
    <artifactId>htrace</artifactId>
    <groupId>org.apache.htrace</groupId>
    <version>4.3.0-incubating-SNAPSHOT</version>
    <relativePath>..</relativePath>
  </parent>

  <name>htrace-htraced</name>
  <description>HTraced and HTraced clients</description>
  <url>http://incubator.apache.org/projects/htrace.html</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <git.version></git.version>
    <leveldb.prefix></leveldb.prefix>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <!-- explicitly define maven-deploy-plugin after other to force exec order -->
        <artifactId>maven-deploy-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <!--Make it so assembly:single does nothing in here-->
          <skipAssembly>true</skipAssembly>
        </configuration>
      </plugin>
      <!--Move this to top-level. These shade patterns are common across components
       -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>org.apache.commons.logging</pattern>
                  <shadedPattern>org.apache.htrace.shaded.commons.logging</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.jackson</pattern>
                  <shadedPattern>org.apache.htrace.shaded.fasterxml.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty</pattern>
                  <shadedPattern>org.apache.htrace.shaded.jetty</shadedPattern>
                </relocation>
                <dependency>
                  <pattern>org.msgpack</pattern>
                  <shadedPattern>org.apache.htrace.msgpack</shadedPattern>
                </dependency>
              </relocations>
            </configuration>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <id>go_compile</id>
            <goals><goal>run</goal></goals>
            <configuration>
              <tasks>
                <exec executable="./gobuild.sh"
                      dir="${basedir}//go/"
                      failonerror="true">
                  <env key="GIT_VERSION" value="${git.version}"/>
                  <env key="RELEASE_VERSION" value="${project.version}"/>
                  <env key="LEVELDB_PREFIX" value="${leveldb.prefix}"/>
                </exec>
              </tasks>
            </configuration>
          </execution>
          <execution>
            <phase>test</phase>
            <id>go_test</id>
            <goals><goal>run</goal></goals>
            <configuration>
              <tasks>
                <exec executable="bash" failonerror="true" dir="${basedir}/go">
                  <arg value="-c"/>
                  <arg value="[ x$SKIPTESTS = xtrue ] || ./gobuild.sh test"/>
                  <env key="SKIPTESTS" value="${skipTests}"/>
                </exec>
              </tasks>
            </configuration>
          </execution>
          <!--We used to call go/gobuild.sh clean here but it fails if
              the first thing we do is mvn clean because this plugin
              expects all plugins to be in place. Instead use the
              below maven-clean-plugin to clean out any extra go dirs.
           -->
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.6.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>bin</directory>
            </fileset>
            <!--Below dirs must match what gobuild.sh clean does.-->
            <fileset>
              <directory>go/build</directory>
            </fileset>
            <fileset>
              <directory>go/pkg</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1.1</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <!-- Module deps. -->
    <dependency>
      <groupId>org.apache.htrace</groupId>
      <artifactId>htrace-core4</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.htrace</groupId>
      <artifactId>htrace-core4</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.htrace</groupId>
      <artifactId>htrace-webapp</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>provided</scope>
    </dependency>
    <!-- Global deps. -->
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>org.msgpack</groupId>
      <artifactId>msgpack-core</artifactId>
      <version>0.7.0-p9</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-client</artifactId>
      <version>9.2.6.v20141205</version>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>rpm</id>
      <activation><property><name>rpm</name></property></activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.1.1</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>generate-rpm</id>
                <goals><goal>rpm</goal></goals>
                <phase>package</phase>
              </execution>
            </executions>
            <configuration>
              <group>Application</group>
              <needarch>true</needarch>
              <release>4.2.0</release>
              <defaultDirmode>755</defaultDirmode>
              <defaultFilemode>644</defaultFilemode>
              <defaultUsername>root</defaultUsername>
              <mappings>
                <mapping>
                  <directory>/usr/local/htraced/web</directory>
                  <sources>
                    <source>
                      <location>src/web</location>
                    </source>
                  </sources>
                </mapping>
                <mapping>
                  <directory>/usr/local/htraced/bin</directory>
                  <filemode>755</filemode>
                  <sources>
                    <source>
                      <location>go/build/htrace</location>
                    </source>
                    <source>
                      <location>go/build/htraced</location>
                    </source>
                  </sources>
                </mapping>
                <mapping>
                  <directory>/usr/local/htraced/java</directory>
                  <sources>
                    <source>
                      <location>target/${project.artifactId}-${project.version}.jar</location>
                    </source>
                  </sources>
                </mapping>
              </mappings>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
using namespace arangodb;

static_assert(auth::Level::UNDEFINED < auth::Level::NONE, "undefined < none");
static_assert(auth::Level::NONE < auth::Level::RO, "none < ro");
static_assert(auth::Level::RO < auth::Level::RW, "none < ro");

static auth::Level _convertToAuthLevel(arangodb::velocypack::StringRef ref) {
  if (ref.compare("rw") == 0) {
    return auth::Level::RW;
  } else if (ref.compare("ro") == 0) {
    return auth::Level::RO;
  } else if (ref.compare("none") == 0 || ref.empty()) {
    return auth::Level::NONE;
  }
  THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
                                 "expecting access type 'rw', 'ro' or 'none'");
}

auth::Level arangodb::auth::convertToAuthLevel(velocypack::Slice grants) {
  return _convertToAuthLevel(arangodb::velocypack::StringRef(grants));
}

auth::Level arangodb::auth::convertToAuthLevel(std::string const& grants) {
  return _convertToAuthLevel(arangodb::velocypack::StringRef(grants));
}

std::string arangodb::auth::convertFromAuthLevel(auth::Level lvl) {
  if (lvl == auth::Level::RW) {
    return "rw";
  } else if (lvl == auth::Level::RO) {
    return "ro";
  } else if (lvl == auth::Level::NONE) {
    return "none";
  } else {
    return "undefined";
  }
}


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

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <!-- The main content view -->

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="5dp"
        >

        <GridView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/gridview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:numColumns="3"
            android:verticalSpacing="5dp"
            android:horizontalSpacing="5dp"
        />

    </LinearLayout>
    <!-- The navigation drawer -->
    <ListView
        android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/menuDrawerGrey"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp" />
</android.support.v4.widget.DrawerLayout>


text:
(function(window) {

	'use strict';

	// Helper vars and functions.
	function extend( a, b ) {
		for( var key in b ) {
			if( b.hasOwnProperty( key ) ) {
				a[key] = b[key];
			}
		}
		return a;
	}

	// from http://www.quirksmode.org/js/events_properties.html#position
	function getMousePos(e) {
		var posx = 0, posy = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) 	{
			posx = e.pageX;
			posy = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
		}
		return { x : posx, y : posy }
	}

	/**
	 * TiltFx obj.
	 */
	function TiltFx(el, options) {
		this.DOM = {};
		this.DOM.el = el;
		this.options = extend({}, this.options);
		extend(this.options, options);
		this._init();
	}

	TiltFx.prototype.options = {
		movement: {
			imgWrapper : {
				translation : {x: 0, y: 0, z: 0},
				rotation : {x: -5, y: 5, z: 0},
				reverseAnimation : {
					duration : 1200,
					easing : 'easeOutElastic',
					elasticity : 600
				}
			},
			lines : {
				translation : {x: 10, y: 10, z: [0,10]},
				reverseAnimation : {
					duration : 1000,
					easing : 'easeOutExpo',
					elasticity : 600
				}
			},
			caption : {
				translation : {x: 20, y: 20, z: 0},
				rotation : {x: 0, y: 0, z: 0},
				reverseAnimation : {
					duration : 1500,
					easing : 'easeOutElastic',
					elasticity : 600
				}
			},
			/*
			overlay : {
				translation : {x: 10, y: 10, z: [0,50]},
				reverseAnimation : {
					duration : 500,
					easing : 'easeOutExpo'
				}
			},
			*/
			shine : {
				translation : {x: 50, y: 50, z: 0},
				reverseAnimation : {
					duration : 1200,
					easing : 'easeOutElastic',
					elasticity: 600
				}
			}
		}
	};

	/**
	 * Init.
	 */
	TiltFx.prototype._init = function() {
		this.DOM.animatable = {};
		this.DOM.animatable.imgWrapper = this.DOM.el.querySelector('.tilter__figure');
		this.DOM.animatable.lines = this.DOM.el.querySelector('.tilter__deco--lines');
		this.DOM.animatable.caption = this.DOM.el.querySelector('.tilter__caption');
		this.DOM.animatable.overlay = this.DOM.el.querySelector('.tilter__deco--overlay');
		this.DOM.animatable.shine = this.DOM.el.querySelector('.tilter__deco--shine > div');
		this._initEvents();
	};

	/**
	 * Init/Bind events.
	 */
	TiltFx.prototype._initEvents = function() {
		var self = this;

		this.mouseenterFn = function() {
			for(var key in self.DOM.animatable) {
				anime.remove(self.DOM.animatable[key]);
			}
		};

		this.mousemoveFn = function(ev) {
			requestAnimationFrame(function() { self._layout(ev); });
		};

		this.mouseleaveFn = function(ev) {
			requestAnimationFrame(function() {
				for(var key in self.DOM.animatable) {
					if( self.options.movement[key] == undefined ) {continue;}
					anime({
						targets: self.DOM.animatable[key],
						duration: self.options.movement[key].reverseAnimation != undefined ? self.options.movement[key].reverseAnimation.duration || 0 : 1,
						easing: self.options.movement[key].reverseAnimation != undefined ? self.options.movement[key].reverseAnimation.easing || 'linear' : 'linear',
						elasticity: self.options.movement[key].reverseAnimation != undefined ? self.options.movement[key].reverseAnimation.elasticity || null : null,
						scaleX: 1,
						scaleY: 1,
						scaleZ: 1,
						translateX: 0,
						translateY: 0,
						translateZ: 0,
						rotateX: 0,
						rotateY: 0,
						rotateZ: 0
					});
				}
			});
		};

		this.DOM.el.addEventListener('mousemove', this.mousemoveFn);
		this.DOM.el.addEventListener('mouseleave', this.mouseleaveFn);
		this.DOM.el.addEventListener('mouseenter', this.mouseenterFn);
	};

	TiltFx.prototype._layout = function(ev) {
		// Mouse position relative to the document.
		var mousepos = getMousePos(ev),
			// Document scrolls.
			docScrolls = {left : document.body.scrollLeft + document.documentElement.scrollLeft, top : document.body.scrollTop + document.documentElement.scrollTop},
			bounds = this.DOM.el.getBoundingClientRect(),
			// Mouse position relative to the main element (this.DOM.el).
			relmousepos = { x : mousepos.x - bounds.left - docScrolls.left, y : mousepos.y - bounds.top - docScrolls.top };

		// Movement settings for the animatable elements.
		for(var key in this.DOM.animatable) {
			if( this.DOM.animatable[key] == undefined || this.options.movement[key] == undefined ) {
				continue;
			}
			var t = this.options.movement[key] != undefined ? this.options.movement[key].translation || {x:0,y:0,z:0} : {x:0,y:0,z:0},
				r = this.options.movement[key] != undefined ? this.options.movement[key].rotation || {x:0,y:0,z:0} : {x:0,y:0,z:0},
				setRange = function (obj) {
					for(var k in obj) {
						if( obj[k] == undefined ) {
							obj[k] = [0,0];
						}
						else if( typeof obj[k] === 'number' ) {
							obj[k] = [-1*obj[k],obj[k]];
						}
					}
				};

			setRange(t);
			setRange(r);

			var transforms = {
				translation : {
					x: (t.x[1]-t.x[0])/bounds.width*relmousepos.x + t.x[0],
					y: (t.y[1]-t.y[0])/bounds.height*relmousepos.y + t.y[0],
					z: (t.z[1]-t.z[0])/bounds.height*relmousepos.y + t.z[0],
				},
				rotation : {
					x: (r.x[1]-r.x[0])/bounds.height*relmousepos.y + r.x[0],
					y: (r.y[1]-r.y[0])/bounds.width*relmousepos.x + r.y[0],
					z: (r.z[1]-r.z[0])/bounds.width*relmousepos.x + r.z[0]
				}
			};

			this.DOM.animatable[key].style.WebkitTransform = this.DOM.animatable[key].style.transform = 'translateX(' + transforms.translation.x + 'px) translateY(' + transforms.translation.y + 'px) translateZ(' + transforms.translation.z + 'px) rotateX(' + transforms.rotation.x + 'deg) rotateY(' + transforms.rotation.y + 'deg) rotateZ(' + transforms.rotation.z + 'deg)';
		}
	};

	window.TiltFx = TiltFx;

})(window);
jQuery(document).ready(function ($) {
(function() {
    var tiltSettings = [
    {},
    {
            movement: {
                    imgWrapper : {
                            translation : {x: 10, y: 10, z: 30},
                            rotation : {x: 0, y: -10, z: 0},
                            reverseAnimation : {duration : 200, easing : 'easeOutQuad'}
                    },
                    lines : {
                            translation : {x: 10, y: 10, z: [0,70]},
                            rotation : {x: 0, y: 0, z: -2},
                            reverseAnimation : {duration : 2000, easing : 'easeOutExpo'}
                    },
                    caption : {
                            rotation : {x: 0, y: 0, z: 2},
                            reverseAnimation : {duration : 200, easing : 'easeOutQuad'}
                    },
                    overlay : {
                            translation : {x: 10, y: -10, z: 0},
                            rotation : {x: 0, y: 0, z: 2},
                            reverseAnimation : {duration : 2000, easing : 'easeOutExpo'}
                    },
                    shine : {
                            translation : {x: 100, y: 100, z: 0},
                            reverseAnimation : {duration : 200, easing : 'easeOutQuad'}
                    }
            }
    },
    ];

    function init() {
            var idx = 0;
            [].slice.call(document.querySelectorAll('.tilter')).forEach(function(el, pos) {
                    idx = pos%2 === 0 ? idx+1 : idx;
                    new TiltFx(el, tiltSettings[idx-1]);
            });
    }

    // Preload all images.
    imagesLoaded(document.querySelector('main'), function() {
            document.body.classList.remove('loading');
            init();
    });

})();

jQuery('.tilter__caption').each( function(){
    var tilterH = jQuery( this ).innerHeight() - 15;
    jQuery( this ).parent('.tilter__figure').css( "height", tilterH );
} )

jQuery(window).scroll(function(){
    if (jQuery(this).scrollTop() > 10) {
        jQuery('#header').addClass('header-slide-down');
        jQuery('#logo-text').addClass('hide-logo');
        jQuery('#logo-triangle').addClass('show-logo');
        jQuery('#logo-text').removeClass('topLogo');
    } else {
        jQuery('#header').removeClass('header-slide-down');
        jQuery('#logo-triangle').removeClass('show-logo');
        jQuery('#logo-text').removeClass('hide-logo');
        jQuery('#logo-text').addClass('topLogo');
    }
});
// PARALLAX

});


text:
#ifndef _SYS_REBOOT_H_
#define _SYS_REBOOT_H_

#include <sys/cdefs.h>
#include <linux/reboot.h>

__BEGIN_DECLS

/* use glibc names as well */

#define RB_AUTOBOOT     LINUX_REBOOT_CMD_RESTART
#define RB_HALT_SYSTEM  LINUX_REBOOT_CMD_HALT
#define RB_ENABLE_CAD   LINUX_REBOOT_CMD_CAD_ON
#define RB_DISABLE_CAD  LINUX_REBOOT_CMD_CAD_OFF
#define RB_POWER_OFF    LINUX_REBOOT_CMD_POWER_OFF

extern int reboot(int  reboot_type);

__END_DECLS

#endif /* _SYS_REBOOT_H_ */


text:
<!doctype html>

    <meta charset="UTF-8">
    <title>CAAT Tutorial 9 - CAAT.InterpolatorActor</title>

    <link href="sh/shCore.css" rel="stylesheet" type="text/css"/>
    <link href="sh/shThemeDefault.css" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" href="style/demo.css">

Other CAAT actors

CAAT.InterpolatorActor

                This actor object draws a given CAAT.Interpolator instance. It is useful when the
                developer wants to know how an Interpolator will behave.

                The setup is simple, simply call the method setInterpolator(
                caat.interpolator_instance, size) and then set actor's bounds by calling
                setBounds(x,y,width,height) or
                setSize( width, height ).

                The parameter size defines by how many line segments the interpolator will be
                drawn. This contour polyline is cached, so drawing constantly the actor won't
                impact performance. If no such parameter is supplied, 50 segments will be used.

                The line color will be the one defined by the method
                setStrokeStyle( style ) or black by default.

                The method setGap( size ) allow to set some insets
                to the actor. By default it is 5 units.

                This actor has been extensively used in the Interpolators tutorial.


text:
package com.thingtrack.konekti.dao.api;

import java.util.List;

import com.thingtrack.konekti.dao.template.Dao;
import com.thingtrack.konekti.domain.Permission;
import com.thingtrack.konekti.domain.Role;

/**
 * @author Thingtrack S.L.
 *
 */
public interface PermissionDao extends Dao<Permission, Integer> {;
	public Permission getByCode( String code ) throws Exception;
	public List<Permission> getAllByRole(Role role) throws Exception;
}


text:
package edu.ucsb.apss.tokenization1

import org.apache.spark.SparkContext
import org.apache.spark.mllib.feature.HashingTF
import org.apache.spark.mllib.linalg.SparseVector
import scala.collection.mutable.{Map => MMap}

/**
  * Created by dimberman on 12/24/15.
  *
  * This class is specifically meant for taking in the pre-processed Bag-of-word data for tweets and turning them into SparseVectors
  * for usage in Spark
  */
object BagOfWordToVectorConverter extends Serializable{
    def convert(s: String):SparseVector = {

        if(s == ""){
            new SparseVector(0, Array(), Array())
        }
        else {
            val valMap:MMap[Int,Double] = MMap().withDefaultValue(0.0)
            for (i <- s.split(" ")){
                valMap(i.toInt) += 1
            }
            val ans = valMap.toArray

            new SparseVector(ans.length, ans.map(_._1), ans.map(_._2))
        }

    }

    def revertToString(v:SparseVector):String = {
        v.indices.foldRight("")((i,s) => {
            val addOn = new StringBuilder
            val numAdd = v.values(i).toInt
            for(i <- 0 to numAdd) addOn.append(i + " ")
            s + addOn
        }
        )
    }

}


text:
package jenkins.telemetry.impl.java11;

import com.google.common.annotations.VisibleForTesting;

import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

public class MissingClassEvents {

    /**
     * Only 100 exceptions a day (period of telemetry)
     */
    @VisibleForTesting
    /* package */ static /* final */ int MAX_EVENTS_PER_SEND = 100;

    /**
     * List of events, one per stack trace.
     */
    private ConcurrentHashMap<List<StackTraceElement>, MissingClassEvent> events = new ConcurrentHashMap<>(MAX_EVENTS_PER_SEND);

    /**
     * Add a new exception to the store. If the same exception already exists, it increases the occurrences. If we
     * already get the maximum number of exceptions, it doesn't add any value.
     * @param name name of the class not found
     * @param t the exception to store
     * @return the occurrences stored for this throwable. 1 the fist time it's stored. > 1 for successive stores of the
     * same stack trace. 0 if we already stored MAX_EVENTS_PER_SEND (100) events for a single send.
     */
    public long put(String name, @NonNull Throwable t) {
        // A final object to pass it to the function
        final AtomicLong occurrences = new AtomicLong();

        // We need the key (the stack trace) to be a list and unmodifiable
        List<StackTraceElement> key = Collections.unmodifiableList(Arrays.asList(t.getStackTrace()));
        events.compute(key, (stackTraceElements, missingClassEvent) -> {

            if (missingClassEvent == null) {
                // It's a new element, the size will increase
                if (events.size() < MAX_EVENTS_PER_SEND) {
                    // Create the new value
                    MissingClassEvent newEvent = new MissingClassEvent(name, t);
                    occurrences.set(1);
                    return newEvent;
                } else {
                    return null;
                }

            } else {
                // We update the occurrences and the last time it happened
                occurrences.set(missingClassEvent.getOccurrences());
                missingClassEvent.setOccurrences(occurrences.incrementAndGet());
                missingClassEvent.setTime(MissingClassTelemetry.clientDateString());
                return missingClassEvent;
            }
        });

        return occurrences.get();
    }

    /**
     * Reinitialize the events happened and return the number of events stored since last execution of this method.
     * Used to send via telemetry the events and restart the events store.
     * @return the number of events stored since previous call to this method.
     */

    @VisibleForTesting
    /* package */ synchronized @NonNull ConcurrentHashMap<List<StackTraceElement>, MissingClassEvent> getEventsAndClean() {
        ConcurrentHashMap<List<StackTraceElement>, MissingClassEvent> currentEvents = events;
        events = new ConcurrentHashMap<>(MAX_EVENTS_PER_SEND);
        return currentEvents;
    }

    @Override
    public String toString() {
        return "MissingClassEvents{" +
                "events=" + events +
                '}';
    }
}


text:
#ifndef NX_MIRROR_SCENE_H

#define NX_MIRROR_SCENE_H

/*!
\file
\brief classes NxMirrorScene, NxMirrorScene::MirrorFilter
*/

#include "foundation/PxPreprocessor.h"
#include "NxApexDefs.h"

#if NX_SDK_VERSION_MAJOR == 3
namespace physx
{
	class PxActor;
	class PxShape;
	class PxVec3;

	namespace apex
	{

		/**
		\brief NxMirrorScene is used to create a selected mirrored copy of a primary scene.  Works only with PhysX 3.x
		*/
		class NxMirrorScene
		{
		public:
			/**
			\brief MirrorFilter is a callback interface implemented by the application to confirm which actors and shapes are, or are not, replicated into the mirrored scene
			*/
			class MirrorFilter
			{
			public:
				/**
				\brief The application returns true if this actor should be mirrored into the secondary mirrored scene.

				\param[in] actor A const reference to the actor in the primary scene to be considered mirrored into the secondary scene.
				*/
				virtual bool shouldMirror(const physx::PxActor &actor) = 0;

				/**
				\brief The application returns true if this shape should be mirrored into the secondary mirrored scene.

				\param[in] shape A const reference to the shape in the primary scene to be considered mirrored into the secondary scene.
				*/
				virtual bool shouldMirror(const physx::PxShape &shape) = 0;

				/**
				\brief Affords the application with an opportunity to modify the contents/state of the shape before is placed into the mirrored scene.

				\param[in] shape A reference to the shape that is about to be placed into the mirrored scene.
				*/
				virtual void reviseMirrorShape(physx::PxShape &shape) = 0;

				/**
				\brief Affords the application with an opportunity to modify the contents/state of the actor before is placed into the mirrored scene.

				\param[in] actor A reference to the actor that is about to be placed into the mirrored scene
				*/
				virtual void reviseMirrorActor(physx::PxActor &actor) = 0;
			};

			/**
			\brief SynchronizePrimaryScene updates the positions of the objects around the camera relative to the static and dynamic distances specified
			These objects are then put in a thread safe queue to be processed when the mirror scene synchronize is called

			\param[in] cameraPos The current position of the camera relative to where objects are being mirrored
			*/
			virtual void synchronizePrimaryScene(const physx::PxVec3 &cameraPos) = 0;

			/**
			\brief Processes the updates to get this mirrored scene to reflect the subset of the
			primary scene that is being mirrored.  Completely thread safe, assumes that
			the primary scene and mirrored scene are most likely being run be completely
			separate threads.
			*/
			virtual void synchronizeMirrorScene(void) = 0;

			/**
			\brief Releases the NxMirrorScene class and all associated mirrored objects; it is important to not that this does *not* release
			the actual APEX scnee; simply the NxMirrorScene helper class.
						*/
			virtual void release(void) = 0;

		};

	}; // end of apex namespace
}; // end of physx namespace

#endif // NX_SDK_VERSION_MAJOR

#endif


text:
FOUNDATION_EXPORT double AvatarImageViewVersionNumber;
FOUNDATION_EXPORT const unsigned char AvatarImageViewVersionString[];


text:
<?php

namespace Chrisguitarguy\Plot\Core;

use Chrisguitarguy\Plot\Environment;
use Chrisguitarguy\Plot\Node\Node;
use Chrisguitarguy\Plot\Exception\BadCallException;

final class LogicalOr
{
    public function __invoke(array $nodes, Environment $env, Node $self)
    {
        if (count($nodes) < 1) {
            throw new BadCallException(sprintf(
                '`or` expects at least 1 argument, got %d near %s',
                count($nodes),
                $self->context()
            ));
        }

        foreach ($nodes as $node) {
            if ($node->evaluate($env)) {
                return true;
            }
        }

        return false;
    }
}