text:
This application makes use of the following third party libraries:

## AFNetworking

Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## Aspects

The MIT License (MIT)

Copyright (c) 2014 Peter Steinberger, steipete@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## BlocksKit

//
//  LICENSE
//  BlocksKit
//

Copyright (c) 2011-2014 Zachary Waldowski, Alexsander Akers, and the BlocksKit Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## GVUserDefaults

Copyright (c) 2012 Gangverk ehf. http://gangverk.is

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## HYBUnicodeReadable

The MIT License (MIT)

Copyright (c) 2015 JackyHuang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## IQKeyboardManager

IQKeyboardManager license
=========================

The MIT License (MIT)

Copyright (c) 2013-14 Iftekhar Qurashi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## JZNavigationExtension

The MIT License (MIT)

Copyright (c) 2015 Jazys

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## MJExtension

Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## MJRefresh

Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## MMPopupView

The MIT License (MIT)

Copyright (c) 2015 ralph li

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Masonry

Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## NullSafe

NullSafe

Version 1.2.1, September 30th, 2014

Copyright (C) 2012 Charcoal Design

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

## PureLayout

This code is distributed under the terms and conditions of the MIT license.

Copyright (c) 2014-2015 Tyler Fox

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## ReactiveCocoa

**Copyright (c) 2012 - 2015, GitHub, Inc.**
**All rights reserved.**

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## SDCycleScrollView

The MIT License (MIT)

Copyright (c) 2015 GSD_iOS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## SDWebImage

Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## SVProgressHUD

Copyright (c) 2011-2016 Sam Vermette, Tobias Tiemerding and contributors.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

A different license may apply to other resources included in this package,
including Freepik Icons. Please consult their
respective headers for the terms of their individual licenses.

## UITableView+FDTemplateLayoutCell

The MIT License (MIT)

Copyright (c) 2015

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## VGParallaxHeader

The MIT License (MIT)

Copyright (c) 2014 Marek Serafin (VG), VGParallaxHeader Creator

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## XXNibBridge

The MIT License (MIT)

Copyright (c) 2015 sunnyxx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## YYCache

The MIT License (MIT)

Copyright (c) 2015 ibireme <ibireme@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## iConsole

iConsole

version 1.5.2, February 22nd, 2013
Copyright (C) 2010 Charcoal Design

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

--------------

Google GTM library

iConsole has a dependency on parts of the Google GTM library, which is
licensed under the Apache 2.0 licence:

http://www.apache.org/licenses/LICENSE-2.0

If your project does not comply with this licence, you can use iConsole
without the GTM files by settings a configuration constant (read the
Instructions.txt file for more info).
Generated by CocoaPods - http://cocoapods.org


text:
package net.ME1312.SubServers.Bungee.Network.Packet;

import net.ME1312.Galaxi.Library.Map.ObjectMap;
import net.ME1312.Galaxi.Library.Util;
import net.ME1312.SubData.Server.Protocol.PacketObjectIn;
import net.ME1312.SubData.Server.Protocol.PacketObjectOut;
import net.ME1312.SubData.Server.SubDataClient;
import net.ME1312.SubServers.Bungee.Host.Server;
import net.ME1312.SubServers.Bungee.SubProxy;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

/**
 * Download Server Info Packet
 */
public class PacketDownloadServerInfo implements PacketObjectIn<Integer>, PacketObjectOut<Integer> {
    private SubProxy plugin;
    private String[] servers;
    private UUID tracker;

    /**
     * New PacketDownloadServerInfo (In)
     *
     * @param plugin SubPlugin
     */
    public PacketDownloadServerInfo(SubProxy plugin) {
        this.plugin = Util.nullpo(plugin);
    }

    /**
     * New PacketDownloadServerInfo (Out)
     *
     * @param plugin SubPlugin
     * @param servers Servers (or null for all)
     * @param tracker Receiver ID
     */
    public PacketDownloadServerInfo(SubProxy plugin, List<String> servers, UUID tracker) {
        this.plugin = Util.nullpo(plugin);
        this.tracker = tracker;

        if (servers != null) {
            this.servers = new String[servers.size()];
            for (int i = 0; i < this.servers.length; ++i) this.servers[i] = servers.get(i).toLowerCase();
            Arrays.sort(this.servers);
        }
    }

    @Override
    public ObjectMap<Integer> send(SubDataClient client) {
        ObjectMap<Integer> data = new ObjectMap<Integer>();
        if (tracker != null) data.set(0x0000, tracker);

        ObjectMap<String> servers = new ObjectMap<String>();
        for (Server server : plugin.api.getServers().values()) {
            if (this.servers == null || this.servers.length <= 0 || Arrays.binarySearch(this.servers, server.getName().toLowerCase()) >= 0) {
                servers.set(server.getName(), server.forSubData());
            }
        }
        data.set(0x0001, servers);
        return data;
    }

    @Override
    public void receive(SubDataClient client, ObjectMap<Integer> data) {
        client.sendPacket(new PacketDownloadServerInfo(plugin, (data.contains(0x0001))?data.getStringList(0x0001):null, (data.contains(0x0000))?data.getUUID(0x0000):null));
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Home\Model;

use Zend\Db\Adapter\Adapter;
use Zend\Db\ResultSet\ResultSet;
use Zend\Paginator\Adapter\DbSelect;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZendX\Paginator\Paginator as PaginatorBase;

abstract class BaseMapper implements ServiceLocatorAwareInterface
{
    /**
     * @var \Zend\Db\Sql\Select The select object used
     */
    protected $select = null;

    /**
     * @var ServiceLocatorInterface
     */
    protected $serviceLocator;

    /**
     * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
     */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;
    }

    /**
     * @return \Zend\ServiceManager\ServiceLocatorInterface
     */
    public function getServiceLocator()
    {
        return $this->serviceLocator;
    }

    /**
     * @return \Zend\Db\Sql\Sql
     */
    public function getDbSql()
    {
        return $this->getServiceLocator()->get('dbSql');
    }

    /**
     * @return \Zend\Db\Adapter\Adapter
     */
    public function getDbAdapter()
    {
        return $this->getServiceLocator()->get('dbAdapter');
    }

	/**
	 * @author VanCK
	 * @param \Base\Model\Base $model
	 * @param array $data
	 */
	protected function saveToDb($model, $data)
	{
		if (!($id = $model->getId())) {
			$insert = $this->getDbSql()->insert(static::TABLE_NAME);
			$insert->values($data);
			$query = $this->getDbSql()->buildSqlString($insert);
			$this->getDbAdapter()->query($query, Adapter::QUERY_MODE_EXECUTE);
			$model->setId($this->getDbAdapter()->getDriver()->getLastGeneratedValue());
			return $model->getId();
		} else {
			$update = $this->getDbSql()->update(static::TABLE_NAME);
			$update->set($data);
			$update->where(array('id' => (int)$model->getId()));
			$selectString = $this->getDbSql()->buildSqlString($update);
			return $this->getDbAdapter()->query($selectString, Adapter::QUERY_MODE_EXECUTE);
		}
	}

    /**
     * @author VanCK
     * @param array $data
     * @param array|\Home\Model\Bases $obj
     */
    public function updateColumns($data, $obj)
    {
    	if(!$obj instanceof \Home\Model\Base && !is_array($obj)) {
    		throw new \Exception('parameter obj must be instance of Home\Model\Base or an array');
    	}

		$update = $this->getDbSql()->update(static::TABLE_NAME);
		$update->set($data);
		if($obj instanceof \Home\Model\Base) {
			$update->where(array('id' => (int)$obj->getId()));
		} else if(is_array($obj)) {
			$update->where($obj);
		}

		$query = $this->getDbSql()->buildSqlString($update);
		return $this->getDbAdapter()->query($query, Adapter::QUERY_MODE_EXECUTE);
    }

    /**
     * @author VanCK
     * @param Zend\Db\Sql\Select $select
     * @param array $paging
     * @param Object $objectPrototype
     * @return \Zend\Paginator\Paginator
     */
    protected function preparePaginator($select, $paging, $objectPrototype = null)
    {
    	$resultSetPrototype = null;
    	if($objectPrototype){
    		$resultSetPrototype = new ResultSet();
    		$resultSetPrototype->buffer();
    		$resultSetPrototype->setArrayObjectPrototype($objectPrototype);
    	}
    	$paginatorAdapter = new DbSelect($select, $this->getDbAdapter(), $resultSetPrototype);
        $paginator = new PaginatorBase($paginatorAdapter);

        if(isset($paging['icpp'])) {
        	$paginator->setItemCountPerPage($paging['icpp']);
        }
        if(isset($paging['page'])) {
        	$paginator->setCurrentPageNumber($paging['page']);
        }

        return $paginator;
    }
}


text:
<?php

class Ess_M2ePro_Block_Adminhtml_Ebay_Listing_PickupStore_Help extends Mage_Adminhtml_Block_Widget
{
    //########################################

    public function __construct()
    {
        parent::__construct();

        // Initialization block
        // ---------------------------------------
        $this->setId('ebayListingPickupStoreHelp');
        // ---------------------------------------

        $this->setTemplate('M2ePro/ebay/listing/pickupStore/help.phtml');
    }

    //########################################
}


text:
import Dialog from '../Dialog';
import Utils from '@util/Utils';

let confirmTemplate = require('../../../template/confirm.hbs');

export default function (question: string, safeContent: boolean = false) {
   if (safeContent !== true) {
      question = Utils.escapeHTML(question);
   }

   let content = confirmTemplate({
      question,
   });

   let dialog = new Dialog(content);
   let dom = dialog.open();

   let promise = new Promise((resolve, reject) => {
      dom.find('.jsxc-confirm').click(function () {
         resolve(dialog);
      });

      dom.find('.jsxc-dismiss').click(function () {
         reject(dialog);
      });
   });

   dialog.getPromise = () => {
      return promise;
   };

   return dialog;
}


text:
'namespace Common
Namespace Common

  ''' <summary>
  ''' Hashtable拡張クラス
  ''' </summary>
  ''' <remarks></remarks>
  Public Class HashtableEx
    Inherits Hashtable

    ''' <summary>
    ''' 値を返す
    ''' </summary>
    ''' <param name="key"></param>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks>Keyが存在しない場合は ""(長さゼロの文字列)を返す</remarks>
    Default Public Overloads Property [Item](key As String) As Object
      Get
        If key.Equals("") Then
          'keyが空白の場合は空白を返す
          Return ""
        End If
        If Me.ContainsKey(key) Then
          '存在した場合は値を返す

          Return MyBase.Item(key)
        Else
          'keyの値がない場合は空白を返す()
          Return ""
        End If

      End Get
      Set(value As Object)

        If Not key.Equals("") Then
          If Me.ContainsKey(key) Then
            '一旦消す
            Me.Remove(key)
          End If
          Me.Add(key, value)
        End If

      End Set
    End Property

  End Class

End Namespace


text:
"use strict";
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require('./title.service'));
//# sourceMappingURL=index.js.map


text:
#include "traits.h"
#include "sugar.h"
#include "../ast/token.h"
#include "../ast/astbuild.h"
#include "../ast/id.h"
#include "../pkg/package.h"
#include "../type/assemble.h"
#include "../type/subtype.h"
#include "../type/reify.h"
#include "../../libponyrt/mem/pool.h"
#include "ponyassert.h"

/** The following defines how we determine the signature and body to use for
 * some method M in type T.
 * Note that the flatten pass will already have ensured that provides types
 * contain only traits and interfaces, and converted those to lists.
 *
 * 1. Explicit.
 *    If T provides an explicit definition of M we use that, including the body
 *    defined. If T provides a signature and no body, then T.M has no body,
 *    even if a body is available from some other source.
 * 2. Compatible inheritance.
 *    If T gets an M from either (1) or (2) then we use "compatible"
 *    inheritance.
 *    Each M from T's provides list must be a supertype of T.M.
 *    Any default bodies of M from the provides list are ignored, even if T.M
 *    has no body.
 * 3. Identical inheritance.
 *    If T does NOT get an M from either (1) or (2) then we use "identical"
 *    inheritance.
 *    All Ms from T's provides list must have identical signatures.
 *    If exactly one default body is provided for M then T.M uses that.
 *    If multiple default bodies are provided for M then T.M is body ambiguous.
 *    If any types in T's provides list are body ambiguous for M then T.M is
 *    body ambiguous.
 * 4. Required body.
 *    If T is a concrete type then M must have a body. It is an error if it has
 *    no body or is body ambiguous.
 *    If T is a trait or interface then it is fine for M to have no body or be
 *    body ambiguous.
 *
 * Throughout the processing of type T each method in T has a method_t struct
 * which is stored in the data field of the method node. Some of the
 * information stored is only used to generate helpful error messages.
 *
 * Once processing of T is finished these are freed and the data field is set
 * to the body donor, ie the type in which the body actually used was defined.
 * This can be used in later passes to determine the source of a method body.
 * If no body is used (only in traits and interfaces) the donor will be set to
 * the containing type.
 */

typedef struct method_t
{
  ast_t* body_donor;  // Type body was defined in. NULL if we have no body.
  ast_t* trait_ref;
  bool local_define;
  bool failed;
} method_t;

static bool trait_entity(ast_t* entity, pass_opt_t* options);

// Report whether the given node is a method.
static bool is_method(ast_t* ast)
{
  pony_assert(ast != NULL);

  token_id variety = ast_id(ast);
  return (variety == TK_BE) || (variety == TK_FUN) || (variety == TK_NEW);
}

// Attach a new method_t structure to the given method.
static method_t* attach_method_t(ast_t* method)
{
  pony_assert(method != NULL);

  method_t* p = POOL_ALLOC(method_t);
  p->body_donor = NULL;
  p->trait_ref = NULL;
  p->local_define = false;
  p->failed = false;

  ast_setdata(method, p);
  return p;
}

// Setup a method_t structure for each method in the given type.
static void setup_local_methods(ast_t* ast)
{
  pony_assert(ast != NULL);

  ast_t* members = ast_childidx(ast, 4);
  pony_assert(members != NULL);

  for(ast_t* p = ast_child(members); p != NULL; p = ast_sibling(p))
  {
    if(is_method(p))
    {
      method_t* info = attach_method_t(p);
      info->local_define = true;

      if(ast_id(ast_childidx(p, 6)) != TK_NONE)
        info->body_donor = ast;
    }
  }
}

// Tidy up the method_t structures in the given entity.
static void tidy_up(ast_t* entity)
{
  pony_assert(entity != NULL);

  ast_t* members = ast_childidx(entity, 4);
  pony_assert(members != NULL);

  for(ast_t* p = ast_child(members); p != NULL; p = ast_sibling(p))
  {
    if(is_method(p))
    {
      method_t* info = (method_t*)ast_data(p);
      pony_assert(info != NULL);
      ast_t* body_donor = info->body_donor;
      POOL_FREE(method_t, info);

      if(body_donor == NULL)
        // No body, donor should indicate containing type.
        body_donor = entity;

      ast_setdata(p, body_donor);
    }
  }
}

// Compare the 2 given signatures to see if they are exactly the same.
static bool compare_signatures(ast_t* sig_a, ast_t* sig_b)
{
  if(sig_a == NULL && sig_b == NULL)
    return true;

  if(sig_a == NULL || sig_b == NULL)
    return false;

  token_id a_id = ast_id(sig_a);

  if(a_id != ast_id(sig_b))
    return false;

  switch(a_id)
  {
    case TK_BE:
    case TK_FUN:
    case TK_NEW:
    {
      // Check everything except body and docstring, ie first 6 children.
      ast_t* a_child = ast_child(sig_a);
      ast_t* b_child = ast_child(sig_b);

      for(int i = 0; i < 6; i++)
      {
        if(a_child == NULL || b_child == NULL)
          return false;

        if(!compare_signatures(a_child, b_child))
          return false;

        a_child = ast_sibling(a_child);
        b_child = ast_sibling(b_child);
      }

      return true;
    }

    case TK_STRING:
    case TK_ID:
    {
      // Can't just use strcmp, string literals may contain \0s.
      size_t a_len = ast_name_len(sig_a);
      size_t b_len = ast_name_len(sig_b);

      if(a_len != b_len)
        return false;

      const char* a_text = ast_name(sig_a);
      const char* b_text = ast_name(sig_b);

      for(size_t i = 0; i < a_len; i++)
      {
        if(a_text[i] != b_text[i])
          return false;
      }

      return true;
    }

    case TK_INT:     return lexint_cmp(ast_int(sig_a), ast_int(sig_b)) == 0;
    case TK_FLOAT:   return ast_float(sig_a) == ast_float(sig_b);

    case TK_NOMINAL:
      if(ast_data(sig_a) != ast_data(sig_b))
        return false;

      break;

    default:
      break;
  }

  ast_t* a_child = ast_child(sig_a);
  ast_t* b_child = ast_child(sig_b);

  while(a_child != NULL && b_child != NULL)
  {
    if(!compare_signatures(a_child, b_child))
      return false;

    a_child = ast_sibling(a_child);
    b_child = ast_sibling(b_child);
  }

  if(a_child != NULL || b_child != NULL)
    return false;

  return true;
}

// Reify the method with the type parameters from trait definition
// and type arguments from trait reference.
// Also handles modifying return types from behaviours, etc.
// Returns the reified type, which must be freed later, or NULL on error.
static ast_t* reify_provides_type(ast_t* method, ast_t* trait_ref,
  pass_opt_t* opt)
{
  pony_assert(method != NULL);
  pony_assert(trait_ref != NULL);

  // Apply the type args (if any) from the trait reference to the type
  // parameters from the trait definition.
  ast_t* trait_def = (ast_t*)ast_data(trait_ref);
  pony_assert(trait_def != NULL);
  ast_t* type_args = ast_childidx(trait_ref, 2);
  ast_t* type_params = ast_childidx(trait_def, 1);

  if(!reify_defaults(type_params, type_args, true, opt))
    return NULL;

  ast_t* reified = reify(method, type_params, type_args, opt, true);

  if(reified == NULL)
    return NULL;

  AST_GET_CHILDREN(reified, cap, id, typeparams, params, result,
    can_error, body, doc);

  return reified;
}

// Find the method with the specified name in the given entity.
// Find only methods, ignore fields.
// Return the method with the specified name or NULL if not found.
static ast_t* find_method(ast_t* entity, const char* name)
{
  pony_assert(entity != NULL);
  pony_assert(name != NULL);

  ast_t* method = ast_get(entity, name, NULL);

  if(method == NULL)
    return NULL;

  if(is_method(method))
    return method;

  return NULL;
}

// Add a new method to the given entity, based on the specified method from
// the specified type.
// The trait_ref is the entry in the provides list that causes this
// method inclusion. Needed for error reporting.
// The basis_method is the reified method in the trait to add.
// The adjective parameter is used for error reporting and should be "provided"
// or similar.
// Return the newly added method or NULL on error.
static ast_t* add_method(ast_t* entity, ast_t* trait_ref, ast_t* basis_method,
  const char* adjective, pass_opt_t* opt)
{
  pony_assert(entity != NULL);
  pony_assert(trait_ref != NULL);
  pony_assert(basis_method != NULL);
  pony_assert(adjective != NULL);

  const char* name = ast_name(ast_childidx(basis_method, 1));

  // Check behaviour compatibility.
  if(ast_id(basis_method) == TK_BE)
  {
    switch(ast_id(entity))
    {
      case TK_PRIMITIVE:
        ast_error(opt->check.errors, trait_ref,
          "cannot add a behaviour (%s) to a primitive", name);
        return NULL;

      case TK_STRUCT:
        ast_error(opt->check.errors, trait_ref,
          "cannot add a behaviour (%s) to a struct", name);
        return NULL;

      case TK_CLASS:
        ast_error(opt->check.errors, trait_ref,
          "cannot add a behaviour (%s) to a class", name);
        return NULL;

      default:
        break;
    }
  }

  // Check for existing method of the same name.
  ast_t* existing = ast_get(entity, name, NULL);

  if(existing != NULL)
  {
    // Should already have checked for methods.
    token_id variety = ast_id(existing);
    (void)variety;
    pony_assert((variety == TK_FVAR) || (variety == TK_FLET) || (variety == TK_EMBED));

    ast_error(opt->check.errors, trait_ref,
      "%s method '%s' clashes with field", adjective, name);
    ast_error_continue(opt->check.errors, basis_method,
      "method is defined here");
    return NULL;
  }

  // Check for clash with existing method.
  ast_t* case_clash = ast_get_case(entity, name, NULL);

  if(case_clash != NULL)
  {
    const char* clash_name = "";

    switch(ast_id(case_clash))
    {
      case TK_FUN:
      case TK_BE:
      case TK_NEW:
        clash_name = ast_name(ast_childidx(case_clash, 1));
        break;

      case TK_LET:
      case TK_VAR:
      case TK_EMBED:
        clash_name = ast_name(ast_child(case_clash));
        break;

      default:
        pony_assert(0);
        break;
    }

    ast_error(opt->check.errors, trait_ref,
      "%s method '%s' differs only in case from '%s'",
      adjective, name, clash_name);
    ast_error_continue(opt->check.errors, basis_method,
      "clashing method is defined here");
    return NULL;
  }

  AST_GET_CHILDREN(basis_method, cap, id, typeparams, params, result,
    can_error, body, doc);

  // Ignore docstring.
  if(ast_id(doc) == TK_STRING)
  {
    ast_set_name(doc, "");
    ast_setid(doc, TK_NONE);
  }

  ast_t* local = ast_append(ast_childidx(entity, 4), basis_method);
  ast_set(entity, name, local, SYM_DEFINED, false);
  ast_t* body_donor = (ast_t*)ast_data(basis_method);
  method_t* info = attach_method_t(local);
  info->trait_ref = trait_ref;

  if(ast_id(body) != TK_NONE)
    info->body_donor = body_donor;

  return local;
}

// Sort out symbol table for copied method body.
static ast_result_t rescope(ast_t** astp, pass_opt_t* options)
{
  (void)options;
  ast_t* ast = *astp;

  if(ast_has_scope(ast))
    ast_clear_local(ast);

  switch(ast_id(ast))
  {
    case TK_FVAR:
    case TK_FLET:
    case TK_EMBED:
    case TK_PARAM:
    case TK_MATCH_CAPTURE:
    case TK_TYPEPARAM:
    {
      pony_assert(ast_child(ast) != NULL);
      ast_set(ast, ast_name(ast_child(ast)), ast, SYM_DEFINED, true);
      break;
    }

    case TK_LET:
    case TK_VAR:
    {
      pony_assert(ast_child(ast) != NULL);
      ast_set(ast, ast_name(ast_child(ast)), ast, SYM_UNDEFINED, true);
      break;
    }

    case TK_TYPEPARAMREF:
    {
      pony_assert(ast_child(ast) != NULL);
      ast_t* def = ast_get(ast, ast_name(ast_child(ast)), NULL);
      ast_setdata(ast, def);
      break;
    }

    default: {}
  }

  return AST_OK;
}

// Combine the given inherited method with the existing one, if any, in the
// given entity.
// The provided method must already be reified.
// The trait_ref is the entry in the provides list that causes this method
// inclusion. Needed for error reporting.
// Returns true on success, false on failure in which case an error will have
// been reported.
static bool add_method_from_trait(ast_t* entity, ast_t* method,
  ast_t* trait_ref, pass_opt_t* opt)
{
  pony_assert(entity != NULL);
  pony_assert(method != NULL);
  pony_assert(trait_ref != NULL);

  AST_GET_CHILDREN(method, cap, id, t_params, params, result, error,
    method_body);

  const char* method_name = ast_name(id);
  ast_t* existing_method = find_method(entity, method_name);

  if(existing_method == NULL)
  {
    // We don't have a method yet with this name, add the one from this trait.
    ast_t* m = add_method(entity, trait_ref, method, "provided", opt);

    if(m == NULL)
      return false;

    if(ast_id(ast_childidx(m, 6)) != TK_NONE)
      ast_visit(&m, rescope, NULL, opt, PASS_ALL);

    return true;
  }

  // A method with this name already exists.
  method_t* info = (method_t*)ast_data(existing_method);
  pony_assert(info != NULL);

  // Method has already caused an error, do nothing.
  if(info->failed)
    return false;

  if(info->local_define)
    return true;

  // Existing method is also provided, signatures must match exactly.
  if(!compare_signatures(existing_method, method))
  {
    pony_assert(info->trait_ref != NULL);

    ast_error(opt->check.errors, trait_ref,
      "clashing definitions for method '%s' provided, local disambiguation "
      "required",
      method_name);
    ast_error_continue(opt->check.errors, trait_ref,
      "provided here, type: %s",
      ast_print_type(method));
    ast_error_continue(opt->check.errors, info->trait_ref,
      "and here, type: %s",
      ast_print_type(existing_method));

    info->failed = true;
    return false;
  }

  // Resolve bodies, if any.
  ast_t* existing_body = ast_childidx(existing_method, 6);

  bool multiple_bodies =
    (info->body_donor != NULL) &&
    (ast_id(method_body) != TK_NONE) &&
    (info->body_donor != (ast_t*)ast_data(method));

  if(multiple_bodies ||
    ast_checkflag(existing_method, AST_FLAG_AMBIGUOUS) ||
    ast_checkflag(method, AST_FLAG_AMBIGUOUS))
  {
    // This method body ambiguous, which is not necessarily an error.
    ast_setflag(existing_method, AST_FLAG_AMBIGUOUS);

    if(ast_id(existing_body) != TK_NONE) // Ditch existing body.
      ast_replace(&existing_body, ast_from(existing_method, TK_NONE));

    info->body_donor = NULL;
    return true;
  }

  // No new body to resolve.
  if((ast_id(method_body) == TK_NONE) ||
    (info->body_donor == (ast_t*)ast_data(method)))
    return true;

  // Trait provides default body. Use it and patch up symbol tables.
  pony_assert(ast_id(existing_body) == TK_NONE);
  ast_replace(&existing_body, method_body);
  ast_visit(&method_body, rescope, NULL, opt, PASS_ALL);

  info->body_donor = (ast_t*)ast_data(method);
  info->trait_ref = trait_ref;
  return true;
}

// Process the methods provided to the given entity from all traits in its
// provides list.
static bool provided_methods(ast_t* entity, pass_opt_t* opt)
{
  pony_assert(entity != NULL);

  ast_t* provides = ast_childidx(entity, 3);
  bool r = true;

  // Run through our provides list
  for(ast_t* trait_ref = ast_child(provides); trait_ref != NULL;
    trait_ref = ast_sibling(trait_ref))
  {
    ast_t* trait = (ast_t*)ast_data(trait_ref);
    pony_assert(trait != NULL);

    if(!trait_entity(trait, opt))
      return false;

    ast_t* members = ast_childidx(trait, 4);

    // Run through the methods of each provided type.
    for(ast_t* method = ast_child(members); method != NULL;
      method = ast_sibling(method))
    {
      pony_assert(is_method(method));

      ast_t* reified = reify_provides_type(method, trait_ref, opt);

      if(reified == NULL)
      {
        // Reification error, already reported.
        r = false;
      }
      else
      {
        if(!add_method_from_trait(entity, reified, trait_ref, opt))
          r = false;

        ast_free_unattached(reified);
      }
    }
  }

  return r;
}

// Check that the given entity, if concrete, has bodies for all methods.
static bool check_concrete_bodies(ast_t* entity, pass_opt_t* opt)
{
  pony_assert(entity != NULL);

  token_id variety = ast_id(entity);
  if((variety != TK_PRIMITIVE) && (variety != TK_STRUCT) &&
    (variety != TK_CLASS) && (variety != TK_ACTOR))
    return true;

  bool r = true;
  ast_t* members = ast_childidx(entity, 4);
  pony_assert(members != NULL);

  for(ast_t* p = ast_child(members); p != NULL; p = ast_sibling(p))
  {
    if(is_method(p))
    {
      method_t* info = (method_t*)ast_data(p);
      pony_assert(info != NULL);

      if(!info->failed)
      {
        const char* name = ast_name(ast_childidx(p, 1));

        if(ast_checkflag(p, AST_FLAG_AMBIGUOUS))
        {
          // Concrete types must not have ambiguous bodies.
          ast_error(opt->check.errors, entity, "multiple possible bodies for "
            "method %s, local disambiguation required", name);
          r = false;
        }
        else if(info->body_donor == NULL)
        {
          // Concrete types must have method bodies.
          pony_assert(info->trait_ref != NULL);
          ast_error(opt->check.errors, info->trait_ref,
            "no body found for method '%s'", name);
          r = false;
        }
      }
    }
  }

  return r;
}

// Add provided methods to the given entity.
static bool trait_entity(ast_t* entity, pass_opt_t* opt)
{
  pony_assert(entity != NULL);

  int state = ast_checkflag(entity,
    AST_FLAG_RECURSE_1 | AST_FLAG_DONE_1 | AST_FLAG_ERROR_1);

  // Check for recursive definitions
  switch(state)
  {
    case 0:
      ast_setflag(entity, AST_FLAG_RECURSE_1);
      break;

    case AST_FLAG_RECURSE_1:
      ast_error(opt->check.errors, entity,
        "traits and interfaces can't be recursive");
      ast_clearflag(entity, AST_FLAG_RECURSE_1);
      ast_setflag(entity, AST_FLAG_ERROR_1);
      return false;

    case AST_FLAG_DONE_1:
      return true;

    case AST_FLAG_ERROR_1:
    case AST_FLAG_ERROR_1 | AST_FLAG_DONE_1:
      return false;

    default:
      pony_assert(0);
      return false;
  }

  setup_local_methods(entity);

  bool r =
    provided_methods(entity, opt) &&
    check_concrete_bodies(entity, opt);

  tidy_up(entity);
  ast_clearflag(entity, AST_FLAG_RECURSE_1);
  ast_setflag(entity, AST_FLAG_DONE_1);

  return r;
}

// Check that embed fields are not recursive.
static bool embed_fields(ast_t* entity, pass_opt_t* opt)
{
  pony_assert(entity != NULL);

  int state = ast_checkflag(entity,
    AST_FLAG_RECURSE_2 | AST_FLAG_DONE_2 | AST_FLAG_ERROR_2);

  // Check for recursive embeds
  switch(state)
  {
    case 0:
      ast_setflag(entity, AST_FLAG_RECURSE_2);
      break;

    case AST_FLAG_RECURSE_2:
      ast_error(opt->check.errors, entity,
        "embedded fields can't be recursive");
      ast_clearflag(entity, AST_FLAG_RECURSE_2);
      ast_setflag(entity, AST_FLAG_ERROR_2);
      return false;

    case AST_FLAG_DONE_2:
      return true;

    case AST_FLAG_ERROR_2:
      return false;

    default:
      pony_assert(0);
      return false;
  }

  AST_GET_CHILDREN(entity, id, typeparams, cap, provides, members);
  ast_t* member = ast_child(members);

  while(member != NULL)
  {
    if(ast_id(member) == TK_EMBED)
    {
      AST_GET_CHILDREN(member, f_id, f_type);
      ast_t* def = (ast_t*)ast_data(f_type);
      pony_assert(def != NULL);

      if(!embed_fields(def, opt))
        return false;
    }

    member = ast_sibling(member);
  }

  ast_clearflag(entity, AST_FLAG_RECURSE_2);
  ast_setflag(entity, AST_FLAG_DONE_2);
  return true;
}

// Setup the type, or lack thereof, for local variable declarations.
// This is not really anything to do with traits, but must be done before the
// expr pass (to allow initialisation references to the variable type) but
// after the name pass (to get temporal capabilities).
static void local_types(ast_t* ast)
{
  pony_assert(ast != NULL);

  // Setup type or mark as inferred now to allow calling create on a
  // non-inferred local to initialise itself
  AST_GET_CHILDREN(ast, id, type);
  pony_assert(type != NULL);

  if(ast_id(type) == TK_NONE)
  {
    if(is_name_dontcare(ast_name(id)))
      type = ast_from(id, TK_DONTCARETYPE);
    else
      type = ast_from(id, TK_INFERTYPE);
  }

  ast_settype(id, type);
  ast_settype(ast, type);
}

// Add eq() and ne() functions to the given entity.
static bool add_comparable(ast_t* ast, pass_opt_t* options)
{
  pony_assert(ast != NULL);

  AST_GET_CHILDREN(ast, id, typeparams, defcap, traits, members);
  ast_t* typeargs = ast_from(typeparams, TK_NONE);
  bool r = true;

  for(ast_t* p = ast_child(typeparams); p != NULL; p = ast_sibling(p))
  {
    ast_t* p_id = ast_child(p);

    BUILD(type, p_id, NODE(TK_NOMINAL, NONE TREE(p_id) NONE NONE NONE));
    ast_append(typeargs, type);
    ast_setid(typeargs, TK_TYPEARGS);
  }

  if(!has_member(members, "eq"))
  {
    BUILD(eq, members,
      NODE(TK_FUN, AST_SCOPE
        NODE(TK_BOX)
        ID("eq")
        NONE
        NODE(TK_PARAMS,
          NODE(TK_PARAM,
            ID("that")
            NODE(TK_NOMINAL, NONE TREE(id) TREE(typeargs) NONE NONE)
            NONE))
        NODE(TK_NOMINAL, NONE ID("Bool") NONE NONE NONE)
        NONE
        NODE(TK_SEQ,
          NODE(TK_IS,
            NODE(TK_THIS)
            NODE(TK_REFERENCE, ID("that"))))
        NONE
        NONE));

    // Need to set function data field to point to originating type, ie ast.
    // This won't be done when we catch up the passes since we've already
    // processed that type.
    ast_setdata(eq, ast);
    ast_append(members, eq);
    ast_set(ast, stringtab("eq"), eq, SYM_DEFINED, false);

    if(!ast_passes_subtree(&eq, options, PASS_TRAITS))
      r = false;
  }

  if(!has_member(members, "ne"))
  {
    BUILD(ne, members,
      NODE(TK_FUN, AST_SCOPE
        NODE(TK_BOX)
        ID("ne")
        NONE
        NODE(TK_PARAMS,
          NODE(TK_PARAM,
            ID("that")
            NODE(TK_NOMINAL, NONE TREE(id) TREE(typeargs) NONE NONE)
            NONE))
        NODE(TK_NOMINAL, NONE ID("Bool") NONE NONE NONE)
        NONE
        NODE(TK_SEQ,
          NODE(TK_ISNT,
            NODE(TK_THIS)
            NODE(TK_REFERENCE, ID("that"))))
        NONE
        NONE));

    // Need to set function data field to point to originating type, ie ast.
    // This won't be done when we catch up the passes since we've already
    // processed that type.
    ast_setdata(ne, ast);
    ast_append(members, ne);
    ast_set(ast, stringtab("ne"), ne, SYM_DEFINED, false);

    if(!ast_passes_subtree(&ne, options, PASS_TRAITS))
      r = false;
  }

  ast_free_unattached(typeargs);
  return r;
}

ast_result_t pass_traits(ast_t** astp, pass_opt_t* options)
{
  ast_t* ast = *astp;

  switch(ast_id(ast))
  {
    case TK_STRUCT:
    case TK_CLASS:
    case TK_ACTOR:
      if(!trait_entity(ast, options))
        return AST_ERROR;

      if(!embed_fields(ast, options))
        return AST_ERROR;
      break;

    case TK_PRIMITIVE:
      if(!trait_entity(ast, options))
        return AST_ERROR;

      if(!add_comparable(ast, options))
        return AST_FATAL;
      break;

    case TK_INTERFACE:
    case TK_TRAIT:
      if(!trait_entity(ast, options))
        return AST_ERROR;
      break;

    case TK_LET:
    case TK_VAR:
      local_types(ast);
      break;

    default:
      break;
  }

  return AST_OK;
}


text:
// Copyright 2007-2016 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit
{
    using System;

    /// <summary>
    /// Returns the address for the message provided
    /// </summary>
    /// <param name="message"></param>
    /// <param name="address"></param>
    /// <returns></returns>
    public delegate bool EndpointAddressProvider<in T>(T message, out Uri address)
        where T : class;
}


text:
// g2o - General Graph Optimization
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifndef G2O_SPARSE_BLOCK_MATRIX_CCS_H
#define G2O_SPARSE_BLOCK_MATRIX_CCS_H

#include <vector>
#include <cassert>
#include <Eigen/Core>

#include "g2o/config.h"
#include "matrix_operations.h"

#ifdef _MSC_VER
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif

namespace g2o {

  /**
   * \brief Sparse matrix which uses blocks
   *
   * This class is used as a const view on a SparseBlockMatrix
   * which allows a faster iteration over the elements of the
   * matrix.
   */
  template <class MatrixType>
  class SparseBlockMatrixCCS
  {
    public:
      //! this is the type of the elementary block, it is an Eigen::Matrix.
      typedef MatrixType SparseMatrixBlock;

      //! columns of the matrix
      int cols() const {return _colBlockIndices.size() ? _colBlockIndices.back() : 0;}
      //! rows of the matrix
      int rows() const {return _rowBlockIndices.size() ? _rowBlockIndices.back() : 0;}

      /**
       * \brief A block within a column
       */
      struct RowBlock
      {
        int row;              ///< row of the block
        MatrixType* block;    ///< matrix pointer for the block
        RowBlock() : row(-1), block(0) {}
        RowBlock(int r, MatrixType* b) : row(r), block(b) {}
        bool operator<(const RowBlock& other) const { return row < other.row;}
      };
      typedef std::vector<RowBlock>      SparseColumn;

      SparseBlockMatrixCCS(const std::vector<int>& rowIndices, const std::vector<int>& colIndices) :
        _rowBlockIndices(rowIndices), _colBlockIndices(colIndices)
      {}

      //! how many rows does the block at block-row r has?
      int rowsOfBlock(int r) const { return r ? _rowBlockIndices[r] - _rowBlockIndices[r-1] : _rowBlockIndices[0] ; }

      //! how many cols does the block at block-col c has?
      int colsOfBlock(int c) const { return c ? _colBlockIndices[c] - _colBlockIndices[c-1] : _colBlockIndices[0]; }

      //! where does the row at block-row r start?
      int rowBaseOfBlock(int r) const { return r ? _rowBlockIndices[r-1] : 0 ; }

      //! where does the col at block-col r start?
      int colBaseOfBlock(int c) const { return c ? _colBlockIndices[c-1] : 0 ; }

      //! the block matrices per block-column
      const std::vector<SparseColumn>& blockCols() const { return _blockCols;}
      std::vector<SparseColumn>& blockCols() { return _blockCols;}

      //! indices of the row blocks
      const std::vector<int>& rowBlockIndices() const { return _rowBlockIndices;}

      //! indices of the column blocks
      const std::vector<int>& colBlockIndices() const { return _colBlockIndices;}

      void rightMultiply(double*& dest, const double* src) const
      {
        int destSize=cols();

        if (! dest){
          dest=new double [ destSize ];
          memset(dest,0, destSize*sizeof(double));
        }

        // map the memory by Eigen
        Eigen::Map<Eigen::VectorXd> destVec(dest, destSize);
        Eigen::Map<const Eigen::VectorXd> srcVec(src, rows());

#      ifdef G2O_OPENMP
#      pragma omp parallel for default (shared) schedule(dynamic, 10)
#      endif
        for (int i=0; i < static_cast<int>(_blockCols.size()); ++i){
          int destOffset = colBaseOfBlock(i);
          for (typename SparseColumn::const_iterator it = _blockCols[i].begin(); it!=_blockCols[i].end(); ++it) {
            const SparseMatrixBlock* a = it->block;
            int srcOffset = rowBaseOfBlock(it->row);
            // destVec += *a.transpose() * srcVec (according to the sub-vector parts)
            internal::atxpy(*a, srcVec, srcOffset, destVec, destOffset);
          }
        }
      }

      /**
       * sort the blocks in each column
       */
      void sortColumns()
      {
        for (int i=0; i < static_cast<int>(_blockCols.size()); ++i){
          std::sort(_blockCols[i].begin(), _blockCols[i].end());
        }
      }

      /**
       * fill the CCS arrays of a matrix, arrays have to be allocated beforehand
       */
      int fillCCS(int* Cp, int* Ci, double* Cx, bool upperTriangle = false) const
      {
        assert(Cp && Ci && Cx && "Target destination is NULL");
        int nz=0;
        for (size_t i=0; i<_blockCols.size(); ++i){
          int cstart=i ? _colBlockIndices[i-1] : 0;
          int csize=colsOfBlock(i);
          for (int c=0; c<csize; ++c) {
            *Cp=nz;
            for (typename SparseColumn::const_iterator it = _blockCols[i].begin(); it!=_blockCols[i].end(); ++it) {
              const SparseMatrixBlock* b=it->block;
              int rstart=it->row ? _rowBlockIndices[it->row-1] : 0;

              int elemsToCopy = b->rows();
              if (upperTriangle && rstart == cstart)
                elemsToCopy = c + 1;
              for (int r=0; r<elemsToCopy; ++r){
                *Cx++ = (*b)(r,c);
                *Ci++ = rstart++;
                ++nz;
              }
            }
            ++Cp;
          }
        }
        *Cp=nz;
        return nz;
      }

      /**
       * fill the CCS arrays of a matrix, arrays have to be allocated beforehand. This function only writes
       * the values and assumes that column and row structures have already been written.
       */
      int fillCCS(double* Cx, bool upperTriangle = false) const
      {
        assert(Cx && "Target destination is NULL");
        double* CxStart = Cx;
        int cstart = 0;
        for (size_t i=0; i<_blockCols.size(); ++i){
          int csize = _colBlockIndices[i] - cstart;
          for (int c=0; c<csize; ++c) {
            for (typename SparseColumn::const_iterator it = _blockCols[i].begin(); it!=_blockCols[i].end(); ++it) {
              const SparseMatrixBlock* b = it->block;
              int rstart = it->row ? _rowBlockIndices[it->row-1] : 0;

              int elemsToCopy = b->rows();
              if (upperTriangle && rstart == cstart)
                elemsToCopy = c + 1;
              memcpy(Cx, b->data() + c*b->rows(), elemsToCopy * sizeof(double));
              Cx += elemsToCopy;

            }
          }
          cstart = _colBlockIndices[i];
        }
        return Cx - CxStart;
      }

    protected:
      const std::vector<int>& _rowBlockIndices; ///< vector of the indices of the blocks along the rows.
      const std::vector<int>& _colBlockIndices; ///< vector of the indices of the blocks along the cols
      std::vector<SparseColumn> _blockCols;     ///< the matrices stored in CCS order
  };

  /**
   * \brief Sparse matrix which uses blocks based on hash structures
   *
   * This class is used to construct the pattern of a sparse block matrix
   */
  template <class MatrixType>
  class SparseBlockMatrixHashMap
  {
    public:
      //! this is the type of the elementary block, it is an Eigen::Matrix.
      typedef MatrixType SparseMatrixBlock;

      //! columns of the matrix
      int cols() const {return _colBlockIndices.size() ? _colBlockIndices.back() : 0;}
      //! rows of the matrix
      int rows() const {return _rowBlockIndices.size() ? _rowBlockIndices.back() : 0;}

      typedef std::tr1::unordered_map<int, MatrixType*> SparseColumn;

      SparseBlockMatrixHashMap(const std::vector<int>& rowIndices, const std::vector<int>& colIndices) :
        _rowBlockIndices(rowIndices), _colBlockIndices(colIndices)
      {}

      //! how many rows does the block at block-row r has?
      int rowsOfBlock(int r) const { return r ? _rowBlockIndices[r] - _rowBlockIndices[r-1] : _rowBlockIndices[0] ; }

      //! how many cols does the block at block-col c has?
      int colsOfBlock(int c) const { return c ? _colBlockIndices[c] - _colBlockIndices[c-1] : _colBlockIndices[0]; }

      //! where does the row at block-row r start?
      int rowBaseOfBlock(int r) const { return r ? _rowBlockIndices[r-1] : 0 ; }

      //! where does the col at block-col r start?
      int colBaseOfBlock(int c) const { return c ? _colBlockIndices[c-1] : 0 ; }

      //! the block matrices per block-column
      const std::vector<SparseColumn>& blockCols() const { return _blockCols;}
      std::vector<SparseColumn>& blockCols() { return _blockCols;}

      //! indices of the row blocks
      const std::vector<int>& rowBlockIndices() const { return _rowBlockIndices;}

      //! indices of the column blocks
      const std::vector<int>& colBlockIndices() const { return _colBlockIndices;}

      /**
       * add a block to the pattern, return a pointer to the added block
       */
      MatrixType* addBlock(int r, int c, bool zeroBlock = false)
      {
        assert(c <(int)_blockCols.size() && "accessing column which is not available");
        SparseColumn& sparseColumn = _blockCols[c];
        typename SparseColumn::iterator foundIt = sparseColumn.find(r);
        if (foundIt == sparseColumn.end()) {
          int rb = rowsOfBlock(r);
          int cb = colsOfBlock(c);
          MatrixType* m = new MatrixType(rb, cb);
          if (zeroBlock)
            m->setZero();
          sparseColumn[r] = m;
          return m;
        }
        return foundIt->second;
      }

    protected:
      const std::vector<int>& _rowBlockIndices; ///< vector of the indices of the blocks along the rows.
      const std::vector<int>& _colBlockIndices; ///< vector of the indices of the blocks along the cols
      std::vector<SparseColumn> _blockCols;     ///< the matrices stored in CCS order
  };

} //end namespace

#endif


text:
import re

from oslo_log import log

from manila.i18n import _LI

LOG = log.getLogger(__name__)

class WindowsUtils(object):
    def __init__(self, remote_execute):
        self._remote_exec = remote_execute
        self._fsutil_total_space_regex = re.compile('of bytes *: ([0-9]*)')
        self._fsutil_free_space_regex = re.compile(
            'of avail free bytes *: ([0-9]*)')

    def initialize_disk(self, server, disk_number):
        cmd = ["Initialize-Disk", "-Number", disk_number]
        self._remote_exec(server, cmd)

    def create_partition(self, server, disk_number):
        cmd = ["New-Partition", "-DiskNumber", disk_number, "-UseMaximumSize"]
        self._remote_exec(server, cmd)

    def format_partition(self, server, disk_number, partition_number):
        cmd = ("Get-Partition -DiskNumber %(disk_number)s "
               "-PartitionNumber %(partition_number)s | "
               "Format-Volume -FileSystem NTFS -Force -Confirm:$false" % {
                   'disk_number': disk_number,
                   'partition_number': partition_number,
               })
        self._remote_exec(server, cmd)

    def add_access_path(self, server, mount_path, disk_number,
                        partition_number):
        cmd = ["Add-PartitionAccessPath", "-DiskNumber", disk_number,
               "-PartitionNumber", partition_number,
               "-AccessPath", self.quote_string(mount_path)]
        self._remote_exec(server, cmd)

    def resize_partition(self, server, size_bytes, disk_number,
                         partition_number):
        cmd = ['Resize-Partition', '-DiskNumber', disk_number,
               '-PartitionNumber', partition_number,
               '-Size', size_bytes]
        self._remote_exec(server, cmd)

    def get_disk_number_by_serial_number(self, server, serial_number):
        pattern = "%s*" % serial_number[:15]
        cmd = ("Get-Disk | "
               "Where-Object {$_.SerialNumber -like '%s'} | "
               "Select-Object -ExpandProperty Number" % pattern)
        (out, err) = self._remote_exec(server, cmd)
        return int(out) if (len(out) > 0) else None

    def get_disk_number_by_mount_path(self, server, mount_path):
        cmd = ('Get-Partition | '
               'Where-Object {$_.AccessPaths -contains "%s"} | '
               'Select-Object -ExpandProperty DiskNumber' %
               (mount_path + "\\"))
        (out, err) = self._remote_exec(server, cmd)
        return int(out) if (len(out) > 0) else None

    def get_volume_path_by_mount_path(self, server, mount_path):
        cmd = ('Get-Partition | '
               'Where-Object {$_.AccessPaths -contains "%s"} | '
               'Get-Volume | '
               'Select-Object -ExpandProperty Path' %
               (mount_path + "\\"))
        (out, err) = self._remote_exec(server, cmd)
        return out.strip()

    def get_disk_space_by_path(self, server, mount_path):
        cmd = ["fsutil", "volume", "diskfree",
               self.quote_string(mount_path)]
        (out, err) = self._remote_exec(server, cmd)

        total_bytes = int(self._fsutil_total_space_regex.findall(out)[0])
        free_bytes = int(self._fsutil_free_space_regex.findall(out)[0])
        return total_bytes, free_bytes

    def get_partition_maximum_size(self, server, disk_number,
                                   partition_number):
        cmd = ('Get-PartitionSupportedSize -DiskNumber %(disk_number)s '
               '-PartitionNumber %(partition_number)s | '
               'Select-Object -ExpandProperty SizeMax' %
               dict(disk_number=disk_number,
                    partition_number=partition_number))
        (out, err) = self._remote_exec(server, cmd)

        max_bytes = int(out)
        return max_bytes

    def set_disk_online_status(self, server, disk_number, online=True):
        is_offline = int(not online)
        cmd = ["Set-Disk", "-Number", disk_number, "-IsOffline", is_offline]
        self._remote_exec(server, cmd)

    def set_disk_readonly_status(self, server, disk_number, readonly=False):
        cmd = ["Set-Disk", "-Number", disk_number,
               "-IsReadOnly", int(readonly)]
        self._remote_exec(server, cmd)

    def update_disk(self, server, disk_number):
        """Updates cached disk information."""
        cmd = ["Update-Disk", disk_number]
        self._remote_exec(server, cmd)

    def join_domain(self, server, domain, admin_username, admin_password):
        # NOTE(lpetrut): An instance reboot is needed but this will be
        # performed using Nova so that the instance state can be
        # retrieved easier.
        LOG.info(_LI("Joining server %(ip)s to Active Directory "
                     "domain %(domain)s"), dict(ip=server['ip'],
                                                domain=domain))
        cmds = [
            ('$password = "%s" | '
             'ConvertTo-SecureString -asPlainText -Force' % admin_password),
            ('$credential = '
             'New-Object System.Management.Automation.PSCredential('
             '"%s", $password)' % admin_username),
            ('Add-Computer -DomainName "%s" -Credential $credential' %
             domain)]

        cmd = ";".join(cmds)
        self._remote_exec(server, cmd)

    def unjoin_domain(self, server, admin_username, admin_password,
                      reboot=False):
        cmds = [
            ('$password = "%s" | '
             'ConvertTo-SecureString -asPlainText -Force' % admin_password),
            ('$credential = '
             'New-Object System.Management.Automation.PSCredential('
             '"%s", $password)' % admin_username),
            ('Remove-Computer -UnjoinDomaincredential $credential '
             '-Passthru -Verbose -Force')]

        cmd = ";".join(cmds)
        self._remote_exec(server, cmd)

    def get_current_domain(self, server):
        cmd = "(Get-WmiObject Win32_ComputerSystem).Domain"
        (out, err) = self._remote_exec(server, cmd)
        return out.strip()

    def ensure_directory_exists(self, server, path):
        cmd = ["New-Item", "-ItemType", "Directory",
               "-Force", "-Path", self.quote_string(path)]
        self._remote_exec(server, cmd)

    def remove(self, server, path, force=True, recurse=False,
               is_junction=False):
        if self.path_exists(server, path):
            if is_junction:
                cmd = ('[System.IO.Directory]::Delete('
                       '%(path)s, %(recurse)d)'
                       % dict(path=self.quote_string(path),
                              recurse=recurse))
            else:
                cmd = ["Remove-Item", "-Confirm:$false",
                       "-Path", self.quote_string(path)]
                if force:
                    cmd += ['-Force']
                if recurse:
                    cmd += ['-Recurse']
            self._remote_exec(server, cmd)
        else:
            LOG.debug("Skipping deleting path %s as it does "
                      "not exist.", path)

    def path_exists(self, server, path):
        cmd = ["Test-Path", path]
        (out, _) = self._remote_exec(server, cmd)
        return out.strip() == "True"

    def normalize_path(self, path):
        return path.replace('/', '\\')

    def get_interface_index_by_ip(self, server, ip):
        cmd = ('Get-NetIPAddress | '
               'Where-Object {$_.IPAddress -eq "%(ip)s"} | '
               'Select-Object -ExpandProperty InterfaceIndex' %
               dict(ip=ip))

        (out, err) = self._remote_exec(server, cmd)
        if_index = int(out)
        return if_index

    def set_dns_client_search_list(self, server, search_list):
        src_list = ",".join(["'%s'" % domain for domain in search_list])

        cmd = ["Set-DnsClientGlobalSetting",
               "-SuffixSearchList", "@(%s)" % src_list]
        self._remote_exec(server, cmd)

    def set_dns_client_server_addresses(self, server, if_index, dns_servers):
        dns_sv_list = ",".join(["'%s'" % dns_sv for dns_sv in dns_servers])
        cmd = ["Set-DnsClientServerAddress",
               "-InterfaceIndex", if_index,
               "-ServerAddresses", "(%s)" % dns_sv_list]
        self._remote_exec(server, cmd)

    def set_win_reg_value(self, server, path, key, value):
        cmd = ['Set-ItemProperty', '-Path', self.quote_string(path),
               '-Name', key, '-Value', value]
        self._remote_exec(server, cmd)

    def get_win_reg_value(self, server, path, name=None):
        cmd = "Get-ItemProperty -Path %s" % self.quote_string(path)
        if name:
            cmd += " | Select-Object -ExpandProperty %s" % name
        return self._remote_exec(server, cmd, retry=False)[0]

    def quote_string(self, string):
        return '"%s"' % string


text:
This section describes the main preprocessing steps applied to source and referential data prior, either prior to a linking operation between a source file and a referential, or as a normalization project by itself.

* [Data type inference](data_type_inference.md)
* [Data type normalization](data_type_normalization.md)
* [Maintenance of static resources used by both inference and normalization](resource_maintenance.md)


text:
<?php

defined('_JEXEC') or die;

/**
 * beezDivision chrome.
 *
 * @since   3.0
 */
function modChrome_beezDivision($module, &$params, &$attribs)
{
	$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
	if (!empty ($module->content)) { ?>
<div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>">
<?php if ($module->showtitle) { ?> <h<?php echo $headerLevel; ?>><?php echo $module->title; ?></h<?php echo $headerLevel; ?>>
<?php }; ?> <?php echo $module->content; ?>

<?php };
}

/**
 * beezHide chrome.
 *
 * @since   3.0
 */
function modChrome_beezHide($module, &$params, &$attribs)
{
	$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
	$state = isset($attribs['state']) ? (int) $attribs['state'] :0;

	if (!empty ($module->content)) { ?>

<div
	class="moduletable_js <?php echo htmlspecialchars($params->get('moduleclass_sfx'));?>"><?php if ($module->showtitle) : ?>
<h<?php echo $headerLevel; ?> class="js_heading"> <?php echo $module->title; ?> <a href="#"
	title="<?php echo JText::_('TPL_BEEZ3_CLICK'); ?>"
	onclick="auf('module_<?php echo $module->id; ?>'); return false"
	class="opencloselink" id="link_<?php echo $module->id?>"> <img src="templates/beez3/images/plus.png"
	alt="<?php if ($state == 1) { echo JText::_('TPL_BEEZ3_ALTOPEN');} else {echo JText::_('TPL_BEEZ3_ALTCLOSE');} ?>" />
</h<?php echo $headerLevel; ?>> <?php endif; ?>
<div class="module_content <?php if ($state == 1){echo "open";} ?>"
	id="module_<?php echo $module->id; ?>" tabindex="-1"><?php echo $module->content; ?>

	<?php }
}

/**
 * beezTabs chrome.
 *
 * @since   3.0
 */
function modChrome_beezTabs($module, $params, $attribs)
{
	$area = isset($attribs['id']) ? (int) $attribs['id'] :'1';
	$area = 'area-'.$area;

	static $modulecount;
	static $modules;

	if ($modulecount < 1)
	{
		$modulecount = count(JModuleHelper::getModules($module->position));
		$modules = array();
	}

	if ($modulecount == 1)
	{
		$temp = new stdClass;
		$temp->content = $module->content;
		$temp->title = $module->title;
		$temp->params = $module->params;
		$temp->id = $module->id;
		$modules[] = $temp;
		// list of moduletitles
		// list of moduletitles
		echo '

';

		foreach ($modules as $rendermodule)
		{
			echo '
id.'" class="linkopen" onclick="tabshow(\'module_'. $rendermodule->id.'\');return false">'.$rendermodule->title.'
';
		}
		echo '
';
		$counter = 0;
		// modulecontent
		foreach ($modules as $rendermodule)
		{
			$counter ++;

			echo '
id.'">';
			echo $rendermodule->content;
			if ($counter != count($modules))
			{
			echo 'id.'\');return false;" id="next_'.$rendermodule->id.'">'.JText::_('TPL_BEEZ3_NEXTTAB').'';
			}
			echo '
';
		}
		$modulecount--;
		echo '
';
	} else {
		$temp = new stdClass;
		$temp->content = $module->content;
		$temp->params = $module->params;
		$temp->title = $module->title;
		$temp->id = $module->id;
		$modules[] = $temp;
		$modulecount--;
	}
}


text:
r"""

A fully rigorous analysis would be expected to integrate zero point
uncertainty and covariance by having the conversion between counts
and flux. However, this is numerically infeasible, as there are so
many observational effects that must be included to get the actual
flux and flux error. Because of this, zero point uncertainty is
generally propagated into analysis by determining the numerical
derivative of the parameters of interest (generally apparent magnitude,
stretch and colour of the supernovae) with respect to the zero points
by simulations. In doing this, there is an assumption made about the
linearity of the gradient surface.
For our DES-like data sample, we find that numerical derivatives
remain linear on scales exceeding :math:`5\sigma`, and so utilise this method
like previous analyses.

As normal, we take a base light curve, and then - for each band we have -
we shift the flux and flux error for those observations lke we had perturbed
the zero point, and compare the difference in SALT2 fit summary statistics
between the base light curve and the perturbed light curve.

With typical zero point uncertainty estimated to be of the order of :math:`0.01` mag,
we calculate numerical derivatives using that :math:`\delta Z_b = 0.01`. Identical results were
used found when using :math:`\delta Z_b = 0.05` and when using either Newton's
difference quotient or symmetric difference quotient.

Using several thousand supernova and simulating an underlying population
which has dispersion in magnitude, stretch and colour, we produce the following
plot.

.. figure::     ../dessn/investigations/zeropoints/output/sensitivity.png
    :align:     center
    :width:     60%

    The lighter and more disperse colours show the numerical gradients I
    have calculated. The darker, tighter and discontinuous lines are
    gradients Chris Lidman has calculated (using canonical supernova). Whilst
    he is using DES observations and I assume fixed cadence, the disparity
    between the curves is a concern and needs to be figured out. I should note
    that the underlying population I draw from is not the issue here - I still have
    many times his dispersion when I collapse my underlying supernova population
    into a delta function.

"""


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

<TITLE>
MessageEventNotificationListener (Smack 3.3.0 Documentation)
</TITLE>

<META NAME="date" CONTENT="2013-05-04">

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

Smack

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.jivesoftware.smackx

Interface MessageEventNotificationListener

public interface MessageEventNotificationListener

A listener that is fired anytime a message event notification is received.
 Message event notifications are received as a consequence of the request
 to receive notifications when sending a message.

Author:

Gaston Dombiak

Method Summary

 void
cancelledNotification(java.lang.String from,
                      java.lang.String packetID)

          Called when a notification that the receiver of the message cancelled the reply
 is received.

 void
composingNotification(java.lang.String from,
                      java.lang.String packetID)

          Called when a notification that the receiver of the message is composing a reply is
 received.

 void
deliveredNotification(java.lang.String from,
                      java.lang.String packetID)

          Called when a notification of message delivered is received.

 void
displayedNotification(java.lang.String from,
                      java.lang.String packetID)

          Called when a notification of message displayed is received.

 void
offlineNotification(java.lang.String from,
                    java.lang.String packetID)

          Called when a notification that the receiver of the message is offline is received.

Method Detail

deliveredNotification

void deliveredNotification(java.lang.String from,
                           java.lang.String packetID)

Called when a notification of message delivered is received.

Parameters:
from - the user that sent the notification.
packetID - the id of the message that was sent.

displayedNotification

void displayedNotification(java.lang.String from,
                           java.lang.String packetID)

Called when a notification of message displayed is received.

Parameters:
from - the user that sent the notification.
packetID - the id of the message that was sent.

composingNotification

void composingNotification(java.lang.String from,
                           java.lang.String packetID)

Called when a notification that the receiver of the message is composing a reply is
 received.

Parameters:
from - the user that sent the notification.
packetID - the id of the message that was sent.

offlineNotification

void offlineNotification(java.lang.String from,
                         java.lang.String packetID)

Called when a notification that the receiver of the message is offline is received.

Parameters:
from - the user that sent the notification.
packetID - the id of the message that was sent.

cancelledNotification

void cancelledNotification(java.lang.String from,
                           java.lang.String packetID)

Called when a notification that the receiver of the message cancelled the reply
 is received.

Parameters:
from - the user that sent the notification.
packetID - the id of the message that was sent.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

Smack

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.


text:
namespace peloton {

// CUCKOO_MAP_TEMPLATE_ARGUMENTS
#define CUCKOO_MAP_TEMPLATE_ARGUMENTS                                \
  template <typename KeyType, typename ValueType, typename HashType, \
            typename PredType>

// CUCKOO_MAP_DEFAULT_ARGUMENTS
#define CUCKOO_MAP_DEFAULT_ARGUMENTS                    \
  template <typename KeyType, typename ValueType,       \
            typename HashType = DefaultHasher<KeyType>, \
            typename PredType = std::equal_to<KeyType>>

// CUCKOO_MAP_TYPE
#define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType, HashType, PredType>

// Iterator type
#define CUCKOO_MAP_ITERATOR_TYPE \
  typename cuckoohash_map<KeyType, ValueType, HashType, PredType>::locked_table

CUCKOO_MAP_DEFAULT_ARGUMENTS
class CuckooMap {
 public:

  CuckooMap();
  CuckooMap(size_t initial_size);
  ~CuckooMap();

  // Inserts a item
  bool Insert(const KeyType &key, ValueType value);

  // Inserts the item if not present, updates value otherwise
  // Upsert operations always succeed
  void Upsert(const KeyType &key, ValueType value);

  // Extracts item with high priority
  bool Update(const KeyType &key, ValueType value);

  // Extracts the corresponding value
  bool Find(const KeyType &key, ValueType &value) const;

  // Delete key from the cuckoo_map
  bool Erase(const KeyType &key);

  // Checks whether the cuckoo_map contains key
  bool Contains(const KeyType &key);

  // Clears the tree (thread safe, not atomic)
  void Clear();

  // Returns item count in the cuckoo_map
  size_t GetSize() const;

  // Checks if the cuckoo_map is empty
  bool IsEmpty() const;

  // Lock the table and get iterator
  // The table would be unlock when the iterator
  // is out of scope
  CUCKOO_MAP_ITERATOR_TYPE
  GetIterator();

  CUCKOO_MAP_ITERATOR_TYPE
  GetConstIterator() const;

 private:

  // cuckoo map
  typedef cuckoohash_map<KeyType, ValueType, HashType, PredType> cuckoo_map_t;

  cuckoo_map_t cuckoo_map;
};

}  // namespace peloton


text:
package com.google.cloud.contactcenterinsights.v1;

import com.google.api.pathtemplate.PathTemplate;
import com.google.api.resourcenames.ResourceName;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
@Generated("by gapic-generator-java")
public class ViewName implements ResourceName {
  private static final PathTemplate PROJECT_LOCATION_VIEW =
      PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/views/{view}");
  private volatile Map<String, String> fieldValuesMap;
  private final String project;
  private final String location;
  private final String view;

  @Deprecated
  protected ViewName() {
    project = null;
    location = null;
    view = null;
  }

  private ViewName(Builder builder) {
    project = Preconditions.checkNotNull(builder.getProject());
    location = Preconditions.checkNotNull(builder.getLocation());
    view = Preconditions.checkNotNull(builder.getView());
  }

  public String getProject() {
    return project;
  }

  public String getLocation() {
    return location;
  }

  public String getView() {
    return view;
  }

  public static Builder newBuilder() {
    return new Builder();
  }

  public Builder toBuilder() {
    return new Builder(this);
  }

  public static ViewName of(String project, String location, String view) {
    return newBuilder().setProject(project).setLocation(location).setView(view).build();
  }

  public static String format(String project, String location, String view) {
    return newBuilder().setProject(project).setLocation(location).setView(view).build().toString();
  }

  public static ViewName parse(String formattedString) {
    if (formattedString.isEmpty()) {
      return null;
    }
    Map<String, String> matchMap =
        PROJECT_LOCATION_VIEW.validatedMatch(
            formattedString, "ViewName.parse: formattedString not in valid format");
    return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("view"));
  }

  public static List<ViewName> parseList(List<String> formattedStrings) {
    List<ViewName> list = new ArrayList<>(formattedStrings.size());
    for (String formattedString : formattedStrings) {
      list.add(parse(formattedString));
    }
    return list;
  }

  public static List<String> toStringList(List<ViewName> values) {
    List<String> list = new ArrayList<>(values.size());
    for (ViewName value : values) {
      if (value == null) {
        list.add("");
      } else {
        list.add(value.toString());
      }
    }
    return list;
  }

  public static boolean isParsableFrom(String formattedString) {
    return PROJECT_LOCATION_VIEW.matches(formattedString);
  }

  @Override
  public Map<String, String> getFieldValuesMap() {
    if (fieldValuesMap == null) {
      synchronized (this) {
        if (fieldValuesMap == null) {
          ImmutableMap.Builder<String, String> fieldMapBuilder = ImmutableMap.builder();
          if (project != null) {
            fieldMapBuilder.put("project", project);
          }
          if (location != null) {
            fieldMapBuilder.put("location", location);
          }
          if (view != null) {
            fieldMapBuilder.put("view", view);
          }
          fieldValuesMap = fieldMapBuilder.build();
        }
      }
    }
    return fieldValuesMap;
  }

  public String getFieldValue(String fieldName) {
    return getFieldValuesMap().get(fieldName);
  }

  @Override
  public String toString() {
    return PROJECT_LOCATION_VIEW.instantiate(
        "project", project, "location", location, "view", view);
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o != null || getClass() == o.getClass()) {
      ViewName that = ((ViewName) o);
      return Objects.equals(this.project, that.project)
          && Objects.equals(this.location, that.location)
          && Objects.equals(this.view, that.view);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= Objects.hashCode(project);
    h *= 1000003;
    h ^= Objects.hashCode(location);
    h *= 1000003;
    h ^= Objects.hashCode(view);
    return h;
  }

  /** Builder for projects/{project}/locations/{location}/views/{view}. */
  public static class Builder {
    private String project;
    private String location;
    private String view;

    protected Builder() {}

    public String getProject() {
      return project;
    }

    public String getLocation() {
      return location;
    }

    public String getView() {
      return view;
    }

    public Builder setProject(String project) {
      this.project = project;
      return this;
    }

    public Builder setLocation(String location) {
      this.location = location;
      return this;
    }

    public Builder setView(String view) {
      this.view = view;
      return this;
    }

    private Builder(ViewName viewName) {
      this.project = viewName.project;
      this.location = viewName.location;
      this.view = viewName.view;
    }

    public ViewName build() {
      return new ViewName(this);
    }
  }
}


text:
import os, time, datetime, logging, warnings
import pandas as pd

from DataBase.Start_DB_Server import SetAdminUser, StartServer, ShutdownServer
from FetchData.Fetch_Data_Stock_US_Daily import updateStockData_US_Daily
from FetchData.Fetch_Data_Stock_CHN_Daily import updateStockData_CHN_Daily

if __name__ == "__main__":
    pd.set_option('precision', 3)
    pd.set_option('display.width',1000)
    warnings.filterwarnings('ignore', category=pd.io.pytables.PerformanceWarning)

    logging.basicConfig(level=logging.ERROR)
    cur_path = os.path.dirname(os.path.abspath(__file__))
    root_path = cur_path[0:cur_path.rfind('/', 0, len(cur_path))]

    # start database server (async)
    thread = StartServer(root_path)

    # wait for db start, the standard procedure should listen to
    # the completed event of function "StartServer"
    time.sleep(5)

    # from arctic import Arctic
    # store = Arctic("localhost")
    # database = "DB_STOCK", "SHEET_CHN_DAILY"
    #store.delete_library(database)
    # try:
    #     library = store[database]
    # except:
    #     store.initialize_library(database)
    #     library = store[database]

    # library.delete("StockList")
    # library.delete("StockPublishDay")

    # item = library.read('000001')
    # print(item.data)
    # item = library.read('000002')
    # print(item.data)
    # item = library.read('ELEC')
    # print(item.data)
    # item = library.read('DJCO')
    # print(item.data)
    # item = library.read('BLVD')
    # print(item.data)
    # item = library.read('KEN')
    # print(item.data)

    now = datetime.datetime.now().strftime("%Y-%m-%d")

    # Fetch US Stock
    # updateStockData_US_Daily(root_path, "1990-01-01", now)

    # Fetch CHN Stock
    #updateStockData_CHN_Daily(root_path)

    # stop database server (sync)
    time.sleep(5)
    ShutdownServer()


text:
package mapper

import (
	"github.com/rancher/norman/types"
)

type ReadOnly struct {
	Field     string
	Optional  bool
	SubFields bool
}

func (r ReadOnly) FromInternal(data map[string]interface{}) {
}

func (r ReadOnly) ToInternal(data map[string]interface{}) error {
	return nil
}

func (r ReadOnly) readOnly(field types.Field, schema *types.Schema, schemas *types.Schemas) types.Field {
	field.Create = false
	field.Update = false

	if r.SubFields {
		subSchema := schemas.Schema(&schema.Version, field.Type)
		if subSchema != nil {
			for name, field := range subSchema.ResourceFields {
				field.Create = false
				field.Update = false
				subSchema.ResourceFields[name] = field
			}
		}
	}

	return field
}

func (r ReadOnly) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
	if r.Field == "*" {
		for name, field := range schema.ResourceFields {
			schema.ResourceFields[name] = r.readOnly(field, schema, schemas)
		}
		return nil
	}

	if err := ValidateField(r.Field, schema); err != nil {
		if r.Optional {
			return nil
		}
		return err
	}

	field := schema.ResourceFields[r.Field]
	schema.ResourceFields[r.Field] = r.readOnly(field, schema, schemas)

	return nil
}


text:
package com.gooddata.sdk.service;

import com.gooddata.sdk.common.GoodDataException;

import java.util.concurrent.TimeUnit;

/**
 * Represents the result retrieved by polling on the REST API.
 */
public interface FutureResult<T> {

    /**
     * Checks if the result is available
     *
     * @return true if so
     * @throws GoodDataException when polling fails or the thread was interrupted
     */
    boolean isDone();

    /**
     * Wait for the result to be available and return it's value
     *
     * @return result value
     * @throws GoodDataException when polling fails or the thread was interrupted
     */
    T get();

    /**
     * Wait for the result to be available up to given time and return it's value
     *
     * @param timeout timeout value
     * @param unit    timeout unit
     * @return result value
     * @throws GoodDataException when polling fails, the timeout expires or the thread was interrupted
     */
    T get(final long timeout, final TimeUnit unit);

    /**
     * Get URI used for polling
     *
     * @return URI string
     */
    String getPollingUri();
}