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

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation marks this class as a holder of a set of configuration settings.
 * @author jmolnar
 */
@Retention( RetentionPolicy.RUNTIME)
@Target( ElementType.TYPE )
public @interface Settings {
    /**
     * The prefix to place to prepend to settings names if they are indicate they want a prefix.
     * Subclasses can override the prefix name that will be used.
     * @return the prefix
     */
    String prefix( ) default "";
}


text:
#include "stdafx.h"
#include "Visualizer.h"
#include "Config.h"

namespace
{
	const char* cDays[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
}
namespace
{
	struct DateTime
	{
		int m_date;
		int m_time;
	};
}

ostream& operator << (ostream& stream, SYSTEMTIME& time)
{
	stream<<setw(4)<<setfill('0')<<time.wYear<<':';
	stream<<setw(2)<<setfill('0')<<time.wMonth<<':';
	stream<<setw(2)<<setfill('0')<<time.wDay;
	if (time.wDayOfWeek < _countof(cDays))
	{
		const char* day = cDays[time.wDayOfWeek];
		stream<<" ("<<day<<")";
	}
	stream<<" - ";
	stream<<setw(2)<<setfill('0')<<time.wHour<<':';
	stream<<setw(2)<<setfill('0')<<time.wMinute<<':';
	stream<<setw(2)<<setfill('0')<<time.wSecond<<".";
	stream<<setw(3)<<setfill('0')<<time.wMilliseconds;
	return stream;
}

VISUALIZER_API HRESULT WINAPI SYSTEMTIME_Format(DWORD address, DEBUGHELPER* helper, int /*base*/, BOOL /*bUniStrings*/, char* buffer, size_t max, DWORD /*reserved*/)
{
	prolog;
	SYSTEMTIME time;
	HRESULT result = debugger.Read(time);
	return_if_failed(result);
	stream<<time;
	return S_OK;
}

VISUALIZER_API HRESULT WINAPI CDateTime_Format(DWORD address, DEBUGHELPER* helper, int /*base*/, BOOL /*bUniStrings*/, char* buffer, size_t max, DWORD /*reserved*/)
{
	prolog;
	__int64 time;
	HRESULT result = debugger.Read(time);
	return_if_failed(result);
	time += 11644473600000;
	time *= 10000;
	SYSTEMTIME systemTime;
	FileTimeToSystemTime(reinterpret_cast<FILETIME*>(&time), &systemTime);
	stream<<systemTime;
	return S_OK;
}

VISUALIZER_API HRESULT WINAPI FILETIME_Format(DWORD address, DEBUGHELPER* helper, int /*base*/, BOOL /*bUniStrings*/, char* buffer, size_t max, DWORD /*reserved*/)
{
	prolog;
	FILETIME file;
	HRESULT result = debugger.Read(file);
	return_if_failed(result);
	SYSTEMTIME time;
	FileTimeToSystemTime(&file, &time);
	stream<<time;
	return S_OK;
}

namespace
{
	/// Magic numbers
	enum
	{
		SECONDS_PER_DAY = 86400,
		SECONDS_PER_HOUR = 3600,
		SECONDS_PER_MIN = 60,
		MINUTES_PER_HOUR = 60,

		MILLIS_PER_DAY = 86400000,
		MILLIS_PER_HOUR = 3600000,
		MILLIS_PER_MIN = 60000,
		MILLIS_PER_SEC = 1000,

		// time_t epoch (1970-01-01) as a Julian date
		JULIAN_19700101 = 2440588
	};
	void GetYMD(int jday, WORD& year, WORD& month, WORD& day)
	{
		int a = jday + 32044;
		int b = (4 * a + 3) / 146097;
		int c = a - int ((b * 146097) / 4);
		int d = (4 * c + 3) / 1461;
		int e = c - int ((1461 * d) / 4);
		int m = (5 * e + 2) / 153;
		day = e - int ((153 * m + 2) / 5) + 1;
		month = m + 3 - 12 * int (m / 10);
		year = b * 100 + d - 4800 + int (m / 10);
	}
	void GetHMS(int time, WORD& hour, WORD& minute, WORD& second, WORD& millis)
	{
		int ticks = time / MILLIS_PER_SEC;
		hour = static_cast<WORD>(ticks / SECONDS_PER_HOUR);
		minute = static_cast<WORD>((ticks / SECONDS_PER_MIN) % MINUTES_PER_HOUR);
		second = static_cast<WORD>(ticks % SECONDS_PER_MIN);
		millis = static_cast<WORD>(time % MILLIS_PER_SEC);
	}
}

VISUALIZER_API HRESULT WINAPI FixTimeStamp_Format(DWORD address, DEBUGHELPER* helper, int /*base*/, BOOL /*bUniStrings*/, char* buffer, size_t max, DWORD /*reserved*/)
{
	prolog;
	DateTime fixtime;
	int offset = gConfig.IsDestructorVirtual? sizeof(int) : 0;
	HRESULT result = debugger.Read(address + offset, fixtime);
	return_if_failed(result);

	SYSTEMTIME time;
	ZeroMemory(&time, sizeof(time));

	GetYMD(fixtime.m_date, time.wYear, time.wMonth, time.wDay);
	GetHMS(fixtime.m_time, time.wHour, time.wMinute, time.wSecond, time.wMilliseconds);

	// calculate day of weak
	FILETIME fileTemp;
	ZeroMemory(&fileTemp, sizeof(fileTemp));

	SYSTEMTIME systemTemp;
	ZeroMemory(&systemTemp, sizeof(systemTemp));

	SystemTimeToFileTime(&time, &fileTemp);
	FileTimeToSystemTime(&fileTemp, &systemTemp);

	time.wDayOfWeek = systemTemp.wDayOfWeek;
	stream<<time;
	return S_OK;
}

redpajama_set_name: RedPajamaGithub


text:
package com.devopsbuddy;

import java.util.HashSet;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import com.devopsbuddy.backend.persistence.domain.backend.Plan;
import com.devopsbuddy.backend.persistence.domain.backend.Role;
import com.devopsbuddy.backend.persistence.domain.backend.User;
import com.devopsbuddy.backend.persistence.domain.backend.UserRole;
import com.devopsbuddy.backend.service.PlanService;
import com.devopsbuddy.backend.service.UserService;
import com.devopsbuddy.enums.PlansEnum;
import com.devopsbuddy.enums.RolesEnum;
import com.devopsbuddy.utils.UserUtils;

@SpringBootApplication

public class DevopsbuddyApplication implements CommandLineRunner{

	@Autowired
	private UserService userService;

	@Autowired
	private PlanService planService;

	@Value("${webmaster.username}")
	private String webmasterUsername;

	@Value("${webmaster.password}")
	private String webmasterPassword;

	@Value("${webmaster.email}")
	private String webmasterEmail;

	private Logger LOG = LoggerFactory.getLogger(DevopsbuddyApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(DevopsbuddyApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception{

		LOG.info("Creating Basic and Pro plans in the database...");
		planService.createPlan(PlansEnum.BASIC.getId());
		planService.createPlan(PlansEnum.PRO.getId());

		String username = webmasterUsername;
		String email = webmasterEmail;
		User user = UserUtils.createBasicUser(username, email);
		user.setPassword(webmasterPassword);
		Set<UserRole> userRoles = new HashSet<>();
		userRoles.add(new UserRole(user, new Role(RolesEnum.ADMIN)));
		userService.createUser(user, PlansEnum.PRO, userRoles);
	}
}


text:
package com.google.javascript.jscomp;

import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.Ordering;
import com.google.javascript.rhino.IR;
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.Token;
import java.util.List;

/**
 * Replaces user-visible messages with appropriate calls to
 * chrome.i18n.getMessage. The first argument to getMessage is the id of the
 * message, as a string. If the message contains placeholders, the second
 * argument is an array of the values being used for the placeholders, sorted
 * by placeholder name.
 *
 * @author tbreisacher@google.com (Tyler Breisacher)
 */
@GwtIncompatible("JsMessage")
class ReplaceMessagesForChrome extends JsMessageVisitor {

  ReplaceMessagesForChrome(AbstractCompiler compiler,
      JsMessage.IdGenerator idGenerator,
      boolean checkDuplicatedMessages, JsMessage.Style style) {

    super(compiler, checkDuplicatedMessages, style, idGenerator);
  }

  private static Node getChromeI18nGetMessageNode(String messageId) {
    Node chromeI18n = IR.getprop(IR.name("chrome"), IR.string("i18n"));
    Node getMessage =  IR.getprop(chromeI18n, IR.string("getMessage"));
    return IR.call(getMessage, IR.string(messageId));
  }

  @Override
  protected void processJsMessage(
      JsMessage message, JsMessageDefinition definition) {
    try {
      Node msgNode = definition.getMessageNode();
      Node newValue = getNewValueNode(msgNode, message);
      newValue.useSourceInfoIfMissingFromForTree(msgNode);

      msgNode.replaceWith(newValue);
      compiler.reportChangeToEnclosingScope(newValue);
    } catch (MalformedException e) {
      compiler.report(JSError.make(e.getNode(),
          MESSAGE_TREE_MALFORMED, e.getMessage()));
    }
  }

  private Node getNewValueNode(Node origNode, JsMessage message)
      throws MalformedException {
    Node newValueNode = getChromeI18nGetMessageNode(message.getId());

    if (!message.placeholders().isEmpty()) {
      Node placeholderValues = origNode.getLastChild();
      checkNode(placeholderValues, Token.OBJECTLIT);

      // Output the placeholders, sorted alphabetically by placeholder name,
      // regardless of what order they appear in the original message.
      List<String> placeholderNames = Ordering.natural().sortedCopy(message.placeholders());

      Node placeholderValueArray = IR.arraylit();
      for (String name : placeholderNames) {
        Node value = getPlaceholderValue(placeholderValues, name);
        if (value == null) {
          throw new MalformedException(
              "No value was provided for placeholder " + name,
              origNode);
        }
        placeholderValueArray.addChildToBack(value);
      }
      newValueNode.addChildToBack(placeholderValueArray);
    }

    newValueNode.useSourceInfoIfMissingFromForTree(origNode);
    return newValueNode;
  }

  private static Node getPlaceholderValue(
      Node placeholderValues, String placeholderName) {
    for (Node key : placeholderValues.children()) {
      if (key.getString().equals(placeholderName)) {
        return key.getFirstChild().cloneTree();
      }
    }
    return null;
  }
}


text:
using System;
using System.Runtime.InteropServices;

namespace Autopsy.Formats.PeCoff.Directories
{
    /// <summary>
    /// IMAGE_DATA_DIRECTORY
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public class DataDirectory
    {
        public UInt32 VirtualAddress;

        public UInt32 Size;
    }
}


text:
void CefFindHandlerCToCpp::OnFindResult(CefRefPtr<CefBrowser> browser,
    int identifier, int count, const CefRect& selectionRect,
    int activeMatchOrdinal, bool finalUpdate) {
  if (CEF_MEMBER_MISSING(struct_, on_find_result))
    return;

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Verify param: browser; type: refptr_diff
  DCHECK(browser.get());
  if (!browser.get())
    return;

  // Execute
  struct_->on_find_result(struct_,
      CefBrowserCppToC::Wrap(browser),
      identifier,
      count,
      &selectionRect,
      activeMatchOrdinal,
      finalUpdate);
}

#ifndef NDEBUG
template<> long CefCToCpp<CefFindHandlerCToCpp, CefFindHandler,
    cef_find_handler_t>::DebugObjCt = 0;
#endif


text:
/**
 * @file
 * This file is used to style the layout builder.
 */

.layout-builder__message--defaults .messages,
.layout-builder__message--overrides .messages {
  background-image: none;
}
.layout-builder__message--defaults .messages__content {
  background-image: url("../../../../../../../misc/icons/73b355/globe.svg");
}
.layout-builder__message--overrides .messages__content {
  background-image: url("../../../../../../../misc/icons/73b355/location.svg");
}


text:
// ============================================================================
// [Include Section]
// ============================================================================
#include <iostream>
#include <SDL2/SDL.h>

#include "vgl.h"
#include "SdlApplication.h"
#include "LoadShaders.h"

// ============================================================================
// [SdlApplication]
// ============================================================================
#define APPTITLE "SDL Template Program"
// SdlApplication is nothing more than thin wrapper to SDL library. You need
// just to instantiate it and call run() to enter the SDL event loop.

SdlApplication::SdlApplication() :
_running(false)
{
}

SdlApplication::~SdlApplication()
{
	destroy();
}

int SdlApplication::init(int width, int height)
{
	// Initialize the SDL library.
	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
	{
		fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
		return APP_FAILED;
	}

    // Request opengl 4.1 context
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);

    /* Turn on double buffering with a 24bit Z buffer.
     * You may need to change this to 16 or 32 for your system */
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);

	win = SDL_CreateWindow(APPTITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);
    maincontext = SDL_GL_CreateContext(win);

	// Success.
	return APP_OK;
}

void SdlApplication::destroy()
{
	if (win)
	{
		SDL_DestroyWindow(win);
		SDL_Quit();
	}
}

int SdlApplication::run(int width, int height)
{
	// Initialize application.
	int state = init(width, height);
	if (state != APP_OK) return state;

	// Enter to the SDL event loop.
	SDL_Event ev;
	_running = true;

	while (SDL_WaitEvent(&ev))
	{
		onEvent(&ev);
		Render();

		if (_running == false)
		{
			break;
		}
	}

	return APP_OK;
}

void SdlApplication::onEvent(SDL_Event* ev)
{
	switch (ev->type)
	{
		case SDL_QUIT:
			_running = false;
			break;

		case SDL_KEYDOWN:
		{
			if (ev->key.keysym.sym == SDLK_ESCAPE)
			{
				_running = false;
			}
		}
	}
}

void SdlApplication::Render()
{
    /* This makes our buffer swap syncronized with the monitor's vertical refresh */
    SDL_GL_SetSwapInterval(1);

    glClear(GL_COLOR_BUFFER_BIT);

    /* Swap our back buffer to the front */
    SDL_GL_SwapWindow(win);
}


text:
"""
Defines the `Component` (base) class, which you can can use to create "View
classes" - logical units of HTML and CSS. It also automates linking up a
JavaScript class to manage the behaviour of the HTML elements it defines, and
linking up RPC methods between the Python and JavaScript sides of the class.

For now, everything is in UTF-8
"""
# TODO: document all the customization points / low-level details *urgh*
# TODO: need examples

from uuid import uuid4
from hashlib import md5
from os import path

import mythril.css

# A kind of "forward define"
Component = None

class ComponentMeta(type):
    def __init__(cls, name, bases, attrs):
        if Component:
            cls.js_class = name

            cssfrag = mythril.css.dumps(cls.css) if cls.css else ''
            if cssfrag:
                oldhash = Component.css_md5.digest()
                Component.css_md5.update(cssfrag)
                filebase = path.join(mythril.css.resource_file_path, 'component_')

class Component(object):
    """
    Base class for defining logical units of HTML, CSS & JS. Define a class
    attribute ``css`` to attach style information, and define a (parameterless)
    method ``html`` to specify how the ``Component`` is rendered.  ``css``
    should hold a something serializable by `mythril.css.dumps`, and the
    ``html`` method must return an HTML element; the modules `mythril.css` and
    `mythril.html` contain the helper classes representing CSS styles and HTML
    elements for this purpose. Importantly, ``Component``s are directly
    serializable by `mythril.html.dumps`, so you can render other components
    recursively (mixed together with HTML and so on). Each Component is given
    a unique id, which is transferred to the ``html`` (return) value as its "id"
    attribute.

    The CSS for all of your components is compiled into a single CSS file that
    you can then include on the page (this could be extended to support
    multiple CSS files, but this is optimal for 99.99% of websites). This file
    is stored in `mythril.css.resource_file_path` and accessible from
    `mythril.css.resource_url_path` (remember to configure these) as
    component_<...>.css where <...> is an MD5 hash for cache-busting goodness.
    See this module's use `Component.css_file_name` to get the current name.

    For each ``Component`` class, you can define a corresponding JavaScript
    class (in fact, deriving from the ``Component`` JS class in the JS file
    "mythril.js" in this package). By default, it should have the same name as
    the Python class and be exposed in the global ``window`` scope.  If so, the
    JavaScript class is instantiated for every use of the ``Component`` on the
    page/AJAX response/etc., and is given the HTML element representing the
    HTML part of the ``Component``. So it is able to organize the behaviours for
    the HTML, and there are helpers in the JS ``Component`` class for this
    purpose, including jQuery integration.

    Finally, your ``Component`` class can define RPC methods. That is, for each
    RPC method on the (Python) ``Component`` class, there will be defined a
    method on the JavaScript class which will RPC (ie., AJAX) that method. In
    addition to wrapping up the AJAX, it includes protections for XSRF and works
    cross-domain.
    """
    __metaclass__ = ComponentMeta
    css = None
    css_md5 = md5()
    js_class = ''

    def __init__(self, *args, **kwargs):
        self.id = u'_' + uuid4().hex
        self.init(*args, **kwargs)

    def init(self, *args, **kwargs): pass
    def html(self): pass

    def __html__(self, writer):
        elem = self.html()


text:
void layman_image::add_edge(int x, int y, int type)
{
	int reference = m_edgeCount-1;
	m_pEdgeList[reference].x = x;
	m_pEdgeList[reference].y = y;
	m_pEdgeList[reference].edgeType = type;
	m_pEdgeList[reference].group = -1;
	m_pEdgeArray[x][y] = m_edgeCount-1;
}

short int layman_image::vs_detect(Magick::PixelPacket *group)
{
	int intensities[9], side_one, side_two;
	short int ret_value = 1;
	for(int counter=0; counter<9; counter++)
	{
		intensities[counter] = (group+counter)->red + (group+counter)->green + (group+counter)->blue;
	}
	side_one = intensities[0] + intensities[3] + intensities[6];  //draw a 3x3 group; mark the center and then look at this code again.  It'll make sense
	side_two = intensities[2] + intensities[5] + intensities[8];
	if(abs(side_one-side_two) > m_detectionThreshold){ret_value *= 2;}
	side_one = side_one - intensities[6] + intensities[1];
	side_two = side_two - intensities[2] + intensities[7];
	if(abs(side_one-side_two) > m_detectionThreshold){ret_value *= 3;}
	side_one = side_one - intensities[3] + intensities[2];
	side_two = side_two - intensities[5] + intensities[6];
	if(abs(side_one-side_two) > m_detectionThreshold){ret_value *= 5;}
	side_one = side_one - intensities[0] + intensities[5];
	side_two = side_two - intensities[8] + intensities[3];
	if(abs(side_one-side_two) > m_detectionThreshold){ret_value *= 7;}
	return ret_value;
}

float layman_image::edge_detect(Magick::Image * input, Magick::Image * output = NULL)
{
	int *y_list = (int*) malloc(sizeof(int)*m_heigth);
	Magick::PixelPacket *group;
	int diagnol;
	for(int pos_y=0; pos_y < m_heigth-(SKIP+3); pos_y += SKIP)
	{
		for(int pos_x=0; pos_x < m_width -(SKIP+3); pos_x +=SKIP)
		{
			group = input->getPixels(pos_x,pos_y,3,3);
			diagnol = vs_detect(group);
			if(diagnol > 1)
			{
				m_edgeCount++;
				if(output != NULL)
				{
					output->pixelColor(pos_x+1,pos_y+1,"black");
					add_edge(pos_x+1,pos_y+1,diagnol);
				}
			}
			y_list[pos_y] = m_edgeCount-1; //gives an index for the start of each y group in the edge list
		}
	}
	free(y_list);
	return m_edgeCount;
}

int layman_image::density_calibration()
{
	int high_th = 100000, low_th = 100;
	int pixels, detected;
	float density = 0.0;

	pixels = m_area;
	while(density < LOW_DENSITY || density > HIGH_DENSITY)
	{
		detected = edge_detect(&m_input);
		density = float(detected)/pixels;
		if(density <  LOW_DENSITY)
		{
			printf("Low Density: %.2f\n", density);
			low_th = m_detectionThreshold;
			m_detectionThreshold = (high_th + low_th)/2;
		}
		else
		{
			printf("High Density: %.2f\n", density);
			high_th = m_detectionThreshold;
			m_detectionThreshold = (high_th + low_th)/2;
		}

	}
	printf("Density: %.2f  Threshold: %d\n", density, m_detectionThreshold);

	//retune this
	m_pEdgeList = (edge *) malloc(sizeof(edge) * m_area);
	m_pEdgeArray  = (int **) malloc(sizeof(int **) * m_width);
	for(int x = 0; x< m_width; x++)
	{
		m_pEdgeArray[x] = (int *) malloc(sizeof(int) * m_heigth);
		for(int y = 0; y < m_heigth; y++)
		{
			m_pEdgeArray[x][y] = -1;
		}
	}

	return detected;
}


text:
aliyun.ecs.model module
=======================

.. automodule:: aliyun.ecs.model
    :members:
    :undoc-members:
    :show-inheritance:


text:
SuperSmash
==========

MVHS Super Smash

## Roadmap ##
1. Basic app
    - [LWJGL](http://lwjgl.org/)
    - [LibGDX](https://github.com/libgdx/libgdx/)
    - [Narya](https://github.com/threerings/narya)
    - Physics Engines
        - [JBox2D](http://www.jbox2d.org/)
2. Network
	- [Java Sockets](http://www.prasannatech.net/2008/07/socket-programming-tutorial.html)
    - [P2P](http://gamedevelopment.tutsplus.com/tutorials/building-a-peer-to-peer-multiplayer-networked-game--gamedev-10074 "P2P")
    - [UDP](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/ "UDP")
    - [Kryo Java Library](https://github.com/EsotericSoftware/kryonet)
    - [Nadron Java Library](https://github.com/menacher/java-game-server)
3. Development Libraries


text:
 (function($){
    $.fn.AutoConfirmButton = function(options) {

        var settings = $.extend({
            textConfirm:        'Sure?',
            textConfirmed:      '<i class="fa fa-check"></i>',
            classConfirm:       'btn-danger',
            classStandby:       'btn-warning',
            disableOnConfirm:   true,
            cancelTime:         2000,
            onFirstClickBefore: function(element){},
            onFirstClickAfter:	function(element){},
            onConfirm:          function(element){},
            allowFirstClick:	true
        }, options );

		this.each(function() {

    		var btn = $(this);

    		btn.on("click", function(){
        		if(btn.data("clicked") == "true"){

                    btn.blur()
                    .data("clicked","false")
                    .html(settings.textConfirmed)
    				.removeClass(settings.classConfirm)
    				.addClass(settings.classStandby);

    				if(settings.disableOnConfirm){
        				btn.addClass("disabled");
    				}

            		settings.onConfirm(btn);

        		}else{

            		settings.onFirstClickBefore(btn);

            		if(settings.allowFirstClick){

            			btn.data("clicked","true")
            			   .removeClass(settings.classStandby)
            			   .addClass(settings.classConfirm)
            			   .data("text",btn.text())
            			   .text(settings.textConfirm);

            			var retorno = setTimeout(function(){
            				if(btn.data("clicked") == "true"){
            					btn.data("clicked","false");
            					btn.removeClass(settings.classConfirm)
            					   .addClass(settings.classStandby)
            					   .text(btn.data('text'));
            				}
            			}, settings.cancelTime);

                        settings.onFirstClickAfter(btn);

        			}
        		}

        		return false;
    		});

		});

    };
})(jQuery);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>org.sdnplatform.sync.internal.util</title>
<meta name="date" content="2015-06-22">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.sdnplatform.sync.internal.util

Class Summary

Class
Description

ByteArray

A byte array container that provides an equals and hashCode pair based on the
 contents of the byte array.

CryptoUtil

EmptyClosableIterator<T>

Pair<F,S>

Represents a pair of items.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
<?php

/**
 * Yii 1.x.x rest component
 *
 * @author Ali MasudianPour <masud.amp@gmail.com>
 * @thanks hackerone
 * @link https://github.com/masudianpour/yrest Source files
 */

/**
 * CLIENT Class
 * To receive REST Responses
 */
class Client extends CBehavior {

    //available && callable methods
    private $availableMethods = array(
        'GET',
        'POST',
        'PUT',
        'DELETE'
    );

    /**
     * __call magic method, to prevent repetition
     * @throws CException
     */
    public function __call($name, $parameters) {
        if (!in_array(strtoupper($name), $this->availableMethods)) {
            throw new CException('Invalid Method Name');
        }
        $name = strtolower($name);
        return Yii::app()->YRest->$name($parameters[0], isset($parameters[1]) ? $parameters[1] : array());
    }

}

/**
 * SERVER Class
 * to implement REST responses
 */
class Server extends CBehavior {

    //required basic authentication or not
    public $auth = FALSE;
    //basic authentication's username
    public $username = '';
    //basic authentication's password
    public $password = '';

    /**
     * Constructor of Server behaviour
     *
     * Setting custom error and exception handlers to send exceptions and errors in
     * json format
     *
     */
    public function __construct() {
        //errors customization
        Yii::app()->attachEventHandler('onError', array($this, 'handleError'));
        //exceptions customization
        Yii::app()->attachEventHandler('onException', array($this, 'handleError'));
    }

    //status codes and their relevant messages
    private static $codes = array(
        200 => 'OK',
        400 => 'Bad Request', //TODO: USE DEFINES CLASS HERE
        401 => 'Unauthorized',
        402 => 'Payment Required',
        403 => 'Forbidden',
        404 => 'Not Found',
        500 => 'Internal Server Errror',
        501 => 'Not Implemented',
    );

    /**
     * to get/produce server signature
     *
     * @access public
     * @return string server signature
     */
    public static function getServerSignature() {
        return empty($_SERVER['SERVER_SIGNATURE']) ?
                $_SERVER['SERVER_SOFTWARE'] .
                ' Server at ' .
                $_SERVER['SERVER_NAME'] . ' Port ' .
                $_SERVER['SERVER_PORT'] :
                $_SERVER['SERVER_SIGNATURE'];
    }

    /**
     * to check basic authntication
     */
    public function checkAuth() {
        //if no basic authentication header has been sent
        if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
            //authentication failed
            self::response(401);
        }

        //getting username
        $username = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : (isset($_SERVER['HTTP_X_USERNAME']) ? $_SERVER['HTTP_X_USERNAME'] : NULL);
        //getting password
        $password = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : (isset($_SERVER['HTTP_X_PASSWORD']) ? $_SERVER['HTTP_X_PASSWORD'] : NULL);

        if (is_null($password) || is_null($username)) {
            //authentication failed
            $this->response(401);
        }
        /*
         * +++++++++++++++++++++++++++++++++++++
         * NOTE:
         * in order to customize your own authentication username and password, $auth
         * array must be changed in your custom way
         * +++++++++++++++++++++++++++++++++++++
         */
        $auth = array(
            'username' => $this->username, //default username from extension's options
            'password' => $this->password   //default password from extension's options
        );
        if ($username !== $auth['username'] || $password !== $auth['password']) {
            //authentication failed
            $this->response(401);
        }
    }

    /**
     * The main method to send response to user in REST way
     *
     * --Note, Default and only content-type which is supported by now, it Json
     * --You can customize your own with some others like XML and so on...
     *
     * @access public
     * @param integer $status output header status code
     * @param mixed $body the output to send in answer of request in response
     * @param string $contentType output content type which is JSON in default
     */
    public function response($status = 500, $body = '', $contentType = 'text/json') {
        //creating appropriate header string for REST reponse
        $header = 'HTTP/1.1 ' . $status . ' ' . self::getStatusCodeMessage($status);
        header($header);
        header('Content-type:' . $contentType);

        if ($body === '' || empty($body)) {
            $body = $status . ' ' . self::getStatusCodeMessage($status);
        }
        //Encoding response to json
        echo CJSON::encode(self::formatOutput($body));
        //closing the connection with appropriate status code
        self::close($status);
    }

    /**
     * To close the connection
     *
     * @access private
     * @param integer $status header status
     */
    private static function close($status) {
        Yii::app()->end($status);
    }

    /**
     * to get the status code's message
     *
     * @access private
     * @param integer $status status code
     * @return mixed message/code
     */
    private static function getStatusCodeMessage($status) {
        return isset(self::$codes[$status]) ? self::$codes[$status] : $status;
    }

    /**
     * To Format the reponse Output
     * this method is customizable to your own. You can easily change your output
     * by changing the following method
     *
     * @param mixed $output output which must be shown in reponse
     * @return array the response array
     */
    private static function formatOutput($output) {
        return array(
            'RESPONSE' => $output,
            'TIME' => date('Y F d D h:i:s', time()),
            'TIMESTAMP' => time(),
            'IP' => $_SERVER['REMOTE_ADDR'],
            'REQUEST_URL' => Yii::app()->request->getUrl(),
            'SIGNATURE' => self::getServerSignature()
        );
    }

    const RESPONSE_KEY = 'RESPONSE';
    const RESPONSE_STATUS_KEY = 'STATUS';
    const RESPONSE_RESULT_KEY = 'RESULT';

    /**
     * To get the request type
     *
     * @access public
     * @return string request type
     */
    public function getRequestType() {
        return Yii::app()->request->getRequestType();
    }

    /**
     * To check the request type
     *
     * @access public
     * @param string $requestMethod request to check
     */
    public function checkRequest($requestMethod) {
        //getting current request
        $request = $this->getRequestType();
        //if was not our willing request, it responses an invalid/bad request message
        if ($request === NULL || $request !== $requestMethod) {
            self::response(400);
        }
    }

    /**
     * to customize errors/exceptions
     *
     * @access public
     * @param CEvent $event
     * @depends RestServer
     */
    public function handleError(CEvent $event) {
        //if any exception occured, we show that in our customized way
        if ($event instanceof CExceptionEvent) {

            self::response(500, array(
                'STATUS' => FALSE,
                'RESULT' => 'EXCEPTION',
                'MESSAGE' => $event->exception->getMessage(),
                'CODE' => $event->exception->getCode(),
                'FILE' => $event->exception->getFile(),
                'LINE' => $event->exception->getLine()
            ));
        }
        //if any error occured, we show that in our customized way
        if ($event instanceof CErrorEvent) {
            self::response(500, array(
                'STATUS' => FALSE,
                'RESULT' => 'EXCEPTION',
                'MESSAGE' => isset($event->message) ? $event->message : NULL,
                'CODE' => isset($event->code) ? $event->code : NULL,
                'FILE' => isset($event->file) ? $event->file : NULL,
                'LINE' => isset($event->line) ? $event->line : NULL
            ));
        }
    }

}

//Main Extension Class
class YRest extends CComponent {

    // Options Constants
    const OPT_C_USERNAME = 'clientUsername';
    const OPT_C_PASSWORD = 'clientPassword';
    const OPT_S_USERNAME = 'serverUsername';
    const OPT_S_PASSWORD = 'serverPassword';
    const OPT_HTTPS = 'https';
    const OPT_URL = 'url';
    const OPT_AUTH = 'serverAuthRequired';

    //Curl Object
    private $curl;
    //url
    private $url;
    //options here
    public $options;
    //initial curl configuration
    private $curlConf = array(
        CURLOPT_RETURNTRANSFER => TRUE,
        CURLOPT_CONNECTTIMEOUT => 30,
        CURLOPT_TIMEOUT => 30
    );

    /**
     * extension initial method.
     * All default settings take place at this function
     *
     * @access public
     * @return YRest
     * @throws CException
     */
    public function init() {
        //attaching server behaivour
        $this->attachBehavior('Server', 'Server');
        //sending options to Server behaviour
        $this->Server->username = $this->options[YRest::OPT_S_USERNAME];
        $this->Server->password = $this->options[YRest::OPT_S_PASSWORD];
        $this->Server->auth = $this->options[YRest::OPT_AUTH];
        //End - sending options to Server behaviour
        //attaching Client behaviour
        $this->attachBehavior('Client', 'Client');
        //enabling Behaviours
        $this->enableBehaviors();

        //making url whether with HTTPS or HTTP
        $this->url = $this->options[YRest::OPT_HTTPS] ? 'https://' : 'http://';
        /*
         * if authentication is required by server, clientUsername and ClientPassword
         * should be passed as options throus extension to use them here.
         */
        if (!empty($this->options[YRest::OPT_C_USERNAME]) && !empty($this->options[YRest::OPT_C_PASSWORD])) {
            $this->url.=$this->options[YRest::OPT_C_USERNAME] . ':' . $this->options[YRest::OPT_C_PASSWORD] . '@';
        }
        //appending the main url
        $this->url.=!empty($this->options[YRest::OPT_URL]) ? $this->options[YRest::OPT_URL] : '';

        /*
         * if serverAuthRequired was TRUE, it'd check the authentication
         */
        if ($this->Server->auth) {
            $this->Server->checkAuth();
        }

        //preparation for CURL
        try {
            $this->curl = curl_init();
            $this->setOptions($this->curlConf);
            $curl = $this->curl;
            Yii::app()->onEndRequest = function() use(&$curl) {
                curl_close($curl);
            };
        } catch (Exception $ex) {
            throw new CException('NO CURL');
        }
        return $this;
    }

    /**
     * gets the CURL error string
     * @access public
     * @return string CURL error
     */
    public function getError() {
        return curl_error($this->curl);
    }

    /**
     * to set an option to curl with a key and value
     *
     * @access public
     * @param string $key the option's key
     * @param string $value the option's value
     * @return YRest
     */
    public function setOptions($keys = array()) {
        curl_setopt_array($this->curl, $keys);
        return $this;
    }

    /**
     * to set mor than one option to curl, which options will be set with data into
     * input argument
     *
     * @param array $keys options
     * @access public
     * @return YRest
     */
    public function setOption($key, $value) {
        curl_setopt($this->curl, $key, $value);
        return $this;
    }

    /**
     * to build a string, in order to append them via url parameters
     *
     * @access private
     * @param array $params parameters
     * @return string parameters string
     */
    private function appendParams($params = array()) {
        if (!empty($params)) {
            $result = '/';
            foreach ($params as $k => $v):
                $result.=$k . '/' . $v . '/';
            endforeach;
            //to remove the last slash
            return substr($result, 0, -1);
        }
    }

    /**
     * checks if curl has error or not
     *
     * @access private
     * @return boolean whether we have error in CURL request or not
     */
    private function hasError() {
        return curl_errno($this->curl);
    }

    /**
     * execution of request
     *
     * @access private
     * @param string $action the action/url to call
     * @return mixed !hasError ? result : exception
     * @throws CException
     */
    private function execute($action) {
        //if url is less than 10, so it is not a complete url. It means user
        //entered a full url address
        $url = strlen($this->url) < 10 ? $action : $this->url . $action;
        $this->setOption(CURLOPT_URL, $url);
        $result = curl_exec($this->curl);
        if (!$this->hasError()) {
            return $this->toArray($result, TRUE);
        } else {
            throw new CException($this->getError());
        }
    }

    /**
     * to convert an json object to array
     *
     * @access private
     * @param mixed $json json
     * @param boolean $assoc whether to return associate array or not
     * @return array array from json
     */
    private function toArray($json, $assoc = FALSE) {
        return CJSON::decode($json, $assoc);
    }

    /**
     * REST GET REQUEST
     *
     * @param string $action action to call
     * @param array $params parameteres that might be sent via request
     * @access public
     * @return mixed reponse
     */
    public function get($action, $params = array()) {
        $this->setOption(CURLOPT_HTTPGET, TRUE);
        return $this->execute($action . $this->appendParams($params));
    }

    /**
     * REST DELETE REQUEST
     *
     * @param string $action action to call
     * @param array $params parameteres that might be sent via request
     * @access public
     * @return mixed reponse
     */
    public function delete($action, $params = array()) {
        $this->setOption(CURLOPT_RETURNTRANSFER, TRUE);
        $this->setOption(CURLOPT_CUSTOMREQUEST, 'DELETE');
        return $this->execute($action . $this->appendParams($params));
    }

    /**
     * REST POST REQUEST
     *
     * @param string $action action to call
     * @param array $params parameteres that might be sent via request
     * @access public
     * @return mixed reponse
     */
    public function post($action, $params = array()) {
        $this->setOption(CURLOPT_POST, TRUE);
        $this->setOption(CURLOPT_POSTFIELDS, $params);
        return $this->execute($action);
    }

    /**
     * REST PUT REQUEST
     *
     * @param string $action action to call
     * @param array $params parameteres that might be sent via request
     * @access public
     * @return mixed reponse
     */
    public function put($action, $params = array()) {
        $this->init();
        $temp = fopen('php://temp', 'rw+');
        fwrite($temp, $this->putData($params));
        rewind($temp);
        $this->setOption(CURLOPT_PUT, TRUE);
        $this->setOption(CURLOPT_CUSTOMREQUEST, 'PUT');
        $this->setOption(CURLOPT_INFILE, $temp);

        return $this->execute($action, $this->appendParams($params));
    }

    /**
     * to build a string appropriate to send via PUT request
     *
     * @param array $params parameters
     * @access private
     * @return string put data string
     */
    private function putData($params = array()) {
        $data = "";
        foreach ($params as $k => $v):
            if ($k == 'id')
                continue;
            $data.="{$k}={$v}&";
        endforeach;
        return substr($data, 0, -1);
    }

}


text:
Example web applications using the crocodile-rtc library.

## Getting Started
get a copy of this repository:

````
git clone https://github.com/crocodilertc/crocodile-rtc-examples.git
````

Alternatively, download a zip file of the repository by clicking on the button to the right labelled _Download ZIP_.

The directory _dist_ contains concatenated, minified CSS and JavaScript files. _[Node.js][node]_ can be used to create a clean build of the _dist_ directory:

On the command line, If you have _[Node.js][node]_ installed, navigate to the directory of the example you would like to use and run the install command:

````
npm install
````

This downloads any dependencies that are needed to build a distribution of the project. Now on the command line run GRUNT to build a distribution of the project:

````
grunt
````

Once the command has finished loading, it will re-create the folder labelled _dist_. Add this folder to the same location of the web page you would like to use the example in.
For example; if the web page called _click2call.html_ is located in the folder _www_. A copy of the _dist_ folder should be placed in the _www_ folder.

Now you can use the example in your web page. The example below uses the _click-2-call_ application:

````html
<link href='dist/css/crocodilertc-click2call-plugin.min.css' rel='stylesheet' type='text/css'/>
<script src="dist/js/crocodilertc-click2call-plugin.min.js"></script>
<script>
  var config = {
    apiKey: 'FIXME',
    addressToCall: 'FIXME@crocodilertc.net',
    click2callDisplayName: 'FIXME'
  };
  croc_click2call(config);
</script>
````

This will create a click-2-call tab on the right hand side of your web page. You will need to replace the _FIXME_ place holder with appropriate values.

* The _apiKey_ property requires an API key registered on the Crocodile network. To register go to [https://www.crocodilertc.net/](https://www.crocodilertc.net/)
* The _addresssToCall_ property requires the address of a registered user for free calls. To make calls to non-registered numbers you will need to add balance to your API key.
* The _click2callDisplayName_ property requires a string of any characters except " This will be displayed to the recipient.

[node]: http://nodejs.org/

## Advanced Click-2-Call Distributions

### Building Lighter Click-2-Call applications

The Click-2-Call application can be configured to build _audio_ only or _video_ only versions of the application. The lighter build enables the application to load faster.
This option is intended for users that would like to only use audio or video.

To build an audio only version of the Click-2-Call application, run the command:

````
grunt audio
````

To build a video only version of the Click-2-Call application, run the command:

````
grunt video
````

### Build Click-2-Call to a Custom Directory

The Click-2-Call application uses image files that it MUST know the location of. It builds the application assuming that its default location will be in the _dist_ folder in the same location as the HTML page
that will be using it.

If you would like to place the _dist_ folder into a different location from the HTML page using it, run the command:

````
grunt --pathToDist='path/to/dist'
````

You will need to replace the value _path/to/dist_ with the path to the _dist_ folder you would like to use. The path can be absolute, or relative to the HTML page initiating the application.

Once the command has finished loading, it will re-create the folder labelled _dist_. Add this folder to the value of the _pathToDist_ option. For example;
if the web page called _click2call.html_ is located in the folder _www_ and the _pathToDist_ option is set to _path/to/dist_. A copy of the _dist_ folder should be placed
in the _www/path/to/_ directory resolving the _dist_ folder to _www/path/to/dist_.

## Documentation
For more details on the examples, see the [crocodile-rtc-wiki](https://wiki.crocodilertc.net/).


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FluentValidation.Results;

namespace Kangaroo.Infrastructure.CommandProcessor
{
    public interface ICommandBus
    {
        ICommandResult Submit<TCommand>(TCommand command) where TCommand : ICommand;
        ValidationResult Validate<TCommand>(TCommand command)
                                                where TCommand : ICommand;
    }
}


text:
package org.mvcspec.ozark.test.mvc;

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests Default Extension Implementation.
 *
 * @author Dmytro Maidaniuk
 */
public class DefaultExtensionIT {

    private String webUrl;
    private WebClient webClient;

    @Before
    public void setUp() {
        webUrl = System.getProperty("integration.url");
        webClient = new WebClient();
    }

    @After
    public void tearDown() {
        webClient.closeAllWindows();
    }

    @Test
    public void testString() throws Exception {
        HtmlPage page = webClient.getPage(webUrl + "resources/def-ext/string");
        assertEquals("/test-def-ext/resources", page.getElementById("basePath").asText());
        assertEquals("jsp", page.getElementById("defaultExtension").asText());
    }

    @Test
    public void testViewable() throws Exception {
        HtmlPage page = webClient.getPage(webUrl + "resources/def-ext/viewable");
        assertEquals("/test-def-ext/resources", page.getElementById("basePath").asText());
        assertEquals("jsp", page.getElementById("defaultExtension").asText());
    }

    @Test
    public void testResponse() throws Exception {
        HtmlPage page = webClient.getPage(webUrl + "resources/def-ext/response");
        assertEquals("/test-def-ext/resources", page.getElementById("basePath").asText());
        assertEquals("jsp", page.getElementById("defaultExtension").asText());
    }

    @Test
    public void testVoid() throws Exception {
        HtmlPage page = webClient.getPage(webUrl + "resources/def-ext/void");
        assertEquals("/test-def-ext/resources", page.getElementById("basePath").asText());
        assertEquals("jsp", page.getElementById("defaultExtension").asText());
    }
}


text:
<component name="ArtifactManager">
  <artifact type="war" name="Anime:war">
    <output-path>$PROJECT_DIR$/target</output-path>
    <root id="archive" name="anime-0.0.1-SNAPSHOT.war">
      <element id="artifact" artifact-name="Anime:war exploded" />
    </root>
  </artifact>
</component>


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class RoomInfoDisplay : MonoBehaviour
{
    public TextMeshProUGUI RoomName;
    public TextMeshProUGUI RoomMoney;
    public TMP_InputField RentInputField;
    public TextMeshProUGUI RoomPeople;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (GameController.obj.SelectedRoom == null)
        {
            gameObject.SetActive(false);
        }
        else
        {
            RoomMoney.text = GameController.obj.SelectedRoom.GetMoneyText();
        }
    }

    public void INPUT_Close()
    {
        GameController.obj.SelectedRoom = null;
        gameObject.SetActive(false);
    }

    public void SetUp()
    {
        RoomName.text = GameController.obj.SelectedRoom.Data.Name;
        RoomMoney.text = GameController.obj.SelectedRoom.GetMoneyText();
        RentInputField.text = GameController.obj.SelectedRoom.Rent.ToString();

        string people = "";
        if (GameController.obj.SelectedRoom.WorkNodes.Count > 0)
        {
            people += "\nEmployees:\n";
            foreach (WorkNode wn in GameController.obj.SelectedRoom.WorkNodes)
            {
                if (wn.Employee != null)
                {
                    people += wn.Employee.Name + "\n";
                }
                else
                {
                    people += "Vacancy\n";
                }
            }
        }
        if (GameController.obj.SelectedRoom.HomeNodes.Count > 0)
        {
            people += "\nResidents:\n";
            foreach (HomeNode hn in GameController.obj.SelectedRoom.HomeNodes)
            {
                if (hn.Resident != null)
                {
                    people += hn.Resident.Name + "\n";
                }
                else
                {
                    people += "Vacancy\n";
                }
            }
        }
        if (GameController.obj.SelectedRoom.LeisureNodes.Count > 0)
        {
            people += "\nCustomers:\n";
            foreach (LeisureNode ln in GameController.obj.SelectedRoom.LeisureNodes)
            {
                if (ln.Reservation != null)
                {
                    people += ln.Reservation.Name + "\n";
                }
                else
                {
                    people += "None (£" + ln.MoneyToUse.ToString("0") + ")\n";
                }
            }
        }

        RoomPeople.text = people;
    }

    public void INPUT_SetRentEditEnd()
    {
        string valueStr = RentInputField.text;
        int value;
        if (int.TryParse(valueStr, out value))
        {
            GameController.obj.SelectedRoom.Rent = value;
        }
    }
}


text:
// MIT License (MIT) - Copyright (c) 2014 jakevn - Please see included LICENSE file
using System;
using System.Collections.Generic;
using System.Net;
using UnityEngine;

namespace MassiveNet {
    // Param enum for RPC target endpoints
    public enum RpcTarget {
        /// <summary> Send an RPC to all connections, even if they are controllers. </summary>
        All,

        /// <summary> Send an RPC to all connections in the group, even if currently not in-scope. </summary>
        AllInclOutOfScope,

        /// <summary> Send an RPC only to the controllers of this NetView. </summary>
        Controllers,

        /// <summary> Send an RPC to all in-scope connections except for the controllers of this NetView. </summary>
        NonControllers,

        /// <summary> Send an RPC to the server of this netview. </summary>
        Server,

        None
    }

    internal enum ViewCmd : ushort {
        /// <summary> Instantiation command to a connection that is not the owner of the new NetView. </summary>
        CreateProxyView = 2030,

        /// <summary> Sender provides data for to create a new NetView with receiver as owner. </summary>
        CreateOwnerView = 2029,

        CreateCreatorView = 2028,

        CreatePeerView = 2027,

        /// <summary> Destroy the object associated with the NetViewID. </summary>
        DestroyView = 2026,

        /// <summary> View server has changed for supplied view ID. Sender of command is new server. </summary>
        ChangeServer = 2025,

        /// <summary> Sender tells client that the View has gone out of scope for them. </summary>
        OutOfScope = 2024,

        /// <summary> Sender provides stream for state synchronization. </summary>
        Sync = 2023
    }

    /// <summary>
    /// Handles creation, destruction, synchronization, and messaging for NetViews.
    /// </summary>
    public class NetViewManager : MonoBehaviour {

        /// <summary> How often Views should be synchronized across the network. </summary>
        public int SyncsPerSecond = 10;

        /// <summary> Incremental sync is designed to spread sync load across each frame. Since it is
        /// dependent on framerate and only beneficial when number of owned views is high, this should
        /// be set to false for clients. </summary>
        public bool IncrementalSync = true;

        /// <summary> The starting value for generating ViewIDs. </summary>
        private const int ViewIdMin = 1000;

        /// <summary> The maximum value for generating ViewIDs. </summary>
        private const int ViewIdMax = 1000000;

        public delegate int GetNewViewId();

        /// <summary> Delegate for generating a new ViewID. </summary>
        public GetNewViewId GenerateViewId;

        public delegate GameObject InstantiateViewPrefab(string prefabRoot, NetView.Relation relation);

        /// <summary> Delegate for instantiating a prefab. This is especially useful for pooling prefabs. </summary>
        public InstantiateViewPrefab InstantiatePrefab;

        public delegate void DestroyViewObj(GameObject view);

        internal delegate void NetViewCreated(NetView view);

        internal event NetViewCreated OnNetViewCreated;

        /// <summary> Delegate for destroying a NetView. Useful for returning to a pool. </summary>
        public DestroyViewObj DestroyViewObject;

        /// <summary> NetView lookup by ViewID. </summary>
        internal readonly Dictionary<int, NetView> ViewLookup = new Dictionary<int, NetView>();

        internal readonly List<NetView> Views = new List<NetView>();

        internal NetSocket Socket;

        private void Awake() {
            Socket = GetComponent<NetSocket>();
            Socket.Events.OnMessageReceived += ReceiveMessage;

            RegisterCommands();
        }

        private void LateUpdate() {
            if (IncrementalSync) IncrementalSyncViews();
            else if (!IsInvoking("TimedSyncViews")) Invoke("TimedSyncViews", 1f / SyncsPerSecond);
        }

        public bool TryGetView(int viewId, out NetView foundView) {
            if (ViewLookup.ContainsKey(viewId)) {
                foundView = ViewLookup[viewId];
                return true;
            }
            foundView = null;
            return false;
        }

        private void RegisterCommands() {
            Socket.Command.Register((ushort)ViewCmd.CreateProxyView, ReceiveCreateView,
                new List<Type> { typeof(int), typeof(int), typeof(string), typeof(NetStream) });
            Socket.Command.Register((ushort)ViewCmd.CreateOwnerView, ReceiveCreateView,
                new List<Type> { typeof(int), typeof(int), typeof(string), typeof(NetStream) });
            Socket.Command.Register((ushort)ViewCmd.CreateCreatorView, ReceiveCreateView,
                new List<Type> { typeof(int), typeof(int), typeof(string), typeof(NetStream), typeof(IPEndPoint) });
            Socket.Command.Register((ushort)ViewCmd.CreatePeerView, ReceiveCreateView,
                new List<Type> { typeof(int), typeof(int), typeof(string), typeof(NetStream), typeof(IPEndPoint) });
            Socket.Command.Register((ushort)ViewCmd.DestroyView, ReceiveDestroyView, new List<Type> { typeof(int) });
            Socket.Command.Register((ushort)ViewCmd.ChangeServer, ReceiveChangeServer, new List<Type> { typeof(int) });
            Socket.Command.Register((ushort)ViewCmd.OutOfScope, ReceiveOutOfScope, new List<Type> { typeof(int) });
            Socket.Command.Register((ushort)ViewCmd.Sync, DeliverSyncStream, new List<Type> { typeof(NetStream) });
        }

        private void DeliverSyncStream(NetMessage message, NetConnection connection) {
            if (!ViewLookup.ContainsKey((int)message.ViewId)) return;
            var view = ViewLookup[(int)message.ViewId];
            if (!view.IsController(connection) && connection != view.Server) {
                if (!connection.IsServer) {
                    NetLog.Warning("Connection attempting to send to unauthorized View: " + connection.Endpoint);
                    return;
                }
                view.Server = connection;
            }
            view.TriggerReadSync((NetStream)message.Parameters[0]);
        }

        private void ReceiveMessage(NetMessage message, NetConnection connection) {
            if (!ViewLookup.ContainsKey((int)message.ViewId)) return;

            string methodName = Socket.Rpc.IdToName(message.MessageId);
            var view = ViewLookup[(int)message.ViewId];

            if (!view.IsController(connection) && connection != view.Server) {
                if (!connection.IsServer) {
                    NetLog.Warning("Connection attempting to send to unauthorized View: " + connection.Endpoint);
                    return;
                }
                view.Server = connection;
            }
            view.DispatchRpc(methodName, message, connection);
        }

        /// <summary> Handles the OutOfScope command by triggering the OnOutOfScope delegate for the view. </summary>
        private void ReceiveOutOfScope(NetMessage message, NetConnection connection) {
            if (!connection.IsServer && !connection.IsPeer) return;

            int viewId = (int)message.Parameters[0];
            if (!ViewLookup.ContainsKey(viewId)) return;
            ViewLookup[viewId].Scope.FireOutEvent();
        }

        /// <summary> Sends a command to all controllers of the View that we are the new Server. </summary>
        internal void SendChangeViewServer(int viewId) {
            if (!ViewLookup.ContainsKey(viewId)) return;

            var view = ViewLookup[viewId];
            if (view.Controllers.Count == 0) return;

            var message = NetMessage.Create((ushort)ViewCmd.ChangeServer, 0, new object[] { viewId }, true);
            for (int i = 0; i < view.Controllers.Count; i++) view.Controllers[i].Send(message);
        }

        /// <summary> Handles the ChangeServer command by changing the View's Server to that of the sender. </summary>
        internal void ReceiveChangeServer(NetMessage message, NetConnection connection) {
            if (!connection.IsServer && !connection.IsPeer) return;

            int viewId = (int)message.Parameters[0];
            if (!ViewLookup.ContainsKey(viewId)) return;
            ViewLookup[viewId].Server = connection;
        }

        /// <summary> Post-instantiation configuration of NetView. </summary>
        private void RegisterNetView(NetView view) {

            if (view.CachedRpcObjects == null) view.SetRpcCache(RpcInfoCache.CreateInstanceLookup(view.gameObject));
            view.Scope.Trans = view.gameObject.transform;
            view.Socket = Socket;
            view.ViewManager = this;

            if (!ViewLookup.ContainsKey(view.Id)) ViewLookup.Add(view.Id, view);
            if (!Views.Contains(view)) Views.Add(view);
        }

        /// <summary> Destroys all Views being served by the supplied connection. </summary>
        public void DestroyViewsServing(NetConnection connection) {
            for (int i = Views.Count - 1; i >= 0; i--) {
                var view = Views[i];
                if (view.Server == connection) DestroyView(view);
            }
        }

        /// <summary> Destroys all Views that the supplied connection is authorized for. </summary>
        public void DestroyAuthorizedViews(NetConnection connection) {
            for (int i = connection.Authorizations.Count - 1; i >= 0; i--) {
                int viewId = connection.Authorizations[i];
                if (ViewLookup.ContainsKey(viewId)) DestroyView(ViewLookup[viewId]);
            }
        }

        /// <summary> Sends an RPC to connections that are in-scope for the provided view. </summary>
        internal void Send(NetView view, NetMessage netMessage, RpcTarget target) {
            switch (target) {
                case (RpcTarget.All):
                    for (int i = 0; i < Socket.Connections.Count; i++) {
                        var connection = Socket.Connections[i];
                        if (!connection.HasScope) continue;
                        if (view.Group != 0 && !connection.InGroup(view.Group)) continue;
                        if ((netMessage.Reliable && connection.Scope.In(view.Id)) || connection.Scope.In(view.Id, syncFrame) || view.IsController(connection)) connection.Send(netMessage);
                    }
                    break;
                case (RpcTarget.Controllers):
                    foreach (NetConnection controller in view.Controllers) {
                        if (controller == Socket.Self) continue;
                        controller.Send(netMessage);
                    }
                    break;
                case (RpcTarget.NonControllers):
                    for (int i = 0; i < Socket.Connections.Count; i++) {
                        var connection = Socket.Connections[i];
                        if (connection.IsServer || !connection.HasScope) continue;
                        if (view.IsController(connection)) continue;
                        if (view.Group != 0 && !connection.InGroup(view.Group)) continue;
                        if ((netMessage.Reliable && connection.Scope.In(view.Id)) || connection.Scope.In(view.Id, syncFrame)) connection.Send(netMessage);
                    }
                    break;
                case (RpcTarget.Server):
                    if (view.Server != Socket.Self) view.Server.Send(netMessage);
                    else NetLog.Warning("Trying to send message to self.");
                    break;
                case (RpcTarget.AllInclOutOfScope):
                    for (int i = 0; i < Socket.Connections.Count; i++) {
                        var connection = Socket.Connections[i];
                        if (view.Group != 0 && !connection.InGroup(view.Group)) continue;
                        connection.Send(netMessage);
                    }
                    break;
            }
        }

        /// <summary> Send overload that creates the NetMessage for the RPC. </summary>
        internal void Send(int viewId, bool reliable, string methodName, RpcTarget target, params object[] parameters) {
            if (!Socket.Rpc.HasId(methodName)) {
                NetLog.Error("Send failed: RPC method name has not been assigned an ID.");
                return;
            }
            if (!ViewLookup.ContainsKey(viewId)) return;
            NetView view = ViewLookup[viewId];
            var netMessage = NetMessage.Create(Socket.Rpc.NameToId(methodName), (uint)viewId, parameters, reliable);
            Send(view, netMessage, target);
        }

        /// <summary> Send overload that creates the NetMessage for the RPC. </summary>
        internal void Send(int viewId, bool reliable, string methodName, NetConnection target, params object[] parameters) {
            if (!Socket.Rpc.HasId(methodName)) {
                NetLog.Error("Send failed: RPC method name has not been assigned an ID.");
                return;
            }
            var netMessage = NetMessage.Create(Socket.Rpc.NameToId(methodName), (uint)viewId, parameters, reliable);
            target.Send(netMessage);
        }

        /// <summary> Send overload that creates the NetMessage for the RPC. </summary>
        internal void Send(int viewId, bool reliable, string methodName, List<NetConnection> targets, params object[] parameters) {
            if (!Socket.Rpc.HasId(methodName)) {
                NetLog.Error("Send failed: RPC method name has not been assigned an ID.");
                return;
            }

            var message = NetMessage.Create(Socket.Rpc.NameToId(methodName), (uint)viewId, parameters, reliable);

            for (int i = 0; i < targets.Count; i++) targets[i].Send(message);
        }

        internal void SendOutOfScope(int viewId, NetConnection connection) {
            Socket.Command.Send((int)ViewCmd.OutOfScope, connection, viewId);
        }

        // Loop controls that need to persist between invocations of IncrementalSyncViews:
        private int syncFrame;
        private int incSyncFrame;
        private int framesPerSync = 4;
        private int incBatchSize = 4;

        /// <summary>
        /// Syncs views every frame in batches. The batch size (number of views to sync per frame)
        /// is calculated using the number of views, target frame rate, and syncs per second.
        /// This is the preferred server-side method to use when there are a large number of views
        /// to sync and framerate is stable. This method allows load to be spread evenly across frames.
        /// </summary>
        private void IncrementalSyncViews() {
            int pos = incSyncFrame * incBatchSize;

            for (int i = pos; i < pos + incBatchSize; i++) {
                if (i >= Views.Count) break;
                var view = Views[i];
                if (view.Server != Socket.Self && !view.IsController(Socket.Self)) continue;
                view.TriggerSyncEvent();
            }

            incSyncFrame++;
            if (incSyncFrame != framesPerSync) return;

            incSyncFrame = 0;
            framesPerSync = Socket.TargetFrameRate / SyncsPerSecond;
            incBatchSize = (Views.Count / framesPerSync) + 1;

            syncFrame++;
            if (syncFrame > 4) syncFrame = 1;
        }

        /// <summary>
        /// Syncs all owned views at intervals determined by SyncsPerSecond.
        /// This is generally the preferred method for client-side use.
        /// </summary>
        private void TimedSyncViews() {
            foreach (NetView view in Views) {
                if (view.Server != Socket.Self && !view.IsController(Socket.Self)) continue;
                view.TriggerSyncEvent();
            }

            if (!IncrementalSync) Invoke("TimedSyncViews", 1f / SyncsPerSecond);
        }

        public NetView CreateView(string prefabBase, NetStream instantiateData) {
            NetView view = CreateView(null, 0, prefabBase, instantiateData);
            return view;
        }

        /// <summary> Authoritatively creates a view that the server owns and triggers network instantiation. </summary>
        public NetView CreateView(string prefabBase) {
            return CreateView(0, prefabBase);
        }

        public NetView CreateView(NetConnection controller, string prefabBase, NetStream instantiateData) {
            NetView view = CreateView(controller, 0, prefabBase, instantiateData);
            return view;
        }

        /// <summary> Authoritatively creates a view for a connected client and triggers network instantiation. </summary>
        public NetView CreateView(NetConnection controller, string prefabBase) {
            return CreateView(controller, 0, prefabBase);
        }

        public NetView CreateView(int group, string prefabBase, NetStream instantiateData) {
            NetView view = CreateView(null, group, prefabBase, instantiateData);
            return view;
        }

        /// <summary> Authoritatively creates a view that the server owns and triggers network instantiation. </summary>
        public NetView CreateView(int group, string prefabBase) {
            return CreateView(null, group, prefabBase);
        }

        public NetView CreateView(NetConnection controller, int group, string prefabBase, NetStream instantiateData) {
            var view = CreateView(controller, Socket.Self, NewViewId(), group, prefabBase, NetView.Relation.Creator);
            view.TriggerReadInstantiateData(instantiateData);
            if (OnNetViewCreated != null) OnNetViewCreated(view);
            return view;
        }

        /// <summary> Authoritatively creates a view for a connected client and triggers network instantiation. </summary>
        public NetView CreateView(NetConnection controller, int group, string prefabBase) {
            var view = CreateView(controller, Socket.Self, NewViewId(), group, prefabBase, NetView.Relation.Creator);
            if (OnNetViewCreated != null) OnNetViewCreated(view);
            return view;
        }

        private NetView CreateView(NetConnection controller, NetConnection server, int viewId, int group, string prefabRoot, NetView.Relation relation) {

            NetView view = null;
            if (ViewLookup.ContainsKey(viewId)) {
                NetView oldView = ViewLookup[viewId];
                if (oldView.CurrentRelation == relation) {
                    view = oldView;
                } else if (server == Socket.Self) {
                    NetScope oldScope = oldView.Scope;
                    Vector3 oldPos = oldView.transform.position;
                    if (oldView.Server != server) SendChangeViewServer(viewId);
                    DestroyView(oldView);
                    view = InstantiateView(prefabRoot, relation);
                    view.InternalScope = oldScope;
                    view.transform.position = oldPos;
                }
            }

            if (view == null) view = InstantiateView(prefabRoot, relation);

            view.Server = server;
            view.Id = viewId;
            view.PrefabRoot = prefabRoot;
            view.Group = group;
            view.CurrentRelation = relation;

            if (controller != null) {
                view.AddController(controller);
                controller.AddAuthorization(view.Id);
                controller.AddToGroup(group);
                if (controller != Socket.Self) {
                    controller.View = view;
                    if (controller.InternalScope != null && view.Controllers.Count == 1) {
                        view.InternalScope = controller.InternalScope;
                    }
                    controller.InternalScope = null;
                }
            }
            view.Scope.FireInEvent();
            RegisterNetView(view);

            return view;
        }

        private static string Prefab(string prefabRoot, NetView.Relation relation) {
            if (relation == NetView.Relation.Creator) return prefabRoot + "@Creator";
            if (relation == NetView.Relation.Owner) return prefabRoot + "@Owner";
            if (relation == NetView.Relation.Peer) return prefabRoot + "@Peer";
            return prefabRoot + "@Proxy";
        }

        private void ReceiveCreateView(NetMessage message, NetConnection server) {
            if (!server.IsServer && !server.IsPeer) return;

            int viewId = (int)message.Parameters[0];
            int group = (int)message.Parameters[1];
            string prefabRoot = (string)message.Parameters[2];
            var stream = (NetStream)message.Parameters[3];

            NetView.Relation relation = default(NetView.Relation);
            NetConnection controller = null;
            switch (message.MessageId) {
                case (int)ViewCmd.CreateOwnerView:
                    controller = Socket.Self;
                    relation = NetView.Relation.Owner;
                    break;
                case (int)ViewCmd.CreatePeerView:
                    relation = NetView.Relation.Peer;
                    break;
                case (int)ViewCmd.CreateCreatorView:
                    server = Socket.Self;
                    relation = NetView.Relation.Creator;
                    break;
                case (int)ViewCmd.CreateProxyView:
                    relation = NetView.Relation.Proxy;
                    break;
            }

            if (relation == NetView.Relation.Creator || relation == NetView.Relation.Peer) {
                var ipendpoint = (IPEndPoint)message.Parameters[4];
                if (ipendpoint != null) {
                    if (Socket.EndpointConnected(ipendpoint)) controller = Socket.EndpointToConnection(ipendpoint);
                    else NetLog.Error("Failed to create view, controller endpoint not connected: " + ipendpoint);
                }
            }

            var view = CreateView(controller, server, viewId, group, prefabRoot, relation);
            view.TriggerReadInstantiateData(stream);
            if (OnNetViewCreated != null) OnNetViewCreated(view);
        }

        private NetView InstantiateView(string prefabRoot, NetView.Relation relation) {
            var viewObject = InstantiatePrefab != null
                ? InstantiatePrefab(prefabRoot, relation)
                : (GameObject)Instantiate(Resources.Load(Prefab(prefabRoot, relation)));

            var view = viewObject.GetComponent<NetView>();

            if (view != null) return view;

            Destroy(viewObject);
            throw new Exception("Prefab does not have a NetView component attached.");
        }

        private int NewViewId() {
            if (GenerateViewId != null) return GenerateViewId();

            for (int i = ViewIdMin; i < ViewIdMax; i++) {
                if (ViewLookup.ContainsKey(i)) continue;
                return i;
            }

            throw new Exception("NewViewId failed: Limit reached.");
        }

        /// <summary> Called by the server to destroy a NetView across the network. </summary>
        public void DestroyView(NetView view) {
            if (view.Server == Socket.Self) SendDestroyView(view);

            if (view.Controllers.Count != 0) {
                foreach (NetConnection connection in view.Controllers) {
                    connection.RemoveAuthorization(view.Id);
                }
            }
            ViewLookup.Remove(view.Id);
            Views.Remove(view);

            if (DestroyViewObject != null) DestroyViewObject(view.gameObject);
            else Destroy(view.gameObject);
        }

        /// <summary> Sends command to all connected clients to destroy the provided view. </summary>
        private void SendDestroyView(NetView view) {
            var destroyViewMessage = NetMessage.Create((ushort)ViewCmd.DestroyView, 0, 1, true);

            destroyViewMessage.Parameters[0] = view.Id;

            for (int i = 0; i < Socket.Connections.Count; i++) {
                var connection = Socket.Connections[i];
                if (connection.IsServer) continue;
                if (view.Group == 0 || connection.InGroup(view.Group)) connection.Send(destroyViewMessage);
            }
        }

        /// <summary> Processes a DestroyView command, this destroys the GameObject associated with the provided viewId. </summary>
        private void ReceiveDestroyView(NetMessage message, NetConnection connection) {
            int viewId = (int)message.Parameters[0];
            if (!ViewLookup.ContainsKey(viewId)) return;

            var view = ViewLookup[viewId];
            if (view.Server != connection) return;

            DestroyView(view);
        }

        /// <summary>
        ///  Returns the connection that matches the supplied target.
        ///  Returns the server for Server or the first controller for Controllers.
        /// </summary>
        internal NetConnection GetTarget(RpcTarget target, NetView view) {
            switch (target) {
                case RpcTarget.Server:
                    return view.Server;
                case RpcTarget.Controllers:
                    return view.Controllers[0];
            }

            NetLog.Error("Invalid RpcTarget for GetTarget. Only RpcTarget.Server or RpcTarget.Controllers can be used.");
            return null;
        }
    }
}


text:
<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>
    <groupId>org.raliev</groupId>
    <artifactId>cpw</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>

    <name>Clinic Pet Web</name>
    <url>http://maven.apache.org</url>
    <properties>
        <spring.version>4.0.5.RELEASE</spring.version>
        <spring.security.version>4.0.1.RELEASE</spring.security.version>
    </properties>

    <build>
        <finalName>ClinicPetWeb</finalName>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.4.201502262128</version>
                <configuration>
                    <destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
                    <dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <skipTests>false</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeScope>compile</includeScope>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Spring Framework -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-support</artifactId>
            <version>2.0.8</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>4.3.9.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.9.Final</version>
        </dependency>

        <!-- Others -->
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901.jdbc4</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>1.1</version>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
package com.sun.codemodel.internal;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * Special class object that represents the type of "null".
 *
 * <p>
 * Use this class with care.
 *
 * @author
 *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
 */
public final class JNullType extends JClass {

    JNullType(JCodeModel _owner) {
        super(_owner);
    }

    public String name() { return "null"; }
    public String fullName() { return "null"; }

    public JPackage _package() { return owner()._package(""); }

    public JClass _extends() { return null; }

    public Iterator<JClass> _implements() {
        return Collections.<JClass>emptyList().iterator();
    }

    public boolean isInterface() { return false; }
    public boolean isAbstract() { return false; }

    protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings) {
        return this;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FusibleFactory (WInte.r 1.3 API)</title>
<meta name="date" content="2018-10-02">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.uni_mannheim.informatik.dws.winter.model

Interface FusibleFactory<RecordType extends Matchable & Fusible<SchemaElementType>,SchemaElementType extends Matchable>

Type Parameters:

RecordType -

public interface FusibleFactory<RecordType extends Matchable & Fusible<SchemaElementType>,SchemaElementType extends Matchable>

Specifies the factory method for creating a fused record

Author:

Oliver Lehmberg (oli@dwslab.de)

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

RecordType
createInstanceForFusion(RecordGroup<RecordType,SchemaElementType> cluster)

Creates a record that will receive all the values from the data fusion
 for the given record group

Method Detail

createInstanceForFusion

RecordType createInstanceForFusion(RecordGroup<RecordType,SchemaElementType> cluster)

Creates a record that will receive all the values from the data fusion
 for the given record group

Parameters:

cluster - the record cluster for which to create a new instance

Returns:

Returns a new instance of RecordType

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2018. All rights reserved.


text:
#ifndef RPC_LOG_SERVER_H_
#define RPC_LOG_SERVER_H_

#include "LogServerStorage.h"
#include "LogServerRequest.h"

#include <3rdparty/msgpack/rpc/server.h>
#include <boost/scoped_ptr.hpp>

namespace sf1r
{
class LogServerWorkThread;
class RpcLogServer : public msgpack::rpc::server::base
{
public:
    RpcLogServer(
        const std::string& host,
        uint16_t port,
        uint32_t threadNum);

    ~RpcLogServer();

    bool init();

    inline uint16_t getPort() const
    {
        return port_;
    }

    void start();

    void join();

    // start + join
    void run();

    void stop();

public:
    virtual void dispatch(msgpack::rpc::request req);

private:
    std::string host_;
    uint16_t port_;
    uint32_t threadNum_;

    boost::scoped_ptr<LogServerWorkThread> workerThread_;
};

}

#endif /* RPC_LOG_SERVER_H_ */


text:
SELECT DISTINCT v2.nr, -- rating1, rating2,
COALESCE(rating1, rating2) AS rating
FROM
(SELECT nr, review.rating1 FROM review WHERE product < 1000) v1 LEFT JOIN
(SELECT nr, review.rating2 FROM review) v2 ON v1.nr = v2.nr;
-- LIMIT 1000;


text:
/******************************************************************************
 *
 * Name:	sktypes.h
 * Project:	GEnesis, PCI Gigabit Ethernet Adapter
 * Version:	$Revision: 1.2 $
 * Date:	$Date: 2003/10/07 08:16:51 $
 * Purpose:	Define data types for Linux
 *
 ******************************************************************************/

/******************************************************************************
 *
 *	(C)Copyright 1998-2002 SysKonnect GmbH.
 *	(C)Copyright 2002-2003 Marvell.
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	The information in this file is provided "AS IS" without warranty.
 *
 ******************************************************************************/

/******************************************************************************
 *
 * Description:
 *
 * In this file, all data types that are needed by the common modules
 * are mapped to Linux data types.
 *
 *
 * Include File Hierarchy:
 *
 *
 ******************************************************************************/

#ifndef __INC_SKTYPES_H
#define __INC_SKTYPES_H

/* defines *******************************************************************/

/*
 * Data types with a specific size. 'I' = signed, 'U' = unsigned.
 */
#define SK_I8	s8
#define SK_U8	u8
#define SK_I16	s16
#define SK_U16	u16
#define SK_I32	s32
#define SK_U32	u32
#define SK_I64	s64
#define SK_U64	u64

#define SK_UPTR	ulong		/* casting pointer <-> integral */

/*
* Boolean type.
*/
#define SK_BOOL		SK_U8
#define SK_FALSE	0
#define SK_TRUE		(!SK_FALSE)

/* typedefs *******************************************************************/

/* function prototypes ********************************************************/

#endif	/* __INC_SKTYPES_H */


text:
<!DOCTYPE html>

  <meta charset="utf8">
  <title>Advanced</title>

Loading...


text:
layout: post
title: Vagrant
date: 2012-05-15
---

We are pleased to announce the May event for PHP North East, **Vagrant** by [@ichilton][1].

The event will take place at the Post Office in Pink Lane ([@PostOfficeNE1][2]) courtesy of PNE.

**Vagrant** by [@ichilton][1]

Ian Chilton is a 100000 year old, developer and sysadmin. With 10
years experience a developer in the North East, he is currently
working at Better Brand Agency in Stokesley, near Middlesbrough. His
interests are in PHP, Ruby/Rails, DevOps, performance, scalability,
deployment, security, electronics & Formula 1.

He can be found as [@ichilton][1] on Twitter or at [http://www.ichilton.co.uk][3].

The talk will be a brief introduction to virtualization, why you would
want to use virtualization for development, an introduction to a tool
called "Vagrant" and a quick look at automated provisioning and
configuration management.

[1]: http://www.twitter.com/ichilton
[2]: http://www.twitter.com/PostOfficeNE1
[3]: http://www.ichilton.co.uk/