text:
import asyncio
import logging

logger = logging.getLogger(__name__)

class GameException(Exception):
    pass

class SquareException(GameException):
    pass

class WinnerException(GameException):
    pass

class HistoryException(GameException):
    pass

class Board:

    def __init__(self, width=8, height=8, players=4, bots=0):
        self.width = width
        self.height = height

        self.tasks = []
        self.listeners = []

        from .bot import Bot
        self.players = \
            [Player(self, i) for i in range(players - bots)] \
            + [Bot(self, i) for i in range(players - bots, players)]
        self.players_wheel = PlayersWheel(self.players)
        self.actual_player = next(self.players_wheel)

        squares = [[Square(self, x, y) for y in range(height)]
                                       for x in range(width)
                  ]
        for x, column in enumerate(squares):
            for y, square in enumerate(column):
                if x > 0:
                    square.neighbours['left'] = squares[x-1][y]
                if x < width - 1:
                    square.neighbours['right'] = squares[x+1][y]
                if y > 0:
                    square.neighbours['up'] = squares[x][y-1]
                if y < height - 1:
                    square.neighbours['down'] = squares[x][y+1]
        self.squares = squares

        self.history = [self.dump()]
        self.history_position = 0

    def __getitem__(self, index):
        if isinstance(index, tuple):
            try:
                column, row = index
                return self.squares[column][row]
            except IndexError:
                raise SquareException('bad coordinate', index)

        if isinstance(index, int):
            column = index // len(self.squares[0])
            if column >= len(self.squares):
                raise SquareException("there's not that many squares")
            row = index % len(self.squares[0])
            return self[column, row]

    def __iter__(self):
        return SquaresIterator(self)

    async def play(self, x=None, y=None):
        if self.is_victory():
            raise WinnerException(self.actual_player)

        if x is None or y is None:
            x, y = self.actual_player.propose_move()

        self.last_move = {'x': x, 'y': y}
        logger.info('%s moving at %d, %d' % (self.actual_player, x, y))

        await self[x, y].increment()
        await self.process()

    async def process(self):
        while self.tasks:
            task = self.tasks.pop(0)
            await asyncio.wait([task])

        self.actual_player = next(self.players_wheel)

        self.history_position += 1
        self.history = self.history[:self.history_position]
        self.history.append(self.dump())

        if self.is_victory():
            raise WinnerException(self.actual_player)

    def is_victory(self):
        actives = sum(int(player.active) for player in self.players)
        if actives == 1:
            return True
        elif actives < 1:
            raise GameException('No active players')
        return False

    def is_expecting_move(self):
        return (not self.history
                 or (self.history_position == len(self.history) - 1
                     and not self.is_victory()))

    def dump(self):
        dump = ''
        for square in self:
            player_number = square.player.number if square.player else '-'
            dump += '%s%d' % (player_number, square.value)
        dump += '%s' % self.actual_player.number
        return dump

    def load(self, dump):
        assert len(dump) == self.width * self.height * 2 + 1

        for sq_nr, square in enumerate(self):
            player_number = dump[2 * sq_nr]
            square.player = self.players[int(player_number)] \
                            if player_number != '-' else None
            square.value = int(dump[2 * sq_nr + 1])

        self.recalculate_players()

        self.players_wheel.set_number(int(dump[-1]))
        self.actual_player = next(self.players_wheel)

    def recalculate_players(self):
        for player in self.players:
            player.amount = 0
            player.active = True
        for square in self:
            if square.player:
                square.player.amount += square.value
        if self.overall_value >= len(self.players):
            for player in self.players:
                if player.amount <= 0:
                    player.active = False

    @property
    def overall_value(self):
        return sum(square.value for square in self)

    def history_jump(self, step):
        if 0 <= self.history_position + step < len(self.history):
            self.history_position += step
            self.load(self.history[self.history_position])
        else:
            raise HistoryException('cannot jump there')

class Square:

    def __init__(self, board, x, y):
        self.board = board
        self.x = x
        self.y = y

        self.neighbours = {}
        self.value = 0
        self.player = None

    def __repr__(self):
        return '<Square %d,%d>' % (self.x, self.y)

    def __eq__(self, other):
        if isinstance(other, self.__class__):
            if self.x == other.x and self.y == other.y:
                return True
        return False

    def __hash__(self):
        return self.x * self.board.height + self.y

    def __getattr__(self, name):
        if name in self.neighbours:
            return self.neighbours[name]

    async def increment(self):
        if self.player and self.player != self.board.actual_player:
            raise SquareException('%s does not belong to %s'
                                  % (self, self.board.actual_player))
        if not self.player:
            self.player = self.board.actual_player

        self.value += 1
        self.player.amount += 1

        if self.value >= len(self.neighbours) and not self.board.is_victory():
            self.player.amount -= self.value
            self.value = 0

            for neighbour in self.neighbours.values():
                if neighbour.player and neighbour.player != self.player:
                    neighbour.player.amount -= neighbour.value

                    if neighbour.player.amount == 0:
                        neighbour.player.active = False
                    elif neighbour.player.amount < 0:
                        raise GameException('player.amount < 0',
                                            neighbour.player)

                    self.player.amount += neighbour.value
                    neighbour.player = self.player

                self.board.tasks.insert(
                    0,
                    asyncio.ensure_future(neighbour.increment())
                )

        for listener in self.board.listeners:
            listener.refresh_square(self)

    @property
    def color(self):
        if self.player:
            return self.player.color
        return 0

class Player:

    NAMES = ['Tesla', 'Lacrum', 'Loana', 'Tatra']

    def __init__(self, board, number, name=None):
        self.board = board
        self.number = number
        self.name = name or self.NAMES[self.number]
        self.amount = 0
        self.active = True

    def __repr__(self):
        return '<Player %s>' % self.name

    def __str__(self):
        return self.name

    @property
    def color(self):
        return self.number + 1

    @property
    def is_bot(self):
        return False

class SquaresIterator:
    def __init__(self, board):
        self.board = board
        self._iter_square = 0

    def __next__(self):
        try:
            square = self.board[self._iter_square]
            self._iter_square += 1
            return square
        except SquareException:
            raise StopIteration

class PlayersWheel:

    def __init__(self, players):
        self.players = players
        self._iter_player = 0

    def __next__(self):
        if self._iter_player >= len(self.players):
            self._iter_player = 0

        player = self.players[self._iter_player]
        self._iter_player += 1

        if player.active:
            return player
        else:
            # beware, might end as an infinite loop
            return next(self)

    def set_number(self, number):
        self._iter_player = number


text:
module.exports = {
  title: 'LovePlatform',
  machineTitle: 'loveplatform',
  heading: 'I Love LovePlatform Because...',
  shareUrl: 'http://bit.ly/loveplatform',
  form: {
    textLabel: 'Message',
    textPlaceHolder: 'Message',
    twitterLabel: '@',
    twitterPlaceHolder: 'Twitter',
    submitButtonText: 'Submit'
  },
  notes: {
    displayInitial: 9,
    voting: false,
    tweeting: false,
  },
  twitter: {
    shareText: 'I love LovePlatform Because',
    shareHash: 'loveplatform',
  },
  fb: {
    appId: '12345'
  },
  afterSubmit: {
    popUpSharePrompt: false,
  }
};

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="ccMaroon">#800000</color>
    <color name="ccRed">#ff0000</color>
    <color name="ccOrange">#ffA500</color>
    <color name="ccYellow">#ffff00</color>
    <color name="ccOlive">#808000</color>
    <color name="ccPurple">#800080</color>
    <color name="ccFuchsia">#ff00ff</color>
    <color name="ccWhite">#ffffff</color>
    <color name="ccLime">#00ff00</color>
    <color name="ccGreen">#008000</color>
    <color name="ccNavy">#000080</color>
    <color name="ccBlue">#0000ff</color>
    <color name="ccAqua">#00ffff</color>
    <color name="ccTeal">#008080</color>
    <color name="ccBlack">#000000</color>
    <color name="ccSilver">#c0c0c0</color>
    <color name="ccGray">#808080</color>
    <color name="ccSteelblue">#4682b4</color>
    <color name="ccTransparentred">#99ff0000</color>
    <color name="ccTransparentgreen">#9900ff00</color>
    <color name="ccLightgreen">#83cf68</color>

    <color name="cListTitleColor">#c4c3c3</color>
    <color name="cListTitleTextColor">#5e5e5e</color>

    <color name="light_black">#747474</color>

    <color name="cAccentColor">#2eb8b8</color>
    <color name="cToggleButtonColor">#70dbdb</color>
    <color name="primary_text_default_material_light">#ffffff</color>
    <color name="black">#fefdfd</color>
</resources>


text:
namespace newsbeuter {

class select_formaction : public formaction {
	public:
		enum class selection_type { TAG, FILTER };

		select_formaction(view *, std::string formstr);
		virtual ~select_formaction();
		virtual void prepare();
		virtual void init();
		virtual keymap_hint_entry * get_keymap_hint();
		inline std::string get_selected_value() {
			return value;
		}
		inline void set_tags(const std::vector<std::string>& t) {
			tags = t;
		}
		inline void set_filters(const std::vector<filter_name_expr_pair>& ff) {
			filters = ff;
		}
		void set_type(selection_type t) {
			type = t;
		}
		virtual void handle_cmdline(const std::string& cmd);
		virtual std::string id() const {
			return (type == selection_type::TAG) ? "tagselection" : "filterselection";
		}
		virtual std::string title();
	private:
		virtual void process_operation(operation op, bool automatic = false, std::vector<std::string> * args = nullptr);
		bool quit;
		selection_type type;
		std::string value;
		std::vector<std::string> tags;
		std::vector<filter_name_expr_pair> filters;
};

}

#endif


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.12.5] - 2022-07-30
### Added
- pivotSynced event listener to flush cache when performing BelongsToMany::sync

[...]

## [0.10.3] - 2021-03-16
### Changed
- The from part of the query ($query->from) instead of the table name of the model ($model->table)
  is now used for determining the table part caching key fragment

## [0.10.2] - 2020-09-04
### Added
- functionality to inject custom builder class for handling conflicting packages.

## [0.10.1] - 2020-08-02
### Fixed
- typos in test class.

## [0.10.0] - 2020-08-02
### Removed
- PREDIS dependency. Going forward testing will be done against PHPREDIS, as
    that is installed by default on Laravel Forge servers and the officially
    recommended Redis client, since PREDIS is no longer maintained.

## [0.9.0] - 2020-07-17
### Removed
- support for PHP 7.2 due to incompatibility.

## [0.8.10] - 2020-07-08
### Fixed
- update and insert methods when called on cached relations.

## [0.8.9] - 2020-07-03
### Added
- changes meant for 0.8.8 that were inadvertently not committed.

## [0.8.8] - 2020-07-02
### Fixed
- return type of `applyScopes` to match parent class.

## [0.8.7] - 2020-07-02
### Added
- check for scopes to avoid them being applied twice. Thanks @saernz!

## [0.8.6] - 2020-05-12
### Changed
- implementation of `debug_backtrace()` to reduce memory consumption. Thanks @saernz!

## [0.8.5] - 2020-05-02
### Changed
- PHP dependency version to ">=7.2.5" to be more inline with Laravel.

## [0.8.4] - 2020-04-29
### Added
- additional unit tests.

### Updated
- key generation to be more explicit in details with global scopes. Thanks @Drewdan!

## [0.8.3] - 2020-04-15
### Added
- initial tests for Nova integration. Thanks @dmason30!

### Fixed
- travis build process, tests on travis are now back to green!!!

## [0.8.2] - 2020-04-13
### Fixed
- issue with incorrectly adding to currentBinding if item was not in query
  binding. Thanks @irvine1231!

## [0.8.1] - 2020-04-09
### Fixed
- `jsonContains()` with array values. Thanks @dmason30!
- `truncate()` to flush cache. Thanks @dmason30!

## [0.8.0] - 2020-02-29
### Added
- Laravel 7 compatibility.

## [0.7.4] - 2019-12-22
### Added
- documentation to explain that database transactions are currently not supported.
- compatibility with binary UUIDs. Thanks @padre!

### Changed
- detection if cache is enabled in the `$model->all()` method. Thanks @titrxw!

## [0.7.2] - 2019-10-12
### Fixed
- improper caching of non-cachable eagerloaded relationships. Now any query with non-cachable eagerloaded relationships will not be cached in its entirety to prevent stale data. Special thanks to @Hornet-Wing for his help in this.

## [0.7.1] - 2019-10-02
### Fixed
- dependency version constraints.
### Added
- various tests.

## [0.7.0] - 2019-08-28
### Added
- Laravel 6.0 support.

## [0.6.3] - 2019-08-27
### Fixed
- caching of methods that could pass field names as string or array.

## [0.6.2] - 2019-07-26
### Added
- 'modelCache:publish' artisan command.
- Spatie's QueryBuilder package to list of incompatible packages.

### Fixed
- registration of config file in service provider.
- detection if cache is disabled.
- flushing of cache for pivot events.

## [0.6.1] - 2019-07-20
### Added
- config and environment variable to allow removal of database information from cache-key.

## [0.6.0] - 2019-07-20
### Changed
- environment variable `MODEL_CACHE_DISABLED` to `MODEL_CACHE_ENABLED` to better conform to standards.

### Fixed
- how cache key is constructed for SQLite.

## [0.5.6] - 2019-06-20
### Removed
- all use of helper methods to allow non-Laravel apps to use this package:
  - app()
  - config()
  - cache()
  - db()
  - now()
  - request()

## [0.5.5] - 2019-05-27
### Fixed
- parsing of soft-deleted-related queries:
  - withTrashed()
  - onlyTrashed()
  - withoutTrashed()

## [0.5.4] - 2019-05-27
### Fixed
- parsing of global scopes. Rewrote how global scopes are analyzed to create appropriate cache key.

## [0.5.3] - 2019-05-21
### Fixed
- calling `flushCache()` on non-cachable related models.

## [0.5.2] - 21 May 2019
Pushed changes intended for 0.5.1. Forgot to push changes to repo. 👀

## [0.5.1] - 21 May 2019
### Fixed
- caching of where clauses using DateTime instead of Carbon.

## [0.5.0] - 20 May 2019
### Changed
- implementation of model-based cache prefix.
- the way tests are run to be MUCH more performant.

### Removed
- dead code.

## [0.4.24] - 18 May 2019
### Fixed
- BelongsToMany relationship to not cache if the target model is not also cachable.

## [0.4.23] - 18 May 2019
### Added
- tests for lazy-loading the following relationships:
    - BelongsTo
    - BelongsToMany
    - HasMany
    - HasOne

### Fixed
- BelongsToMany relationship cache not being automatically invalidated.

## [0.4.22] - 17 May 2019
### Fixed
- issue introduce in previous release related to cache cooldown and prefixes.

## [0.4.21] - 17 May 2019
### Added
- my own implementation of laravel pivot events, based on `fico7489/laravel-pivot`.

### Fixed
- Laravel Telescope compatibility.

### Removed
- dependency on `fico7489/laravel-pivot`.

## [0.4.20] - 17 May 2019
### Added
- caching lazy-loading of belongs-to relationships. Thanks @tmishutin for leading the way forward on this effort! Hopefully this solution will work as a template for lazy-loading other relationship types going forward.

### Fixed
- an issue with prefixing found during testing.

### Removed
- unused code.

## [0.4.19] - 16 May 2019
### Added
- work-around for Laravel Telescope compatibility to README.

## [0.4.18] - 14 May 2019
### Fixed
- polymorphic relationship caching, as well as other queries using `InRaw`.

## [0.4.17] - 12 May 2019
### Fixed
- generation of cache key where clauses.

## [0.4.16] - 10 May 2019
### Changed
- the way the database name is determined when creating the cache prefix.

## [0.4.15] - 9 May 2019
### Fixed
- bindings used in `whereIn` clauses.

## [0.4.14] - 21 Apr 2019
### Fixed
- where `first()` didn't pass an array parameter.

## [0.4.13] - 4 Apr 2019
### Added
- helper function to run closure with model-caching disabled. Thanks for the suggestion, @mycarrysun

## [0.4.12] - 3 Apr 2019
### Updated
- string and array helpers to use the `Str` and `Arr` classes directly, in preparation for helper deprecations in Laravel 5.9. Thanks @mycarrysun

### Fixed
- disabling of model caching on relationship queries if model caching was disabled on the model. Thanks @mycarrysun
- error that occurred if `whereIn` was given an empty array. Thanks @Ben52

## [0.4.11] - 25 Mar 2019
### Changed
- `useCacheCooldown` to `cacheCooldownSeconds` in models.

## [0.4.10] - 24 Mar 2019
### Updated
- cache cool down functionality to not trigger if it is not set on the model. This should hopefully improve performance. Thanks @mycarrysun for implementing the PR, and thanks @yemenifree for alerting me to the issue!

## [0.4.9] - 6 Mar 2019
### Changed
- `laravel-pivot` dependency back to that of the original owner, as Laravel 5.8 compatibility has been restored.

## [0.4.8] - 4 Mar 2019
### Changed
- to rely on temporarily published `mikebronner/laravel-pivot` package on packagist.

## [0.4.7] - 1 Mar 2019
### Fixed
- installation of patched laravel-pivot dependency.

## [0.4.6] - 28 Feb 2019
### Fixed
- dependency constraints from 5.8 to 5.8.*.

## [0.4.5] - 28 Feb 2019
### Fixed
- using `find()` to get multiple items via an array. Thanks @cluebattery !

## [0.4.4] - 28 Feb 2019
### Added
- functionality for caching of model relationships across different connections and databases. Thanks @PokeGuys for starting the conversation around this problem.

## [0.4.3] - 28 Feb 2019
### Fixed
- cache cooldown flush when cool-down seconds option was used.

## [0.4.2] - 28 Feb 2019
### Fixed
- `laravel-pivot` package compatibility temporarily with Laravel 5.8 patch of my own until they provide compatibility.

## [0.4.1] - 28 Feb 2019
### Fixed
- version requirements in composer.json.

## [0.4.0] - 28 Feb 2019
### Added
- Laravel 5.8 compatibility.

### Removed
- compatibility with previous versions of Laravel, as it was no longer sustainable with all the changes required.

## [0.3.7] - 6 Feb 2019
### Updated
- depency laravel-pivot to next major release version, from a dev-version.

### Changed
- reference to `request()` helper to `app("request")` for Lumen compatibility. Thanks @PokeGuys

## [0.3.6] - 8 Dec 2018
### Added
- functionality to invalidate cache after running `increment()` and `decrement()` queries.

## [0.3.5] - 30 Nov 2018
### Added
- tracking of model table in cache key for those using dynamic table names in models.

### Updated
- dependency of `laravel-pivot` package to use the new code branch which includes a fix for Laravel Telescope compatibility.

## [0.3.5] - 28 Nov 2018
### Fixed
- relationship queries breaking on new where clause type `InRaw`.

## [0.3.3] - 10 Nov 2018
### Fixed
- typo in method `checkCooldownAndFlushAfterPersiting()` to
  `checkCooldownAndFlushAfterPersisting()`; thanks @jacobzlogar!

## [0.3.2] - 3 Nov 2018
### Added
- handling of `whereJsonContains()` and `orWhereJsonContains()`.

### Fixed
- price field value generation in BookFactory to not exceed database field limits.

## [0.3.1] - 7 Oct 2018
### Changed
- use of `cache()` helper method to `app("cache")` to allow for better Lumen compatibility. Thanks @nope7777!

### Updated
- test script for Laravel 5.7 to use non-dev version of test dependency.

### Removed
- `codedungeon/phpunit-result-printer` unit test output printer.

### Fixed
- use of custom pagination name.
- edge-case where tag creation failed.
- usage of `forceDelete()` in the Builder.

## [0.3.0] - 10 Sep 2018
### Added
- Laravel 5.7 compatibility.

## [0.2.64] - 25 Jul 2018
### Fixed
- caching of subqueries of `->whereNotIn()` and `->whereIn()`.
- nested where bindings.

## [0.2.63] - 9 Jun 2018
### Fixed
- where clause binding resolution issue.

## [0.2.62] - 1 Jun 2018
### Fixed
- function name typo.

### Removed
- dump() used for debugging.

## [0.2.61] - 31 May 2018
### Fixed
- caching of paginated queries with page identifiers as arrays (`?page[size]=1`).

## [0.2.60] - 27 May 2018
### Added
- unit tests for multiple versions of Laravel simultaneously.
- backwards-compatibility to Laravel 5.4.

## [0.2.59] - 27 May 2018
### Fixed
- caching of queries with `whereNotIn` clauses.

### Updated
- readme to specify that lazy-loaded relationships are currently not cached.

## [0.2.58] - 24 May 2018
### Fixed
- caching of queries with `whereIn` clauses.

## [0.2.57] - 19 May 2018
### Added
- database name to cache keys and tags to help with multi-tenancy use-cases.

### Fixed
- `find()` using array parameter.

## [0.2.56] - 12 May 2018
### Fixed
- nested `whereNull` within `whereHas`.

## [0.2.55] - 6 May 2018
### Fixed
- caching of `between` where clauses.
- test cache keys and brought them back to green.

## [0.2.54] - 6 May 2018
### Fixed
- caching of query parameter bindings.

## [0.2.53] - 6 May 2018
### Fixed
- `->inRandomOrder()` to not cache the query.

## [0.2.52] - 21 Mar 2018
### Changed
- `flush` console command to be called `clear`, to match other laravel commands.

### Fixed
- implementation of `count()` method.

## [0.2.51] - 10 Mar 2018
### Added
- disabling of `all()` query.

## [0.2.50] - 10 Mar 2018
### Added
- cache invalidation when `destroy()`ing models.

### Fixed
- cache tag generation when calling `all()` queries that prevented proper
  cache invalidation.

## [0.2.49] - 9 Mar 2018
### Fixed
- caching of `->first()` queries.

## [0.2.48] - 9 Mar 2018
### Added
- database connection name to cache prefix.

## [0.2.47] - 5 Mar 2018
### Fixed
- exception when calling disableCache() when caching is already disabled via config.

## [0.2.46] - 5 Mar 2018
### Fixed
- package dependency version to work with Laravel 5.5.

## [0.2.45] - 3 Mar 2018
### Fixed
- pagination cache key generation; fixes #85.

## [0.2.44] - 3 Mar 2018
### Fixed
- disabling of caching using the query scope.

## [0.2.43] - 2 Mar 2018
### Fixed
- actions on belongsToMany relationships not flushing cache when needed.

## [0.2.42] - 28 Feb 2018
### Added
- additional integration tests for additional use cases.

### Fixed
- flushing a specific model from the command line that extended a base class and did not use the trait directly.

## [0.2.41] - 26 Feb 2018
### Fixes
- cache invalidation when using ->insert() method.
- cache invalidation when using ->update() method.

## [0.2.40] - 24 Feb 2018
### Updated
- code with some home-cleaning and refactoring.

## [0.2.39] - 24 Feb 2018
### Updated
- CachedBuilder class with some refactoring and cleanup.

## [0.2.38] - 24 Feb 2018
### Added
- cache-invalidation-cool-down functionality.

## [0.2.37] - 23 Feb 2018
### Added
- disabling of `->all()` method caching via config flag.

## [0.2.36] - 23 Feb 2018
### Added
- config setting to allow disabling of model-caching.

## [0.2.35] - 21 Feb 2018
### Fixed
- cache key generation for `find()` and `findOrFail()`.

### Added
- caching for `paginate()`;

## [0.2.34] - 21 Feb 2018
### Added
- implementation tests using redis.
- additional tests for some edge case scenarios.

### Fixed
- cache key prefix functionality.

### Updated
- tests through refactoring and cleaning up.

## [0.2.33] - 19 Feb 2018
### Added
- unit test to make sure `Model::all()` returns a collection when only only
  record is retrieved.
- console command to flush entire model-cache.

## [0.2.32] - 19 Feb 2018
### Fixed
- hash collision logic to not run query twice if not needed.

## [0.2.31] - 18 Feb 2018
### Added
- optional cache key prefixing.

## [0.2.30] - 18 Feb 2018
### Changed
- detection of Cachable trait to use `class_uses()` instead of looking for
  method.

## [0.2.29] - 18 Feb 2018
### Added
- hash collision detection and prevetion.

## [0.2.28] - 18 Feb 2018
### Changed
- disabling of cache from using session to use cache-key instead.

## [0.2.27] - 17 Feb 2018
### Fixed
- the erroneous use of `arrayEmpty()` function, changed to simple `count()`.

## [0.2.26] - 16 Feb 2018
### Added
- refactor functionality to trait (thanks @rs-sliske!).

## [0.2.25] - 16 Feb 2018
### Fixed
- readme spelling errors (thanks @fridzema!).

## [0.2.24] - 16 Feb 2018
### Fixed
- whereNotIn query caching.

## [0.2.23] - 13 Feb 2018
### Fixed
- whereBetween and value bindings parsing.

## [0.2.22] - 10 Feb 2018
### Fixed
- Laravel 5.5 dependencies.

## [0.2.21] - 9 Feb 2018
### Added
- Laravel 5.6 compatibility.

## [0.2.20] - 7 Feb 2018
### Fixed
- previously existing unit tests to properly consider changes made in 0.2.19.

## [0.2.19] - 7 Feb 2018
### Fixed
- parsing of where clause operators.

## [0.2.18] - 16 Jan 2018
### Added
- hashing of cache keys to prevent key length over-run issues.

### Updated
- dependency version constraint for "pretty test printer".

## [0.2.17] - 10 Jan 2018
###Added
- caching for value() querybuilder method.

### Updated
- tests to use Orchestral Testbench.

## [0.2.16] - 5 Jan 2018
### Added
- `thanks` package.

### Updated
- readme explaining `thanks` package.

## [0.2.15] - 30 Dec 2017
### Added
- sanity checks for artisan command with feedback as to what needs to be fixed.

## [0.2.14] - 30 Dec 2017
### Added
- ability to flush cache for a given model via Artisan command.

## [0.2.13] - 28 Dec 2017
### Added
- ability to define custom cache store in `.env` file.

## [0.2.12] - 14 Dec 2017
### Added
- chainable method to disable caching of queries.

## [0.2.11] - 13 Dec 2017
### Added
- functionality to clear corresponding cache tags when model is deleted.

## [0.2.10] - 5 Dec 2017
### Fixed
- caching when using `orderByRaw()`.

## [0.2.9] - 19 Nov 2017
### Added
- test for query scopes.
- test for relationship query.

### Updated
- readme file.
- travis configuration.

## [0.2.8] - 2017-10-17
### Updated
- code with optimizations and refactoring.

## [0.2.7] - 2017-10-16
### Added
- remaining unit tests that were incomplete, thanks everyone who participated!
- added parsing of where `doesnthave()` condition.

## [0.2.6] - 2017-10-12
### Added
- orderBy clause to cache key. Thanks @RobMKR for the PR!

## [0.2.5] - 2017-10-04
### Fixed
- parsing of nested, exists, raw, and column where clauses.

## [0.2.4] - 2017-10-03
### Added
- .gitignore file to reduce download size for production environment.

### Fixed
- parsing of where clauses with null and notnull.

## [0.2.3] - 2017-10-03
### Fixed
- parsing of where clauses to account for some edge cases.

## [0.2.2] - 2017-09-29
### Added
- additional unit tests for checking caching of lazy-loaded relationships.

### Fixed
- generation of cache key for queries with where clauses.

## [0.2.1] - 2017-09-25
### Fixed
- where clause parsing when where clause is empty.

## [0.2.0] - 2017-09-24
### Changed
- approach to caching things. Completely rewrote the CachedBuilder class.

### Added
- many, many more tests.

## [0.1.0] - 2017-09-22
### Added
- initial development of package.
- unit tests with 100% code coverage.


text:
FOUNDATION_EXPORT double Pods_RxSwift_1_VersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_RxSwift_1_VersionString[];


text:
import time
import json
import os

def log(msg):
    ''' Prints @msg to the terminal with a timestamp '''
    localTime = time.localtime(time.time())
    stringTime = str(localTime[3]) + ":" + str(localTime[4]) + ":" + str(localTime[5])

    print stringTime + ": " + msg

def decodeJSON(data):
    '''Decodes JSON from a @data'''
    result = json.loads(data)

    return result

def countFiles(folder):
    """ Counts the number of files in a directory """
    count = 0
    for f in os.listdir(folder):
        if os.path.isfile(os.path.join(folder, f)):
            count += 1

    return count


text:
#include "uv.h"
#include "task.h"

static int once_cb_called = 0;
static int once_close_cb_called = 0;
static int repeat_cb_called = 0;
static int repeat_close_cb_called = 0;
static int order_cb_called = 0;
static uint64_t start_time;
static uv_timer_t tiny_timer;
static uv_timer_t huge_timer1;
static uv_timer_t huge_timer2;

static void once_close_cb(uv_handle_t* handle) {
  printf("ONCE_CLOSE_CB\n");

  ASSERT(handle != NULL);
  ASSERT(!uv_is_active(handle));

  once_close_cb_called++;
}

static void once_cb(uv_timer_t* handle, int status) {
  printf("ONCE_CB %d\n", once_cb_called);

  ASSERT(handle != NULL);
  ASSERT(status == 0);
  ASSERT(!uv_is_active((uv_handle_t*)handle));

  once_cb_called++;

  uv_close((uv_handle_t*)handle, once_close_cb);

  /* Just call this randomly for the code coverage. */
  uv_update_time(uv_default_loop());
}

static void repeat_close_cb(uv_handle_t* handle) {
  printf("REPEAT_CLOSE_CB\n");

  ASSERT(handle != NULL);

  repeat_close_cb_called++;
}

static void repeat_cb(uv_timer_t* handle, int status) {
  printf("REPEAT_CB\n");

  ASSERT(handle != NULL);
  ASSERT(status == 0);
  ASSERT(uv_is_active((uv_handle_t*)handle));

  repeat_cb_called++;

  if (repeat_cb_called == 5) {
    uv_close((uv_handle_t*)handle, repeat_close_cb);
  }
}

static void never_cb(uv_timer_t* handle, int status) {
  FATAL("never_cb should never be called");
}

TEST_IMPL(timer) {
  uv_timer_t once_timers[10];
  uv_timer_t *once;
  uv_timer_t repeat, never;
  unsigned int i;
  int r;

  start_time = uv_now(uv_default_loop());
  ASSERT(0 < start_time);

  /* Let 10 timers time out in 500 ms total. */
  for (i = 0; i < ARRAY_SIZE(once_timers); i++) {
    once = once_timers + i;
    r = uv_timer_init(uv_default_loop(), once);
    ASSERT(r == 0);
    r = uv_timer_start(once, once_cb, i * 50, 0);
    ASSERT(r == 0);
  }

  /* The 11th timer is a repeating timer that runs 4 times */
  r = uv_timer_init(uv_default_loop(), &repeat);
  ASSERT(r == 0);
  r = uv_timer_start(&repeat, repeat_cb, 100, 100);
  ASSERT(r == 0);

  /* The 12th timer should not do anything. */
  r = uv_timer_init(uv_default_loop(), &never);
  ASSERT(r == 0);
  r = uv_timer_start(&never, never_cb, 100, 100);
  ASSERT(r == 0);
  r = uv_timer_stop(&never);
  ASSERT(r == 0);
  uv_unref((uv_handle_t*)&never);

  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(once_cb_called == 10);
  ASSERT(once_close_cb_called == 10);
  printf("repeat_cb_called %d\n", repeat_cb_called);
  ASSERT(repeat_cb_called == 5);
  ASSERT(repeat_close_cb_called == 1);

  ASSERT(500 <= uv_now(uv_default_loop()) - start_time);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

TEST_IMPL(timer_start_twice) {
  uv_timer_t once;
  int r;

  r = uv_timer_init(uv_default_loop(), &once);
  ASSERT(r == 0);
  r = uv_timer_start(&once, never_cb, 86400 * 1000, 0);
  ASSERT(r == 0);
  r = uv_timer_start(&once, once_cb, 10, 0);
  ASSERT(r == 0);
  r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
  ASSERT(r == 0);

  ASSERT(once_cb_called == 1);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

TEST_IMPL(timer_init) {
  uv_timer_t handle;

  ASSERT(0 == uv_timer_init(uv_default_loop(), &handle));
  ASSERT(0 == uv_timer_get_repeat(&handle));
  ASSERT(!uv_is_active((uv_handle_t*)&handle));

  MAKE_VALGRIND_HAPPY();
  return 0;
}

static void order_cb_a(uv_timer_t *handle, int status) {
  ASSERT(order_cb_called++ == *(int*)handle->data);
}

static void order_cb_b(uv_timer_t *handle, int status) {
  ASSERT(order_cb_called++ == *(int*)handle->data);
}

TEST_IMPL(timer_order) {
  int first;
  int second;
  uv_timer_t handle_a;
  uv_timer_t handle_b;

  first = 0;
  second = 1;
  ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_a));
  ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_b));

  /* Test for starting handle_a then handle_b */
  handle_a.data = &first;
  ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0));
  handle_b.data = &second;
  ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0));
  ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));

  ASSERT(order_cb_called == 2);

  ASSERT(0 == uv_timer_stop(&handle_a));
  ASSERT(0 == uv_timer_stop(&handle_b));

  /* Test for starting handle_b then handle_a */
  order_cb_called = 0;
  handle_b.data = &first;
  ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0));

  handle_a.data = &second;
  ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0));
  ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));

  ASSERT(order_cb_called == 2);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

static void tiny_timer_cb(uv_timer_t* handle, int status) {
  ASSERT(handle == &tiny_timer);
  uv_close((uv_handle_t*) &tiny_timer, NULL);
  uv_close((uv_handle_t*) &huge_timer1, NULL);
  uv_close((uv_handle_t*) &huge_timer2, NULL);
}

TEST_IMPL(timer_huge_timeout) {
  ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer));
  ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1));
  ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer2));
  ASSERT(0 == uv_timer_start(&tiny_timer, tiny_timer_cb, 1, 0));
  ASSERT(0 == uv_timer_start(&huge_timer1, tiny_timer_cb, 0xffffffffffffLL, 0));
  ASSERT(0 == uv_timer_start(&huge_timer2, tiny_timer_cb, (uint64_t) -1, 0));
  ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
  MAKE_VALGRIND_HAPPY();
  return 0;
}

static void huge_repeat_cb(uv_timer_t* handle, int status) {
  static int ncalls;

  if (ncalls == 0)
    ASSERT(handle == &huge_timer1);
  else
    ASSERT(handle == &tiny_timer);

  if (++ncalls == 10) {
    uv_close((uv_handle_t*) &tiny_timer, NULL);
    uv_close((uv_handle_t*) &huge_timer1, NULL);
  }
}

TEST_IMPL(timer_huge_repeat) {
  ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer));
  ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1));
  ASSERT(0 == uv_timer_start(&tiny_timer, huge_repeat_cb, 2, 2));
  ASSERT(0 == uv_timer_start(&huge_timer1, huge_repeat_cb, 1, (uint64_t) -1));
  ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
  MAKE_VALGRIND_HAPPY();
  return 0;
}


text:
using System.Linq;
using System.Web;
using System.Web.Http;

namespace ASC.CdnCheck.Controllers
{
    public class CdnController : ApiController
    {
        [HttpGet]
        public void Error(int status, string url)
        {
            var logger = log4net.LogManager.GetLogger("ASC");
            logger.Debug("");
            logger.DebugFormat("status:{0}", status);

            foreach (var header in Request.Headers)
            {
                logger.DebugFormat("{0}: {1}", header.Key, header.Value.Aggregate((a,b)=> string.Format("{0},{1}",a,b)));
            }

            logger.DebugFormat("host address {0}", HttpContext.Current.Request.UserHostAddress);
            logger.DebugFormat("host name {0}", HttpContext.Current.Request.UserHostName);
        }
    }
}


text:
package com.skubit.bitid;

import com.skubit.dialog.ProgressCallback;
import com.skubit.shared.dto.BitJwtCallbackResponseDto;

public interface BitIdCallback extends ProgressCallback {

    void showChooseAddress(String bitID);

    void showCreateAddress(String bitID, ECKeyData keyData);

    void showSignInRequest(String bitID);

    void showSignInResponse(BitJwtCallbackResponseDto data, String bitID);

}


text:
var assert = require('assert');
var bn = require('bn.js');
var elliptic = require('../../elliptic');
var utils = elliptic.utils;

var KeyPair = require('./key');
var Signature = require('./signature');

function EC(options) {
  if (!(this instanceof EC))
    return new EC(options);

  // Shortcut `elliptic.ec(curve-name)`
  if (typeof options === 'string') {
    assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);

    options = elliptic.curves[options];
  }

  // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  if (options instanceof elliptic.curves.PresetCurve)
    options = { curve: options };

  this.curve = options.curve.curve;
  this.n = this.curve.n;
  this.nh = this.n.shrn(1);
  this.g = this.curve.g;

  // Point on curve
  this.g = options.curve.g;
  this.g.precompute(options.curve.n.bitLength() + 1);

  // Hash for function for DRBG
  this.hash = options.hash || options.curve.hash;
}
module.exports = EC;

EC.prototype.keyPair = function keyPair(priv, pub) {
  return new KeyPair(this, priv, pub);
};

EC.prototype.genKeyPair = function genKeyPair(options) {
  if (!options)
    options = {};

  // Instantiate Hmac_DRBG
  var drbg = new elliptic.hmacDRBG({
    hash: this.hash,
    pers: options.pers,
    entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),
    nonce: this.n.toArray()
  });

  var bytes = this.n.byteLength();
  var ns2 = this.n.sub(new bn(2));
  do {
    var priv = new bn(drbg.generate(bytes));
    if (priv.cmp(ns2) > 0)
      continue;

    priv.iaddn(1);
    return this.keyPair(priv);
  } while (true);
};

EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
  var delta = msg.byteLength() * 8 - this.n.bitLength();
  if (delta > 0)
    msg = msg.shrn(delta);
  if (!truncOnly && msg.cmp(this.n) >= 0)
    return msg.sub(this.n);
  else
    return msg;
};

EC.prototype.sign = function sign(msg, key, options) {
  key = this.keyPair(key, 'hex');
  msg = this._truncateToN(new bn(msg, 16));
  if (!options)
    options = {};

  // Zero-extend key to provide enough entropy
  var bytes = this.n.byteLength();
  var bkey = key.getPrivate().toArray();
  for (var i = bkey.length; i < 21; i++)
    bkey.unshift(0);

  // Zero-extend nonce to have the same byte size as N
  var nonce = msg.toArray();
  for (var i = nonce.length; i < bytes; i++)
    nonce.unshift(0);

  // Instantiate Hmac_DRBG
  var drbg = new elliptic.hmacDRBG({
    hash: this.hash,
    entropy: bkey,
    nonce: nonce
  });

  // Number of bytes to generate
  var ns1 = this.n.sub(new bn(1));
  do {
    var k = new bn(drbg.generate(this.n.byteLength()));
    k = this._truncateToN(k, true);
    if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
      continue;

    var kp = this.g.mul(k);
    if (kp.isInfinity())
      continue;

    var r = kp.getX().mod(this.n);
    if (r.cmpn(0) === 0)
      continue;

    var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)).mod(this.n);
    if (s.cmpn(0) === 0)
      continue;

    // Use complement of `s`, if it is > `n / 2`
    if (options.canonical && s.cmp(this.nh) > 0)
      s = this.n.sub(s);

    return new Signature(r, s);
  } while (true);
};

EC.prototype.verify = function verify(msg, signature, key) {
  msg = this._truncateToN(new bn(msg, 16));
  key = this.keyPair(key, 'hex');
  signature = new Signature(signature, 'hex');

  // Perform primitive values validation
  var r = signature.r;
  var s = signature.s;
  if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
    return false;
  if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
    return false;

  // Validate signature
  var sinv = s.invm(this.n);
  var u1 = sinv.mul(msg).mod(this.n);
  var u2 = sinv.mul(r).mod(this.n);

  var p = this.g.mulAdd(u1, key.getPublic(), u2);
  if (p.isInfinity())
    return false;

  return p.getX().mod(this.n).cmp(r) === 0;
};


text:
#pragma once
#include <aws/codestar-connections/CodeStarconnections_EXPORTS.h>
#include <aws/codestar-connections/CodeStarconnectionsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/codestar-connections/model/ProviderType.h>
#include <aws/codestar-connections/model/VpcConfiguration.h>
#include <utility>

namespace Aws
{
namespace CodeStarconnections
{
namespace Model
{

  /**
   */
  class AWS_CODESTARCONNECTIONS_API CreateHostRequest : public CodeStarconnectionsRequest
  {
  public:
    CreateHostRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "CreateHost"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline CreateHostRequest& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline CreateHostRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of the host to be created. The name must be unique in the calling
     * AWS account.

     */
    inline CreateHostRequest& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline const ProviderType& GetProviderType() const{ return m_providerType; }

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline bool ProviderTypeHasBeenSet() const { return m_providerTypeHasBeenSet; }

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline void SetProviderType(const ProviderType& value) { m_providerTypeHasBeenSet = true; m_providerType = value; }

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline void SetProviderType(ProviderType&& value) { m_providerTypeHasBeenSet = true; m_providerType = std::move(value); }

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline CreateHostRequest& WithProviderType(const ProviderType& value) { SetProviderType(value); return *this;}

    /**
     *
The name of the installed provider to be associated with your connection. The
     * host resource represents the infrastructure where your provider type is
     * installed. The valid provider type is GitHub Enterprise Server.

     */
    inline CreateHostRequest& WithProviderType(ProviderType&& value) { SetProviderType(std::move(value)); return *this;}

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline const Aws::String& GetProviderEndpoint() const{ return m_providerEndpoint; }

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline bool ProviderEndpointHasBeenSet() const { return m_providerEndpointHasBeenSet; }

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline void SetProviderEndpoint(const Aws::String& value) { m_providerEndpointHasBeenSet = true; m_providerEndpoint = value; }

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline void SetProviderEndpoint(Aws::String&& value) { m_providerEndpointHasBeenSet = true; m_providerEndpoint = std::move(value); }

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline void SetProviderEndpoint(const char* value) { m_providerEndpointHasBeenSet = true; m_providerEndpoint.assign(value); }

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline CreateHostRequest& WithProviderEndpoint(const Aws::String& value) { SetProviderEndpoint(value); return *this;}

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline CreateHostRequest& WithProviderEndpoint(Aws::String&& value) { SetProviderEndpoint(std::move(value)); return *this;}

    /**
     *
The endpoint of the infrastructure to be represented by the host after it is
     * created.

     */
    inline CreateHostRequest& WithProviderEndpoint(const char* value) { SetProviderEndpoint(value); return *this;}

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline const VpcConfiguration& GetVpcConfiguration() const{ return m_vpcConfiguration; }

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline bool VpcConfigurationHasBeenSet() const { return m_vpcConfigurationHasBeenSet; }

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline void SetVpcConfiguration(const VpcConfiguration& value) { m_vpcConfigurationHasBeenSet = true; m_vpcConfiguration = value; }

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline void SetVpcConfiguration(VpcConfiguration&& value) { m_vpcConfigurationHasBeenSet = true; m_vpcConfiguration = std::move(value); }

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline CreateHostRequest& WithVpcConfiguration(const VpcConfiguration& value) { SetVpcConfiguration(value); return *this;}

    /**
     *
The VPC configuration to be provisioned for the host. A VPC must be
     * configured and the infrastructure to be represented by the host must already be
     * connected to the VPC.

     */
    inline CreateHostRequest& WithVpcConfiguration(VpcConfiguration&& value) { SetVpcConfiguration(std::move(value)); return *this;}

  private:

    Aws::String m_name;
    bool m_nameHasBeenSet;

    ProviderType m_providerType;
    bool m_providerTypeHasBeenSet;

    Aws::String m_providerEndpoint;
    bool m_providerEndpointHasBeenSet;

    VpcConfiguration m_vpcConfiguration;
    bool m_vpcConfigurationHasBeenSet;
  };

} // namespace Model
} // namespace CodeStarconnections
} // namespace Aws


text:
class CreateIdentities < ActiveRecord::Migration[5.0]
  def change
    create_table :identities, id: :uuid do |t|
      t.belongs_to :user, null: false, type: :uuid
      t.string :provider, null: false
      t.string :external_id, null: false
      t.string :external_username
      t.string :external_name
      t.string :external_email
      t.json :data

      t.timestamps
    end
  end
end


text:
import inspect

from django.db import models
from django.db.models import Q
from django.core.exceptions import ImproperlyConfigured

from avocado.conf import settings

__all__ = ('ModelTree',)

DEFAULT_MODELTREE_ALIAS = 'default'

class ModelTreeNode(object):
    def __init__(self, model, parent=None, rel_type=None, rel_reversed=None,
        related_name=None, accessor_name=None, depth=0):

        """Defines attributes of a `model' and the relationship to the parent
        model.

            `name' - the `model's class name

            `db_table' - the model's database table name

            `pk_field' - the model's primary key field

            `parent' - a reference to the parent ModelTreeNode

            `parent_model' - a reference to the `parent' model, since it may be
            None

            `rel_type' - denotes the _kind_ of relationship with the
            following possibilities: 'manytomany', 'onetoone', or 'foreignkey'.

            `rel_reversed' - denotes whether this node was derived from a
            forward relationship (an attribute lives on the parent model) or
            a reverse relationship (an attribute lives on this model).

            `related_name' - is the query string representation which is used
            when querying via the ORM.

            `accessor_name' - can be used when accessing the model object's
            attributes e.g. getattr(obj, accessor_name). this is relative to
            the parent model.

            `depth' - the depth of this node relative to the root (zero-based
            index)

            `children' - a list containing the child nodes
        """
        self.model = model
        self.name = model.__name__
        self.db_table = model._meta.db_table
        self.pk_field = model._meta.pk.column

        self.parent = parent
        self.parent_model = parent and parent.model or None

        self.rel_type = rel_type
        self.rel_reversed = rel_reversed
        self.related_name = related_name
        self.accessor_name = accessor_name
        self.depth = depth

        self.children = []

    def __str__(self):
        return '%s via %s' % (self.name, self.parent_model.__name__)

    def _get_m2m_db_table(self):
        f = getattr(self.parent_model, self.accessor_name)
        if self.rel_reversed:
            return f.related.field.m2m_db_table()
        else:
            return f.field.m2m_db_table()
    m2m_db_table = property(_get_m2m_db_table)

    def _get_m2m_field(self):
        f = getattr(self.parent_model, self.accessor_name)
        if self.rel_reversed:
            return f.related.field.m2m_column_name()
        else:
            return f.field.m2m_column_name()
    m2m_field = property(_get_m2m_field)

    def _get_m2m_reverse_field(self):
        f = getattr(self.parent_model, self.accessor_name)
        if self.rel_reversed:
            return f.related.field.m2m_reverse_name()
        else:
            return f.field.m2m_reverse_name()
    m2m_reverse_field = property(_get_m2m_reverse_field)

    def _get_foreignkey_field(self):
        f = getattr(self.parent_model, self.accessor_name)
        if self.rel_reversed:
            return f.related.field.column
        else:
            return f.field.column
    foreignkey_field = property(_get_foreignkey_field)

    def _get_join_connections(self):
        """Returns a list of connections that need to be added to a
        QuerySet object that properly joins this model and the parent.
        """
        if not hasattr(self, '_join_connections'):
            connections = []
            # setup initial FROM clause
            connections.append((None, self.parent.db_table, None, None))

            # setup two connections for m2m
            if self.rel_type == 'manytomany':
                c1 = (
                    self.parent.db_table,
                    self.m2m_db_table,
                    self.parent.pk_field,
                    self.rel_reversed and self.m2m_reverse_field or \
                        self.m2m_field,
                )

                c2 = (
                    self.m2m_db_table,
                    self.db_table,
                    self.rel_reversed and self.m2m_field or \
                        self.m2m_reverse_field,
                    self.pk_field,
                )
                connections.append(c1)
                connections.append(c2)
            else:
                c1 = (
                    self.parent.db_table,
                    self.db_table,
                    self.rel_reversed and self.parent.pk_field or \
                        self.foreignkey_field,
                    self.rel_reversed and self.foreignkey_field or \
                        self.parent.pk_field,
                )
                connections.append(c1)

            self._join_connections = connections
        return self._join_connections
    join_connections = property(_get_join_connections)

    def remove_child(self, model):
        for i, cnode in enumerate(self.children):
            if cnode.model is model:
                return self.children.pop(i)

class ModelTree(object):
    """A class to handle building and parsing a tree structure given a model.

        `root_model' - the model of interest in which everything is relatively
        defined

        `exclude' - a list of models that are not to be added to the tree
    """
    def __init__(self, root_model, exclude=(), routes=()):
        self.root_model = self._get_model(root_model)
        self.exclude = map(self._get_model, exclude)

        self._rts, self._tos = self._build_routes(routes)
        self._tree_hash = {}

    def check(self, queryset):
        if queryset.model is self.root_model:
            return True
        return False

    def _get_model(self, label):
        # model class
        if inspect.isclass(label) and issubclass(label, models.Model):
            return label
        # passed as a label string
        elif isinstance(label, basestring):
            app_label, model_label = label.lower().split('.')
            model = models.get_model(app_label, model_label)
            if model:
                return model
        raise TypeError, 'model "%s" could not be found' % label

    def _build_routes(self, routes):
        """
        Routes provide a means of specifying JOINs between two tables.

        The minimum information necessary to define an explicit JOIN is as
        follows:

            'from_label' - defines the model on the right side of the join
            'to_label' - defines the model on the left side of the join
            'join_field' - defines the field in which the join will occur
            'symmetrical' - defines whether the same join will be constructed
                if the 'from_model' and 'to_model' are reversed
        """
        rts = {}
        tos = {}

        for route in routes:
            # unpack
            from_label, to_label, join_field, symmetrical = route

            # get models
            from_model = self._get_model(from_label)
            to_model = self._get_model(to_label)

            # get field
            if join_field is not None:
                model_name, field_name = join_field.split('.')
                model_name = model_name.lower()

                if model_name == from_model.__name__.lower():
                    field = from_model._meta.get_field_by_name(field_name)[0]
                elif model_name == to_model.__name__.lower():
                    field = to_model._meta.get_field_by_name(field_name)[0]
                else:
                    raise TypeError, 'model for join_field, "%s", does not match' % field_name

                if field is None:
                    raise TypeError, 'field "%s" not found'
            else:
                field = None

            if field:
                rts[(from_model, to_model)] = field
                if symmetrical:
                    rts[(to_model, from_model)] = field
            else:
                tos[to_model] = from_model

        return rts, tos

    def _filter_one2one(self, field):
        """Tests if this field is a OneToOneField. If a route exists for this
        field's model and it's target model, ensure this is the field that
        should be used to join the the two tables.
        """
        if isinstance(field, models.OneToOneField):
            # route has been defined with a specific field required
            tup = (field.model, field.rel.to)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return field

    def _filter_related_one2one(self, rel):
        """Tests if this RelatedObject represents a OneToOneField. If a route
        exists for this field's model and it's target model, ensure this is
        the field that should be used to join the the two tables.
        """
        field = rel.field
        if isinstance(field, models.OneToOneField):
            # route has been defined with a specific field required
            tup = (rel.model, field.model)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return rel

    def _filter_fk(self, field):
        """Tests if this field is a ForeignKey. If a route exists for this
        field's model and it's target model, ensure this is the field that
        should be used to join the the two tables.
        """
        if isinstance(field, models.ForeignKey):
            # route has been defined with a specific field required
            tup = (field.model, field.rel.to)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return field

    def _filter_related_fk(self, rel):
        """Tests if this RelatedObject represents a ForeignKey. If a route
        exists for this field's model and it's target model, ensure this is
        the field that should be used to join the the two tables.
        """
        field = rel.field
        if isinstance(field, models.ForeignKey):
            # route has been defined with a specific field required
            tup = (rel.model, field.model)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return rel

    def _filter_m2m(self, field):
        """Tests if this field is a ManyToManyField. If a route exists for this
        field's model and it's target model, ensure this is the field that
        should be used to join the the two tables.
        """
        if isinstance(field, models.ManyToManyField):
            # route has been defined with a specific field required
            tup = (field.model, field.rel.to)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return field

    def _filter_related_m2m(self, rel):
        """Tests if this RelatedObject represents a ManyToManyField. If a route
        exists for this field's model and it's target model, ensure this is
        the field that should be used to join the the two tables.
        """
        field = rel.field
        if isinstance(field, models.ManyToManyField):
            # route has been defined with a specific field required
            tup = (rel.model, field.model)
            # skip if not the correct field
            if self._rts.has_key(tup) and self._rts.get(tup) is not field:
                return
            return rel

    def _add_node(self, parent, model, rel_type, rel_reversed, related_name,
        accessor_name, depth):
        """Adds a node to the tree only if a node of the same `model' does not
        already exist in the tree with smaller depth. If the node is added, the
        tree traversal continues finding the node's relations.

        Conditions in which the node will fail to be added:

            - the model is excluded completely
            - the model is going back the same path it came from
            - the model is circling back to the root_model
            - the model does not come from the parent.model (via _tos)
        """
        exclude = set(self.exclude + [parent.parent_model, self.root_model])

        # ignore excluded models and prevent circular paths
        if model in exclude:
            return

        # if a route exists, only allow the model to be added if coming from the
        # specified parent.model
        if self._tos.has_key(model) and self._tos.get(model) is not parent.model:
            return

        node_hash = self._tree_hash.get(model, None)

        # don't add node if a path with a shorter depth exists. this is applied
        # after the correct join has been determined. generally if a route is
        # defined for relation, this will never be an issue since there would
        # only be one path available. if a route is not defined, the shorter
        # path will be found
        if not node_hash or node_hash['depth'] > depth:
            if node_hash:
                node_hash['parent'].remove_child(model)

            node = ModelTreeNode(model, parent, rel_type, rel_reversed,
                related_name, accessor_name, depth)

            self._tree_hash[model] = {'parent': parent, 'depth': depth,
                'node': node}

            node = self._find_relations(node, depth)
            parent.children.append(node)
            del node

    def _find_relations(self, node, depth=0):
        """Finds all relations given a node.

        NOTE: the many-to-many relations are evaluated first to prevent
        'through' models being bound as a ForeignKey relationship.
        """
        depth += 1

        model = node.model

        # determine relational fields to determine paths
        forward_fields = model._meta.fields
        reverse_fields = model._meta.get_all_related_objects()

        forward_o2o = filter(self._filter_one2one, forward_fields)
        reverse_o2o = filter(self._filter_related_one2one, reverse_fields)

        forward_fk = filter(self._filter_fk, forward_fields)
        reverse_fk = filter(self._filter_related_fk, reverse_fields)

        forward_m2m = filter(self._filter_m2m, model._meta.many_to_many)
        reverse_m2m = filter(self._filter_related_m2m, model._meta.get_all_related_many_to_many_objects())

        # iterate m2m relations
        for f in forward_m2m:
            kwargs = {
                'parent': node,
                'model': f.rel.to,
                'rel_type': 'manytomany',
                'rel_reversed': False,
                'related_name': f.name,
                'accessor_name': f.name,
                'depth': depth,
            }
            self._add_node(**kwargs)

        # iterate over related m2m fields
        for r in reverse_m2m:
            kwargs = {
                'parent': node,
                'model': r.model,
                'rel_type': 'manytomany',
                'rel_reversed': True,
                'related_name': r.field.related_query_name(),
                'accessor_name': r.get_accessor_name(),
                'depth': depth,
            }
            self._add_node(**kwargs)

        # iterate over one2one fields
        for f in forward_o2o:
            kwargs = {
                'parent': node,
                'model': f.rel.to,
                'rel_type': 'onetoone',
                'rel_reversed': False,
                'related_name': f.name,
                'accessor_name': f.name,
                'depth': depth,
            }
            self._add_node(**kwargs)

        # iterate over related one2one fields
        for r in reverse_o2o:
            kwargs = {
                'parent': node,
                'model': r.model,
                'rel_type': 'onetoone',
                'rel_reversed': True,
                'related_name': r.field.related_query_name(),
                'accessor_name': r.get_accessor_name(),
                'depth': depth,
            }
            self._add_node(**kwargs)

        # iterate over fk fields
        for f in forward_fk:
            kwargs = {
                'parent': node,
                'model': f.rel.to,
                'rel_type': 'foreignkey',
                'rel_reversed': False,
                'related_name': f.name,
                'accessor_name': f.name,
                'depth': depth,
            }
            self._add_node(**kwargs)

        # iterate over related foreign keys
        for r in reverse_fk:
            kwargs = {
                'parent': node,
                'model': r.model,
                'rel_type': 'foreignkey',
                'rel_reversed': True,
                'related_name': r.field.related_query_name(),
                'accessor_name': r.get_accessor_name(),
                'depth': depth,
            }
            self._add_node(**kwargs)

        return node

    def _get_root_node(self):
        "Sets the `root_node' and implicitly builds the entire tree."
        if not hasattr(self, '_root_node'):
            node = ModelTreeNode(self.root_model)
            self._root_node = self._find_relations(node)
            self._tree_hash[self.root_model] = {'parent': None, 'depth': 0,
                'node': self._root_node}
        return self._root_node
    root_node = property(_get_root_node)

    def _find_path(self, model, node, node_path=[]):
        if node.model == model:
            return node_path
        for cnode in node.children:
            mpath = self._find_path(model, cnode, node_path + [cnode])
            if mpath:
                return mpath

    def path_to(self, model):
        "Returns a list of nodes thats defines the path of traversal."
        model = self._get_model(model)
        return self._find_path(model, self.root_node)

    def path_to_with_root(self, model):
        """Returns a list of nodes thats defines the path of traversal
        including the root node.
        """
        model = self._get_model(model)
        return self._find_path(model, self.root_node, [self.root_node])

    def get_node_by_model(self, model):
        "Finds the node with the specified model."
        model = self._get_model(model)
        if not self._tree_hash:
            self.root_node
        val = self._tree_hash.get(model, None)
        if val is None:
            return
        return val['node']

    def query_string(self, node_path, field_name, operator=None):
        "Returns a query string given a path"
        toks = [n.related_name for n in node_path] + [field_name]
        if operator is not None:
            toks.append(operator)
        return str('__'.join(toks))

    def q(self, node_path, field_name, value, operator=None):
        "Returns a Q object."
        key = self.query_string(node_path, field_name, operator)
        return Q(**{key: value})

    def accessor_names(self, node_path):
        """Returns a list of the accessor names given a list of nodes. This is
        most useful when needing to dynamically access attributes starting from
        an instance of the `root_node' object.
        """
        return [n.accessor_name for n in node_path]

    def get_all_join_connections(self, node_path):
        """Returns a list of JOIN connections that can be manually applied to a
        QuerySet object, e.g.:

            queryset = SomeModel.objects.all()
            modeltree = ModelTree(SomeModel)
            nodes = modeltree.path_to(SomeOtherModel)
            conns = modeltree.get_all_join_connections(nodes)
            for c in conns:
                queryset.query.join(c, promote=True)

        This allows for the ORM to handle setting up the JOINs which may be
        different depending the QuerySet being altered.
        """
        connections = []
        for i,node in enumerate(node_path):
            if i == 0:
                connections.extend(node.join_connections)
            else:
                connections.extend(node.join_connections[1:])
        return connections

    def add_joins(self, model, queryset, **kwargs):
        model = self._get_model(model)

        clone = queryset._clone()
        nodes = self.path_to(model)
        conns = self.get_all_join_connections(nodes)
        for c in conns:
            clone.query.join(c, **kwargs)
        return clone

    def print_path(self, node=None, depth=0):
        "Traverses the entire tree and prints a hierarchical view to stdout."
        if node is None:
            node = self.root_node
        if node:
            print '- ' * depth * 2, '"%s"' % node.name, 'at a depth of', node.depth
        if node.children:
            depth += 1
            for x in node.children:
                self.print_path(x, depth)

    def get_accessor_pairs(self, node_path):
        "Used for testing purposes."
        accessor_names = self.accessor_names(node_path)
        node_path = node_path[:-1] # don't need the last item
        if len(node_path) == 0 or node_path[0] is not self.root_node:
            node_path = [self.root_node] + node_path
        else:
            accessor_names = accessor_names[1:]
        return zip(node_path, accessor_names)

    def get_queryset(self):
        "Returns a QuerySet relative to the ``root_model``."
        return self.root_model.objects.all()

class LazyModelTree(object):
    def __init__(self, modeltrees):
        self.modeltrees = modeltrees
        self._modeltrees = {}

    def __getitem__(self, alias):
        if not self.modeltrees:
            raise ImproperlyConfigured, 'You must at least specify the "%s" ' \
                'modeltree config' % DEFAULT_MODELTREE_ALIAS

        if alias not in self._modeltrees:
            try:
                kwargs = self.modeltrees[alias]
            except KeyError:
                raise KeyError, 'No modeltree settings defined for "%s"' % alias

            self._modeltrees[alias] = ModelTree(**kwargs)
        return self._modeltrees[alias]

trees = LazyModelTree(settings.MODELTREES)


text:
#ifndef __RTW_BTCOEX_WIFIONLY_H__
#define __RTW_BTCOEX_WIFIONLY_H__

#if defined(CONFIG_RTL8721D) || defined(CONFIG_RTL8710C) || defined(CONFIG_RTL8821C)
void rtw_btcoex_wifionly_switchband_notify(PADAPTER padapter);
void rtw_btcoex_wifionly_scan_notify(PADAPTER padapter);
void rtw_btcoex_wifionly_connect_notify(PADAPTER padapter);
void rtw_btcoex_wifionly_hw_config(PADAPTER padapter);
void rtw_btcoex_wifionly_initialize(PADAPTER padapter);
void rtw_btcoex_wifionly_AntInfoSetting(PADAPTER padapter);
#else
#define rtw_btcoex_wifionly_switchband_notify(padapter)
#define rtw_btcoex_wifionly_scan_notify(padapter)
#define rtw_btcoex_wifionly_connect_notify(padapter)
#define rtw_btcoex_wifionly_hw_config(padapter)
#define rtw_btcoex_wifionly_initialize(padapter)
#define rtw_btcoex_wifionly_AntInfoSetting(padapter)
#endif
#endif


text:
package goflow

type Application interface {
	Name() string
	Id() AppId
}

type AppId uint64


text:
.class public Lcom/htc/wrap/android/app/HtcWrapNotification;
.super Landroid/app/Notification;
.source "HtcWrapNotification.java"

# static fields
.field public static final CHARM_INCOMING_CALL:I = 0x6

.field public static final CHARM_MISSED_CALL:I = 0x7

.field public static final CHARM_OFF:I = 0x0

.field public static final FLAG_CALL_FORWARD_EVENT:I = 0x200000

.field public static final FLAG_DLNA_GALLERY_EVENT:I = 0x100000

.field public static final FLAG_DLNA_MUSIC_EVENT:I = 0x80000

.field public static final FLAG_MSG_FORWARD_EVENT:I = 0x400000

.field public static final FLAG_MUSIC_EVENT:I = 0x40000

.field public static final FLAG_ONTOP_EVENT:I = 0x20000

.field public static final FLAG_SHOW_CHARMS:I = 0x2000000

.field public static final FLAG_SHOW_JOGS:I = 0x10000

.field public static final FLAG_SOUND_ONLY_PREFERRED:I = 0x1000000

.field public static final JOG_BREATHING:I = 0x7

.field public static final JOG_OFF:I = 0x0

.field public static final JOG_SHORT_FLASH:I = 0x3

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 44
    invoke-direct {p0}, Landroid/app/Notification;-><init>()V

    .line 45
    return-void
.end method

.method public constructor <init>(ILjava/lang/CharSequence;J)V
    .locals 0
    .parameter "icon"
    .parameter "tickerText"
    .parameter "when"

    .prologue
    .line 55
    invoke-direct {p0, p1, p2, p3, p4}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 56
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;ILjava/lang/CharSequence;JLjava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/content/Intent;)V
    .locals 0
    .parameter "context"
    .parameter "icon"
    .parameter "tickerText"
    .parameter "when"
    .parameter "contentTitle"
    .parameter "contentText"
    .parameter "contentIntent"

    .prologue
    .line 50
    invoke-direct/range {p0 .. p8}, Landroid/app/Notification;-><init>(Landroid/content/Context;ILjava/lang/CharSequence;JLjava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/content/Intent;)V

    .line 51
    return-void
.end method

.method public constructor <init>(Landroid/os/Parcel;)V
    .locals 0
    .parameter "parcel"

    .prologue
    .line 60
    invoke-direct {p0, p1}, Landroid/app/Notification;-><init>(Landroid/os/Parcel;)V

    .line 61
    return-void
.end method

# virtual methods
.method public getCharmMode()I
    .locals 1

    .prologue
    .line 87
    iget v0, p0, Landroid/app/Notification;->charmMode:I

    return v0
.end method

.method public getExtras()Landroid/os/Bundle;
    .locals 1

    .prologue
    .line 103
    iget-object v0, p0, Landroid/app/Notification;->extras:Landroid/os/Bundle;

    return-object v0
.end method

.method public getJogMode()I
    .locals 1

    .prologue
    .line 71
    iget v0, p0, Landroid/app/Notification;->jogMode:I

    return v0
.end method

.method public setCharmMode(I)V
    .locals 0
    .parameter "mode"

    .prologue
    .line 78
    iput p1, p0, Landroid/app/Notification;->charmMode:I

    .line 79
    return-void
.end method

.method public setExtras(Landroid/os/Bundle;)V
    .locals 0
    .parameter "extras"

    .prologue
    .line 99
    iput-object p1, p0, Landroid/app/Notification;->extras:Landroid/os/Bundle;

    .line 100
    return-void
.end method

.method public setJogMode(I)V
    .locals 0
    .parameter "mode"

    .prologue
    .line 67
    iput p1, p0, Landroid/app/Notification;->jogMode:I

    .line 68
    return-void
.end method


text:
using System.Collections.Generic;
using MLAPI.Collections;
using MLAPI.Configuration;
using MLAPI.Transports;
using UnityEngine;

namespace MLAPI.Profiling
{
    /// <summary>
    /// NetworkProfiler for profiling network traffic
    /// </summary>
    public static class NetworkProfiler
    {
        /// <summary>
        /// The ticks that has been recorded
        /// </summary>
        public static FixedQueue<ProfilerTick> Ticks { get; private set; }

        /// <summary>
        /// Whether or not the profiler is recording data
        /// </summary>
        public static bool IsRunning { get; private set; }

        private static int s_TickHistory = 1024;
        private static int s_EventIdCounter = 0;
        private static ProfilerTick s_CurrentTick;

        /// <summary>
        /// Starts recording data for the Profiler
        /// </summary>
        /// <param name="historyLength">The amount of ticks to keep in memory</param>
        public static void Start(int historyLength)
        {
            if (IsRunning) return;
            s_EventIdCounter = 0;
            Ticks = new FixedQueue<ProfilerTick>(historyLength);
            s_TickHistory = historyLength;
            s_CurrentTick = null;
            IsRunning = true;
        }

        /// <summary>
        /// Stops recording data
        /// </summary>
        public static void Stop()
        {
            Ticks = null; //leave to GC
            s_CurrentTick = null; //leave to GC
            IsRunning = false;
        }

        /// <summary>
        /// Stops recording data and fills the buffer with the recorded ticks and returns the length;
        /// </summary>
        /// <param name="tickBuffer">The buffer to fill with the ticks</param>
        /// <returns>The number of ticks recorded</returns>
        public static int Stop(ref ProfilerTick[] tickBuffer)
        {
            if (!IsRunning) return 0;
            int iteration = Ticks.Count > tickBuffer.Length ? tickBuffer.Length : Ticks.Count;
            for (int i = 0; i < iteration; i++) tickBuffer[i] = Ticks[i];

            Ticks = null; //leave to GC
            s_CurrentTick = null; //leave to GC
            IsRunning = false;

            return iteration;
        }

        /// <summary>
        /// Stops recording data and fills the buffer with the recorded ticks and returns the length;
        /// </summary>
        /// <param name="tickBuffer">The buffer to fill with the ticks</param>
        /// <returns>The number of ticks recorded</returns>
        public static int Stop(ref List<ProfilerTick> tickBuffer)
        {
            if (!IsRunning) return 0;

            int iteration = Ticks.Count > tickBuffer.Count ? tickBuffer.Count : Ticks.Count;
            for (int i = 0; i < iteration; i++) tickBuffer[i] = Ticks[i];

            Ticks = null; //leave to GC
            s_CurrentTick = null; //leave to GC
            IsRunning = false;

            return iteration;
        }

        internal static void StartTick(TickType type)
        {
            if (!IsRunning) return;
            if (Ticks.Count == s_TickHistory)
            {
                Ticks.Dequeue();
            }

            var tick = new ProfilerTick()
            {
                Type = type,
                Frame = Time.frameCount,
                EventId = s_EventIdCounter
            };
            s_EventIdCounter++;
            Ticks.Enqueue(tick);
            s_CurrentTick = tick;
        }

        internal static void EndTick()
        {
            if (!IsRunning) return;
            if (s_CurrentTick == null) return;
            s_CurrentTick = null;
        }

        internal static void StartEvent(TickType eventType, uint bytes, NetworkChannel networkChannel, byte messageType)
        {
            if (!IsRunning) return;
            if (s_CurrentTick == null) return;

            string messageName = messageType < NetworkConstants.MESSAGE_NAMES.Length ? NetworkConstants.MESSAGE_NAMES[messageType] : "INVALID_MESSAGE_TYPE";

            string channelName = networkChannel.ToString();
            s_CurrentTick.StartEvent(eventType, bytes, channelName, messageName);
        }

        internal static void StartEvent(TickType eventType, uint bytes, NetworkChannel networkChannel, string messageName)
        {
            if (!IsRunning) return;
            if (s_CurrentTick == null) return;

            string channelName = networkChannel.ToString();
            s_CurrentTick.StartEvent(eventType, bytes, channelName, messageName);
        }

        internal static void EndEvent()
        {
            if (!IsRunning) return;
            if (s_CurrentTick == null) return;
            s_CurrentTick.EndEvent();
        }
    }
}


text:
[index wireframe](/week-2/imgs/wireframe-index.png)

[index blog wireframe](/week-2/imgs/wireframe-blog-index.png)

##What is a wireframe?
A wireframe is getting your idea and plan for your website on paper(either digitally or otherwise).  A visual representation of a website without having it coded.

##What are the benefits of wireframing?
It helps give you an idea of what to code.  It is a visual guide to what you need to build and how.  It helps get ideas out of your head and into the physical realm.

##Did you enjoy wireframing your site?
Yea, it was pretty fun.  I got to learn how to use some wireframing software which was interesting.  It was fairly user friendly.  I used Sketch.  I think I will buy it.

##Did you revise your wireframe or stick with your first idea?
I stuck with my first idea.  If I want to revise it, I will do so later on.  I don't think it needs to be super fancy.  Just easy to read.

##What questions did you ask during this challenge? What resources did you find to help you answer them?
It was mostly related to the design software I was using.  I could not figure out how their "art boards" worked and how to duplicate them.  The resources I used included clicking things in the software until I figured out what they did haha.

##Which parts of the challenge did you enjoy and which parts did you find tedious?
I liked once I got a little workflow down in the software.  It was pretty fun and felt like I was "building" my site!  I found getting the image to show up inline on the markdown reflection files to be fairly tedious.  I couldn't figure out how it was intrepretting the URL I was putting in.  After many commits, I figured it out.  It seems it assumes you are in the repo depending if you start the url with a / or not.  That was fun.


text:
namespace base {
namespace debug {

#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS)
typedef MultiProcessTest StackTraceTest;
#else
typedef testing::Test StackTraceTest;
#endif

#if !defined(__UCLIBC__) && !defined(_AIX)
// StackTrace::OutputToStream() is not implemented under uclibc, nor AIX.
// See https://crbug.com/706728

TEST_F(StackTraceTest, OutputToStream) {
  StackTrace trace;

  // Dump the trace into a string.
  std::ostringstream os;
  trace.OutputToStream(&os);
  std::string backtrace_message = os.str();

  // ToString() should produce the same output.
  EXPECT_EQ(backtrace_message, trace.ToString());

  size_t frames_found = 0;
  const void* const* addresses = trace.Addresses(&frames_found);

#if defined(OFFICIAL_BUILD) && \
    ((defined(OS_POSIX) && !defined(OS_MACOSX)) || defined(OS_FUCHSIA))
  // Stack traces require an extra data table that bloats our binaries,
  // so they're turned off for official builds. Stop the test here, so
  // it at least verifies that StackTrace calls don't crash.
  return;
#endif  // defined(OFFICIAL_BUILD) &&
        // ((defined(OS_POSIX) && !defined(OS_MACOSX)) || defined(OS_FUCHSIA))

  ASSERT_TRUE(addresses);
  ASSERT_GT(frames_found, 5u) << "Too few frames found.";

#if defined(OFFICIAL_BUILD) && defined(OS_MACOSX)
  // Official Mac OS X builds contain enough information to unwind the stack,
  // but not enough to symbolize the output.
  return;
#endif  // defined(OFFICIAL_BUILD) && defined(OS_MACOSX)

#if defined(OS_FUCHSIA) || defined(OS_ANDROID)
  // Under Fuchsia and Android, StackTrace emits executable build-Ids and
  // address offsets which are symbolized on the test host system, rather than
  // being symbolized in-process.
  return;
#endif  // defined(OS_FUCHSIA) || defined(OS_ANDROID)

#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || \
    defined(MEMORY_SANITIZER)
  // Sanitizer configurations (ASan, TSan, MSan) emit unsymbolized stacks.
  return;
#endif  // defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||
        // defined(MEMORY_SANITIZER)

  // Check if the output has symbol initialization warning.  If it does, fail.
  ASSERT_EQ(backtrace_message.find("Dumping unresolved backtrace"),
            std::string::npos)
      << "Unable to resolve symbols.";

  // Expect a demangled symbol.
  // Note that Windows Release builds omit the function parameters from the
  // demangled stack output, otherwise this could be "testing::Test::Run()".
  EXPECT_TRUE(backtrace_message.find("testing::Test::Run") != std::string::npos)
      << "Expected a demangled symbol in backtrace:\n"
      << backtrace_message;

  // Expect to at least find main.
  EXPECT_TRUE(backtrace_message.find("main") != std::string::npos)
      << "Expected to find main in backtrace:\n"
      << backtrace_message;

  // Expect to find this function as well.
  // Note: This will fail if not linked with -rdynamic (aka -export_dynamic)
  EXPECT_TRUE(backtrace_message.find(__func__) != std::string::npos)
      << "Expected to find " << __func__ << " in backtrace:\n"
      << backtrace_message;
}

#if !defined(OFFICIAL_BUILD) && !defined(NO_UNWIND_TABLES)
// Disabled in Official builds, where Link-Time Optimization can result in two
// or fewer stack frames being available, causing the test to fail.
TEST_F(StackTraceTest, TruncatedTrace) {
  StackTrace trace;

  size_t count = 0;
  trace.Addresses(&count);
  ASSERT_LT(2u, count);

  StackTrace truncated(2);
  truncated.Addresses(&count);
  EXPECT_EQ(2u, count);
}
#endif  // !defined(OFFICIAL_BUILD) && !defined(NO_UNWIND_TABLES)

// The test is used for manual testing, e.g., to see the raw output.
TEST_F(StackTraceTest, DebugOutputToStream) {
  StackTrace trace;
  std::ostringstream os;
  trace.OutputToStream(&os);
  VLOG(1) << os.str();
}

// The test is used for manual testing, e.g., to see the raw output.
TEST_F(StackTraceTest, DebugPrintBacktrace) {
  StackTrace().Print();
}

// The test is used for manual testing, e.g., to see the raw output.
TEST_F(StackTraceTest, DebugPrintWithPrefixBacktrace) {
  StackTrace().PrintWithPrefix("[test]");
}

// Make sure nullptr prefix doesn't crash. Output not examined, much
// like the DebugPrintBacktrace test above.
TEST_F(StackTraceTest, DebugPrintWithNullPrefixBacktrace) {
  StackTrace().PrintWithPrefix(nullptr);
}

// Test OutputToStreamWithPrefix, mainly to make sure it doesn't
// crash. Any "real" stack trace testing happens above.
TEST_F(StackTraceTest, DebugOutputToStreamWithPrefix) {
  StackTrace trace;
  const char* prefix_string = "[test]";
  std::ostringstream os;
  trace.OutputToStreamWithPrefix(&os, prefix_string);
  std::string backtrace_message = os.str();

  // ToStringWithPrefix() should produce the same output.
  EXPECT_EQ(backtrace_message, trace.ToStringWithPrefix(prefix_string));
}

// Make sure nullptr prefix doesn't crash. Output not examined, much
// like the DebugPrintBacktrace test above.
TEST_F(StackTraceTest, DebugOutputToStreamWithNullPrefix) {
  StackTrace trace;
  std::ostringstream os;
  trace.OutputToStreamWithPrefix(&os, nullptr);
  trace.ToStringWithPrefix(nullptr);
}

#endif  // !defined(__UCLIBC__) && !defined(_AIX)

#if defined(OS_POSIX) && !defined(OS_ANDROID)
#if !defined(OS_IOS)
static char* newArray() {
  // Clang warns about the mismatched new[]/delete if they occur in the same
  // function.
  return new char[10];
}

MULTIPROCESS_TEST_MAIN(MismatchedMallocChildProcess) {
  char* pointer = newArray();
  delete pointer;
  return 2;
}

// Regression test for StackDumpingSignalHandler async-signal unsafety.
// Combined with tcmalloc's debugallocation, that signal handler
// and e.g. mismatched new[]/delete would cause a hang because
// of re-entering malloc.
TEST_F(StackTraceTest, AsyncSignalUnsafeSignalHandlerHang) {
  Process child = SpawnChild("MismatchedMallocChildProcess");
  ASSERT_TRUE(child.IsValid());
  int exit_code;
  ASSERT_TRUE(
      child.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &exit_code));
}
#endif  // !defined(OS_IOS)

namespace {

std::string itoa_r_wrapper(intptr_t i, size_t sz, int base, size_t padding) {
  char buffer[1024];
  CHECK_LE(sz, sizeof(buffer));

  char* result = internal::itoa_r(i, buffer, sz, base, padding);
  EXPECT_TRUE(result);
  return std::string(buffer);
}

}  // namespace

TEST_F(StackTraceTest, itoa_r) {
  EXPECT_EQ("0", itoa_r_wrapper(0, 128, 10, 0));
  EXPECT_EQ("-1", itoa_r_wrapper(-1, 128, 10, 0));

  // Test edge cases.
  if (sizeof(intptr_t) == 4) {
    EXPECT_EQ("ffffffff", itoa_r_wrapper(-1, 128, 16, 0));
    EXPECT_EQ("-2147483648",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::min(), 128, 10, 0));
    EXPECT_EQ("2147483647",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::max(), 128, 10, 0));

    EXPECT_EQ("80000000",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::min(), 128, 16, 0));
    EXPECT_EQ("7fffffff",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::max(), 128, 16, 0));
  } else if (sizeof(intptr_t) == 8) {
    EXPECT_EQ("ffffffffffffffff", itoa_r_wrapper(-1, 128, 16, 0));
    EXPECT_EQ("-9223372036854775808",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::min(), 128, 10, 0));
    EXPECT_EQ("9223372036854775807",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::max(), 128, 10, 0));

    EXPECT_EQ("8000000000000000",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::min(), 128, 16, 0));
    EXPECT_EQ("7fffffffffffffff",
              itoa_r_wrapper(std::numeric_limits<intptr_t>::max(), 128, 16, 0));
  } else {
    ADD_FAILURE() << "Missing test case for your size of intptr_t ("
                  << sizeof(intptr_t) << ")";
  }

  // Test hex output.
  EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 0));
  EXPECT_EQ("deadbeef", itoa_r_wrapper(0xdeadbeef, 128, 16, 0));

  // Check that itoa_r respects passed buffer size limit.
  char buffer[1024];
  EXPECT_TRUE(internal::itoa_r(0xdeadbeef, buffer, 10, 16, 0));
  EXPECT_TRUE(internal::itoa_r(0xdeadbeef, buffer, 9, 16, 0));
  EXPECT_FALSE(internal::itoa_r(0xdeadbeef, buffer, 8, 16, 0));
  EXPECT_FALSE(internal::itoa_r(0xdeadbeef, buffer, 7, 16, 0));
  EXPECT_TRUE(internal::itoa_r(0xbeef, buffer, 5, 16, 4));
  EXPECT_FALSE(internal::itoa_r(0xbeef, buffer, 5, 16, 5));
  EXPECT_FALSE(internal::itoa_r(0xbeef, buffer, 5, 16, 6));

  // Test padding.
  EXPECT_EQ("1", itoa_r_wrapper(1, 128, 10, 0));
  EXPECT_EQ("1", itoa_r_wrapper(1, 128, 10, 1));
  EXPECT_EQ("01", itoa_r_wrapper(1, 128, 10, 2));
  EXPECT_EQ("001", itoa_r_wrapper(1, 128, 10, 3));
  EXPECT_EQ("0001", itoa_r_wrapper(1, 128, 10, 4));
  EXPECT_EQ("00001", itoa_r_wrapper(1, 128, 10, 5));
  EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 0));
  EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 1));
  EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 2));
  EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 3));
  EXPECT_EQ("0688", itoa_r_wrapper(0x688, 128, 16, 4));
  EXPECT_EQ("00688", itoa_r_wrapper(0x688, 128, 16, 5));
}
#endif  // defined(OS_POSIX) && !defined(OS_ANDROID)

#if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)

template <size_t Depth>
void NOINLINE ExpectStackFramePointers(const void** frames,
                                       size_t max_depth) {
  code_start:
  // Calling __builtin_frame_address() forces compiler to emit
  // frame pointers, even if they are not enabled.
  EXPECT_NE(nullptr, __builtin_frame_address(0));
  ExpectStackFramePointers<Depth - 1>(frames, max_depth);

  constexpr size_t frame_index = Depth - 1;
  const void* frame = frames[frame_index];
  EXPECT_GE(frame, &&code_start) << "For frame at index " << frame_index;
  EXPECT_LE(frame, &&code_end) << "For frame at index " << frame_index;
  code_end: return;
}

template <>
void NOINLINE ExpectStackFramePointers<1>(const void** frames,
                                          size_t max_depth) {
  code_start:
  // Calling __builtin_frame_address() forces compiler to emit
  // frame pointers, even if they are not enabled.
  EXPECT_NE(nullptr, __builtin_frame_address(0));
  size_t count = TraceStackFramePointers(frames, max_depth, 0);
  ASSERT_EQ(max_depth, count);

  const void* frame = frames[0];
  EXPECT_GE(frame, &&code_start) << "For the top frame";
  EXPECT_LE(frame, &&code_end) << "For the top frame";
  code_end: return;
}

#if defined(MEMORY_SANITIZER)
// The test triggers use-of-uninitialized-value errors on MSan bots.
// This is expected because we're walking and reading the stack, and
// sometimes we read fp / pc from the place that previously held
// uninitialized value.
#define MAYBE_TraceStackFramePointers DISABLED_TraceStackFramePointers
#else
#define MAYBE_TraceStackFramePointers TraceStackFramePointers
#endif
TEST_F(StackTraceTest, MAYBE_TraceStackFramePointers) {
  constexpr size_t kDepth = 5;
  const void* frames[kDepth];
  ExpectStackFramePointers<kDepth>(frames, kDepth);
}

#if defined(OS_ANDROID) || defined(OS_MACOSX)
#define MAYBE_StackEnd StackEnd
#else
#define MAYBE_StackEnd DISABLED_StackEnd
#endif

TEST_F(StackTraceTest, MAYBE_StackEnd) {
  EXPECT_NE(0u, GetStackEnd());
}

#endif  // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)

}  // namespace debug
}  // namespace base