text:
#ifndef XACT_H
#define XACT_H

#include "access/xlog.h"
#include "nodes/pg_list.h"
#include "storage/relfilenode.h"
#include "utils/timestamp.h"
#include "access/persistentendxactrec.h"

#include "cdb/cdbpublic.h"

/*
 * Xact isolation levels
 */
#define XACT_READ_UNCOMMITTED	0
#define XACT_READ_COMMITTED		1
#define XACT_REPEATABLE_READ	2
#define XACT_SERIALIZABLE		3

extern int	DefaultXactIsoLevel;
extern int	XactIsoLevel;

/*
 * We only implement two isolation levels internally.  This macro should
 * be used to check which one is selected.
 */
#define IsXactIsoLevelSerializable (XactIsoLevel >= XACT_REPEATABLE_READ)

/* Xact read-only state */
extern bool DefaultXactReadOnly;
extern bool XactReadOnly;

/* Asynchronous commits */
extern bool XactSyncCommit;

/* Kluge for 2PC support */
extern bool MyXactAccessedTempRel;

/*
 *	start- and end-of-transaction callbacks for dynamically loaded modules
 */
typedef enum
{
	XACT_EVENT_COMMIT,
	XACT_EVENT_ABORT,
	XACT_EVENT_PREPARE
} XactEvent;

typedef void (*XactCallback) (XactEvent event, void *arg);

typedef enum
{
	SUBXACT_EVENT_START_SUB,
	SUBXACT_EVENT_COMMIT_SUB,
	SUBXACT_EVENT_ABORT_SUB
} SubXactEvent;

typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
									SubTransactionId parentSubid, void *arg);

/* ----------------
 *		transaction-related XLOG entries
 * ----------------
 */

/*
 * XLOG allows to store some information in high 4 bits of log
 * record xl_info field
 */
#define XLOG_XACT_COMMIT			0x00
#define XLOG_XACT_PREPARE			0x10
#define XLOG_XACT_ABORT				0x20
#define XLOG_XACT_COMMIT_PREPARED	0x30
#define XLOG_XACT_ABORT_PREPARED	0x40
#define XLOG_XACT_DISTRIBUTED_COMMIT 0x50
#define XLOG_XACT_DISTRIBUTED_FORGET 0x60

typedef struct xl_xact_commit
{
	TimestampTz xact_time;		/* time of commit */
	time_t		xtime;

	int16		persistentCommitObjectCount;
								/* number of PersistentEndXactRec style objects */

	int			nsubxacts;		/* number of subtransaction XIDs */

	/* PersistentEndXactRec style objects for commit */
	uint8 data[0];				/* VARIABLE LENGTH ARRAY */

	/* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */
} xl_xact_commit;

#define MinSizeOfXactCommit offsetof(xl_xact_commit, data)

typedef struct xl_xact_abort
{
	TimestampTz xact_time;		/* time of abort */
	time_t		xtime;

	int16		persistentAbortObjectCount;
								/* number of PersistentEndXactRec style objects */

	int			nsubxacts;		/* number of subtransaction XIDs */

	/* PersistentEndXactRec style objects for abort */
	uint8 data[0];		/* VARIABLE LENGTH ARRAY */

	/* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */
} xl_xact_abort;

#define MinSizeOfXactAbort offsetof(xl_xact_abort, data)

/*
 * COMMIT_PREPARED and ABORT_PREPARED are identical to COMMIT/ABORT records
 * except that we have to store the XID of the prepared transaction explicitly
 * --- the XID in the record header will be for the transaction doing the
 * COMMIT PREPARED or ABORT PREPARED command.
 */

typedef struct xl_xact_commit_prepared
{
	TransactionId xid;			/* XID of prepared xact */
	DistributedTransactionTimeStamp distribTimeStamp;
	DistributedTransactionId        distribXid;
	xl_xact_commit crec;		/* COMMIT record */
	/* MORE DATA FOLLOWS AT END OF STRUCT */
} xl_xact_commit_prepared;

#define MinSizeOfXactCommitPrepared offsetof(xl_xact_commit_prepared, crec.data)

typedef struct xl_xact_abort_prepared
{
	TransactionId xid;			/* XID of prepared xact */
	xl_xact_abort arec;			/* ABORT record */
	/* MORE DATA FOLLOWS AT END OF STRUCT */
} xl_xact_abort_prepared;

#define MinSizeOfXactAbortPrepared offsetof(xl_xact_abort_prepared, arec.data)

/*
 * xl_xact_distributed_forget - moved to cdb/cdbtm.h
 */
typedef struct xl_xact_distributed_forget
{
	TMGXACT_LOG gxact_log;
} xl_xact_distributed_forget;

typedef enum
{
	XACT_INFOKIND_NONE = 0,
	XACT_INFOKIND_COMMIT,
	XACT_INFOKIND_ABORT,
	XACT_INFOKIND_PREPARE
} XactInfoKind;

/* ----------------
 *		extern definitions
 * ----------------
 */

/* Greenplum Database specific */
extern char *XactInfoKind_Name(
	const XactInfoKind		kind);
extern void SetSharedTransactionId_writer(void);
extern void SetSharedTransactionId_reader(TransactionId xid, CommandId cid);
extern bool IsTransactionState(void);
extern bool IsAbortInProgress(void);
extern bool IsTransactionPreparing(void);
extern bool IsAbortedTransactionBlockState(void);
extern void GetAllTransactionXids(
	DistributedTransactionId	*distribXid,
	TransactionId				*localXid,
	TransactionId				*subXid);
extern TransactionId GetTopTransactionId(void);
extern TransactionId GetTopTransactionIdIfAny(void);
extern TransactionId GetCurrentTransactionId(void);
extern TransactionId GetCurrentTransactionIdIfAny(void);
extern SubTransactionId GetCurrentSubTransactionId(void);
extern CommandId GetCurrentCommandId(bool used);
extern TimestampTz GetCurrentTransactionStartTimestamp(void);
extern TimestampTz GetCurrentStatementStartTimestamp(void);
extern TimestampTz GetCurrentTransactionStopTimestamp(void);
extern void SetCurrentStatementStartTimestamp(void);
extern void SetCurrentStatementStartTimestampToMaster(TimestampTz masterTime);
extern int	GetCurrentTransactionNestLevel(void);
extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
extern void CommandCounterIncrement(void);
extern void ForceSyncCommit(void);
extern void StartTransactionCommand(void);
extern void CommitTransactionCommand(void);
extern void AbortCurrentTransaction(void);
extern void BeginTransactionBlock(void);
extern bool EndTransactionBlock(void);
extern bool PrepareTransactionBlock(char *gid);
extern void UserAbortTransactionBlock(void);
extern void ReleaseSavepoint(List *options);
extern void DefineSavepoint(char *name);
extern void DefineDispatchSavepoint(char *name);
extern void RollbackToSavepoint(List *options);
extern void BeginInternalSubTransaction(char *name);
extern void ReleaseCurrentSubTransaction(void);
extern void RollbackAndReleaseCurrentSubTransaction(void);
extern bool IsSubTransaction(void);
extern bool IsTransactionBlock(void);
extern bool IsTransactionOrTransactionBlock(void);
extern void ExecutorMarkTransactionUsesSequences(void);
extern void ExecutorMarkTransactionDoesWrites(void);
extern bool ExecutorSaysTransactionDoesWrites(void);
extern char TransactionBlockStatusCode(void);
extern void AbortOutOfAnyTransaction(void);
extern void PreventTransactionChain(bool isTopLevel, const char *stmtType);
extern void RequireTransactionChain(bool isTopLevel, const char *stmtType);
extern bool IsInTransactionChain(bool isTopLevel);
extern void RegisterXactCallback(XactCallback callback, void *arg);
extern void UnregisterXactCallback(XactCallback callback, void *arg);
extern void RegisterXactCallbackOnce(XactCallback callback, void *arg);
extern void UnregisterXactCallbackOnce(XactCallback callback, void *arg);
extern void RegisterSubXactCallback(SubXactCallback callback, void *arg);
extern void UnregisterSubXactCallback(SubXactCallback callback, void *arg);

extern void RecordDistributedForgetCommitted(struct TMGXACT_LOG *gxact_log);
extern bool RecordCrashTransactionAbortRecord(
	TransactionId				xid,
	PersistentEndXactRecObjects *persistentAbortObjects);

extern int	xactGetCommittedChildren(TransactionId **ptr);

extern void xact_redo(XLogRecPtr beginLoc, XLogRecPtr lsn, XLogRecord *record);
extern bool xact_redo_get_info(
		XLogRecord					*record,
		XactInfoKind				*infoKind,
		TransactionId				*xid,
		PersistentEndXactRecObjects *persistentObjects,
		TransactionId				**subXids,
		int 						*subXidCount);
extern void xact_desc(StringInfo buf, XLogRecPtr beginLoc, XLogRecord *record);
extern const char *IsoLevelAsUpperString(int IsoLevel);

#endif   /* XACT_H */


text:
- Local Storage and Error Handling
  - Web storage
  - Serialization
  - Storing/retrieving data
- Error: Food for the mind
- Strict mode
- Testing
  - Advantages of test
- Exceptions
  - The finally keyword
  - Selective catching
  - Sneak peak into prototypes
  - Assertions

## Exercice
- Read the eloquent javascript page 149 - 163

redpajama_set_name: RedPajamaGithub


text:
using Provisioning.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace Provisioning.UX.AppWeb.Models
{
    [DataContract]
    public class SiteRequestsResponse
    {
        [DataMember(Name = "requests")]
        public ICollection<SiteInformation> SiteRequests
        {
            get;
            set;
        }

        #region Public Members
        [DataMember(Name = "success")]
        public bool Success { get; set; }

        [DataMember(Name = "errorMessage")]
        public string ErrorMessage { get; set; }
        #endregion

    }
}


text:
#ifndef WEBRTC_VIDEO_VIE_ENCODER_H_
#define WEBRTC_VIDEO_VIE_ENCODER_H_

#include <memory>
#include <string>
#include <vector>

#include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/common_types.h"
#include "webrtc/video_encoder.h"
#include "webrtc/media/base/videosinkinterface.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
#include "webrtc/modules/video_coding/video_coding_impl.h"
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/typedefs.h"

namespace webrtc {

class Config;
class EncodedImageCallback;
class OveruseFrameDetector;
class PacedSender;
class ProcessThread;
class SendStatisticsProxy;
class ViEBitrateObserver;
class ViEEffectFilter;
class VideoEncoder;

// VieEncoder represent a video encoder that accepts raw video frames as input
// and produces an encoded bit stream.
// Usage:
// 1. Instantiate
// 2. Call Init
// 3. Call RegisterExternalEncoder if available.
// 4. Call SetEncoder with the codec settings and the object that shall receive
//    the encoded bit stream.
// 5. Call Start.
// 6. For each available raw video frame call EncodeVideoFrame.
class ViEEncoder : public VideoEncoderRateObserver,
                   public EncodedImageCallback,
                   public VCMSendStatisticsCallback {
 public:
  friend class ViEBitrateObserver;

  ViEEncoder(uint32_t number_of_cores,
             ProcessThread* module_process_thread,
             SendStatisticsProxy* stats_proxy,
             OveruseFrameDetector* overuse_detector,
             EncodedImageCallback* sink);

  ~ViEEncoder();

  vcm::VideoSender* video_sender();

  // Returns the id of the owning channel.
  int Owner() const;

  void Start();
  // Drops incoming packets before they get to the encoder.
  void Pause();

  // Codec settings.
  int32_t RegisterExternalEncoder(VideoEncoder* encoder,
                                  uint8_t pl_type,
                                  bool internal_source);
  int32_t DeRegisterExternalEncoder(uint8_t pl_type);
  void SetEncoder(const VideoCodec& video_codec,
                  int min_transmit_bitrate_bps,
                  size_t max_data_payload_length);

  void EncodeVideoFrame(const VideoFrame& video_frame);
  void SendKeyFrame();

  uint32_t LastObservedBitrateBps() const;
  // Loss protection. Must be called before SetEncoder() to have max packet size
  // updated according to protection.
  // TODO(pbos): Set protection method on construction.
  void SetProtectionMethod(bool nack, bool fec);

  // Implements VideoEncoderRateObserver.
  void OnSetRates(uint32_t bitrate_bps, int framerate) override;

  // Implements EncodedImageCallback.
  int32_t Encoded(const EncodedImage& encoded_image,
                  const CodecSpecificInfo* codec_specific_info,
                  const RTPFragmentationHeader* fragmentation) override;

  // Implements VideoSendStatisticsCallback.
  void SendStatistics(uint32_t bit_rate,
                      uint32_t frame_rate,
                      const std::string& encoder_name) override;

  // virtual to test EncoderStateFeedback with mocks.
  virtual void OnReceivedIntraFrameRequest(size_t stream_index);
  virtual void OnReceivedSLI(uint8_t picture_id);
  virtual void OnReceivedRPSI(uint64_t picture_id);

  int GetPaddingNeededBps() const;

  void OnBitrateUpdated(uint32_t bitrate_bps,
                        uint8_t fraction_lost,
                        int64_t round_trip_time_ms);

 private:
  bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_);
  void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_);
  void TraceFrameDropEnd() EXCLUSIVE_LOCKS_REQUIRED(data_cs_);

  const uint32_t number_of_cores_;
  EncodedImageCallback* const sink_;

  const std::unique_ptr<VideoProcessing> vp_;
  vcm::VideoSender video_sender_;

  rtc::CriticalSection data_cs_;

  SendStatisticsProxy* const stats_proxy_;
  OveruseFrameDetector* const overuse_detector_;

  // The time we last received an input frame or encoded frame. This is used to
  // track when video is stopped long enough that we also want to stop sending
  // padding.
  int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_);
  VideoCodec encoder_config_ GUARDED_BY(data_cs_);
  int min_transmit_bitrate_bps_ GUARDED_BY(data_cs_);
  uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_);
  bool encoder_paused_ GUARDED_BY(data_cs_);
  bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_);

  ProcessThread* module_process_thread_;

  bool has_received_sli_ GUARDED_BY(data_cs_);
  uint8_t picture_id_sli_ GUARDED_BY(data_cs_);
  bool has_received_rpsi_ GUARDED_BY(data_cs_);
  uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_);

  bool video_suspended_ GUARDED_BY(data_cs_);
};

}  // namespace webrtc

#endif  // WEBRTC_VIDEO_VIE_ENCODER_H_


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>City Browser :: About</title>

    <link href='https://fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css' />

    <link rel="stylesheet" href="resources/css/bootstrap.min.css" />

    <link rel="stylesheet" href="resources/css/bootstrap-theme.min.css" />

    <link rel="stylesheet" href="resources/css/style.css" />

            <button type="button" class="navbar-toggle toggle-left visibility_hidden navbar-left" data-toggle="sidebar" data-target=".sidebar-left">
                Filters
            </button>

                City Browser

About

About

City Browser was made by Stephen Firrincieli . The code is released under
        the MIT license and can be found on GitHub. If you
        find any bugs please send me a message.

Data sources

        The data used in City Browser was taken from a few sources provided by different US government agencies.
        I put the data into a manageable JSON
        using web scraping and by processing data files. The code for generating the JSON was
        written in Python and can also be found at this GitHub page.

            Data
            Source
            Format
            Links
            Information

            Climate
            NOAA
            Text files

                Climate normals

                Daily summaries

                NOAA provides climate data for each station it keeps track of in text files. First, the script determined the nearest
                station to the coordinates of the city on Wikipedia. NOAA provides pre-calculated data on the monthly normal (mean)
                highs and lows for each station over a 30-year period. To determine the mean maximum and minimum temperatures,
                the script read the daily weather for each station for as long as it has been available, and averaged each
                month's maximums and minimums over all the available years.

            Population
            Wikipedia via U.S. Census Bureau
            HTML

                Wikipedia

                2015 Population Estimates

                The U.S. Census Bureau makes estimates of the current year's population for each city in between census years.
                The Census Bureau's website was difficult to scrape data from so I scraped the equivalent 2015 data from the
                Wikipedia page.

            Median rent
            Office of Policy Development and Research
            Spreadsheet
            50th Percentile Rent Estimates

                An office of the U.S. Department of Housing and Urban Development, the Office of Policy Development and Research
                produces yearly estimates of the median rent for areas of the United States. The script would first
                search the spreadsheet for the name and state of the city. If it could not find the specific city, it would
                fall back to use the county the city is within.

Acknowledgements

A huge thanks to NOAA, the U.S. Census Bureau, and the Office of Policy Development and Research for making this data available to the public

The users and editors of Wikipedia for contributing the intro paragraphs about each city and the thumbnail images used here

            The developers of noUiSlider, Open Iconic, and
            bootstrap-sidebar, which made it possible for me to
            put this together in a reasonable amount of time.


text:
/* Multiselect
----------------------------------*/

.ui-picklist { border: solid 1px; font-size: 0.8em; }
.ui-picklist ul { -moz-user-select: none; }
.ui-picklist li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
.ui-picklist li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
.ui-picklist li.ui-draggable-dragging { padding-left: 10px; }

.ui-picklist div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
.ui-picklist ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
.ui-picklist ul.selected li { }

.ui-picklist div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
.ui-picklist ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
.ui-picklist ul.available li { padding-left: 10px; }

.ui-picklist .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
.ui-picklist .ui-state-hover { border: none; }
.ui-picklist .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}

.ui-picklist .add-all { float: right; padding: 7px;}
.ui-picklist .remove-all { float: right; padding: 7px;}
.ui-picklist .search { float: left; padding: 4px;}
.ui-picklist .count { float: left; padding: 7px;}

.ui-picklist li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
.ui-picklist li a.action { position: absolute; right: 2px; top: 2px; }

.ui-picklist input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; }


text:
Following [Prometheus](https://github.com/prometheus/prometheus/blob/master/RELEASE.md) and [Thanos](https://github.com/thanos-io/thanos/blob/master/docs/release-process.md), this project aims for a predictable release schedule.

Release cadence of first pre-releases being cut is 6 weeks.

| Release | Date of first pre-release (year-month-day) | Release shepherd                            |
|---------|--------------------------------------------|---------------------------------------------|
| v0.39   | 2020-05-06                                 | Pawel Krupa (GitHub: @paulfantom)           |
| v0.40   | 2020-06-17                                 | Lili Cosic (GitHub: @lilic)                 |
| v0.41   | 2020-07-29                                 | Sergiusz Urbaniak (GitHub: @s-urbaniak)     |
| v0.42   | 2020-09-09                                 | Matthias Loibl (GitHub: @metalmatze)        |
| v0.43   | 2020-10-21                                 | Simon Pasquier (GitHub: @simonpasquier)     |
| v0.44   | 2020-12-02                                 | Pawel Krupa (GitHub: @paulfantom)           |
| v0.45   | 2021-01-13                                 | Lili Cosic (GitHub: @lilic)                 |
| v0.46   | 2021-02-24                                 | **searching for volunteer**                 |

# How to cut a new release

> This guide is strongly based on the [Prometheus release instructions](https://github.com/prometheus/prometheus/blob/master/RELEASE.md).

## Branch management and versioning strategy

We use [Semantic Versioning](http://semver.org/).

We maintain a separate branch for each minor release, named `release-<major>.<minor>`, e.g. `release-1.1`, `release-2.0`.

The usual flow is to merge new features and changes into the master branch and to merge bug fixes into the latest release branch. Bug fixes are then merged into master from the latest release branch. The master branch should always contain all commits from the latest release branch.

If a bug fix got accidentally merged into master, cherry-pick commits have to be created in the latest release branch, which then have to be merged back into master. Try to avoid that situation.

Maintaining the release branches for older minor releases happens on a best effort basis.

## Update Go dependencies

A couple of days before the release, consider submitting a PR against the `master` branch to update the Go dependencies.

## Update operand versions

A couple of days before the release, update the [default versions](https://github.com/prometheus-operator/prometheus-operator/blob/f6ce472ecd6064fb6769e306b55b149dfb6af903/pkg/operator/defaults.go#L20-L31) of Prometheus, Alertmanager and Thanos if newer versions are available.

## Prepare your release

For a new major or minor release, work from the `master` branch. For a patch release, work in the branch of the minor release you want to patch (e.g. `release-0.43` if you're releasing `v0.43.2`).

Bump the version in the `VERSION` file in the root of the repository.

A number of files have to be re-generated, this is automated with the following make target:

```bash
$ make clean generate
```

Bump the version of the `pkg/apis/monitoring` and `pkg/client` packages in `go.mod`:

```bash
$ go mod edit -require "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v$(< VERSION)"
$ go mod edit -require "github.com/prometheus-operator/prometheus-operator/pkg/client@v$(< VERSION)"
```

Now that all version information has been updated, an entry for the new version can be added to the `CHANGELOG.md` file.

Entries in the `CHANGELOG.md` are meant to be in this order:

* `[CHANGE]`
* `[FEATURE]`
* `[ENHANCEMENT]`
* `[BUGFIX]`

Create a PR for the changes to be reviewed.

## Publish the new release

For new minor and major releases, create the `release-<major>.<minor>` branch starting at the PR merge commit.

From now on, all work happens on the `release-<major>.<minor>` branch.

Tag the new release with a tag named `v<major>.<minor>.<patch>`, e.g. `v2.1.3`. Note the `v` prefix. Tag also the `github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring` module with `pkg/apis/monitoring/v<major>.<minor>.<patch>` and the `github.com/prometheus-operator/prometheus-operator/pkg/client` module with `pkg/client/v<major>.<minor>.<patch>`. You can do the tagging on the commandline:

```bash
$ tag="v$(< VERSION)"
$ git tag -s "${tag}" -m "${tag}"
$ git tag -s "pkg/apis/monitoring/${tag}" -m "pkg/apis/monitoring/${tag}"
$ git tag -s "pkg/client/${tag}" -m "pkg/client/${tag}"
$ git push origin "${tag}" "pkg/apis/monitoring/${tag}" "pkg/client/${tag}"
```

Signed tag with a GPG key is appreciated, but in case you can't add a GPG key to your Github account using the following [procedure](https://help.github.com/articles/generating-a-gpg-key/), you can replace the `-s` flag by `-a` flag of the `git tag` command to only annotate the tag without signing.

Our CI pipeline will automatically push the container images to [quay.io](https://quay.io/organization/prometheus-operator).

Go to  https://github.com/prometheus-operator/prometheus-operator/releases/new, associate the new release with the before pushed tag, paste in changes made to `CHANGELOG.md` and click "Publish release".

For patch releases, submit a pull request to merge back the release branch into the `master` branch.

## Update kube-prometheus

Bump the versions of `github.com/prometheus-operator/prometheus-operator` in [prometheus-operator/kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) (see this [pull request](https://github.com/prometheus-operator/kube-prometheus/pull/674) for example).

Take a breath. You're done releasing.


text:
from flask import Flask
from flask import request
from flask import jsonify
from flask import send_from_directory
from flask import Response
from flask import abort

from werkzeug import secure_filename

from setup import *

app = Flask(__name__)
#app = Flask(__name__, static_url_path='')

app.config['MAX_CONTENT_LENGTH'] = MAX_CONTENT_LENGTH
app.config['UPLOAD_FOLDER'     ] = UPLOAD_FOLDER
app.config['RNG_ID'            ] = RNG_ID
app.config['DB_NAME'           ] = DB_NAME


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Introduction </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Introduction ">
    <meta name="generator" content="docfx 2.42.1.0">

    <link rel="shortcut icon" href="../../images/favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="../toc.html">

    <meta property="docfx:rel" content="../../">
    <meta property="docfx:newtab" content="true">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Introduction

The Maker Board to Rule Them All!

FEZ (fast and easy) is our magnificent maker board. This low cost board offers Arduino pinout compatibility, optional WiFi for IoT applications, and can be programmed using multiple programming languages and development environments. However, we are focused on TinyCLR OS support to program the board in .NET C# and Visual Basic.

Pricing, purchasing and other information can be found on the FEZ page on our main website.

Spec
Value

Processor
STMicroelectronics ST32F401RET6

Speed
84 MHz

Internal RAM
96 KByte

Internal Flash
512 KByte

Dimensions
70.6 x 56.0 x 14.5 mm

Peripheral
Quantity

GPIO (5V tolerant)
22

IRQ
22

UART
1

I2C
1

SPI
1

PWM
8

12 Bit ADC
8

CAN
0

USB Client
1

WiFi
Optional

*Note:  Many peripherals share I/O pins.  Not all peripherals will be available to your application.

Resources

Schematic

TinyCLR Tutorials

Instructions for updating the WiFi module firmware.

FEZ can be powered through the USB connector and/or the power connector. The barrel jack is pin positive, sleeve negative, 2.1mm. It is capable of anywhere 6V to 9V. 500mA of power should be enough for most needs.

TinyCLR OS

TinyCLR OS provides a way to program FEZ in C# or Visual Basic from the Microsoft Visual Studio integrated development environment.  To get started you must first install the bootloader and firmware (instructions below) and then go to the TinyCLR Getting Started page for instructions.

Loading Bootloader

Download the FEZ bootloader here.

Connect your device to the USB client port.

Put the board in DFU mode: Hold BOOT0 button low and press/release the reset button. Wait for a second then release BOOT0. Windows Device Manager will now show "STM Device in DFU Mode" under the 'Universal Serial Bus controller' TAB.

Go to the STM32 Bootloader to learn how to upload DFU files.

Loading the Firmware

Activate the bootloader, hold the BTN1 button low while resetting the board.

Open TinyCLR Config tool.

Click the loader tab.

Select the correct COM port. If you are not seeing it then the device is not in the loader mode.

Click the Update to Latest button.

You can also update the firmware manually. Download the firmware and learn how to use the GHI Bootloader manually.

Start Coding

Now that you have installed the bootloader and firmware on the FEZ, you can setup your host computer and start programming. Go to the TinyCLR Getting Started page for instructions.

Code Samples

For some examples of using TinyCLR, take a look at the TinyCLR Samples repo. You may also find the TinyCLR tutorials useful.

Native Code

TinyCLR OS also lets you use native code that works alongside your managed application. Native code can be used to provide improved performance or access to advanced features not exposed through TinyCLR. For more information check out Native Code on TinyCLR.

The memory area reserved for native code in TinyCLR OS on FEZ starts at 0x20016000 and its length is 0x3F8.

WiFi Support

For support on using the on-board WiFi, including updating the firmware, please see this page.

Visit our main website at www.ghielectronics.com and our community forums at forums.ghielectronics.com.

                    Improve this Doc

              Back to top

            Copyright © 2019 GHI Electronics, LLC
Generated by DocFX


text:
#ifndef IVW_TEMPLATE_RESOURCE_H
#define IVW_TEMPLATE_RESOURCE_H

#include <inviwo/core/common/inviwo.h>
#include <inviwo/core/properties/property.h>

namespace inviwo {

/** \class TemplateResource
 *
 * A TemplateResource is a container for data of type T.
 *
 * @see Resource
 * @see ResourceManager
 */
template<typename T>
class TemplateResource : public Resource {

public:
    /**
     * Resource will take ownership of data and then delete it upon destruction.
     *
     * @param value Pointer to allocated data.
     */
    TemplateResource(const std::string& identifier, T* value);

    virtual ~TemplateResource() { delete value_; }

    virtual T* getData() { return value_; };
    virtual const T* getData() const { return value_; };

    virtual const std::string& getIdentifier() const { return identifier_; };

protected:
    std::string identifier_;
    T* value_;
};

template <typename T>
TemplateResource<T>::TemplateResource(const std::string& identifier, T* value)
    : Resource(), identifier_(identifier), value_(value)
{}

} // namespace

#endif // IVW_TEMPLATE_RESOURCE_H


text:
package metadata

import "github.com/uber/cherami-thrift/.generated/go/shared"
import "github.com/stretchr/testify/mock"

// MetadataServiceReadConsumerGroupExtentsStreamInCall is an autogenerated mock type for the MetadataServiceReadConsumerGroupExtentsStreamInCall type
type MetadataServiceReadConsumerGroupExtentsStreamInCall struct {
	mock.Mock
}

// Done provides a mock function with given fields:
func (_m *MetadataServiceReadConsumerGroupExtentsStreamInCall) Done() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Flush provides a mock function with given fields:
func (_m *MetadataServiceReadConsumerGroupExtentsStreamInCall) Flush() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetResponseHeaders provides a mock function with given fields: headers
func (_m *MetadataServiceReadConsumerGroupExtentsStreamInCall) SetResponseHeaders(headers map[string]string) error {
	ret := _m.Called(headers)

	var r0 error
	if rf, ok := ret.Get(0).(func(map[string]string) error); ok {
		r0 = rf(headers)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Write provides a mock function with given fields: arg
func (_m *MetadataServiceReadConsumerGroupExtentsStreamInCall) Write(arg *shared.ConsumerGroupExtent) error {
	ret := _m.Called(arg)

	var r0 error
	if rf, ok := ret.Get(0).(func(*shared.ConsumerGroupExtent) error); ok {
		r0 = rf(arg)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}


text:
Wrapper for the AVAudioPlayer that supports sound effects, and music.

# Update
Currently mostly broken in new versions of iOS may update eventually but is not in the plans for now

The music played through this manager is set so that it will not play if any other sounds in the system are playing. This way people can listen to their own music while using the application. The music also supports having two simultanious songs that can be switched betreen. I used this feature in my app "Toothache" so that I could impliment a marimba mode where all the music begins to play with a marimba.

**Note:** Only use this is you are ok with the sounds staying around in memory for the duration of the program.
## Usage
- Drop "SoundManager.swift" into your project
-  Put play/pause statments inside of your AppDelegate (see example)
- Add your sound files
- Play them

### Music
Music is played by filling the "primary" and "secondary" slots in the 'MusicManager'

I would suggest building a sequencer class over the MusicManager that way you can easily manage your progression of songs. However that is your call. To play songs you have to add them to either the primary or the secondary slot then play.

To play a sound

    MusicPlayer.addTrack("HappySong", type: "wav")
	SoundManager.setPrimary("HappySong")
	SoundManager.play()

### Sound Effects
I would suggest building a sequencer class over the MusicManager that way you can easily manage your progression of songs. However that is your call. To play songs you have to add them to either the primary or the secondary slot then play.

To play a sound

    SoundEffects.addEffect("Growl1", fileName: "se2", type: "wav")
    SoundEffects.play("Growl1")

### Limitations
You can only have one song, or sound effect for each name. If you want to avoid this their are other overloads of the add functions that allow you to specify a name that is different from the file name.

All of the sounds included in the demo project are licesned under the Creative Commons Zero license.

Enjoy!

### Contact
For any inquiries kierumcak@gmail.com

### License
Copyright (c) 2016 Caleb Kierum

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

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

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


text:
package edu.umd.marbl.mhap.sketch;

public abstract class AbstractBitSketch<T extends AbstractBitSketch<T>> implements Sketch<T>,
		Comparable<T>
{
	protected final long[] bits;
	/**
	 *
	 */
	private static final long serialVersionUID = -3392030412388403092L;

	protected AbstractBitSketch(long[] bits)
	{
		this.bits = bits;
	}

	@Override
	public int compareTo(final T sim)
	{
		for (int bitIndex = 0; bitIndex < this.bits.length; bitIndex++)
		{
			if (this.bits[bitIndex] < sim.bits[bitIndex])
				return -1;
			if (this.bits[bitIndex] > sim.bits[bitIndex])
				return 1;
		}

		return 0;
	}

	public final boolean getBit(long index)
	{
		int arrayIndex = (int)(index/64L);
		int bitPos = (int)(index%64L);

		long mask = 0b1L<<bitPos;

		return (bits[arrayIndex] & mask) != 0L;
	}

	public final long[] getBits()
	{
		return this.bits;
	}

	public final int getIntersectionCount(final T sh)
	{
		if (this.bits.length != sh.bits.length)
			throw new SketchRuntimeException("Size of bits in tables must match.");

		int count = 0;
		for (int longIndex = 0; longIndex < this.bits.length; longIndex++)
		{
			final long xor = this.bits[longIndex] ^ sh.bits[longIndex];

			count += Long.bitCount(xor);
		}

		return this.bits.length * 64 - count;
	}

	public long getWord(int index)
	{
		return this.bits[index];
	}

	public long numberOfBits()
	{
		return this.bits.length*64;
	}

	public int numberOfWords()
	{
		return this.bits.length;
	}

	@Override
	public final double similarity(T v)
	{
		int count = getIntersectionCount(v);

		return (double)count/(double) this.numberOfBits();
	}

	@Override
	public String toString()
	{
		StringBuilder s = new StringBuilder();
		for (int longIndex = 0; longIndex < this.bits.length; longIndex++)
		{
			long mask = 1L << 63;

			for (int bit = 63; bit >= 0; bit--)
			{
				if ((this.bits[longIndex] & mask) == 0)
					s.append("0");
				else
					s.append("1");

				mask = mask >>> 1;
			}
		}

		return s.toString();
	}
}


text:
using System;
using System.Collections.Generic;
using System.Data;
using AllReady.Services;
using Moq;
using Xunit;
using AllReady.Extensions;

namespace AllReady.UnitTest.Extensions
{
    public class DataReaderExtensionsTests
    {
        private int _rowCount = -1;

        [Fact]
        public void DataReaderMapToListReturnsNonNullList()
        {
            var dataReader = GetDataReader(
                new List<DummyInputObject>
                {
                    new DummyInputObject
                    {
                        DummyBool = true,
                        DummyInt = 1
                    },
                }
            );

            var mapped = dataReader.DataReaderMapToList<DummyOutputObject>();
            var expected = new List<DummyOutputObject>
            {
                new DummyOutputObject
                {
                    DummyBool = true,
                    DummyInt = 1
                }
            };
            Assert.Equal(expected, mapped, new DummyOutputObjectComparer());
        }

        [Fact]
        public void DataReaderMapToListReturnsMultipleItems()
        {
            var dataReader = GetDataReader(
                new List<DummyInputObject>
                {
                    new DummyInputObject
                    {
                        DummyBool = true,
                        DummyInt = 1
                    },
                     new DummyInputObject
                    {
                        DummyBool = false,
                        DummyInt = 2
                    }
                }
            );

            var mapped = dataReader.DataReaderMapToList<DummyOutputObject>();
            var expected = new List<DummyOutputObject>
            {
                new DummyOutputObject
                {
                    DummyBool = true,
                    DummyInt = 1
                },
                new DummyOutputObject
                {
                    DummyBool = false,
                    DummyInt = 2
                }
            };
            Assert.Equal(expected, mapped, new DummyOutputObjectComparer());
        }

        [Fact]
        public void DataReaderMapToListReturnsDbNullAssignment()
        {
            var dataReader = GetDataReader(
                new List<DummyInputObject>
                {
                    new DummyInputObject
                    {
                        DummyBool = DBNull.Value,
                        DummyInt =  DBNull.Value
                    },
                }
            );

            var mapped = dataReader.DataReaderMapToList<DummyOutputObject>();
            var expected = new List<DummyOutputObject>
            {
                new DummyOutputObject
                {
                    DummyBool = null,
                    DummyInt = null
                }
            };
            Assert.Equal(expected, mapped, new DummyOutputObjectComparer());
        }

        private IDataReader GetDataReader(IReadOnlyList<DummyInputObject> dummyObjects)
        {
            var dataReaderMock = new Mock<IDataReader>();

            dataReaderMock
                .Setup(mock => mock.Read())
                .Returns(() =>
                _rowCount < dummyObjects.Count - 1)
                .Callback(() => _rowCount++);

            dataReaderMock.Setup(mock => mock["DummyInt"])
                .Returns(() =>
                dummyObjects[_rowCount].DummyInt);
            dataReaderMock.Setup(mock => mock["DummyBool"])
                .Returns(() =>
                dummyObjects[_rowCount].DummyBool);

            return dataReaderMock.Object;
        }
        private class DummyOutputObjectComparer : IEqualityComparer<DummyOutputObject>
        {
            public bool Equals(DummyOutputObject x, DummyOutputObject y)
            {
                if (x == null && y == null)
                    return true;
                if (x == null | y == null)
                    return false;
                return x.DummyInt == y.DummyInt
                    && x.DummyBool == y.DummyBool;
            }

            public int GetHashCode(DummyOutputObject obj)
            {
                // fake a hash code
                return obj.DummyInt.GetHashCode();
            }
        }

        private class DummyInputObject
        {
            public object DummyInt { get; set; }
            public object DummyBool { get; set; }
        }

        private class DummyOutputObject
        {
            public int? DummyInt { get; set; }
            public bool? DummyBool { get; set; }
        }
    }
}


text:
/**************************************************
 * Source Code for the Original Compiler for the
 * Programming Language Wake
 *
 * PrecedenceEnforcer.h
 *
 * Licensed under the MIT license
 * See LICENSE.TXT for details
 *
 * Author: Michael Fairhurst
 * Revised By:
 *
 **************************************************/

#ifndef HEADER_PRECEDENCE_ENFORCER
#define HEADER_PRECEDENCE_ENFORCER

#include "CompileTargetPrecedenceConfig.h"

class PrecedenceEnforcer {

	public:
		PrecedenceEnforcer(CompileTargetPrecedenceConfig& config) : config(config) {};
		void enforceAssociative(Node* tree, int index);
		void enforceExact(Node* tree, int index, int outer);
		void enforceNonAssociative(Node* tree, int outer);
		void enforce(Node* tree);

	private:
		CompileTargetPrecedenceConfig& config;

};

#endif


text:
RSpec Capybara examples for Chennai Ruby Meetup

The whole idea is to walkthrough the integration test by examples. No theory.

Lets create a simple step-by-step examples illsutrating ..

#### Step 1

* Simple page texts validation (assert for helloworld on a direct page view, assert for text inside a tab, assert of text inside an accordion and so on)
* Simple form filling (input field, radio buttons, checkbox, select box)
* Form filling and validations text assertions (example: Invalid email id)
* Form submission and content generation assertions
* Ajax based form submission assertions
* Integrate Devise and show an example of form submission

#### Step 2

* Show Factory girl example by creating one model and then two models (post, post and comments)

#### Step 3

* Run the whole test with capybara and selenium, capybara and phantomjs, capybara and capybara-webkit


text:
// ========================================================================
// $Id: Classpath.java,v 1.5 2004/05/09 20:32:46 gregwilkins Exp $
// Copyright 2002-2004 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================

package net.lightbody.bmp.proxy.jetty.start;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.Vector;

/**
 * Class to handle CLASSPATH construction
 * @author Jan Hlavatý
 */
public class Classpath {

    Vector _elements = new Vector();

    public Classpath()
    {}

    public Classpath(String initial)
    {
        addClasspath(initial);
    }

    public boolean addComponent(String component)
    {
        if ((component != null)&&(component.length()>0)) {
            try {
                File f = new File(component);
                if (f.exists())
                {
                    File key = f.getCanonicalFile();
                    if (!_elements.contains(key))
                    {
                        _elements.add(key);
                        return true;
                    }
                }
            } catch (IOException e) {}
        }
        return false;
    }

    public boolean addComponent(File component)
    {
        if (component != null) {
            try {
                if (component.exists()) {
                    File key = component.getCanonicalFile();
                    if (!_elements.contains(key)) {
                        _elements.add(key);
                        return true;
                    }
                }
            } catch (IOException e) {}
        }
        return false;
    }

    public boolean addClasspath(String s)
    {
        boolean added=false;
        if (s != null)
        {
            StringTokenizer t = new StringTokenizer(s, File.pathSeparator);
            while (t.hasMoreTokens())
            {
                added|=addComponent(t.nextToken());
            }
        }
        return added;
    }

    public String toString()
    {
        StringBuffer cp = new StringBuffer(1024);
        int cnt = _elements.size();
        if (cnt >= 1) {
            cp.append( ((File)(_elements.elementAt(0))).getPath() );
        }
        for (int i=1; i < cnt; i++) {
            cp.append(File.pathSeparatorChar);
            cp.append( ((File)(_elements.elementAt(i))).getPath() );
        }
        return cp.toString();
    }

    public ClassLoader getClassLoader() {
        int cnt = _elements.size();
        URL[] urls = new URL[cnt];
        for (int i=0; i < cnt; i++) {
            try {
                urls[i] = ((File)(_elements.elementAt(i))).toURL();
            } catch (MalformedURLException e) {}
        }

        ClassLoader parent = Thread.currentThread().getContextClassLoader();
        if (parent == null) {
            parent = Classpath.class.getClassLoader();
        }
        if (parent == null) {
            parent = ClassLoader.getSystemClassLoader();
        }
        return new Loader(urls, parent);
    }

    private class Loader extends URLClassLoader
    {
        String name;

        Loader(URL[] urls, ClassLoader parent)
        {
            super(urls, parent);
            name = "StartLoader"+Arrays.asList(urls);
        }

        public String toString()
        {
            return name;
        }
    }

}


text:
<?php

namespace Fuel\Migrations;

class Create_priceimports
{
	public function up()
	{
		\DBUtil::create_table('priceimports', array(
			'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
			'price_import' => array('constraint' => 11, 'type' => 'int'),
			'product_id' => array('constraint' => 11, 'type' => 'int'),
			'quantity_import' => array('constraint' => 11, 'type' => 'int'),
			'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
			'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),

		), array('id'));
	}

	public function down()
	{
		\DBUtil::drop_table('priceimports');
	}
}


text:
package jakarta.servlet;

import java.util.EventListener;

/**
 * Implementations of this interface receive notifications of changes to the
 * attribute list on the servlet context of a web application. To receive
 * notification events, the implementation class must be configured in the
 * deployment descriptor for the web application.
 *
 * @see ServletContextAttributeEvent
 *
 * @since Servlet 2.3
 */
public interface ServletContextAttributeListener extends EventListener {

    /**
     * Notification that a new attribute was added to the servlet context.
     * Called after the attribute is added.
     * The default implementation is a NO-OP.
     * @param scae Information about the new attribute
     */
    public default void attributeAdded(ServletContextAttributeEvent scae) {
    }

    /**
     * Notification that an existing attribute has been removed from the servlet
     * context. Called after the attribute is removed.
     * The default implementation is a NO-OP.
     * @param scae Information about the removed attribute
     */
    public default void attributeRemoved(ServletContextAttributeEvent scae) {
    }

    /**
     * Notification that an attribute on the servlet context has been replaced.
     * Called after the attribute is replaced.
     * The default implementation is a NO-OP.
     * @param scae Information about the replaced attribute
     */
    public default void attributeReplaced(ServletContextAttributeEvent scae) {
    }
}


text:
require 'retryable'

module Bellbro
  module SidekiqUtils

    class Queue
      def self.names
        Sidekiq::Stats::Queues.new.lengths.keys
      end

      def self.all
        names.map do |name|
          Sidekiq::Queue.new(name)
        end
      end

      def self.each
        names.each do |name|
          yield Sidekiq::Queue.new(name)
        end
      end

      def self.clear_all
        each do |q|
          q.clear
        end
      end
    end

    class Job
      attr_accessor :source

      def initialize(source)
        @source = source
      end

      def method_missing(method_name, *args, &block)
        source.args.first.try(:[], method_name.to_s)
      end

      def jid
        source.jid
      end

      def self.all_for_class(klass_name)
        Retryable.retryable(on: Redis::TimeoutError) do
          Queue.all.map do |q|
            q.map do |job|
              next unless job.klass == klass_name
              new(job)
            end
          end.flatten.compact
        end
      end
    end

    class Worker
      attr_accessor :source

      def initialize(source)
        @source = source
      end

      def method_missing(method_name, *args, &block)
        args.first.try(:[],method_name.to_s)
      end

      def payload
        source["payload"] || {}
      end

      def args
        payload["args"] || []
      end

      def jid
        payload["jid"]
      end

      def time
        source["run_at"]
      end

      def klass
        payload["class"]
      end

      def queue
        source["queue"]
      end

      def self.all
        Sidekiq::Workers.new.map do |process_id, thread_id, worker|
          worker
        end
      end

      def self.all_for_class(klass_name)
        Retryable.retryable(on: Redis::TimeoutError) do
          all.select do |worker|
            worker.klass == klass_name
          end
        end
      end
    end

    def workers
      Worker.all_for_class("#{self.name}")
    end

    def jobs
      Job.all_for_class("#{self.name}")
    end

    def jobs_in_flight_with(arg)
      jobs_with(arg) + workers_with(arg)
    end

    def jobs_with(arg)
      key   = arg.keys.first
      value = arg.values.first
      jobs.select do |job|
        value == job.send(key)
      end
    end

    def workers_with(arg)
      key   = arg.keys.first
      value = arg.values.first
      workers.select do |worker|
        value == worker.send(key)
      end
    end

    def workers_for_queue(q)
      workers.select do |worker|
        worker.queue == q
      end
    end

    def number_of_active_workers(q_name)
      workers_for_queue(q_name).count
    end
  end
end


text:
print("Hello World!")
print('I "said" this is a sentence.')
print("OK let's get this going.")


text:
package org.geogit.storage;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.Map;

import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.MultiLineString;
import com.vividsolutions.jts.geom.MultiPoint;
import com.vividsolutions.jts.geom.MultiPolygon;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;

/**
 * Enumeration with types supported for attribute values
 *
 *
 */
public enum FieldType {

    NULL(0x00, Void.class), //
    BOOLEAN(0x01, Boolean.class), //
    BYTE(0x02, Byte.class), //
    SHORT(0x03, Short.class), //
    INTEGER(0x04, Integer.class), //
    LONG(0x05, Long.class), //
    FLOAT(0x06, Float.class), //
    DOUBLE(0x07, Double.class), //
    STRING(0x08, String.class), //
    BOOLEAN_ARRAY(0x09, boolean[].class), //
    BYTE_ARRAY(0x0A, byte[].class), //
    SHORT_ARRAY(0x0B, short[].class), //
    INTEGER_ARRAY(0x0C, int[].class), //
    LONG_ARRAY(0x0D, long[].class), //
    FLOAT_ARRAY(0x0E, float[].class), //
    DOUBLE_ARRAY(0x0F, double[].class), //
    STRING_ARRAY(0x10, String[].class), //
    POINT(0x11, Point.class), //
    LINESTRING(0x12, LineString.class), //
    POLYGON(0x13, Polygon.class), //
    MULTIPOINT(0x14, MultiPoint.class), //
    MULTILINESTRING(0x15, MultiLineString.class), //
    MULTIPOLYGON(0x16, MultiPolygon.class), //
    GEOMETRYCOLLECTION(0x17, GeometryCollection.class), //
    GEOMETRY(0x18, Geometry.class), //
    UUID(0x19, java.util.UUID.class), //
    BIG_INTEGER(0x1A, BigInteger.class), //
    BIG_DECIMAL(0x1B, BigDecimal.class), //
    DATETIME(0x1C, Date.class), //
    DATE(0x1D, java.sql.Date.class), //
    TIME(0x1E, java.sql.Time.class), //
    TIMESTAMP(0x1F, java.sql.Timestamp.class);

    private final byte tagValue;

    private final Class<?> binding;

    private static final Map<Class<?>, FieldType> BINDING_MAPPING = Maps.newHashMap();
    static {
        for (FieldType t : FieldType.values()) {
            BINDING_MAPPING.put(t.getBinding(), t);
        }
    }

    private FieldType(int tagValue, Class<?> binding) {
        this.tagValue = (byte) tagValue;
        this.binding = binding;
    }

    public Class<?> getBinding() {
        return binding;
    }

    public byte getTag() {
        return tagValue;
    }

    public static FieldType valueOf(int i) {
        return values()[i];
    }

    public static FieldType forValue(Optional<Object> field) {
        if (field.isPresent()) {
            Object realField = field.get();
            Class<?> fieldClass = realField.getClass();
            return forBinding(fieldClass);
        } else {
            return NULL;
        }
    }

    public static FieldType forBinding(Class<?> binding) {
        // try a hash lookup first
        FieldType fieldType = BINDING_MAPPING.get(binding);
        if (fieldType != null) {
            return fieldType;
        }
        // not in the map, lets check one by one anyways
        // beware for this to work properly FieldTypes for super classes must be defined _after_
        // any subclass (i.e. Point before Geometry)
        for (FieldType t : values()) {
            if (t.getBinding().isAssignableFrom(binding)) {
                return t;
            }
        }
        throw new IllegalArgumentException("Attempted to write unsupported field type " + binding);
    }

}


text:
<?php
	namespace SystemDBService;

	class clsDB_MySQL {
		//定義共用變數
		public $conn;
		//CreateDBConnection(sServer, sDatabase, sUser, sPassWord) as boolean
		//資料庫連線
		public function CreateDBConnection($sServer,$sDatabase,$sUser,$sPassWord){
			$this->conn = new \mysqli($sServer, $sUser, $sPassWord,$sDatabase);
			if ($this->conn->connect_error) {
				$this->conn = false;
			}
			//回傳
			return $this->conn;
		}

		//用於單純INSERT、UPDATE、DELETE等
		//ExecuteNonQuery(sSqlText)
		public function ExecuteNonQuery($sSqlText){
			if( !empty($sSqlText) ){
				$stmt = $this->conn->query($sSqlText);
				return ($stmt)?true:false;
			}
		}

		//讀取資料 QueryData(sSqlText) as DataTable
		public function QueryData($sSqlText){
			$data = null;
			if( !empty($sSqlText) ){
				$stmt = $this->conn->query($sSqlText);
				$data = $this->Data2Array($stmt);

			}
			return $data;
		}

		//建立Transcation機制 CreateMySqlTranscation
		public function Transcation(){
			$sSqlText = 'START TRANSACTION';
			$this->ExecuteNonQuery($sSqlText);
		}

		//Commit Transction機制 CommitMySqlTranscation
		public function Commit(){
			$sSqlText = 'COMMIT';
			$this->ExecuteNonQuery($sSqlText);
		}

		//Rollback Transction機制 RollbackMySqlTranscation
		public function Rollback(){
			$sSqlText = 'ROLLBACK';
			$this->ExecuteNonQuery($sSqlText);
		}

		//關閉資料庫連線 CloseConnection
		public function DBClose(){
			$this->conn->close();
		}

		//資料庫轉換資料
		private function Data2Array($DBQueryData){
			$data = null;
			if($DBQueryData){
				$i=0;
				if( $DBQueryData and $DBQueryData->num_rows){
					while ($ar = $DBQueryData->fetch_array(MYSQLI_ASSOC)) {
						$j=0;
						foreach($ar as $key=>$val){
							//echo $key."=>".$val;
							if( !empty($pk) ){
								$p = $ar[$pk];
								if($kind==0) $data[$p][$key]=$val;
								elseif($kind==1) $data[$p][$j]=$val;
							}
							else{
								if($kind==0) $data[$i][$key]=$val;
								elseif($kind==1) $data[$i][$j]=$val;
							}
							$j++;
						}
						$i++;
					}
				}
			}
			return $data;
		}

	}
?>


text:
// Copyright (c) DotNetwork. All rights reserved.
// Licensed under the MIT license. See LICENSE file for full license information.

using System;
using DotNetwork.Oldscape.Network.Protocol.Packet.Context.Impl;
using DotNetwork.Oldscape.Game.Model.Entity.Actor.Player;

namespace DotNetwork.Oldscape.Network.Protocol.Packet.Encoder.Impl
{

    /// <summary>
    /// The player update packet encoder.
    /// </summary>
    sealed class PlayerUpdateEncoder : PacketEncoder<PlayerUpdateContext>
    {

        /// <summary>
        /// Constructs a new object.
        /// </summary>
        public PlayerUpdateEncoder() : base(129, PacketType.VARIABLE_SHORT) { }

        /// <summary>
        /// Encodes the packet.
        /// </summary>
        /// <param name="context"></param>
        public override void Encode(PlayerUpdateContext context)
        {
            builder.PutBytes(PlayerUpdate.Update(context.GetPlayer()).GetBuffer());
        }
    }
}


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

using PCLExt.FileStorage;

using PokeD.CPGL.Storage.Files.GameFiles.ContentFiles;

namespace PokeD.CPGL.Storage.Folders.GameFolders.ContentFolders
{
    public class FontFolder : BaseContentChildFolder
    {
        public FontFolder(IFolder folder, BaseContentFolder parent) : base(folder, parent) { }

        public FontFile GetFontFile(string fileName)
        {
            var t = GetFiles($"{fileName}_*.fnt").Select(file => new FontFile(file, this)).ToList();

            return GetFontFiles().FirstOrDefault(file => file.InContentLocalPathWithoutExtension == fileName);
        }
        public IList<FontFile> GetFontFiles(string fontName) => GetFiles($"{fontName}_*.fnt").Select(file => new FontFile(file, this)).ToList();

        public IList<FontFile> GetFontFiles() => GetFiles("*.fnt").Select(file => new FontFile(file, this)).ToList();
    }
}


text:
layout: text/textblock
---

Senior communications, content leads and publishers need to clarify context.

- Does there need to be a related news story, blog or social media strategy?
- Does this content already exist, on this website or another channel?
- Does the content impact existing content that will need to be updated or removed?
- Do you have inaccessible PDFs? If so, make them accessible and provide an extract and contact details.


text:
#ifndef DeprecatedStorageInfo_h
#define DeprecatedStorageInfo_h

#include "bindings/core/v8/ScriptWrappable.h"
#include "modules/quota/DeprecatedStorageQuota.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"

namespace blink {

class ExecutionContext;
class StorageErrorCallback;
class StorageQuotaCallback;
class StorageUsageCallback;

class DeprecatedStorageInfo final
    : public GarbageCollected<DeprecatedStorageInfo>,
      public ScriptWrappable {
  DEFINE_WRAPPERTYPEINFO();

 public:
  enum {
    kTemporary,
    kPersistent,
  };

  static DeprecatedStorageInfo* create() { return new DeprecatedStorageInfo(); }

  void queryUsageAndQuota(ExecutionContext*,
                          int storageType,
                          StorageUsageCallback*,
                          StorageErrorCallback*);

  void requestQuota(ExecutionContext*,
                    int storageType,
                    unsigned long long newQuotaInBytes,
                    StorageQuotaCallback*,
                    StorageErrorCallback*);

  DECLARE_TRACE();

 private:
  DeprecatedStorageInfo();

  DeprecatedStorageQuota* getStorageQuota(int storageType);

  mutable Member<DeprecatedStorageQuota> m_temporaryStorage;
  mutable Member<DeprecatedStorageQuota> m_persistentStorage;
};

}  // namespace blink

#endif  // DeprecatedStorageInfo_h


text:
MentorMe
========

MentorMe is a mentorship app specifically designed for Women Who Code which will help students and potential mentees in the tech world with real life mentors. It helps you fast-track your career prospects and build an enduring professional network.

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-08-28.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-08-36.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-08-41.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-15-53-53.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-09-17.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-09-23.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-09-37.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-10-01.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-10-13.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-10-17.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-10-39.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/Screenshot_2014-05-01-14-11-37.png)

![alt tag](https://raw.githubusercontent.com/WWC-MentorMe/MentorMe/master/screenshots/ic_launcher_teal%20copy.png)


text:
import type from 'focus-core/component/types';

var paginationMixin = {
    /**
     * @inheritDoc
     */
    getDefaultProps: function getPaginationDefaultProps() {
        return {
            hasMoreData: false,
            isManualFetch: false
        };
    },

    propTypes: {
        hasMoreData: type('bool'),
        fetchNextPage: type('func'),
        isManualFetch: type('bool')
    },

    /**
     * Fetch the next page.
     * @param {number} page the page to fetch
     * @return {*} the next page
     */
    fetchNextPage: function fetchNextPage(page) {
        if(!this.props.hasMoreData) {
            return;
        }
        if(this.props.fetchNextPage) {
            return this.props.fetchNextPage(page);
        }
    },

    /**
     * handle manual fetch.
     * @param {object} event event received
     */
    handleShowMore: function handleShowMore(event) {
        this.nextPage++;
        this.fetchNextPage(this.nextPage);
    }
};

module.exports = {mixin: paginationMixin};


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="Nathan Hage créateur d'expérience, designer numérique & étudiant en web design">
  <meta property="og:title" content="Nathan Hage Étudiant en Web Design">
  <meta property="og:site_name" content="Nathan Hage">
  <meta property="og:url" content="https://www.nathan-hage.be">
  <meta property="og:description" content="Nathan Hage créateur d'expérience, designer numérique & étudiant en web design">
  <meta property="og:type" content="website">
  <meta property="og:image" content="/images/og.png">  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Soundboard | Laboratoire | Nathan Hage Étudiant en Web Design</title>

  <meta name="msapplication-tap-highlight" content="no">

  <link rel="manifest" href="/manifest.json">

  <link rel="manifest" href="/manifest.json">

  <link rel="manifest" href="/manifest.json">

  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="/images/favicon/favicon-96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16.png">

  <meta name="mobile-web-app-capable" content="yes">
  <meta name="application-name" content="Nathan Hage">
  <link rel="icon" sizes="192x192" href="/images/touch/chrome-touch-icon-192x192.png">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Nathan Hage">
  <link rel="apple-touch-icon" href="/images/touch/apple-touch-icon.png">

  <meta name="msapplication-TileImage" content="/images/touch/ms-touch-icon-144x144-precomposed.png">
  <meta name="msapplication-TileColor" content="#1995D2">

  <meta name="theme-color" content="#1995D2">

  <link rel="stylesheet" type="text/css" href="/styles/style.css">

<object class="header__link-before" type="image/svg+xml" data="/images/logo.svg"></object>Nathan Hage

      <object class="nav__menu-icon" type="image/svg+xml" data="/images/icn/icn_menu.svg"></object>

          Projets

          Laboratoire

          Email

<button class="sound-button__btn" data-sound="sound-1.mp3">Ça c'est une macrale</button>

<button class="sound-button__btn" data-sound="sound-2.mp3">On l'enterrera samedi</button>

<button class="sound-button__btn" data-sound="sound-3.mp3">Oui ! Oui, oui ...</button>

<button class="sound-button__btn" data-sound="sound-4.mp3">Et ça ...</button>

<button class="sound-button__btn" data-sound="sound-5.mp3">Qu'est-ce qu'il faut croire ?</button>

<button class="sound-button__btn" data-sound="sound-6.mp3">Tomber sur sa tête</button>

<button class="sound-button__btn" data-sound="sound-7.mp3">Et il est mort</button>

La Soundboard Macrale

Quand on clique sur l'un des boutons le son lié via son attribut est joué.

<ul>
  <li><button class="play-btn" data-sound="sound-1.mp3">Ça c'est une macrale</button></li>
  <!-- The data-sound attribute will provide the audio file to play -->
  <li><button class="play-btn" data-sound="sound-2.mp3">On l'enterrera samedi</button></li>
  {…} <!-- same patern for every btn -->
</ul>

{…} /* Does not have a function except for the aesthetic */

var btnPlay = document.querySelectorAll('.sound-button__btn');
for (var i=0; i < btnPlay.length; i++) {
  btnPlay[i].addEventListener('click', function (e) {
    var sound = e.target.getAttribute('data-sound');
    // Get the audio file from the data-sound attribute
    var audio = new Audio(sound);
    // Create a new audio object with the audio file
    audio.play();
    // Play the audio file
  });
}

          Expérience Précédente Poster Intéractif

          Expérience Suivante Flicard

          Nathan Hage & DWM_ 2017 ©

            <svg class="nav__icon nav__icon--twitter">
              <use xlink:href="/images/icn/icn-socials.svg#twitter-icon"></use>
            </svg>

            <svg class="nav__icon nav__icon--pinterest">
              <use xlink:href="/images/icn/icn-socials.svg#pinterest-icon"></use>
            </svg>

            <svg class="nav__icon nav__icon--mail">
              <use xlink:href="/images/icn/icn-socials.svg#mail-icon"></use>
            </svg>

            <svg class="nav__icon nav__icon--grid">
              <use xlink:href="/images/icn/icn-socials.svg#grid-icon"></use>
            </svg>


text:
package com.opencredo.concursus.domain.commands.dispatching;

import com.opencredo.concursus.domain.commands.Command;
import com.opencredo.concursus.domain.commands.CommandType;

/**
 * An object that can subscribe {@link CommandProcessor}s to handle {@link Command}s by {@link CommandType}
 */
@FunctionalInterface
public interface CommandSubscribable {

    /**
     * Subscribe the given {@link CommandProcessor} to handle commands of the given {@link CommandType}
     * @param commandType The {@link CommandType} to handle.
     * @param commandProcessor The {@link CommandProcessor} to process commands of this type with.
     * @return This object, for method chaining.
     */
    CommandSubscribable subscribe(CommandType commandType, CommandProcessor commandProcessor);

}


text: The fully-tested interactive version of cheers


text:
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chromecast.base;

import android.graphics.Color;

import org.chromium.base.CommandLine;
import org.chromium.base.Log;

/**
 * Contains all of the command line switches that are specific to Chromecast on
 * on Android.
 */
public abstract class CastSwitches {
    private static final String TAG = "CastSwitches";

    // Background color to use when chromium hasn't rendered anything yet. This will often be
    // displayed briefly when loading a Cast app. Format is a #ARGB in hex. (Black: #FF000000,
    // Green: #FF009000, and so on)
    public static final String CAST_APP_BACKGROUND_COLOR = "cast-app-background-color";

    public static int getSwitchValueColor(String switchName, int defaultValue) {
        String colorString = CommandLine.getInstance().getSwitchValue(switchName);
        try {
            if (colorString != null) {
                return Color.parseColor(colorString);
            }
        } catch (IllegalArgumentException e) {
            Log.e(TAG, "Invalid value for %s (%s). Using default.",
                    CastSwitches.CAST_APP_BACKGROUND_COLOR, colorString);
        }
        return defaultValue;
    }

    // Prevent instantiation
    private CastSwitches() {}
}


text:
<add commitWithin="1000">
	<doc>
		<field name="id">1</field>
		<field name="title">A Modern Jazz Symposium of Music and Poetry</field>
		<field name="artist">Charles Mingus</field>
		<field name="genre">Jazz</field>
		<field name="released">1957</field>
		<field name="old_price">10.0</field>
		<field name="new_price">12.1</field>
	</doc>
	<doc>
		<field name="id">2</field>
		<field name="title">Where Jazz meets Poetry</field>
		<field name="artist">United Artists</field>
		<field name="genre">Jazz</field>
		<field name="released">1976</field>
		<field name="old_price">9.99</field>
		<field name="new_price">11.2</field>
	</doc>
	<doc>
		<field name="id">3</field>
		<field name="title">I'm In The Mood For Love</field>
		<field name="artist">Charlie Parker</field>
		<field name="genre">Jazz</field>
		<field name="released">1981</field>
		<field name="old_price">5.99</field>
		<field name="new_price">4.99</field>
	</doc>
	<doc>
		<field name="id">4</field>
		<field name="title">Weather Report</field>
		<field name="artist">Weather Report</field>
		<field name="genre">Fusion</field>
		<field name="released">1971</field>
		<field name="old_price">7.99</field>
		<field name="new_price">6.99</field>
	</doc>
	<doc>
		<field name="id">5</field>
		<field name="title">Heavy Weather</field>
		<field name="artist">Weather Report</field>
		<field name="genre">Fusion</field>
		<field name="released">1977</field>
		<field name="old_price">7.99</field>
		<field name="new_price">6.99</field>
	</doc>
	<doc>
		<field name="id">6</field>
		<field name="title">Tutu</field>
		<field name="artist">Miles Davis</field>
		<field name="genre">Fusion</field>
		<field name="released">1986</field>
		<field name="old_price">6.00</field>
		<field name="new_price">6.99</field>
	</doc>
	<doc>
		<field name="id">7</field>
		<field name="title">School Days</field>
		<field name="artist">Stankey Clarke</field>
		<field name="genre">Fusion</field>
		<field name="released">1976</field>
		<field name="old_price">5.50</field>
		<field name="new_price">5.50</field>
	</doc>
	<doc>
		<field name="id">8</field>
		<field name="title">Rock the Nations</field>
		<field name="artist">Saxon</field>
		<field name="genre">Rock</field>
		<field name="released">1986</field>
		<field name="old_price">10.50</field>
		<field name="new_price">8.50</field>
	</doc>
	<doc>
		<field name="id">9</field>
		<field name="title">Piece of Mind</field>
		<field name="artist">Iron Maiden</field>
		<field name="genre">Heavy Metal</field>
		<field name="released">1983</field>
		<field name="old_price">11.50</field>
		<field name="new_price">6.50</field>
	</doc>
	<doc>
		<field name="id">10</field>
		<field name="title">Powerslave</field>
		<field name="artist">Iron Maiden</field>
		<field name="genre">Heavy Metal</field>
		<field name="released">1984</field>
		<field name="old_price">11.50</field>
		<field name="new_price">6.50</field>
	</doc>
	<doc>
		<field name="id">11</field>
		<field name="title">Seventh Son of a Seventh Son</field>
		<field name="artist">Iron Maiden</field>
		<field name="genre">Heavy Metal</field>
		<field name="released">1988</field>
		<field name="old_price">12.50</field>
		<field name="new_price">11.50</field>
	</doc>
	<doc>
		<field name="id">12</field>
		<field name="title">Girls, Girls, Girls</field>
		<field name="artist">Motley Crue</field>
		<field name="genre">Rock</field>
		<field name="released">1987</field>
		<field name="old_price">12.50</field>
		<field name="new_price">11.50</field>
	</doc>
	<doc>
		<field name="id">14</field>
		<field name="title">Eclipse</field>
		<field name="artist">Yngwie Malmsteen</field>
		<field name="genre">Heavy Metal</field>
		<field name="genre">Heavy metal</field>
		<field name="genre">Neoclassical metal</field>
		<field name="genre">Pop metal</field>
		<field name="genre">Hair metal</field>
		<field name="genre">Hard rock</field>
		<field name="released">1990</field>
		<field name="old_price">12.50</field>
		<field name="new_price">11.50</field>
	</doc>
	<doc>
		<field name="id">15</field>
		<field name="title">The Story of Rock</field>
		<field name="artist">Steve Vai</field>
		<field name="genre">Hard Rock</field>
		<field name="genre">Instrumental Rock</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">2012</field>
		<field name="old_price">20.50</field>
		<field name="new_price">22.50</field>
	</doc>
	<doc>
		<field name="id">16</field>
		<field name="title">Alien Love Secrets</field>
		<field name="artist">Steve Vai</field>
		<field name="genre">Rock</field>
		<field name="released">1995</field>
		<field name="old_price">15.50</field>
		<field name="new_price">11.50</field>
	</doc>
	<doc>
		<field name="id">17</field>
		<field name="title">Awake</field>
		<field name="artist">Dream Theater</field>
		<field name="genre">Progressive Rock</field>
		<field name="genre">Progressive Metal</field>
		<field name="released">1994</field>
		<field name="old_price">12.50</field>
		<field name="new_price">12.50</field>
	</doc>
	<doc>
		<field name="id">18</field>
		<field name="title">Images and Words</field>
		<field name="artist">Dream Theater</field>
		<field name="genre">Progressive Rock</field>
		<field name="genre">Progressive Metal</field>
		<field name="released">1992</field>
		<field name="old_price">12.50</field>
		<field name="new_price">12.50</field>
	</doc>
	<doc>
		<field name="id">19</field>
		<field name="title">Octavarium</field>
		<field name="artist">Dream Theater</field>
		<field name="genre">Progressive Rock</field>
		<field name="genre">Progressive Metal</field>
		<field name="released">2005</field>
		<field name="old_price">12.50</field>
		<field name="new_price">12.50</field>
	</doc>
	<doc>
		<field name="id">20</field>
		<field name="title">Selling England by the Pound</field>
		<field name="artist">Genesis</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">1973</field>
		<field name="old_price">11.50</field>
		<field name="new_price">10.50</field>
	</doc>
	<doc>
		<field name="id">21</field>
		<field name="title">The Lamb Lies Down on Broadway</field>
		<field name="artist">Genesis</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">1974</field>
		<field name="old_price">8.50</field>
		<field name="new_price">7.50</field>
	</doc>
	<doc>
		<field name="id">22</field>
		<field name="title">Us</field>
		<field name="artist">Peter Gabriel</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">1992</field>
		<field name="old_price">8.50</field>
		<field name="new_price">10.50</field>
	</doc>
	<doc>
		<field name="id">23</field>
		<field name="title">Up</field>
		<field name="artist">Peter Gabriel</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">2002</field>
		<field name="old_price">11.50</field>
		<field name="new_price">11.50</field>
	</doc>
	<doc>
		<field name="id">24</field>
		<field name="title">Delicate Sound of Thunder</field>
		<field name="artist">Pink Floyd</field>
		<field name="genre">Pop</field>
		<field name="genre">Rock</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">1988</field>
		<field name="old_price">13.99</field>
		<field name="new_price">13.50</field>
	</doc>
	<doc>
		<field name="id">25</field>
		<field name="title">Ummagumma</field>
		<field name="artist">Pink Floyd</field>
		<field name="genre">Rock</field>
		<field name="genre">Progressive Rock</field>
		<field name="released">1969</field>
		<field name="old_price">13.99</field>
		<field name="new_price">13.50</field>
	</doc>
</add>


text:
package com.gs.collections.impl.map.immutable.primitive;

import com.gs.collections.api.map.primitive.ImmutableObjectBooleanMap;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.map.mutable.primitive.ObjectBooleanHashMap;
import org.junit.Assert;
import org.junit.Test;

/**
 * JUnit test for {@link ImmutableObjectBooleanHashMap}.
 */
public class ImmutableObjectBooleanHashMapTest extends AbstractImmutableObjectBooleanMapTestCase
{
    @Override
    protected ImmutableObjectBooleanMap<String> classUnderTest()
    {
        return ObjectBooleanHashMap.newWithKeysValues("0", true, "1", true, "2", false).toImmutable();
    }

    @Test
    public void newWithKeyValue()
    {
        ImmutableObjectBooleanMap<String> map1 = this.classUnderTest();
        ImmutableObjectBooleanMap<String> expected = ObjectBooleanHashMap.newWithKeysValues("0", true, "1", true, "2", false, "3", false).toImmutable();
        Assert.assertEquals(expected, map1.newWithKeyValue("3", false));
        Assert.assertNotSame(map1, map1.newWithKeyValue("3", false));
        Assert.assertEquals(this.classUnderTest(), map1);
    }

    @Test
    public void newWithoutKeyValue()
    {
        ImmutableObjectBooleanMap<String> map1 = this.classUnderTest();
        ImmutableObjectBooleanMap<String> expected = this.newWithKeysValues("0", true, "1", true);
        Assert.assertEquals(expected, map1.newWithoutKey("2"));
        Assert.assertNotSame(map1, map1.newWithoutKey("2"));
        Assert.assertEquals(this.classUnderTest(), map1);
    }

    @Test
    public void newWithoutAllKeys()
    {
        ImmutableObjectBooleanMap<String> map1 = this.classUnderTest();
        ImmutableObjectBooleanMap<String> expected = this.newWithKeysValues("1", true);
        Assert.assertEquals(expected, map1.newWithoutAllKeys(FastList.newListWith("0", "2")));
        Assert.assertNotSame(map1, map1.newWithoutAllKeys(FastList.newListWith("0", "2")));
        Assert.assertEquals(this.classUnderTest(), map1);
    }
}


text:
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    clean: ["dist"],
    nugetpack: {
      dist: {
        src: 'src/**/*.csproj',
        dest: 'dist/',
        options: {
          properties: "Configuration=Release"
        }
      }
    },
    nugetpush: {
      dist: {
        src: 'dist/*.nupkg'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');

  // Load the plugin that provides the "nuget" task.
  grunt.loadNpmTasks('grunt-nuget');

  // Default task(s).
  grunt.registerTask('default', ['clean', 'nugetpack']);
  // Build and publish to nuget task
  grunt.registerTask('publish', ['clean', 'nugetpack', 'nugetpush']);
};


text:
require 'test_helper'

class AchievementsHelperTest < ActionView::TestCase
end


text:
<?php

namespace App\Http\Middleware;

use Closure;
use Predis\Client;
use Illuminate\Http\Request;
use Freeq\Redirector\{
    Manager as RedirectorManager,
    StorageFactory as Storage
};

class CatchRedirect
{
    public function handle(Request $request, Closure $next)
    {
        $driver = config('redirector.driver');

        $storage = Storage::build($driver, $driver === 'redis'
            ? new Client(config('database.redis.default'))
            : config('redirector.path'));
        $redirect_manager = new RedirectorManager($storage);
        $redirect_manager->forward($request->path());

        return $next($request);
    }
}


text:
<?php

namespace frontend\modules\costs\controllers;

use frontend\assets\AppAsset;
use Yii;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\web\Controller;
use frontend\modules\costs\models\CategoriesCosts;
use frontend\modules\costs\models\CategoryCostsUsers;
use frontend\modules\costs\models\CostsUsers;
use frontend\modules\costs\models\search\CostsUsersSearch;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\data\Pagination;
use yii\data\ActiveDataProvider;
use yii\web\Response;

class DefaultController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => [
                    'index',
                    'createCategory',
                    'createCost',
                    'updateCost',
                    'update',
//                    'add-view',
                    'add',
                ],
                'rules' => [
                    [
                        'actions' => [
                            'index',
                            'createCategory',
                            'createCost',
                            'updateCost',
                            'update',
//                            'add-view',
                            'add',
                        ],
                        'allow' => true,
                        'roles' => ['@'],
                    ]
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    public function actionIndex()
    {
        $userId = Yii::$app->user->identity->getId();

        $costsUser = CostsUsers::find()->where(['user_id' => $userId]);
        $countQuery = clone $costsUser;
        $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize'=>10]);
        $models = $costsUser->offset($pages->offset)
            ->limit($pages->limit)
            ->all();

        $sumCosts = CostsUsers::sumAllCostsUser($userId);

        $searchModel  = new CostsUsersSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        $dataProvider->pagination->pageSize=5;

        $model = new CostsUsers();
        $categoriesUser = CategoryCostsUsers::categoriesOfUser($userId);

        return $this->render('index', [
            'costsUser' => $models,
            'sumCosts' => $sumCosts,
            'pages' => $pages,
            'dataProvider' => $dataProvider,
            'searchModel' => $searchModel,
            'model' => $model,
            'categoriesUser' => $categoriesUser
        ]);
    }

    public function actionAdd()
    {
        $userId = Yii::$app->user->identity->getId();
        $request = Yii::$app->request;

        if ($request->post('CostsUsers')) {
            $model = new CostsUsers();
            $model->user_id = $userId;

            if ($model->load($request->post()) && $model->save()) {
                \Yii::$app->getSession()->setFlash('success', 'Запис додано.');
                return $this->redirect(['/costs']);
            } else {
                \Yii::$app->getSession()->setFlash('error', 'Error');
                return $this->redirect(['/costs']);
            }
        }

    }

    public function actionCreateCategory()
    {
        $model = new CategoriesCosts();
        $userId = Yii::$app->user->identity->getId();
        $categories = CategoriesCosts::find()
            ->where(['static' => 1])
            ->all();

        if ($post = Yii::$app->request->post('CategoriesCosts')) {

            if (!empty($post['createCategory'])) {
                $post['name'] = $post['createCategory'];
            }

            $dataModel = CategoriesCosts::addOrCreate($post['name'], $userId);

            if ($dataModel->save()) {
                return $this->refresh();
            }

        }

        return $this->render('createCategory', [
            'model' => $model,
            'errors' => isset($dataModel) ? $dataModel : [],
            'categories' => $categories,
            'userCategories' => CategoryCostsUsers::categoriesOfUser($userId)
        ]);
    }

    public function actionUpdate($id)
    {
            $userId = Yii::$app->user->identity->getId();

            $model = CostsUsers::findOne($id);
            $date = (new \DateTime($model->date))->format('Y-m-d');
            $model->date = $date;
            $model->user_id = $userId;
            $model->cost = $model->cost / 100;

            $categoriesUser = CategoryCostsUsers::categoriesOfUser($userId);

            if ($model->load(Yii::$app->request->post()) && $model->save()) {
                \Yii::$app->getSession()->setFlash('info', 'Запис оновлено.');
                return $this->redirect(['/costs']);
            } else {
                return $this->renderAjax('ajaxUpdate', [
                    'model' => $model,
                    'categoriesUser' => $categoriesUser
                ]);
            }
    }

    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['/costs']);

    }

    /**
     * Finds the CostsUsers model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return CostsUsers the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = CostsUsers::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

}


text:
package com.webtec2.auth;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.SimpleAccount;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;
import org.apache.shiro.SecurityUtils;
import com.webtec2.DBUser;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.authc.*;

@Transactional
public class DatabaseAuthenticator {

	@PersistenceContext
	private EntityManager entityManager;

	public AuthenticationInfo fetchAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {

		final String user = (String) token.getPrincipal();
		try {
			DBUser userobj = entityManager.find(DBUser.class, user);
			System.out.println("[" + userobj.getUsername() + "/" + userobj.getPassword() + "] are accepted");
			return new SimpleAccount(userobj.getUsername(), userobj.getPassword(), WT2Realm.REALM);
		}
		catch(Exception ex)
		{
			System.out.println("[" + user + "/] exception occured");
			System.out.println(ex);
			//throw new AuthenticationException("again");
			return new SimpleAccount(user, user.toCharArray(), WT2Realm.REALM);
		}

		/**
		try {
			final UsernamePasswordToken uptoken = (UsernamePasswordToken) token;
			final char[] password = uptoken.getPassword();
			DBUser userobj = this.entityManager.find(DBUser.class, user);
			if(userobj != null) {
				try {
					Subject currentUser = SecurityUtils.getSubject();
					currentUser.login(uptoken);
					System.out.println("[" + user + "/" + password + "] are accepted");
					return new SimpleAccount(user, password, WT2Realm.REALM);
				}
				catch(UnknownAccountException uae)
				{
					System.out.println("[ErrorDB] User " + user + " couldn't be found");
					System.out.println(uae);
				}
				catch(IncorrectCredentialsException ice)
				{
					System.out.println("[ErrorDB] Password does not match");
					System.out.println(ice);
				}
				catch(LockedAccountException lae)
				{
					System.out.println("[ErrorDB] User " + user + " has been deactivated");
					System.out.println(lae);
				}
				System.out.println("[" + user + "/" + password + "] credentials has been found, but db object has [" + userobj.getUsername() + "/" + userobj.getPassword() + "]");
				return new SimpleAccount(user, password, WT2Realm.REALM);
			}
			System.out.println("[" + user + "/" + password + "] credentials has been found, but no db object");
			**/
	}

}