text:
function orderedNoiseDisplay(noise, spacing)

% ORDEREDNOISEDISPLAY Display parameters of the ORDERED noise.
%
%	Description:
%
%	ORDEREDNOISEDISPLAY(NOISE) displays the parameters of the ordered
%	categorical noise and the noise type to the console.
%	 Arguments:
%	  NOISE - the noise to display.
%
%	ORDEREDNOISEDISPLAY(NOISE, SPACING)
%	 Arguments:
%	  NOISE - the noise to display.
%	  SPACING - how many spaces to indent the display of the noise by.
%
%
%	See also
%	ORDEREDNOISEPARAMINIT, MODELDISPLAY, NOISEDISPLAY

%	Copyright (c) 2004, 2005 Neil D. Lawrence

if nargin > 1
  spacing = repmat(32, 1, spacing);
else
  spacing = [];
end
spacing = char(spacing);
for i = 1:noise.numProcess
  fprintf(spacing);
  fprintf('Ordered bias on process %d: %2.4f\n', i, noise.bias(i))
end
for i = 1:noise.C-2
  fprintf('Ordered noise model width %d: %2.4f\n', i, noise.widths(i))
end
fprintf(spacing);
fprintf(spacing);
fprintf('Ordered Sigma2: %2.4f\n', noise.variance);


text:
How to use bash history expansion

Examples:

re-execute the last commands:
echo !! shortern for echo !-1

re-execute the second last command: echo !-2

re-execute the last command with string replace
service sshd start
^start^stop^ equal !!:s/start/stop

execute command with the last argument of the last command
echo !$ shortern for echo !!:$

execute command with the first argument of the last command
echo !^ shortern for echo !!:1

execute command with all argument of the last command
echo !!:* shortern for !!:1-$

The most complex command:
echo !-3:2-3:gs/start/stop/

reference:

bash history expansion

redpajama_set_name: RedPajamaGithub


text:
package ru.job4j.loop;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
* Test task #4412.
*
*@author Idergunov(mailto:idergunov058@yadnex.ru).
*@version $Id$
*@since 0.1
*/
public class PaintTest {
/**
* Test add.
* Проверки постоения 2 пирамиды.
*/
@Test
public void whenPiramidWithHeightTwoThenStringWithTwoRows() {
	Paint paint = new Paint();
	String result = paint.piramid(2);
	String expected = String.format(" ^ %s^^^", System.getProperty("line.separator"));
	assertThat(result, is(expected));

	}
/**
* Test add.
* Проверки постоения 3 пирамиды.
*/
@Test
 public void whenPiramidWithHeightThreeThenStringWithThreeRows() {
	Paint paint = new Paint();
	String result = paint.piramid(3);
	String expected = String.format("  ^  %s ^^^ %s^^^^^", System.getProperty("line.separator"), System.getProperty("line.separator"));
	assertThat(result, is(expected));
	}
}


text:
@interface DSManager : NSObject {

    int currentIndex;

    NSMutableArray *getBlocks;

}

-(void)setCurrentIndex:(int)index;
-(void)setGet:(int)limit block:(void (^)(int))block;

@end


text:
<?php

namespace ANDS\Registry\Providers\RIFCS;

use ANDS\Registry\Providers\MetadataProvider;
use ANDS\Registry\Providers\RIFCSProvider;
use ANDS\RegistryObject;
use ANDS\Util\XMLUtil;
use Carbon\Carbon;

class CitationProvider implements RIFCSProvider
{

    public static function process(RegistryObject $record)
    {
        // TODO: Implement process() method.
    }

    public static function get(RegistryObject $record)
    {
        $data = MetadataProvider::getSelective($record, ['recordData']);

        $citations = [];

        foreach (XMLUtil::getElementsByXPath($data['recordData'],
            'ro:registryObject/ro:' . $record->class . '/ro:citationInfo') AS $citation){
            $fullCitation = null;
            $citationMetadata = null;

            if ($citation->fullCitation) {
                $fullCitation = [
                    'value' => (string) $citation->fullCitation,
                    'style' => $citation->fullCitation['style']
                ];
            }

            if ($citation->citationMetadata) {
                $citationMetadata = [
                    'bibtex' => static::toBibTex($citation->citationMetadata, $record),
                    'coins' => static::toCoinsSpan($citation->citationMetadata)
                ];
            }

            $citations[] = [
                'full' => $fullCitation,
                'metadata' => $citationMetadata
            ];
        }

        $bibtex = collect($citations)->filter(function($item) {
            if ($item['metadata'] && $item['metadata']['bibtex']) {
                return $item;
            }
            return false;
        })->first();

        $full = collect($citations)->filter(function($item) {
            if ($item['full']) {
                return true;
            }
            return false;
        })->map(function($item){
            return [
                'value' => $item['full']['value'],
                'style' => (string) $item['full']['style']
            ];
        })->first();

        return [
            'full' => $full ? $full['value'] : null,
            'full_style' => $full ? $full['style'] : null,
            'bibtex' => $bibtex ? $bibtex['metadata']['bibtex'] : null,
            'citations' => $citations
        ];
    }

    /**
     * misc {title = "citationMetadata/title>",
     * year = "citationMetadata/date (just the year)",
     * doi = "citationMetadata/identifier @type=doi",
     * author="citationMetadata/contributor",
     * publisher="citationMetadata/publisher" }
     *
     * @param $elem
     * @param RegistryObject $record
     * @return string
     */
    public static function toBibTex($elem, RegistryObject $record)
    {

        $result = "@misc{";
        $result .= "title={".$record->title. "} ";
        if ($date = DatesProvider::parseDate((string) $elem->date)) {
            $result .= "year={".$date->year. "} ";
        }
        if ($elem->identifier && $elem->identifier['type'] == 'doi') {
            $result .= "DOI={".(string) $elem->identifier. "} ";
        }
        $names = [];

        if ($elem->contributor) {
            foreach ($elem->contributor as $contributor) {
                $name = [];
                if (!$contributor->namePart) {
                    continue;
                }

                // TODO: Refactor this to a common provider, used in a lot of places
                $order = ['given', 'family'];
                foreach ($order as $o) {
                    foreach ($contributor->namePart as $namePart) {
                        if ((string) $namePart['type'] == $o) {
                            $name[] = (string) $namePart;
                        }
                    }
                }

                $names[] = implode(" ", $name);
            }
        }

        if ($elem->contributor && $elem->contributor->namePart) {
            $result .= "author={".implode(", ", $names)."} ";
        }
        if ($elem->publisher && $elem->publisher) {
            $result .= "publisher={".(string) $elem->publisher."}";
        }
        $result.= "}";

        return trim($result);
    }

    public static function toCoinsSpan($elem)
    {
        return null;
    }
}


text:
package com.deathree.ca.dao;

import java.util.List;
import com.deathree.ca.model.bean.User;

public interface UserDao {
    public void addUser(User user);
    public String findUserByName(String username);
    public List<User> list();
    public User findUserById(Long id);
    public void UpdateInfo(User user);
    public void delUserById(Long id);
}


text:
<?php

/**
 * @package PayPal
 */

/**
 * Make sure our parent class is defined.
 */
require_once 'PayPal/Type/XSDSimpleType.php';

/**
 * DoNonReferencedCreditRequestDetailsType
 *
 * @package PayPal
 */
class DoNonReferencedCreditRequestDetailsType extends XSDSimpleType
{
    var $Amount;

    var $NetAmount;

    var $TaxAmount;

    var $ShippingAmount;

    var $CreditCard;

    var $ReceiverEmail;

    var $Comment;

    function DoNonReferencedCreditRequestDetailsType()
    {
        parent::XSDSimpleType();
        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
        $this->_elements = array_merge($this->_elements,
            array (
              'Amount' =>
              array (
                'required' => true,
                'type' => 'BasicAmountType',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'NetAmount' =>
              array (
                'required' => false,
                'type' => 'BasicAmountType',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'TaxAmount' =>
              array (
                'required' => false,
                'type' => 'BasicAmountType',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'ShippingAmount' =>
              array (
                'required' => false,
                'type' => 'BasicAmountType',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'CreditCard' =>
              array (
                'required' => true,
                'type' => 'CreditCardDetailsType',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'ReceiverEmail' =>
              array (
                'required' => false,
                'type' => 'string',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
              'Comment' =>
              array (
                'required' => false,
                'type' => 'string',
                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
              ),
            ));
    }

    function getAmount()
    {
        return $this->Amount;
    }
    function setAmount($Amount, $charset = 'iso-8859-1')
    {
        $this->Amount = $Amount;
        $this->_elements['Amount']['charset'] = $charset;
    }
    function getNetAmount()
    {
        return $this->NetAmount;
    }
    function setNetAmount($NetAmount, $charset = 'iso-8859-1')
    {
        $this->NetAmount = $NetAmount;
        $this->_elements['NetAmount']['charset'] = $charset;
    }
    function getTaxAmount()
    {
        return $this->TaxAmount;
    }
    function setTaxAmount($TaxAmount, $charset = 'iso-8859-1')
    {
        $this->TaxAmount = $TaxAmount;
        $this->_elements['TaxAmount']['charset'] = $charset;
    }
    function getShippingAmount()
    {
        return $this->ShippingAmount;
    }
    function setShippingAmount($ShippingAmount, $charset = 'iso-8859-1')
    {
        $this->ShippingAmount = $ShippingAmount;
        $this->_elements['ShippingAmount']['charset'] = $charset;
    }
    function getCreditCard()
    {
        return $this->CreditCard;
    }
    function setCreditCard($CreditCard, $charset = 'iso-8859-1')
    {
        $this->CreditCard = $CreditCard;
        $this->_elements['CreditCard']['charset'] = $charset;
    }
    function getReceiverEmail()
    {
        return $this->ReceiverEmail;
    }
    function setReceiverEmail($ReceiverEmail, $charset = 'iso-8859-1')
    {
        $this->ReceiverEmail = $ReceiverEmail;
        $this->_elements['ReceiverEmail']['charset'] = $charset;
    }
    function getComment()
    {
        return $this->Comment;
    }
    function setComment($Comment, $charset = 'iso-8859-1')
    {
        $this->Comment = $Comment;
        $this->_elements['Comment']['charset'] = $charset;
    }
}


text:
{-|
An example of the use of the
'Control.Monad.MultiPass.Instrument.OrdCons.OrdCons' instrument.
-}

module Control.Monad.MultiPass.Example.OrdCons ( convertArray )
where

import Control.Monad.ST2
import Control.Monad.MultiPass
import Control.Monad.MultiPass.Instrument.CreateST2Array
import Control.Monad.MultiPass.Instrument.OrdCons
import Data.Ix

newtype ConvertArray i a r w p1 p2 tc
  = ConvertArray (ConvertArrayType i a r w p1 p2 tc)

type ConvertArrayType i a r w p1 p2 tc
  =  OrdCons a r w p1 p2 tc
  -> CreateST2Array r w p2 tc
  -> MultiPassMain r w tc (p2 (ST2Array r w i Int))

instance MultiPassAlgorithm
           (ConvertArray i a r w p1 p2 tc)
           (ConvertArrayType i a r w p1 p2 tc)
           where
  unwrapMultiPassAlgorithm (ConvertArray f) = f

convertArray
  :: (Ix i, Num i, Ord a)
  => NumThreads
  -> ST2Array r w i a
  -> ST2 r w (ST2Array r w i Int)
convertArray n xs =
  run $ PassS $ PassS $ PassZ $ ConvertArray $
  convertArrayMP n xs

convertArrayMP
  :: (Ix i, Num i, Ord a, Monad p1, Monad p2)
  => NumThreads
  -> ST2Array r w i a
  -> ConvertArrayType i a r w p1 p2 tc
convertArrayMP n xs oc cr =
  mkMultiPassMain
    (return ())
    (\() ->
     pmapST2ArrayMP cr n xs $ \x ->
       ordCons oc (return x))
    return


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class VirtualPCNet32 extends VirtualEthernetCard {
}


text:
/* global fetch */

import 'whatwg-fetch'

import config from 'config'

const middleware = store => next => action => {
  const api = action.API
  if (typeof api === 'undefined') {
    return next(action)
  }

  next({
    type: api.actions.request
  })

  const url = `${config.api.url}${api.endpoint}`
  const options = {
    method: api.verb
  }
  if (api.payload) {
    options.body = JSON.stringify(api.payload)
  }
  return fetch(url, options)
    .then(response => response.json())
    .then(payload => {
      next({
        type: api.actions.success,
        payload
      })
    })
    .catch(error => {
      next({
        type: api.actions.failure,
        message: error.message || 'Something went wrong!',
        error
      })
    })
}

export default middleware


text:
'Report writer'

import pdb

class Report(object):
    def __init__(self, also_print=True):
        self._also_print = also_print
        self._lines = []

    def append(self, line):
        self._lines.append(line)
        if self._also_print:
            print line

    def append_lines(self, lines):
        for line in lines:
            self.append(line)

    def append_report(self, other_report):
        for line in other_report.iterlines():
            self.append(line)

    def extend(self, lines):
        for line in lines:
            self.append(line)

    def write(self, path):
        f = open(path, 'w')
        for line in self._lines:
            try:
                f.write(str(line))
            except:
                print line
                print type(line)
                pdb.set_trace()
            f.write('\n')
        f.close()

    def iterlines(self):
        for line in self._lines:
            yield line

    def lines(self):
        return self._lines


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

[System.Serializable]
public class PlanetTileData
{

    [SerializeField]
    PlanetData planetData;

    public PlanetTileData(PlanetData data)
    {
        planetData = data;
    }

}


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

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:color="#ccc"/>
    <item android:drawable="@drawable/card" android:color="#3498db"/>
</selector>


text:
var pg;
(function (pg) {
    // Terrible element resize hack methods
    function resizeTriggerListener(e) {
        var win = e.target;
        var trigger = win.__resizeOwner__;
        trigger.__resizeListeners__.forEach(function (fn) {
            fn.call(trigger, e);
        });
    }
    function addElementResizeListener(element, listener) {
        function onLoad(e) {
            obj.onload = null;
            obj.contentDocument.defaultView.__resizeOwner__ = element;
            obj.contentDocument.defaultView.addEventListener('resize', resizeTriggerListener);
        }
        if (!element.__resizeListeners__) {
            element.__resizeListeners__ = [];
            if (getComputedStyle(element).position == 'static')
                element.style.position = 'relative';
            var obj = element.__resizeTrigger__ = document.createElement('object');
            obj.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
            obj.onload = onLoad;
            obj.type = 'text/html';
            obj.data = 'about:blank';
            element.appendChild(obj);
        }
        element.__resizeListeners__.push(listener);
    }
    pg.addElementResizeListener = addElementResizeListener;
    function removeElementResizeListener(element, listener) {
        element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(listener), 1);
        if (!element.__resizeListeners__.length) {
            element.__resizeTrigger__.contentDocument.defaultView.removeEventListener('resize', resizeTriggerListener);
            element.removeChild(element.__resizeTrigger__);
            element.__resizeTrigger__ = null;
            element.__resizeListeners__ = null;
        }
    }
    pg.removeElementResizeListener = removeElementResizeListener;
    // end horrible hack stuff
})(pg || (pg = {}));
(function (pg) {
    var ui;
    (function (ui) {
        var ScrollController = /** @class */ (function () {
            function ScrollController(container, opts) {
                this.WheelVelocity = 30;
                this.MinThumbHeight = 20;
                this.MaxThumbHeight = 0;
                this.ScrollPos = 0;
                this.MinPos = 0;
                this.ThumbHeight = 0;
                this.ThumbScale = 0;
                this.WheelVelocity = opts.wheelVelocity != null ? opts.wheelVelocity : this.WheelVelocity;
                this.MinThumbHeight = opts.minThumbHeight != null ? opts.minThumbHeight : this.MinThumbHeight;
                this.MaxThumbHeight = opts.maxThumbHeight != null ? opts.maxThumbHeight : this.MaxThumbHeight;
                this.Container = container;
                this.Content = container.children[0];
                this.TopShadow = document.createElement('div');
                this.TopShadow.style.position = "absolute";
                this.TopShadow.style.width = "100%";
                this.TopShadow.style.top = "0px";
                this.TopShadow.style.pointerEvents = "none";
                this.TopShadow.classList.add("scrollTopShadow");
                this.Container.appendChild(this.TopShadow);
                this.BottomShadow = document.createElement('div');
                this.BottomShadow.style.position = "absolute";
                this.BottomShadow.style.width = "100%";
                this.BottomShadow.style.bottom = "0px";
                this.TopShadow.style.pointerEvents = "none";
                this.BottomShadow.classList.add("scrollBottomShadow");
                this.Container.appendChild(this.BottomShadow);
                this.ScrollThumb = document.createElement('div');
                this.ScrollThumb.style.position = "absolute";
                this.ScrollThumb.classList.add("scrollThumb");
                this.Container.appendChild(this.ScrollThumb);
                this.setupEvents();
                this.calcDimensions();
            }
            ScrollController.prototype.redraw = function () {
                var topOpacity = this.ScrollPos / -100.0;
                if (topOpacity < 0)
                    topOpacity = 0;
                else if (topOpacity > 1.0)
                    topOpacity = 1.0;
                this.TopShadow.style.opacity = String(topOpacity);
                var bottomOpacity = (this.ScrollPos - this.MinPos) / 100.0;
                if (bottomOpacity < 0)
                    bottomOpacity = 0;
                else if (bottomOpacity > 1.0)
                    bottomOpacity = 1.0;
                this.BottomShadow.style.opacity = String(bottomOpacity);
                if (this.ThumbScale != 0) {
                    var thumbPos = this.ScrollPos * this.ThumbScale;
                    this.ScrollThumb.style.top = Math.round(thumbPos) + "px";
                }
            };
            ScrollController.prototype.calcDimensions = function () {
                this.ContainerHeight = this.Container.offsetHeight;
                this.ContentHeight = this.Content.offsetHeight;
                this.MinPos = this.ContainerHeight - this.ContentHeight;
                if (this.MinPos > 0)
                    this.MinPos = 0;
                this.ThumbHeight = this.ContainerHeight * this.ContainerHeight / this.ContentHeight;
                if (this.ThumbHeight < this.MinThumbHeight)
                    this.ThumbHeight = this.MinThumbHeight;
                else if (this.MaxThumbHeight > 0 && this.ThumbHeight > this.MaxThumbHeight)
                    this.ThumbHeight = this.MaxThumbHeight;
                if (this.ContentHeight == 0 || this.ContainerHeight > this.ContentHeight) {
                    this.ScrollThumb.style.display = "none";
                    this.ThumbScale = 0;
                }
                else {
                    this.ScrollThumb.style.display = "block";
                    this.ScrollThumb.style.height = this.ThumbHeight + "px";
                    this.ThumbScale = (this.ContainerHeight - this.ThumbHeight) / this.MinPos;
                }
                this.setScroll(this.ScrollPos);
            };
            ScrollController.prototype.setScroll = function (pos) {
                if (pos > 0)
                    pos = 0;
                else if (pos < this.MinPos)
                    pos = this.MinPos;
                this.ScrollPos = Math.round(pos);
                this.Content.style.top = this.ScrollPos + "px";
                this.redraw();
            };
            ScrollController.prototype.scroll = function (delta) {
                this.setScroll(this.ScrollPos - delta);
            };
            ScrollController.prototype.setupEvents = function () {
                var inst = this;
                this.Container.addEventListener("wheel", onWheel);
                this.ScrollThumb.addEventListener("mousedown", onThumbMouseDown);
                pg.addElementResizeListener(this.Container, onContainerResized);
                pg.addElementResizeListener(this.Content, onContentResized);
                var startMouseY = 0;
                var startScrollPos = 0;
                function onWheel(ev) {
                    var delta = ev.deltaY > 0 ? inst.WheelVelocity : -inst.WheelVelocity;
                    inst.scroll(delta);
                    ev.preventDefault();
                }
                function onContainerResized(ev) {
                    inst.calcDimensions();
                }
                function onContentResized(ev) {
                    inst.calcDimensions();
                }
                function onThumbMouseMove(ev) {
                    var offset = ev.clientY - startMouseY;
                    if (inst.ThumbScale != 0) {
                        var scrollOffset = offset / inst.ThumbScale;
                        inst.setScroll(startScrollPos + scrollOffset);
                    }
                    ev.preventDefault();
                }
                function onThumbMouseUp(ev) {
                    document.removeEventListener("mousemove", onThumbMouseMove);
                    document.removeEventListener("mouseup", onThumbMouseUp);
                }
                function onThumbMouseDown(ev) {
                    startMouseY = ev.clientY;
                    startScrollPos = inst.ScrollPos;
                    document.addEventListener("mousemove", onThumbMouseMove);
                    document.addEventListener("mouseup", onThumbMouseUp);
                    ev.preventDefault();
                }
            };
            return ScrollController;
        }());
        function makeScrollPanel(container, opts) {
            if (!opts)
                opts = {};
            container.style.overflow = "hidden";
            return new ScrollController(container, opts);
        }
        ui.makeScrollPanel = makeScrollPanel;
    })(ui = pg.ui || (pg.ui = {}));
})(pg || (pg = {}));
(function (pg) {
    var library;
    (function (library) {
        var PreviewPane = null;
        var Library = null;
        var LibraryPalette = null;
        var CurrentlySelected = null;
        function initLibrary() {
            Library = document.getElementById("library");
            if (Library == null)
                return;
            Library.style.display = "none";
            PreviewPane = document.createElement("div");
            PreviewPane.classList.add("pgbare");
            PreviewPane.style.left = "0px";
            PreviewPane.style.right = "200px";
            PreviewPane.style.height = "100%";
            document.body.appendChild(PreviewPane);
            if (window.location.href.substring(0, 5) != "file:")
                return;
            var hash = window.location.hash.substring(1);
            var libPath = hash.split("/");
            if (libPath.length == 0 || libPath[0] != "library")
                return;
            LibraryPalette = document.createElement("div");
            LibraryPalette.classList.add("pgbare");
            LibraryPalette.style.width = "200px";
            LibraryPalette.style.right = "0px";
            LibraryPalette.style.height = "100%";
            LibraryPalette.style.backgroundColor = "#dddddd";
            LibraryPalette.innerHTML =
                "
Library
";
            document.body.appendChild(LibraryPalette);
            var scrollContainer = document.createElement("div");
            scrollContainer.classList.add("pgbare");
            scrollContainer.style.width = "100%";
            scrollContainer.style.top = "50px";
            scrollContainer.style.bottom = "0px";
            LibraryPalette.appendChild(scrollContainer);
            var scrollPanel = document.createElement("div");
            scrollContainer.appendChild(scrollPanel);
            var list = document.createElement("ul");
            list.id = "libraryList";
            scrollPanel.appendChild(list);
            var libItems = Library.children;
            for (var i = 0; i < libItems.length; i++) {
                var libItem = libItems[i];
                if (libItem.id == null)
                    libItem.id = "Library Item " + i;
                var li = document.createElement("li");
                li.id = "li_" + libItem.id;
                li.innerHTML = libItem.id;
                li.addEventListener("click", libraryItemClicked);
                list.appendChild(li);
            }
            pg.ui.makeScrollPanel(scrollContainer, {});
            libPath.shift();
            if (libPath.length > 0) {
                var node = libPath.shift();
                showLibraryItem(node);
            }
        }
        function libraryItemClicked(ev) {
            var item = ev.currentTarget;
            var itemId = item.innerHTML;
            showLibraryItem(itemId);
        }
        function showLibraryItem(itemId) {
            if (Library == null)
                return;
            var item = document.getElementById(itemId);
            if (item == null)
                return;
            while (PreviewPane.lastChild != null) {
                PreviewPane.removeChild(PreviewPane.lastChild);
            }
            var cloned = item.cloneNode(true);
            PreviewPane.appendChild(cloned);
            if (CurrentlySelected) {
                var prevLI = document.getElementById("li_" + CurrentlySelected);
                prevLI.classList.remove("librarySelected");
            }
            CurrentlySelected = itemId;
            var newLI = document.getElementById("li_" + CurrentlySelected);
            newLI.classList.add("librarySelected");
            history.pushState(null, "Library", "#library/" + itemId);
        }
        function getItem(itemId) {
            var item = document.getElementById(itemId);
            if (item == null)
                return;
            return item.cloneNode(true);
        }
        library.getItem = getItem;
        initLibrary();
    })(library = pg.library || (pg.library = {}));
})(pg || (pg = {}));


text:
/**
* Column choise control for instant report.
*/
(function () {
  'use strict';

  // implementation
  function izendaInstantReportColumnSettings($izendaUrl) {
    return {
      restrict: 'A',
      scope: {
        name: '@',
        tables: '=',
        selectedColumn: '='
      },
      templateUrl: $izendaUrl.urlSettings.urlResources + '/components/instant-report/templates/instant-report-column-settings.html',
      link: function ($scope, elem, attrs) {

      }
    };
  };

  // definition
  angular
    .module('izendaInstantReport')
    .directive('izendaInstantReportColumnSettings', [
      '$izendaUrl',
      izendaInstantReportColumnSettings
    ]);
})();


text:
const randomString = require(`randomstring`);
const chai = require(`chai`);
const assert = chai.assert;
const config = require('../config');
const DeviceHive = require('../../../index');
const Device = DeviceHive.models.Device;
const Notification = DeviceHive.models.Notification;
const NotificationListQuery = DeviceHive.models.query.NotificationListQuery;
const NotificationPollQuery = DeviceHive.models.query.NotificationPollQuery;
const NotificationPollManyQuery = DeviceHive.models.query.NotificationPollManyQuery;

const httpDeviceHive = new DeviceHive(config.server.http);
const wsDeviceHive = new DeviceHive(config.server.ws);

const TIMESTAMP = new Date().toISOString();
const DH_NOTIFICATIONS_TEST_DEVICE = {
    id: randomString.generate(),
    name: `DH_COMMANDS_TEST_DEVICE`,
    networkId: 1,
    deviceTypeId: 1,
    isBlocked: false,
    data: {}
};
const TEST_DEVICE_NOTIFICATIONS = {
    HTTP: {
        deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id,
        notification: `notification-${randomString.generate()}`,
        timestamp: TIMESTAMP,
        parameters: {
            jsonString: 'jsonString'
        }
    },
    WS: {
        deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id,
        notification: `notification-${randomString.generate()}`,
        timestamp: TIMESTAMP,
        parameters: {
            jsonString: 'jsonString'
        }
    }
};

describe('NotificationAPI', () => {

    before(done => {
        Promise.all([httpDeviceHive.connect(), wsDeviceHive.connect()])
            .then(() => httpDeviceHive.device.add(new Device(DH_NOTIFICATIONS_TEST_DEVICE)))
            .then(() => done())
            .catch(done);
    });

    it(`should insert new notification with name ${TEST_DEVICE_NOTIFICATIONS.HTTP.notification} via HTTP`, done => {
        const notificationModel = new Notification(TEST_DEVICE_NOTIFICATIONS.HTTP);

        httpDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, notificationModel)
            .then((notification) => {
                TEST_DEVICE_NOTIFICATIONS.HTTP.id = notification.id;

                done();
            })
            .catch(done);
    });

    it(`should insert new notification with name ${TEST_DEVICE_NOTIFICATIONS.WS.notification} via WS`, done => {
        const notificationModel = new Notification(TEST_DEVICE_NOTIFICATIONS.WS);

        wsDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, notificationModel)
            .then((notification) => {
                TEST_DEVICE_NOTIFICATIONS.WS.id = notification.id;

                done();
            })
            .catch(done);
    });

    it(`should list all notifications for device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via HTTP`, done => {
        const notificationListQuery = new NotificationListQuery({
            deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id,
            notification: TEST_DEVICE_NOTIFICATIONS.HTTP.notification
        });

        setTimeout(() => {
            httpDeviceHive.notification.list(notificationListQuery)
                .then(notifications => {
                    assert.equal(notifications[0].notification, TEST_DEVICE_NOTIFICATIONS.HTTP.notification);
                })
                .then(() => done())
                .catch(done);
        }, 200);
    });

    it(`should list all notifications for device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via WS`, done => {
        const notificationListQuery = new NotificationListQuery({
            deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id,
            notification: TEST_DEVICE_NOTIFICATIONS.WS.notification
        });

        setTimeout(() => {
            wsDeviceHive.notification.list(notificationListQuery)
                .then(notifications => {
                    assert.equal(notifications[0].notification, TEST_DEVICE_NOTIFICATIONS.WS.notification);
                })
                .then(() => done())
                .catch(done);
        }, 200);
    });

    it(`should get notification with id ${TEST_DEVICE_NOTIFICATIONS.HTTP.id} for device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via HTTP`, done => {
        httpDeviceHive.notification.get(DH_NOTIFICATIONS_TEST_DEVICE.id, TEST_DEVICE_NOTIFICATIONS.HTTP.id)
            .then(notification => {
                assert.equal(notification.id, TEST_DEVICE_NOTIFICATIONS.HTTP.id);
            })
            .then(() => done())
            .catch(done);
    });

    it(`should get notification with id ${TEST_DEVICE_NOTIFICATIONS.WS.id} for device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via WS`, done => {
        wsDeviceHive.notification.get(DH_NOTIFICATIONS_TEST_DEVICE.id, TEST_DEVICE_NOTIFICATIONS.WS.id)
            .then(command => {
                assert.equal(command.id, TEST_DEVICE_NOTIFICATIONS.WS.id);
            })
            .then(() => done())
            .catch(done);
    });

    it(`should poll new notification for device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via HTTP`, done => {
        const notificationPollQuery = new NotificationPollQuery({
            deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id,
            waitTimeout: 1
        });

        httpDeviceHive.notification.poll(notificationPollQuery)
            .then((notifications) => {
                assert.equal(notifications.length, 1);
                assert.equal(notifications[0].notification, TEST_DEVICE_NOTIFICATIONS.HTTP.notification);

                TEST_DEVICE_NOTIFICATIONS.HTTP.id = notifications[0].id;
                done();
            })
            .catch(done);

        setTimeout(() => {
            TEST_DEVICE_NOTIFICATIONS.HTTP.notification = `notification-${randomString.generate()}`;
            httpDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, new Notification(TEST_DEVICE_NOTIFICATIONS.HTTP));
        }, 100);
    });

    it(`should poll new notification for network with id ${DH_NOTIFICATIONS_TEST_DEVICE.networkId} via HTTP`, done => {
        const notificationPollManyQuery = new NotificationPollManyQuery({
            networkIds: [ DH_NOTIFICATIONS_TEST_DEVICE.networkId ],
            waitTimeout: 1
        });

        httpDeviceHive.notification.pollMany(notificationPollManyQuery)
            .then((notifications) => {
                assert.equal(notifications.length, 1);
                assert.equal(notifications[0].notification, TEST_DEVICE_NOTIFICATIONS.HTTP.notification);

                done();
            })
            .catch(done);

        setTimeout(() => {
            TEST_DEVICE_NOTIFICATIONS.HTTP.notification = `notification-${randomString.generate()}`;
            httpDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, new Notification(TEST_DEVICE_NOTIFICATIONS.HTTP));
        }, 100);
    });

    it(`should subscribe for notification insertion notifications on device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via HTTP`, done => {
        const notificationPollQuery = new NotificationPollQuery({ deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id });
        let subscriptionId;

        httpDeviceHive.notification.subscribe(notificationPollQuery)
            .then((response) => {
                subscriptionId = response.subscriptionId;

                httpDeviceHive.on(`message`, (command) => {
                    assert.equal(command.notification, TEST_DEVICE_NOTIFICATIONS.HTTP.notification);
                    httpDeviceHive.notification.unsubscribe(subscriptionId)
                        .then(() => done())
                        .catch(done);
                });

                setTimeout(() => {
                    TEST_DEVICE_NOTIFICATIONS.HTTP.notification = `command-${randomString.generate()}`;
                    httpDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, new Notification(TEST_DEVICE_NOTIFICATIONS.HTTP));
                }, 100);
            })
            .catch(done);
    });

    it(`should subscribe for notification insertion notifications on device with id ${DH_NOTIFICATIONS_TEST_DEVICE.id} via WS`, done => {
        const notificationPollQuery = new NotificationPollQuery({ deviceId: DH_NOTIFICATIONS_TEST_DEVICE.id });
        let subscriptionId;

        wsDeviceHive.notification.subscribe(notificationPollQuery)
            .then((response) => {
                subscriptionId = response.subscriptionId;

                setTimeout(() => {
                    wsDeviceHive.on(`message`, (command) => {
                        assert.equal(command.notification, TEST_DEVICE_NOTIFICATIONS.WS.notification);
                        wsDeviceHive.notification.unsubscribe(subscriptionId)
                            .then(() => done())
                            .catch(done);
                    });
                }, 200);

                setTimeout(() => {
                    TEST_DEVICE_NOTIFICATIONS.WS.notification = `command-${randomString.generate()}`;
                    wsDeviceHive.notification.insert(DH_NOTIFICATIONS_TEST_DEVICE.id, new Notification(TEST_DEVICE_NOTIFICATIONS.WS));
                }, 300);
            })
            .catch(done);
    });

    after(done => {
        httpDeviceHive.device.delete(DH_NOTIFICATIONS_TEST_DEVICE.id)
            .then(() => {
                httpDeviceHive.disconnect();
                wsDeviceHive.disconnect();

                done();
            });
    });
});


text:
.class public Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;
.super Ljava/lang/Object;
.source "SemVirtualSpaceScreen.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$1;,
        Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;,
        Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;
    }
.end annotation

# static fields
.field public static final FLAG_CLEAR_MAIN_DISPLAY:I = 0x20

.field public static final FLAG_ENABLE_HW_COMPOSITION:I = 0x40

.field public static final FLAG_REDIRECT_MAIN_DISPLAY:I = 0x10

.field public static final PRIORITY_HIGH:I = 0x5a

.field public static final PRIORITY_LOW:I = 0x0

.field public static final PRIORITY_MAX:I = 0x64

.field public static final PRIORITY_NORMAL:I = 0x32

# instance fields
.field private final mCallbackProxy:Lcom/samsung/android/virtualspace/IVSScreenCallback$Stub;

.field private mClosed:Z

.field private mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

.field private mOnReadySent:Z

.field private final mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

.field private mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

# direct methods
.method static synthetic -get0(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;)Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    return-object v0
.end method

.method static synthetic -get1(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;)Z
    .locals 1

    iget-boolean v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mOnReadySent:Z

    return v0
.end method

.method static synthetic -get2(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;)Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    return-object v0
.end method

.method static synthetic -set0(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;Z)Z
    .locals 0

    iput-boolean p1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mClosed:Z

    return p1
.end method

.method static synthetic -set1(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;Z)Z
    .locals 0

    iput-boolean p1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mOnReadySent:Z

    return p1
.end method

.method constructor <init>(Lcom/samsung/android/virtualspace/SemVirtualSpaceSession;Lcom/samsung/android/virtualspace/IVSScreen;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$1;

    invoke-direct {v1, p0}, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$1;-><init>(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;)V

    iput-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mCallbackProxy:Lcom/samsung/android/virtualspace/IVSScreenCallback$Stub;

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "SemVirtualSpaceScreen()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    iput-object p2, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    iget-object v2, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mCallbackProxy:Lcom/samsung/android/virtualspace/IVSScreenCallback$Stub;

    invoke-interface {v1, v2}, Lcom/samsung/android/virtualspace/IVSScreen;->registerCallback(Lcom/samsung/android/virtualspace/IVSScreenCallback;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "registerCallback failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

# virtual methods
.method public clear()V
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "clear()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->clear()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public clearFocus()V
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "grabFocus()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->releaseFocus()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public close()V
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "screen close()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->close()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public dispatchInputEvent(Landroid/view/InputEvent;)Z
    .locals 3

    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1}, Lcom/samsung/android/virtualspace/IVSScreen;->dispatchInputEvent(Landroid/view/InputEvent;)Z
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, 0x0

    return v1
.end method

.method public getAppOrientation()I
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "getAppOrientation()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->getAppOrientation()I
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, -0x1

    return v1
.end method

.method public getBounds()Landroid/graphics/Rect;
    .locals 4

    sget-boolean v2, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v2, :cond_0

    const-string/jumbo v2, "SemVirtualSpace"

    const-string/jumbo v3, "getBounds()"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    :try_start_0
    iget-object v2, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v2, v0}, Lcom/samsung/android/virtualspace/IVSScreen;->getBounds(Landroid/graphics/Rect;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-object v0

    :catch_0
    move-exception v1

    const-string/jumbo v2, "SemVirtualSpace"

    const-string/jumbo v3, "Call failed with"

    invoke-static {v2, v3, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public getOrientation()I
    .locals 3

    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->getOrientation()I
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, 0x0

    return v1
.end method

.method public getPriority()I
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "getPriority()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->getPriority()I
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, -0x1

    return v1
.end method

.method public getRotation()I
    .locals 3

    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->getRotation()I
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, 0x0

    return v1
.end method

.method public getSize()Landroid/graphics/Point;
    .locals 4

    new-instance v1, Landroid/graphics/Point;

    invoke-direct {v1}, Landroid/graphics/Point;-><init>()V

    :try_start_0
    iget-object v2, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v2, v1}, Lcom/samsung/android/virtualspace/IVSScreen;->getSize(Landroid/graphics/Point;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-object v1

    :catch_0
    move-exception v0

    const-string/jumbo v2, "SemVirtualSpace"

    const-string/jumbo v3, "Call failed with"

    invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public launchActivity(Landroid/content/Intent;)Z
    .locals 4

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "launchActivity() "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1}, Lcom/samsung/android/virtualspace/IVSScreen;->launchActivity(Landroid/content/Intent;)Z
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    return v1

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, 0x0

    return v1
.end method

.method public redirectIME(Z)V
    .locals 1

    const/16 v0, 0x7db

    invoke-virtual {p0, v0, p1}, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->redirectSystemWindows(IZ)V

    return-void
.end method

.method public redirectSystemWindows(IZ)V
    .locals 4

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "redirectSystemWindows("

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ", "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1, p2}, Lcom/samsung/android/virtualspace/IVSScreen;->redirectSystemWindows(IZ)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public registerEventListener(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;)V
    .locals 3

    sget-boolean v0, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string/jumbo v0, "SemVirtualSpace"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "registerEventListener("

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ")"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    if-eqz p1, :cond_1

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    if-eq v0, p1, :cond_2

    :cond_1
    new-instance v0, Ljava/lang/IllegalArgumentException;

    invoke-direct {v0}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v0

    :cond_2
    iput-object p1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    return-void
.end method

.method public registerStateListener(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;)V
    .locals 4

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "registerStateListener("

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    if-eqz p1, :cond_1

    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    if-eqz v1, :cond_2

    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    if-eq v1, p1, :cond_2

    :cond_1
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v1

    :cond_2
    iget-boolean v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mClosed:Z

    if-eqz v1, :cond_3

    invoke-interface {p1, p0}, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;->onClosed(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;)V

    return-void

    :cond_3
    iput-object p1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mOnReadySent:Z

    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->resendState()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public requestFocus()V
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "takeFocus()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1}, Lcom/samsung/android/virtualspace/IVSScreen;->takeFocus()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public setPriority(I)V
    .locals 4

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "setPriority("

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    if-ltz p1, :cond_1

    const/16 v1, 0x64

    if-le p1, v1, :cond_2

    :cond_1
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v1

    :cond_2
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1}, Lcom/samsung/android/virtualspace/IVSScreen;->setPriority(I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public setRotation(I)V
    .locals 4

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "setRotation("

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    packed-switch p1, :pswitch_data_0

    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v1

    :pswitch_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1}, Lcom/samsung/android/virtualspace/IVSScreen;->setRotation(I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
    .end packed-switch
.end method

.method public setSurface(Landroid/view/Surface;)V
    .locals 3

    sget-boolean v1, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v1, :cond_0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "setSurface()"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mScreen:Lcom/samsung/android/virtualspace/IVSScreen;

    invoke-interface {v1, p1}, Lcom/samsung/android/virtualspace/IVSScreen;->setSurface(Landroid/view/Surface;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v1, "SemVirtualSpace"

    const-string/jumbo v2, "Call failed with"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public unregisterEventListener(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;)V
    .locals 4

    const/4 v3, 0x0

    sget-boolean v0, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string/jumbo v0, "SemVirtualSpace"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "unregisterEventListener("

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ")"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    if-eqz p1, :cond_1

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    if-eq v0, p1, :cond_2

    :cond_1
    new-instance v0, Ljava/lang/IllegalArgumentException;

    invoke-direct {v0}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v0

    :cond_2
    iput-object v3, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mEventListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$EventListener;

    return-void
.end method

.method public unregisterStateListener(Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;)V
    .locals 4

    const/4 v3, 0x0

    sget-boolean v0, Lcom/samsung/android/virtualspace/SemVirtualSpaceManager;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string/jumbo v0, "SemVirtualSpace"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "unregisterStateListener("

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ")"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    if-eqz p1, :cond_1

    iget-object v0, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    if-eq v0, p1, :cond_2

    :cond_1
    new-instance v0, Ljava/lang/IllegalArgumentException;

    invoke-direct {v0}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v0

    :cond_2
    iput-object v3, p0, Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen;->mStateListener:Lcom/samsung/android/virtualspace/SemVirtualSpaceScreen$StateListener;

    return-void
.end method


text:
package io.strimzi.kafka.bridge.utils;

public class Urls {

    private static final String SCHEME = "http://";
    public static final String BRIDGE_HOST = "127.0.0.1";
    public static final int BRIDGE_PORT = 8080;
    private static final String BRIDGE_ADDRESS = SCHEME + BRIDGE_HOST + ":" + BRIDGE_PORT;

    private static final String CONSUMERS_PATH = "/consumers/";
    private static final String INSTANCES_PATH =  "/instances/";
    private static final String POSITIONS_BEGGINING_PATH =  "/positions/beginning";
    private static final String POSITIONS_END_PATH =  "/positions/end";
    private static final String POSITIONS_PATH =  "/positions";
    private static final String SUBSCRIPTION_PATH =  "/subscription";
    private static final String TOPICS_PATH = "/topics/";
    private static final String PARTITIONS_PATH = "/partitions/";
    private static final String ASSIGMENTS_PATH = "/assignments";
    private static final String OFFSETS_PATH = "/offsets";
    private static final String RECORDS_PATH = "/records";

    public static String consumer(String groupId) {
        return BRIDGE_ADDRESS + CONSUMERS_PATH + groupId;
    }

    public static String consumerInstance(String groupId, String name) {
        return BRIDGE_ADDRESS + CONSUMERS_PATH + groupId + INSTANCES_PATH + name;
    }

    public static String consumerInstancePositionBeginning(String groupId, String name) {
        return consumerInstance(groupId, name) + POSITIONS_BEGGINING_PATH;
    }

    public static String consumerInstancePositionEnd(String groupId, String name) {
        return consumerInstance(groupId, name) + POSITIONS_END_PATH;
    }

    public static String consumerInstancePosition(String groupId, String name) {
        return consumerInstance(groupId, name) + POSITIONS_PATH;
    }

    public static String consumerInstanceSubscription(String groupId, String name) {
        return consumerInstance(groupId, name) + SUBSCRIPTION_PATH;
    }

    public static String consumerInstanceAssignments(String groupId, String name) {
        return consumerInstance(groupId, name) + ASSIGMENTS_PATH;
    }

    public static String consumerInstanceOffsets(String groupId, String name) {
        return consumerInstance(groupId, name) + OFFSETS_PATH;
    }

    public static String consumerInstanceRecords(String groupId, String name, Integer timeout, Integer maxBytes) {
        return consumerInstance(groupId, name) + RECORDS_PATH
                + "?"
                + (timeout != null ? "timeout=" + timeout : "")
                + (timeout != null && maxBytes != null ? "&" : "")
                + (maxBytes != null  ? "max_bytes=" + maxBytes : "");
    }

    public static String consumerInstanceRecords(String groupId, String name) {
        return consumerInstance(groupId, name) + RECORDS_PATH;
    }

    public static String producerTopic(String topic) {
        return BRIDGE_ADDRESS + TOPICS_PATH + topic;
    }

    public static String producerTopicPartition(String topic, Object partitions) {
        return BRIDGE_ADDRESS + TOPICS_PATH + topic + PARTITIONS_PATH + partitions;
    }

}


text:
const {Action, api} = require('actionhero');
const dal = require('@dal');
const convertible = require('@lib/convertible');
const path = require('path');
const etl = require('@lib/etl');
const mcdir = require('@lib/mcdir');

// module.exports.TestETLTaskAction = class TestETLTaskAction extends Action {
//     constructor() {
//         super();
//         this.name = 'testETLTask';
//         this.description = 'test that etl tasks are working';
//         this.inputs = {};
//         this.do_not_authenticate = true;
//     }
//
//     async run({response}) {
//         await api.tasks.enqueue('testETLTask', {}, 'etl');
//         response.data = {success: 'Enqueued'};
//     }
// };

module.exports.CreateExperimentFromSpreadsheetV2Action = class CreateExperimentFromSpreadsheetV2Action extends Action {
    constructor() {
        super();
        this.name = 'createExperimentFromSpreadsheet';
        this.description = 'Create an experiment from a spreadsheet running mcetl';
        this.version = 2;
        this.inputs = {
            project_id: {
                required: true,
            },

            file_id: {
                required: true,
            },

            has_parent: {
                default: false,
            },

            experiment_name: {
                required: true,
                validator: name => {
                    if (name === '') {
                        throw new Error(`experiment_name cannot be blank`);
                    }

                    if (name.match(/[^0-9a-zA-Z_\-\s]/)) {
                        // A match means it found characters that are not in the list above
                        throw new Error(`Invalid experiment name, only a-zA-Z0-9_- are allowed`);
                    }
                }
            }
        };
    }

    async run({response, params, user}) {
        if (!await api.mc.check.fileInProject(params.file_id, params.project_id)) {
            throw new Error(`File ${params.file_id} not in project ${params.project_id}`);
        }

        if (!await api.mc.check.experimentNameIsUniqueInProject(params.experiment_name, params.project_id)) {
            throw new Error(`Experiment name ${params.experiment_name} is not unique in project ${params.project_id}`);
        }

        let file = await dal.tryCatch(async() => await api.mc.files.getFile(params.file_id));
        if (!file) {
            throw new Error(`Internal error: unable to retrieve file ${params.file_id}`);
        }

        if (!convertible.isSpreadsheet(file.mediatype.mime)) {
            throw new Error(`File ${file.name} is not a spreadsheet: ${file.mediatype.mime}`);
        }

        let etlJob = {
            projectId: params.project_id,
            experimentName: params.experiment_name,
            file: file,
            apikey: user.apikey,
            hasParent: params.has_parent,
        };

        await api.tasks.enqueue('mcetl', etlJob, 'etl');

        response.data = {success: `Successfully enqueued ETL V2 job for ${file.name}`};
    }
};

module.exports.CreateExperimentFromSpreadsheetV1Action = class CreateExperimentFromSpreadsheetV1Action extends Action {
    constructor() {
        super();
        this.name = 'createExperimentFromSpreadsheet';
        this.description = 'Create an experiment from a spreadsheet running pymcetl';
        this.version = 1;
        this.inputs = {
            project_id: {
                required: true,
            },

            experiment_name: {
                required: true,
            },

            file_id: {
                required: true,
            }
        };
    }

    async run({response, params, user}) {
        if (!await api.mc.check.fileInProject(params.file_id, params.project_id)) {
            throw new Error(`File ${params.file_id} not in project ${params.project_id}`);
        }

        let file = await dal.tryCatch(async() => await api.mc.files.getFile(params.file_id));
        if (!file) {
            throw new Error(`Internal error: unable to retrieve file ${params.file_id}`);
        }

        if (!convertible.isSpreadsheet(file.mediatype.mime)) {
            throw new Error(`File ${file.name} is not a spreadsheet: ${file.mediatype.mime}`);
        }

        // Remove project name from directory path
        let filePath = path.join(file.directory.name, file.name);
        let slash = filePath.indexOf('/');
        filePath = filePath.substring(slash, filePath.length);

        let etlJob = {
            projectId: params.project_id,
            experimentName: params.experiment_name,
            path: filePath,
            apikey: user.apikey,
        };

        await api.tasks.enqueue('processSpreadsheet', etlJob, 'etl');

        response.data = {success: `Successfully enqueued ETL V1 job for ${filePath}`};
    }
};

module.exports.CheckSpreadsheetAction = class CheckSpreadsheetAction extends Action {
    constructor() {
        super();
        this.name = 'checkSpreadsheet';
        this.description = 'Validate a spreadsheet for ETL';
        this.inputs = {
            project_id: {
                required: true,
            },

            file_id: {
                required: true,
            },

            experiment_name: {
                required: true,
            },

            has_parent: {
                default: false,
            }
        };
    }

    async run({response, params, user}) {
        if (!await api.mc.check.fileInProject(params.file_id, params.project_id)) {
            throw new Error(`File ${params.file_id} not in project ${params.project_id}`);
        }

        if (!await api.mc.check.experimentNameIsUniqueInProject(params.experiment_name, params.project_id)) {
            throw new Error(`Experiment name ${params.experiment_name} is not unique in project ${params.project_id}`);
        }

        let file = await dal.tryCatch(async() => await api.mc.files.getFile(params.file_id));
        if (!file) {
            throw new Error(`Internal error: unable to retrieve file ${params.file_id}`);
        }

        let filePath = mcdir.pathToFileId(mcdir.idToUse(file));

        response.data = await etl.checkSpreadsheet(filePath, params.has_parent, params.project_id, user.apikey);
    }
};

module.exports.UpdateExperimentProgressStatusAction = class UpdateExperimentProgressStatusAction extends Action {
    constructor() {
        super();
        this.name = 'updateExperimentProgressStatus';
        this.description = 'Updates the in_progress flag';
        this.inputs = {
            project_id: {
                required: true,
            },

            experiment_id: {
                required: true,
            },

            in_progress: {
                required: true,
            }
        };
    }

    async run({response, params}) {
        const {project_id, experiment_id, in_progress} = params;

        if (!await api.mc.check.experimentInProject(experiment_id, project_id)) {
            throw new Error(`Experiment ${experiment_id} is not in project ${project_id}`);
        }

        let status = await dal.tryCatch(async() => await api.mc.experiments.updateInProgress(experiment_id, in_progress));
        if (!status) {
            throw new Error(`Unable to update in progress status for experiment ${experiment_id}`);
        }

        response.data = {success: true};
    }
};

module.exports.CreateExperimentInProjectAction = class CreateExperimentInProjectAction extends Action {
    constructor() {
        super();
        this.name = 'createExperimentInProject';
        this.description = 'Creates a new experiment in the given project';
        this.inputs = {
            project_id: {
                required: true,
            },

            name: {
                required: true,
            },

            description: {
                default: ''
            },

            in_progress: {
                default: false,
            }
        };
    }

    async run({response, params, user}) {
        if (!await api.mc.check.experimentNameIsUniqueInProject(params.name, params.project_id)) {
            throw new Error(`Experiment name ${params.name} is not unique in project ${params.project_id}`);
        }

        let e = await dal.tryCatch(async() => await api.mc.experiments.createExperiment(params.name, params.description, user.id, params.project_id, params.in_progress));
        if (!e) {
            throw new Error(`Unable to create experiment ${params.name} in project ${params.project_id}`);
        }

        response.data = e;
    }
};

module.exports.GetExperimentAction = class GetExperimentAction extends Action {
    constructor() {
        super();
        this.name = 'getExperiment';
        this.description = 'Returns the given experiment in the given project';
        this.inputs = {
            project_id: {
                required: true,
            },

            experiment_id: {
                required: true,
            }
        };
    }

    async run({response, params}) {
        let e = await dal.tryCatch(async() => await api.mc.experiments.getExperiment(params.experiment_id));
        if (!e) {
            throw new Error(`Unable to retrieve experiment ${params.experiment_id} in project ${params.project_id}`);
        }

        response.data = e;
    }
};

module.exports.RenameExperimentInProjectAction = class RenameExperimentInProjectAction extends Action {
    constructor() {
        super();
        this.name = 'renameExperimentInProject';
        this.description = 'Renames the experiment';
        this.inputs = {
            project_id: {
                required: true
            },

            experiment_id: {
                required: true,
            },

            name: {
                required: true,
                validator: name => {
                    if (name.match(/[^0-9a-zA-Z_\-\s]/)) {
                        // A match means it found characters that are not in the list above
                        throw new Error(`Invalid experiment name, only a-zA-Z0-9_- are allowed`);
                    }
                }
            }
        };
    }

    async run({response, params}) {
        if (!await api.mc.check.experimentNameIsUniqueInProject(params.name, params.project_id)) {
            throw new Error(`Name ${params.name} is not unique in project ${params.project_id}`);
        }

        let renamed = await dal.tryCatch(async() => await api.mc.experiments.renameExperiment(params.experiment_id, params.name));
        if (!renamed) {
            throw new Error(`Unable to rename experiment ${params.experiment_id} to ${params.name}`);
        }

        let e = await dal.tryCatch(async() => await api.mc.experiment.getExperiment(params.experiment_id));
        if (!e) {
            throw new Error(`Unable to retrieve updated experiment ${params.experiment_id}`);
        }

        response.data = e;
    }
};

module.exports.DeleteExperimentInProjectAction = class DeleteExperimentInProjectAction extends Action {
    constructor() {
        super();
        this.name = 'deleteExperimentInProject';
        this.description = 'Delete an experiment in a project';
        this.inputs = {
            project_id: {
                required: true,
            },

            experiment_id: {
                required: true,
            }
        };
    }

    async run({response, params, user}) {
        const {experiment_id, project_id} = params;

        if (!await api.mc.check.experimentInProject(experiment_id, project_id)) {
            throw new Error(`Experiment ${experiment_id} is not in project ${project_id}`);
        }

        let p = await api.mc.projects.getProjectSimple(project_id);
        let e = await api.mc.experiments.getExperimentSimple(experiment_id);

        if (p.owner !== user.id) {
            if (e.owner !== user.owner) {
                throw new Error(`You do not have permission to delete experiment ${experiment_id}`);
            }
        }

        let status = await dal.tryCatch(async() => await api.mc.experiments.addExperimentToDeleteItems(experiment_id, project_id));
        if (!status) {
            throw new Error(`Unable to delete experiment ${experiment_id} in project ${project_id}`);
        }

        status = await dal.tryCatch(async() => await api.mc.experiments.removeExperimentFromJoinTables(experiment_id, project_id));
        if (!status) {
            throw new Error(`Unable to delete experiment ${experiment_id} in project ${project_id}`);
        }

        response.data = {success: true};
    }
};


text:
A ROSMOD package contains the definitions for its associated `Messages` and `Services`, which follow the [ROS](http://www.ros.org) definitions, as well as the definitions for ROSMOD `Components`.

**Note**: a `Package` must have a valid `c++` name, of the form: `[a-zA-Z_][a-zA-Z0-9_]+`, e.g. `package_1`, `Package2`, etc.

Contains:
1. Components
2. Messages
3. Services
4. Documentation

## Documentation Style Guide

For a package-level documentation block use the following headers in order to generate consistent and flowing documentation.

```no-highlight
# [Package Name]
## Overview
## Libraries
```


text:
require File.join(File.dirname(__FILE__), 'node')

module Cisco
  # NodeUtil - generic functionality for node utility subclasses to use
  class NodeUtil
    # rubocop:disable Style/ClassVars
    # We want this to be inherited to all child classes, it's a singleton.
    @@node = Cisco::Node.instance
    # rubocop:enable Style/ClassVars

    def self.node
      @@node
    end

    def node
      self.class.node
    end

    def self.config_get(*args)
      @@node.config_get(*args)
    end

    def config_get(*args)
      node.config_get(*args)
    end

    def self.config_get_default(*args)
      @@node.config_get_default(*args)
    end

    def config_get_default(*args)
      node.config_get_default(*args)
    end

    def self.config_set(*args)
      @@node.config_set(*args)
    end

    def config_set(*args)
      node.config_set(*args)
    end
  end
end


text:
package org.locationtech.geomesa.utils.geometry

import com.vividsolutions.jts.geom.Polygon
import org.geotools.geometry.jts.JTS

@deprecated
object Geometry {

  @deprecated
  val noPolygon : Polygon  = null

  @deprecated
  implicit class RichPolygon(self: Polygon) {
    def getSafeUnion(other: Polygon): Polygon = {
      if (self != noPolygon && other != noPolygon) {
        if (self.overlaps(other)) {
          val p = self.union(other)
          p.normalize()
          p.asInstanceOf[Polygon]
        } else {
          // they don't overlap; take the merge of their envelopes
          // (since we don't support MultiPolygon returns yet)
          val env = self.getEnvelopeInternal
          env.expandToInclude(other.getEnvelopeInternal)
          JTS.toGeometry(env)
        }
      } else noPolygon
    }

    def getSafeIntersection(other: Polygon): Polygon =
      if (self == noPolygon) other
      else if (other == noPolygon) self
      else if (self.intersects(other)) {
        val p = self.intersection(other)
        p.normalize()
        p match {
          case poly: Polygon => poly
          case _ => noPolygon
        }
      } else noPolygon
  }
}


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

<TITLE>
com.sun.speech.engine Class Hierarchy (FreeTTS 1.2)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Hierarchy For Package com.sun.speech.engine

Package Hierarchies:
All Packages

Class Hierarchy

class java.lang.Object

class com.sun.speech.engine.BaseAudioManager (implements javax.speech.AudioManager)

class com.sun.speech.engine.BaseEngine (implements javax.speech.Engine, com.sun.speech.engine.SpeechEventDispatcher)

class com.sun.speech.engine.BaseEngineProperties (implements javax.speech.EngineProperties, com.sun.speech.engine.SpeechEventDispatcher)

class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable)

class java.awt.Container

class javax.swing.JComponent (implements java.io.Serializable)

class javax.swing.JPanel (implements javax.accessibility.Accessible)

class com.sun.speech.engine.EngineEventPanel

class com.sun.speech.engine.SpeechEventUtilities.SpeechAWTEventTarget

class com.sun.speech.engine.EngineMonitor
class com.sun.speech.engine.EngineMonitor.EngineMonitorEngineListener (implements javax.speech.EngineListener)

class java.util.EventObject (implements java.io.Serializable)

class java.awt.AWTEvent

class com.sun.speech.engine.SpeechEventUtilities.SpeechAWTEvent

class javax.speech.SpeechEvent

class com.sun.speech.engine.SpeechEventWrapper

class com.sun.speech.engine.SpeechEventUtilities

Interface Hierarchy

interface com.sun.speech.engine.SpeechEventDispatcher

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
The "demo_script.ps1" file in this directory walks through a
demonstration of basic interoperation between PowerShell and Python
including how to use JSON to exchange structured objects between
Python and PowerShell.

The other files in this directory are referenced by demo_script.ps1.


text:
package com.github.cxfplus.com.sun.xml.bind.v2.runtime.unmarshaller;

import javax.activation.DataHandler;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
import javax.xml.namespace.NamespaceContext;

import com.github.cxfplus.com.sun.xml.bind.v2.WellKnownNamespace;

import org.xml.sax.SAXException;

/**
 * Decorator of {@link XmlVisitor} that performs XOP processing.
 * Used to support MTOM.
 *
 * @author Kohsuke Kawaguchi
 */
final class MTOMDecorator implements XmlVisitor {

    private final XmlVisitor next;

    private final AttachmentUnmarshaller au;

    private UnmarshallerImpl parent;

    private final Base64Data base64data = new Base64Data();

    /**
     * True if we are between the start and the end of xop:Include
     */
    private boolean inXopInclude;

    /**
     * UGLY HACK: we need to ignore the whitespace that follows
     * the attached base64 image.
     *
     * This happens twice; once before </xop:Include>, another
     * after </xop:Include>. The spec guarantees that
     * no valid pcdata can follow </xop:Include>.
     */
    private boolean followXop;

    public MTOMDecorator(UnmarshallerImpl parent,XmlVisitor next, AttachmentUnmarshaller au) {
        this.parent = parent;
        this.next = next;
        this.au = au;
    }

    public void startDocument(LocatorEx loc, NamespaceContext nsContext) throws SAXException {
        next.startDocument(loc,nsContext);
    }

    public void endDocument() throws SAXException {
        next.endDocument();
    }

    public void startElement(TagName tagName) throws SAXException {
        if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) {
            // found xop:Include
            String href = tagName.atts.getValue("href");
            DataHandler attachment = au.getAttachmentAsDataHandler(href);
            if(attachment==null) {
                // report an error and ignore
                parent.getEventHandler().handleEvent(null);
                // TODO
            }
            base64data.set(attachment);
            next.text(base64data);
            inXopInclude = true;
            followXop = true;
        } else
            next.startElement(tagName);
    }

    public void endElement(TagName tagName) throws SAXException {
        if(inXopInclude) {
            // consume </xop:Include> by ourselves.
            inXopInclude = false;
            followXop = true;
            return;
        }
        next.endElement(tagName);
    }

    public void startPrefixMapping(String prefix, String nsUri) throws SAXException {
        next.startPrefixMapping(prefix,nsUri);
    }

    public void endPrefixMapping(String prefix) throws SAXException {
        next.endPrefixMapping(prefix);
    }

    public void text( CharSequence pcdata ) throws SAXException {
        if(!followXop)
            next.text(pcdata);
        else
            followXop = false;
    }

    public UnmarshallingContext getContext() {
        return next.getContext();
    }

    public TextPredictor getPredictor() {
        return next.getPredictor();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>HBase 0.98.7-hadoop2 Reference Package org.apache.hadoop.hbase.errorhandling</title>
		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />

        	org.apache.hadoop.hbase.errorhandling

Classes

            	TestForeignExceptionDispatcher

            	TestForeignExceptionSerialization

            	TestTimeoutExceptionInjector


text:
import { Injectable }             from '@angular/core';
import { Router,
         ActivatedRouteSnapshot,
         RouterStateSnapshot }    from '@angular/router';
import { CanActivate }            from '@angular/router';
import { Auth }                   from './services/auth.service';

@Injectable()
export class AuthGuard implements CanActivate {

	constructor(private auth: Auth, private router: Router) {

	}

	canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    	if(this.auth.authenticated()) {
      		console.log('AUTH GUARD PASSED');
      		return true;
    	}
    	else {
      		console.log('BLOCKED BY AUTH GUARD');
      		this.router.navigate(['/']);
      		return false;
    	}
  	}
}


text:
import webapp2

from main import IndexHandler, MainHandler
from profile.handlers import ProfileHandler, UploadHandler, ServeHandler

application = webapp2.WSGIApplication([
	('/', ProfileHandler),
	('/register', IndexHandler),
	('/main', MainHandler),
	('/upload', UploadHandler),
	('/serve/([^/]+)?', ServeHandler),
], debug=True)


text:
CTL="${BASEURL}index.php?/module/fonts/"

# Get the scripts in the proper directories
"${CURL[@]}" "${CTL}get_script/fonts.py" -o "${MUNKIPATH}preflight.d/fonts.py"

# Check exit status of curl
if [ $? = 0 ]; then
	# Make executable
	chmod a+x "${MUNKIPATH}preflight.d/fonts.py"

	# Set preference to include this file in the preflight check
	setreportpref "fonts" "${CACHEPATH}fonts.plist"

else
	echo "Failed to download all required components!"
	rm -f "${MUNKIPATH}preflight.d/fonts.py"

	# Signal that we had an error
	ERR=1
fi


text:
import isObject from 'isobject';
import isPlainObject from 'is-plain-object';
import itis from './base';
import isDefined from './isDefined';
import isUndefined from './isUndefined';
import isItClass from './isClassOf';
import isWindow from './isWindow';
import isElement from './isElement';
import isDocument from './isDocument';
import isArrayLike from './isArrayLike';

// Number, Function, RegExp, Boolean, Date, Error, Arguments,
// PlainObject, Object, Array, ArrayLike, Element
export default Object.assign( itis, {
  Undefined: isUndefined,
  Defined: isDefined,
  Element: isElement,
  Window: isWindow,
  Document: isDocument,
  PlainObject: isPlainObject,
  Object: isObject,
  ArrayLike: isArrayLike,
  isItClass
});


text:
#ifndef time_internal_h_
#define time_internal_h_

#ifdef mingw_PLATFORM
#include "libltfs/arch/win/win_util.h"
#else
#include <time.h>
typedef int64_t	ltfs_time_t;
struct ltfs_timespec {
	ltfs_time_t	tv_sec;
	long		tv_nsec;
};
#endif

#define LTFS_TIME_T_MAX (253402300799) /* 9999/12/31 23:59:59 UTC */
#define LTFS_TIME_T_MIN (-62167219200) /* 0000/01/01 00:00:00 UTC */
#define LTFS_TIME_OUT_OF_RANGE    (1)  /* Time stamp is out of range */

#define timer_sub(a, b, result) \
  do { \
    (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
    (result)->tv_nsec = (a)->tv_nsec - (b)->tv_nsec; \
    if ((result)->tv_nsec < 0) { \
      --(result)->tv_sec; \
      (result)->tv_nsec += 1000000000; \
    } \
  } while (0)

ltfs_time_t ltfs_timegm(struct tm *t);
struct tm *ltfs_gmtime(const ltfs_time_t *timep, struct tm *result);
struct timespec timespec_from_ltfs_timespec(const struct ltfs_timespec *pSrc);
struct ltfs_timespec ltfs_timespec_from_timespec(const struct timespec *pSrc);

#ifdef __APPLE__
int get_osx_current_timespec(struct ltfs_timespec* now);
#endif

#ifdef __APPLE__
#define _get_current_timespec(timespec) get_osx_current_timespec(timespec)
#define get_localtime(time) localtime(time)
#elif defined(mingw_PLATFORM)
#define _get_current_timespec(timespec) get_win32_current_timespec(timespec)
#define get_localtime(time) get_win32_localtime(time)
#define get_gmtime(time) get_win32_gmtime(time)
#else
int get_unix_current_timespec(struct ltfs_timespec* now);
struct tm *get_unix_localtime(const ltfs_time_t *timep);
#define _get_current_timespec(timespec) get_unix_current_timespec(timespec)
#define get_localtime(time) get_unix_localtime(time);
#endif

static inline int normalize_ltfs_time(ltfs_time_t *t)
{
	int ret = LTFS_TIME_OUT_OF_RANGE;

	if (*t > (ltfs_time_t)LTFS_TIME_T_MAX)
		*t = (ltfs_time_t)LTFS_TIME_T_MAX;
	else if (*t < (ltfs_time_t)LTFS_TIME_T_MIN)
		*t = (ltfs_time_t)LTFS_TIME_T_MIN;
	else
		ret = 0;

	return ret;
}

static inline int get_current_timespec(struct ltfs_timespec* now)
{
	int ret;

	ret = _get_current_timespec(now);
	if (! ret)
		ret = normalize_ltfs_time(&now->tv_sec);

	return ret;
}

#ifndef gmtime_r
#define gmtime_r win_gmtime_r
#endif /* gmtime_r */

#endif /* time_internal_h_ */