text:
<?php
//error_reporting(E_ALL) ;
//ini_set('display_errors', 'On');

require_once('api.php');

class APICall_getcomments extends APICall
{
	protected function getChildComments($permlink)
	{
		$comments = array();
		$sql = "select * from dbo.Comments where parent_permlink = '$permlink' order by created";
		$stmt = sqlsrv_query( $this->ms, $sql);
		while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
			$data = array();
			$data['author'] = $row['author'];
			$data['permlink'] = $row['permlink'];
			$data['parent_author'] = $row['parent_author'];
			$data['parent_permlink'] = $row['parent_permlink'];
			$data['title'] = $row['title'];
			$data['body'] = $row['body'];
			$data['created'] = $row['created'];
			$data['last_update'] = $row['last_update'];
			$data['depth'] = $row['depth'];
			$comments[] = $data;
			//print_r($data);
			if($data['depth'] >= 4)
			{
				continue;
			}
			$c2 = $this->getChildComments($data['permlink']);
			$comments = array_merge($comments, $c2);
		}
		return $comments;
	}

	public function query($params = array())
	{
		parent::query($params);
		if(array_key_exists('permlink', $params))
		{
			$permlink = $params['permlink'];
			$comments = $this->getChildComments($permlink);
		}
		else
		{
			return;
		}

		$this->count = count($comments);

		//print_r($comments);
		echo json_encode($comments);
		//return;
	}
}


text:
require 'onetime/app/helpers'

module Onetime
  class App

    module Base
      include OT::App::Helpers

      def publically redirect=nil
        carefully(redirect) do
          check_session!     # 1. Load or create the session, load customer (or anon)
          check_locale!      # 2. Check the request for the desired locale
          check_shrimp!      # 3. Check the shrimp for POST,PUT,DELETE (after session)
          check_subdomain!   # 4. Check if we're running as a subdomain
          check_referrer!    # 5. Check referrers for public requests
          yield
        end
      end

      def authenticated redirect=nil
        carefully(redirect) do
          check_session!     # 1. Load or create the session, load customer (or anon)
          check_locale!      # 2. Check the request for the desired locale
          check_shrimp!      # 3. Check the shrimp for POST,PUT,DELETE (after session)
          check_subdomain!   # 4. Check if we're running as a subdomain
          sess.authenticated? ? yield : res.redirect(('/')) # TODO: raise OT::Redirect
        end
      end

      def colonels redirect=nil
        carefully(redirect) do
          check_session!     # 1. Load or create the session, load customer (or anon)
          check_locale!      # 2. Check the request for the desired locale
          check_shrimp!      # 3. Check the shrimp for POST,PUT,DELETE (after session)
          sess.authenticated? && cust.role?(:colonel) ? yield : res.redirect(('/'))
        end
      end

      def check_subdomain!
        subdomstr = req.env['SERVER_NAME'].split('.').first
        if !subdomstr.to_s.empty? && subdomstr != 'www' && OT::Subdomain.mapped?(subdomstr)
          req.env['ots.subdomain'] = OT::Subdomain.load_by_cname(subdomstr)
        elsif cust.has_key?(:cname)
          req.env['ots.subdomain'] = cust.load_subdomain
        end
      end

      def check_referrer!
        return if @check_referrer_ran
        @check_referrer_ran = true
        return if req.referrer.nil? || req.referrer.match(Onetime.conf[:site][:host])
        sess.referrer ||= req.referrer
      end

      def handle_form_error ex, redirect
        sess.set_form_fields ex.form_fields
        sess.set_error_message ex.message
        res.redirect redirect
      end

      def secret_not_found_response
        view = Onetime::App::Views::UnknownSecret.new req, sess, cust, locale
        res.status = 404
        res.body = view.render
      end

      def not_found
        publically do
          not_found_response "Not sure what you're looking for..."
        end
      end

      def server_error
        publically do
          error_response "You found a bug. Let us know how it happened!"
        end
      end

      def not_found_response message
        view = Onetime::App::Views::NotFound.new req, sess, cust, locale
        view.add_error message
        res.status = 404
        res.body = view.render
      end

      def error_response message
        view = Onetime::App::Views::Error.new req, sess, cust, locale
        view.add_error message
        res.status = 401
        res.body = view.render
      end

      def is_subdomain?
        ! req.env['ots.subdomain'].nil?
      end
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<title>Java Web Starter Application</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" href="style.css" />

 Yay!  It works! Liberty for Java Starter Application.


text:
using System;
using System.Net;
using System.Net.Sockets;
using System.Collections.Generic;

namespace LumiSoft.Net.ICMP
{
	/// <summary>
	/// ICMP type.
	/// </summary>
	public enum ICMP_Type
	{
		/// <summary>
		/// Echo rely.
		/// </summary>
		EchoReply = 0,

		/// <summary>
		/// Time to live exceeded reply.
		/// </summary>
		TimeExceeded = 11,

		/// <summary>
		/// Echo.
		/// </summary>
		Echo = 8,
    }

    #region class EchoMessage

    /// <summary>
	/// Echo reply message.
	/// </summary>
	public class EchoMessage
	{
		private IPAddress m_pIP  = null;
		private int       m_TTL  = 0;
		private int       m_Time = 0;

		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="ip">IP address what sent echo message.</param>
		/// <param name="ttl">Time to live in milli seconds.</param>
		/// <param name="time">Time what elapsed before getting echo response.</param>
		internal EchoMessage(IPAddress ip,int ttl,int time)
		{
			m_pIP  = ip;
			m_TTL  = ttl;
			m_Time = time;
		}

		/// <summary>
		///
		/// </summary>
		/// <returns></returns>
        [Obsolete("Will be removed !")]
		public string ToStringEx()
		{
			return "TTL=" + m_TTL + "\tTime=" + m_Time + "ms" + "\tIP=" + m_pIP;
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="messages"></param>
		/// <returns></returns>
        [Obsolete("Will be removed !")]
		public static string ToStringEx(EchoMessage[] messages)
		{
			string retVal = "";

			foreach(EchoMessage m in messages){
				retVal += m.ToStringEx() + "\r\n";
			}

			return retVal;
        }

        #region Properties Implementation

        /// <summary>
        /// Gets IP address what sent echo message.
        /// </summary>
        public IPAddress IPAddress
        {
            get{ return m_pIP; }
        }
        /*
        /// <summary>
        /// Gets time to live in milli seconds.
        /// </summary>
        public int TTL
        {
            get{ return m_TTL; }
        }*/

        /// <summary>
        /// Gets time in milliseconds what toke to get reply.
        /// </summary>
        public int ReplyTime
        {
            get{ return m_Time; }
        }

        #endregion
    }

    #endregion

    /// <summary>
	/// Icmp utils.
	/// </summary>
	public class Icmp
	{
		#region methoc Trace

        /// <summary>
		/// Traces specified ip.
		/// </summary>
		/// <param name="destIP">Destination IP address.</param>
		/// <returns></returns>
		public static EchoMessage[] Trace(string destIP)
		{
            return Trace(System.Net.IPAddress.Parse(destIP),2000);
        }

		/// <summary>
		/// Traces specified ip.
		/// </summary>
		/// <param name="ip">IP address to tracce.</param>
		/// <param name="timeout">Send recieve timeout in milli seconds.</param>
		/// <returns></returns>
		public static EchoMessage[] Trace(IPAddress ip,int timeout)
		{
			List<EchoMessage> retVal = new List<EchoMessage>();

			//Create Raw ICMP Socket
			Socket s = new Socket(AddressFamily.InterNetwork,SocketType.Raw,ProtocolType.Icmp);

			IPEndPoint ipdest = new IPEndPoint(ip,80);
			EndPoint endpoint = (EndPoint)(new IPEndPoint(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[0],80));

			ushort id         = (ushort)DateTime.Now.Millisecond;
			byte[] sendPacket = CreatePacket(id);

			int continuesNoReply = 0;
			//send requests with increasing number of TTL
			for(int ittl=1;ittl<=30; ittl++){
				byte[] buffer = new byte[1024];

				try{
					//Socket options to set TTL and Timeouts
					s.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.IpTimeToLive      ,ittl);
					s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.SendTimeout   ,timeout);
					s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReceiveTimeout,timeout);

					//Get current time
					DateTime startTime = DateTime.Now;

					//Send Request
					s.SendTo(sendPacket,sendPacket.Length,SocketFlags.None,ipdest);

					//Receive
					s.ReceiveFrom(buffer,buffer.Length,SocketFlags.None,ref endpoint);

					//Calculate time required
					TimeSpan ts = DateTime.Now - startTime;
					retVal.Add(new EchoMessage(((IPEndPoint)endpoint).Address,ittl,ts.Milliseconds));

					// Endpoint reached
					if(buffer[20] == (byte)ICMP_Type.EchoReply){
						break;
					}

					// Un wanted reply
					if(buffer[20] != (byte)ICMP_Type.TimeExceeded){
						throw new Exception("UnKnown error !");
					}

					continuesNoReply = 0;
				}
				catch{
					//ToDo: Handle recive/send timeouts
					continuesNoReply++;
				}

				// If there is 3 continues no reply, consider that destination host won't accept ping.
				if(continuesNoReply >= 3){
					break;
				}
			}

			return retVal.ToArray();
		}

		#endregion

        #region method Ping

        /// <summary>
        /// Pings specified destination host.
        /// </summary>
        /// <param name="ip">IP address to ping.</param>
        /// <param name="timeout">Send recieve timeout in milli seconds.</param>
        /// <returns></returns>
		public static EchoMessage Ping(IPAddress ip,int timeout)
		{
            //Create Raw ICMP Socket
			Socket s = new Socket(AddressFamily.InterNetwork,SocketType.Raw,ProtocolType.Icmp);

			IPEndPoint ipdest = new IPEndPoint(ip,80);
			EndPoint endpoint = (EndPoint)(new IPEndPoint(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[0],80));

			ushort id         = (ushort)DateTime.Now.Millisecond;
			byte[] sendPacket = CreatePacket(id);

			//Socket options to set TTL and Timeouts
			s.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.IpTimeToLive      ,30);
			s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.SendTimeout   ,timeout);
			s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReceiveTimeout,timeout);

			//Get current time
			DateTime startTime = DateTime.Now;

			//Send Request
			s.SendTo(sendPacket,sendPacket.Length,SocketFlags.None,ipdest);

			//Receive
			byte[] buffer = new byte[1024];
			s.ReceiveFrom(buffer,buffer.Length,SocketFlags.None,ref endpoint);

			// Endpoint reached
			if(buffer[20] == (byte)ICMP_Type.EchoReply){
			}
			// Un wanted reply
			else if(buffer[20] != (byte)ICMP_Type.TimeExceeded){
				throw new Exception("UnKnown error !");
			}

            //Calculate time elapsed
			TimeSpan ts = DateTime.Now - startTime;
			return new EchoMessage(((IPEndPoint)endpoint).Address,0,ts.Milliseconds);
        }

        #endregion

        #region method CreatePacket

        private static byte[] CreatePacket(ushort id)
		{
			/*Rfc 792  Echo or Echo Reply Message
			  0               8              16              24
			 +---------------+---------------+---------------+---------------+
			 |     Type      |     Code      |           Checksum            |
			 +---------------+---------------+---------------+---------------+
			 |           ID Number           |            Sequence Number    |
			 +---------------+---------------+---------------+---------------+
			 |     Data...
			 +---------------+---------------+---------------+---------------+
			*/

			byte[] packet = new byte[8 + 2];
			packet[0] = (byte)ICMP_Type.Echo; // Type
			packet[1] = 0;  // Code
			packet[2] = 0;  // Checksum
			packet[3] = 0;  // Checksum
			packet[4] = 0;  // ID
			packet[5] = 0;  // ID
			packet[6] = 0;  // Sequence
			packet[7] = 0;  // Sequence

			// Set id
			Array.Copy(BitConverter.GetBytes(id), 0, packet, 4, 2);

			// Fill data 2 byte data
			for(int i=0;i<2;i++){
				packet[i + 8] = (byte)'x'; // Data
			}

			// calculate checksum
			int checkSum = 0;
			for(int i= 0;i<packet.Length;i+= 2){
				checkSum += Convert.ToInt32(BitConverter.ToUInt16(packet,i));
			}

			// The checksum is the 16-bit ones's complement of the one's
			// complement sum of the ICMP message starting with the ICMP Type.
			checkSum  = (checkSum & 0xffff);
			Array.Copy(BitConverter.GetBytes((ushort)~checkSum),0,packet,2,2);

			return packet;
		}

		#endregion
	}
}


text:
var config = {

};

module.exports.conf = config;


text:
package com.gs.fw.common.mithra.cache;

import com.gs.fw.common.mithra.finder.Operation;
import com.gs.fw.common.mithra.querycache.CachedQuery;

import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.*;

public class NonLruQueryIndex implements Evictable, QueryIndex
{
    private static final Object RESIZE_SENTINEL = new Object();
    /**
     * The default initial capacity -- MUST be a power of two + 1.
     */
    private static final int DEFAULT_INITIAL_CAPACITY = 16;

    /**
     * The maximum capacity, used if a higher value is implicitly specified
     * by either of the constructors with arguments.
     * MUST be a power of two <= 1<<30.
     */
    private static final int MAXIMUM_CAPACITY = 1 << 30;

    private static final AtomicReferenceFieldUpdater tableUpdater = AtomicReferenceFieldUpdater.newUpdater(NonLruQueryIndex.class, AtomicReferenceArray.class, "table");
    private static final AtomicIntegerFieldUpdater expungerUpdater = AtomicIntegerFieldUpdater.newUpdater(NonLruQueryIndex.class, "expunger");

    /**
     * The table, resized as necessary. Length MUST Always be a power of two.
     */
    private volatile AtomicReferenceArray table;

    private volatile int expunger;

    private int expungeCount;
    private static final int MAX_EXPUNGE_COUNT = 10000;

    private static final Object RESIZED = new Object();
    private static final Object RESIZING = new Object();
    private static final int PARTITIONED_SIZE_THRESHOLD = 4096; // chosen to keep size below 1% of the total size of the map
    private static final int SIZE_BUCKETS = 8;

    private AtomicIntegerArray partitionedSize = new AtomicIntegerArray(SIZE_BUCKETS*16); // each cache line is 64 bytes. we want one integer in each cache line

    /**
     * Reference queue for cleared WeakEntries
     */
    private final ReferenceQueue queue = new ReferenceQueue();

    private int weakThreshold = Cache.WEAK_THRESHOLD;
    private final ReferenceListener listener;

    public NonLruQueryIndex(int initialCapacity)
    {
        if (initialCapacity < 0)
            throw new IllegalArgumentException("Illegal Initial Capacity: " +
                    initialCapacity);
        if (initialCapacity > MAXIMUM_CAPACITY)
            initialCapacity = MAXIMUM_CAPACITY;

        int capacity = 1;
        while (capacity < initialCapacity)
            capacity <<= 1;
        table = new AtomicReferenceArray(capacity+1);
        this.listener = new ReferenceListener()
        {
            @Override
            public void evictCollectedReferences()
            {
                NonLruQueryIndex.this.evictCollectedReferences();
            }
        };
        MithraReferenceThread.getInstance().addListener(listener);
    }

    public NonLruQueryIndex()
    {
        this(DEFAULT_INITIAL_CAPACITY);
    }

    public boolean isEmpty()
    {
        return size() == 0;
    }

    public CachedQuery get(Operation op, boolean forRelationship)
    {
        int hash = op.hashCode();
        AtomicReferenceArray currentArray = getTable();
        while(true)
        {
            int length = currentArray.length();
            int index = indexFor(hash, length);
            Object o = currentArray.get(index);
            if (o == RESIZED || o == RESIZING)
            {
                currentArray = helpWithResizeWhileCurrentIndex(currentArray, index);
            }
            else if (o instanceof Entry)
            {
                Entry e = (Entry) o;
                while (e != null)
                {
                    CachedQuery candidate = e.getUnexpiredCachedQuery();
                    if (candidate == null)
                    {
                        e = cleanChainAndReturnLeftOver(currentArray, index, (Entry) o, e);
                    }
                    else if (e.getHash() == hash &&
                            candidate.getOperation().equals(op))
                    {
                        return candidate;
                    }
                    else
                    {
                        e = e.getNext();
                    }
                }
                return null;
            }
            else // o is null
            {
                return null;
            }
        }
    }

    public CachedQuery put(CachedQuery key, boolean isForRelationship)
    {
        int hash = key.getOperation().hashCode();
        boolean soft =  (key.getResult().size() < weakThreshold);

        AtomicReferenceArray currentArray = getTable();
        outer:
        while(true)
        {
            int length = currentArray.length();
            int index = indexFor(hash, length);
            Object o = currentArray.get(index);
            if (o == RESIZED || o == RESIZING)
            {
                currentArray = helpWithResizeWhileCurrentIndex(currentArray, index);
            }
            else if (o instanceof Entry)
            {
                Entry e = (Entry) o;
                Entry next = e;
                boolean replaced = false;
                while (e != null)
                {
                    CachedQuery candidate = e.get();
                    if (candidate == null || candidate.isExpired())
                    {
                        e = cleanChainAndReturnLeftOver(currentArray, index, (Entry) o, e);
                    }
                    else if (e.getHash() == hash &&
                            candidate.getOperation().equals(key.getOperation()))
                    {
                        next = createReplacementChainForRemoval((Entry) o, e);
                        replaced = true;
                        break;
                    }
                    else
                    {
                        e = e.getNext();
                    }
                }
                Entry newEntry;
                if (soft)
                {
                    newEntry = new SoftEntry(key, next, hash, queue);
                }
                else
                {
                    newEntry = new WeakEntry(key, queue, hash, next);
                }

                if (updateTable(length, currentArray, index, o, newEntry, replaced)) return key;
            }
            else // o is null
            {
                Object entry;
                if (soft)
                {
                    entry = new SoftEntry(key, null, hash, queue);
                }
                else
                {
                    entry = new WeakEntry(key, queue, hash, null);
                }
                if (updateTable(length, currentArray, index, o, entry, false)) return key;
            }
        }
    }

    private Entry createReplacementChainForRemoval(Entry original, Entry toRemove)
    {
        if (original == toRemove)
        {
            return original.getNext();
        }
        Entry replacement = null;
        Entry e = original;
        while (e != null)
        {
            if (e != toRemove)
            {
                if (replacement == null)
                {
                    replacement = e.cloneWithoutNext(queue);
                }
                else
                {
                    replacement = e.cloneWithNext(queue, replacement);
                }
            }
            e = e.getNext();
        }
        return replacement;
    }

    public void clear()
    {
        AtomicReferenceArray currentArray = this.table;
        boolean followResize;
        do
        {
            followResize = false;
            for (int i = 0; i < currentArray.length() - 1; i++)
            {
                Object o = currentArray.get(i);
                if (o == RESIZED || o == RESIZING)
                {
                    followResize = true;
                    break;
                }
                else if (o != null)
                {
                    Entry e = (Entry) o;
                    if (currentArray.compareAndSet(i, o, null))
                    {
                        int removedEntries = 0;
                        while (e != null)
                        {
                            removedEntries++;
                            e = e.getNext();
                        }
                        addToSizeAndGetLocalSize(-removedEntries);
                    }
                    else
                    {
                        i--; // retry this one
                    }
                }
            }
            if (followResize)
            {
                helpWithResize(currentArray);
                ResizeContainer resizeContainer = (ResizeContainer) currentArray.get(currentArray.length() - 1);
                resizeContainer.waitForAllResizers();
                currentArray = resizeContainer.nextArray;
            }
        }
        while (followResize);
    }

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

    @Override
    public void destroy()
    {
        zRemoveListener();
    }

    public void zRemoveListener()
    {
        MithraReferenceThread.getInstance().removeListener(listener);
    }

    /*
     * Return index for hash code h.
     */
    private static int indexFor(int h, int length)
    {
        return h & (length - 2);
    }

    /*
     * Expunge stale entries from the table.
     */
    private boolean expungeStaleEntries()
    {
        Object r;
        boolean result = false;
        AtomicReferenceArray table = this.table;
        while ((r = queue.poll()) != null)
        {
            result = true;
            Entry e = (Entry) r;
            int h = e.getHash();
            removeWeakReferencesAtHash(table, e, h);
        }
        expungerUpdater.set(this, 0);
        return result;
    }

    private void removeWeakReferencesAtHash(AtomicReferenceArray table, Entry e, int h)
    {
        while(true)
        {
            int index = indexFor(h, table.length());
            Object o = table.get(index);
            if (o == RESIZED || o == RESIZING)
            {
                table = ((ResizeContainer) table.get(table.length() - 1)).nextArray;
                continue;
            }
            if (o instanceof Entry)
            {
                cleanChainAndReturnLeftOver(table, index, (Entry) o, e);
            }
            break;
        }
    }

    public int size()
    {
        int size = 0;
        for(int i=0;i<SIZE_BUCKETS;i++)
        {
            size += partitionedSize.get(i << 4);
        }
        return size;
    }

    /*
     * Return the table after first expunging stale entries
     */
    private AtomicReferenceArray getTable()
    {
        expungeCount++;
        if (expungeCount >= MAX_EXPUNGE_COUNT)
        {
            expungeCount = 0;
            if (expungerUpdater.compareAndSet(this, 0, 1))
            {
                MithraConcurrentEvictorThread.getInstance().queueEviction(this);
            }
        }
        return table;
    }

    private int addToSizeAndGetLocalSize(int value)
    {
        int h = (int) Thread.currentThread().getId();
        h ^= (h >>> 18) ^ (h >>> 12);
        h = (h ^ (h >>> 10)) & (SIZE_BUCKETS - 1);
        h = h << 4;
        while (true)
        {
            int localSize = this.partitionedSize.get(h);
            if (this.partitionedSize.compareAndSet(h, localSize, localSize + value))
            {
                return localSize + value;
            }
        }
    }

    private boolean updateTable(int length, AtomicReferenceArray currentArray, int index, Object o, Object entryOrHardRef, boolean replaced)
    {
        if (currentArray.compareAndSet(index, o, entryOrHardRef))
        {
            if (!replaced)
            {
                int localSize = addToSizeAndGetLocalSize(1);
                if (o != null)
                {
                    int threshold = length >> 1;
                    threshold += (threshold >> 1); // threshold = length * 0.75
                    if (localSize > (threshold >> 3) + 1 && size() > threshold)
                    {
                        resize(currentArray);
                    }
                }
            }
            return true;
        }
        return false;
    }

    private Entry cleanChainAndReturnLeftOver(AtomicReferenceArray table, int index, Entry original, Entry entry)
    {
        if (original == null)
        {
            return null;
        }
        while(true)
        {
            Object o = table.get(index);
            if (o == original)
            {
                Entry e = (Entry) o;
                Entry cleanTail = getCleanTail(e);

                int removed = 0;
                e = (Entry) o;

                if (cleanTail == null)
                {
                    while(e != null && e.getUnexpiredCachedQuery() == null)
                    {
                        removed++;
                        e = e.getNext();
                    }
                    if (e == null)
                    {
                        if (table.compareAndSet(index, original, null))
                        {
                            addToSizeAndGetLocalSize(-removed);
                            return null;
                        }
                    }
                }
                e = (Entry) o;
                removed = 0;
                Entry replacement = cleanTail;
                while(e != cleanTail)
                {
                    CachedQuery validCachedQuery = e.getUnexpiredCachedQuery();
                    if (validCachedQuery != null)
                    {
                        replacement = e.cloneWithNext(queue, replacement);
                    }
                    else
                    {
                        removed++;
                    }
                    e = e.getNext();
                }
                if (removed == 0) return original.getNext();
                if (table.compareAndSet(index, original, replacement))
                {
                    addToSizeAndGetLocalSize(-removed);
                    return replacement;
                }
            }
            else
            {
                return entry.getNext();
            }
        }
    }

    private Entry getCleanTail(Entry e)
    {
        Entry cleanTail = e;
        while(e != null)
        {
            CachedQuery cachedQuery = e.getUnexpiredCachedQuery();
            if (cachedQuery == null)
            {
                cleanTail = e.getNext();
            }
            e = e.getNext();
        }
        return cleanTail;
    }

    private AtomicReferenceArray helpWithResizeWhileCurrentIndex(AtomicReferenceArray currentArray, int index)
    {
        AtomicReferenceArray newArray = this.helpWithResize(currentArray);
        int helpCount = 0;
        while (currentArray.get(index) != RESIZED)
        {
            helpCount++;
            newArray = this.helpWithResize(currentArray);
            if ((helpCount & 7) == 0)
            {
                Thread.yield();
            }
        }
        return newArray;
    }

    private AtomicReferenceArray helpWithResize(AtomicReferenceArray currentArray)
    {
        ResizeContainer resizeContainer = (ResizeContainer) currentArray.get(currentArray.length() - 1);
        AtomicReferenceArray newTable = resizeContainer.nextArray;
        if (resizeContainer.getQueuePosition() > ResizeContainer.QUEUE_INCREMENT)
        {
            resizeContainer.incrementResizer();
            this.reverseTransfer(currentArray, resizeContainer);
            resizeContainer.decrementResizerAndNotify();
        }
        return newTable;
    }

    private void resize(AtomicReferenceArray oldTable)
    {
        this.resize(oldTable, (oldTable.length() - 1 << 1) + 1);
    }

    // newSize must be a power of 2 + 1
    private void resize(AtomicReferenceArray oldTable, int newSize)
    {
        int oldCapacity = oldTable.length();
        int end = oldCapacity - 1;
        Object last = oldTable.get(end);
        if (this.size() < end && last == RESIZE_SENTINEL)
        {
            return;
        }
        if (oldCapacity >= MAXIMUM_CAPACITY)
        {
            throw new RuntimeException("index is too large!");
        }
        ResizeContainer resizeContainer = null;
        boolean ownResize = false;
        if (last == null || last == RESIZE_SENTINEL)
        {
            synchronized (oldTable) // allocating a new array is too expensive to make this an atomic operation
            {
                if (oldTable.get(end) == null)
                {
                    oldTable.set(end, RESIZE_SENTINEL);
                    resizeContainer = new ResizeContainer(new AtomicReferenceArray(newSize), oldTable.length() - 1);
                    oldTable.set(end, resizeContainer);
                    ownResize = true;
                }
            }
        }
        if (ownResize)
        {
            this.transfer(oldTable, resizeContainer);
            AtomicReferenceArray src = this.table;
            while (!tableUpdater.compareAndSet(this, oldTable, resizeContainer.nextArray))
            {
                // we're in a double resize situation; we'll have to go help until it's our turn to set the table
                if (src != oldTable)
                {
                    this.helpWithResize(src);
                }
            }
        }
        else
        {
            this.helpWithResize(oldTable);
        }
    }

    /*
     * Transfer all entries from src to dest tables
     */
    private void transfer(AtomicReferenceArray src, ResizeContainer resizeContainer)
    {
        AtomicReferenceArray dest = resizeContainer.nextArray;

        for (int j = 0; j < src.length() - 1; )
        {
            Object o = src.get(j);
            if (o == null)
            {
                if (src.compareAndSet(j, null, RESIZED))
                {
                    j++;
                }
            }
            else if (o == RESIZED || o == RESIZING)
            {
                j = (j & ~(ResizeContainer.QUEUE_INCREMENT - 1)) + ResizeContainer.QUEUE_INCREMENT;
                if (resizeContainer.resizers.get() == 1)
                {
                    break;
                }
            }
            else
            {
                if (src.compareAndSet(j, o, RESIZING))
                {
                    moveBucket(o, dest);
                    src.set(j, RESIZED);
                    j++;
                }
            }
        }
        resizeContainer.decrementResizerAndNotify();
        resizeContainer.waitForAllResizers();
    }

    private void moveBucket(Object o, AtomicReferenceArray dest)
    {
        Entry e = (Entry) o;
        while (e != null)
        {
            this.unconditionalCopy(dest, e);
            e = e.getNext();
        }
    }

    private void reverseTransfer(AtomicReferenceArray src, ResizeContainer resizeContainer)
    {
        AtomicReferenceArray dest = resizeContainer.nextArray;
        while (resizeContainer.getQueuePosition() > 0)
        {
            int start = resizeContainer.subtractAndGetQueuePosition();
            int end = start + ResizeContainer.QUEUE_INCREMENT;
            if (end > 0)
            {
                if (start < 0)
                {
                    start = 0;
                }
                for (int j = end - 1; j >= start; )
                {
                    Object o = src.get(j);
                    if (o == null)
                    {
                        if (src.compareAndSet(j, null, RESIZED))
                        {
                            j--;
                        }
                    }
                    else if (o == RESIZED || o == RESIZING)
                    {
                        resizeContainer.zeroOutQueuePosition();
                        return;
                    }
                    else
                    {
                        if (src.compareAndSet(j, o, RESIZING))
                        {
                            moveBucket(o, dest);
                            src.set(j, RESIZED);
                            j--;
                        }
                    }
                }
            }
        }
    }

    private void unconditionalCopy(AtomicReferenceArray dest, Entry toCopyEntry)
    {
        CachedQuery toCopy = toCopyEntry.getUnexpiredCachedQuery(); // we keep this local variable to ensure it doesn't get collected while transferring.
        if (toCopy == null)
        {
            addToSizeAndGetLocalSize(-1);
            return;
        }
        int hash = toCopyEntry.getHash();
        AtomicReferenceArray currentArray = dest;
        while(true)
        {
            int length = currentArray.length();
            int index = indexFor(hash, length);
            Object o = currentArray.get(index);
            if (o == RESIZED || o == RESIZING)
            {
                currentArray = ((ResizeContainer) currentArray.get(length - 1)).nextArray;
            }
            else
            {
                Entry next = (Entry)o;
                if (currentArray.compareAndSet(index, o, toCopyEntry.cloneWithNext(queue, next)))
                {
                    return;
                }
            }
        }

    }

    public boolean evictCollectedReferences()
    {
        return this.expungeStaleEntries();
    }

    public int getEntryCount()
    {
        AtomicReferenceArray table = this.table;
        int result = 0;
        for(int i=0;i<table.length();i++)
        {
            Object o = table.get(i);
            Entry e = (Entry) o;
            while(e != null)
            {
                result ++;
                e = e.getNext();
            }
        }
        return result;
    }

    private static interface Entry
    {
        public int getHash();
        public Entry getNext();
        public Entry cloneWithoutNext(ReferenceQueue queue);
        public CachedQuery get();

        public CachedQuery getUnexpiredCachedQuery();

        public Entry cloneWithNext(ReferenceQueue queue, Entry next);
    }

    private static class WeakEntry extends WeakReference<CachedQuery> implements Entry
    {
        private final int hash;
        private final Entry next;

        public WeakEntry(CachedQuery key, ReferenceQueue queue,
              int hash, Entry next)
        {
            super(key, queue);
            this.hash = hash;
            this.next = next;
        }

        public int getHash()
        {
            return hash;
        }

        public Entry getNext()
        {
            return next;
        }

        @Override
        public CachedQuery getUnexpiredCachedQuery()
        {
            CachedQuery cachedQuery = this.get();
            return cachedQuery != null && !cachedQuery.isExpired() ? cachedQuery : null;
        }

        public Entry cloneWithoutNext(ReferenceQueue queue)
        {
            return cloneWithNext(queue, null);
        }

        @Override
        public Entry cloneWithNext(ReferenceQueue queue, Entry next)
        {
            if (this.next == next)
            {
                return this;
            }
            return new WeakEntry(this.get(), queue, this.hash, next);
        }
    }

    private static class SoftEntry extends SoftReference<CachedQuery> implements Entry
    {
        private final int hash;
        private final Entry next;

        public SoftEntry(CachedQuery key, Entry next, int hash, ReferenceQueue queue)
        {
            super(key, queue);
            this.hash = hash;
            this.next = next;
        }

        public int getHash()
        {
            return hash;
        }

        public Entry getNext()
        {
            return next;
        }

        @Override
        public CachedQuery getUnexpiredCachedQuery()
        {
            CachedQuery cachedQuery = this.get();
            return cachedQuery != null && !cachedQuery.isExpired() ? cachedQuery : null;
        }

        public Entry cloneWithoutNext(ReferenceQueue queue)
        {
            return cloneWithNext(queue, null);
        }

        public Entry cloneWithNext(ReferenceQueue queue, Entry next)
        {
            if (this.next == next)
            {
                return this;
            }
            return new SoftEntry(this.get(), next, hash, queue);
        }
    }

    private static final class ResizeContainer
    {
        private static final int QUEUE_INCREMENT = Math.min(1 << 10, Integer.highestOneBit(Runtime.getRuntime().availableProcessors()) << 4);
        private final AtomicInteger resizers = new AtomicInteger(1);
        private final AtomicReferenceArray nextArray;
        private final AtomicInteger queuePosition;

        private ResizeContainer(AtomicReferenceArray nextArray, int oldSize)
        {
            this.nextArray = nextArray;
            this.queuePosition = new AtomicInteger(oldSize);
        }

        public void incrementResizer()
        {
            this.resizers.incrementAndGet();
        }

        public void decrementResizerAndNotify()
        {
            int remaining = this.resizers.decrementAndGet();
            if (remaining == 0)
            {
                synchronized (this)
                {
                    this.notifyAll();
                }
            }
        }

        public int getQueuePosition()
        {
            return this.queuePosition.get();
        }

        public int subtractAndGetQueuePosition()
        {
            return this.queuePosition.addAndGet(-QUEUE_INCREMENT);
        }

        public void waitForAllResizers()
        {
            if (this.resizers.get() > 0)
            {
                for (int i = 0; i < 16; i++)
                {
                    if (this.resizers.get() == 0)
                    {
                        break;
                    }
                }
                for (int i = 0; i < 16; i++)
                {
                    if (this.resizers.get() == 0)
                    {
                        break;
                    }
                    Thread.yield();
                }
            }
            if (this.resizers.get() > 0)
            {
                synchronized (this)
                {
                    while (this.resizers.get() > 0)
                    {
                        try
                        {
                            this.wait();
                        }
                        catch (InterruptedException e)
                        {
                            // ignore
                        }
                    }
                }
            }
        }

        public void zeroOutQueuePosition()
        {
            this.queuePosition.set(0);
        }
    }
}


text:
"""Command-line skeleton application for Drive API.
Usage:
  $ python sample.py

You can also get help on all the command-line flags the program understands
by running:

  $ python sample.py --help

"""

import argparse
import os
import sys
import pprint

sys.path.append('./google_drive')

from apiclient import discovery
from oauth2client import file
from oauth2client import client
from oauth2client import tools
from apiclient.http import MediaFileUpload
import httplib2

from apiclient.discovery import build
from apiclient import errors
from datetime import datetime

# Parser for command-line arguments.
parser = argparse.ArgumentParser(
    description=__doc__,
    formatter_class=argparse.RawDescriptionHelpFormatter,
    parents=[tools.argparser])

# CLIENT_SECRETS is name of a file containing the OAuth 2.0 information for this
# application, including client_id and client_secret. You can see the Client ID
# and Client secret on the APIs page in the Cloud Console:
# <https://cloud.google.com/console#/project/952794511259/apiui>
CLIENT_SECRETS = os.path.join(os.path.dirname(__file__), 'google_drive/client_secrets.json')

# Set up a Flow object to be used for authentication.
# Add one or more of the following scopes. PLEASE ONLY ADD THE SCOPES YOU
# NEED. For more information on using scopes please see
# <https://developers.google.com/+/best-practices>.
FLOW = client.flow_from_clientsecrets(CLIENT_SECRETS,
  scope=[
      'https://www.googleapis.com/auth/drive',
      'https://www.googleapis.com/auth/drive.appdata',
      'https://www.googleapis.com/auth/drive.apps.readonly',
      'https://www.googleapis.com/auth/drive.file',
      'https://www.googleapis.com/auth/drive.metadata.readonly',
      'https://www.googleapis.com/auth/drive.readonly',
      'https://www.googleapis.com/auth/drive.scripts',
    ],
    message=tools.message_if_missing(CLIENT_SECRETS))

def get_gservice_drive():
  # Parse the command-line flags.
  flags = parser.parse_args()
  # If the credentials don't exist or are invalid run through the native client
  # flow. The Storage object will ensure that if successful the good
  # credentials will get written back to the file.
  print flags
  storage = file.Storage('google_drive/sample.dat')
  credentials = storage.get()
  if credentials is None or credentials.invalid:
    credentials = tools.run_flow(FLOW, storage, flags)

  # Create an httplib2.Http object to handle our HTTP requests and authorize it
  # with our good Credentials.
  http = httplib2.Http()
  http = credentials.authorize(http)

  # Construct the service object for the interacting with the Drive API.
  service = discovery.build('drive', 'v2', http=http)

  try:
    print "Success! Now add code here."
    return service
  except client.AccessTokenRefreshError:
    print ("The credentials have been revoked or expired, please re-run"
      "the application to re-authorize")
    return False


text:
template<typename T> class C1 { using ReprType = unsigned; };
template<typename T> class C2 : public C1<T> { using typename C1<T>::Repr; };


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

<meta name="GENERATOR" content="PasDoc 0.9.0">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>ftpsend: Class TFTPSend</title>
<link rel="StyleSheet" type="text/css" href="pasdoc.css">

Class TFTPSend

Description	Hierarchy	Fields	Methods	Properties

Unit

ftpsend

Declaration

type TFTPSend = class(TSynaClient)

Description

Implementation of FTP protocol.

 Note: Are you missing properties for setting Username and Password? Look to parent TSynaClient object! (Username and Password have default values for "anonymous" FTP login)

Are you missing properties for specify server address and port? Look to parent TSynaClient too!

Hierarchy

TObject

TSynaClient

TFTPSend

Overview

Fields

CustomLogon: TLogonActions;

Methods

constructor Create;

destructor Destroy; override;

function ReadResult: Integer; virtual;

procedure ParseRemote(Value: string); virtual;

procedure ParseRemoteEPSV(Value: string); virtual;

function FTPCommand(const Value: string): integer; virtual;

function Login: Boolean; virtual;

function Logout: Boolean; virtual;

procedure Abort; virtual;

procedure TelnetAbort; virtual;

function List(Directory: string; NameList: Boolean): Boolean; virtual;

function RetrieveFile(const FileName: string; Restore: Boolean): Boolean; virtual;

function StoreFile(const FileName: string; Restore: Boolean): Boolean; virtual;

function StoreUniqueFile: Boolean; virtual;

function AppendFile(const FileName: string): Boolean; virtual;

function RenameFile(const OldName, NewName: string): Boolean; virtual;

function DeleteFile(const FileName: string): Boolean; virtual;

function FileSize(const FileName: string): integer; virtual;

function NoOp: Boolean; virtual;

function ChangeWorkingDir(const Directory: string): Boolean; virtual;

function ChangeToParentDir: Boolean; virtual;

function ChangeToRootDir: Boolean; virtual;

function DeleteDir(const Directory: string): Boolean; virtual;

function CreateDir(const Directory: string): Boolean; virtual;

function GetCurrentDir: String; virtual;

function DataRead(const DestStream: TStream): Boolean; virtual;

function DataWrite(const SourceStream: TStream): Boolean; virtual;

Properties

property ResultCode: Integer read FResultCode;

property ResultString: string read FResultString;

property FullResult: TStringList read FFullResult;

property Account: string read FAccount Write FAccount;

property FWHost: string read FFWHost Write FFWHost;

property FWPort: string read FFWPort Write FFWPort;

property FWUsername: string read FFWUsername Write FFWUsername;

property FWPassword: string read FFWPassword Write FFWPassword;

property FWMode: integer read FFWMode Write FFWMode;

property Sock: TTCPBlockSocket read FSock;

property DSock: TTCPBlockSocket read FDSock;

property DataStream: TMemoryStream read FDataStream;

property DataIP: string read FDataIP;

property DataPort: string read FDataPort;

property DirectFile: Boolean read FDirectFile Write FDirectFile;

property DirectFileName: string read FDirectFileName Write FDirectFileName;

property CanResume: Boolean read FCanResume;

property PassiveMode: Boolean read FPassiveMode Write FPassiveMode;

property ForceDefaultPort: Boolean read FForceDefaultPort Write FForceDefaultPort;

property ForceOldPort: Boolean read FForceOldPort Write FForceOldPort;

property OnStatus: TFTPStatus read FOnStatus write FOnStatus;

property FtpList: TFTPList read FFtpList;

property BinaryMode: Boolean read FBinaryMode Write FBinaryMode;

property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;

property FullSSL: Boolean read FFullSSL Write FFullSSL;

property IsTLS: Boolean read FIsTLS;

property IsDataTLS: Boolean read FIsDataTLS;

property TLSonData: Boolean read FTLSonData write FTLSonData;

Description

Fields

CustomLogon: TLogonActions;

Custom definition of login sequence. You can use this when you set FWMode to value -1.

Methods

constructor Create;

destructor Destroy; override;

function ReadResult: Integer; virtual;

Waits and read FTP server response. You need this only in special cases!

procedure ParseRemote(Value: string); virtual;

Parse remote side information of data channel from value string (returned by PASV command). This function you need only in special cases!

procedure ParseRemoteEPSV(Value: string); virtual;

Parse remote side information of data channel from value string (returned by EPSV command). This function you need only in special cases!

function FTPCommand(const Value: string): integer; virtual;

Send Value as FTP command to FTP server. Returned result code is result of this function. This command is good for sending site specific command, or non-standard commands.

function Login: Boolean; virtual;

Connect and logon to FTP server. If you specify any FireWall, connect to firewall and throw them connect to FTP server. Login sequence depending on FWMode.

function Logout: Boolean; virtual;

Logoff and disconnect from FTP server.

procedure Abort; virtual;

Break current transmission of data. (You can call this method from Sock.OnStatus event, or from another thread.)

procedure TelnetAbort; virtual;

Break current transmission of data. It is same as Abort, but it send abort telnet commands prior ABOR FTP command. Some servers need it. (You can call this method from Sock.OnStatus event, or from another thread.)

function List(Directory: string; NameList: Boolean): Boolean; virtual;

Download directory listing of Directory on FTP server. If Directory is empty string, download listing of current working directory. If NameList is True, download only names of files in directory. (internally use NLST command instead LIST command) If NameList is False, returned list is also parsed to FtpList property.

function RetrieveFile(const FileName: string; Restore: Boolean): Boolean; virtual;

Read data from FileName on FTP server. If Restore is True and server supports resume dowloads, download is resumed. (received is only rest of file)

function StoreFile(const FileName: string; Restore: Boolean): Boolean; virtual;

Send data to FileName on FTP server. If Restore is True and server supports resume upload, upload is resumed. (send only rest of file) In this case if remote file is same length as local file, nothing will be done. If remote file is larger then local, resume is disabled and file is transfered from begin!

function StoreUniqueFile: Boolean; virtual;

Send data to FTP server and assing unique name for this file.

function AppendFile(const FileName: string): Boolean; virtual;

Append data to FileName on FTP server.

function RenameFile(const OldName, NewName: string): Boolean; virtual;

Rename on FTP server file with OldName to NewName.

function DeleteFile(const FileName: string): Boolean; virtual;

Delete file FileName on FTP server.

function FileSize(const FileName: string): integer; virtual;

Return size of Filename file on FTP server. If command failed (i.e. not implemented), return -1.

function NoOp: Boolean; virtual;

Send NOOP command to FTP server for preserve of disconnect by inactivity timeout.

function ChangeWorkingDir(const Directory: string): Boolean; virtual;

Change currect working directory to Directory on FTP server.

function ChangeToParentDir: Boolean; virtual;

walk to upper directory on FTP server.

function ChangeToRootDir: Boolean; virtual;

walk to root directory on FTP server. (May not work with all servers properly!)

function DeleteDir(const Directory: string): Boolean; virtual;

Delete Directory on FTP server.

function CreateDir(const Directory: string): Boolean; virtual;

Create Directory on FTP server.

function GetCurrentDir: String; virtual;

Return current working directory on FTP server.

function DataRead(const DestStream: TStream): Boolean; virtual;

Establish data channel to FTP server and retrieve data. This function you need only in special cases, i.e. when you need to implement some special unsupported FTP command!

function DataWrite(const SourceStream: TStream): Boolean; virtual;

Establish data channel to FTP server and send data. This function you need only in special cases, i.e. when you need to implement some special unsupported FTP command.

Properties

property ResultCode: Integer read FResultCode;

After FTP command contains result number of this operation.

property ResultString: string read FResultString;

After FTP command contains main line of result.

property FullResult: TStringList read FFullResult;

After any FTP command it contains all lines of FTP server reply.

property Account: string read FAccount Write FAccount;

Account information used in some cases inside login sequence.

property FWHost: string read FFWHost Write FFWHost;

Address of firewall. If empty string (default), firewall not used.

property FWPort: string read FFWPort Write FFWPort;

port of firewall. standard value is same port as ftp server used. (21)

property FWUsername: string read FFWUsername Write FFWUsername;

Username for login to firewall. (if needed)

property FWPassword: string read FFWPassword Write FFWPassword;

password for login to firewall. (if needed)

property FWMode: integer read FFWMode Write FFWMode;

Type of Firewall. Used only if you set some firewall address. Supported predefined firewall login sequences are described by comments in source file where you can see pseudocode decribing each sequence.

property Sock: TTCPBlockSocket read FSock;

Socket object used for TCP/IP operation on control channel. Good for seting OnStatus hook, etc.

property DSock: TTCPBlockSocket read FDSock;

Socket object used for TCP/IP operation on data channel. Good for seting OnStatus hook, etc.

property DataStream: TMemoryStream read FDataStream;

If you not use DirectFile mode, all data transfers is made to or from this stream.

property DataIP: string read FDataIP;

After data connection is established, contains remote side IP of this connection.

property DataPort: string read FDataPort;

After data connection is established, contains remote side port of this connection.

property DirectFile: Boolean read FDirectFile Write FDirectFile;

Mode of data handling by data connection. If False, all data operations are made to or from DataStream TMemoryStream. If True, data operations is made directly to file in your disk. (filename is specified by DirectFileName property.) Dafault is False!

property DirectFileName: string read FDirectFileName Write FDirectFileName;

Filename for direct disk data operations.

property CanResume: Boolean read FCanResume;

Indicate after Login if remote server support resume downloads and uploads.

property PassiveMode: Boolean read FPassiveMode Write FPassiveMode;

If true (default value), all transfers is made by passive method. It is safer method for various firewalls.

property ForceDefaultPort: Boolean read FForceDefaultPort Write FForceDefaultPort;

Force to listen for dataconnection on standard port (20). Default is False, dataconnections will be made to any non-standard port reported by PORT FTP command. This setting is not used, if you use passive mode.

property ForceOldPort: Boolean read FForceOldPort Write FForceOldPort;

When is True, then is disabled EPSV and EPRT support. However without this commands you cannot use IPv6! (Disabling of this commands is needed only when you are behind some crap firewall/NAT.

property OnStatus: TFTPStatus read FOnStatus write FOnStatus;

You may set this hook for monitoring FTP commands and replies.

property FtpList: TFTPList read FFtpList;

After LIST command is here parsed list of files in given directory.

property BinaryMode: Boolean read FBinaryMode Write FBinaryMode;

if True (default), then data transfers is in binary mode. If this is set to False, then ASCII mode is used.

property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;

if is true, then if server support upgrade to SSL/TLS mode, then use them.

property FullSSL: Boolean read FFullSSL Write FFullSSL;

if server listen on SSL/TLS port, then you set this to true.

property IsTLS: Boolean read FIsTLS;

Signalise, if control channel is in SSL/TLS mode.

property IsDataTLS: Boolean read FIsDataTLS;

Signalise, if data transfers is in SSL/TLS mode.

property TLSonData: Boolean read FTLSonData write FTLSonData;

If True (default), then try to use SSL/TLS on data transfers too. If False, then SSL/TLS is used only for control connection.

Generated by PasDoc 0.9.0 on 2007-12-20 22:45:43


text:
package org.sakaiproject.tool.assessment.ui.listener.evaluation;

import java.util.Date;
import java.util.List;

import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

import org.sakaiproject.tool.assessment.data.dao.grading.StudentGradingSummaryData;
import org.sakaiproject.tool.assessment.facade.AgentFacade;
import org.sakaiproject.tool.assessment.services.GradingService;
import org.sakaiproject.tool.assessment.ui.bean.evaluation.RetakeAssessmentBean;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;

/**
 *
Title: Samigo

 *
Description: Sakai Assessment Manager

 * @author Ed Smiley
 * @version $Id: RetakeAssessmentListener.java 106463 2012-04-02 12:20:09Z david.horwitz@uct.ac.za $
 */

public class RetakeAssessmentListener implements ActionListener {
	//private static Log log = LogFactory.getLog(ConfirmRemovePartListener.class);

	public RetakeAssessmentListener() {
	}

	public void processAction(ActionEvent ae) throws AbortProcessingException {
		RetakeAssessmentBean retakeAssessment = (RetakeAssessmentBean) ContextUtil.lookupBean("retakeAssessment");
		GradingService gradingService = new GradingService();
		StudentGradingSummaryData studentGradingSummaryData = (StudentGradingSummaryData) retakeAssessment.getStudentGradingSummaryDataMap().get(retakeAssessment.getAgentId());
		if (studentGradingSummaryData == null) {
			studentGradingSummaryData = new StudentGradingSummaryData();
			studentGradingSummaryData.setPublishedAssessmentId(retakeAssessment.getPublishedAssessmentId());
			studentGradingSummaryData.setAgentId(retakeAssessment.getAgentId());
			studentGradingSummaryData.setNumberRetake(Integer.valueOf(1));
		    studentGradingSummaryData.setCreatedBy(AgentFacade.getAgentString());
			studentGradingSummaryData.setCreatedDate(new Date());
			studentGradingSummaryData.setLastModifiedBy(AgentFacade.getAgentString());
			studentGradingSummaryData.setLastModifiedDate(new Date());
		}
		else {
			int updatedNumberRetake = studentGradingSummaryData.getNumberRetake().intValue() + 1;
			studentGradingSummaryData.setNumberRetake(Integer.valueOf(updatedNumberRetake));
			studentGradingSummaryData.setLastModifiedBy(AgentFacade.getAgentString());
			studentGradingSummaryData.setLastModifiedDate(new Date());
		}

		gradingService.saveStudentGradingSummaryData(studentGradingSummaryData);
	}

}


text:
class SkBitmap;

namespace gfx {
class Image;
class ImageSkia;
}

namespace message_center {
class MessageCenter;
}

namespace ash {

class BatteryNotification;
class DualRoleNotification;

namespace tray {
class PowerTrayView;
}

class ASH_EXPORT TrayPower : public SystemTrayItem,
                             public PowerStatus::Observer {
 public:
  enum NotificationState {
    NOTIFICATION_NONE,

    // Low battery charge.
    NOTIFICATION_LOW_POWER,

    // Critically low battery charge.
    NOTIFICATION_CRITICAL,
  };

  // Time-based notification thresholds when on battery power.
  static const int kCriticalMinutes;
  static const int kLowPowerMinutes;
  static const int kNoWarningMinutes;

  // Percentage-based notification thresholds when using a low-power charger.
  static const int kCriticalPercentage;
  static const int kLowPowerPercentage;
  static const int kNoWarningPercentage;

  static const char kUsbNotificationId[];

  TrayPower(SystemTray* system_tray,
            message_center::MessageCenter* message_center);
  ~TrayPower() override;

  void NotifyUsbNotificationClosedByUser();

 private:
  friend class TrayPowerTest;

  // This enum is used for histogram. The existing values should not be removed,
  // and the new values should be added just before CHARGER_TYPE_COUNT.
  enum ChargerType{
    UNKNOWN_CHARGER,
    MAINS_CHARGER,
    USB_CHARGER,
    UNCONFIRMED_SPRING_CHARGER,
    SAFE_SPRING_CHARGER,
    CHARGER_TYPE_COUNT,
  };

  // Overridden from SystemTrayItem.
  views::View* CreateTrayView(user::LoginStatus status) override;
  views::View* CreateDefaultView(user::LoginStatus status) override;
  void DestroyTrayView() override;
  void DestroyDefaultView() override;
  void UpdateAfterLoginStatusChange(user::LoginStatus status) override;
  void UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) override;

  // Overridden from PowerStatus::Observer.
  void OnPowerStatusChanged() override;

  // Shows a notification that a low-power USB charger has been connected.
  // Returns true if a notification was shown or explicitly hidden.
  bool MaybeShowUsbChargerNotification();

  // Shows a notification when dual-role devices are connected.
  void MaybeShowDualRoleNotification();

  // Sets |notification_state_|. Returns true if a notification should be shown.
  bool UpdateNotificationState();
  bool UpdateNotificationStateForRemainingTime();
  bool UpdateNotificationStateForRemainingPercentage();

  message_center::MessageCenter* message_center_;  // Not owned.
  tray::PowerTrayView* power_tray_;
  std::unique_ptr<BatteryNotification> battery_notification_;
  std::unique_ptr<DualRoleNotification> dual_role_notification_;
  NotificationState notification_state_;

  // Was a USB charger connected the last time OnPowerStatusChanged() was
  // called?
  bool usb_charger_was_connected_;

  // Was line power connected the last time onPowerStatusChanged() was called?
  bool line_power_was_connected_;

  // Has the user already dismissed a low-power notification? Should be set
  // back to false when all power sources are disconnected.
  bool usb_notification_dismissed_;

  DISALLOW_COPY_AND_ASSIGN(TrayPower);
};

}  // namespace ash

#endif  // ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_


text:
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using FluentAssertions;
using IdentityServer4.IntegrationTests.Common;
using System.Net;
using System.Threading.Tasks;
using Xunit;

namespace IdentityServer4.IntegrationTests.Endpoints.CheckSession
{
    public class CheckSessionTests
    {
        private const string Category = "Check session endpoint";

        private IdentityServerPipeline _mockPipeline = new IdentityServerPipeline();

        public CheckSessionTests()
        {
            _mockPipeline.Initialize();
        }

        [Fact]
        [Trait("Category", Category)]
        public async Task get_request_should_not_return_404()
        {
            var response = await _mockPipeline.Client.GetAsync(IdentityServerPipeline.CheckSessionEndpoint);

            response.StatusCode.Should().NotBe(HttpStatusCode.NotFound);
        }
    }
}


text:
CKEDITOR.plugins.setLang( 'table', 'fo', {
	border: 'Bordabreidd',
	caption: 'Tabellfrágreiðing',
	cell: {
		menu: 'Meski',
		insertBefore: 'Set meska inn áðrenn',
		insertAfter: 'Set meska inn aftaná',
		deleteCell: 'Strika meskar',
		merge: 'Flætta meskar',
		mergeRight: 'Flætta meskar til høgru',
		mergeDown: 'Flætta saman',
		splitHorizontal: 'Kloyv meska vatnrætt',
		splitVertical: 'Kloyv meska loddrætt',
		title: 'Mesku eginleikar',
		cellType: 'Mesku slag',
		rowSpan: 'Ræð spenni',
		colSpan: 'Kolonnu spenni',
		wordWrap: 'Orðkloyving',
		hAlign: 'Horisontal plasering',
		vAlign: 'Loddrøtt plasering',
		alignBaseline: 'Basislinja',
		bgColor: 'Bakgrundslitur',
		borderColor: 'Bordalitur',
		data: 'Data',
		header: 'Header',
		yes: 'Ja',
		no: 'Nei',
		invalidWidth: 'Meskubreidd má vera eitt tal.',
		invalidHeight: 'Meskuhædd má vera eitt tal.',
		invalidRowSpan: 'Raðspennið má vera eitt heiltal.',
		invalidColSpan: 'Kolonnuspennið má vera eitt heiltal.',
		chooseColor: 'Vel'
	},
	cellPad: 'Meskubreddi',
	cellSpace: 'Fjarstøða millum meskar',
	column: {
		menu: 'Kolonna',
		insertBefore: 'Set kolonnu inn áðrenn',
		insertAfter: 'Set kolonnu inn aftaná',
		deleteColumn: 'Strika kolonnur'
	},
	columns: 'Kolonnur',
	deleteTable: 'Strika tabell',
	headers: 'Yvirskriftir',
	headersBoth: 'Báðir',
	headersColumn: 'Fyrsta kolonna',
	headersNone: 'Eingin',
	headersRow: 'Fyrsta rað',
	invalidBorder: 'Borda-stødd má vera eitt tal.',
	invalidCellPadding: 'Cell padding má vera eitt tal.',
	invalidCellSpacing: 'Cell spacing má vera eitt tal.',
	invalidCols: 'Talið av kolonnum má vera eitt tal størri enn 0.',
	invalidHeight: 'Tabell-hædd má vera eitt tal.',
	invalidRows: 'Talið av røðum má vera eitt tal størri enn 0.',
	invalidWidth: 'Tabell-breidd má vera eitt tal.',
	menu: 'Eginleikar fyri tabell',
	row: {
		menu: 'Rað',
		insertBefore: 'Set rað inn áðrenn',
		insertAfter: 'Set rað inn aftaná',
		deleteRow: 'Strika røðir'
	},
	rows: 'Røðir',
	summary: 'Samandráttur',
	title: 'Eginleikar fyri tabell',
	toolbar: 'Tabell',
	widthPc: 'prosent',
	widthPx: 'pixels',
	widthUnit: 'breiddar unit'
});


text:
import {MultiAudioNode} from '../MultiAudioNode';

/**
 * The audio-effects flanger class.
 * This class lets you add a flanger effect.
 */
export class Flanger extends MultiAudioNode {
    private _delay: number;
    private _depth: number;
    private _feedback: number;
    private _speed: number;

    constructor(audioContext: AudioContext) {
        super(audioContext);

        this.nodes = {
            inputGainNode: audioContext.createGain(), // Create the input gain-node
            wetGainNode: audioContext.createGain(), // Create the wetness controll gain-node
            delayNode: audioContext.createDelay(), // Create the delay node
    	    gainNode: audioContext.createGain(), // Create the gain controll gain-node
        	feedbackGainNode: audioContext.createGain(), // Create the feedback controll gain-node
        	oscillatorNode: audioContext.createOscillator() // Create the oscilator node
        };

        // Wire it all up
	    this.nodes['oscillatorNode'].connect(this.nodes['gainNode']);
	    this.nodes['gainNode'].connect((<any>this.nodes['delayNode']).delayTime);
	    this.nodes['inputGainNode'].connect(this.nodes['wetGainNode']);
	    this.nodes['inputGainNode'].connect(this.nodes['delayNode']);
	    this.nodes['delayNode'].connect(this.nodes['wetGainNode']);
	    this.nodes['delayNode'].connect(this.nodes['feedbackGainNode']);
	    this.nodes['feedbackGainNode'].connect(this.nodes['inputGainNode']);

        // Setup the oscillator
        (<OscillatorNode>this.nodes['oscillatorNode']).type = 'sine';
        (<OscillatorNode>this.nodes['oscillatorNode']).start(0);

        // Set the input gain-node as the input-node.
        this.node = this.nodes['inputGainNode'];

        // Set the output gain-node as the output-node.
        this.output = this.nodes['wetGainNode'];

        // Set the default delay of 0.005 seconds
        this.delay = 0.005;

        // Set the default depth to 0.002;
        this.depth = 0.002;

        // Set the default feedback to 0.5
        this.feedback = 0.5;

        // Set the default speed to 0.25Hz
        this.speed = 0.25;
    }

    /**
     * Getter for the effect's delay
     * @return {number}
     */
    public get delay() : number|string{
        return this._delay;
    }

    /**
     * Setter for the effect's delay
     * @param  {number} delay
     */
    public set delay(delay: number|string) {
        // Set the internal delay value
        this._delay = parseFloat(<string>delay);

        // Set the new value for the delay-node
        (<DelayNode>this.nodes['delayNode']).delayTime.value = this._delay;
    }

    /**
     * Getter for the effect's depth
     * @return {number}
     */
    public get depth() : number|string {
        return this._depth;
    }

    /**
     * Setter for the effect's depth
     * @param  {number} depth
     */
    public set depth(depth: number|string) {
        // Set the internal depth value
        this._depth = parseFloat(<string>depth);

        // Set the gain value of the gain-node
        (<GainNode>this.nodes['gainNode']).gain.value = this._depth;
    }

    /**
     * Getter for the effect's feedback
     * @return {number}
     */
    public get feedback() : number|string {
        return this._feedback;
    }

    /**
     * Setter for the effect's feedback
     * @param  {number} feedback
     */
    public set feedback(feedback: number|string) {
        // Set the internal feedback value
        this._feedback = parseFloat(<string>feedback);

        // Set the feedback gain-node value
        (<GainNode>this.nodes['feedbackGainNode']).gain.value = this._feedback;
    }

    /**
     * Getter for the effect's speed
     * @return {number}
     */
    public get speed() : number|string {
        return this._speed;
    }

    /**
     * Setter for the effect's speed
     * @param  {number} speed
     */
    public set speed(speed: number|string) {
        // Set the internal speed value
        this._speed = parseFloat(<string>speed);

        // Set the speed gain-node value
        (<OscillatorNode>this.nodes['oscillatorNode']).frequency.value = this._speed;
    }
};


text:
package egovframework.com.ext.ldapumt.web;

import java.util.Map;

import egovframework.com.cmm.EgovMessageSource;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.ext.ldapumt.service.EgovOrgManageLdapService;
import egovframework.com.ext.ldapumt.service.UcorgVO;
import egovframework.com.ext.ldapumt.service.UserVO;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class EgovOrgManageLdapController {

	@Autowired
	private EgovOrgManageLdapService orgManageLdapService;

    @Resource(name="egovMessageSource")
    EgovMessageSource egovMessageSource;

    /**
     * 부서의 하위 부서 목록을 조회 한다.
     * @param dn
     * @param model
     * @return
     * @throws Exception
     */
	@RequestMapping(value = "/ext/ldapumt/dpt/getDeptManageSublist.do")
	public ModelAndView selectDeptManageSublist(@RequestParam("dn") String dn, ModelMap model) throws Exception {
		model.addAttribute("deptManage", orgManageLdapService.selectDeptManageSubList(dn));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);
		return modelAndView;
	}

	/**
	 * 등록된 부서의 상세정보를 조회한다.
	 * @param dn
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/getDeptManage.do")
	public ModelAndView selectDeptManage(@RequestParam("dn") String dn, ModelMap model) throws Exception {
		model.addAttribute("deptManage", orgManageLdapService.selectDeptManage(dn));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);
		return modelAndView;
	}

	/**
	 * 등록된 사용자의 상세정보를 조회한다.
	 * @param dn
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/getUserManage.do")
	public ModelAndView selectUserManage(@RequestParam("dn") String dn, ModelMap model) throws Exception {
		model.addAttribute("userManage", orgManageLdapService.selectUserManage(dn));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);
		return modelAndView;
	}

	/**
	 * 부서를 등록한다.
	 * @param parentDn 등록될 부서의 상위 부서
	 * @param ou 등록될 부서명
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/createNode.do")
	public ModelAndView createDeptManage(@RequestParam("dn") String parentDn, @RequestParam("text") String ou, ModelMap model) throws Exception {
		Map<String, Object> map = orgManageLdapService.insertDeptManage(parentDn, ou);

		model.addAttribute("deptManage", map);

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 사용자를 등록한다.
	 * @param parentDn 등록될 사용자의 상위 부서
	 * @param ou 등록될 사용자명
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/createUserNode.do")
	public ModelAndView createUserManage(@RequestParam("dn") String parentDn, @RequestParam("text") String cn, ModelMap model) throws Exception {
		Map<String, Object> map = orgManageLdapService.insertUserManage(parentDn, cn);

		model.addAttribute("deptManage", map);

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 부서를 삭제한다.
	 * @param dn 삭제할 부서의 DN
	 * @param model
	 * @return
	 * @throws Exception
	 * 하위부서까지 모두 삭제된다.
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/deleteNode.do")
	public ModelAndView removeDeptManage(@RequestParam("dn") String dn, ModelMap model) throws Exception {
		orgManageLdapService.deleteDeptManage(dn);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.delete"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 부서의 이름을 변경한다.
	 * @param dn 변경될 부서의 DN
	 * @param name 변경될 이름
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/renameNode.do")
	public ModelAndView renameDeptManage(@RequestParam("id") String dn, @RequestParam("text") String name, ModelMap model) throws Exception {
		orgManageLdapService.renameDeptManage(dn, name);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.update"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 사용자의 이름을 변경한다.
	 * @param dn 변경될 사용자의 DN
	 * @param name 변경될 이름
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/renameUserNode.do")
	public ModelAndView renameUserManage(@RequestParam("id") String dn, @RequestParam("text") String name, ModelMap model) throws Exception {
		orgManageLdapService.renameUserManage(dn, name);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.update"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 조직을 이동한다.
	 * @param dn 이동할 대상 DN
	 * @param parentDn 이동될 DN
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/moveOrgNode.do")
	public ModelAndView moveOrgManage(@RequestParam("id") String dn, @RequestParam("parent") String parentDn, ModelMap model) throws Exception {
		orgManageLdapService.moveOrgManage(dn, parentDn);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.update"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 부서정보를 변경한다.
	 * @param ucorgVO
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/modifyDeptManage.do")
	public ModelAndView modifyDeptManage(@ModelAttribute("ucorgVO") UcorgVO ucorgVO,
            ModelMap model) throws Exception {
		orgManageLdapService.modifyDeptManage(ucorgVO);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.update"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);

		return modelAndView;
	}

	/**
	 * 사용자 정보를 변경한다.
	 * @param userVO
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/ext/ldapumt/dpt/modifyUserManage.do")
	public ModelAndView modifyUserManage(@ModelAttribute("userVO") UserVO userVO,
			ModelMap model) throws Exception {
		orgManageLdapService.modifyUserManage(userVO);

		model.addAttribute("message", egovMessageSource.getMessage("success.common.update"));

		ModelAndView modelAndView = new ModelAndView("jsonView", model);
		return modelAndView;
	}

	/**
	 * 조직도 트리화면으로 이동
	 * @return
	 * @throws Exception
	 */
	@IncludedInfo(name="LDAP 조직도 트리",order = 3100 ,gid = 100)
    @RequestMapping("/ext/ldapumt/dpt/selectDeptManageTreeView.do")
    public String selectDeptManageTreeView() throws Exception {

        return "egovframework/com/ext/ldapumt/EgovDeptManageTree";
    }

    /**
     * 조직도 그래프로 이동
     * @return String
     * @exception Exception
     */
	@IncludedInfo(name="LDAP 조직도 그래프",order = 3110 ,gid = 100)
    @RequestMapping("/ext/ldapumt/dpt/selectDeptManageOrgChartView.do")
    public String selectDeptManageOrgChartView() throws Exception {

    	return "egovframework/com/ext/ldapumt/EgovDeptManageOrgChart";
    }

}


text:
layout: landing
root: true
scripts: ['index.js']
---

{{site.description}}

Who we are?

We are team of developers comes up with several ideas to solve
                                                         problems
                                                         using technology.
                                                         These projects get prototyped through in-house design and
                                                         technology, and
                                                         are delivered.

What we do, in four steps.

1. Analyze

Analyze the problem....

2. Ideate

Ideate a solution....

3. Prototype

Develop a prototype and showcase it, and collect feed
                                                         back....

4. Build

Develop the application....

                            <svg width="256" height="112" viewBox="0 0 256 112">
                                <path fill="none" stroke="currentColor" stroke-width="1"
                                      d="M8,56 C8,33.90861 25.90861,16 48,16 C70.09139,16 88,33.90861 88,56 C88,78.09139 105.90861,92 128,92 C150.09139,92 160,72 160,56 C160,40 148,24 128,24 C108,24 96,40 96,56 C96,72 105.90861,92 128,92 C154,93 168,78 168,56 C168,33.90861 185.90861,16 208,16 C230.09139,16 248,33.90861 248,56 C248,78.09139 230.09139,96 208,96 L48,96 C25.90861,96 8,78.09139 8,56 Z"></path>
                            </svg>

Services we offer

                            We provide wide range of services, starting from web designing, web application development,
                            mobile application development and ERP implementation.

                            Based on requirements we can work on any technology.

Responsive Web

If your website/web app's not responsive, you're doing it wrong. We create a
                           dynamic viewing experience for easy reading and navigation. We've been
                           making our websites and web apps responsive and adaptive for years now.
                           That's part of our mobile-first, design-first mantra. We build fast-loading,
                           highly optimized experiences that will work across a wide range of devices.
                           This responsive website is a perfect example. Play with the window size to
                           see what it looks like on mobile screens. We'll be here when you're
                           done.

"Information technology is at the core of how you
                                                                     do your business and how your business model itself
                                                                     evolves."

                                – Satya Nadella

Custom Web Application Development

The advantage of custom web applications is that they are tailored exactly to the way your
                           business works. Whether you need to build a custom web app from scratch, migrate your legacy
                           backend, or streamline existing front-end functionality, we can accomplish that in an
                           efficient and cost-effective manner.

Mobile App Development

Develop powerful, highly usable Android, Windows, iOS apps that solve business problems,
                           attract users, and
                           reinforce your brand. Cut your development and maintenance costs with cross-platform apps
                           that
                           work seamlessly on iOS, Android, and more.

ERP Implementation

Mapping ERP to your existing business processes using open source solutions. Set up a solid
                           foundation and rapidly install your on-premise, hosted or cloud ERP software. Personalize
                           your ERP software to meet your needs, including the design, development and integration of
                           complete and unique software applications.

Portfolio

                        We work with organizations from a broad range of industries

1. Invoicing Application

Web Application

                        Tools/Frameworks used:

Java Spring Framework

Angular JS

Bootstrap Framework

MySql

                    Try It

2. Balaji Developers

Responsive web design and development

                        Tools/Frameworks used:

PHP

Bootstrap material tool kit

                    Visit

3. Catering App

Hybrid Mobile Application

                        Tools/Frameworks used:

Cordova

Java Spring Framework

Angular JS

Bootstrap Framework

MySql

                    <form class="form" method="" action="">

Want to work with us?

Your project is very important to us.

                                <input type="text" class="form-control" placeholder="Name..." id="contact-form-name"
                                       autocomplete="off">

                                <input type="email" class="form-control" placeholder="Email..." id="contact-form-email"
                                       autocomplete="off">

                                <textarea placeholder="Message..." class="form-control" id="contact-form-message"
                                          autocomplete="off"></textarea>

                                    Oh snap!

                                    Sent! You message is delivery, we will get back to you as soon as
                                                           possible.

                            <button class="btn btn-neutral btn-round btn-lg" id="contact-form-send" type="button">Send
                            </button>

                    </form>

KEEP IN TOUCH

 contact@anysols.com

If you have interest in contracting any of our services,
                                            please contact us! We love new challenges... ;)

Follow us


text:
<?php

namespace App\Models\Admin\Content;

use App\Models\Model;

class Category extends Model {

    public function addCategory($data) {
        DB::query("
			INSERT INTO " . DB::prefix() . "blog_category
			SET
				parent_id = '" . (int)$data['parent_id'] . "',
				sort_order = '" . (int)$data['sort_order'] . "',
				status = '" . (int)$data['status'] . "',
				date_modified = NOW(),
				date_added = NOW()
		");

        $category_id = DB::getLastId();

        if (isset($data['image'])) {
            DB::query("
				UPDATE " . DB::prefix() . "blog_category
				SET
					image = '" . DB::escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "'
				WHERE category_id = '" . (int)$category_id . "'
			");
        }

        foreach ($data['category_description'] as $language_id => $value) {
            DB::query("
				INSERT INTO " . DB::prefix() . "blog_category_description
				SET
                    category_id      = '" . (int)$category_id . "',
                    language_id      = '" . (int)$language_id . "',
                    name             = '" . DB::escape($value['name']) . "',
                    meta_keyword     = '" . DB::escape($value['meta_keyword']) . "',
                    meta_description = '" . DB::escape($value['meta_description']) . "',
                    description      = '" . DB::escape($value['description']) . "'
			");

            // process tags
            if (isset($value['tag'])):
                $tags = explode(',', $value['tag']);
                foreach ($tags as $tag):
                    $tag = trim($tag);
                    DB::query("
                        INSERT INTO " . DB::prefix() . "tag
                        SET
                            section     = 'blog_category',
                            element_id  = '" . (int)$category_id . "',
                            language_id = '" . (int)$language_id . "',
                            tag         = '" . DB::escape($tag) . "'
                    ");
                endforeach;
            endif;

            Search::add($language_id, 'blog_category', $category_id, $value['name']);
            Search::add($language_id, 'blog_category', $category_id, $value['description']);
        }

        if (isset($data['category_store'])) {
            foreach ($data['category_store'] as $store_id) {
                DB::query("
					INSERT INTO " . DB::prefix() . "blog_category_to_store
					SET
						category_id = '" . (int)$category_id . "',
						store_id = '" . (int)$store_id . "'
				");
            }
        }

        if (isset($data['category_layout'])) {
            foreach ($data['category_layout'] as $store_id => $layout) {
                if ($layout['layout_id']) {
                    DB::query("
						INSERT INTO " . DB::prefix() . "blog_category_to_layout
						SET
							category_id = '" . (int)$category_id . "',
							store_id = '" . (int)$store_id . "',
							layout_id = '" . (int)$layout['layout_id'] . "'
					");
                }
            }
        }

        if ($data['slug']) {
            DB::query("
				INSERT INTO " . DB::prefix() . "route
				SET
					route='content/category',
					query = 'blog_category_id:" . (int)$category_id . "',
					slug = '" . DB::escape($data['slug']) . "'
			");
        }

        Cache::delete('post.category');
        Cache::delete('post.categories');

        Theme::trigger('admin_blog_add_category', array('blog_category_id' => $category_id));
    }

    public function editCategory($category_id, $data) {
        DB::query("
			UPDATE " . DB::prefix() . "blog_category
			SET
				parent_id = '" . (int)$data['parent_id'] . "',
				sort_order = '" . (int)$data['sort_order'] . "',
				status = '" . (int)$data['status'] . "',
				date_modified = NOW()
			WHERE category_id = '" . (int)$category_id . "'
		");

        if (isset($data['image'])) {
            DB::query("
				UPDATE " . DB::prefix() . "blog_category
				SET image = '" . DB::escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "'
				WHERE category_id = '" . (int)$category_id . "'
			");
        }

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_description
            WHERE category_id = '" . (int)$category_id . "'");

        foreach ($data['category_description'] as $language_id => $value) {
            DB::query("
				INSERT INTO " . DB::prefix() . "blog_category_description
				SET
                    category_id      = '" . (int)$category_id . "',
                    language_id      = '" . (int)$language_id . "',
                    name             = '" . DB::escape($value['name']) . "',
                    meta_keyword     = '" . DB::escape($value['meta_keyword']) . "',
                    meta_description = '" . DB::escape($value['meta_description']) . "',
                    description      = '" . DB::escape($value['description']) . "'
			");

            DB::query("
                DELETE FROM " . DB::prefix() . "tag
                WHERE section   = 'blog_category'
                AND element_id  = '" . (int)$category_id . "'
                AND language_id = '" . (int)$language_id . "'
            ");

            // process tags
            if (isset($value['tag'])):
                $tags = explode(',', $value['tag']);
                foreach ($tags as $tag):
                    $tag = trim($tag);
                    DB::query("
                        INSERT INTO " . DB::prefix() . "tag
                        SET
                            section     = 'blog_category',
                            element_id  = '" . (int)$category_id . "',
                            language_id = '" . (int)$language_id . "',
                            tag         = '" . DB::escape($tag) . "'
                    ");
                endforeach;
            endif;

            Search::delete('blog_category', $category_id);

            Search::add($language_id, 'blog_category', $category_id, $value['name']);
            Search::add($language_id, 'blog_category', $category_id, $value['description']);
        }

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_to_store
            WHERE category_id = '" . (int)$category_id . "'");

        if (isset($data['category_store'])) {
            foreach ($data['category_store'] as $store_id) {
                DB::query("
					INSERT INTO " . DB::prefix() . "blog_category_to_store
					SET
						category_id = '" . (int)$category_id . "',
						store_id = '" . (int)$store_id . "'
				");
            }
        }

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_to_layout
            WHERE category_id = '" . (int)$category_id . "'");

        if (isset($data['category_layout'])) {
            foreach ($data['category_layout'] as $store_id => $layout) {
                if ($layout['layout_id']) {
                    DB::query("
						INSERT INTO " . DB::prefix() . "blog_category_to_layout
						SET
							category_id = '" . (int)$category_id . "',
							store_id = '" . (int)$store_id . "',
							layout_id = '" . (int)$layout['layout_id'] . "'
					");
                }
            }
        }

        DB::query("
            DELETE FROM " . DB::prefix() . "route
            WHERE query = 'blog_category_id:" . (int)$category_id . "'");

        if ($data['slug']) {
            DB::query("
				INSERT INTO " . DB::prefix() . "route
				SET
					route = 'content/category',
					query = 'blog_category_id:" . (int)$category_id . "',
					slug = '" . DB::escape($data['slug']) . "'
			");
        }

        Cache::delete('post.category');
        Cache::delete('post.categories');

        Theme::trigger('admin_blog_edit_category', array('blog_category_id' => $category_id));
    }

    public function deleteCategory($category_id) {
        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category
            WHERE category_id = '" . (int)$category_id . "'");

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_description
            WHERE category_id = '" . (int)$category_id . "'");

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_to_store
            WHERE category_id = '" . (int)$category_id . "'");

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_category_to_layout
            WHERE category_id = '" . (int)$category_id . "'");

        DB::query("
            DELETE FROM " . DB::prefix() . "blog_post_to_category
            WHERE category_id = '" . (int)$category_id . "'");

        DB::query("
            DELETE FROM " . DB::prefix() . "route
            WHERE query = 'blog_category_id:" . (int)$category_id . "'");

        $query = DB::query("
			SELECT category_id
			FROM " . DB::prefix() . "blog_category
			WHERE parent_id = '" . (int)$category_id . "'
		");

        DB::query("
            DELETE FROM " . DB::prefix() . "tag
            WHERE section  = 'blog_category'
            AND element_id = '" . (int)$category_id . "'");

        foreach ($query->rows as $result) {
            $this->deleteCategory($result['category_id']);
        }

        Search::delete('blog_category', $category_id);

        Cache::delete('post.category');
        Cache::delete('post.categories');

        Theme::trigger('admin_blog_delete_category', array('blog_category_id' => $category_id));
    }

    public function getCategory($category_id) {
        $query = DB::query("
			SELECT DISTINCT *,
			(SELECT slug FROM " . DB::prefix() . "route WHERE query = 'blog_category_id:" . (int)$category_id . "') AS slug
			FROM " . DB::prefix() . "blog_category
			WHERE category_id = '" . (int)$category_id . "'
		");

        if ($query->num_rows):
            $query->row['tag'] = $this->getBlogCategoryTags($category_id);
        endif;

        return $query->row;
    }

    public function getBlogCategoryTags($category_id) {
        $query = DB::query("
            SELECT tag
            FROM " . DB::prefix() . "tag
            WHERE section   = 'blog_category'
            AND element_id  = '" . (int)$category_id . "'
            AND language_id = '" . (int)Config::get('config_language_id') . "'
        ");

        if ($query->num_rows):
            $tags = array();
            foreach($query->rows as $row):
                $tags[] = $row['tag'];
            endforeach;
            return implode(', ', $tags);
        else:
            return false;
        endif;
    }

    public function getCategories($parent_id = 0) {
        $category_data = Cache::get('blog_category.' . (int)Config::get('config_language_id') . '.' . (int)$parent_id);

        if (!$category_data) {
            $category_data = array();

            $query = DB::query("
				SELECT *
				FROM " . DB::prefix() . "blog_category c
				LEFT JOIN " . DB::prefix() . "blog_category_description cd
					ON (c.category_id = cd.category_id)
				WHERE c.parent_id = '" . (int)$parent_id . "'
				AND cd.language_id = '" . (int)Config::get('config_language_id') . "'
				ORDER BY c.sort_order, cd.name ASC
			");

            foreach ($query->rows as $result) {
                $category_data[] = array(
                    'category_id' => $result['category_id'],
                    'name'        => $this->getPath($result['category_id'], Config::get('config_language_id')),
                    'status'      => $result['status'],
                    'sort_order'  => $result['sort_order']
                );

                $category_data = array_merge($category_data, $this->getCategories($result['category_id']));
            }

            Cache::set('blog_category.' . (int)Config::get('config_language_id') . '.' . (int)$parent_id, $category_data);
        }

        return $category_data;
    }

    public function getPath($category_id) {
        $query = DB::query("
			SELECT name, parent_id
			FROM " . DB::prefix() . "blog_category c
			LEFT JOIN " . DB::prefix() . "blog_category_description cd
				ON (c.category_id = cd.category_id)
			WHERE c.category_id = '" . (int)$category_id . "'
			AND cd.language_id = '" . (int)Config::get('config_language_id') . "'
			ORDER BY c.sort_order, cd.name ASC
		");

        if ($query->row['parent_id']) {
            return $this->getPath($query->row['parent_id'], Config::get('config_language_id')) . Lang::get('lang_text_separator') . $query->row['name'];
        } else {
            return $query->row['name'];
        }
    }

    public function getCategoryDescriptions($category_id) {
        $category_description_data = array();

        $query = DB::query("
			SELECT *
			FROM " . DB::prefix() . "blog_category_description
			WHERE category_id = '" . (int)$category_id . "'
		");

        foreach ($query->rows as $result) {
            $category_description_data[$result['language_id']] = array(
                'name'             => $result['name'],
                'meta_keyword'     => $result['meta_keyword'],
                'meta_description' => $result['meta_description'],
                'description'      => $result['description'],
                'tag'              => $this->getBlogCategoryTags($category_id)
            );
        }

        return $category_description_data;
    }

    public function getCategoryStores($category_id) {
        $category_store_data = array();

        $query = DB::query("
			SELECT *
			FROM " . DB::prefix() . "blog_category_to_store
			WHERE category_id = '" . (int)$category_id . "'
		");

        foreach ($query->rows as $result) {
            $category_store_data[] = $result['store_id'];
        }

        return $category_store_data;
    }

    public function getCategoryLayouts($category_id) {
        $category_layout_data = array();

        $query = DB::query("
			SELECT *
			FROM " . DB::prefix() . "blog_category_to_layout
			WHERE category_id = '" . (int)$category_id . "'
		");

        foreach ($query->rows as $result) {
            $category_layout_data[$result['store_id']] = $result['layout_id'];
        }

        return $category_layout_data;
    }

    public function getTotalCategories() {
        $query = DB::query("
			SELECT COUNT(*) AS total
			FROM " . DB::prefix() . "blog_category
		");

        return $query->row['total'];
    }

    public function getTotalCategoriesByImageId($image_id) {
        $query = DB::query("
			SELECT COUNT(*) AS total
			FROM " . DB::prefix() . "blog_category
			WHERE image_id = '" . (int)$image_id . "'
		");

        return $query->row['total'];
    }

    public function getTotalCategoriesByLayoutId($layout_id) {
        $query = DB::query("
			SELECT COUNT(*) AS total
			FROM " . DB::prefix() . "blog_category_to_layout
			WHERE layout_id = '" . (int)$layout_id . "'
		");

        return $query->row['total'];
    }
}


text:
Template.UserContentWidget.helpers({
  style: function() {
    var backgroundRule = 'background-color: ' + this.backgroundColor + ';';
    if (this.imageUrl) {
      backgroundRule += 'background-image: url("' + this.imageUrl + '"); ' +
        'background-size: cover;';
    }
    var textColorRule = 'color: ' + this.textColor + ';';
    return {
      style: backgroundRule + ' ' + textColorRule
    };
  }
});


text:
export * from 'auth/actions';
export * from 'shared/actions';
export * from 'soundboard/actions';


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=".LoginActivity" >

    <EditText
        android:id="@+id/usernameEdit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="@string/usernameHint" >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/passwordEdit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="@string/passwordHint"
        android:inputType="textPassword" />

    <TableLayout
        android:id="@+id/TableLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="0,1" >

        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="fill" >

            <Button
                android:id="@+id/loginBtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/loginBtn" />

            <Button
                android:id="@+id/registerBtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/registerBtn" />
        </TableRow>
    </TableLayout>

</LinearLayout>


text:
DIRS = userprog threads machine security ag

include ../Makefile

test:
	cd ../test
	make