text:
package users;

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

import medicalinfo.diseaseandcure.MedicateController;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;

import users.reporters.doctor.Doctor;
import users.reporters.doctor.GeneralDoctor;
import users.reporters.doctor.SpecialDoctor;
import users.reporters.patient.Patient;

import com.jvmhub.tutorial.App;

public class UsersDB {

	@SuppressWarnings("unchecked")
	public static Users getByUserName(String username2) {
		List<Users> u = App.get_session()
				.createCriteria(Users.class)
				.add(Restrictions.eq("username", username2))
				.list();
		if(u.size() == 0)	return null;
		else return u.get(0);
	}
	@SuppressWarnings("unchecked")
	public static List<Users> search_users_by_name(String name, boolean isActive)
	{
		List<Users> u =  App.get_session()
				.createCriteria(Users.class)
				.add(Restrictions.eq("isActivated", isActive))
				.list();
//		App.error("size e by name  " + u.size());
		return find_the_one_contain_this_name(name, u);
	}
	@SuppressWarnings("unchecked")
	public static List<Patient> search_patients_by_name(String name, boolean isActive)
	{
		List<Patient> u =  App.get_session()
				.createCriteria(Patient.class)
				.add(Restrictions.eq("isActivated", isActive))
				.add(Restrictions.isNotNull("PersonId"))
				.list();
		for(Patient tmp : u)
			System.err.println(tmp.getName());
		return find_the_one_contain_this_name(name, u);

	}
	public static void save(Users m) {
		Session session = null;
        Transaction tx = null;
        try {
            session = App.get_session();
            tx = session.beginTransaction();

            session.save(m);

            tx.commit();
        } catch (Exception ex) {
            if (tx != null)
                tx.rollback();
            throw new RuntimeException(ex);
        } finally {
            if (session != null)
                session.close();
        }
	}
	public static void merge(Users m) {
		Session session = null;
        Transaction tx = null;
        try {
            session = App.get_session();
            tx = session.beginTransaction();

            session.merge(m);

            tx.commit();
        } catch (Exception ex) {
            if (tx != null)
                tx.rollback();
            throw new RuntimeException(ex);
        } finally {
            if (session != null)
                session.close();
        }
	}
	public static boolean login(String username, String password){
		Users u = getByUserName(username);
		if(u == null)
			return false;
		if(u.getPassword().equals(password))
			return true;
		return false;
	}
	@SuppressWarnings("unchecked")
	public static List<Doctor> get_doctors_by_name(String name, boolean isGeneral){

		List<Doctor> gd ;
		if(isGeneral)
		{
			gd = App.get_session()
					.createCriteria(GeneralDoctor.class)
					.add(Restrictions.eq("isActivated", true))
					.add(Restrictions.isNotNull("DocId"))
					.list();
		}
		else{
			gd = App.get_session()
					.createCriteria(SpecialDoctor.class)
					.add(Restrictions.eq("isActivated", true))
					.add(Restrictions.isNotNull("DocId"))
					.list();
		}

		return find_the_one_contain_this_name(name, gd);
	}
	public static <E> List<E> find_the_one_contain_this_name(String name, List<E> gd)
	{
		List<E> res = new ArrayList<>();
		for(E tmp: gd){
			String str = ((Users)tmp).getName() + " " + ((Users)tmp).getFamilyname();
			if(str.contains(name))
				res.add(tmp);
		}
		return res;
	}
	public static List<Patient> get_my_patient(String docUser, String patName){
		 ArrayList<Patient> all = MedicateController.get_doctor_patient(docUser);
		 return find_the_one_contain_this_name(patName, all);
	}
	public static List<Doctor> searchSpecialDoctors(String name,
			String specialty) {
		List <Doctor> res = searchSpecialDoctors("", specialty);
		return find_the_one_contain_this_name(name, res);
	}
}


text:
<?php

namespace Proxies;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
 */
class AcmeMsgBundleEntitymsgProxy extends \Acme\MsgBundle\Entity\msg implements \Doctrine\ORM\Proxy\Proxy
{
    private $_entityPersister;
    private $_identifier;
    public $__isInitialized__ = false;
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
    }
    /** @private */
    public function __load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;

            if (method_exists($this, "__wakeup")) {
                // call this after __isInitialized__to avoid infinite recursion
                // but before loading to emulate what ClassMetadata::newInstance()
                // provides.
                $this->__wakeup();
            }

            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            unset($this->_entityPersister, $this->_identifier);
        }
    }

    public function getId()
    {
        $this->__load();
        return parent::getId();
    }

    public function setName($name)
    {
        $this->__load();
        return parent::setName($name);
    }

    public function getName()
    {
        $this->__load();
        return parent::getName();
    }

    public function setMail($mail)
    {
        $this->__load();
        return parent::setMail($mail);
    }

    public function getMail()
    {
        $this->__load();
        return parent::getMail();
    }

    public function setContant($contant)
    {
        $this->__load();
        return parent::setContant($contant);
    }

    public function getContant()
    {
        $this->__load();
        return parent::getContant();
    }

    public function setReply($reply)
    {
        $this->__load();
        return parent::setReply($reply);
    }

    public function getReply()
    {
        $this->__load();
        return parent::getReply();
    }

    public function setReplyer($replyer)
    {
        $this->__load();
        return parent::setReplyer($replyer);
    }

    public function getReplyer()
    {
        $this->__load();
        return parent::getReplyer();
    }

    public function setTimestamp($timestamp)
    {
        $this->__load();
        return parent::setTimestamp($timestamp);
    }

    public function getTimestamp()
    {
        $this->__load();
        return parent::getTimestamp();
    }

    public function __sleep()
    {
        return array('__isInitialized__', 'id', 'name', 'mail', 'contant', 'reply', 'replyer', 'timestamp');
    }

    public function __clone()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            $class = $this->_entityPersister->getClassMetadata();
            $original = $this->_entityPersister->load($this->_identifier);
            if ($original === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            foreach ($class->reflFields AS $field => $reflProperty) {
                $reflProperty->setValue($this, $reflProperty->getValue($original));
            }
            unset($this->_entityPersister, $this->_identifier);
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper_acceptance'

describe 'try_get_value function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
  describe 'success' do
    it 'gets a value' do
      pp = <<-EOS
      $data = {
        'a' => { 'b' => 'passing'}
      }

      $tests = try_get_value($data, 'a/b')
      notice(inline_template('tests are <%= @tests.inspect %>'))
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/tests are "passing"/)
      end
    end
  end
  describe 'failure' do
    it 'uses a default value' do
      pp = <<-EOS
      $data = {
        'a' => { 'b' => 'passing'}
      }

      $tests = try_get_value($data, 'c/d', 'using the default value')
      notice(inline_template('tests are <%= @tests.inspect %>'))
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/using the default value/)
      end
    end

    it 'raises error on incorrect number of arguments' do
      pp = <<-EOS
      $o = try_get_value()
      EOS

      apply_manifest(pp, :expect_failures => true) do |r|
        expect(r.stderr).to match(/wrong number of arguments/i)
      end
    end
  end
end


text:
package com.github.gdefacci.briscola.presentation.player

import com.github.gdefacci.briscola.{ player => model }
import com.github.gdefacci.briscola.player.PlayerId
import com.github.gdefacci.briscola.presentation.EventAndState
import com.github.gdefacci.briscola.presentation.StateChangeFilter
import com.github.gdefacci.briscola.web.util.PresentationAdapter
import com.github.gdefacci.ddd.StateChange

class PlayersStateChangeFilter(
    implicit playerPresentationAdapter: PresentationAdapter[model.Player, Player],
    playerEventPresentationAdapter:PresentationAdapter[model.PlayerEvent, PlayerEvent] )
    extends StateChangeFilter[Iterable[model.Player], model.PlayerEvent, Iterable[Player], PlayerEvent] {

  def apply(pid: PlayerId) = {
    case StateChange(_, e @ model.PlayerLogOff(id), s) if id != pid =>
      EventAndState(PresentationAdapter(e:model.PlayerEvent), s.map(p => PresentationAdapter(p)))
    case StateChange(_, e @ model.PlayerLogOn(id), s) if id != pid  =>
      EventAndState(PresentationAdapter(e:model.PlayerEvent), s.map(p => PresentationAdapter(p)))
  }

}


text:
namespace System
{
    // Generated from `System.LocalDataStoreSlot` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
    public class LocalDataStoreSlot
    {
        // ERR: Stub generator didn't handle member: ~LocalDataStoreSlot
    }

    namespace Threading
    {
        // Generated from `System.Threading.ApartmentState` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public enum ApartmentState : int
        {
            MTA = 1,
            STA = 0,
            Unknown = 2,
        }

        // Generated from `System.Threading.CompressedStack` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class CompressedStack : System.Runtime.Serialization.ISerializable
        {
            public static System.Threading.CompressedStack Capture() => throw null;
            public System.Threading.CompressedStack CreateCopy() => throw null;
            public static System.Threading.CompressedStack GetCompressedStack() => throw null;
            public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) => throw null;
            public static void Run(System.Threading.CompressedStack compressedStack, System.Threading.ContextCallback callback, object state) => throw null;
        }

        // Generated from `System.Threading.ParameterizedThreadStart` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public delegate void ParameterizedThreadStart(object obj);

        // Generated from `System.Threading.Thread` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class Thread : System.Runtime.ConstrainedExecution.CriticalFinalizerObject
        {
            public void Abort() => throw null;
            public void Abort(object stateInfo) => throw null;
            public static System.LocalDataStoreSlot AllocateDataSlot() => throw null;
            public static System.LocalDataStoreSlot AllocateNamedDataSlot(string name) => throw null;
            public System.Threading.ApartmentState ApartmentState { get => throw null; set => throw null; }
            public static void BeginCriticalRegion() => throw null;
            public static void BeginThreadAffinity() => throw null;
            public System.Globalization.CultureInfo CurrentCulture { get => throw null; set => throw null; }
            public static System.Security.Principal.IPrincipal CurrentPrincipal { get => throw null; set => throw null; }
            public static System.Threading.Thread CurrentThread { get => throw null; }
            public System.Globalization.CultureInfo CurrentUICulture { get => throw null; set => throw null; }
            public void DisableComObjectEagerCleanup() => throw null;
            public static void EndCriticalRegion() => throw null;
            public static void EndThreadAffinity() => throw null;
            public System.Threading.ExecutionContext ExecutionContext { get => throw null; }
            public static void FreeNamedDataSlot(string name) => throw null;
            public System.Threading.ApartmentState GetApartmentState() => throw null;
            public System.Threading.CompressedStack GetCompressedStack() => throw null;
            public static int GetCurrentProcessorId() => throw null;
            public static object GetData(System.LocalDataStoreSlot slot) => throw null;
            public static System.AppDomain GetDomain() => throw null;
            public static int GetDomainID() => throw null;
            public override int GetHashCode() => throw null;
            public static System.LocalDataStoreSlot GetNamedDataSlot(string name) => throw null;
            public void Interrupt() => throw null;
            public bool IsAlive { get => throw null; }
            public bool IsBackground { get => throw null; set => throw null; }
            public bool IsThreadPoolThread { get => throw null; }
            public void Join() => throw null;
            public bool Join(System.TimeSpan timeout) => throw null;
            public bool Join(int millisecondsTimeout) => throw null;
            public int ManagedThreadId { get => throw null; }
            public static void MemoryBarrier() => throw null;
            public string Name { get => throw null; set => throw null; }
            public System.Threading.ThreadPriority Priority { get => throw null; set => throw null; }
            public static void ResetAbort() => throw null;
            public void Resume() => throw null;
            public void SetApartmentState(System.Threading.ApartmentState state) => throw null;
            public void SetCompressedStack(System.Threading.CompressedStack stack) => throw null;
            public static void SetData(System.LocalDataStoreSlot slot, object data) => throw null;
            public static void Sleep(System.TimeSpan timeout) => throw null;
            public static void Sleep(int millisecondsTimeout) => throw null;
            public static void SpinWait(int iterations) => throw null;
            public void Start() => throw null;
            public void Start(object parameter) => throw null;
            public void Suspend() => throw null;
            public Thread(System.Threading.ParameterizedThreadStart start) => throw null;
            public Thread(System.Threading.ParameterizedThreadStart start, int maxStackSize) => throw null;
            public Thread(System.Threading.ThreadStart start) => throw null;
            public Thread(System.Threading.ThreadStart start, int maxStackSize) => throw null;
            public System.Threading.ThreadState ThreadState { get => throw null; }
            public bool TrySetApartmentState(System.Threading.ApartmentState state) => throw null;
            public void UnsafeStart() => throw null;
            public void UnsafeStart(object parameter) => throw null;
            public static System.IntPtr VolatileRead(ref System.IntPtr address) => throw null;
            public static System.UIntPtr VolatileRead(ref System.UIntPtr address) => throw null;
            public static System.Byte VolatileRead(ref System.Byte address) => throw null;
            public static double VolatileRead(ref double address) => throw null;
            public static float VolatileRead(ref float address) => throw null;
            public static int VolatileRead(ref int address) => throw null;
            public static System.Int64 VolatileRead(ref System.Int64 address) => throw null;
            public static object VolatileRead(ref object address) => throw null;
            public static System.SByte VolatileRead(ref System.SByte address) => throw null;
            public static System.Int16 VolatileRead(ref System.Int16 address) => throw null;
            public static System.UInt32 VolatileRead(ref System.UInt32 address) => throw null;
            public static System.UInt64 VolatileRead(ref System.UInt64 address) => throw null;
            public static System.UInt16 VolatileRead(ref System.UInt16 address) => throw null;
            public static void VolatileWrite(ref System.IntPtr address, System.IntPtr value) => throw null;
            public static void VolatileWrite(ref System.UIntPtr address, System.UIntPtr value) => throw null;
            public static void VolatileWrite(ref System.Byte address, System.Byte value) => throw null;
            public static void VolatileWrite(ref double address, double value) => throw null;
            public static void VolatileWrite(ref float address, float value) => throw null;
            public static void VolatileWrite(ref int address, int value) => throw null;
            public static void VolatileWrite(ref System.Int64 address, System.Int64 value) => throw null;
            public static void VolatileWrite(ref object address, object value) => throw null;
            public static void VolatileWrite(ref System.SByte address, System.SByte value) => throw null;
            public static void VolatileWrite(ref System.Int16 address, System.Int16 value) => throw null;
            public static void VolatileWrite(ref System.UInt32 address, System.UInt32 value) => throw null;
            public static void VolatileWrite(ref System.UInt64 address, System.UInt64 value) => throw null;
            public static void VolatileWrite(ref System.UInt16 address, System.UInt16 value) => throw null;
            public static bool Yield() => throw null;
            // ERR: Stub generator didn't handle member: ~Thread
        }

        // Generated from `System.Threading.ThreadAbortException` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class ThreadAbortException : System.SystemException
        {
            public object ExceptionState { get => throw null; }
        }

        // Generated from `System.Threading.ThreadExceptionEventArgs` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class ThreadExceptionEventArgs : System.EventArgs
        {
            public System.Exception Exception { get => throw null; }
            public ThreadExceptionEventArgs(System.Exception t) => throw null;
        }

        // Generated from `System.Threading.ThreadExceptionEventHandler` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public delegate void ThreadExceptionEventHandler(object sender, System.Threading.ThreadExceptionEventArgs e);

        // Generated from `System.Threading.ThreadInterruptedException` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class ThreadInterruptedException : System.SystemException
        {
            public ThreadInterruptedException() => throw null;
            protected ThreadInterruptedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) => throw null;
            public ThreadInterruptedException(string message) => throw null;
            public ThreadInterruptedException(string message, System.Exception innerException) => throw null;
        }

        // Generated from `System.Threading.ThreadPriority` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public enum ThreadPriority : int
        {
            AboveNormal = 3,
            BelowNormal = 1,
            Highest = 4,
            Lowest = 0,
            Normal = 2,
        }

        // Generated from `System.Threading.ThreadStart` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public delegate void ThreadStart();

        // Generated from `System.Threading.ThreadStartException` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class ThreadStartException : System.SystemException
        {
        }

        // Generated from `System.Threading.ThreadState` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        [System.Flags]
        public enum ThreadState : int
        {
            AbortRequested = 128,
            Aborted = 256,
            Background = 4,
            Running = 0,
            StopRequested = 1,
            Stopped = 16,
            SuspendRequested = 2,
            Suspended = 64,
            Unstarted = 8,
            WaitSleepJoin = 32,
        }

        // Generated from `System.Threading.ThreadStateException` in `System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
        public class ThreadStateException : System.SystemException
        {
            public ThreadStateException() => throw null;
            protected ThreadStateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) => throw null;
            public ThreadStateException(string message) => throw null;
            public ThreadStateException(string message, System.Exception innerException) => throw null;
        }

    }
}


text:
from __future__ import print_function
# encoding: utf-8

# Before running this program, first Start HFO server:
# $> ./bin/HFO --offense-agents 1

from __future__ import print_function

import argparse
import itertools
import random
try:
  import hfo
except ImportError:
  print('Failed to import hfo. To install hfo, in the HFO directory'\
    ' run: \"pip install .\"')
  exit()

def main():
  parser = argparse.ArgumentParser()
  parser.add_argument('--port', type=int, default=6000,
                      help="Server port")
  parser.add_argument('--seed', type=int, default=None,
                      help="Python randomization seed; uses python default if 0 or not given")
  parser.add_argument('--record', action='store_true',
                      help="If doing HFO --record")
  parser.add_argument('--rdir', type=str, default='log/',
                      help="Set directory to use if doing --record")
  args=parser.parse_args()
  if args.seed:
    random.seed(args.seed)
  # Create the HFO Environment
  hfo_env = hfo.HFOEnvironment()
  # Connect to the server with the specified
  # feature set. See feature sets in hfo.py/hfo.hpp.
  if args.record:
    hfo_env.connectToServer(hfo.HIGH_LEVEL_FEATURE_SET,
                            'bin/teams/base/config/formations-dt', args.port,
                            'localhost', 'base_left', False,
                            record_dir=args.rdir)
  else:
    hfo_env.connectToServer(hfo.HIGH_LEVEL_FEATURE_SET,
                            'bin/teams/base/config/formations-dt', args.port,
                            'localhost', 'base_left', False)

  if args.seed:
    print("Python randomization seed: {0:d}".format(args.seed))

  for episode in itertools.count():
    status = hfo.IN_GAME
    while status == hfo.IN_GAME:
      # Get the vector of state features for the current state
      state = hfo_env.getState()
      # Perform the action
      if state[5] == 1: # State[5] is 1 when the player can kick the ball
        if random.random() < 0.5: # more efficient than random.choice for 2
          hfo_env.act(hfo.SHOOT)
        else:
          hfo_env.act(hfo.DRIBBLE)
      else:
        hfo_env.act(hfo.MOVE)
      # Advance the environment and get the game status
      status = hfo_env.step()

    # Check the outcome of the episode

    end_status = hfo_env.statusToString(status)
    print("Episode {0:n} ended with {1:s}".format(episode, end_status))

    # Quit if the server goes down
    if status == hfo.SERVER_DOWN:
      hfo_env.act(hfo.QUIT)
      exit()

if __name__ == '__main__':
  main()


text:
(function ($) {
	"use strict";

	$.jqPagination = function (el, options) {

		// To avoid scope issues, use 'base' instead of 'this'
		// to reference this class from internal events and functions.

		var base = this;

		// Access to jQuery and DOM versions of element
		base.$el = $(el);
		base.el = el;

		// get input jQuery object
		base.$input = base.$el.find('input');

		// Add a reverse reference to the DOM object
		base.$el.data("jqPagination", base);

		base.init = function () {

			base.options = $.extend({}, $.jqPagination.defaultOptions, options);

			// if the user hasn't provided a max page number in the options try and find
			// the data attribute for it, if that cannot be found, use one as a max page number

			if (base.options.max_page === null) {

				if (base.$input.data('max-page') !== undefined) {
					base.options.max_page = base.$input.data('max-page');
				} else {
					base.options.max_page = 1;
				}

			}

			// if the current-page data attribute is specified this takes priority
			// over the options passed in, so long as it's a number

			if (base.$input.data('current-page') !== undefined && base.isNumber(base.$input.data('current-page'))) {
				base.options.current_page = base.$input.data('current-page');
			}

			// remove the readonly attribute as JavaScript must be working by now ;-)
			base.$input.removeAttr('readonly');

			// set the initial input value
			// pass true to prevent paged callback form being fired

			base.updateInput(true);

			 //***************
			// BIND EVENTS

			base.$input.on('focus.jqPagination mouseup.jqPagination', function (event) {

				// if event === focus, select all text...
				if (event.type === 'focus') {

					var current_page = parseInt(base.options.current_page, 10);

					$(this).val(current_page).select();

				}

				// if event === mouse up, return false. Fixes Chrome bug
				if (event.type === 'mouseup') {
					return false;
				}

			});

			base.$input.on('blur.jqPagination keydown.jqPagination', function (event) {

				var $self			= $(this),
					current_page	= parseInt(base.options.current_page, 10);

				// if the user hits escape revert the input back to the original value
				if (event.keyCode === 27) {
					$self.val(current_page);
					$self.blur();
				}

				// if the user hits enter, trigger blur event but DO NOT set the page value
				if (event.keyCode === 13) {
					$self.blur();
				}

				// only set the page is the event is focusout.. aka blur
				if (event.type === 'blur') {
					base.setPage($self.val());
				}

			});

			base.$el.on('click.jqPagination', 'a', function (event) {

				var $self = $(this);

				// we don't want to do anything if we've clicked a disabled link
				// return false so we stop normal link action btu also drop out of this event

				if ($self.hasClass('disabled')) {
					return false;
				}

				// for mac + windows (read: other), maintain the cmd + ctrl click for new tab
				if (!event.metaKey && !event.ctrlKey) {
					event.preventDefault();
					base.setPage($self.data('action'));
				}

			});

		};

		base.setPage = function (page, prevent_paged) {

			// return current_page value if getting instead of setting
			if (page === undefined) {
				return base.options.current_page;
			}

			var current_page	= parseInt(base.options.current_page, 10),
				max_page		= parseInt(base.options.max_page, 10);

			if (isNaN(parseInt(page, 10))) {

				switch (page) {

					case 'first':
						page = 1;
						break;

					case 'prev':
					case 'previous':
						page = current_page - 1;
						break;

					case 'next':
						page = current_page + 1;
						break;

					case 'last':
						page = max_page;
						break;

				}

			}

			page = parseInt(page, 10);

			// reject any invalid page requests
			if (isNaN(page) || page < 1 || page > max_page) {

				// update the input element
				base.setInputValue(current_page);

				return false;

			}

			// update current page options
			base.options.current_page = page;
			base.$input.data('current-page', page);

			// update the input element
			base.updateInput( prevent_paged );

		};

		base.setMaxPage = function (max_page, prevent_paged) {

			// return the max_page value if getting instead of setting
			if (max_page === undefined) {
				return base.options.max_page;
			}

			// ignore if max_page is not a number
			if (!base.isNumber(max_page)) {
				console.error('jqPagination: max_page is not a number');
				return false;
			}

			// ignore if max_page is less than the current_page
			if (max_page < base.options.current_page) {
				console.error('jqPagination: max_page lower than current_page');
				return false;
			}

			// set max_page options
			base.options.max_page = max_page;
			base.$input.data('max-page', max_page);

			// update the input element
			base.updateInput( prevent_paged );

		};

		// ATTN this isn't really the correct name is it?
		base.updateInput = function (prevent_paged) {

			var current_page = parseInt(base.options.current_page, 10);

			// set the input value
			base.setInputValue(current_page);

			// set the link href attributes
			base.setLinks(current_page);

			// we may want to prevent the paged callback from being fired
			if (prevent_paged !== true) {

				// fire the callback function with the current page
				base.options.paged(current_page);

			}

		};

		base.setInputValue = function (page) {

			var page_string	= base.options.page_string,
				max_page	= base.options.max_page;

			// this looks horrible :-(
			page_string = page_string
				.replace("{current_page}", page)
				.replace("{max_page}", max_page);

			base.$input.val(page_string);

		};

		base.isNumber = function(n) {
			return !isNaN(parseFloat(n)) && isFinite(n);
		};

		base.setLinks = function (page) {

			var link_string		= base.options.link_string,
				current_page	= parseInt(base.options.current_page, 10),
				max_page		= parseInt(base.options.max_page, 10);

			if (link_string !== '') {

				// set initial page numbers + make sure the page numbers aren't out of range

				var previous = current_page - 1;
				if (previous < 1) {
					previous = 1;
				}

				var next = current_page + 1;
				if (next > max_page) {
					next = max_page;
				}

				// apply each page number to the link string, set it back to the element href attribute
				base.$el.find('a.first').attr('href', link_string.replace('{page_number}', '1'));
				base.$el.find('a.prev, a.previous').attr('href', link_string.replace('{page_number}', previous));
				base.$el.find('a.next').attr('href', link_string.replace('{page_number}', next));
				base.$el.find('a.last').attr('href', link_string.replace('{page_number}', max_page));

			}

			// set disable class on appropriate links
			base.$el.find('a').removeClass('disabled');

			if (current_page === max_page) {
				base.$el.find('.next, .last').addClass('disabled');
			}

			if (current_page === 1) {
				base.$el.find('.previous, .first').addClass('disabled');
			}

		};

		base.callMethod = function (method, key, value) {

			switch (method.toLowerCase()) {

				case 'option':

					// if we're getting, immediately return the value
					if ( value === undefined && typeof key !== "object" ) {
						return base.options[key];
					}

					// set default object to trigger the paged event (legacy opperation)
					var options = {'trigger': true},
					result = false;

					// if the key passed in is an object
					if($.isPlainObject(key) && !value){
						$.extend(options, key)
					}
					else{ // make the key value pair part of the default object
						options[key] = value;
					}

					var prevent_paged = (options.trigger === false);

					// if current_page property is set call setPage
					if(options.current_page !== undefined){
						result = base.setPage(options.current_page, prevent_paged);
					}

					// if max_page property is set call setMaxPage
					if(options.max_page !== undefined){
						result = base.setMaxPage(options.max_page, prevent_paged);
					}

					// if we've not got a result fire an error and return false
					if( result === false ) console.error('jqPagination: cannot get / set option ' + key);
					return result;

					break;

				case 'destroy':

					base.$el
						.off('.jqPagination')
						.find('*')
							.off('.jqPagination');

					break;

				default:

					// the function name must not exist
					console.error('jqPagination: method "' + method + '" does not exist');
					return false;

			}

		};

		// Run initializer
		base.init();

	};

	$.jqPagination.defaultOptions = {
		current_page	: 1,
		link_string		: '',
		max_page		: null,
		page_string		: 'Page {current_page} of {max_page}',
		paged			: function () {}
	};

	$.fn.jqPagination = function () {

		// get any function parameters
		var self = this,
			$self = $(self),
			args = Array.prototype.slice.call(arguments),
			result = false;

		// if the first argument is a string call the desired function
		// note: we can only do this to a single element, and not a collection of elements

		if (typeof args[0] === 'string') {

			// if we're getting, we can only get value for the first pagination element
			if (args[2] === undefined) {

				result = $self.first().data('jqPagination').callMethod(args[0], args[1]);

			} else {

				// if we're setting, set values for all pagination elements
				$self.each(function(){
					result = $(this).data('jqPagination').callMethod(args[0], args[1], args[2]);
				});

			}

			return result;
		}

		// if we're not dealing with a method, initialise plugin
		self.each(function () {
			(new $.jqPagination(this, args[0]));
		});

	};

})(jQuery);

// polyfill, provide a fallback if the console doesn't exist
if (!console) {

	var console	= {},
		func	= function () { return false; };

	console.log		= func;
	console.info	= func;
	console.warn	= func;
	console.error	= func;

}


text:
package org.ops4j.pax.bnd.maven;

import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static org.ops4j.pax.bnd.maven.Utils.*;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;

import aQute.bnd.build.Container;
import aQute.bnd.build.Project;
import aQute.bnd.build.Workspace;

@Mojo(name = "prepare")
public class BuildpathhMojo extends AbstractMojo {

    @Component
    protected MavenSession session;

    @Parameter(property = "supportedProjectTypes")
    protected List<String> supportedProjectTypes = Arrays.asList(new String[] { "jar", "bundle" });

    @Component
    protected MavenProject project;

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        Set<Artifact> artifacts = new HashSet<Artifact>();
        try {
            Workspace workspace = printInfo("Running the Pax BND Buildpath Mojo", getLog(), getWorkspace(new File(session.getExecutionRootDirectory())));
            Project workspaceProject = workspace.getProject(project.getArtifactId());
            if (project == null)
                throw new MojoExecutionException("Something is broken with your workspace. Cannot find " + project.getArtifactId() + "(from pom.xml) in BND Workspace.");

            for (Project dep : workspaceProject.getDependson()) {
                for (Container deliverable : dep.getDeliverables()) {
                    getLog().info("+ " + deliverable.getFile().getAbsolutePath());
                    artifacts.add(asArtifact(deliverable.getFile()));
                }
            }
            Collection<Container> cp = workspaceProject.getBuildpath();

            for (Container entry : cp) {
                getLog().info("+ " + entry.getFile().getAbsolutePath());
                artifacts.add(asArtifact(entry.getFile()));
            }
            workspace.close();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        session.getCurrentProject().setResolvedArtifacts(artifacts);
    }

    private Artifact asArtifact(File element) {
        Artifact a = new DefaultArtifact("group", element.getName(), "0", "compile", "bundle", "", null);
        a.setFile(element);
        a.setArtifactHandler(newHandler(a));
        getLog().info("Added artifact: " + a.toString());
        return a;
    }

    public static ArtifactHandler newHandler(Artifact artifact) {
        String ext = "jar";
        String type = "bundle";
        DefaultArtifactHandler handler = new DefaultArtifactHandler(type);
        handler.setExtension(ext);
        handler.setLanguage("java");
        handler.setAddedToClasspath(true);
        handler.setIncludesDependencies(true);
        return handler;
    }

}


text:
================
Table Of Contents
================

.. toctree::

	Omics Pipe <index>
	about
	installation
	AWS_installation
	tutorial
	parameter_file
	custom_pipelines
	adding_modules
	pipelines

	databases
	dependencies
	resources

	RNAseq_Tuxedo_Modules
	RNAseq_counts_modules
	RNAseq_cancer_modules
	RNAseq_cancer_modules_TCGA
	RNAseq_counts_modules_TCGA
	miRNAseq_Tuxedo_Modules
	miRNAseq_counts_modules
	ChIPseq_modules_HOMER
	ChIPseq_modules_MACS
	WGS_WES_modules
	mutect_modules
	all_modules

	history
	copyright


text:
namespace xwalk {
namespace sysapps {

using extensions::XWalkExtensionFunctionHandler;
using extensions::XWalkExtensionFunctionInfo;

// This class is used to represent an object living in the JavaScript
// context that has a counterpart in the native side. The lifecycle of
// this object is controlled by the BindingObjectStore. The JavaScript
// object represented by this class must use the BindingObjectPrototype.
class BindingObject {
 public:
  // We don't assign an Instance to the handler here because this class
  // won't be receiving raw messages, but only FunctionInfo with the reply
  // callback already set to the appropriated Instance.
  BindingObject() : handler_(NULL) {}
  virtual ~BindingObject() {}

  bool HandleFunction(scoped_ptr<XWalkExtensionFunctionInfo> info) {
    return handler_.HandleFunction(std::move(info));
  }

 protected:
  XWalkExtensionFunctionHandler handler_;
};

}  // namespace sysapps
}  // namespace xwalk

#endif  // XWALK_SYSAPPS_COMMON_BINDING_OBJECT_H_


text:
namespace IntegrationTests
{
    using AspNet.Identity.MongoDB;
    using Microsoft.AspNet.Identity;
    using MongoDB.Driver;
    using NUnit.Framework;
    using System.Threading.Tasks;

    [TestFixture]
    public class EnsureWeCanExtendIdentityRoleTests : UserIntegrationTestsBase
    {
        private RoleManager<IdentityRole> manager;
        private ExtendedIdentityRole role;

        public class ExtendedIdentityRole : IdentityRole
        {
            public string ExtendedField { get; set; }
        }

        [SetUp]
        public void BeforeEachTestAfterBase()
        {
            var context = new RolesContext<IdentityRole>(Roles);
            var roleStore = new RoleStore<IdentityRole>(context);
            manager = new RoleManager<IdentityRole>(roleStore);
            role = new ExtendedIdentityRole
                   {
                       Name = "admin"
                   };
        }

        [Test]
        public async Task Create_ExtendedRoleType_SavesExtraFields()
        {
            role.ExtendedField = "extendedField";

            manager.Create(role);

            var savedRole = (ExtendedIdentityRole) await Roles.Find(_ => true).SingleAsync();
            Expect(savedRole.ExtendedField, Is.EqualTo("extendedField"));
        }

        [Test]
        public void Create_ExtendedRoleType_ReadsExtraFields()
        {
            role.ExtendedField = "extendedField";

            manager.Create(role);

            var savedRole = (ExtendedIdentityRole) manager.FindById(role.Id);
            Expect(savedRole.ExtendedField, Is.EqualTo("extendedField"));
        }
    }
}


text:
package com.supremainc.biostar2;

import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;

import com.supremainc.biostar2.activity.LoginActivity;
import com.supremainc.biostar2.widget.popup.Popup;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.matcher.ViewMatchers.isRoot;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

@RunWith(AndroidJUnit4.class)
public class UserTest {
    public static final String TAG = "AutoTest";
    @Rule
    public ActivityTestRule<LoginActivity> mActivityRule =
            new ActivityTestRule<>(LoginActivity.class);

    public void w(int time) {
        onView(isRoot()).perform(ExtTest.waitTime(time));
    }

    /**
     * User / User 등록
     */
    @Test
    public void user() {
        ExtTest.checkLogin();
        w(1000);
        Log.e(TAG, "case: User/User 등록/UserID입력/1/1. User를 선택한다.");
//        onView(withId(R.id.main_user)).perform(ViewActions.click());
        //inputTest();

        w(1000);
        onView(withId(R.id.listview)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()));
        ExtTest.waitSwipyRefresh();
        UserTestUtil.checkUserList(R.id.listview);
        Log.e(TAG, "result: 1) All Users List로 이동한다.");
//        UserTestUtil.deleteUserID();

//        inputTelephone();
//        inputEmail();
//        inputUserID();
//        inputUserName();
//        inputOperator();

//        Log.e(TAG, "result: User 추가 화면으로 이동한다.");
//
//        Log.e(TAG, "User/User 등록/UserID입력/3. User ID를 선택한다.");
//        w(1000);
//        onView(withId(R.id.user_id)).perform(ViewActions.click());
//
//
//        w(1000);
//        onView(withId(R.id.user_id)).perform(ViewActions.click());
//        w(1000);
//
//
//        onView(withId(R.id.input)).perform(ViewActions.typeText("alpha")); // subdomain
//        onView(withId(R.id.login_id)).perform(ViewActions.closeSoftKeyboard());
//        onView(isRoot()).perform(ExtTest.waitTime(1100));
//        onView(withId(R.id.login_id)).perform(ViewActions.typeText("isbaek")); //id
//        onView(withId(R.id.login_id)).perform(ViewActions.closeSoftKeyboard());
//        onView(isRoot()).perform(ExtTest.waitTime(1100));
//        onView(withId(R.id.password)).perform(ViewActions.typeText("1234Qwer+")); //password
//        onView(withId(R.id.login_id)).perform(ViewActions.closeSoftKeyboard());
//        onView(isRoot()).perform(ExtTest.waitTime(1100));
//        onView(withId(R.id.login)).perform(ViewActions.click());
//        onView(isRoot()).perform(ExtTest.waitId(R.id.main_menu, 10000));
//        onView(withId(R.id.main_menu)).check(ViewAssertions.matches(isDisplayed()));
    }

    private void inputTest() {
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        UserTestUtil.selectOperation(0);
        w(1000);
        //   onView(withId(R.id.detail_scroll)).perform(ViewActions.swipeUp());
        w(5000);
        onView(withId(R.id.password_edit)).perform(ViewActions.click());
        ExtTest.waitId(R.id.main_container, 60000);
    }

    private void inputUserName() {
        Log.e(TAG, "start: inputUserName");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        UserTestUtil.inputEdit(R.id.name, 48, R.id.name);
        UserTestUtil.saveName();
        UserTestUtil.saveUserID();
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 1) Apply 시 정상적으로 저장됨을 확인한다.");

        Log.e(TAG, "case: User/User 등록/Name입력/1. 입력한 Name이 정상적으로 등록됨을 확인한다.");
        UserTestUtil.searchDeleteUserID("4294967294", false);
        Log.e(TAG, "result:User/User 등록/Name입력/1.  User 정보, User 검색 시 정상 동작됨을 확인한다.");
        Log.e(TAG, "end: inputUserName");
    }

    private void inputUserID() {
        Log.e(TAG, "start: inputUserID");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        UserTestUtil.saveUserID();
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 1) Apply 시 정상적으로 저장됨을 확인한다.");

        ExtTest.waitSwipyRefresh();
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));

        Log.e(TAG, "case: User/User 등록/UserID입력/2/2. 최대 입력값 이상 입력한다. 4294967295");
        onView(withId(R.id.user_id)).perform(ViewActions.click());
        w(1000);
        onView(withId(R.id.user_id)).perform(ViewActions.typeText("4294967295")); //id
        w(1000);
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, false, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 2) Invalid User ID 팝업이 발생한다.");

        Log.e(TAG, "case: User/User 등록/UserID입력/3/1. 이미 등록 된 사용자와 동일한 ID를 입력한다. 4294967294");
        onView(withId(R.id.user_id)).perform(ViewActions.click());
        w(1000);
        onView(withId(R.id.user_id)).perform(ViewActions.typeText("4294967294")); //id
        w(1000);
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, false, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 1) Duplicate User 팝업이 발생한다.");

        Log.e(TAG, "case: User/User 등록/UserID입력/4/1.  ID(필수항목)를 입력하지 않는다. 2. Apply를 누른다.");
        onView(withId(R.id.user_id)).perform(ViewActions.click());
        w(1000);
        ExtTest.delEditText(R.id.user_id);
        w(1000);
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, false, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 1) You must enter ID  팝업이 발생한다.");

        pressBack();
        Log.e(TAG, "case: User/User 등록/UserID입력/5/1. 입력한 ID가 정상적으로 등록됨을 확인한다.");
        UserTestUtil.searchDeleteUserID("4294967294", false);
        Log.e(TAG, "result: User/User 등록/UserID입력/5/1. 입력한 ID가 정상적으로 등록됨을 확인한다.");
        Log.e(TAG, "end: inputUserID");
    }

    private void inputEmail() {
        Log.e(TAG, "start: inputEmail");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        UserTestUtil.saveUserID();
        UserTestUtil.saveName();
        UserTestUtil.saveTelephone();

        Log.e(TAG, "case: User/User 등록/email 입력/ 유효하지 않은 Email 주소를 입력한다.");
        UserTestUtil.saveEmail("123456!@#$^&*()_abcdefghijklmopqrst7810");
        ExtTest.checkPopupType(false, false, Popup.PopupType.ALERT);
        Log.e(TAG, "result: Email Address Invalid 팝업이 발생한다.");

        Log.e(TAG, "case: User/User 등록/email 입력/ 입력한 Email이 정상적으로 등록됨을 확인한다.");
        UserTestUtil.saveEmail("test@suprema.co.kr");
        w(1000);
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        Log.e(TAG, "result: User/User 등록/email 입력/ 입력한 Email이 정상적으로 등록됨을 확인한다.");
        w(1000);
        UserTestUtil.searchDeleteUserID("test@suprema.co.kr", true);
        Log.e(TAG, "end: inputEmail");
    }

    private void inputTelephone() {
        Log.e(TAG, "start: inputTelephone");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        UserTestUtil.saveUserID();
        UserTestUtil.saveEmail("test@suprema.co.kr");
        UserTestUtil.saveTelephone();
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        UserTestUtil.searchDeleteUserID("4294967294", true);
        Log.e(TAG, "end: inputTelephone");
    }

    private void inputOperator() {
        Log.e(TAG, "start: inputOperator");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));
        Log.e(TAG, "case: User/User 등록/operator/BioStar Operator 초기값을 확인한다.");
        onView(withId(R.id.operator)).check(ViewAssertions.matches(ViewMatchers.withText(mActivityRule.getActivity().getResources().getString(R.string.none))));
//        onView(isRoot()).perform(ExtTest.waitInvisibleGoneId(R.id.operator_expand, 3000));
        Log.e(TAG, "result: 초기값은 None으로 출력된다.");

        UserTestUtil.selectOperation(0);
        UserTestUtil.selectOperation(-1);
        UserTestUtil.selectOperation(0);

        UserTestUtil.saveUserID();
//        UserTestUtil.inputEdit(R.id.login_id, 32, R.id.login_id_edit);
        UserTestUtil.inputPassword();
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        w(1000);
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 입력한 특수기호 표시,입력한 Password로 설정이 가능해야한다.");
        UserTestUtil.searchDeleteUserID("4294967294", false);
        Log.e(TAG, "end: inputOperator");
    }

    private void inputGroup() {
        Log.e(TAG, "start: inputGroup");
        UserTestUtil.addUserCheck(mActivityRule.getActivity().getResources().getString(R.string.new_user));

        Log.e(TAG, "case: User/User 등록/operator/BioStar Operator 초기값을 확인한다.");
        onView(withId(R.id.operator)).check(ViewAssertions.matches(ViewMatchers.withText(mActivityRule.getActivity().getResources().getString(R.string.none))));
//        onView(isRoot()).perform(ExtTest.waitInvisibleGoneId(R.id.operator_expand, 3000));
        Log.e(TAG, "result: 초기값은 None으로 출력된다.");

        UserTestUtil.selectOperation(0);
        UserTestUtil.selectOperation(-1);
        UserTestUtil.selectOperation(0);

        UserTestUtil.saveUserID();
//        UserTestUtil.inputEdit(R.id.login_id, 32, R.id.login_id_edit);
        UserTestUtil.inputPassword();
        onView(withId(R.id.action_save)).perform(ViewActions.click());
        w(1000);
        ExtTest.checkPopupType(false, true, Popup.PopupType.ALERT);
        Log.e(TAG, "result: 입력한 특수기호 표시,입력한 Password로 설정이 가능해야한다.");
        UserTestUtil.searchDeleteUserID("4294967294", false);
        Log.e(TAG, "end: inputGroup");
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Hey Kowalski, you out there?">

    <meta property="og:image" content="http://vncprado.github.io/img/contact-bg.jpg" />
    <meta property="og:url" content="http://vncprado.github.io/contact/" />
    <meta property="og:title" content="Contact" />
    <meta property="og:description" content="Contact" />
    <meta property="fb:app_id" content="166534027083083" />

    <title>Contact - Vanishing Point</title>

    <link rel="canonical" href="http://vncprado.github.io/contact/">

    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <link rel="stylesheet" href="/css/clean-blog.css">

    <link rel="stylesheet" href="/css/syntax.css">

    <link rel="stylesheet" href="/css/share-page.css">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Vanishing Point

                    Home

                    About

                    Contact

Contact

                    Have questions? I have answers (maybe).

			At the bottom there is some social media that I use.

Copyright © Vanishing Point 2020


text: python ../../bin/lime.py build myrose -o ../../compiled/myrose_c/myrose_c.js -a -p myrose.start


text: THD_API bool THDMasterWorkerInit(THDChannelType channel_type);


text:
<?php
// $Id: date-vevent.tpl.php,v 1.1.2.3 2010/11/20 13:25:54 karens Exp $
/**
 * $event
 *   An array with the following information about each event:
 *
 *   $event['uid'] - a unique id for the event (usually the url).
 *   $event['summary'] - the name of the event.
 *   $event['start'] - the formatted start date of the event.
 *   $event['end'] - the formatted end date of the event.
 *   $event['rrule'] - the RRULE of the event, if any.
 *   $event['timezone'] - the formatted timezone name of the event, if any.
 *   $event['url'] - the url for the event.
 *   $event['location'] - the name of the event location, or a vvenue location id.
 *   $event['description'] - a description of the event.
 *   $event['alarm'] - an optional array of alarm values.
 *    @see date-valarm.tpl.php.
 */
?>
BEGIN:VEVENT
UID:<?php print($event['uid'] . "\r\n") ?>
SUMMARY:<?php print($event['summary'] . "\r\n") ?>
DTSTAMP:<?php print($site_timezone_utc . "Z\r\n") ?>
DTSTART;<?php print $event['timezone'] ?><?php print($event['start'] . "\r\n") ?>
<?php if (!empty($event['end'])): ?>
DTEND;<?php print $event['timezone'] ?><?php print($event['end'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['rrule'])) : ?>
<?php print($event['rrule'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['url'])): ?>
URL;VALUE=URI:<?php print($event['url'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['location'])): ?>
LOCATION:<?php print($event['location'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['description'])) : ?>
DESCRIPTION:<?php print($event['description'] . "\r\n") ?>
<?php endif; ?>
END:VEVENT


text:
ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'

require 'rails'
require 'active_record'
require 'action_controller/railtie'
require 'action_view'
require 'action_mailer'

require 'active_enum'
require 'active_enum/acts_as_enum'
require 'securerandom'
require 'byebug'

module ActiveEnum
  class Application < Rails::Application
    config.generators do |g|
      g.orm             :active_record
      g.test_framework  :rspec, :fixture => false
    end
    config.active_support.deprecation = :notify
    config.eager_load = false if Rails.version >= "4.0"
    config.secret_key_base = SecureRandom.hex(10) if Rails.version >= "4.0"
  end
end
ActiveEnum::Application.initialize!

I18n.enforce_available_locales = false
I18n.available_locales = ['en', 'ja']

ActiveRecord::Migration.verbose = false
ActiveRecord::Base.establish_connection({:adapter => "sqlite3", :database => ':memory:'})

require 'rspec/rails'
require 'support/schema'

Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }

class Person < ActiveRecord::Base; end
class NoEnumPerson < ActiveRecord::Base
  self.table_name = 'people'
end

class NotActiveRecord
  include ActiveModel::Validations
  attr_accessor :name
end

ActiveEnum.extend_classes = [ActiveRecord::Base]
ActiveEnum.extend_classes!

module SpecHelper
  def reset_class(klass, &block)
    name = klass.name.to_sym
    Object.send(:remove_const, name)
    eval "class #{klass}#{' < ' + klass.superclass.to_s if klass.superclass != Class}; end", TOPLEVEL_BINDING
    new_klass = Object.const_get(name)
    new_klass.class_eval &block if block_given?
    new_klass
  end
end

RSpec.configure do |config|
  config.include SpecHelper
  config.include ConfigHelper

  # rspec-rails 3 will no longer automatically infer an example group's spec type
  # from the file location. You can explicitly opt-in to the feature using this
  # config option.
  # To explicitly tag specs without using automatic inference, set the `:type`
  # metadata manually:
  #
  #     describe ThingsController, :type => :controller do
  #       # Equivalent to being in spec/controllers
  #     end
  config.infer_spec_type_from_file_location!
end


text:
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni.pycffi_marshal import CPyBinary, CPyObject, CPyObject, CPyObjectProxy, CPyPrimitive, CPyRecord, CPyString

from abc import ABCMeta, abstractmethod
from dh__list_binary import ListBinaryHelper
from dh__list_int32_t import ListInt32THelper
from dh__list_record_foo_some_other_record import ListRecordFooSomeOtherRecordHelper
from dh__map_string_int32_t import MapStringInt32THelper
from dh__map_string_int32_t import MapStringInt32TProxy
from foo_containers_record import FooContainersRecord
from foo_containers_record_helper import FooContainersRecordHelper
from foo_some_other_record import FooSomeOtherRecord
from foo_some_other_record_helper import FooSomeOtherRecordHelper
from future.utils import with_metaclass
from PyCFFIlib_cffi import ffi, lib

from djinni import exception # this forces run of __init__.py which gives cpp option to call back into py to create exception

class FooContainersInterface(with_metaclass(ABCMeta)):
    @abstractmethod
    def set_containers_record(self, rec):
        raise NotImplementedError

    @abstractmethod
    def get_containers_record(self):
        raise NotImplementedError

    @abstractmethod
    def set_optional_containers_record(self, rec):
        raise NotImplementedError

    @abstractmethod
    def get_optional_containers_record(self):
        raise NotImplementedError

    @abstractmethod
    def set_optional_map_string_int(self, m):
        raise NotImplementedError

    @abstractmethod
    def get_optional_map_string_int(self):
        raise NotImplementedError

    @abstractmethod
    def set_optional_list_int(self, m):
        raise NotImplementedError

    @abstractmethod
    def get_optional_list_int(self):
        raise NotImplementedError

    @abstractmethod
    def set_list_record(self, lr):
        raise NotImplementedError

    @abstractmethod
    def set_list_binary(self, lb):
        """get_list_record(): list<foo_some_other_record>; """
        raise NotImplementedError

    @abstractmethod
    def get_list_binary(self):
        raise NotImplementedError

    @staticmethod
    def create():
        """
         Commented out until we figure out the std::hash situation in hpp
        set_set_record(sr: set<foo_some_other_record>);
        get_set_record(): set<foo_some_other_record>;
        """
        return FooContainersInterfaceCppProxy.create()

class FooContainersInterfaceCppProxy(FooContainersInterface):
    def __init__(self, proxy):
        self._is_cpp_proxy = True
        self._cpp_impl = proxy
    def __del__(self):
        if not lib:
            return
        lib.foo_containers_interface___wrapper_dec_ref(self._cpp_impl)

    def set_containers_record(self, rec):
        lib.cw__foo_containers_interface_set_containers_record(self._cpp_impl, CPyRecord.fromPy(FooContainersRecord.c_data_set, rec))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def get_containers_record(self):
        _ret_c = lib.cw__foo_containers_interface_get_containers_record(self._cpp_impl)
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = CPyRecord.toPy(FooContainersRecord.c_data_set, _ret_c)
        assert _ret is not None
        return _ret

    def set_optional_containers_record(self, rec):
        lib.cw__foo_containers_interface_set_optional_containers_record(self._cpp_impl, CPyRecord.fromPyOpt(FooContainersRecord.c_data_set, rec))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def get_optional_containers_record(self):
        _ret_c = lib.cw__foo_containers_interface_get_optional_containers_record(self._cpp_impl)
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = CPyRecord.toPyOpt(FooContainersRecord.c_data_set, _ret_c)
        return _ret

    def set_optional_map_string_int(self, m):
        lib.cw__foo_containers_interface_set_optional_map_string_int(self._cpp_impl, CPyObjectProxy.fromPyOpt(MapStringInt32THelper.c_data_set, MapStringInt32TProxy(m)))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def get_optional_map_string_int(self):
        _ret_c = lib.cw__foo_containers_interface_get_optional_map_string_int(self._cpp_impl)
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = CPyObjectProxy.toPyObjOpt(MapStringInt32THelper.c_data_set, _ret_c)
        return _ret

    def set_optional_list_int(self, m):
        lib.cw__foo_containers_interface_set_optional_list_int(self._cpp_impl, CPyObject.fromPyOpt(ListInt32THelper.c_data_set, m))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def get_optional_list_int(self):
        _ret_c = lib.cw__foo_containers_interface_get_optional_list_int(self._cpp_impl)
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = CPyObject.toPyOpt(ListInt32THelper.c_data_set, _ret_c)
        return _ret

    def set_list_record(self, lr):
        lib.cw__foo_containers_interface_set_list_record(self._cpp_impl, CPyObject.fromPy(ListRecordFooSomeOtherRecordHelper.c_data_set, lr))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def set_list_binary(self, lb):
        lib.cw__foo_containers_interface_set_list_binary(self._cpp_impl, CPyObject.fromPy(ListBinaryHelper.c_data_set, lb))
        CPyException.toPyCheckAndRaise(ffi.NULL)

    def get_list_binary(self):
        _ret_c = lib.cw__foo_containers_interface_get_list_binary(self._cpp_impl)
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = CPyObject.toPy(ListBinaryHelper.c_data_set, _ret_c)
        assert _ret is not None
        return _ret

    @staticmethod
    def create():
        _ret_c = lib.cw__foo_containers_interface_create()
        CPyException.toPyCheckAndRaise(_ret_c)
        _ret = FooContainersInterfaceHelper.toPy(_ret_c)
        assert _ret is not None
        return _ret

class FooContainersInterfaceHelper:
    c_data_set = MultiSet()
    @staticmethod
    def toPy(obj):
        if obj == ffi.NULL:
            return None
        return FooContainersInterfaceCppProxy(obj)


text:
package li.seiji.minichess.move;

import li.seiji.minichess.board.State;
import li.seiji.minichess.figure.*;

public class MoveValidator {

    public static boolean isMovePhysicallyValid(State state, Move move) {
        if(!IFigure.isMoveWithinBounds(state, move)) return false;
        if(IFigure.getFieldPlayer(state, move.to) == state.turn) return false;
        if(IFigure.getFieldPlayer(state, move.from) != state.turn) return false;
        return  true;
    }

    public static boolean isMoveValid(State state, Move move) {
        if(!IFigure.isMoveWithinBounds(state, move)) return false;
        if(IFigure.getFieldPlayer(state, move.to) == state.turn) return false;
        if(IFigure.getFieldPlayer(state, move.from) != state.turn) return false;

        char identifier = move.from.getIdentifier(state);
        switch(identifier) {
            case Pawn.identifier:
                return Pawn.isMoveValid(state, move);
            case Rook.identifier:
                return Rook.isMoveValid(state, move);
            case Bishop.identifier:
                return Bishop.isMoveValid(state, move);
            case Knight.identifier:
                return Knight.isMoveValid(state, move);
            case King.identifier:
                return King.isMoveValid(state, move);
            case Queen.identifier:
                return Queen.isMoveValid(state, move);
        }
        return false;
    }

}


text:
package.path = "lua/?.lua;"..package.path

local ffi = require('ffi')
local tap = require('tap')
local common = require('serializer_test')

local function is_map(s)
    return string.sub(s, 1, 1) == "{"
end

local function is_array(s)
    return string.sub(s, 1, 1) == "["
end

tap.test("json", function(test)
    local serializer = require('json')
    test:plan(8)
    test:test("unsigned", common.test_unsigned, serializer)
    test:test("signed", common.test_signed, serializer)
    test:test("double", common.test_double, serializer)
    test:test("boolean", common.test_boolean, serializer)
    test:test("string", common.test_string, serializer)
    test:test("nil", common.test_nil, serializer)
    test:test("table", common.test_table, serializer, is_array, is_map)
    test:test("ucdata", common.test_ucdata, serializer)
end)


text:
package org.jboss.resteasy.test.form;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.test.form.resource.CollectionsFormAddress;
import org.jboss.resteasy.test.form.resource.CollectionsFormPerson;
import org.jboss.resteasy.test.form.resource.CollectionsFormResource;
import org.jboss.resteasy.test.form.resource.CollectionsFormTelephoneNumber;
import org.jboss.resteasy.util.HttpResponseCodes;
import org.jboss.resteasy.utils.PortProviderUtil;
import org.jboss.resteasy.utils.TestUtil;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * @tpSubChapter Form tests
 * @tpChapter Integration tests
 * @tpTestCaseDetails Test inner form parameters and collections.
 * @tpSince RESTEasy 3.0.16
 */
@RunWith(Arquillian.class)
@RunAsClient
public class CollectionsFormTest {

    @Deployment
    public static Archive<?> createTestArchive() {
        WebArchive war = TestUtil.prepareArchive(CollectionsFormTest.class.getSimpleName());
        war.addClasses(CollectionsFormPerson.class, CollectionsFormTelephoneNumber.class,
                CollectionsFormAddress.class);
        return TestUtil.finishContainerPrepare(war, null, CollectionsFormResource.class);
    }

    /**
     * @tpTestDetails Set all relevant parameters to form.
     * @tpSince RESTEasy 3.0.16
     */
    @Test
    public void shouldSupportCollectionsInForm() throws Exception {
        javax.ws.rs.core.Form form = new javax.ws.rs.core.Form()
        .param("telephoneNumbers[0].countryCode", "31")
        .param("telephoneNumbers[0].number", "0612345678")
        .param("telephoneNumbers[1].countryCode", "91")
        .param("telephoneNumbers[1].number", "9717738723")
        .param("address[INVOICE].street", "Main Street")
        .param("address[INVOICE].houseNumber", "2")
        .param("address[SHIPPING].street", "Square One")
        .param("address[SHIPPING].houseNumber", "13");

        ResteasyClient client = new ResteasyClientBuilder().build();
        WebTarget base = client.target(PortProviderUtil.generateURL("/person", CollectionsFormTest.class.getSimpleName()));
        Response response = base.request().accept(MediaType.TEXT_PLAIN).post(Entity.form(form));

        Assert.assertEquals(HttpResponseCodes.SC_NO_CONTENT, response.getStatus());
    }
}


text:
package org.semanticweb.elk.util.logging;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.semanticweb.elk.util.hashing.HashGenerator;

/**
 * Enhanced message class that carries information to classify the message, in
 * addition to the actual messages string.
 *
 * @author Markus Kroetzsch
 *
 */
public class ElkMessage {

	private final static Pattern PATTERN_ = Pattern.compile("\\[(.+)\\](.*)");

	protected final String message;
	protected final String messageType;

	/**
	 * Create a new message. The message can be an arbitrary string, possibly
	 * with line breaks (this is encouraged for very long messages). The
	 * messageType should be a global identifier for the kind of message,
	 * preferably human-readable and starting lower case, such as
	 * "unsupportedFeature". Dots could be used to relate a message type to a
	 * Java package/class, but mentioning ELK is not useful (start only after
	 * "org.semantiweb.elk").
	 *
	 * @param message
	 * @param messageType
	 */
	public ElkMessage(String message, String messageType) {
		this.message = message;
		this.messageType = messageType;
	}

	public String getMessage() {
		return message;
	}

	public String getMessageType() {
		return messageType;
	}

	@Override
	public String toString() {
		return message;
	}

	@Override
	public int hashCode() {
		return HashGenerator.combinedHashCode(message, messageType);
	}

	public static ElkMessage deserialize(String message) {
		Matcher matcher = PATTERN_.matcher(message);

		if (matcher.find()) {
			// the first group is the type, the second is the body. this should
			// hold no matter which pattern we use.
			String type = matcher.group(1);
			String body = matcher.group(2);

			return new ElkMessage(body, type);
		}

		return null;
	}

	public static String serialize(String type, String message) {
		return String.format("[%s]%s", type, message);
	}

}


text:
FROM node:onbuild
MAINTAINER raymond@loansolutions.ph

EXPOSE 3000


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for VirtualDiskBlocksNotFullyProvisioned complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="VirtualDiskBlocksNotFullyProvisioned">
 *   <complexContent>
 *     <extension base="{urn:vim25}DeviceBackingNotSupported">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VirtualDiskBlocksNotFullyProvisioned")
public class VirtualDiskBlocksNotFullyProvisioned
    extends DeviceBackingNotSupported
{

}


text:
#pragma once
#include "kernel/expr_maps.h"

namespace lean {
/**
   \brief Base class for implementing operations that apply modifications
   on expressions.
   The default behavior is a NOOP, users must create subclasses and
   redefine the visit_* methods.
*/
class replace_visitor {
protected:
    typedef expr_bi_struct_map<expr> cache;
    cache   m_cache;
    expr save_result(expr const & e, expr && r, bool shared);
    virtual expr visit_sort(expr const &);
    virtual expr visit_macro(expr const &);
    virtual expr visit_constant(expr const &);
    virtual expr visit_var(expr const &);
    virtual expr visit_mlocal(expr const &);
    virtual expr visit_meta(expr const &);
    virtual expr visit_local(expr const &);
    virtual expr visit_app(expr const &);
    virtual expr visit_binding(expr const &);
    virtual expr visit_lambda(expr const &);
    virtual expr visit_pi(expr const &);
    virtual expr visit_let(expr const & e);
    virtual expr visit(expr const &);
public:
    expr operator()(expr const & e) { return visit(e); }
    void clear() { m_cache.clear(); }
};
}


text:
id: topics
name: Topics
heading: Course topics
subheading:
image:
---
The course has a propose to give some concepts about particle self-assembly by using computational tools like Artficial Chemistries (AC). The AC is a tools to simulate chemical reactions processes. Those chemical reactions generates the self-assembling of molecules from particles. The will be capable to recreate chemical models on a simulation to represent natural phenomenon like, self-assembly-, self-organization and self-replication. The stufen should make a presentation about topics, create computational simulations and develop a final proyect focusen on an engineering problem.

* Artificial Chemistries - basic concepts.
* Reactive computation via artificial chemistries.
* The chemistry of life
  * What is life?
  * The basic componetens of life.
  * Different contributions from artificial chemistries to the origin of life.

* Evolution
  * Open-ended evolution
  * Self-evolution and self-assembly
  * The growing of compleixty
*The bio-inspired artificial chemistires
  * Chains based on artificial chemistries
  * Espatial structure and movement of artificial chemistries.
* Self-organization and emergent phenomenon
  * Self-organized systems examples.
  * Self-organice system concepts.
  * Explanatory concepts of emergence.
* Artificial chemistries applications:
  * Fundamental implementation.
  * Search and optimizations inspired on chemistry.
  * Artificial chemistry and genetic programming.
  * Bio-chemisty and chemistry computation.


text:
//
//  StoryboardViewController.m
//  NBRouter
//
//  Created by NapoleonBai on 16/10/18.
//  Copyright © 2016年 BaiZhiqiang. All rights reserved.
//

#import "StoryboardViewController.h"
#import "NBRouter.h"

@interface StoryboardViewController ()

@property(assign,nonatomic)BOOL isPush;
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation StoryboardViewController

- (BOOL)isPush{
    return [self.params[@"isPush"] boolValue];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.label.text = [NSString stringWithFormat:@"点击屏幕,回到上一页\n\n 传递参数为:\nuserName = %@, pwd = %@",self.params[@"userName"],self.params[@"pwd"]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    if (self.isPush) {
        [NBURLRouter pop];
    }else{
        [NBURLRouter dismiss];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
require "topical_map_to_kmaps/engine"

module TopicalMapToKmaps
  def self.topical_map_database_yaml
    settings = Rails.cache.fetch('topical_map/database.yml/hash', :expires_in => 1.day) do
      settings_file = Rails.root.join('config', 'topical_map_database.yml')
      settings_file.exist? ? YAML.load_file(settings_file) : {}
    end
    settings[Rails.env]
  end

  def self.run_importation
    categories = TopicalMap::Category.order(:id)
    self.import_categories(categories)
    self.import_relations(categories)
    self.handle_triggers
  end

  def self.import_relations(categories = TopicalMap::Category.order(:id))
    puts 'Importing category relations'
    general = Perspective.get_by_code('gen')
    categories.each do |c|
      puts "Importing category relations for #{c.id}"
      if !c.parent_id.nil?
        child_id = Feature.get_by_fid(c.id).id
        parent_id = Feature.get_by_fid(c.parent_id).id
        FeatureRelation.create(:child_node_id => child_id, :parent_node_id => parent_id, :perspective_id => general.id, :feature_relation_type_id => c.cumulative? ? FeatureRelationType.get_by_code('is.part.of').id : FeatureRelationType.get_by_code('is.an.instantiation.of').id, :skip_update => true) if FeatureRelation.where(:child_node_id => child_id, :parent_node_id => parent_id).empty?
      end
    end
  end

  def self.import_categories(categories = TopicalMap::Category.order(:id))
    puts 'Importing authors'
    authors = TopicalMap::Person.select('author_id').uniq('author_id').from('authors_descriptions').collect{|a| TopicalMap::Person.find(a.author_id).fullname.strip}
    authors.each { |fullname| AuthenticatedSystem::Person.create(:fullname => fullname) if AuthenticatedSystem::Person.find_by(fullname: fullname).nil? }

    categories.each do |c|
      puts "Importing categories names and descriptions for #{c.id}"
      f = Feature.find_by(fid: c.id)
      f = Feature.create(:is_public => c.published?, :fid => c.id) if f.nil?
      self.import_names(c, f)
      self.import_descriptions(c, f)
    end
  end

  def self.handle_triggers
    Feature.order(:fid).each do |f|
      puts "Updating cached feature names for #{f.fid}"
      f.update_cached_feature_names
    end
    Feature.order(:fid).each do |f|
      puts "Expiring cache for #{f.fid}"
      #Rails.cache.write('tree_tmp', f.id)
      f.expire_tree_cache
    end
    Feature.order(:fid).each do |f|
      puts "Updating hierarchy for #{f.fid}"
      f.update_hierarchy
    end
    Feature.order(:fid).each do |f|
      puts "Updating name positions for #{f.fid}"
      f.update_name_positions
    end
  end

  private

  def self.import_descriptions(c, f)
    c.descriptions.order(:id).each do |d|
      next if !Description.where(:feature_id => f.id, :title => d.title).empty?
      desc = f.descriptions.create :title => d.title, :is_primary => d.is_main?, :content => d.content, :author_ids => d.authors.collect{ |a| AuthenticatedSystem::Person.find_by(fullname: a.fullname.strip).id }
      d.sources.each do |s|
        note = s.note.nil? ? '' : s.note
        if !s.passage.blank?
          note << "\n" if !note.blank?
          note << "
Passage (#{self.kmaps_language(s.language_id).name})
\n"
          note << s.passage
          s.translated_sources.each do |ts|
            note << "
Translation (#{self.kmaps_language(ts.language_id).name})
\n"
            note << ts.title
          end
        end
        cit = desc.citations << Citation.create(:info_source_id => s.mms_id, :notes => note)
        cit.pages << Page.create(:volume => s.volume_number, :start_page => s.start_page, :start_line => s.start_line, :end_page => s.end_page, :end_line => s.end_line) if !s.volume_number.nil? || !s.start_page.nil? || !s.start_line.nil? || !s.end_page.nil? || !s.end_line.nil?
      end
    end
  end

  def self.import_names(c, f)
    names = f.names
    main_name = names.find_by(name: c.title)
    main_name = names.create(:name => c.title, :language_id => Language.get_by_code('eng').id, :writing_system_id => WritingSystem.get_by_code('latin').id, :is_primary_for_romanization => true, :skip_update => true) if main_name.nil?
    pending_relations = []
    c.translated_titles.order(:id).each do |t|
      language_id = t.language.id
      next if !names.find_by(name: t.title).nil?
      name = names.create(:name => t.title, :language_id => self.kmaps_language(language_id).id, :writing_system_id => self.writing_system(language_id).id, :skip_update => true)
      case language_id
      when 1, 2, 3, 4, 8, 14, 9, 13, 17  # English, Tibetan, Dzongkha, Nepali, Sanskrit, Sanskrit-Transliterated, Chinese-Traditional, Chinese-Simplified, Tibetan (Amdo)
        FeatureNameRelation.create :parent_node_id => main_name.id, :child_node_id => name.id, :is_translation => true, :skip_update => true
      else
        pending_relations << {:type => language_id, :name => name}
      end
    end
    pending_relations.each do |r|
      name = r[:name]
      case r[:type]
      when 10 # Chinese-Pinyin
        parent = names.where(:language_id => Language.get_by_code('zho').id, :writing_system_id => [WritingSystem.get_by_code('hant').id, WritingSystem.get_by_code('hans').id]).order(:id).first
        FeatureNameRelation.create :parent_node_id => parent.id, :child_node_id => name.id, :is_phonetic => true, :phonetic_system_id => PhoneticSystem.get_by_code('pinyin.transcrip').id, :skip_update => true
      when 11 # Tibetan-THL Wylie
        parent = names.where(:language_id => Language.get_by_code('bod').id, :writing_system_id => WritingSystem.get_by_code('tibt').id).order(:id).first
        if parent.nil?
          FeatureNameRelation.create :parent_node_id => main_name.id, :child_node_id => name.id, :is_translation => true, :skip_update => true
        else
          FeatureNameRelation.create :parent_node_id => parent.id, :child_node_id => name.id, :is_orthographic => true, :orthographic_system_id => OrthographicSystem.get_by_code('thl.ext.wyl.translit').id, :skip_update => true
        end
      when 12 # Tibetan-THL Phonetics
        parent = names.where(:language_id => Language.get_by_code('bod').id, :writing_system_id => WritingSystem.get_by_code('tibt').id).order(:id).first
        FeatureNameRelation.create :parent_node_id => parent.id, :child_node_id => name.id, :is_phonetic => true, :phonetic_system_id => PhoneticSystem.get_by_code('thl.simple.transcrip').id, :skip_update => true
      end
    end
  end

  def self.kmaps_language(language_id)
    case language_id
    when 1 then Language.get_by_code('eng') # English
    when 2, 11, 12, 17 then Language.get_by_code('bod') # Tibetan, Tibetan-THL Wylie, Tibetan-THL Phonetics, Tibetan (Amdo)
    when 3 then Language.get_by_code('dzo') # Dzongkha
    when 4 then Language.get_by_code('nep') # Nepali
    when 8, 14 then Language.get_by_code('san') # Sanskrit, Sanskrit-Transliterated
    when 9, 10, 13 then Language.get_by_code('zho') # Chinese-Traditional, Chinese-Pinyin, Chinese-Simplified
    end
  end

  def self.writing_system(language_id)
    case language_id
    when 1, 8, 14, 10, 11, 12 then WritingSystem.get_by_code('latin') # English, Sanskrit, Sanskrit-Transliterated, Chinese-Pinyin, Tibetan-THL Wylie, Tibetan-THL Phonetics
    when 2, 3, 17 then WritingSystem.get_by_code('tibt') # Tibetan, Dzongkha, Tibetan (Amdo)
    when 4 then WritingSystem.get_by_code('deva') # Nepali
    when 9 then WritingSystem.get_by_code('hant') # Chinese-Traditional
    when 13 then WritingSystem.get_by_code('hans') # Chinese-Simplified
    end
  end
end


text:
package com.koch.ambeth.persistence.jdbc.compositeid.models;

import com.koch.ambeth.ioc.annotation.Autowired;
import com.koch.ambeth.merge.compositeid.ICompositeIdFactory;
import com.koch.ambeth.merge.model.IDirectObjRef;
import com.koch.ambeth.merge.proxy.IEntityMetaDataHolder;
import com.koch.ambeth.merge.transfer.ObjRef;
import com.koch.ambeth.persistence.api.IPrimaryKeyProvider;
import com.koch.ambeth.persistence.api.ITableMetaData;
import com.koch.ambeth.service.merge.model.IEntityMetaData;
import com.koch.ambeth.service.merge.model.IObjRef;
import com.koch.ambeth.util.collections.IList;

public class SeqGenId implements IPrimaryKeyProvider {
	@Autowired
	protected ICompositeIdFactory compositeIdFactory;

	@Override
	public void acquireIds(ITableMetaData table, IList<IObjRef> idlessObjRefs) {
		for (int a = idlessObjRefs.size(); a-- > 0;) {
			IObjRef objRef = idlessObjRefs.get(a);
			objRef.setIdNameIndex(ObjRef.PRIMARY_KEY_INDEX);

			CompositeIdEntity entity = (CompositeIdEntity) ((IDirectObjRef) objRef).getDirect();
			IEntityMetaData metaData = ((IEntityMetaDataHolder) entity).get__EntityMetaData();
			Object id = compositeIdFactory.createCompositeId(metaData, metaData.getIdMember(), 42,
					entity.getAltId4() + entity.getAltId2());
			objRef.setId(id);
		}
	}
}


text:
namespace NetworkController.Client.Logic.DataTypes.Interfaces
{
    public interface IMeasuredDeltaState : IDeltaState
    {
        /// <summary>
        /// Velocity of whatever state change occurred
        /// </summary>
        double Velocity { get; set; }

        /// <summary>
        /// Acceleration of state change since last measure
        /// </summary>
        double Acceleration { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Contribution a l'etude des Dermatomycoses humaines tropicales de l'Afrique Equatoriale francaise, Strasbourg 86 (1935)

#### Original name
Blastodendrion schweitzeri Weiss {?}

### Remarks
null


text:
package com.limemobile.app.blog.weibo.tencent.entity.friends;

import com.limemobile.app.blog.constant.Constant;
import com.limemobile.app.blog.weibo.tencent.entity.TObject;
import com.limemobile.app.blog.weibo.tencent.entity.common.Tag;
import com.limemobile.app.blog.weibo.tencent.entity.common.Tweet;
import com.loopj.android.http.JSONArrayPoxy;
import com.loopj.android.http.JSONObjectProxy;

import org.json.JSONException;

import java.lang.reflect.Field;
import java.util.ArrayList;

// 我的听众列表
// 我收听的人列表
// 特别收听列表
public class Friend extends TObject {
    /**
     *
     */
    private static final long serialVersionUID = -1402488333172861128L;
    public String timestamp; // 服务器时间戳
    public int hasnext; // 0-表示还有数据,1-表示下页没有数据
    public ArrayList<Info> info;

    public class Info extends TObject {
        /**
         *
         */
        private static final long serialVersionUID = 5335601827719045368L;
        public String name; // 帐户名
        public String openid; // 用户唯一id,与name相对应
        public String nick; // 昵称
        public String head; // 头像url
        public int sex; // 用户性别,1-男,2-女,0-未填写
        public String location; // 用户发表微博时的所在地
        public int country_code; // 国家码
        public int province_code; // 省份码
        public int city_code; // 城市码
        public ArrayList<Tweet> tweet; // 用户最近发的一条微博
        public long fansnum; // 听众数
        public long idolnum; // 偶像数
        public boolean isfans; // 是否我的听众,false-不是,1-是
        public boolean isidol; // 是否我收听的人
        public int isvip; // 是否微博认证用户,0-不是,1-是
        public int isrealname; // 是否实名认证,0-老用户,1-已实名认证,2-已注册但未实名认证
        public ArrayList<Tag> tag; // 用户标签

        public void parse(Field field, String typeString, JSONObjectProxy data, String fieldName)
                throws IllegalArgumentException, IllegalAccessException {
            if (typeString.equals(Constant.CLASS_TYPE_ARRAY_LIST)) {
                if (fieldName.equals("tweet")) {
                    JSONArrayPoxy jsonArray = data.getJSONArrayOrNull(fieldName);
                    if (jsonArray != null) {
                        ArrayList<Tweet> array = new ArrayList<Tweet>();
                        for (int index = 0; index < jsonArray.length(); ++index) {
                            try {
                                JSONObjectProxy jsonObject = jsonArray.getJSONObject(index);
                                if (jsonObject != null) {
                                    Tweet tag = new Tweet();
                                    tag.parse(jsonObject);
                                    array.add(tag);
                                }
                            } catch (JSONException e) {
                            }
                        }
                        field.set(this, array);
                    }
                } else if (fieldName.equals("tag")) {
                    JSONArrayPoxy jsonArray = data.getJSONArrayOrNull(fieldName);
                    if (jsonArray != null) {
                        ArrayList<Tag> array = new ArrayList<Tag>();
                        for (int index = 0; index < jsonArray.length(); ++index) {
                            try {
                                JSONObjectProxy jsonObject = jsonArray.getJSONObject(index);
                                if (jsonObject != null) {
                                    Tag tag = new Tag();
                                    tag.parse(jsonObject);
                                    array.add(tag);
                                }
                            } catch (JSONException e) {
                            }
                        }
                        field.set(this, array);
                    }
                }
            } else if (typeString
                    .equals("com.limemobile.app.blog.weibo.tencent.entity.common.Tweet")) {
                try {
                    JSONObjectProxy tweetObject = data.getJSONObject(fieldName);
                    if (tweetObject != null) {
                        Tweet tweet = new Tweet();
                        tweet.parse(tweetObject);
                        field.set(this, tweet);
                    }
                } catch (JSONException e) {
                }
            }
        }
    }

    public void parse(Field field, String typeString, JSONObjectProxy data, String fieldName)
            throws IllegalArgumentException, IllegalAccessException {
        if (typeString.equals(Constant.CLASS_TYPE_ARRAY_LIST)) {
            JSONArrayPoxy jsonArray = data.getJSONArrayOrNull(fieldName);
            if (jsonArray != null) {
                ArrayList<Info> array = new ArrayList<Info>();
                for (int index = 0; index < jsonArray.length(); ++index) {
                    try {
                        JSONObjectProxy jsonObject = jsonArray.getJSONObject(index);
                        if (jsonObject != null) {
                            Info info = new Info();
                            info.parse(jsonObject);
                            array.add(info);
                        }
                    } catch (JSONException e) {
                    }
                }
                field.set(this, array);
            }
        }
    }
}


text:
package org.drools.workbench.screens.guided.dtable.client.widget.analysis;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import com.google.gwtmockito.GwtMockitoTestRunner;
import org.drools.workbench.models.guided.dtable.shared.model.ActionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn;
import org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
import org.drools.workbench.models.guided.dtable.shared.model.Pattern52;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.workbench.common.services.verifier.reporting.client.analysis.VerifierWebWorkerConnection;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.Coordinate;
import org.mockito.ArgumentCaptor;

import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

@RunWith(GwtMockitoTestRunner.class)
public class DecisionTableAnalyzerTest {

    private List<ActionCol52> actionColumns;
    private List<ConditionCol52> conditionColumns;
    private List<Pattern52> patterns;
    private Pattern52 pattern;

    private VerifierWebWorkerConnection connection;
    private DTableUpdateManager updateManager;
    private GuidedDecisionTable52 model;
    private DecisionTableAnalyzer decisionTableAnalyzer;

    @Before
    public void setUp() throws Exception {
        actionColumns = new ArrayList<>();
        conditionColumns = new ArrayList<>();
        patterns = new ArrayList<>();
        pattern = new Pattern52();

        connection = mock(VerifierWebWorkerConnection.class);
        updateManager = mock(DTableUpdateManager.class);
        model = new GuidedDecisionTable52();
        decisionTableAnalyzer = new DecisionTableAnalyzer(model,
                                                          updateManager,
                                                          connection);
    }

    @Test
    public void testOnFocus() throws Exception {
        final List<Coordinate> updates = Collections.emptyList();
        decisionTableAnalyzer.analyze(updates);

        final ArgumentCaptor<List> argumentCaptor = ArgumentCaptor.forClass(List.class);

        verify(updateManager).update(eq(model),
                                     argumentCaptor.capture());

        assertTrue(argumentCaptor.getValue()
                           .isEmpty());

        decisionTableAnalyzer.activate();

        verify(connection).activate();
    }

    @Test
    public void testInsertConditionColumn() throws Exception {

        ConditionCol52 a = new ConditionCol52();
        ConditionCol52 b = new ConditionCol52();
        conditionColumns.add(a);
        conditionColumns.add(b);
        pattern.setChildColumns(conditionColumns);
        patterns.add(pattern);

        model.getConditions().addAll(patterns);

        decisionTableAnalyzer.insertColumn(a);
        verify(updateManager).newColumn(model, 3);
    }

    @Test
    public void testInsertActionColumn() throws Exception {

        ActionCol52 a = new ActionCol52();
        a.setHeader("A");
        ActionCol52 b = new ActionCol52();
        b.setHeader("B");
        actionColumns.add(a);
        actionColumns.add(b);
        model.setActionCols(actionColumns);

        decisionTableAnalyzer.insertColumn(b);

        verify(updateManager).newColumn(model, 4);
    }

    @Test
    public void testInsertBRLConditionColumn() throws Exception {
        BRLConditionColumn brlConditionOne = new BRLConditionColumn();
        BRLConditionVariableColumn a = new BRLConditionVariableColumn();
        a.setHeader("A");
        BRLConditionVariableColumn b = new BRLConditionVariableColumn();
        b.setHeader("B");

        BRLConditionColumn brlConditionTwo = new BRLConditionColumn();
        BRLConditionVariableColumn c = new BRLConditionVariableColumn();
        BRLConditionVariableColumn d = new BRLConditionVariableColumn();

        brlConditionOne.setChildColumns(Arrays.asList(a, b));
        brlConditionTwo.setChildColumns(Arrays.asList(c, d));

        model.getConditions().addAll(Arrays.asList(brlConditionOne, brlConditionTwo));

        decisionTableAnalyzer.insertColumn(brlConditionTwo);
        verify(updateManager).newColumn(model, 5);
    }

    @Test
    public void testInsertBRLActionColumn() throws Exception {
        BRLActionColumn brlActionOne = new BRLActionColumn();
        BRLActionVariableColumn a = new BRLActionVariableColumn();
        BRLActionVariableColumn b = new BRLActionVariableColumn();

        BRLActionColumn brlActionTwo = new BRLActionColumn();
        BRLActionVariableColumn c = new BRLActionVariableColumn();
        BRLActionVariableColumn d = new BRLActionVariableColumn();

        brlActionOne.setChildColumns(Arrays.asList(a, b));
        brlActionTwo.setChildColumns(Arrays.asList(c, d));

        model.setActionCols(Arrays.asList(brlActionOne, brlActionTwo));

        decisionTableAnalyzer.insertColumn(brlActionOne);
        verify(updateManager).newColumn(model, 3);
    }

    @Test
    public void testInsertBRLVariableColumn() throws Exception {
        ConditionCol52 a = new ConditionCol52();
        a.setHeader("A");
        ConditionCol52 b = new ConditionCol52();
        b.setHeader("B");
        pattern.setChildColumns(Arrays.asList(a, b));

        BRLConditionColumn brlCondition = new BRLConditionColumn();
        BRLConditionVariableColumn c = new BRLConditionVariableColumn();
        c.setHeader("C");
        BRLConditionVariableColumn d = new BRLConditionVariableColumn();
        d.setHeader("D");
        brlCondition.setChildColumns(Arrays.asList(c, d));

        model.getConditions().addAll(Arrays.asList(pattern, brlCondition));

        decisionTableAnalyzer.insertColumn(d);
        verify(updateManager).newColumn(model, 6);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testInsertNonExistingColumn() throws Exception {
        ConditionCol52 a = new ConditionCol52();
        a.setHeader("A");
        ConditionCol52 b = new ConditionCol52();
        b.setHeader("B");
        pattern.setChildColumns(Arrays.asList(a));

        BRLConditionColumn brlCondition = new BRLConditionColumn();
        BRLConditionVariableColumn c = new BRLConditionVariableColumn();
        BRLConditionVariableColumn d = new BRLConditionVariableColumn();
        brlCondition.setChildColumns(Arrays.asList(c, d));

        model.getConditions().addAll(Arrays.asList(pattern, brlCondition));

        decisionTableAnalyzer.insertColumn(b);
    }

    @Test
    public void testSort() {
        final List<Integer> rowOrder = Collections.emptyList();
        decisionTableAnalyzer.sort(rowOrder);
        verify(updateManager).sort(rowOrder);
    }
}