text:
using System;
using System.Collections.Generic;
using Mono.WebServer.Log;
using Mono.WebServer.FastCgi;
using NRecord = Mono.WebServer.FastCgi.Record;
using Mono.WebServer.FastCgi.Compatibility;

namespace Mono.FastCgi {
	public class Connection
	{
		#region Private Fields

		readonly List<Request> requests = new List<Request> ();

		Socket socket;

		readonly Server server;

		bool keep_alive;

		bool stop;

		readonly object request_lock = new object ();

		readonly object send_lock = new object ();

		readonly Buffers receive_buffers;

		readonly Buffers send_buffers;

		readonly object connection_teardown_lock = new object ();
		#endregion

		#region Constructors

		public Connection (Socket socket, Server server)
		{
			if (socket == null)
				throw new ArgumentNullException ("socket");
			if (server == null)
				throw new ArgumentNullException ("server");

			this.socket = socket;
			this.server = server;

			receive_buffers = new Buffers(server.BigBufferManager, server.SmallBufferManager);
			send_buffers = new Buffers (server.BigBufferManager, server.SmallBufferManager);
		}

		#endregion

		#region Public Properties

		public event EventHandler RequestReceived;

		public int RequestCount {
			get {return requests.Count;}
		}

		public bool IsConnected {
			get {
				if (socket == null)
					return false;
				return socket.Connected;
			}
		}

		public Server Server {
			get {return server;}
		}

		#endregion

		#region Public Methods

		public void Run ()
		{
			Logger.Write (LogLevel.Debug, Strings.Connection_BeginningRun);
			if (socket == null) {
				Logger.Write (LogLevel.Notice, Strings.Connection_NoSocketInRun);
				return;
			}
			do {
				NRecord record;

				try {
					record = NRecord.Receive(socket, receive_buffers);
				} catch (System.Net.Sockets.SocketException) {
					StopRun (Strings.Connection_RecordNotReceived);
					Stop ();
					break;
				}

				Request request = GetRequest (record.RequestID);

				try {
					if (RequestReceived != null)
						RequestReceived.BeginInvoke (this, EventArgs.Empty, null, null);
				} catch(Exception e) {
					// We don't care if the event handler has problems
					Logger.Write(LogLevel.Error, "Error while invoking RequestReceived event:");
					Logger.Write(e);
				}

				Logger.Write(LogLevel.Debug, "Now handling record (with type {0})", record.Type);

				HandleRequest (record, request);
			}
			while (!stop && (UnfinishedRequests || keep_alive));

			if (requests.Count == 0) {
				lock (connection_teardown_lock) {
					CloseSocket();

					if (!stop)
						server.EndConnection (this);

					send_buffers.Return ();
					receive_buffers.Return ();
				}
			}

			Logger.Write (LogLevel.Debug, Strings.Connection_EndingRun);
		}

		void CloseSocket ()
		{
			try {
				if (socket != null)
					socket.Close ();
			} catch (System.Net.Sockets.SocketException e) {
				// Ignore: "The descriptor is not a socket"
				//         error from UnmanagedSocket.Close
				if (e.ErrorCode != 10038)
					throw;  // Rethrow other errors
			} catch (ObjectDisposedException){
				// Ignore: already closed
			} finally {
				socket = null;
			}
		}

		void HandleRequest (NRecord record, Request request)
		{
			switch (record.Type) {
				// Creates a new request.
			case RecordType.BeginRequest:
				HandleBeginRequest (request, record);
				break;

				// Gets server values.
			case RecordType.GetValues:
				HandleGetValues (record);
				break;

				// Sends params to the request.
			case RecordType.Params:
				HandleParams (request, record);
				break;

				// Sends standard input to the request.
			case RecordType.StandardInput:
				HandleStandardInput (request, record);
				break;

				// Sends file data to the request.
			case RecordType.Data:
				HandleData (request, record);
				break;

				// Aborts a request when the server aborts.
			case RecordType.AbortRequest:
				HandleAbortRequest (request);
				break;

				// Informs the client that the record type is
				// unknown.
			default:
				HandleUnknown (record);
				break;
			}
		}

		void HandleUnknown (NRecord record)
		{
			Logger.Write (LogLevel.Warning, Strings.Connection_UnknownRecordType, record.Type);
			SendRecord (RecordType.UnknownType, record.RequestID, new UnknownTypeBody (record.Type).GetData ());
		}

		static void HandleAbortRequest (Request request)
		{
			if (request == null)
				return;

			request.Abort (Strings.Connection_AbortRecordReceived);
		}

		void HandleData (Request request, NRecord record)
		{
			if (request == null) {
				StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID);
				return;
			}

			request.AddFileData (record);
		}

		void HandleStandardInput (Request request, NRecord record)
		{
			if (request == null) {
				StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID);
				return;
			}

			request.AddInputData (record);
		}

		void HandleParams (Request request, NRecord record)
		{
			if (request == null) {
				StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID);
				return;
			}

			IReadOnlyList<byte> body = record.GetBody ();
			request.AddParameterData (body);
		}

		void HandleGetValues (NRecord record)
		{
			byte[] response_data;

			// Look up the data from the server.
			try {
				IReadOnlyList<byte> body = record.GetBody ();
				IDictionary<string, string> pairs_in = NameValuePair.FromData (body);
				IDictionary<string, string> pairs_out = server.GetValues (pairs_in.Keys);
				response_data = NameValuePair.GetData (pairs_out);
			} catch {
				response_data = new byte[0];
			}

			SendRecord (RecordType.GetValuesResult, record.RequestID, response_data);
		}

		void HandleBeginRequest (Request request, NRecord record)
		{
			// If a request with the given ID
			// already exists, there's a bug in the
			// client. Abort.
			if (request != null) {
				StopRun (Strings.Connection_RequestAlreadyExists);
				return;
			}

			// If there are unfinished requests
			// and multiplexing is disabled, inform
			// the client and don't begin the
			// request.
			if (!server.MultiplexConnections && UnfinishedRequests) {
				EndRequest (record.RequestID, 0, ProtocolStatus.CantMultiplexConnections);
				return;
			}

			// If the maximum number of requests is
			// reached, inform the client and don't
			// begin the request.
			if (!server.CanRequest) {
				EndRequest (record.RequestID, 0, ProtocolStatus.Overloaded);
				return;
			}

			var body = new BeginRequestBody (record);

			// If the role is "Responder", and it is
			// supported, create a ResponderRequest.
			if (body.Role == Role.Responder && server.SupportsResponder)
				request = new ResponderRequest(record.RequestID, this);
			else {
				// If the role is not supported inform the client
				// and don't begin the request.
				Logger.Write (LogLevel.Warning, Strings.Connection_RoleNotSupported, body.Role);
				EndRequest (record.RequestID, 0, ProtocolStatus.UnknownRole);
				return;
			}

			lock (request_lock) {
				requests.Add (request);
			}

			keep_alive = (body.Flags & BeginRequestFlags.KeepAlive) != 0;
		}

		public void SendRecord (RecordType type, ushort requestID,
		                        byte [] bodyData)
		{
			SendRecord (type, requestID, bodyData, 0, bodyData.Length);
		}

		public void SendRecord (RecordType type, ushort requestID,
		                        byte [] bodyData, int bodyIndex,
		                        int bodyLength)
		{
			if (IsConnected)
				lock (send_lock) {
					try {
						CompatArraySegment<byte> body = send_buffers.EnforceBodyLength(bodyLength);
						Array.Copy(bodyData, bodyIndex, body.Array, body.Offset, bodyLength);
						var record = new NRecord (1, type, requestID, bodyLength, send_buffers);
						record.Send (socket);
					} catch (System.Net.Sockets.SocketException) {
					}
				}
		}

		public void EndRequest (ushort requestID, int appStatus,
		                        ProtocolStatus protocolStatus)
		{
			var body = new EndRequestBody (appStatus, protocolStatus);
			try {
				if (IsConnected) {
					byte[] bodyData = body.GetData ();
					CompatArraySegment<byte> bodyBuffer = send_buffers.EnforceBodyLength(bodyData.Length);
					Array.Copy(bodyData, 0, bodyBuffer.Array, bodyBuffer.Offset, bodyData.Length);
					var record = new NRecord (1, RecordType.EndRequest, requestID, bodyData.Length, send_buffers);
					record.Send (socket);
				}
			} catch (System.Net.Sockets.SocketException) {
			}

			RemoveRequest(requestID);

			lock (connection_teardown_lock) {
				if (requests.Count == 0 && (!keep_alive || stop)) {
					CloseSocket ();

					if (!stop)
						server.EndConnection (this);

					receive_buffers.Return ();
					send_buffers.Return ();
				}
			}
		}

		public void Stop ()
		{
			stop = true;
			lock(request_lock)
				foreach (Request req in new List<Request>(requests))
					EndRequest (req.RequestID, -1, ProtocolStatus.RequestComplete);
		}

		#endregion

		#region Private Properties

		bool UnfinishedRequests {
			get {
				lock(request_lock)
					foreach (Request request in requests)
						if (request.DataNeeded)
							return true;

				return false;
			}
		}

		#endregion

		#region Private Methods

		Request GetRequest (ushort requestID)
		{
			lock(request_lock)
				foreach (Request request in requests)
					if (request.RequestID == requestID)
						return request;

			return null;
		}

		void RemoveRequest (ushort requestID)
		{
			int i = 0;
			lock(request_lock) {
				int count = requests.Count;
				while (i < count && requests [i].RequestID != requestID)
					i ++;
				if (i != count)
					requests.RemoveAt(i);
			}
		}

		void StopRun (string message, params object [] args)
		{
			Logger.Write (LogLevel.Error, message, args);
			Logger.Write (LogLevel.Error,
				Strings.Connection_Terminating);

			Stop ();
		}

		#endregion
	}
}


text:
package sqlancer.sqlite3.ast;

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

import sqlancer.IgnoreMeException;
import sqlancer.Randomly;
import sqlancer.sqlite3.SQLite3Provider;
import sqlancer.sqlite3.schema.SQLite3DataType;
import sqlancer.sqlite3.schema.SQLite3Schema.SQLite3Column.SQLite3CollateSequence;

/**
 * @see Built-in Aggregate Functions
 */
public class SQLite3Aggregate extends SQLite3Expression {

    private final SQLite3AggregateFunction func;
    private final List<SQLite3Expression> expr;

    public enum SQLite3AggregateFunction {
        AVG() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                return SQLite3Cast.castToReal(exprVal);
            }

        },
        COUNT() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                int count;
                if (exprVal.isNull()) {
                    count = 0;
                } else {
                    count = 1;
                }
                return SQLite3Constant.createIntConstant(count);
            }
        },
        COUNT_ALL() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                return SQLite3Constant.createIntConstant(1);
            }
        },
        GROUP_CONCAT() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                SQLite3Constant castToText = SQLite3Cast.castToText(exprVal);
                if (castToText == null && SQLite3Provider.mustKnowResult) {
                    throw new IgnoreMeException();
                }
                return castToText;
            }
        },
        MAX {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                return exprVal;
            }
        },
        MIN {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                return exprVal;
            }
        },
        SUM() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                return SQLite3Cast.castToReal(exprVal);
            }

        },
        TOTAL() {
            @Override
            public SQLite3Constant apply(SQLite3Constant exprVal) {
                if (exprVal.isNull()) {
                    return SQLite3Constant.createRealConstant(0);
                } else {
                    return SQLite3Cast.castToReal(exprVal);
                }
            }

        };

        public abstract SQLite3Constant apply(SQLite3Constant exprVal);

        public static SQLite3AggregateFunction getRandom() {
            List<SQLite3AggregateFunction> functions = new ArrayList<>(Arrays.asList(values()));
            if (SQLite3Provider.mustKnowResult) {
                functions.remove(SQLite3AggregateFunction.SUM);
                functions.remove(SQLite3AggregateFunction.TOTAL);
                functions.remove(SQLite3AggregateFunction.GROUP_CONCAT);
            }
            return Randomly.fromOptions(values());
        }

        public static SQLite3AggregateFunction getRandom(SQLite3DataType type) {
            return Randomly.fromOptions(values());
        }

    }

    public SQLite3Aggregate(List<SQLite3Expression> expr, SQLite3AggregateFunction func) {
        this.expr = expr;
        this.func = func;
    }

    public SQLite3AggregateFunction getFunc() {
        return func;
    }

    public List<SQLite3Expression> getExpr() {
        return expr;
    }

    @Override
    public SQLite3CollateSequence getExplicitCollateSequence() {
        return null;
        // return expr.getExplicitCollateSequence();
    }

    @Override
    public SQLite3Constant getExpectedValue() {
        assert !SQLite3Provider.mustKnowResult;
        return null;
        // return func.apply(expr.getExpectedValue());
    }

}

redpajama_set_name: RedPajamaGithub


text:
require 'rio/version'
require 'rio/base'
require 'rio/def'
require 'rio/exception'

require 'forwardable'

$trace_states = false

require 'rio/kernel'
require 'rio/constructor'
require 'rio/construct'

require 'rio/const'

module RIO
  class Rio #:doc:
    require 'rio/local'
    include Local
    require 'rio/factory'
    protected

    attr_reader :state

    public

    # See RIO.rio
    def initialize(*args)
      @state = Factory.instance.create_state(*args)
    end

    def initialize_copy(*args)
      #p callstr("initialize_copy",args[0].inspect)
      super
      @state = Factory.instance.clone_state(@state)
    end

    # See RIO.rio
    def self.rio(*args,&block) # :yields: self
      ario = new(*args)
      if block_given?
        old_closeoncopy = ario.closeoncopy?
        begin
          yield ario.nocloseoncopy
        ensure
          ario.reset.closeoncopy(old_closeoncopy)
        end
      end
      ario
    end

    # Returns the string representation of a Rio that is used by Ruby's libraries.
    # For Rios that exist on the file system this is Rio#fspath.
    # For FTP and HTTP Rios, this is the URL.
    #
    #  rio('/a/b/c').to_s                    ==> "/a/b/c"
    #  rio('b/c').to_s                       ==> "b/c"
    #  rio('C:/b/c').to_s                    ==> "C:/b/c"
    #  rio('//ahost/a/b').to_s               ==> "//ahost/a/b"
    #  rio('file://ahost/a/b').to_s          ==> "//ahost/a/b"
    #  rio('file:///a/b').to_s               ==> "/a/b"
    #  rio('file://localhost/a/b').to_s      ==> "/a/b"
    #  rio('http://ahost/index.html').to_s   ==> "http://ahost/index.html"
    #
    def to_s() target.to_s end

    alias :to_str :to_s
    def dup
      #p callstr('dup',self)
      self.class.new(self.to_rl)
    end

    def method_missing(sym,*args,&block) #:nodoc:
      #p callstr('method_missing',sym,*args)

      result = target.__send__(sym,*args,&block)
      return result unless result.kind_of? State::Base and result.equal? target

      self
    end

    def inspect()
      cl = self.class.to_s[5..-1]
      st = state.target.class.to_s[5..-1]
      sprintf('#<%s:0x%x:"%s" (%s)>',cl,self.object_id,self.to_url,st)
    end

    protected

    def target()  #:nodoc:
      @state.target
    end

    def callstr(func,*args) #:nodoc:
      self.class.to_s+'.'+func.to_s+'('+args.join(',')+')'
    end

  end # class Rio
end # module RIO
module RIO
  class Rio
    USE_IF = true #:nodoc:

    if USE_IF
      include Enumerable
      require 'rio/if'
      include RIO::IF::Grande
      require 'rio/ext/if'
      include RIO::IF::Ext
    end
  end
end

#require 'rio/ext/zipfile.rb'

if $0 == __FILE__
  eval DATA.read, nil, $0, __LINE__+4
end

__END__

puts
puts("Run the tests that came with the distribution")
puts("From the distribution directory use 'test/runtests.rb'")
puts


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".DeviceDetailsActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center" >

        <Switch
            android:id="@+id/deviceStateSwitch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center" />
    </LinearLayout>

    <TextView
        android:id="@+id/typeLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/type"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/deviceType"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="foo"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/onSinceLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/on_since"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/deviceOnSince"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="OFF"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/totalTimeOnLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/total_time_on"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/deviceTotalTimeOn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="0 minutes"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/powerUsageLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/power_usage"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/devicePowerUsage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="0 kWh"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/timerLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/timer"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/deviceTimerDetails"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center|left"
            android:text="No Timer Set"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <ImageButton
            android:id="@+id/addTimerButton"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="38dp"
            android:layout_height="38dp"
            android:background="@drawable/new_timer"
            android:visibility="visible" />

        <ImageButton
            android:id="@+id/deleteTimerButton"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="37dp"
            android:layout_height="37dp"
            android:background="@drawable/delete_timer" />
    </LinearLayout>

</LinearLayout>


text:
<?php
/**
 * The Header for our theme.
 *
 * Displays all of the  section
 *
 * @package WordPress
 * @subpackage Siren
 * @version 3.8
 */
?><!DOCTYPE html>

<html <?php language_attributes(); ?>>

	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title><?php wp_title( '|', true, 'right' ); ?></title>
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
	<link rel="icon" type="image/x-icon" href="<?php bloginfo( 'template_url' ); ?>/favicon.ico" />

	<?php wp_head(); ?>

<?php if(isset($_COOKIE['fontloaded-project'])) {  ?>
<body <?php body_class('font-loaded'); ?>>
<?php } else {  ?>
<body <?php body_class(); ?>>
<?php }   ?>

			<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="title_link">
				<img src="<?php bloginfo( 'template_url' ); ?>/images/logo.png" alt="<?php bloginfo( 'name' ); ?>" class="title_image" />

			<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav_list', 'menu_id' => 'navMenu') ); ?>


text:
require 'webscrutinizer/level'
#require 'yaml'

module Webscrutinizer

  class SeedPool

    attr_accessor :levels

    # SeedPool new constructor
    def initialize
      @levels = []
      yield self if block_given?
    end

    # Has +uri+ been included into the pool in some level?. Returns that level
    # if true, else nil.
    def find_level(uri)
      @levels.find {|lvl| lvl.uri == uri }
    end

    # Adds a +parser+ (and receiver) associated to an +uri+
    def use_parser(uri, parser, receiver=nil)
      # error checking
      raise ArgumentError, "Invalid URI" unless uri.is_a? String
      raise ArgumentError, "Invalid parser" unless parser.is_a? Symbol

      if (level=find_level uri)
        level.use_parser parser,receiver
      else
        @levels << Webscrutinizer::Level.new(uri, parser, receiver)
      end
    end

    alias add_parser use_parser
    alias seed use_parser

    # Removes a whole level corresponding to an +uri+ or a level's +parser+ if
    # +parser+ is given.
    def remove(uri, parser=nil)
      # error checking
      raise ArgumentError, "Invalid URI" unless uri.is_a? String
      if parser
        raise ArgumentError, "Invalid parser" unless parser.is_a? Symbol
      end

      if !parser
        @levels.delete_if { |l| l.uri == uri }
      elsif (level = find_level uri)
        level.remove_parser parser
      end

    end

    # returns an array with included URIs
    def uris
      arr = []
      self.each_uri {|u| arr << u}
      arr
    end

    # returns an array with parsers (symbols that identify them) assigned to
    # parse +uri+
    def parsers(uri)
      lvl =  self.find_level(uri)
      lvl.parrecs.map(&:parser) if lvl
    end

    # ITERATORS

    # iterates over all levels yielding each one.
    def each_level(&block)
      @levels.each {|l| yield(l)}
    end

    # iterates over all levels yielding each URI.
    def each_uri(&block)
      @levels.each {|l| yield(l.uri)}
    end

  end

end


text:
NuiCompressedDepthFrame::~NuiCompressedDepthFrame()
{
	Clear();
}

void NuiCompressedDepthFrame::Clear()
{
	SafeDeleteArray(m_pDepthBuffer);
	m_nDepthWidth = 0;
	m_nDepthHeight = 0;
}

void NuiCompressedDepthFrame::DeepCopy (const NuiCompressedDepthFrame& other)
{
	NuiGrabberFrame::DeepCopy(other);

	m_ZoomFactor = other.m_ZoomFactor;
	m_ViewOffset = other.m_ViewOffset;

	if(other.m_pDepthBuffer)
	{
		UINT16* pDepthBuffer = AllocateBuffer(other.m_nDepthWidth, other.m_nDepthHeight);
		memcpy(pDepthBuffer, other.m_pDepthBuffer, GetBufferSize());
	}
	else
	{
		Clear();
	}
}

UINT16* NuiCompressedDepthFrame::AllocateBuffer(UINT width, UINT height)
{
	if(m_pDepthBuffer)
	{
		if(m_nDepthWidth != width || m_nDepthHeight != height)
		{
			Clear();
		}
	}
	if(!m_pDepthBuffer)
	{
		m_nDepthWidth = width;
		m_nDepthHeight = height;
		if(0 != m_nDepthWidth && 0 != m_nDepthHeight)
		{
			m_pDepthBuffer = new UINT16[m_nDepthWidth*m_nDepthHeight];
		}
	}
	return m_pDepthBuffer;
}


text:
package org.onosproject.virtualbng.cli;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.karaf.shell.commands.Command;
import org.onlab.packet.IpAddress;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.virtualbng.VbngConfigurationService;

/**
 * Command to show the list of vBNG IP address mapping entries.
 */
@Command(scope = "onos", name = "vbngs",
        description = "Lists all vBNG IP address mapping entries")
public class MappingListCommand extends AbstractShellCommand {

    private static final String FORMAT_HEADER =
            "   Private IP - Public IP";
    private static final String FORMAT_MAPPING =
            "   %s - %s";

    @Override
    protected void execute() {

        VbngConfigurationService service =
                AbstractShellCommand.get(VbngConfigurationService.class);

        // Print all mapping entries
        printMappingEntries(service.getIpAddressMappings());
    }

    /**
     * Prints all vBNG IP address mapping entries.
     *
     * @param map the map from private IP address to public address
     */
    private void printMappingEntries(Map<IpAddress, IpAddress> map) {
        print(FORMAT_HEADER);

        Iterator<Entry<IpAddress, IpAddress>> entries =
                map.entrySet().iterator();
        while (entries.hasNext()) {
            Entry<IpAddress, IpAddress> entry = entries.next();
            print(FORMAT_MAPPING, entry.getKey(), entry.getValue());
        }

        print("");
    }
}


text:
package com.google.appengine.tools.mapreduce.impl.sort;

import static java.nio.charset.StandardCharsets.US_ASCII;
import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.appengine.tools.mapreduce.Marshallers;

import junit.framework.TestCase;

import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.Random;

/**
 * Tests for {@link LexicographicalComparator}
 */
public class LexicographicalComparatorTest extends TestCase {

  public void testSelfCompare() {
    LexicographicalComparator comp = new LexicographicalComparator();
    ByteBuffer value = ByteBuffer.wrap("A long Test String".getBytes(US_ASCII));
    assertEquals(0, comp.compare(value, value));
    value = Marshallers.getLongMarshaller().toBytes(-1L);
    assertEquals(0, comp.compare(value, value));
    value = Marshallers.getLongMarshaller().toBytes(0L);
    assertEquals(0, comp.compare(value, value));
    value = Marshallers.getLongMarshaller().toBytes(1L);
    assertEquals(0, comp.compare(value, value));

    value = ByteBuffer.wrap("A long Test String".getBytes(US_ASCII));
    ByteBuffer same = ByteBuffer.wrap("A long Test String".getBytes(US_ASCII));
    assertEquals(0, comp.compare(value, same));
    value = Marshallers.getLongMarshaller().toBytes(1234567890L);
    same = Marshallers.getLongMarshaller().toBytes(1234567890L);
    assertEquals(0, comp.compare(value, same));
  }

  public void testCompare() {
    LexicographicalComparator comp = new LexicographicalComparator();
    ByteBuffer left = ByteBuffer.wrap("502539523".getBytes(US_ASCII));
    ByteBuffer right = ByteBuffer.wrap("-1930858313".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) > 0);
    left = ByteBuffer.wrap("foo".getBytes(US_ASCII));
    right = ByteBuffer.wrap("bar".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) > 0);
    left = ByteBuffer.wrap("A".getBytes(US_ASCII));
    right = ByteBuffer.wrap("Z".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) < 0);
    left = ByteBuffer.wrap("".getBytes(US_ASCII));
    right = ByteBuffer.wrap("x".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) < 0);
    left = ByteBuffer.wrap("x".getBytes(US_ASCII));
    right = ByteBuffer.wrap("".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) > 0);
    left = ByteBuffer.wrap("0".getBytes(US_ASCII));
    right = ByteBuffer.wrap("0".getBytes(US_ASCII));
    assertEquals(0, comp.compare(left, right));
    left = ByteBuffer.wrap("00".getBytes(US_ASCII));
    right = ByteBuffer.wrap("0".getBytes(US_ASCII));
    assertTrue(comp.compare(left, right) > 0);
  }

  public void testEpilogue() {
    LexicographicalComparator comp = new LexicographicalComparator();
    Random r = new Random(0);
    for (int i = 0; i < 100000; i++) {
      ByteBuffer b1 = ByteBuffer.allocate(12);
      ByteBuffer b2 = ByteBuffer.allocate(12);
      ByteBuffer prefix = Marshallers.getLongMarshaller().toBytes(r.nextLong());
      b1.put(prefix);
      prefix.rewind();
      b2.put(prefix);
      assertEquals(4, b1.remaining());
      assertEquals(4, b2.remaining());
      int i1 = r.nextInt();
      int i2 = r.nextInt();
      ByteBuffer suffix1 = Marshallers.getIntegerMarshaller().toBytes(i1);
      ByteBuffer suffix2 = Marshallers.getIntegerMarshaller().toBytes(i2);
      b1.put(suffix1);
      b2.put(suffix2);
      assertEquals(0, b1.remaining());
      assertEquals(0, b2.remaining());
      b1.rewind();
      b2.rewind();
      assertEquals(i1 > i2, comp.compare(b1, b2) > 0);
      assertEquals(i1 < i2, comp.compare(b1, b2) < 0);
    }
  }

  public void testRandomStrings() {
    LexicographicalComparator comp = new LexicographicalComparator();
    Random r = new Random(0);
    for (int i = 0; i < 100000; i++) {
      String s1 = getRandomString(r);
      String s2 = getRandomString(r);
      ByteBuffer b1 = UTF_8.encode(s1);
      ByteBuffer b2 = UTF_8.encode(s2);
      assertEquals(s1.compareTo(s2) > 0, comp.compare(b1, b2) > 0);
      assertEquals(s1.compareTo(s2) < 0, comp.compare(b1, b2) < 0);
    }
  }

  private String getRandomString(Random r) {
    CharBuffer chars = CharBuffer.allocate(10);
    while (chars.hasRemaining()) {
      chars.append((char) r.nextInt());
    } // Round-triping the data so as to transform out any invalid sequences
    return UTF_8.decode(UTF_8.encode(chars)).toString();
  }

  public void testNumbersCompare() {
    LexicographicalComparator comp = new LexicographicalComparator();
    ByteBuffer min = Marshallers.getIntegerMarshaller().toBytes(Integer.MIN_VALUE);
    ByteBuffer negTwo = Marshallers.getIntegerMarshaller().toBytes(-2);
    ByteBuffer negOne = Marshallers.getIntegerMarshaller().toBytes(-1);
    ByteBuffer zero = Marshallers.getIntegerMarshaller().toBytes(0);
    ByteBuffer one = Marshallers.getIntegerMarshaller().toBytes(1);
    ByteBuffer two = Marshallers.getIntegerMarshaller().toBytes(2);
    ByteBuffer twoFiftyFive = Marshallers.getIntegerMarshaller().toBytes(255);
    ByteBuffer twoFiftySix = Marshallers.getIntegerMarshaller().toBytes(256);
    ByteBuffer max = Marshallers.getIntegerMarshaller().toBytes(Integer.MAX_VALUE);
    assertTrue(comp.compare(min, negTwo) < 0);
    assertTrue(comp.compare(negTwo, negOne) < 0);
    assertTrue(comp.compare(negOne, zero) < 0);
    assertTrue(comp.compare(zero, one) < 0);
    assertTrue(comp.compare(one, two) < 0);
    assertTrue(comp.compare(two, twoFiftyFive) < 0);
    assertTrue(comp.compare(twoFiftyFive, twoFiftySix) < 0);
    assertTrue(comp.compare(twoFiftySix, max) < 0);
    assertTrue(comp.compare(min, max) < 0);

    min = Marshallers.getLongMarshaller().toBytes(Long.MIN_VALUE);
    negTwo = Marshallers.getLongMarshaller().toBytes(-2L);
    negOne = Marshallers.getLongMarshaller().toBytes(-1L);
    zero = Marshallers.getLongMarshaller().toBytes(0L);
    one = Marshallers.getLongMarshaller().toBytes(1L);
    two = Marshallers.getLongMarshaller().toBytes(2L);
    twoFiftyFive = Marshallers.getLongMarshaller().toBytes(255L);
    twoFiftySix = Marshallers.getLongMarshaller().toBytes(256L);
    max = Marshallers.getLongMarshaller().toBytes(Long.MAX_VALUE);
    assertTrue(comp.compare(min, negTwo) < 0);
    assertTrue(comp.compare(negTwo, negOne) < 0);
    assertTrue(comp.compare(negOne, zero) < 0);
    assertTrue(comp.compare(zero, one) < 0);
    assertTrue(comp.compare(one, two) < 0);
    assertTrue(comp.compare(two, twoFiftyFive) < 0);
    assertTrue(comp.compare(twoFiftyFive, twoFiftySix) < 0);
    assertTrue(comp.compare(twoFiftySix, max) < 0);
    assertTrue(comp.compare(min, max) < 0);
  }

}


text:
\hypertarget{namespacesisl_1_1utility}{}\section{sisl\+:\+:utility Namespace Reference}
\label{namespacesisl_1_1utility}\index{sisl\+::utility@{sisl\+::utility}}

Namespace for utility functions, anything that\textquotesingle{}s generally helpful, but not related to shift invariant spaces.

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item
class \hyperlink{classsisl_1_1utility_1_1isosurface}{isosurface}
\begin{DoxyCompactList}\small\item\em An implementation of marching cubes. \end{DoxyCompactList}\item
class \hyperlink{classsisl_1_1utility_1_1ply__mesh}{ply\+\_\+mesh}
\begin{DoxyCompactList}\small\item\em A barebones ply mesh writer. \end{DoxyCompactList}\item
class \hyperlink{classsisl_1_1utility_1_1ppm__image}{ppm\+\_\+image}
\begin{DoxyCompactList}\small\item\em P\+PM image writer. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Detailed Description}
Namespace for utility functions, anything that\textquotesingle{}s generally helpful, but not related to shift invariant spaces.


text:
/*

 * CIS2750 F2017

 * Assignment 1

 * Dominick Hera 0943778

 * This file contains the implementation of the linked List API that also utilises an iterator to traverse through the doubly linked list.

 * This implementation is based on the List API that I implemented in my Assignment 1 for CIS2520, which I took

 * in the summer of 2017 with professor Judi McCuaig.  The permission to use my CIS2520 code in CIS2750 was obtained on my behalf by

 * my current CIS2750 professor, Denis Nikitenko.

 */

#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "LinkedListAPI.h"
#include "CalendarParser.h"

Event* initializeEvent();
Property* initializeProperty(char* propName, char* propDescr);
Alarm* initializeAlarm(char* action, char* trigger);
void  tDestroy(void *data);
char * tPrint(void *toBePrinted);
int tCompare(const void * one, const void * two);

ErrorCode createCalendar(char* fileName, Calendar** obj)
{
    FILE *fp;
    char line[256];
    char lineStorage[256][500];
    char eventPropNameStorage[256][200];
    char eventPropDscrStorage[256][500];
    char alarmPropNameStorage[500][200];
    char alarmPropDscrStorage[500][500];
    char alarmActionStorage[256][200];
    char alarmTriggerStorage[256][500];
    char UIDStorage[256];
    char VersionStorage[256];
    char PROIDStorage[256];
    char DSTAMPStorage[256];
    char triggerStorage[256];
    char actionStorage[200];
    char newOtherTempStorage[256];
    float tempVersion = 0;
    char newTempStorage[200];
    char newTempDscStorage[256];
    char *tempStorage = malloc(sizeof(char) * 1000);
    char *otherTempStorage = malloc(sizeof(char) * 9);
    char tempDateStorage[9];
    char tempTimeStorage[7];
    int count = 0;
    int tempSize = 0;
    int eventFlag = 0;
    int calendarFlag = 0;
    int alarmFlag = 0;
    int versionFlag = 0;
    int proidFlag = 0;
    int uidFlag = 0;
    int dstampFlag = 0;
    int tempCount = 0;
    int eventPropCount = 0;
    int alarmPropCount = 0;
    int totalAlarmCount = 0;
    int totalAlarmPropCount = 0;
    int totalAlarmPropArray[500];

    //parsing into a string array
    if(fileName != NULL && fileName[0] != '\0')
    {
        // printf("filename is: %s", fileName);
        if((strstr(fileName, ".ics")))
        {
            // if(strcmp(&fileName[strlen(fileName)], "\n") == 0 || strcmp(&fileName[strlen(fileName)+1], "\r") == 0 )
            // {
                // printf("the pass char is %c\n", fileName[strlen(fileName) + 1]);
                if((fp = fopen(fileName, "r")))
                {
                    while(fgets(line, sizeof(line), fp) != NULL)
                    {
                        if(line[strlen(line) - 1] == '\n')
                        {
                            line[strlen(line) - 1] = '\0';
                        }
                        strcpy(lineStorage[count], line);
                        count++;
                    }

                    fclose(fp);
                }
                else
                {

                    return INV_FILE;
                }
            // }
            // else
            // {
            //     printf("the fail char is %c >\n", fileName[strlen(fileName) + 1]);
            //     return INV_FILE;
            // }
        }
        else
        {
            return INV_FILE;
        }
    }
    else
    {
        return INV_FILE;
    }

    Calendar* parseCalendar;
    // List tempAlarmStorage;
    // Calendar *parseCalendar = *obj;
    // Event * parseEvent = NULL;
    Alarm * tempAlarm;
    // Property* tempProperty;

    for(int i = 0; i < count; i++)
    {

        if((strcasestr(lineStorage[i], "BEGIN")) && (strcasestr(lineStorage[i], "VCALENDAR")) && calendarFlag == 0)
        {
            // printf("2\n");
            parseCalendar = malloc(sizeof(Calendar));
            // (*obj) = malloc(sizeof(Calendar));
            // parseCalendar = initializeCalendar();
            calendarFlag++;
            // printf("count = %d\n", i);
        }
        else if((strcasestr(lineStorage[i], "PRODID")) && calendarFlag == 1)
        {
            // printf("3\n");

            if(proidFlag == 0)
            {
                proidFlag++;
                for(int j = 0; j < strlen(lineStorage[i]); j++)
                {
                    // printf("4\n");
                    if(lineStorage[i][j] == ':')
                    {
                        // printf("5\n");
                        j++;
                        while(lineStorage[i][j+1] != '\0')
                        {
                            // printf("6\n");
                            tempStorage[tempSize] = lineStorage[i][j];
                            tempSize++;
                            j++;
                        }
                    }
                }

                if(tempSize != 0)
                {
                    strcpy(PROIDStorage, tempStorage);
                    strcpy(parseCalendar->prodID, PROIDStorage);
                }
                else
                {
                    return INV_PRODID;
                }

                tempSize = 0;
                memset(tempStorage, '\0', 1000);
            }
            else
            {
                return DUP_PRODID;
            }
        }
        else if((strcasestr(lineStorage[i], "VERSION")) && calendarFlag == 1 && versionFlag == 0)
        {
            // printf("8\n");
            if((strcasestr(lineStorage[i], "2")))
            {

                for(int j = 0; j < strlen(lineStorage[i]); j++)
                {
                    if(lineStorage[i][j] == ':')
                    {
                        j++;
                        while(lineStorage[i][j] != '\0')
                        {
                            tempStorage[tempSize] = lineStorage[i][j];
                            tempSize++;
                            j++;
                        }
                    }
                }

                strcpy(VersionStorage, tempStorage);
                tempVersion = atof(VersionStorage);
                // parseCalendar->version = tempVersion;
                parseCalendar->version = tempVersion;
                tempSize = 0;
                memset(tempStorage, '\0', 1000);
                versionFlag++;
            }
            else
            {
                return INV_VER;
            }
        }
        else if((strcasestr(lineStorage[i], "BEGIN")) && (strcasestr(lineStorage[i], "VEVENT")) && eventFlag == 0 && calendarFlag == 1)
        {
            // printf("9\n");
            eventFlag++;
            parseCalendar->event = initializeEvent();
            // printf("9a\n");
            // parseCalendar->event = malloc(sizeof(Event));
            // parseCalendar->event->properties = initializeList(NULL, NULL, NULL);
            // parseCalendar->event->alarms = initializeList(NULL, NULL, NULL);

        }
        else if((strcasestr(lineStorage[i], "UID")) && eventFlag == 1)
        {
            // printf("10\n");
            uidFlag++;
            for(int j = 0; j < strlen(lineStorage[i]); j++)
            {
                if(lineStorage[i][j] == ':')
                {
                    j++;
                    while(lineStorage[i][j] != '\0')
                    {
                        tempStorage[tempSize] = lineStorage[i][j];
                        tempSize++;
                        j++;
                    }
                }
            }

            strcpy(UIDStorage, tempStorage);
            strcpy(parseCalendar->event->UID, UIDStorage);
            tempSize = 0;
            memset(tempStorage, '\0', 1000);
        }
        else if((strcasestr(lineStorage[i], "DTSTAMP")) && dstampFlag == 0)
        {
            // printf("11\n");
            dstampFlag++;
            for(int j = 0; j < strlen(lineStorage[i]); j++)
            {
                if(lineStorage[i][j] == ':')
                {
                    j++;
                    while(lineStorage[i][j] != '\0')
                    {
                        tempStorage[tempSize] = lineStorage[i][j];
                        tempSize++;
                        j++;
                    }
                }
            }

            strcpy(DSTAMPStorage, tempStorage);
            // char * boolCheck;
            bool tempUTC;
            int tempThirdVal = 0;
            if((strcasestr(DSTAMPStorage, "Z")))
            {
                tempUTC = true;
                parseCalendar->event->creationDateTime.UTC = true;
            }
            else
            {
                tempUTC = false;
                parseCalendar->event->creationDateTime.UTC = false;
            }

            for(int j = 0; j < strlen(DSTAMPStorage); j++)
            {

                while(DSTAMPStorage[j] != 'T')
                {
                    if(DSTAMPStorage[j] != 'T')
                    {
                        tempDateStorage[tempCount] = DSTAMPStorage[j];
                        j++;
                        tempCount++;
                    }
                    else
                    {
                        j++;
                    }
                }

                j++;
                if(tempUTC == true)
                {
                    while(DSTAMPStorage[j+1] != '\0')
                    {

                        if(DSTAMPStorage[j] != 'Z')
                        {
                            tempTimeStorage[tempThirdVal] = DSTAMPStorage[j];
                            j++;
                            tempThirdVal++;
                        }
                        else
                        {
                            j++;
                        }
                    }
                }
                else
                {
                    while(DSTAMPStorage[j+1] != '\0')
                    {
                        tempTimeStorage[tempThirdVal] = DSTAMPStorage[j];
                        j++;
                        tempThirdVal++;
                    }
                }

            }

            if((!strcasestr(DSTAMPStorage, "T")) || tempThirdVal > 7 || tempCount > 9 || tempThirdVal < 5 || tempCount < 7)
            {
                return INV_CREATEDT;
            }
            else
            {
                strcpy(parseCalendar->event->creationDateTime.date, tempDateStorage);
                strcpy(parseCalendar->event->creationDateTime.time, tempTimeStorage);
            }

            tempSize = 0;
            tempCount = 0;
            tempThirdVal = 0;
            memset(otherTempStorage, '\0', 1000);
            memset(tempStorage, '\0', 1000);
        }
        else if((strcasestr(lineStorage[i], "END")) && (strcasestr(lineStorage[i], "VEVENT")) && eventFlag == 1)
        {
            Property * testEventInsertVal;
            for(int k = 0; k < eventPropCount; k++)
            {
                if(strlen(eventPropDscrStorage[k]) == 0)
                {
                    return INV_EVENT;
                }
                testEventInsertVal = initializeProperty(eventPropNameStorage[k], eventPropDscrStorage[k]);
                insertBack(&parseCalendar->event->properties, (void*)testEventInsertVal);

            }

            for(int j = 1; j < totalAlarmCount + 1; j++)
            {
                if(strlen(alarmActionStorage[j]) == 0 || strlen(alarmTriggerStorage[j]) == 0)
                {
                    return INV_EVENT;
                }
                tempAlarm = initializeAlarm(alarmActionStorage[j], alarmTriggerStorage[j]);
                Property * alarmProp;
                if(j == 0)
                {
                    for(int k = 0; k < totalAlarmPropArray[j]; k++)
                    {

                        if(strlen(alarmPropDscrStorage[k]) == 0)
                        {
                            return INV_EVENT;
                        }

                        alarmProp = initializeProperty(alarmPropNameStorage[k], alarmPropDscrStorage[k]);
                        insertBack(&tempAlarm->properties, (void*)alarmProp);
                    }
                }
                else
                {
                    for(int k = totalAlarmPropArray[j-1]; k < totalAlarmPropArray[j]; k++)
                    {
                        if(strlen(alarmPropDscrStorage[k]) == 0)
                        {
                            return INV_EVENT;
                        }
                       alarmProp = initializeProperty(alarmPropNameStorage[k], alarmPropDscrStorage[k]);
                       insertBack(&tempAlarm->properties, (void*)alarmProp);
                    }
                }
                insertBack(&parseCalendar->event->alarms, tempAlarm);
            }

            totalAlarmPropCount = 0;
            eventPropCount = 0;
            eventFlag++;
        }
        else if((strcasestr(lineStorage[i], "END")) && (strcasestr(lineStorage[i], "VCALENDAR")) && calendarFlag == 1)
        {
            calendarFlag++;
        }
        else if((strcasestr(lineStorage[i], "BEGIN")) && (strcasestr(lineStorage[i], "VALARM")) && eventFlag == 1 && alarmFlag == 0)
        {
            alarmFlag++;
            totalAlarmCount++;
        }
        else if((strcasestr(lineStorage[i], "TRIGGER")) && calendarFlag == 1 &&  eventFlag == 1 && alarmFlag == 1)
        {
            for(int j = 0; j < strlen(lineStorage[i]); j++)
            {
                if(lineStorage[i][j] == ';')
                {
                    j++;
                    while(lineStorage[i][j] != '\0')
                    {
                        newOtherTempStorage[tempSize] = lineStorage[i][j];
                        // printf("char is %c\n", lineStorage[i][j]);
                        tempSize++;
                        j++;
                    }
                }
                else if(lineStorage[i][j] == ':')
                {
                    j++;
                    while(lineStorage[i][j] != '\0')
                    {
                        newOtherTempStorage[tempSize] = lineStorage[i][j];
                        // printf("char is %c\n", lineStorage[i][j]);
                        tempSize++;
                        j++;
                    }
                }
            }

            strcpy(alarmTriggerStorage[totalAlarmCount], newOtherTempStorage);

            tempSize = 0;
            memset(newOtherTempStorage, '\0', 256);
            // memset(triggerStorage, '\0', 200);
    }
    else if((strcasestr(lineStorage[i], "ACTION")) && calendarFlag == 1 && eventFlag == 1 && alarmFlag == 1)
    {
        // printf("fuck\n");
        for(int j = 0; j < strlen(lineStorage[i]); j++)
        {
            if(lineStorage[i][j] == ':')
            {
                j++;
                while(lineStorage[i][j+1] != '\0')
                {
                    // printf("char is %c\n", lineStorage[i][j]);
                    tempStorage[tempSize] = lineStorage[i][j];
                    // printf("char is %c\n", lineStorage[i][j]);
                    tempSize++;
                    j++;
                }
            }
        }

        strcpy(alarmActionStorage[totalAlarmCount], tempStorage);

        tempSize = 0;
        memset(tempStorage, '\0', 1000);
        // memset(actionStorage,'\0', 200);
    }
    else if((strcasestr(lineStorage[i], "END")) && (strcasestr(lineStorage[i], "VALARM")) && calendarFlag == 1 && alarmFlag == 1 && eventFlag == 1)
    {

        // int tempIntVal = 0;
        totalAlarmPropArray[totalAlarmCount] = totalAlarmPropCount;

        memset(triggerStorage, '\0', 200);
        memset(actionStorage,'\0', 200);
        // printf("6b\n");
        alarmFlag--;
        alarmPropCount = 0;

        // printf("after local insert aciton: %s, trigger: %s\n", (Alarm*)tempAlarmStorage.tail->data->action, (Alarm*)tempAlarmStorage.tail->data->trigger);
        printf("\n\n");
    }
    //alarm property
    else if(calendarFlag == 1 && eventFlag == 1 && alarmFlag == 1 && lineStorage[i][0] != ';')
    {
        // printf("test prop fucker\n");
        for(int j = 0; j < strlen(lineStorage[i]); j++)
        {
            if(lineStorage[i][j] != ':')
            {
                // j++;
                while(lineStorage[i][j] != ':')
                {
                    if(lineStorage[i][j] != ';')
                    {
                        newTempStorage[tempSize] = lineStorage[i][j];
                        tempSize++;
                        j++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            j++;
            while(lineStorage[i][j] != '\0')
            {
                newTempDscStorage[tempCount] = lineStorage[i][j];
                tempCount++;
                j++;
            }
        }

        if(tempSize != 0 && tempCount != 0)
        {
            // if(newTempStorage[tempSize - 1] == '\n')
            // {
            //         newTempStorage[tempSize - 1] = '\0';
            // }

            // if(newTempDscStorage[tempCount - 1] == '\n')
            // {
            newTempDscStorage[tempCount - 1] = '\0';
            // }

            strcpy(alarmPropNameStorage[totalAlarmPropCount], newTempStorage);
            strcpy(alarmPropDscrStorage[totalAlarmPropCount], newTempDscStorage);
            alarmPropCount++;
            totalAlarmPropCount++;

        }
        else
        {
            return INV_EVENT;
        }

        tempSize = 0;
        tempCount = 0;
        memset(tempStorage, '\0', 1000);
        memset(otherTempStorage, '\0', 1000);
        memset(newTempStorage, '\0', 200);
        memset(newTempDscStorage, '\0', 256);
    }
    //event property
    else if(calendarFlag == 1 && eventFlag == 1 && alarmFlag == 0 && lineStorage[i][0] != ';')
    {

        for(int j = 0; j < strlen(lineStorage[i]); j++)
        {
            if(lineStorage[i][j] != ':')
            {
                // j++;
                while(lineStorage[i][j] != ':')
                {
                    if(lineStorage[i][j] != ';')
                    {
                        newTempStorage[tempSize] = lineStorage[i][j];
                        tempSize++;
                        j++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            j++;
            while(lineStorage[i][j+1] != '\0')
            {
                newTempDscStorage[tempCount] = lineStorage[i][j];
                tempCount++;
                j++;
            }
        }

        if(tempSize != 0 && tempCount != 0)
        {
            // if(newTempStorage[tempSize - 1] == '\n')
            // {
            //         newTempStorage[tempSize - 1] = '\0';
            // }

            // if(newTempDscStorage[tempCount - 1] == '\n')
            // {
            // newTempDscStorage[tempCount - 1] = '\0';
            // }

            strcpy(eventPropNameStorage[eventPropCount], newTempStorage);
            strcpy(eventPropDscrStorage[eventPropCount], newTempDscStorage);
            eventPropCount++;

        }
        else
        {
            return INV_EVENT;
        }
        tempSize = 0;
        tempCount = 0;
        memset(tempStorage, '\0', 1000);
        memset(otherTempStorage, '\0', 1000);
        memset(newTempStorage, '\0', 200);
        memset(newTempDscStorage, '\0', 256);
        // memset(finalTempStorage, '\0', 256);
    }
    else if((strcasestr(lineStorage[i], "VERSION")) && versionFlag == 1)
    {
        return DUP_VER;
    }
    else if((strcasestr(lineStorage[i], "PROID")) && proidFlag == 1)
    {
        return DUP_PRODID;
    }
    // printf("uh\n");
}
// printf("hi\n");

if(calendarFlag != 2 || proidFlag != 1 || versionFlag != 1 || eventFlag != 2)
{
    // printf("fuck\n");
    return INV_CAL;
}
else  if(uidFlag != 1 || dstampFlag != 1)
{
    return INV_EVENT;
}
else
{
    // printf("what\n");
    *obj = parseCalendar;
    (*obj)->event = parseCalendar->event;
    (*obj)->event->properties = parseCalendar->event->properties;
    (*obj)->event->alarms = parseCalendar->event->alarms;
    // strcpy((*obj)->prodID, parseCalendar->prodID);
    // *obj = parseCalendar;
    // printf("but how does this work\n");
    return OK;
}

}

void deleteCalendar(Calendar* obj)
{
    if(obj != NULL)
    {

        void *eventAlarmsDeleteElem;
        ListIterator eventAlarmsDeleteIter = createIterator(obj->event->alarms);
        while((eventAlarmsDeleteElem = nextElement(&eventAlarmsDeleteIter)) != NULL)
        {
            Alarm* tempEventAlarmDelete = (Alarm*)eventAlarmsDeleteElem;
            // clearList(tempEventAlarmDelete);
            void *alarmPropDeleteElem;
            ListIterator alarmPropDeleteIter = createIterator(tempEventAlarmDelete->properties);
            while((alarmPropDeleteElem = nextElement(&alarmPropDeleteIter)) != NULL)
            {
                List* tempAlarmPropDelete = (List*)alarmPropDeleteElem;
                clearList(tempAlarmPropDelete);
            }
        }

        void *eventPropertiesDeleteElem;
        ListIterator eventPropertiesDeleteIter = createIterator(obj->event->properties);
        while((eventPropertiesDeleteElem = nextElement(&eventPropertiesDeleteIter)) != NULL)
        {
            List* tempEventPropertiesDelete = (List*)eventPropertiesDeleteElem;
            clearList(tempEventPropertiesDelete);
        }

        free(obj->event);
        free(obj);
    }
}

char* printCalendar(const Calendar* obj)
{

    char * calendarReturn = malloc(sizeof(char) * 1000);

    if(obj != NULL)
    {
        sprintf(calendarReturn, "\n\nCalendar\n     Version = %f, ProdID = %s\n", obj->version, obj->prodID);

        if(obj->event != NULL)
        {

            sprintf(calendarReturn + strlen(calendarReturn), "\nEvent\nUID = %s\n", obj->event->UID);
            // if(obj->event->creationDateTime.date != NULL)
            // {
            sprintf(calendarReturn + strlen(calendarReturn), "  creationDateTime = %s:%s UTC = %d\n", obj->event->creationDateTime.date, obj->event->creationDateTime.time, obj->event->creationDateTime.UTC);
            // }

            if(obj->event->alarms.head != NULL)
            {
                strcat(calendarReturn, "\nAlarms:\n");
                void* elem;
                ListIterator eventAlarmsIter = createIterator(obj->event->alarms);
                while((elem = nextElement(&eventAlarmsIter)) != NULL)
                {
                    Alarm* tempAlarmPrint = (Alarm*)elem;

                    sprintf(calendarReturn + strlen(calendarReturn), "  Action: %s\n    Trigger: %s\n   Properties:\n",tempAlarmPrint->action, tempAlarmPrint->trigger);
                    ListIterator eventAlarmsPropIter = createIterator(tempAlarmPrint->properties);
                    void *propElem;
                    while((propElem = nextElement(&eventAlarmsPropIter)) != NULL)
                    {
                        Property* tempPropPrint = (Property*)propElem;
                        sprintf(calendarReturn + strlen(calendarReturn), "      %s:%s\n", tempPropPrint->propName, tempPropPrint->propDescr);
                    }

                }
            }

            strcat(calendarReturn + strlen(calendarReturn), "\nOther Properties:\n");

            void *eventPropElem;
            ListIterator eventPropertiesIter = createIterator(obj->event->properties);
            while((eventPropElem = nextElement(&eventPropertiesIter)) != NULL)
            {
                Property* tempEventPropPrint = (Property*)eventPropElem;
                sprintf(calendarReturn + strlen(calendarReturn), "  %s:%s\n", tempEventPropPrint->propName, tempEventPropPrint->propDescr);
            }

        }

        return calendarReturn;
    }

    return NULL;

}

char* printError(ErrorCode err)
{

    // printf("%U is entered\n", err);
    char * errorCodeReturn = malloc(sizeof(char) * 256);
    if(err == INV_FILE)
    {
        strcpy(errorCodeReturn, "INV_FILE: there's a problem with file argument - its null, it;'s a empty string, file doesn't exist or - cannot be opened,file doesn't have the.ics extension\n");
    }
    else if(err == INV_VER)
    {

        strcpy(errorCodeReturn, "INV_VER: the calendar version property is present but malformed\n");
    }
    else if(err == DUP_VER)
    {

        strcpy(errorCodeReturn,"DUP_VER: the calendar version property appears more than once\n");
    }
    else if(err == INV_PRODID)
    {

        strcpy(errorCodeReturn, "INV_PRODID: the product ID property is present but malformed\n");
    }
    else if(err == DUP_PRODID)
    {

        strcpy(errorCodeReturn, "DUP_PRODID: the product ID property appears more than once\n");
    }
    else if(err == INV_CAL)
    {

        strcpy(errorCodeReturn, "INV_CAL: the calendar itself is invalid (missing required properties or components, invalid opening - closingtags,etc.)\n");
    }
    else if(err == INV_CREATEDT)
    {

        strcpy(errorCodeReturn, "INV_CREADEDT: the event creation date-time property is malformed in some way\n");
    }
    else if(err == INV_EVENT)
    {

        strcpy(errorCodeReturn, "INV_EVENT: the event component is malformed in some way\n");
    }
    else if(err == OK)
    {
        strcpy(errorCodeReturn, "OK: File parsed successfully.\n");
    }
    else
    {
        strcpy(errorCodeReturn, "error code not found\n");
    }

    return errorCodeReturn;

}

Event* initializeEvent()
{

    Event * tempEvent = malloc(sizeof(Event));
    tempEvent->properties = initializeList(NULL, NULL, NULL);
    tempEvent->alarms = initializeList(NULL, NULL, NULL);

    return tempEvent;
}

Property* initializeProperty(char* propName, char* propDescr)
{

    Property* tempProp;

    tempProp = malloc(sizeof(Property) + (sizeof(char)*(strlen(propDescr)+1)));
    strcpy(tempProp->propName, propName);
    strcpy(tempProp->propDescr, propDescr);
    // printf("name: %s, dsc: %s\n", tempProp->propName, tempProp->propDescr);

    return tempProp;

}

Alarm* initializeAlarm(char* action, char* trigger)
{

    Alarm * initAlarm = malloc(sizeof(Alarm));
    initAlarm->trigger = malloc(sizeof(char) * (strlen(trigger)+1));
    initAlarm->properties = initializeList(NULL, NULL, NULL);

    strcpy(initAlarm->trigger, trigger);
    strcpy(initAlarm->action, action);

    return initAlarm;

}

void  tDestroy(void *data)
{
    free(data);
}

char * tPrint(void *toBePrinted)
{
    if(toBePrinted!=NULL){
        return strdup((char *)toBePrinted);
    }
    return NULL;
}

int tCompare(const void * one, const void * two)
{
    return strcmp((char*)one, (char*)two);
}


text:
This test cook mimics a cookbook that places your SSL certificates seperately from openldap.
Hidden here to prevent you from using these certificates for real.


text:
module Arel
  module Nodes
    class Grouping < Arel::Nodes::Unary
    end
  end
end


text:
// This software is part of the Autofac IoC container
// Copyright (c) 2012 Autofac Contributors
// http://autofac.org
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using System.Web.Http.ModelBinding;
using Autofac.Integration.WebApi;

namespace Autofac.Tests.Integration.WebApi
{
    public class IsAControllerNot : ApiController
    {
    }

    public class TestController : ApiController
    {
        [CustomActionFilter]
        public virtual IEnumerable<string> Get()
        {
            return new[] {"value1", "value2"};
        }
    }

    public class TestControllerA : TestController
    {
        public override IEnumerable<string> Get()
        {
            return new[] {"value1", "value2"};
        }
    }

    public class TestControllerB : TestControllerA
    {
        public override IEnumerable<string> Get()
        {
            return new[] { "value1", "value2" };
        }
    }

    public class InterfaceController : IHttpController
    {
        public Task<HttpResponseMessage> ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
        {
            throw new System.NotImplementedException();
        }
    }

    public interface ILogger
    {
        void Log(string value);
    }

    public class Logger : ILogger, IDisposable
    {
        public void Log(string value)
        {
            Console.WriteLine(value);
        }

        public void Dispose()
        {
        }
    }

    public class CustomActionFilter : ActionFilterAttribute
    {
        public ILogger Logger { get; set; }

        public override void OnActionExecuting(HttpActionContext actionContext)
        {
        }
    }

    public class Dependency
    {
    }

    public class TestModel1
    {
    }

    public class TestModel2
    {
    }

    public class TestModelBinder : IModelBinder
    {
        public Dependency Dependency { get; private set; }

        public TestModelBinder(Dependency dependency)
        {
            Dependency = dependency;
        }

        public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
        {
            return true;
        }
    }

    public class TestActionFilter : IAutofacActionFilter
    {
        public ILogger Logger { get; private set; }

        public TestActionFilter(ILogger logger)
        {
            Logger = logger;
        }

        public void OnActionExecuting(HttpActionContext actionContext)
        {
        }

        public void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
        }
    }

    public class TestActionFilter2 : IAutofacActionFilter
    {
        public ILogger Logger { get; private set; }

        public TestActionFilter2(ILogger logger)
        {
            Logger = logger;
        }

        public void OnActionExecuting(HttpActionContext actionContext)
        {
        }

        public void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
        }
    }

    public class TestAuthenticationFilter : IAutofacAuthenticationFilter
    {
        public ILogger Logger { get; private set; }

        public TestAuthenticationFilter(ILogger logger)
        {
            Logger = logger;
        }

        public void OnAuthenticate(HttpAuthenticationContext context)
        {
        }

        public void OnChallenge(HttpAuthenticationChallengeContext context)
        {
        }
    }

    public class TestAuthenticationFilter2 : IAutofacAuthenticationFilter
    {
        public ILogger Logger { get; private set; }

        public TestAuthenticationFilter2(ILogger logger)
        {
            Logger = logger;
        }

        public void OnAuthenticate(HttpAuthenticationContext context)
        {
        }

        public void OnChallenge(HttpAuthenticationChallengeContext context)
        {
        }
    }

    public class TestAuthorizationFilter : IAutofacAuthorizationFilter
    {
        public ILogger Logger { get; private set; }

        public TestAuthorizationFilter(ILogger logger)
        {
            Logger = logger;
        }

        public void OnAuthorization(HttpActionContext actionContext)
        {
        }
    }

    public class TestAuthorizationFilter2 : IAutofacAuthorizationFilter
    {
        public ILogger Logger { get; private set; }

        public TestAuthorizationFilter2(ILogger logger)
        {
            Logger = logger;
        }

        public void OnAuthorization(HttpActionContext actionContext)
        {
        }
    }

    public class TestExceptionFilter : IAutofacExceptionFilter
    {
        public ILogger Logger { get; private set; }

        public TestExceptionFilter(ILogger logger)
        {
            Logger = logger;
        }

        public void OnException(HttpActionExecutedContext actionExecutedContext)
        {
        }
    }

    public class TestExceptionFilter2 : IAutofacExceptionFilter
    {
        public ILogger Logger { get; private set; }

        public TestExceptionFilter2(ILogger logger)
        {
            Logger = logger;
        }

        public void OnException(HttpActionExecutedContext actionExecutedContext)
        {
        }
    }

    public class TestCombinationFilter : IAutofacActionFilter, IAutofacAuthenticationFilter, IAutofacAuthorizationFilter, IAutofacExceptionFilter
    {
        public void OnActionExecuting(HttpActionContext actionContext)
        {
        }

        public void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
        }

        public void OnAuthorization(HttpActionContext actionContext)
        {
        }

        public void OnException(HttpActionExecutedContext actionExecutedContext)
        {
        }

        public void OnAuthenticate(HttpAuthenticationContext context)
        {
        }

        public void OnChallenge(HttpAuthenticationChallengeContext context)
        {
        }
    }
}


text:
const EventEmitter = require('eventemitter3');
const Node = require("./Node").Class;
const Signal = require("./Signal");

class Sensor extends Node {
  constructor(options : any, eventemitter : ? EventEmitter) {
    super(options, eventemitter);
    this.addFeature("Sensor");
  }
}

module.exports = {
  Class : Sensor,
  isSensor : (object : any) : boolean => {
    return typeof object === "object"
      && Array.isArray(object.feature)
      && object.feature.indexOf("Sensor") >= 0;
  },
  create: (delegate : any) => {
    return class NewSensor extends Sensor {
      get type() : string {
        if (typeof delegate.type === "function") {
          return delegate.type.call(this);
        } else {
          return super.type;
        }
      }

      get inputs() : [string] {
        if (typeof delegate.inputs === "function") {
          return delegate.inputs.call(this);
        } else {
          return super.inputs;
        }
      }

      get outputs() : [string] {
        if (typeof delegate.outputs === "function") {
          return delegate.outputs.call(this);
        } else {
          return super.outputs;
        }
      }

      poweron() {
        if (typeof delegate.poweron === "function" && this.status !== "power on") {
          delegate.poweron.call(this);
        }
        super.poweron();
      }

      watch() {
        if (typeof delegate.watch === "function") {
          return delegate.watch.call(this);
        }
      }
    }
  }
}


text:
package org.apache.flink.table.sources;

import org.apache.flink.annotation.Experimental;
import org.apache.flink.api.common.io.InputFormat;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.connector.source.DynamicTableSource;

import static org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo;

/**
 * Defines an external bounded table and provides access to its data.
 *
 * @param <T> Type of the bounded {@link InputFormat} created by this {@link TableSource}.
 * @deprecated This interface has been replaced by {@link DynamicTableSource}. The new interface
 *     produces internal data structures and only works with the Blink planner. See FLIP-95 for more
 *     information.
 */
@Deprecated
@Experimental
public abstract class InputFormatTableSource<T> implements StreamTableSource<T> {

    /** Returns an {@link InputFormat} for reading the data of the table. */
    public abstract InputFormat<T, ?> getInputFormat();

    /** Always returns true which indicates this is a bounded source. */
    @Override
    public final boolean isBounded() {
        return true;
    }

    @SuppressWarnings("unchecked")
    @Override
    public final DataStream<T> getDataStream(StreamExecutionEnvironment execEnv) {
        TypeInformation<T> typeInfo =
                (TypeInformation<T>) fromDataTypeToLegacyInfo(getProducedDataType());
        return execEnv.createInput(getInputFormat(), typeInfo);
    }
}


text:
namespace armnn
{

arm_compute::Status ClLogWorkloadValidate(const TensorInfo& input, const TensorInfo& output)
{
    const arm_compute::TensorInfo aclInput  = armcomputetensorutils::BuildArmComputeTensorInfo(input);
    const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);

    return arm_compute::CLLogLayer::validate(&aclInput, &aclOutput);
}

ClLogWorkload::ClLogWorkload(const ElementwiseUnaryQueueDescriptor& descriptor,
                             const WorkloadInfo& info,
                             const arm_compute::CLCompileContext& clCompileContext)
    : ClBaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info)
{
    m_Data.ValidateInputsOutputs("ClLogWorkload", 1, 1);

    arm_compute::ICLTensor& input  = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
    arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();

    {
        ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClLogWorkload_configure");
        m_LogLayer.configure(clCompileContext, &input, &output);
    }
}

void ClLogWorkload::Execute() const
{
    ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClLogWorkload_Execute", this->GetGuid());
    RunClFunction(m_LogLayer, CHECK_LOCATION());
}

} // namespace armnn


text:
package feed

import (
	"strconv"

	"go-common/app/interface/main/app-tag/model"
	"go-common/app/service/main/archive/api"
	xtime "go-common/library/time"
)

// Item is feed item, contains av, bangumi, live, banner, feed...
type Item struct {
	Title   string `json:"title,omitempty"`
	Cover   string `json:"cover,omitempty"`
	URI     string `json:"uri,omitempty"`
	Param   string `json:"param,omitempty"`
	Goto    string `json:"goto,omitempty"`
	Rid     int16  `json:"tid,omitempty"`
	TName   string `json:"tname,omitempty"`
	Desc    string `json:"desc,omitempty"`
	Play    int    `json:"play,omitempty"`
	Danmaku int    `json:"danmaku,omitempty"`
	Reply   int    `json:"reply,omitempty"`
	Fav     int    `json:"favorite,omitempty"`
	Coin    int    `json:"coin,omitempty"`
	Share   int    `json:"share,omitempty"`
	Like    int    `json:"like,omitempty"`
	// av stat
	Duration int64 `json:"duration,omitempty"`
	// upper
	Mid   int64      `json:"mid,omitempty"`
	Name  string     `json:"name,omitempty"`
	Face  string     `json:"face,omitempty"`
	CTime xtime.Time `json:"ctime,omitempty"`
}

func (i *Item) FromArc(a *api.Arc) {
	if i.Title == "" {
		i.Title = a.Title
	}
	if i.Cover == "" {
		i.Cover = a.Pic
	}
	i.Param = strconv.FormatInt(a.Aid, 10)
	i.Goto = model.GotoAv
	i.URI = model.FillURI(i.Goto, i.Param)
	i.Rid = int16(a.TypeID)
	i.TName = a.TypeName
	i.Desc = a.Desc
	i.fillStat(a)
	i.Duration = a.Duration
	i.Mid = a.Author.Mid
	i.Name = a.Author.Name
	i.Face = a.Author.Face
	i.CTime = a.PubDate
}

func (i *Item) fillStat(a *api.Arc) {
	if a.Access == 0 {
		i.Play = int(a.Stat.View)
	}
	i.Danmaku = int(a.Stat.Danmaku)
	i.Reply = int(a.Stat.Reply)
	i.Fav = int(a.Stat.Fav)
	i.Coin = int(a.Stat.Coin)
	i.Share = int(a.Stat.Share)
	i.Like = int(a.Stat.Like)
}


text:
package dk.laundav.data;

public class ReverseGeocoderObject extends AbstractLocationObject {

	private String administrative_area_level_2;
	private String administrative_area_level_1;
	private String route;
	private String postal_code;
	private String locality;
	private String street_number;
	private String sublocality;

	public ReverseGeocoderObject() {
		super();
	}

	public ReverseGeocoderObject(double latitude, double longitude) {
		super(latitude, longitude);
	}

	public ReverseGeocoderObject(double latitude, double longitude, String address, String country) {
		super(latitude, longitude, country, country);
	}

	public ReverseGeocoderObject(double latitude, double longitude, String address, String country,
								String administrative_area_level_2, String administrative_area_level_1,
								String route, String postal_code, String locality, String street_number,
								String sublocality) {

		super(latitude, longitude, sublocality, sublocality);
		setAdministrative_area_level_2(administrative_area_level_2);
		setAdministrative_area_level_1(administrative_area_level_1);
		setRoute(route);
		setPostal_code(postal_code);
		setLocality(sublocality);
		setStreet_number(street_number);
		setSublocality(sublocality);
	}

	public void setAddressComponent(String key, String value) {

		// sets the content of the location object
		if (key.equals("administrative_area_level_2")) {
			setAdministrative_area_level_2(value);
		} else if (key.equals("administrative_area_level_1")) {
			setAdministrative_area_level_1(value);
		} else if (key.equals("route")) {
			setRoute(value);
		} else if (key.equals("postal_code")) {
			setPostal_code(value);
		} else if (key.equals("locality")) {
			setLocality(value);
		} else if (key.equals("street_number")) {
			setStreet_number(value);
		} else if (key.equals("sublocality")) {
			setSublocality(value);
		} else if (key.equals("country")) {
			setCountry(value);
		}

	}

	public String getAdministrative_area_level_2() {
		return administrative_area_level_2;
	}

	public void setAdministrative_area_level_2(
			String administrative_area_level_2) {
		this.administrative_area_level_2 = administrative_area_level_2;
	}

	public String getAdministrative_area_level_1() {
		return administrative_area_level_1;
	}

	public void setAdministrative_area_level_1(
			String administrative_area_level_1) {
		this.administrative_area_level_1 = administrative_area_level_1;
	}

	public String getRoute() {
		return route;
	}

	public void setRoute(String route) {
		this.route = route;
	}

	public String getPostal_code() {
		return postal_code;
	}

	public void setPostal_code(String postal_code) {
		this.postal_code = postal_code;
	}

	public String getLocality() {
		return locality;
	}

	public void setLocality(String locality) {
		this.locality = locality;
	}

	public String getStreet_number() {
		return street_number;
	}

	public void setStreet_number(String street_number) {
		this.street_number = street_number;
	}

	public String getSublocality() {
		return sublocality;
	}

	public void setSublocality(String sublocality) {
		this.sublocality = sublocality;
	}

}


text:
<?php

namespace Karwana\Penelope\Scripts;

use Karwana\Penelope\ObjectCollection;

use Everyman\Neo4j;

abstract class Batchable {

	protected $batch_size = 10, $usleep = 100000;

	public function setBatchSize($batch_size) {
		$this->batch_size = $batch_size;
	}

	public function setInterval($usleep) {
		$this->usleep = $usleep;
	}

	public function run() {
		foreach ($this->getCollections() as $collection) {
			$this->processCollection($collection);
		}
	}

	public function processCollection(ObjectCollection $collection) {
		$page = 1;
		$collection->setPageSize($this->batch_size);
		$collection->fetch();

		while (count($collection) > 0) {
			$this->processBatch($collection);
			usleep($this->usleep);

			$page++;
			$collection->setPage($page);
			$collection->fetch();
		}
	}

	public function processBatch(ObjectCollection $collection) {
		try {
			foreach ($collection as $object) {
				$this->process($object);
			}
		} catch (\Exception $e) {
			if (isset($object)) {
				throw new \Exception('Error while processing object ' . $object->getId() . ' (' . $object->getSchema()->getName() . ').', 0, $e);
			}

			throw $e;
		}
	}
}