text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.example.note;

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int create_note=0x7f020000;
        public static final int ic_launcher=0x7f020001;
        public static final int ic_menu_delete=0x7f020002;
        public static final int ic_menu_save=0x7f020003;
        public static final int notelist=0x7f020004;
        public static final int notetop=0x7f020005;
    }
    public static final class id {
        public static final int addnotebutton=0x7f070007;
        public static final int body=0x7f070004;
        public static final int btmLayout=0x7f070006;
        public static final int date_row=0x7f070009;
        public static final int menu_about=0x7f07000c;
        public static final int menu_delete=0x7f07000b;
        public static final int menu_save=0x7f07000a;
        public static final int notelist_date=0x7f070003;
        public static final int text1=0x7f070008;
        public static final int textViewTop=0x7f070005;
        public static final int title=0x7f070002;
        public static final int title_text1=0x7f070001;
        public static final int toplayout=0x7f070000;
    }
    public static final class layout {
        public static final int note_edit=0x7f030000;
        public static final int notelist=0x7f030001;
        public static final int notes_row=0x7f030002;
    }
    public static final class menu {
        public static final int noteedit_menu=0x7f060000;
        public static final int notelist_menu=0x7f060001;
    }
    public static final class string {
        public static final int about=0x7f040002;
        public static final int app_name=0x7f040000;
        public static final int delete_menu_noteedit=0x7f040008;
        public static final int edit_note=0x7f040006;
        public static final int hello_world=0x7f040001;
        public static final int menu_delete=0x7f040004;
        public static final int no_title=0x7f040005;
        public static final int save_menu_noteedit=0x7f040007;
        public static final int title=0x7f040003;
    }
    public static final class style {
        /**
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.

            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.

        Base application theme for API 11+. This theme completely replaces
        AppBaseTheme from res/values/styles.xml on API 11+ devices.

 API 11 theme customizations can go here.

        Base application theme for API 14+. This theme completely replaces
        AppBaseTheme from BOTH res/values/styles.xml and
        res/values-v11/styles.xml on API 14+ devices.

 API 14 theme customizations can go here.
         */
        public static final int AppBaseTheme=0x7f050000;
        /**  Application theme.
 All customizations that are NOT specific to a particular API-level can go here.
         */
        public static final int AppTheme=0x7f050001;
    }
}


text:
import { FormControl, ValidatorFn } from '@angular/forms';

import { rangeLength } from './validator';

describe('RangeLength [4,9],', () => {
  let control: FormControl;
  let validator: ValidatorFn;

  beforeEach(() => {
    validator = rangeLength([4, 9]);
  });

  it('"abc" should equal to "{rangeLength: true}"', () => {
    control = new FormControl('abc');
    expect(validator(control)).toEqual({rangeLength: true});
  });

  it('"abcd" should equal to "null"', () => {
    control = new FormControl('abcd');
    expect(validator(control)).toBeNull();
  });

  it('"abcdefghi" should equal to "null"', () => {
    control = new FormControl('abcdefghi');
    expect(validator(control)).toBeNull();
  });

  it('"abcdefghij" should equal to "{rangeLength: true}"', () => {
    control = new FormControl('abcdefghij');
    expect(validator(control)).toEqual({rangeLength: true});
  });
});

redpajama_set_name: RedPajamaGithub


text:
__An open source Ruby on Rails content management system for Rails 3.__

Refinery also supports Rails 2.x using the [Rails 2.x stable branch](http://github.com/resolve/refinerycms/tree/rails2-stable). More information at [http://refinerycms.com](http://refinerycms.com)

## Requirements

* [Bundler](http://gembundler.com)
* [ImageMagick](http://www.imagemagick.org/script/install-source.php)

## How to

* __[Install Refinery CMS](http://refinerycms.com/download)__
* [Update Refinery CMS to the latest version](http://refinerycms.com/guides/how-to-update-refinery-to-the-latest-version)
* [Install Refinery CMS on Heroku](http://refinerycms.com/guides/how-to-install-refinery-on-heroku)
* [Run the Refinery CMS test suite](http://refinerycms.com/guides/how-to-test-refinery)
* __[Contribute to Refinery CMS](http://refinerycms.com/guides/how-to-contribute-to-refinery)__
* __[Donate to the Refinery CMS core team](http://pledgie.com/campaigns/8431)__

## Getting Started

If you're new to Refinery, start with this guide:

* __[Getting started with Refinery](http://refinerycms.com/guides/getting-started-with-refinery)__

## What's it good at?

__Refinery is great for sites where the client needs to be able to update their website themselves__ without being bombarded with anything too complicated.

Unlike other content managers, Refinery is truly __aimed at the end user__ making it easy for them to pick up and make changes themselves.

### For developers

* Easily customise the look to suit the business.
* __[Extend with custom engines](http://github.com/resolve/refinerycms/blob/master/core/engines.md#readme)__ to do anything Refinery doesn't do out of the box.
* Sticks to __"the Rails way"__ as much as possible; we don't force you to learn new templating languages.
* Uses [jQuery](http://jquery.com/) for fast and concise Javascript.

![Refinery Dashboard](http://refinerycms.com/system/images/0000/0576/dashboard.png)

Wanna see Refinery for yourself? [Try the demo](http://demo.refinerycms.com/refinery)

## Help and Documentation

* [Getting Started](http://refinerycms.com/guides/getting-started-with-refinery)
* [Guides](http://refinerycms.com/guides)
* [Google Group Discussion](http://group.refinerycms.org)
* [IRC Channel](irc://irc.freenode.net/refinerycms)
* [GitHub repository](http://github.com/resolve/refinerycms)
* [Developer/API documentation](http://api.refinerycms.org)
* [Twitter Account](http://twitter.com/refinerycms)
* Documentation about: [Pages](http://github.com/resolve/refinerycms/blob/master/pages/readme.md#readme), [Images](http://github.com/resolve/refinerycms/blob/master/images/readme.md#readme), [Files](http://github.com/resolve/refinerycms/blob/master/resources/readme.md#readme), [Inquiries](http://github.com/resolve/refinerycms-inquiries/blob/master/readme.md#readme), [Settings](http://github.com/resolve/refinerycms/blob/master/settings/readme.md#readme), [Dashboard](http://github.com/resolve/refinerycms/blob/master/dashboard/readme.md#readme), [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/authentication/readme.md#readme), [Extending with Engines](http://github.com/resolve/refinerycms/blob/master/core/engines.md#readme).

## Features

### [Pages](http://github.com/resolve/refinerycms/blob/master/pages/readme.md#readme)

* Easily edit and manage pages with a [WYSIWYG visual editor](http://www.wymeditor.org/).
* Manage you site's structure.

### [Images](http://github.com/resolve/refinerycms/blob/master/images/readme.md#readme) & [Files](http://github.com/resolve/refinerycms/blob/master/resources/readme.md#readme)

* Easily upload and insert images.
* Upload and link to resources such as PDF documents.
* Uses the popular [Dragonfly](http://github.com/markevans/dragonfly).
* Supports storage on Amazon S3.

### [Inquiries](http://github.com/resolve/refinerycms-inquiries/blob/master/readme.md#readme)

* Collect inquiries from a contact form.
* Manage your inquiries and be notified when new ones come in.
* Checks new inquiries for spam.

### [Settings](http://github.com/resolve/refinerycms/blob/master/settings/readme.md#readme)

* Manage the behaviour of Refinery
* Easily integrate with [Google Analytics](https://www.google.com/analytics/)

### [Dashboard](http://github.com/resolve/refinerycms/blob/master/dashboard/readme.md#readme)

* Get an overview of what has been updated recently and see recent inquiries.

### [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/authentication/readme.md#readme)

* Manage who can access Refinery.
* Control which engines each user has access to.
* Uses the popular [authlogic](http://github.com/binarylogic/authlogic).

### ...Want more? [Extend with Engines](http://github.com/resolve/refinerycms/blob/master/core/engines.md#readme)

Extend Refinery easily by running the Refinery engine generator

    rails generate refinery_engine

to get help on how to use that. Or read the full documentation on [writing engines for Refinery](http://github.com/resolve/refinerycms/blob/master/core/engines.md#readme)

### Popular Engines

* [Blog](http://github.com/resolve/refinerycms-blog) - A simple blogging engine that supports posts, categories and comments (with moderation support if you choose to enable it)
* [Portfolio](http://github.com/resolve/refinerycms-portfolio) - manage groups of images like an image gallery.
* [News](http://github.com/resolve/refinerycms-news) - post and manage news items.

[Full engine list here](http://github.com/resolve/refinerycms/wiki/engines)

### Example Site Showcase

[List here (add your link when you're done)](http://github.com/resolve/refinerycms/wiki/Example-Site-Showcase)

## License

Refinery is released under the [MIT license](http://github.com/resolve/refinerycms/blob/master/license.md#readme) and is copyright (c) 2005-2010 [Resolve Digital](http://www.resolvedigital.com)


text:
FactoryBot.define do
  factory :dismissal do
    dismissal_reason
    enrollment
    date { Date.today }
  end
end


text:
package io.hydrosphere.mist.api

trait MLMistJob extends ContextSupport


text:
<?php
namespace Concrete\Core\User;

use Concrete\Core\Foundation\Object;
use Concrete\Core\Http\Request;
use Concrete\Core\Support\Facade\Application;
use Concrete\Core\User\Group\Group;
use Concrete\Core\Authentication\AuthenticationType;
use Concrete\Core\Page\Page;
use Concrete\Core\User\Group\GroupList;
use Hautelook\Phpass\PasswordHash;
use Concrete\Core\Permission\Access\Entity\Entity as PermissionAccessEntity;
use Concrete\Core\User\Point\Action\Action as UserPointAction;

class User extends Object
{
    public $uID = '';
    public $uName = '';
    public $uGroups = array();
    public $superUser = false;
    public $uTimezone = null;
    protected $uDefaultLanguage = null;
    // an associative array of all access entity objects that are associated with this user.
    protected $accessEntities = array();
    protected $hasher;
    protected $uLastPasswordChange;

    /** Return an User instance given its id (or null if it's not found)
     * @param int $uID The id of the user
     * @param bool $login = false Set to true to make the user the current one
     * @param bool $cacheItemsOnLogin = false Set to true to cache some items when $login is true
     *
     * @return User|null
     */
    public static function getByUserID($uID, $login = false, $cacheItemsOnLogin = true)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        $v = array($uID);
        $q = "SELECT uID, uName, uIsActive, uLastOnline, uTimezone, uDefaultLanguage, uLastPasswordChange FROM Users WHERE uID = ? LIMIT 1";
        $r = $db->query($q, $v);
        $row = $r ? $r->FetchRow() : null;
        $nu = null;
        if ($row) {
            $nu = new static();
            $nu->setPropertiesFromArray($row);
            $nu->uGroups = $nu->_getUserGroups(true);
            $nu->superUser = ($nu->getUserID() == USER_SUPER_ID);
            if ($login) {
                $nu->persist($cacheItemsOnLogin);
                $nu->recordLogin();
            }
        }

        return $nu;
    }

    /**
     * @param int $uID
     *
     * @return User
     */
    public static function loginByUserID($uID)
    {
        return static::getByUserID($uID, true);
    }

    public static function isLoggedIn()
    {
        $app = Application::getFacadeApplication();
        $session = $app['session'];

        return $session->has('uID') && $session->get('uID') > 0;
    }

    public function checkLogin()
    {
        $app = Application::getFacadeApplication();
        $session = $app['session'];
        $config = $app['config'];

        $aeu = $config->get('concrete.misc.access_entity_updated');
        if ($aeu && $aeu > $session->get('accessEntitiesUpdated')) {
            self::refreshUserGroups();
        }

        $app->make('Concrete\Core\Session\SessionValidatorInterface')->handleSessionValidation($session);

        if ($session->get('uID') > 0) {
            $db = $app['database']->connection();

            $row = $db->GetRow("select uID, uIsActive, uLastPasswordChange, ulsPasswordReset from Users where uID = ? and uName = ?", array($session->get('uID'), $session->get('uName')));
            $checkUID = (isset($row['uID'])) ? ($row['uID']) : (false);

            if ($checkUID == $session->get('uID')) {
                if (!$row['uIsActive']) {
                    return false;
                }

                if ($row['uLastPasswordChange'] > $session->get('uLastPasswordChange')) {
                    $this->loadError(USER_SESSION_EXPIRED);

                    return false;
                }

                if ($row['ulsPasswordReset']) {
                    return false;
                }

                $session->set('uOnlineCheck', time());
                if (($session->get('uOnlineCheck') - $session->get('uLastOnline') > (ONLINE_NOW_TIMEOUT / 2))) {
                    $db->query("update Users set uLastOnline = ? where uID = ?", array($session->get('uOnlineCheck'), $this->uID));
                    $session->set('uLastOnline', $session->get('uOnlineCheck'));
                }

                return true;
            } else {
                return false;
            }
        }
    }

    public function getUserInfoObject()
    {
        return UserInfo::getByID($this->uID);
    }

    public function __construct()
    {
        $app = Application::getFacadeApplication();
        $args = func_get_args();
        $session = $app['session'];
        $config = $app['config'];

        if (isset($args[1])) {
            // first, we check to see if the username and password match the admin username and password
            // $username = uName normally, but if not it's email address

            $username = $args[0];
            $password = $args[1];
            $disableLogin = isset($args[2]) ? (bool) $args[2] : false;
            if (!$disableLogin) {
                $session->remove('uGroups');
                $session->remove('accessEntities');
            }
            $v = array($username);
            if ($config->get('concrete.user.registration.email_registration')) {
                $q = "select uID, uName, uIsActive, uIsValidated, uTimezone, uDefaultLanguage, uPassword, uLastPasswordChange from Users where uEmail = ?";
            } else {
                $q = "select uID, uName, uIsActive, uIsValidated, uTimezone, uDefaultLanguage, uPassword, uLastPasswordChange from Users where uName = ?";
            }

            $db = $app->make('Concrete\Core\Database\Connection\Connection');
            $r = $db->query($q, $v);
            if ($r) {
                $row = $r->fetchRow();
                $pw_is_valid_legacy = ($config->get('concrete.user.password.legacy_salt') && self::legacyEncryptPassword($password) == $row['uPassword']);
                $pw_is_valid = $pw_is_valid_legacy || $this->getUserPasswordHasher()->checkPassword($password, $row['uPassword']);
                if ($row['uID'] && $row['uIsValidated'] === '0' && $config->get('concrete.user.registration.validate_email')) {
                    $this->loadError(USER_NON_VALIDATED);
                } elseif ($row['uID'] && $row['uIsActive'] && $pw_is_valid) {
                    $this->uID = $row['uID'];
                    $this->uName = $row['uName'];
                    $this->uIsActive = $row['uIsActive'];
                    $this->uTimezone = $row['uTimezone'];
                    $this->uDefaultLanguage = $row['uDefaultLanguage'];
                    $this->uLastPasswordChange = $row['uLastPasswordChange'];
                    $this->uGroups = $this->_getUserGroups($disableLogin);
                    if ($row['uID'] == USER_SUPER_ID) {
                        $this->superUser = true;
                    } else {
                        $this->superUser = false;
                    }
                    $this->recordLogin();
                    if (!$disableLogin) {
                        $this->persist();
                    }
                } elseif ($row['uID'] && !$row['uIsActive']) {
                    $this->loadError(USER_INACTIVE);
                } else {
                    $this->loadError(USER_INVALID);
                }
                $r->free();
                if ($pw_is_valid_legacy) {
                    // this password was generated on a previous version of Concrete5.
                    // We re-hash it to make it more secure.
                    $v = array($this->getUserPasswordHasher()->HashPassword($password), $this->uID);
                    $db->execute($db->prepare("update Users set uPassword = ? where uID = ?"), $v);
                }
            } else {
                $this->getUserPasswordHasher()->hashpassword($password); // hashpassword and checkpassword are slow functions.
                // We run one here just take time.
                // Without it an attacker would be able to tell that the
                // username doesn't exist using a timing attack.
                $this->loadError(USER_INVALID);
            }
        } else {
            $req = Request::getInstance();
            if ($req->hasCustomRequestUser()) {
                $this->uID = null;
                $this->uName = null;
                $this->superUser = false;
                $this->uDefaultLanguage = null;
                $this->uTimezone = null;
                $ux = $req->getCustomRequestUser();
                if ($ux && is_object($ux)) {
                    $this->uID = $ux->getUserID();
                    $this->uName = $ux->getUserName();
                    $this->superUser = $ux->getUserID() == USER_SUPER_ID;
                    if ($ux->getUserDefaultLanguage()) {
                        $this->uDefaultLanguage = $ux->getUserDefaultLanguage();
                    }
                    $this->uTimezone = $ux->getUserTimezone();
                }
            } elseif ($session->has('uID')) {
                $this->uID = $session->get('uID');
                $this->uName = $session->get('uName');
                $this->uTimezone = $session->get('uTimezone');
                if ($session->has('uDefaultLanguage')) {
                    $this->uDefaultLanguage = $session->get('uDefaultLanguage');
                }
                $this->superUser = ($session->get('uID') == USER_SUPER_ID) ? true : false;
            } else {
                $this->uID = null;
                $this->uName = null;
                $this->superUser = false;
                $this->uDefaultLanguage = null;
                $this->uTimezone = null;
            }
            $this->uGroups = $this->_getUserGroups();
            if (!isset($args[2]) && !$req->hasCustomRequestUser()) {
                $session->set('uGroups', $this->uGroups);
            }
        }

        return $this;
    }

    public function recordLogin()
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();
        $uLastLogin = $db->getOne("select uLastLogin from Users where uID = ?", array($this->uID));

        /** @var \Concrete\Core\Permission\IPService $iph */
        $iph = $app->make('helper/validation/ip');
        $ip = $iph->getRequestIP();
        $db->query("update Users set uLastIP = ?, uLastLogin = ?, uPreviousLogin = ?, uNumLogins = uNumLogins + 1 where uID = ?", array(($ip === false) ? ('') : ($ip->getIp()), time(), $uLastLogin, $this->uID));
    }

    public function recordView($c)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        $uID = ($this->uID > 0) ? $this->uID : 0;
        $cID = $c->getCollectionID();
        $v = array($cID, $uID);
        $db->query("insert into PageStatistics (cID, uID, date) values (?, ?, NOW())", $v);
    }

    // $salt is retained for compatibilty with older versions of concerete5, but not used.
    public function encryptPassword($uPassword, $salt = null)
    {
        return $this->getUserPasswordHasher()->HashPassword($uPassword);
    }

    // this is for compatibility with passwords generated in older versions of Concrete5.
    // Use only for checking password hashes, not generating new ones to store.
    public function legacyEncryptPassword($uPassword)
    {
        $app = Application::getFacadeApplication();

        return md5($uPassword . ':' . $app['config']->get('concrete.user.password.legacy_salt'));
    }

    public function isActive()
    {
        return $this->uIsActive;
    }

    public function isSuperUser()
    {
        return $this->superUser;
    }

    public function getLastOnline()
    {
        return isset($this->uLastOnline) ? $this->uLastOnline : null;
    }

    public function getUserName()
    {
        return $this->uName;
    }

    public function isRegistered()
    {
        return $this->getUserID() > 0;
    }

    public function getUserID()
    {
        return $this->uID;
    }

    public function getUserTimezone()
    {
        return $this->uTimezone;
    }

    public function getUserSessionValidSince()
    {
        return $this->uLastPasswordChange;
    }

    public function setAuthTypeCookie($authType)
    {
        $app = Application::getFacadeApplication();
        $config = $app['config'];
        $jar = $app['cookie'];

        $cookie = array($this->getUserID(), $authType);
        $at = AuthenticationType::getByHandle($authType);
        $cookie[] = $at->controller->buildHash($this);

        $jar->set(
            'ccmAuthUserHash',
            implode(':', $cookie),
            time() + USER_FOREVER_COOKIE_LIFETIME,
            DIR_REL . '/',
            $config->get('concrete.session.cookie.cookie_domain'),
            $config->get('concrete.session.cookie.cookie_secure'),
            $config->get('concrete.session.cookie.cookie_httponly')
        );
    }

    public function setLastAuthType(AuthenticationType $at)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();
        $db->Execute('UPDATE Users SET uLastAuthTypeID=? WHERE uID=?', array($at->getAuthenticationTypeID(), $this->getUserID()));
    }

    public function getLastAuthType()
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();
        $id = $db->getOne('SELECT uLastAuthTypeID FROM Users WHERE uID=?', array($this->getUserID()));

        return intval($id);
    }

    public function unloadAuthenticationTypes()
    {
        $ats = AuthenticationType::getList();
        foreach ($ats as $at) {
            $at->controller->deauthenticate($this);
        }
    }

    public function logout($hard = true)
    {
        $app = Application::getFacadeApplication();
        $events = $app['director'];

        // First, we check to see if we have any collection in edit mode
        $this->unloadCollectionEdit();
        $this->unloadAuthenticationTypes();

        $this->invalidateSession($hard);
        $events->dispatch('on_user_logout');
    }

    public function invalidateSession($hard = true)
    {
        $app = Application::getFacadeApplication();
        $session = $app['session'];
        $config = $app['config'];
        $cookie = $app['cookie'];

        // @todo remove this hard option if `Session::clear()` does what we need.
        if (!$hard) {
            $session->clear();
        } else {
            $session->invalidate();
        }

        if ($cookie->has('ccmAuthUserHash') && $cookie->get('ccmAuthUserHash')) {
            $cookie->set('ccmAuthUserHash',
                '',
                315532800,
                DIR_REL . '/',
                $config->get('concrete.session.cookie.cookie_domain'),
                $config->get('concrete.session.cookie.cookie_secure'),
                $config->get('concrete.session.cookie.cookie_httponly')
            );
        }

        $loginCookie = sprintf('%s_LOGIN', $app['config']->get('concrete.session.name'));
        if ($cookie->has($loginCookie) && $cookie->get($loginCookie)) {
            $cookie->clear($loginCookie, 1);
        }
    }

    public static function verifyAuthTypeCookie()
    {
        if ($cookie = array_get($_COOKIE, 'ccmAuthUserHash')) {
            list($_uID, $authType, $uHash) = explode(':', $cookie);
            $at = AuthenticationType::getByHandle($authType);
            $u = self::getByUserID($_uID);
            if ((!is_object($u)) || $u->isError()) {
                return;
            }
            if ($at->controller->verifyHash($u, $uHash)) {
                self::loginByUserID($_uID);
            }
        }
    }

    public function getUserGroupObjects()
    {
        $gs = new GroupList();
        $gs->filterByUserID($this->uID);

        return $gs->getResults();
    }

    public function getUserGroups()
    {
        return $this->uGroups;
    }

    /**
     * Sets a default language for a user record.
     */
    public function setUserDefaultLanguage($lang)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();
        $session = $app['session'];

        $this->uDefaultLanguage = $lang;
        $session->set('uDefaultLanguage', $lang);
        $db->Execute('update Users set uDefaultLanguage = ? where uID = ?', array($lang, $this->getUserID()));
    }

    /**
     * Gets the default language for the logged-in user.
     */
    public function getUserDefaultLanguage()
    {
        return $this->uDefaultLanguage;
    }

    /**
     * Gets the default language for the logged-in user.
     */
    public function getLastPasswordChange()
    {
        return $this->uLastPasswordChange;
    }

    /**
     * Checks to see if the current user object is registered. If so, it queries that records
     * default language. Otherwise, it falls back to sitewide settings.
     */
    public function getUserLanguageToDisplay()
    {
        if ($this->getUserDefaultLanguage() != '') {
            return $this->getUserDefaultLanguage();
        } else {
            $app = Application::getFacadeApplication();
            $config = $app['config'];

            return $config->get('concrete.locale');
        }
    }

    public function refreshUserGroups()
    {
        $app = Application::getFacadeApplication();
        $session = $app['session'];

        $session->remove('uGroups');
        $session->remove('accessEntities');
        $ug = $this->_getUserGroups();
        $session->set('uGroups', $ug);
        $this->uGroups = $ug;
    }

    public function getUserAccessEntityObjects()
    {
        $app = Application::getFacadeApplication();
        $req = Request::getInstance();
        $session = $app['session'];

        if ($req->hasCustomRequestUser()) {
            // we bypass session-saving performance
            // and we don't save them in session.
            return PermissionAccessEntity::getForUser($this);
        }

        if ($session->has('accessEntities')) {
            $entities = $session->get('accessEntities');
        } else {
            $entities = PermissionAccessEntity::getForUser($this);
            $session->set('accessEntities', $entities);
            $session->set('accessEntitiesUpdated', time());
        }

        return $entities;
    }

    public function _getUserGroups($disableLogin = false)
    {
        $app = Application::getFacadeApplication();
        $req = Request::getInstance();
        $session = $app['session'];

        if (($session->has('uGroups')) && (!$disableLogin) && (!$req->hasCustomRequestUser())) {
            $ug = $session->get('uGroups');
        } else {
            $db = $app['database']->connection();
            if ($this->uID) {
                $ug[REGISTERED_GROUP_ID] = REGISTERED_GROUP_ID;

                $uID = $this->uID;
                $q = "select gID from UserGroups where uID = ?";
                $r = $db->query($q, array($uID));
                while ($row = $r->fetch()) {
                    $g = Group::getByID($row['gID']);
                    if ($g->isUserExpired($this)) {
                        $this->exitGroup($g);
                    } else {
                        $ug[$row['gID']] = $row['gID'];
                    }
                }
            }

            // now we populate also with guest information, since presumably logged-in users
            // see the same stuff as guest
            $ug[GUEST_GROUP_ID] = GUEST_GROUP_ID;
        }

        return $ug;
    }

    public function enterGroup($g)
    {
        $app = Application::getFacadeApplication();
        // takes a group object, and, if the user is not already in the group, it puts them into it
        $dt = $app->make('helper/date');

        if (is_object($g)) {
            if (!$this->inGroup($g)) {
                $gID = $g->getGroupID();
                $db = $app['database']->connection();

                $db->Replace('UserGroups', array(
                    'uID' => $this->getUserID(),
                    'gID' => $g->getGroupID(),
                    'ugEntered' => $dt->getOverridableNow(),
                ),
                array('uID', 'gID'), true);

                if ($g->isGroupBadge()) {
                    $action = UserPointAction::getByHandle('won_badge');
                    if (is_object($action)) {
                        $action->addDetailedEntry($this, $g);
                    }

                    $mh = $app->make('mail');
                    $ui = UserInfo::getByID($this->getUserID());
                    $mh->addParameter('badgeName', $g->getGroupDisplayName(false));
                    $mh->addParameter('uDisplayName', $ui->getUserDisplayName());
                    $mh->addParameter('uProfileURL', (string) $ui->getUserPublicProfileURL());
                    $mh->addParameter('siteName', tc('SiteName', $app['config']->get('concrete.site')));
                    $mh->to($ui->getUserEmail());
                    $mh->load('won_badge');
                    $mh->sendMail();
                }

                $ue = new \Concrete\Core\User\Event\UserGroup($this);
                $ue->setGroupObject($g);

                $app['director']->dispatch('on_user_enter_group', $ue);
            }
        }
    }

    public function exitGroup($g)
    {

        // takes a group object, and, if the user is in the group, they exit the group
        if (is_object($g)) {
            $app = Application::getFacadeApplication();
            $db = $app['database']->connection();

            $gID = $g->getGroupID();

            $ue = new \Concrete\Core\User\Event\UserGroup($this);
            $ue->setGroupObject($g);
            $app['director']->dispatch('on_user_exit_group', $ue);

            $q = 'delete from UserGroups where uID = ? and gID = ?';
            $r = $db->executeQuery($q, array($this->uID, $gID));
        }
    }

    public function inGroup($g)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        $v = array($this->uID, $g->getGroupID());
        $cnt = $db->GetOne("select gID from UserGroups where uID = ? and gID = ?", $v);

        return $cnt > 0;
    }

    public function loadMasterCollectionEdit($mcID, $ocID)
    {
        $app = Application::getFacadeApplication();
        $session = $app['session'];
        // basically, this function loads the master collection ID you're working on into session
        // so you can work on it without the system failing because you're editing a template
        $session->set('mcEditID', $mcID);
        $session->set('ocID', $ocID);
    }

    public function loadCollectionEdit(&$c)
    {
        $c->refreshCache();

        // can only load one page into edit mode at a time.
        if ($c->isCheckedOut()) {
            return false;
        }

        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        $cID = $c->getCollectionID();
        // first, we check to see if we have a collection in edit mode. If we do, we relinquish it
        $this->unloadCollectionEdit(false);

        $q = 'select cIsCheckedOut, cCheckedOutDatetime from Pages where cID = ?';
        $r = $db->executeQuery($q, array($cID));
        if ($r) {
            $row = $r->fetchRow();
            if (!$row['cIsCheckedOut']) {
                $app['session']->set('editCID', $cID);
                $uID = $this->getUserID();
                $dh = $app->make('helper/date');
                $datetime = $dh->getOverridableNow();
                $q2 = 'update Pages set cIsCheckedOut = ?, cCheckedOutUID = ?, cCheckedOutDatetime = ?, cCheckedOutDatetimeLastEdit = ? where cID = ?';
                $r2 = $db->executeQuery($q2, array(1, $uID, $datetime, $datetime, $cID));

                $c->cIsCheckedOut = 1;
                $c->cCheckedOutUID = $uID;
                $c->cCheckedOutDatetime = $datetime;
                $c->cCheckedOutDatetimeLastEdit = $datetime;
            }
        }
    }

    public function unloadCollectionEdit($removeCache = true)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        if ($this->getUserID() > 0) {
            $col = $db->GetCol('select cID from Pages where cCheckedOutUID = ?', array($this->getUserID()));
            foreach ($col as $cID) {
                $p = Page::getByID($cID);
                if ($removeCache) {
                    $p->refreshCache();
                }
            }

            $q = "update Pages set cIsCheckedOut = 0, cCheckedOutUID = null, cCheckedOutDatetime = null, cCheckedOutDatetimeLastEdit = null where cCheckedOutUID = ?";
            $db->query($q, array($this->getUserID()));
        }
    }

    public function config($cfKey)
    {
        if ($this->isRegistered()) {
            $app = Application::getFacadeApplication();
            $db = $app['database']->connection();

            $val = $db->GetOne("select cfValue from ConfigStore where uID = ? and cfKey = ?", array($this->getUserID(), $cfKey));

            return $val;
        }
    }

    public function markPreviousFrontendPage(Page $c)
    {
        $app = Application::getFacadeApplication();
        $app['session']->set('frontendPreviousPageID', $c->getCollectionID());
    }

    public function getPreviousFrontendPageID()
    {
        $app = Application::getFacadeApplication();

        return $app['session']->get('frontendPreviousPageID');
    }

    public function saveConfig($cfKey, $cfValue)
    {
        $app = Application::getFacadeApplication();
        $app['database']->connection()->Replace('ConfigStore', array('cfKey' => $cfKey, 'cfValue' => $cfValue, 'uID' => $this->getUserID()), array('cfKey', 'uID'), true);
    }

    public function refreshCollectionEdit(&$c)
    {
        if ($this->isLoggedIn() && $c->getCollectionCheckedOutUserID() == $this->getUserID()) {
            $app = Application::getFacadeApplication();
            $db = $app['database']->connection();
            $cID = $c->getCollectionID();

            $dh = $app->make('helper/date');
            $datetime = $dh->getOverridableNow();

            $q = 'update Pages set cCheckedOutDatetimeLastEdit = ? where cID = ?';
            $r = $db->executeQuery($q, array($datetime, $cID));

            $c->cCheckedOutDatetimeLastEdit = $datetime;
        }
    }

    public function forceCollectionCheckInAll()
    {
        // This function forces checkin to take place
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();

        $q = "update Pages set cIsCheckedOut = 0, cCheckedOutUID = null, cCheckedOutDatetime = null, cCheckedOutDatetimeLastEdit = null";
        $r = $db->query($q);

        return $r;
    }

    /**
     * @see PasswordHash
     *
     * @return PasswordHash
     */
    public function getUserPasswordHasher()
    {
        $app = Application::getFacadeApplication();
        $config = $app['config'];
        if (isset($this->hasher)) {
            return $this->hasher;
        }
        $this->hasher = new PasswordHash(
            $config->get('concrete.user.password.hash_cost_log2'),
            $config->get('concrete.user.password.hash_portable'));

        return $this->hasher;
    }

    /**
     * Manage user session writing.
     *
     * @param bool $cache_interface
     */
    public function persist($cache_interface = true)
    {
        $this->refreshUserGroups();

        $app = Application::getFacadeApplication();

        /** @var \Symfony\Component\HttpFoundation\Session\Session $session */
        $session = $app['session'];
        $session->set('uID', $this->getUserID());
        $session->set('uName', $this->getUserName());
        $session->set('uBlockTypesSet', false);
        $session->set('uGroups', $this->getUserGroups());
        $session->set('uLastOnline', $this->getLastOnline());
        $session->set('uTimezone', $this->getUserTimezone());
        $session->set('uDefaultLanguage', $this->getUserDefaultLanguage());
        $session->set('uLastPasswordChange', $this->getLastPasswordChange());

        $cookie = $app['cookie'];
        $cookie->set(sprintf('%s_LOGIN', $app['config']->get('concrete.session.name')), 1);

        if ($cache_interface) {
            $app->make('helper/concrete/ui')->cacheInterfaceItems();
        }
    }

    public function logIn($cache_interface = true)
    {
        $this->persist($cache_interface);
    }
}


text:
class UsersController < ApplicationController
  before_action :set_user, only: [:show, :edit, :update, :destroy]
  before_filter :authenticate_user!
  load_and_authorize_resource except: [:create]

  # GET /users
  def index
    @users = User.all
  end

  # GET /users/1
  def show
  end

  # GET /users/new
  def new
    @user = User.new
  end

  # GET /users/1/edit
  def edit
  end

  # POST /users
  def create
    @user = User.new(user_params)
    if @user.save
      redirect_to @user, notice:  t("actions.created.male",  model: t("activerecord.models.#{controller_name.singularize}").downcase)
    else
      render action: 'new'#DO NO DELETE THIS COMMENT
    end
  end

  # PATCH/PUT /users/1
  def update
    if @user.update(user_params)
      redirect_to @user, notice:  t("actions.updated.male",  model: t("activerecord.models.#{controller_name.singularize}").downcase)
    else
      render action: 'edit'
    end
  end

  # DELETE /users/1
  def destroy
    @user.destroy
    redirect_to users_url, notice:  t("actions.destroyed.male",  model: t("activerecord.models.#{controller_name.singularize}").downcase)
  end

  def destroy_multiple
    if params[:users]
      User.destroy(params[:users])
      redirect_to users_url, notice:  t("actions.multiple_destroyed.male",  model: t("activerecord.models.#{controller_name}").downcase)
    else
      redirect_to users_url, notice:  t("messages.error.you_must_select_at_least_one.male",  model: t("activerecord.models.#{controller_name.singularize}").downcase)
    end
  end

  private
  # Use callbacks to share common setup or constraints between actions.
  def set_user
    @user = User.find(params[:id])
  end

  # Only allow a trusted parameter "white list" through.
  def user_params
    params.require(:user).permit(:first_name, :last_name, :role_id, :active, :username, :email)#DO NO DELETE THIS COMMENT
  end
end


text:
import { Component, OnInit, OnDestroy, Input } from '@angular/core';

import { PcapService } from '../service/pcap.service';
import { PcapStatusResponse } from '../model/pcap-status-response';
import { PcapRequest } from '../model/pcap.request';
import { Pdml } from '../model/pdml';
import { Subscription } from 'rxjs';
import { PcapPagination } from '../model/pcap-pagination';
import { RestError } from '../../model/rest-error';

@Component({
  selector: 'app-pcap-panel',
  templateUrl: './pcap-panel.component.html',
  styleUrls: ['./pcap-panel.component.scss']
})
export class PcapPanelComponent implements OnInit, OnDestroy {

  pdml: Pdml = null;
  pcapRequest: PcapRequest;
  resetPaginationForSearch: boolean;
  queryRunning = false;
  queryId: string;
  progressWidth = 0;
  pagination: PcapPagination = new PcapPagination();
  savedPcapRequest: {};
  errorMsg: string;
  cancelConfirmMessage = 'Are you sure want to cancel the running query?';
  subscriptions: {
    [key: string]: Subscription
  } = {};

  constructor(private pcapService: PcapService) { }

  ngOnInit() {
    this.pcapRequest = new PcapRequest();
    this.subscriptions['runningJobSubscription'] = this.pcapService.getRunningJob().subscribe((statusResponses: PcapStatusResponse[]) => {
      if (statusResponses.length > 0) {
        // Assume the first job in the list is the running job
        this.queryRunning = true;
        let statusResponse = statusResponses[0];
        this.updateStatus(statusResponse);
        this.startPolling(statusResponse.jobId);
        this.subscriptions['pcapRequestSubscription'] = this.pcapService.getPcapRequest(statusResponse.jobId).subscribe(
          (pcapRequest: PcapRequest) => {
            this.pcapRequest = pcapRequest;
          }
        );
      }
    });
  }

  changePage(page) {
    this.pagination.selectedPage = page;
    this.subscriptions['packetSubscription'] = this.pcapService.getPackets(this.queryId, this.pagination.selectedPage).subscribe(pdml => {
      this.pdml = pdml;
    });
  }

  onSearch(pcapRequest) {
    this.queryRunning = true;
    this.queryId = '';
    this.savedPcapRequest = pcapRequest;
    this.pagination.selectedPage = 1;
    this.pdml = null;
    this.progressWidth = 0;
    this.errorMsg = null;
    this.subscriptions['submitSubscription'] = this.pcapService.submitRequest(pcapRequest).subscribe(
      (submitResponse: PcapStatusResponse) => {
        let id = submitResponse.jobId;
        if (!id) {
          this.errorMsg = submitResponse.description;
          this.queryRunning = false;
        } else {
          this.startPolling(id);
        }
      }, (error: any) => {
        this.errorMsg = `Response message: ${error.message}. Something went wrong with your query submission!`;
      }
    );
  }

  startPolling(id: string) {
    this.queryId = id;
    this.errorMsg = null;
    this.subscriptions['statusSubscription'] = this.pcapService.pollStatus(id).subscribe((statusResponse: PcapStatusResponse) => {
      this.updateStatus(statusResponse);
    }, (error: any) => {
      this.subscriptions['statusSubscription'].unsubscribe();
      this.queryRunning = false;
      this.errorMsg = `Response message: ${error.message}. Something went wrong with your status request!`;
    });
  }

  updateStatus(statusResponse: PcapStatusResponse) {
    if ('SUCCEEDED' === statusResponse.jobStatus) {
      this.pagination.total = statusResponse.pageTotal;
      this.subscriptions['statusSubscription'].unsubscribe();
      this.queryRunning = false;
      this.subscriptions['packetSubscription'] = this.pcapService.getPackets(this.queryId, this.pagination.selectedPage).subscribe(pdml => {
        this.pdml = pdml;
      }, (error: RestError) => {
        if (error.status === 404) {
          this.errorMsg = 'No results returned';
        } else {
          this.errorMsg = `Response message: ${error.message}. Something went wrong retrieving pdml results!`;
        }
      });
    } else if ('FAILED' === statusResponse.jobStatus) {
      this.subscriptions['statusSubscription'].unsubscribe();
      this.queryRunning = false;
      this.errorMsg = `Query status: ${statusResponse.jobStatus}. Check your filter criteria and try again!`;
    } else if (this.progressWidth < 100) {
      this.progressWidth = Math.trunc(statusResponse.percentComplete);
    }
  }

  getDownloadUrl() {
    return this.pcapService.getDownloadUrl(this.queryId, this.pagination.selectedPage);
  }

  unsubscribeAll() {
    Object.keys(this.subscriptions).forEach((key) => {
      this.subscriptions[key].unsubscribe();
    });
    this.subscriptions = {};
  }

  cancelQuery() {
    this.subscriptions['cancelSubscription'] = this.pcapService.cancelQuery(this.queryId)
      .subscribe(() => {
        this.unsubscribeAll();
        this.queryId = '';
        this.queryRunning = false;
      }, (error: any) => {
        this.queryId = '';
        this.errorMsg = `Response message: ${error.message}. Something went wrong with the cancellation!`;
        this.queryRunning = false;
      });
  }

  ngOnDestroy() {
    this.unsubscribeAll();
  }
}


text:
from QUANTAXIS.QAIndicator.indicators import *
from QUANTAXIS.QAIndicator.QAIndicator_Dataframe import *
from QUANTAXIS.QAIndicator.QAIndicator_Series import *

"""
这个模块是对了对应QA_DataStruct

可以被add_func来添加,所以 这个模块的函数必须有一个DataFrame的输入

例如

import QUANTAXIS as QA
data=QA.QA_fetch_stock_day_adv('000001','2017-01-01','2017-01-31')
data.add_func(QA.)
"""


text:
require 'test_helper'

class MoneybookersModuleTest < Test::Unit::TestCase
  include OffsitePayments::Integrations

  def test_notification_method
    assert_instance_of Moneybookers::Notification, Moneybookers.notification('name=cody', :credential2 => 'secret')
  end

  def test_service_url
    url = 'https://www.moneybookers.com/app/payment.pl'
    assert_equal url, Moneybookers.service_url
  end
end


text:
The documentation is crafted to assist you to apply the features on your side easily. ByteScout Barcode Suite was created to assist swap worksheets with spreadsheet sdk in C#. ByteScout Barcode Suite is the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK.

This rich and prolific sample source code in C# for ByteScout Barcode Suite contains various functions and options you should do calling the API to implement swap worksheets with spreadsheet sdk.  Just copy and paste this C# sample code to your C# application's code editor, add a reference to ByteScout Barcode Suite (if you haven't added yet) and you are ready to go! This basic programming language sample code for C# will do the whole work for you in implementing swap worksheets with spreadsheet sdk in your app.

On our website you may get trial version of ByteScout Barcode Suite for free. Source code samples are included to help you with your C# application.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20Barcode%20Suite%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Barcode%20Suite%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=NEwNs2b9YN8](https://www.youtube.com/watch?v=NEwNs2b9YN8)

<!-- code block begin -->

##### ****Program.cs:**

```
using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;
using System.Diagnostics;
using System.IO;

namespace MergeCells
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();
	document.LoadFromFile("sample.xls");

            // Move page
            document.Workbook.Worksheets.Move(1, 0);

            // delete output file if exists already
            if (File.Exists("Output.xls")){
                File.Delete("Output.xls");
            }

            // Save document
            document.SaveAs("Output.xls");

            // Close Spreadsheet
            document.Close();

            // open generated XLS document in default program
            Process.Start("Output.xls");

        }
    }
}

```

<!-- code block end -->

<!-- code block begin -->

##### ****SwapWorksheets.VS2005.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4AB0726C-4B52-4D9B-8425-B61CF392A0F6}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SwapWorksheets</RootNamespace>
    <AssemblyName>SwapWorksheets</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.Spreadsheet, Version=1.4.0.2, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Sample.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****SwapWorksheets.VS2008.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4AB0726C-4B52-4D9B-8425-B61CF392A0F6}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SwapWorksheets</RootNamespace>
    <AssemblyName>SwapWorksheets</AssemblyName>
    <OldToolsVersion>2.0</OldToolsVersion>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.Spreadsheet, Version=1.4.0.2, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Sample.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****SwapWorksheets.VS2010.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4AB0726C-4B52-4D9B-8425-B61CF392A0F6}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SwapWorksheets</RootNamespace>
    <AssemblyName>SwapWorksheets</AssemblyName>
    <OldToolsVersion>3.5</OldToolsVersion>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.Spreadsheet, Version=1.4.0.2, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Sample.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->


text:
@interface MOBProjectionEPSG32054 : MOBProjection

@end


text:
node-file-parter
================

Node.js module for hashing parts of a file.


text:
package caris.framework.handlers;

import java.util.ArrayList;
import java.util.HashMap;

import caris.framework.basehandlers.MessageHandler;
import caris.framework.basereactions.MultiReaction;
import caris.framework.basereactions.Reaction;
import caris.framework.events.MessageEventWrapper;
import caris.framework.library.Constants;
import caris.framework.library.Keywords;
import caris.framework.library.Variables;
import caris.framework.reactions.ReactionMessage;
import caris.framework.reactions.ReactionTrackerAdd;
import caris.framework.reactions.ReactionTrackerRemove;
import caris.framework.tokens.InputSources;
import sx.blah.discord.handle.obj.IChannel;
import sx.blah.discord.handle.obj.IGuild;

public class TrackerSetHandler extends MessageHandler {

	public TrackerSetHandler() {
		super("Tracker", Access.DEVELOPER);
	}

	@Override
	protected boolean isTriggered(MessageEventWrapper messageEventWrapper) {
		return messageEventWrapper.developerAuthor && mentioned(messageEventWrapper) && messageEventWrapper.containsAnyWords("track", "tracking");
	}

	@Override
	protected Reaction process(MessageEventWrapper messageEventWrapper) {
		ArrayList<Long> longs = messageEventWrapper.longTokens;
		MultiReaction track = new MultiReaction(2);
		if( longs.isEmpty() ) {
			track.reactions.add(new ReactionMessage("You need to specify the ID of a channel/guild!", messageEventWrapper.getChannel()));
		} else {
			if( messageEventWrapper.containsAnyWords(Keywords.END) ) {
				if( !Variables.trackerSets.containsKey(messageEventWrapper.getChannel()) ) {
					track.reactions.add(new ReactionMessage("No inputs are currently being tracked!", messageEventWrapper.getChannel()));
				} else {
					for( IGuild guild : Variables.trackerSets.get(messageEventWrapper.getChannel()).guilds ) {
						if( longs.get(0).equals(guild.getLongID()) ) {
							track.reactions.add(new ReactionTrackerRemove(messageEventWrapper.getChannel(), new InputSources(guild)));
							track.reactions.add(new ReactionMessage("Tracker for <" + guild.getName() + "> removed successfully!", messageEventWrapper.getChannel()));
							break;
						}
					}
					for( IChannel channel : Variables.trackerSets.get(messageEventWrapper.getChannel()).channels ) {
						if( longs.get(0).equals(channel.getLongID()) ) {
							track.reactions.add(new ReactionTrackerRemove(messageEventWrapper.getChannel(), new InputSources(channel)));
							track.reactions.add(new ReactionMessage("Tracker for <" + channel.getName() + "> removed successfully!", messageEventWrapper.getChannel()));
							break;
						}
					}
				}
			} else {
				for( IGuild guild : Variables.guildIndex.keySet() ) {
					if( longs.get(0).equals(guild.getLongID()) ) {
						track.reactions.add(new ReactionMessage("Tracker for <" + guild.getName() + "> set successfully!", messageEventWrapper.getChannel()));
						track.reactions.add(new ReactionTrackerAdd(messageEventWrapper.getChannel(), new InputSources(guild)));
						break;
					} else {
						for( IChannel channel : guild.getChannels() ) {
							if( longs.get(0).equals(channel.getLongID()) ) {
								track.reactions.add(new ReactionMessage("Tracker for <" + channel.getName() + "> set successfully!", messageEventWrapper.getChannel()));
								track.reactions.add(new ReactionTrackerAdd(messageEventWrapper.getChannel(), new InputSources(channel)));
								break;
							}
						}
					}
				}
			}
		}
		return track;
	}

	@Override
	public String getDescription() {
		return "Outputs all the messages sent in a given channel.";
	}

	@Override
	public HashMap<String, String> getUsage() {
		HashMap<String, String> usage = new HashMap<String, String>();
		usage.put(Constants.NAME + ", start tracking <Channel ID>", "Begins relaying all messages in the specified channel to the current channel");
		usage.put(Constants.NAME + ", stop tracking <Channel ID>", "Stops tracking the given channel");
		return usage;
	}

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Frailea aureinitens Buining & Brederoo

### Remarks
null


text:
v0.1.2 (June 24, 2019)
++++++++++++++++++++++++++++++

New features
############
* new attribute `nominal_power` in :class:`~windpowerlib.wind_farm.WindFarm` and :class:`~windpowerlib.wind_turbine_cluster.WindTurbineCluster` classes (PR #53)
* use properties and setters for `nominal_power` and `installed_power` in :class:`~windpowerlib.wind_farm.WindFarm` and  :class:`~windpowerlib.wind_turbine_cluster.WindTurbineCluster` classes
* made windpowerlib work offline: added csv files containing turbine data from `OpenEnergy Database (oedb) <https://openenergy-platform.org/dataedit/>`_ to the repository for offline usage (PR #52)

Bug fixes
#########
* fixed issue with pandas Multiindex labels and codes attributes (PR #51)

Other changes
#############
* made :py:func:`~windpowerlib.wind_turbine.get_turbine_types` also accessible via `get_turbine_types()` --> from windpowerlib import get_turbine_types
* added kwargs in init of :class:`~windpowerlib.wind_turbine.WindTurbine`, :class:`~windpowerlib.wind_farm.WindFarm` and  :class:`~windpowerlib.wind_turbine_cluster.WindTurbineCluster`
* we are working with deprecation warnings to draw our user's attention to important changes (PR #53)

Deprecations
############
**wind_farm and wind_turbine_cluster:**

* Parameter coordinates is deprecated. In the future the parameter can only be set after instantiation of WindFarm object.
* installed_power is deprecated, use nominal_power instead

**wind_turbine:**

* Parameters name, data_source and fetch_curve are deprecated. The parameter name will be renamed to turbine_type. Data source and fetching will be defined by the parameters power_coefficient_curve, power_curve and nominal_power in the future.
* Parameter coordinates is deprecated. In the future the parameter can only be set after instantiation of WindTurbine object.

**power_curves:**

* wake_losses_model is deprecated, will be defined by the type of wind_farm_efficiency

Contributors
############
* Sabine Haas
* Birgit Schachler
* Uwe Krien


text:
namespace v8 {
namespace internal {

LayoutDescriptor::LayoutDescriptor(Address ptr)
    : ByteArray(ptr, AllowInlineSmiStorage::kAllowBeingASmi) {
  SLOW_DCHECK(IsLayoutDescriptor());
}
CAST_ACCESSOR(LayoutDescriptor)

LayoutDescriptor LayoutDescriptor::FromSmi(Smi smi) {
  return LayoutDescriptor::cast(smi);
}

Handle<LayoutDescriptor> LayoutDescriptor::New(Isolate* isolate, int length) {
  if (length <= kBitsInSmiLayout) {
    // The whole bit vector fits into a smi.
    return handle(LayoutDescriptor::FromSmi(Smi::zero()), isolate);
  }
  int backing_store_length = GetSlowModeBackingStoreLength(length);
  Handle<LayoutDescriptor> result =
      Handle<LayoutDescriptor>::cast(isolate->factory()->NewByteArray(
          backing_store_length, AllocationType::kOld));
  memset(reinterpret_cast<void*>(result->GetDataStartAddress()), 0,
         result->DataSize());
  return result;
}

bool LayoutDescriptor::InobjectUnboxedField(int inobject_properties,
                                            PropertyDetails details) {
  if (details.location() != kField || !details.representation().IsDouble()) {
    return false;
  }
  // We care only about in-object properties.
  return details.field_index() < inobject_properties;
}

LayoutDescriptor LayoutDescriptor::FastPointerLayout() {
  return LayoutDescriptor::FromSmi(Smi::zero());
}

bool LayoutDescriptor::GetIndexes(int field_index, int* layout_word_index,
                                  int* layout_bit_index) {
  if (static_cast<unsigned>(field_index) >= static_cast<unsigned>(capacity())) {
    return false;
  }

  *layout_word_index = field_index / kBitsPerLayoutWord;
  CHECK((!IsSmi() && (*layout_word_index < length())) ||
        (IsSmi() && (*layout_word_index < 1)));

  *layout_bit_index = field_index % kBitsPerLayoutWord;
  return true;
}

LayoutDescriptor LayoutDescriptor::SetRawData(int field_index) {
  return SetTagged(field_index, false);
}

LayoutDescriptor LayoutDescriptor::SetTagged(int field_index, bool tagged) {
  int layout_word_index = 0;
  int layout_bit_index = 0;

  CHECK(GetIndexes(field_index, &layout_word_index, &layout_bit_index));
  uint32_t layout_mask = static_cast<uint32_t>(1) << layout_bit_index;

  if (IsSlowLayout()) {
    uint32_t value = get_layout_word(layout_word_index);
    if (tagged) {
      value &= ~layout_mask;
    } else {
      value |= layout_mask;
    }
    set_layout_word(layout_word_index, value);
    return *this;
  } else {
    uint32_t value = static_cast<uint32_t>(Smi::ToInt(*this));
    if (tagged) {
      value &= ~layout_mask;
    } else {
      value |= layout_mask;
    }
    return LayoutDescriptor::FromSmi(Smi::FromInt(static_cast<int>(value)));
  }
}

bool LayoutDescriptor::IsTagged(int field_index) {
  if (IsFastPointerLayout()) return true;

  int layout_word_index;
  int layout_bit_index;

  if (!GetIndexes(field_index, &layout_word_index, &layout_bit_index)) {
    // All bits after Out of bounds queries
    return true;
  }
  uint32_t layout_mask = static_cast<uint32_t>(1) << layout_bit_index;

  if (IsSlowLayout()) {
    uint32_t value = get_layout_word(layout_word_index);
    return (value & layout_mask) == 0;
  } else {
    uint32_t value = static_cast<uint32_t>(Smi::ToInt(*this));
    return (value & layout_mask) == 0;
  }
}

bool LayoutDescriptor::IsFastPointerLayout() {
  return *this == FastPointerLayout();
}

bool LayoutDescriptor::IsFastPointerLayout(Object layout_descriptor) {
  return layout_descriptor == FastPointerLayout();
}

bool LayoutDescriptor::IsSlowLayout() { return !IsSmi(); }

int LayoutDescriptor::capacity() {
  return IsSlowLayout() ? (length() * kBitsPerByte) : kBitsInSmiLayout;
}

LayoutDescriptor LayoutDescriptor::cast_gc_safe(Object object) {
  // The map word of the object can be a forwarding pointer during
  // object evacuation phase of GC. Since the layout descriptor methods
  // for checking whether a field is tagged or not do not depend on the
  // object map, it should be safe.
  return LayoutDescriptor::unchecked_cast(object);
}

int LayoutDescriptor::GetSlowModeBackingStoreLength(int length) {
  DCHECK_LT(0, length);
  // We allocate kTaggedSize rounded blocks of memory anyway so we increase
  // the length  of allocated array to utilize that "lost" space which could
  // also help to avoid layout descriptor reallocations.
  return RoundUp(length, kBitsPerByte * kTaggedSize) / kBitsPerByte;
}

int LayoutDescriptor::CalculateCapacity(Map map, DescriptorArray descriptors,
                                        int num_descriptors) {
  int inobject_properties = map.GetInObjectProperties();
  if (inobject_properties == 0) return 0;

  DCHECK_LE(num_descriptors, descriptors.number_of_descriptors());

  int layout_descriptor_length;
  const int kMaxWordsPerField = kDoubleSize / kTaggedSize;

  if (num_descriptors <= kBitsInSmiLayout / kMaxWordsPerField) {
    // Even in the "worst" case (all fields are doubles) it would fit into
    // a Smi, so no need to calculate length.
    layout_descriptor_length = kBitsInSmiLayout;

  } else {
    layout_descriptor_length = 0;

    for (InternalIndex i : InternalIndex::Range(num_descriptors)) {
      PropertyDetails details = descriptors.GetDetails(i);
      if (!InobjectUnboxedField(inobject_properties, details)) continue;
      int field_index = details.field_index();
      int field_width_in_words = details.field_width_in_words();
      layout_descriptor_length =
          Max(layout_descriptor_length, field_index + field_width_in_words);
    }
  }
  layout_descriptor_length = Min(layout_descriptor_length, inobject_properties);
  return layout_descriptor_length;
}

LayoutDescriptor LayoutDescriptor::Initialize(
    LayoutDescriptor layout_descriptor, Map map, DescriptorArray descriptors,
    int num_descriptors) {
  DisallowHeapAllocation no_allocation;
  int inobject_properties = map.GetInObjectProperties();

  for (InternalIndex i : InternalIndex::Range(num_descriptors)) {
    PropertyDetails details = descriptors.GetDetails(i);
    if (!InobjectUnboxedField(inobject_properties, details)) {
      DCHECK(details.location() != kField ||
             layout_descriptor.IsTagged(details.field_index()));
      continue;
    }
    int field_index = details.field_index();
    layout_descriptor = layout_descriptor.SetRawData(field_index);
    if (details.field_width_in_words() > 1) {
      layout_descriptor = layout_descriptor.SetRawData(field_index + 1);
    }
  }
  return layout_descriptor;
}

int LayoutDescriptor::number_of_layout_words() {
  return length() / kUInt32Size;
}

uint32_t LayoutDescriptor::get_layout_word(int index) const {
  return get_uint32_relaxed(index);
}

void LayoutDescriptor::set_layout_word(int index, uint32_t value) {
  set_uint32_relaxed(index, value);
}

// LayoutDescriptorHelper is a helper class for querying whether inobject
// property at offset is Double or not.
LayoutDescriptorHelper::LayoutDescriptorHelper(Map map)
    : all_fields_tagged_(true),
      header_size_(0),
      layout_descriptor_(LayoutDescriptor::FastPointerLayout()) {
  if (!FLAG_unbox_double_fields) return;

  layout_descriptor_ = map.layout_descriptor_gc_safe();
  if (layout_descriptor_.IsFastPointerLayout()) {
    return;
  }

  header_size_ = map.GetInObjectPropertiesStartInWords() * kTaggedSize;
  DCHECK_GE(header_size_, 0);

  all_fields_tagged_ = false;
}

bool LayoutDescriptorHelper::IsTagged(int offset_in_bytes) {
  DCHECK(IsAligned(offset_in_bytes, kTaggedSize));
  if (all_fields_tagged_) return true;
  // Object headers do not contain non-tagged fields.
  if (offset_in_bytes < header_size_) return true;
  int field_index = (offset_in_bytes - header_size_) / kTaggedSize;

  return layout_descriptor_.IsTagged(field_index);
}

}  // namespace internal
}  // namespace v8

#include "src/objects/object-macros-undef.h"

#endif  // V8_OBJECTS_LAYOUT_DESCRIPTOR_INL_H_


text:
CTObject
=========

A POSIX C library inspired by CoreFoundation and attempting to bridge the power gap between C and C++