text:
(function() {
  var BaseScraper, PREFIX, RedditScraper, SUBREDDIT, constants, iced, proof_text_check_to_med_id, sncmp, v_codes, __iced_k, __iced_k_noop, _ref,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  iced = require('iced-runtime');
  __iced_k = __iced_k_noop = function() {};

  _ref = require('./base'), sncmp = _ref.sncmp, BaseScraper = _ref.BaseScraper;

  constants = require('../constants').constants;

  v_codes = constants.v_codes;

  proof_text_check_to_med_id = require('../base').proof_text_check_to_med_id;

  PREFIX = "https://www.reddit.com";

  SUBREDDIT = PREFIX + "/r/keybaseproofs";

  exports.RedditScraper = RedditScraper = (function(_super) {
    __extends(RedditScraper, _super);

    function RedditScraper(opts) {
      RedditScraper.__super__.constructor.call(this, opts);
    }

    RedditScraper.prototype._check_args = function(args) {
      if (!(args.username != null)) {
        return new Error("Bad args to Reddit proof: no username given");
      } else if (!(args.name != null) || (args.name !== 'reddit')) {
        return new Error("Bad args to Reddit proof: type is " + args.name);
      } else {
        return null;
      }
    };

    RedditScraper.prototype._check_api_url = function(_arg) {
      var api_url, rxx, username;
      api_url = _arg.api_url, username = _arg.username;
      rxx = new RegExp("^" + SUBREDDIT, "i");
      return (api_url != null) && api_url.match(rxx);
    };

    RedditScraper.prototype.hunt2 = function(_arg, cb) {
      var err, json, name, post, posts, proof_post, proof_text_check, rc, username, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      username = _arg.username, proof_text_check = _arg.proof_text_check, name = _arg.name;
      if ((err = this._check_args({
        username: username,
        name: name
      })) != null) {
        return cb(err, {
          rc: v_codes.BAD_ARGS
        });
      }
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/proofs/src/scrapers/reddit.iced",
            funcname: "RedditScraper.hunt2"
          });
          _this._get_url_body({
            url: "" + PREFIX + "/user/" + (encodeURIComponent(username)) + "/submitted.json?count=25&cachebust=" + (Math.random()),
            json: true
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                rc = arguments[1];
                return json = arguments[2];
              };
            })(),
            lineno: 43
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          var _i, _len;
          if ((err != null) || rc !== v_codes.OK) {
            return cb(err, {
              rc: rc
            });
          }
          if ((posts = _this.unpack_posts(json)) == null) {
            return cb(new Error("Couldn't get Reddit user " + username + "'s posts: " + json.error), {
              rc: v_codes.FAILED_PARSE
            });
          }
          proof_post = null;
          _this.log("+ Reddit user " + username + "'s posts:");
          for (_i = 0, _len = posts.length; _i < _len; _i++) {
            post = posts[_i];
            _this.log("| title: " + post.title);
            if ((rc = _this.check_post({
              post: post,
              username: username,
              proof_text_check: proof_text_check
            })) === v_codes.OK) {
              _this.log("| Found a good post!");
              proof_post = post;
              break;
            } else {
              _this.log("| hunt failed with rc=" + rc);
            }
          }
          _this.log("- Scan of posts with OK=" + (proof_post != null));
          if (proof_post == null) {
            return cb(null, {
              rc: v_codes.NOT_FOUND
            });
          }
          return cb(null, {
            rc: v_codes.OK,
            api_url: PREFIX + proof_post.permalink + ".json",
            human_url: PREFIX + proof_post.permalink,
            remote_id: proof_post.name
          });
        };
      })(this));
    };

    RedditScraper.prototype.unpack_posts = function(json) {
      var data, posts, _i, _len, _ref1, _results;
      if (((json != null ? json.kind : void 0) === 'Listing') && ((posts = json != null ? (_ref1 = json.data) != null ? _ref1.children : void 0 : void 0) != null) && (posts.length === 0 || posts[0].kind === 't3')) {
        _results = [];
        for (_i = 0, _len = posts.length; _i < _len; _i++) {
          data = posts[_i].data;
          _results.push(data);
        }
        return _results;
      } else {
        return null;
      }
    };

    RedditScraper.prototype.unpack_post = function(json) {
      var parent, _ref1, _ref2, _ref3, _ref4, _ref5;
      if ((((_ref1 = json[0]) != null ? _ref1.kind : void 0) === 'Listing') && (((_ref2 = (parent = (_ref3 = json[0]) != null ? (_ref4 = _ref3.data) != null ? (_ref5 = _ref4.children) != null ? _ref5[0] : void 0 : void 0 : void 0)) != null ? _ref2.kind : void 0) === 't3')) {
        return parent.data;
      } else {
        return null;
      }
    };

    RedditScraper.prototype.check_post = function(_arg) {
      var med_id, post, proof_text_check, username;
      post = _arg.post, username = _arg.username, proof_text_check = _arg.proof_text_check;
      med_id = proof_text_check_to_med_id(proof_text_check);
      if (!(((post != null ? post.subreddit : void 0) != null) && (post.author != null) && (post.selftext != null) && (post.title != null))) {
        return v_codes.CONTENT_MISSING;
      } else if (post.subreddit.toLowerCase() !== 'keybaseproofs') {
        return v_codes.SERVICE_ERROR;
      } else if (!sncmp(post.author, username)) {
        return v_codes.BAD_USERNAME;
      } else if (post.title.indexOf(med_id) < 0) {
        return v_codes.TITLE_NOT_FOUND;
      } else {
        if (this._find_sig_in_raw(proof_text_check, post.selftext)) {
          return v_codes.OK;
        } else {
          return v_codes.TEXT_NOT_FOUND;
        }
      }
    };

    RedditScraper.prototype.check_status = function(_arg, cb) {
      var api_url, err, json, post, proof_text_check, rc, remote_id, username, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      username = _arg.username, api_url = _arg.api_url, proof_text_check = _arg.proof_text_check, remote_id = _arg.remote_id;
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/proofs/src/scrapers/reddit.iced",
            funcname: "RedditScraper.check_status"
          });
          _this._get_url_body({
            url: api_url + ("?cachebust=" + (Math.random())),
            json: true,
            user_agent: "linux:com.github/keybase/proofs:v2.1.41 (by /u/maxtaco)"
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                rc = arguments[1];
                return json = arguments[2];
              };
            })(),
            lineno: 117
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          rc = rc !== v_codes.OK ? rc : (post = _this.unpack_post(json)) == null ? v_codes.CONTENT_FAILURE : _this.check_post({
            post: post,
            username: username,
            proof_text_check: proof_text_check
          });
          return cb(err, rc);
        };
      })(this));
    };

    return RedditScraper;

  })(BaseScraper);

}).call(this);


text:
using System.ComponentModel;

namespace ChargeBee.Models.Enums
{
    public enum EventTypeEnum
    {

        [Description("Unknown Enum")]
        UnKnown, /*Indicates unexpected value for this enum. You can get this when there is a
                dotnet-client version incompatibility. We suggest you to upgrade to the latest version */

        [Description("customer_created")]
         CustomerCreated,

        [Description("customer_changed")]
         CustomerChanged,

        [Description("subscription_created")]
         SubscriptionCreated,

        [Description("subscription_started")]
         SubscriptionStarted,

        [Description("subscription_trial_ending")]
         SubscriptionTrialEnding,

        [Description("subscription_activated")]
         SubscriptionActivated,

        [Description("subscription_changed")]
         SubscriptionChanged,

        [Description("subscription_cancellation_scheduled")]
         SubscriptionCancellationScheduled,

        [Description("subscription_cancelling")]
         SubscriptionCancelling,

        [Description("subscription_cancelled")]
         SubscriptionCancelled,

        [Description("subscription_reactivated")]
         SubscriptionReactivated,

        [Description("subscription_renewed")]
         SubscriptionRenewed,

        [Description("subscription_scheduled_cancellation_removed")]
         SubscriptionScheduledCancellationRemoved,

        [Description("subscription_shipping_address_updated")]
         SubscriptionShippingAddressUpdated,

        [Description("invoice_receipt")]
         InvoiceReceipt,

        [Description("invoice_created")]
         InvoiceCreated,

        [Description("invoice_updated")]
         InvoiceUpdated,

        [Description("invoice_deleted")]
         InvoiceDeleted,

        [Description("subscription_renewal_reminder")]
         SubscriptionRenewalReminder,

        [Description("payment_succeeded")]
         PaymentSucceeded,

        [Description("payment_failed")]
         PaymentFailed,

        [Description("payment_refunded")]
         PaymentRefunded,

        [Description("card_added")]
         CardAdded,

        [Description("card_updated")]
         CardUpdated,

        [Description("card_expiring")]
         CardExpiring,

        [Description("card_expired")]
         CardExpired,

        [Description("card_deleted")]
         CardDeleted,

    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: Microservices, Docker and buzz words
category: blog
comments: true
excerpt: Decoding the buzz words related to microservices ecosystem
tags:
  - cloud
  - microservices
---

Can't make sense of words like Docker, Containers, Kubernetes, ETCD? You are not alone. The container technology space is on a tear lately. Let me try to make sense of a few the buzz words.

**Caution**: I only have limited understanding of this ecosystem. I'd suggest reading the article to understand concepts rather than individual companies/projects and where they stand.

## Microservices
Architecture style in which large application is split into multiple small applications (aka services). Each service performs a small specific task of the application hence called micro-service. Each microservice can use its own set of technologies (language, db etc). The services communicate with each other using queues or REST API. Read Martin Fowler's [excellent guide](http://martinfowler.com/microservices/#what) on the topic. Following diagram is from my experience converting [monolith
application to microservices]({{site.url}}/projects/accidental-microservices/).

 A sample microservices based application

Since each microservice is small, a few/all of them can be deployed on a single server. There are 2 ways of doing this: Virtual Machines and Containers.

## Virtual Machines
An entire Operating System wrapped in a installable software. You can install your application on a single OS, wrap it in a Virtual Machine and then install it on any server (OS/Linux/Windows) and application will work correctly. VMs are resource heavy and large (since it is an entire OS), thus it is slow and you can only use limited number of VMs on single server.

## Container Runtime
Instead of full-fledged Operating Systems we can use set of core libraries that most applications use to interact with the server. Container engine is a thin layer that acts as an intermediary between application and OS/Other-applications.

 Virtual Machines (left) vs Containers (right)

## Containers
Containers are thin wrappers surrounding the microservice/application. Like VMs if your application works well within the container, you can be assured it will work on any server (OS/Linux/Windows). If application is wrapped in a container, it can be easily replicated or migrated to another server. (example: replicate front-end container in response to increase in requests). Also, it ensures, containers restrict application's abilities on the server. (Example: application can access only restricted set of users, file system, ports, CPU, memory etc).

## Container Formats
These containers need to have specific format so that the runtime can start and run them properly. There are mainly 2 competing formats

- [Docker](https://www.docker.com/what-docker)
- [Rkt by CoreOS](https://coreos.com/blog/rocket/)
- [OCI](https://www.opencontainers.org/about) Attempt to standardize container format

### Side note:

Industry has [not](https://sreeninet.wordpress.com/2016/06/11/container-standards/) [yet](https://coreos.com/blog/making-sense-of-standards/) [standardized](https://www.linkedin.com/pulse/forking-docker-daniel-riek) the format for containers. Thus, all container orchestration frameworks advertise their compatibility with different containers. For example: [Kubernetes](http://blog.kubernetes.io/2016/07/rktnetes-brings-rkt-container-engine-to-Kubernetes.html) is capable of running both Docker and Rocket containers.

Docker and CoreOS are 2 companies which not only have their container formats (Docker and Rkt) but also entire ecosystem to
 manage them (some of which are listed below).

## Container Registry

Once a container is created for the application, it can be stored on a server called container registry. This helps in reusing the container image, to create new copies/instances.

Registries are of two types

- Public - Which hosts basic software images like Tomcat, Nginx, MySQL etc.
- Private - Which host your custom application containers.

Typically, first a basic image is downloaded from [Docker's Open Repository](https://hub.docker.com). Then the image is customized as per the application's needs, and then saved to any of the private registries mentioned below.

- [Docker Registry](https://docs.docker.com/registry/)
- [CoreOS Registry](https://coreos.com/products/enterprise-registry/docs)
- [AWS Registry](https://aws.amazon.com/ecr/)
- [Google Container Registry](https://cloud.google.com/container-registry/)

Docker's Public Container Registry

## Orchestration

Once all microservices/applications are wrapped in containers, there needs to be a way to automate their deployments, rollbacks, restart, healing etc. Also, there is a need to monitor services, discover new services, authenticate them, scale/replicate etc.

All these requirements call for an orchestration framework.

Few of such frameworks are listed below:

- [Kubernetes](https://deis.com/blog/2016/kubernetes-illustrated-guide/) - Most popular one.
- [Docker Swarm](https://blog.docker.com/2016/06/docker-1-12-built-in-orchestration/) - Docker's own embedded orchestration.
- [Mesos](mesos.apache.org/) - Highly popular cluster manager, used to manage servers. Is used with Hadoop, Kafka and Spark. Recently gained container (Docker/Rkt/OCI) [support](https://blogs.apache.org/foundation/entry/the_apache_software_foundation_announces97).
- [Amazon ECS](https://aws.amazon.com/ecs/) - AWS's own cloud based orchestration.
- [Google Container Engine](https://cloud.google.com/container-engine/) - Kubernetes on Google Compute Engine.

## Service Discovery

As part of the orchestration, each service needs to register itself, so that other services and orchestrator can discover and work with it. For this functionality, a highly available, strongly consistent system is required. Few of softwares which satisfy these requirements include [ETCD](https://coreos.com/etcd/), [Consul](https://www.consul.io/) and  [Zookeeper](https://zookeeper.apache.org/). These projects are used by frameworks internally, and we need not have complete understanding of it. I'd recommend this [Google paper](https://research.google.com/archive/chubby.html) if interested in knowing how these systems are implemented.

## Conclusion

The ecosystem surrounding microservices and containers is vibrant and fast-paced. Since, it is still going through
the churn and yet to mature, it can be difficult to keep track of all projects. I guess, we will soon see
consolidation of these technologies. Trends are beginning to show Docker leading in containers while Kubernetes
in container management. Fascinating times.

##  Left over buzzwords

- [Hadoop](https://www.youtube.com/watch?v=d2xeNpfzsYI): System used to store and process large amounts of data.
- [Kafka](http://kafka.apache.org/): Distributed messaging system.
- [Spark](http://spark.apache.org/): Big data processing engine. Similar to (& allegedly much better than) Hadoop
- [Redis](http://redis.io): Distributed key-Value store.

If you want to learn about some of the modern databases, check out this [article]({{site.url}}/blog/choosing-databases/).


text:
<!DOCTYPE html>

    <meta charset="UTF-8">

    <title>A Pen by  Linda</title>

Important Concepts

The internet, the web, browsers and HTML

   The internet is a way that allows computers (phones, tablets, servers etc) around the world to talk to one another.
  We send these information packets (bytes) through LAN cables or through WiFi.
  It used to be just text.

  Now computers talk using a new language called HTML (Hypertext Markup Language) to create a web page.
  So instead of just text, HTML allows the webpage to be in a graphical format.
  We will need a browsers to view HTML in a graphical format, which you will know it as a webpage.
  All these web pages is collectively known as the world wide web or commonly known as the web.

  So the internet is the physical highway between computers, the vehicles on the highway are the packets of information.
  There are many different types of vehicles now. The car is like the web traffic, the trucks like the email traffic and the motorcycles like your music, video, picture traffic. So the internet contains the the web, email, music, video, pictures etc.

HTML terms

  HTML stands for Hypertext Markup Language.
  HTML documents form the majority of the content on the web.

Tags and Elements

  HTML documents are made of HTML elements.
  When writing HTML, we tell browsers the type of each element by
  using HTML tags. Eg  tag = bold

Why Computers are Stupid

   Computers are stupid because they interpret instructions literally.
   Every tag has to be correct for the computer to understand what you want it to do.

Inline vs Block Elements

   HTML elements are either inline or block.
   Block elements form an "invisible box" around the content inside
   of them.

So how does everthing work together?

  When you enter the url for a webpage like www.google.com,
  your computer sends a HTTP Request to a server using HTML.
  The server finds the appropriate HTML document and sends it back to your computer.
  Your web browser on your computer will interpret the HTML into the webpage
  that you ultimately see on your computer screen.


text:
package org.socialsignin.spring.data.dynamodb.mapping.event;

import org.springframework.context.ApplicationEvent;

/**
 * @author Michael Lavelle
 */
public class DynamoDBMappingEvent<T> extends ApplicationEvent {

	private static final long serialVersionUID = 1L;

	public DynamoDBMappingEvent(T source) {
		super(source);
	}

	@SuppressWarnings({ "unchecked" })
	@Override
	public T getSource() {
		return (T) super.getSource();
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>
      temperature
  </title>

temperature

Get Version

        1.1.1

What

Temperature makes it easy to deal with temperatures in Ruby, but

adding mixin methods to numbers and strings.

This was inspired by using Ruby to manipulate data from my home

weather station, and wanting it to keep track of the units for me so

that I didn’t have to think about that in code.

Installing

sudo gem install temperature

Demonstration of usage

freezing_in_F = 32
freezing_in_C = freezing_in_F.to_C

boiling_in_C = 100
boiling_in_C.units = "C"
boiling_in_F = boiling_in_C.to_F

absolute_zero = "0K".to_degrees
absolute_zero_in_C = absolute_zero.to_C
absolute_zero_in_F = absolute_zero.to_F

There is also support to calculate dewpoint from relative humidity

based on the NOAA approximation documented here -

http://en.wikipedia.org/wiki/Dew_point#Closer_approximation

dewpoint = 32.dewpoint(45)

API Documentation

Full module level documentation can be found at http://sdaguegems.rubyforge.org/temperature/rdoc

How to submit patches

Read the 8 steps for fixing other people’scode.

Fork the code on github, then send me a merge request.

github: http://github.com/sdague/temperature/tree/master

git clone git://github.com/sdague/temperature.git

Build and test instructions

cd temperature
rake test
rake install_gem

License

This code is free to use under the terms of the MIT license.

Contact

Comments are welcome. Contact me via

github, or via my website

      Sean Dague, 14th March 2010

      Theme extended from Paul Battley


text:
LOG="/tmp/pair.log"
CARRIER_ID=$1
LOCATION_ID=$2
CAM_ID=$3

echo "Carrier_ID:$CARRIER_ID\nLocation:$LOCATION_ID\nCAM_ID:$CAM_ID\n" >$LOG
/usr/local/wabisabi/kintsugi/fixtures/CAM/bin/racklistener -f $LOCATION_ID
echo "/usr/local/wabisabi/kintsugi/fixtures/CAM/bin/racklistener -f $LOCATION_ID\n" >>$LOG


text:
/**
 * @file Trainer.h
 * @class Trainer
 * @brief Trains a Net.
 *
 * @author Clemens-Alexander Brust (ikosa dot de at gmail dot com)
 */

#ifndef CONV_TRAINER_H
#define CONV_TRAINER_H

#include <cmath>

#include "CombinedTensor.h"
#include "Net.h"

namespace Conv {

struct TrainerSettings {
public:
  datum learning_rate = 0.0001;
  datum l1_weight = 0.001;
  datum l2_weight = 0.0005;
  datum exponent = 0.75;
  datum gamma = 0.0003;
  datum momentum = 0.9;
  datum epoch_training_ratio = 1.0;
  datum testing_ratio = 1.0;
  unsigned int pbatchsize = 1;
  unsigned int sbatchsize = 1;
  unsigned int iterations = 500;
};

class Trainer {
public:
  /**
	* @brief Creates a Trainer for the specified Net
	*
	* @param net The Net to train
	* @param settings The settings to use in training
	*/
  Trainer (Net& net, TrainerSettings settings);

  /**
	* @brief Train the net for the specified number of epochs
	*
	* @param epochs The number of epochs to train
	*/
  void Train (unsigned int epochs);

  /**
	* @brief Test the net by running every test sample through the net
	*/
  datum Test();

  /**
	* @brief Train the net for exactly one epoch
	*/
  void Epoch();

  /**
	* @brief Set the current epoch
	*
	* @param epoch The new epoch number
	*/
  inline void SetEpoch (unsigned int epoch) {
    epoch_ = epoch;
  }

  inline unsigned int epoch() { return epoch_; }

  inline datum CalculateLR (unsigned int iteration) {
    return settings_.learning_rate * pow (1.0 + settings_.gamma
                                          * (datum) iteration,
                                          -settings_.exponent);
  }

private:
  void ApplyGradients (datum lr);
  // References for easy access
  Net& net_;
  std::vector<CombinedTensor*> parameters_;
  std::vector<Tensor*> last_deltas_;
  std::vector<Tensor*> accumulated_gradients_;
  TrainingLayer* training_layer_;
  LossFunctionLayer* lossfunction_layer_;

  // Sample count
  unsigned int sample_count_ = 0;

  // Learning options
  TrainerSettings settings_;

  // State
  unsigned int epoch_ = 0;
};

/**
 * @brief Prints settings to the ostream, may be helpful.
 */
std::ostream& operator<< (std::ostream& output, const TrainerSettings settings);

}

#endif


text:
namespace Kvasir {
//System Integration Module
    namespace SimSrsid{    ///<System Reset Status and ID Register
        using Addr = Register::Address<0x40048000,0x0000d119,0x00000000,unsigned>;
        ///Low Voltage Detect
        enum class LvdVal {
            v0=0x00000000,     ///<Reset is not caused by LVD trip or POR.
            v1=0x00000001,     ///<Reset is caused by LVD trip or POR.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,LvdVal> lvd{};
        namespace LvdValC{
            constexpr Register::FieldValue<decltype(lvd)::Type,LvdVal::v0> v0{};
            constexpr Register::FieldValue<decltype(lvd)::Type,LvdVal::v1> v1{};
        }
        ///Internal Clock Source Module Reset
        enum class LocVal {
            v0=0x00000000,     ///<Reset is not caused by the ICS module.
            v1=0x00000001,     ///<Reset is caused by the ICS module.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,LocVal> loc{};
        namespace LocValC{
            constexpr Register::FieldValue<decltype(loc)::Type,LocVal::v0> v0{};
            constexpr Register::FieldValue<decltype(loc)::Type,LocVal::v1> v1{};
        }
        ///Watchdog (WDOG)
        enum class WdogVal {
            v0=0x00000000,     ///<Reset is not caused by WDOG timeout.
            v1=0x00000001,     ///<Reset is caused by WDOG timeout.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,WdogVal> wdog{};
        namespace WdogValC{
            constexpr Register::FieldValue<decltype(wdog)::Type,WdogVal::v0> v0{};
            constexpr Register::FieldValue<decltype(wdog)::Type,WdogVal::v1> v1{};
        }
        ///External Reset Pin
        enum class PinVal {
            v0=0x00000000,     ///<Reset is not caused by external reset pin.
            v1=0x00000001,     ///<Reset came from external reset pin.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,PinVal> pin{};
        namespace PinValC{
            constexpr Register::FieldValue<decltype(pin)::Type,PinVal::v0> v0{};
            constexpr Register::FieldValue<decltype(pin)::Type,PinVal::v1> v1{};
        }
        ///Power-On Reset
        enum class PorVal {
            v0=0x00000000,     ///<Reset not caused by POR.
            v1=0x00000001,     ///<POR caused reset.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,PorVal> por{};
        namespace PorValC{
            constexpr Register::FieldValue<decltype(por)::Type,PorVal::v0> v0{};
            constexpr Register::FieldValue<decltype(por)::Type,PorVal::v1> v1{};
        }
        ///Core Lockup
        enum class LockupVal {
            v0=0x00000000,     ///<Reset is not caused by core LOCKUP event.
            v1=0x00000001,     ///<Reset is caused by core LOCKUP event.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,LockupVal> lockup{};
        namespace LockupValC{
            constexpr Register::FieldValue<decltype(lockup)::Type,LockupVal::v0> v0{};
            constexpr Register::FieldValue<decltype(lockup)::Type,LockupVal::v1> v1{};
        }
        ///Software
        enum class SwVal {
            v0=0x00000000,     ///<Reset is not caused by software setting of SYSRESETREQ bit.
            v1=0x00000001,     ///<Reset caused by software setting of SYSRESETREQ bit
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,SwVal> sw{};
        namespace SwValC{
            constexpr Register::FieldValue<decltype(sw)::Type,SwVal::v0> v0{};
            constexpr Register::FieldValue<decltype(sw)::Type,SwVal::v1> v1{};
        }
        ///MDM-AP System Reset Request
        enum class MdmapVal {
            v0=0x00000000,     ///<Reset is not caused by host debugger system setting of the System Reset Request bit.
            v1=0x00000001,     ///<Reset is caused by host debugger system setting of the System Reset Request bit.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,MdmapVal> mdmap{};
        namespace MdmapValC{
            constexpr Register::FieldValue<decltype(mdmap)::Type,MdmapVal::v0> v0{};
            constexpr Register::FieldValue<decltype(mdmap)::Type,MdmapVal::v1> v1{};
        }
        ///Stop Mode Acknowledge Error Reset
        enum class SackerrVal {
            v0=0x00000000,     ///<Reset is not caused by peripheral failure to acknowledge attempt to enter Stop mode.
            v1=0x00000001,     ///<Reset is caused by peripheral failure to acknowledge attempt to enter Stop mode.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,SackerrVal> sackerr{};
        namespace SackerrValC{
            constexpr Register::FieldValue<decltype(sackerr)::Type,SackerrVal::v0> v0{};
            constexpr Register::FieldValue<decltype(sackerr)::Type,SackerrVal::v1> v1{};
        }
        ///Device Pin ID
        enum class PinidVal {
            v0000=0x00000000,     ///<8-pin
            v0001=0x00000001,     ///<16-pin
            v0010=0x00000002,     ///<20-pin
            v0011=0x00000003,     ///<24-pin
            v0100=0x00000004,     ///<32-pin
            v0101=0x00000005,     ///<44-pin
            v0110=0x00000006,     ///<48-pin
            v0111=0x00000007,     ///<64-pin
            v1000=0x00000008,     ///<80-pin
            v1010=0x0000000a,     ///<100-pin
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,16),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,PinidVal> pinid{};
        namespace PinidValC{
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0000> v0000{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0001> v0001{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0010> v0010{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0011> v0011{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0100> v0100{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0101> v0101{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0110> v0110{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v0111> v0111{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v1000> v1000{};
            constexpr Register::FieldValue<decltype(pinid)::Type,PinidVal::v1010> v1010{};
        }
        ///Device Revision Number
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,20),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> revid{};
        ///Kinetis sub-family ID
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,24),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> subfamid{};
        ///Kinetis family ID
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,28),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> famid{};
    }
    namespace SimSopt{    ///<System Options Register
        using Addr = Register::Address<0x40048004,0x007000f1,0x00000000,unsigned>;
        ///NMI Pin Enable
        enum class NmieVal {
            v0=0x00000000,     ///<PTB4/FTM2_CH4/SPI0_MISO/NMI/ACMP1_IN2 pin functions as PTB4, FTM2_CH4, SPI0_MISO, or ACMP1_IN2.
            v1=0x00000001,     ///<PTB4/FTM2_CH4/SPI0_MISO/NMI/ACMP1_IN2 pin functions as NMI.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,NmieVal> nmie{};
        namespace NmieValC{
            constexpr Register::FieldValue<decltype(nmie)::Type,NmieVal::v0> v0{};
            constexpr Register::FieldValue<decltype(nmie)::Type,NmieVal::v1> v1{};
        }
        ///RESET Pin Enable
        enum class RstpeVal {
            v0=0x00000000,     ///<PTA5/IRQ/FTM0_CLK/RESET pin functions as PTA5, IRQ, or FTM0_CLK.
            v1=0x00000001,     ///<PTA5/IRQ/FTM0_CLK/RESET pin functions as RESET.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,RstpeVal> rstpe{};
        namespace RstpeValC{
            constexpr Register::FieldValue<decltype(rstpe)::Type,RstpeVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rstpe)::Type,RstpeVal::v1> v1{};
        }
        ///Single Wire Debug Port Pin Enable
        enum class SwdeVal {
            v0=0x00000000,     ///<PTA4/ACMP0_OUT/SWD_DIO as PTA4 or ACMP0_OUT function, PTC4/RTCO/FTM1_CH0/ACMP0_IN2/SWD_CLK as PTC4, RTCO, FTM1_CH0, or ACMP0_IN2 function.
            v1=0x00000001,     ///<PTA4/ACMP0_OUT/SWD_DIO as SWD_DIO function, PTC4/RTCO/FTM1CH0/ACMP0_IN2/SWD_CLK as SWD_CLK function.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,SwdeVal> swde{};
        namespace SwdeValC{
            constexpr Register::FieldValue<decltype(swde)::Type,SwdeVal::v0> v0{};
            constexpr Register::FieldValue<decltype(swde)::Type,SwdeVal::v1> v1{};
        }
        ///ADC Hardware Trigger Source
        enum class AdhwtVal {
            v00=0x00000000,     ///<RTC overflow as the ADC hardware trigger
            v01=0x00000001,     ///<PIT overflow as the ADC hardware trigger
            v10=0x00000002,     ///<FTM2 init trigger with 8-bit programmable delay
            v11=0x00000003,     ///<FTM2 match trigger with 8-bit programmable delay
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,AdhwtVal> adhwt{};
        namespace AdhwtValC{
            constexpr Register::FieldValue<decltype(adhwt)::Type,AdhwtVal::v00> v00{};
            constexpr Register::FieldValue<decltype(adhwt)::Type,AdhwtVal::v01> v01{};
            constexpr Register::FieldValue<decltype(adhwt)::Type,AdhwtVal::v10> v10{};
            constexpr Register::FieldValue<decltype(adhwt)::Type,AdhwtVal::v11> v11{};
        }
        ///Real-Time Counter Capture
        enum class RtccVal {
            v0=0x00000000,     ///<RTC overflow is not connected to FTM1 input channel 1.
            v1=0x00000001,     ///<RTC overflow is connected to FTM1 input channel 1.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,RtccVal> rtcc{};
        namespace RtccValC{
            constexpr Register::FieldValue<decltype(rtcc)::Type,RtccVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rtcc)::Type,RtccVal::v1> v1{};
        }
        ///Analog Comparator to Input Capture Enable
        enum class AcicVal {
            v0=0x00000000,     ///<ACMP0 output is not connected to FTM1 input channel 0.
            v1=0x00000001,     ///<ACMP0 output is connected to FTM1 input channel 0.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,AcicVal> acic{};
        namespace AcicValC{
            constexpr Register::FieldValue<decltype(acic)::Type,AcicVal::v0> v0{};
            constexpr Register::FieldValue<decltype(acic)::Type,AcicVal::v1> v1{};
        }
        ///UART0_RX Capture Select
        enum class RxdceVal {
            v0=0x00000000,     ///<UART0_RX input signal is connected to the UART0 module only.
            v1=0x00000001,     ///<UART0_RX input signal is connected to the UART0 module and FTM0 channel 1.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,RxdceVal> rxdce{};
        namespace RxdceValC{
            constexpr Register::FieldValue<decltype(rxdce)::Type,RxdceVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rxdce)::Type,RxdceVal::v1> v1{};
        }
        ///UART0_RX Filter Select
        enum class RxdfeVal {
            v0=0x00000000,     ///<UART0_RX input signal is connected to UART0 module directly.
            v1=0x00000001,     ///<UART0_RX input signal is filtered by ACMP, then injected to UART0.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,RxdfeVal> rxdfe{};
        namespace RxdfeValC{
            constexpr Register::FieldValue<decltype(rxdfe)::Type,RxdfeVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rxdfe)::Type,RxdfeVal::v1> v1{};
        }
        ///FTM2 Synchronization Select
        enum class FtmsyncVal {
            v0=0x00000000,     ///<No synchronization triggered.
            v1=0x00000001,     ///<Generates a PWM synchronization trigger to the FTM2 modules.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::Access<Register::AccessType::writeOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,FtmsyncVal> ftmsync{};
        namespace FtmsyncValC{
            constexpr Register::FieldValue<decltype(ftmsync)::Type,FtmsyncVal::v0> v0{};
            constexpr Register::FieldValue<decltype(ftmsync)::Type,FtmsyncVal::v1> v1{};
        }
        ///UART0_TX Modulation Select
        enum class TxdmeVal {
            v0=0x00000000,     ///<UART0_TX output is connected to pinout directly.
            v1=0x00000001,     ///<UART0_TX output is modulated by FTM0 channel 0 before mapped to pinout.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,TxdmeVal> txdme{};
        namespace TxdmeValC{
            constexpr Register::FieldValue<decltype(txdme)::Type,TxdmeVal::v0> v0{};
            constexpr Register::FieldValue<decltype(txdme)::Type,TxdmeVal::v1> v1{};
        }
        ///BUS Clock Output select
        enum class BusrefVal {
            v000=0x00000000,     ///<Bus
            v001=0x00000001,     ///<Bus divided by 2
            v010=0x00000002,     ///<Bus divided by 4
            v011=0x00000003,     ///<Bus divided by 8
            v100=0x00000004,     ///<Bus divided by 16
            v101=0x00000005,     ///<Bus divided by 32
            v110=0x00000006,     ///<Bus divided by 64
            v111=0x00000007,     ///<Bus divided by 128
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,16),Register::ReadWriteAccess,BusrefVal> busref{};
        namespace BusrefValC{
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v000> v000{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v001> v001{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v010> v010{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v011> v011{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v100> v100{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v101> v101{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v110> v110{};
            constexpr Register::FieldValue<decltype(busref)::Type,BusrefVal::v111> v111{};
        }
        ///Bus Clock Output Enable
        enum class ClkoeVal {
            v0=0x00000000,     ///<Bus clock output is disabled on PTH2.
            v1=0x00000001,     ///<Bus clock output is enabled on PTH2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,ClkoeVal> clkoe{};
        namespace ClkoeValC{
            constexpr Register::FieldValue<decltype(clkoe)::Type,ClkoeVal::v0> v0{};
            constexpr Register::FieldValue<decltype(clkoe)::Type,ClkoeVal::v1> v1{};
        }
        ///FTM2 Trigger Delay Active
        enum class DlyactVal {
            v0=0x00000000,     ///<The delay is inactive.
            v1=0x00000001,     ///<The delay is active.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,DlyactVal> dlyact{};
        namespace DlyactValC{
            constexpr Register::FieldValue<decltype(dlyact)::Type,DlyactVal::v0> v0{};
            constexpr Register::FieldValue<decltype(dlyact)::Type,DlyactVal::v1> v1{};
        }
        ///FTM2 Trigger Delay
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,24),Register::ReadWriteAccess,unsigned> delay{};
    }
    namespace SimPinsel{    ///<Pin Selection Register
        using Addr = Register::Address<0x40048008,0xffff000f,0x00000000,unsigned>;
        ///RTCO Pin Select
        enum class RtcpsVal {
            v0=0x00000000,     ///<RTCO is mapped on PTC4.
            v1=0x00000001,     ///<RTCO is mapped on PTC5.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,RtcpsVal> rtcps{};
        namespace RtcpsValC{
            constexpr Register::FieldValue<decltype(rtcps)::Type,RtcpsVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rtcps)::Type,RtcpsVal::v1> v1{};
        }
        ///I2C0 Port Pin Select
        enum class I2c0psVal {
            v0=0x00000000,     ///<I2C0_SCL and I2C0_SDA are mapped on PTA3 and PTA2, respectively.
            v1=0x00000001,     ///<I2C0_SCL and I2C0_SDA are mapped on PTB7 and PTB6, respectively.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,I2c0psVal> i2c0ps{};
        namespace I2c0psValC{
            constexpr Register::FieldValue<decltype(i2c0ps)::Type,I2c0psVal::v0> v0{};
            constexpr Register::FieldValue<decltype(i2c0ps)::Type,I2c0psVal::v1> v1{};
        }
        ///SPI0 Pin Select
        enum class Spi0psVal {
            v0=0x00000000,     ///<SPI0_SCK, SPI0_MOSI, SPI0_MISO, and SPI0_PCS0 are mapped on PTB2, PTB3, PTB4, and PTB5.
            v1=0x00000001,     ///<SPI0_SCK, SPI0_MOSI, SPI0_MISO, and SPI0_PCS0 are mapped on PTE0, PTE1, PTE2, and PTE3.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,Spi0psVal> spi0ps{};
        namespace Spi0psValC{
            constexpr Register::FieldValue<decltype(spi0ps)::Type,Spi0psVal::v0> v0{};
            constexpr Register::FieldValue<decltype(spi0ps)::Type,Spi0psVal::v1> v1{};
        }
        ///UART0 Pin Select
        enum class Uart0psVal {
            v0=0x00000000,     ///<UART0_RX and UART0_TX are mapped on PTB0 and PTB1.
            v1=0x00000001,     ///<UART0_RX and UART0_TX are mapped on PTA2 and PTA3.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,Uart0psVal> uart0ps{};
        namespace Uart0psValC{
            constexpr Register::FieldValue<decltype(uart0ps)::Type,Uart0psVal::v0> v0{};
            constexpr Register::FieldValue<decltype(uart0ps)::Type,Uart0psVal::v1> v1{};
        }
        ///FTM0[0] Port Pin Select
        enum class Ftm0ps0Val {
            v0=0x00000000,     ///<FTM0[0] channels are mapped on PTA0.
            v1=0x00000001,     ///<FTM0[0] channels are mapped on PTB2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,Ftm0ps0Val> ftm0ps0{};
        namespace Ftm0ps0ValC{
            constexpr Register::FieldValue<decltype(ftm0ps0)::Type,Ftm0ps0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm0ps0)::Type,Ftm0ps0Val::v1> v1{};
        }
        ///FTM0[1] Port Pin Select
        enum class Ftm0ps1Val {
            v0=0x00000000,     ///<FTM0[1] channels are mapped on PTA1.
            v1=0x00000001,     ///<FTM0[1] channels are mapped on PTB3.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,Ftm0ps1Val> ftm0ps1{};
        namespace Ftm0ps1ValC{
            constexpr Register::FieldValue<decltype(ftm0ps1)::Type,Ftm0ps1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm0ps1)::Type,Ftm0ps1Val::v1> v1{};
        }
        ///FTM1[0] Port Pin Select
        enum class Ftm1ps0Val {
            v0=0x00000000,     ///<FTM1[0] channels are mapped on PTC4.
            v1=0x00000001,     ///<FTM1[0] channels are mapped on PTH2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,Ftm1ps0Val> ftm1ps0{};
        namespace Ftm1ps0ValC{
            constexpr Register::FieldValue<decltype(ftm1ps0)::Type,Ftm1ps0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm1ps0)::Type,Ftm1ps0Val::v1> v1{};
        }
        ///FTM1[1] Port Pin Select
        enum class Ftm1ps1Val {
            v0=0x00000000,     ///<FTM1[1] channels are mapped on PTC5.
            v1=0x00000001,     ///<FTM1[1] channels are mapped on PTE7.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,Ftm1ps1Val> ftm1ps1{};
        namespace Ftm1ps1ValC{
            constexpr Register::FieldValue<decltype(ftm1ps1)::Type,Ftm1ps1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm1ps1)::Type,Ftm1ps1Val::v1> v1{};
        }
        ///FTM2[0] Port Pin Select
        enum class Ftm2ps0Val {
            v0=0x00000000,     ///<FTM2[0] channels are mapped on PTC0.
            v1=0x00000001,     ///<FTM2[0] channels are mapped on PTH0.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,Ftm2ps0Val> ftm2ps0{};
        namespace Ftm2ps0ValC{
            constexpr Register::FieldValue<decltype(ftm2ps0)::Type,Ftm2ps0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm2ps0)::Type,Ftm2ps0Val::v1> v1{};
        }
        ///FTM2[1] Port Pin Select
        enum class Ftm2ps1Val {
            v0=0x00000000,     ///<FTM2[1] channels are mapped on PTC1.
            v1=0x00000001,     ///<FTM2[1] channels are mapped on PTH1.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,Ftm2ps1Val> ftm2ps1{};
        namespace Ftm2ps1ValC{
            constexpr Register::FieldValue<decltype(ftm2ps1)::Type,Ftm2ps1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm2ps1)::Type,Ftm2ps1Val::v1> v1{};
        }
        ///FTM2[2] Port Pin Select
        enum class Ftm2ps2Val {
            v0=0x00000000,     ///<FTM2[2] channels are mapped on PTC2.
            v1=0x00000001,     ///<FTM2[2] channels are mapped on PTD0.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,Ftm2ps2Val> ftm2ps2{};
        namespace Ftm2ps2ValC{
            constexpr Register::FieldValue<decltype(ftm2ps2)::Type,Ftm2ps2Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm2ps2)::Type,Ftm2ps2Val::v1> v1{};
        }
        ///FTM2[3] Port Pin Select
        enum class Ftm2ps3Val {
            v0=0x00000000,     ///<FTM2[3] channels are mapped on PTC3.
            v1=0x00000001,     ///<FTM2[3] channels are mapped on PTD1.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,Ftm2ps3Val> ftm2ps3{};
        namespace Ftm2ps3ValC{
            constexpr Register::FieldValue<decltype(ftm2ps3)::Type,Ftm2ps3Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm2ps3)::Type,Ftm2ps3Val::v1> v1{};
        }
    }
    namespace SimScgc{    ///<System Clock Gating Control Register
        using Addr = Register::Address<0x4004800c,0x1481cb1c,0x00000000,unsigned>;
        ///RTC Clock Gate Control
        enum class RtcVal {
            v0=0x00000000,     ///<Bus clock to the RTC module is disabled.
            v1=0x00000001,     ///<Bus clock to the RTC module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,RtcVal> rtc{};
        namespace RtcValC{
            constexpr Register::FieldValue<decltype(rtc)::Type,RtcVal::v0> v0{};
            constexpr Register::FieldValue<decltype(rtc)::Type,RtcVal::v1> v1{};
        }
        ///PIT Clock Gate Control
        enum class PitVal {
            v0=0x00000000,     ///<Bus clock to the PIT module is disabled.
            v1=0x00000001,     ///<Bus clock to the PIT module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,PitVal> pit{};
        namespace PitValC{
            constexpr Register::FieldValue<decltype(pit)::Type,PitVal::v0> v0{};
            constexpr Register::FieldValue<decltype(pit)::Type,PitVal::v1> v1{};
        }
        ///FTM0 Clock Gate Control
        enum class Ftm0Val {
            v0=0x00000000,     ///<Bus clock to the FTM0 module is disabled.
            v1=0x00000001,     ///<Bus clock to the FTM0 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,Ftm0Val> ftm0{};
        namespace Ftm0ValC{
            constexpr Register::FieldValue<decltype(ftm0)::Type,Ftm0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm0)::Type,Ftm0Val::v1> v1{};
        }
        ///FTM1 Clock Gate Control
        enum class Ftm1Val {
            v0=0x00000000,     ///<Bus clock to the FTM1 module is disabled.
            v1=0x00000001,     ///<Bus clock to the FTM1 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,Ftm1Val> ftm1{};
        namespace Ftm1ValC{
            constexpr Register::FieldValue<decltype(ftm1)::Type,Ftm1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm1)::Type,Ftm1Val::v1> v1{};
        }
        ///FTM2 Clock Gate Control
        enum class Ftm2Val {
            v0=0x00000000,     ///<Bus clock to the FTM2 module is disabled.
            v1=0x00000001,     ///<Bus clock to the FTM2 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,Ftm2Val> ftm2{};
        namespace Ftm2ValC{
            constexpr Register::FieldValue<decltype(ftm2)::Type,Ftm2Val::v0> v0{};
            constexpr Register::FieldValue<decltype(ftm2)::Type,Ftm2Val::v1> v1{};
        }
        ///CRC Clock Gate Control
        enum class CrcVal {
            v0=0x00000000,     ///<Bus clock to the CRC module is disabled.
            v1=0x00000001,     ///<Bus clock to the CRC module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,CrcVal> crc{};
        namespace CrcValC{
            constexpr Register::FieldValue<decltype(crc)::Type,CrcVal::v0> v0{};
            constexpr Register::FieldValue<decltype(crc)::Type,CrcVal::v1> v1{};
        }
        ///Flash Clock Gate Control
        enum class FlashVal {
            v0=0x00000000,     ///<Bus clock to the flash module is disabled.
            v1=0x00000001,     ///<Bus clock to the flash module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,FlashVal> flash{};
        namespace FlashValC{
            constexpr Register::FieldValue<decltype(flash)::Type,FlashVal::v0> v0{};
            constexpr Register::FieldValue<decltype(flash)::Type,FlashVal::v1> v1{};
        }
        ///SWD (single wire debugger) Clock Gate Control
        enum class SwdVal {
            v0=0x00000000,     ///<Bus clock to the SWD module is disabled.
            v1=0x00000001,     ///<Bus clock to the SWD module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,SwdVal> swd{};
        namespace SwdValC{
            constexpr Register::FieldValue<decltype(swd)::Type,SwdVal::v0> v0{};
            constexpr Register::FieldValue<decltype(swd)::Type,SwdVal::v1> v1{};
        }
        ///I2C Clock Gate Control
        enum class I2cVal {
            v0=0x00000000,     ///<Bus clock to the IIC module is disabled.
            v1=0x00000001,     ///<Bus clock to the IIC module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,17),Register::ReadWriteAccess,I2cVal> i2c{};
        namespace I2cValC{
            constexpr Register::FieldValue<decltype(i2c)::Type,I2cVal::v0> v0{};
            constexpr Register::FieldValue<decltype(i2c)::Type,I2cVal::v1> v1{};
        }
        ///SPI0 Clock Gate Control
        enum class Spi0Val {
            v0=0x00000000,     ///<Bus clock to the SPI0 module is disabled.
            v1=0x00000001,     ///<Bus clock to the SPI0 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,18),Register::ReadWriteAccess,Spi0Val> spi0{};
        namespace Spi0ValC{
            constexpr Register::FieldValue<decltype(spi0)::Type,Spi0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(spi0)::Type,Spi0Val::v1> v1{};
        }
        ///SPI1 Clock Gate Control
        enum class Spi1Val {
            v0=0x00000000,     ///<Bus clock to the SPI1 module is disabled.
            v1=0x00000001,     ///<Bus clock to the SPI1 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,Spi1Val> spi1{};
        namespace Spi1ValC{
            constexpr Register::FieldValue<decltype(spi1)::Type,Spi1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(spi1)::Type,Spi1Val::v1> v1{};
        }
        ///UART0 Clock Gate Control
        enum class Uart0Val {
            v0=0x00000000,     ///<Bus clock to the UART0 module is disabled.
            v1=0x00000001,     ///<Bus clock to the UART0 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,Uart0Val> uart0{};
        namespace Uart0ValC{
            constexpr Register::FieldValue<decltype(uart0)::Type,Uart0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(uart0)::Type,Uart0Val::v1> v1{};
        }
        ///UART1 Clock Gate Control
        enum class Uart1Val {
            v0=0x00000000,     ///<Bus clock to the UART1 module is disabled.
            v1=0x00000001,     ///<Bus clock to the UART1 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,Uart1Val> uart1{};
        namespace Uart1ValC{
            constexpr Register::FieldValue<decltype(uart1)::Type,Uart1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(uart1)::Type,Uart1Val::v1> v1{};
        }
        ///UART2 Clock Gate Control
        enum class Uart2Val {
            v0=0x00000000,     ///<Bus clock to the UART2 module is disabled.
            v1=0x00000001,     ///<Bus clock to the UART2 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,Uart2Val> uart2{};
        namespace Uart2ValC{
            constexpr Register::FieldValue<decltype(uart2)::Type,Uart2Val::v0> v0{};
            constexpr Register::FieldValue<decltype(uart2)::Type,Uart2Val::v1> v1{};
        }
        ///KBI0 Clock Gate Control
        enum class Kbi0Val {
            v0=0x00000000,     ///<Bus clock to the KBI0 module is disabled.
            v1=0x00000001,     ///<Bus clock to the KBI0 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,24),Register::ReadWriteAccess,Kbi0Val> kbi0{};
        namespace Kbi0ValC{
            constexpr Register::FieldValue<decltype(kbi0)::Type,Kbi0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(kbi0)::Type,Kbi0Val::v1> v1{};
        }
        ///KBI1 Clock Gate Control
        enum class Kbi1Val {
            v0=0x00000000,     ///<Bus clock to the KBI1 module is disabled.
            v1=0x00000001,     ///<Bus clock to the KBI1 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::ReadWriteAccess,Kbi1Val> kbi1{};
        namespace Kbi1ValC{
            constexpr Register::FieldValue<decltype(kbi1)::Type,Kbi1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(kbi1)::Type,Kbi1Val::v1> v1{};
        }
        ///IRQ Clock Gate Control
        enum class IrqVal {
            v0=0x00000000,     ///<Bus clock to the IRQ module is disabled.
            v1=0x00000001,     ///<Bus clock to the IRQ module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,27),Register::ReadWriteAccess,IrqVal> irq{};
        namespace IrqValC{
            constexpr Register::FieldValue<decltype(irq)::Type,IrqVal::v0> v0{};
            constexpr Register::FieldValue<decltype(irq)::Type,IrqVal::v1> v1{};
        }
        ///ADC Clock Gate Control
        enum class AdcVal {
            v0=0x00000000,     ///<Bus clock to the ADC module is disabled.
            v1=0x00000001,     ///<Bus clock to the ADC module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(29,29),Register::ReadWriteAccess,AdcVal> adc{};
        namespace AdcValC{
            constexpr Register::FieldValue<decltype(adc)::Type,AdcVal::v0> v0{};
            constexpr Register::FieldValue<decltype(adc)::Type,AdcVal::v1> v1{};
        }
        ///ACMP0 Clock Gate Control
        enum class Acmp0Val {
            v0=0x00000000,     ///<Bus clock to the ACMP0 module is disabled.
            v1=0x00000001,     ///<Bus clock to the ACMP0 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(30,30),Register::ReadWriteAccess,Acmp0Val> acmp0{};
        namespace Acmp0ValC{
            constexpr Register::FieldValue<decltype(acmp0)::Type,Acmp0Val::v0> v0{};
            constexpr Register::FieldValue<decltype(acmp0)::Type,Acmp0Val::v1> v1{};
        }
        ///ACMP1 Clock Gate Control
        enum class Acmp1Val {
            v0=0x00000000,     ///<Bus clock to the ACMP1 module is disabled.
            v1=0x00000001,     ///<Bus clock to the ACMP1 module is enabled.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,31),Register::ReadWriteAccess,Acmp1Val> acmp1{};
        namespace Acmp1ValC{
            constexpr Register::FieldValue<decltype(acmp1)::Type,Acmp1Val::v0> v0{};
            constexpr Register::FieldValue<decltype(acmp1)::Type,Acmp1Val::v1> v1{};
        }
    }
    namespace SimUuidl{    ///<Universally Unique Identifier Low Register
        using Addr = Register::Address<0x40048010,0x00000000,0x00000000,unsigned>;
        ///Universally Unique Identifier
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,0),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> id{};
    }
    namespace SimUuidh{    ///<Universally Unique Identifier High Register
        using Addr = Register::Address<0x40048014,0x00000000,0x00000000,unsigned>;
        ///Universally Unique Identifier
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,0),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> id{};
    }
    namespace SimBusdiv{    ///<BUS Clock Divider Register
        using Addr = Register::Address<0x40048018,0xfffffffe,0x00000000,unsigned>;
        ///BUS Clock Divider
        enum class BusdivVal {
            v0=0x00000000,     ///<Bus clock is same as ICSOUTCLK.
            v1=0x00000001,     ///<Bus clock is ICSOUTCLK divided by 2.
        };
        constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,BusdivVal> busdiv{};
        namespace BusdivValC{
            constexpr Register::FieldValue<decltype(busdiv)::Type,BusdivVal::v0> v0{};
            constexpr Register::FieldValue<decltype(busdiv)::Type,BusdivVal::v1> v1{};
        }
    }
}


text:
#region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Kooboo.CMS.Common.Persistence.Non_Relational;

namespace Kooboo.CMS.Content.Models
{

    [DataContract(Name = "TextFolder")]
    [KnownTypeAttribute(typeof(TextFolder))]
    public class TextFolder : Folder
    {
        public TextFolder() { }
        public TextFolder(Repository repository, string fullName) : base(repository, fullName) { }
        public TextFolder(Repository repository, string name, Folder parent) : base(repository, name, parent) { }
        public TextFolder(Repository repository, IEnumerable<string> namePath) : base(repository, namePath) { }
        [DataMember(Order = 9)]
        public string SchemaName { get; set; }

        [DataMember(Order = 10)]
        public List<CategoryFolder> Categories { get; set; }

        [DataMember(Order = 13)]
        public string[] EmbeddedFolders { get; set; }

        [DataMember(Order = 14)]
        public string WorkflowName { get; set; }

        [DataMember(Order = 15)]
        public string[] Roles { get; set; }

        private OrderSetting orderSetting;
        [DataMember(Order = 16)]
        [Obsolete]
        public OrderSetting OrderSetting
        {
            get
            {
                if (orderSetting == null)
                {
                    orderSetting = new Models.OrderSetting() { FieldName = OrderSetting.Default.FieldName, Direction = OrderSetting.Default.Direction };
                }
                return orderSetting;
            }
            set
            {
                orderSetting = value;
            }
        }

        [DataMember()]
        public bool? Sortable
        {
            get;
            set;
        }

        private bool? _enablePaging;
        [DataMember()]
        public bool? EnablePaging
        {
            get
            {
                if (!_enablePaging.HasValue)
                {
                    return true;
                }
                return _enablePaging;
            }
            set
            {
                _enablePaging = value;
            }
        }

        private bool? visibleOnSidebarMenu;
        [Obsolete("please use Hidden.")]
        [DataMember(Order = 18)]
        public bool? VisibleOnSidebarMenu
        {
            get
            {
                if (visibleOnSidebarMenu.HasValue == false)
                {
                    return true;
                }
                return visibleOnSidebarMenu;
            }
            set
            {
                visibleOnSidebarMenu = value;
            }
        }

        private bool? hidden;
        [DataMember(Order = 20)]
        public bool? Hidden
        {
            get
            {
                if (!hidden.HasValue && VisibleOnSidebarMenu.HasValue)
                {
                    //compatible with VisibleOnSidebarMenu setting
                    return !VisibleOnSidebarMenu.Value;
                }
                return hidden;
            }
            set
            {
                hidden = value;
            }
        }

        private int pageSize = 50;
        [DataMember(Order = 20)]
        public int PageSize
        {
            get
            {
                if (pageSize == 0)
                {
                    pageSize = 50;
                }
                return pageSize;
            }
            set
            {
                pageSize = value;
            }
        }

        public bool EnabledWorkflow
        {
            get
            {
                return !string.IsNullOrEmpty(WorkflowName);
            }
        }

        /// <summary>
        /// Gets a value indicating whether this <see cref="TextFolder" /> is visible.
        /// determine by Repository.ShowHiddenFolder and Hidden value.
        /// </summary>
        /// <value>
        ///   <c>true</c> if visible; otherwise, <c>false</c>.
        /// </value>
        public bool Visible
        {
            get
            {
                if (Repository != null)
                {
                    return Repository.AsActual().ShowHiddenFolders || this.AsActual().Hidden == null || this.AsActual().Hidden.Value == false;
                }
                else
                {
                    return true;
                }
            }
        }

    }
}


text:
<?php

namespace Youshido\TokenAuthenticationBundle\Model;

interface AccessTokenInterface
{
    /**
     * Get id
     *
     * @return integer
     */
    public function getId();

    /**
     * Set modelId
     *
     * @param string $modelId
     *
     * @return $this
     */
    public function setModelId($modelId);

    /**
     * Get modelId
     *
     * @return string
     */
    public function getModelId();

    /**
     * Set status
     *
     * @param integer $status
     *
     * @return $this
     */
    public function setStatus($status);

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus();

    /**
     * Set value
     *
     * @param string $value
     *
     * @return $this
     */
    public function setValue($value);

    /**
     * Get value
     *
     * @return string
     */
    public function getValue();

    /**
     * @return \DateTime
     */
    public function getCreatedAt();

    /**
     * @param \DateTime $createdAt
     *
     * @return $this
     */
    public function setCreatedAt($createdAt);

}


text:
const jsCodeWithSingleAndMultLineComments = `
function nonMutatingPush(original, newItem) {
  /* This is a
    multi-line comment
    that should be removed. */
  return original.push(newItem);
}
var first = [1, 2, 3];
// This is a single line comment
var second = [4, 5];
nonMutatingPush(first, second);`;

const jsCodeWithSingleAndMultLineCommentsRemoved = `
function nonMutatingPush(original, newItem) {
    return original.push(newItem);
}
var first = [1, 2, 3];

var second = [4, 5];
nonMutatingPush(first, second);`;

const jsCodeWithUrl = `
function nonMutatingPush(original, newItem) {
  var url = 'https://freecodecamp.org'; // this comment should vanish
  return original.push(newItem);
}`;

const jsCodeWithUrlUnchanged = `
function nonMutatingPush(original, newItem) {
  var url = 'https://freecodecamp.org';
  return original.push(newItem);
}`;

const jsCodeWithNoCall = `function myFunc() {
  return Math.random();
}
`;

const jsCodeWithNoArgCall = `function myFunc() {
  return Math.random();
}
myFunc();
`;

const jsCodeWithArgCall = `function myFunc() {
  return Math.random();
}
myFunc('this shouldn't be here');
`;

const jsCodeWithCommentedCall = `function myFunc() {
  return Math.random();
}
/*
myFunc();
*/
`;

const testValues = {
  jsCodeWithSingleAndMultLineComments,
  jsCodeWithSingleAndMultLineCommentsRemoved,
  jsCodeWithUrl,
  jsCodeWithUrlUnchanged,
  jsCodeWithNoCall,
  jsCodeWithNoArgCall,
  jsCodeWithArgCall,
  jsCodeWithCommentedCall
};

export default testValues;


text:
package io.datarouter.loadtest.service;

import io.datarouter.loadtest.storage.RandomValue;
import io.datarouter.loadtest.storage.RandomValueKey;
import io.datarouter.storage.client.imp.noop.NoOpNode;
import io.datarouter.storage.node.op.raw.write.StorageWriter;

public interface LoadTestInsertDao{

	StorageWriter<RandomValueKey,RandomValue> getWriterNode();

	class NoOpLoadTestInsertDao implements LoadTestInsertDao{

		@Override
		public StorageWriter<RandomValueKey,RandomValue> getWriterNode(){
			return new NoOpNode<>();
		}

	}

}


text:
using System;
using Prometheus.Compile;
using Prometheus.Nodes;

namespace Prometheus.Exceptions.Executor
{
    /// <summary>
    /// Base exception for all run time errors.
    /// </summary>
    public class RunTimeException : PrometheusException
    {
        /// <summary>
        /// Constructor
        /// </summary>
        protected RunTimeException()
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="pMessage">Exception message</param>
        public RunTimeException(string pMessage)
            : base(pMessage)
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="pMessage">Exception message</param>
        /// <param name="pNode">The node the error relates to</param>
        protected RunTimeException(string pMessage, Node pNode)
            : base(pMessage, pNode.Location)
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="pMessage">Exception message</param>
        /// <param name="pInner">Inner exception</param>
        protected RunTimeException(string pMessage, Exception pInner)
            : base(pMessage, pInner)
        {
        }

        /// <summary>
        /// Wraps around another exception.
        /// </summary>
        public RunTimeException(string pMessage, Location pLocation, Exception pInnerException)
            : base(pMessage, pLocation, pInnerException)
        {
        }
    }
}


text:
日本の銀行に関して、その休日を把握しやすくするためのgem.
[holiday_jp](https://github.com/komagata/holiday_jp)をベースに、作っています.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'bank_working_day'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install bank_working_day

## Usage

#### 初期化

```ruby
bank_working_day = BankWorkingDay::Base.new()
```

祝日の情報をオーバーライドしたい場合はYAMLファイルのパスを渡す

```ruby
bank_working_day = BankWorkingDay::Base.new('/path/to/holidays.yml')
```

#### 銀行における月の最終営業日を返す

```ruby
bank_working_day.end_of_month_without_holiday(date)
```

#### x営業日前の日付を返す

```ruby
bank_working_day.working_day_before(date: date, offset: offset)
```

#### 休日か確認する

```ruby
bank_working_day.holiday?(date)
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/speee/bank_working_day. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
package org.apache.helix.api.id;

/**
 * Generic identifier for Helix constructs
 */
public abstract class Id implements Comparable<Id> {
  public abstract String stringify();

  @Override
  public String toString() {
    return stringify();
  }

  @Override
  public boolean equals(Object that) {
    if (that instanceof Id) {
      return this.stringify().equals(((Id) that).stringify());
    } else if (that instanceof String) {
      return this.stringify().equals(that);
    }
    return false;
  }

  @Override
  public int hashCode() {
    return this.stringify().hashCode();
  }

  @Override
  public int compareTo(Id that) {
    if (that instanceof Id) {
      return this.stringify().compareTo(that.stringify());
    }
    return -1;
  }
}


text:
A large library that assists in mod creation.
- Script File Manipulation.
- Custom Heist framework
- Modules Framework
- Easy ability to add content. Such as Masks, Melee Weapons, Weapon Mods etc

## Editors
Editors were moved to BeardLib-Editor a while ago, get them there [BeardLib-Editor](https://github.com/GreatBigBushyBeard/PAYDAY-2-BeardLib-Editor)

## Documentation
The main documentation can be found on the [wiki](https://github.com/GreatBigBushyBeard/PAYDAY-2-BeardLib/wiki) for this repo.

## Download
You can download a stable release from modworkshop: https://modworkshop.net/mod/14924

## Dependencies
* [SuperBLT](https://superblt.znix.xyz)

## Templates
You can find them here: https://github.com/ModWorkshop/BeardLib-Templates

## A few mods that make use of BeardLib
* PD:TH Hud: [ModWorkshop](https://modworkshop.net/mod/19900)
* Death Wish+: [ModWorkshop](http://modworkshop.net/mod/14384)
* SC's Mod: [ModWorkshop](http://modworkshop.net/mod/17254)
* HoloUI: [GitHub](https://github.com/Luffyyy/HoloUI) [ModWorkshop](http://modworkshop.net/mod/12501)
* Restoration Mod: [ModWorkshop](https://modworkshop.net/mod/428)
* And a lot more in here: [ModWorkshop](https://modworkshop.net/find/mod?gid=1&tags=11)

## Custom content mods
* [Custom heists](https://modworkshop.net/category/502)
* [Custom weapons and weapon mods](https://modworkshop.net/category/528)
* [Custom masks](https://modworkshop.net/category/8)


text:
<?php
namespace Jme\CommentBundle\Controller;

use FOS\CommentBundle\Controller\ThreadController as BaseThreadController;

use Symfony\Component\HttpFoundation\Request;

class ThreadController extends BaseThreadController
{
    /**
     * Get the comments of a thread. Creates a new thread if none exists.
     *
     * @param Request $request Current request
     * @param string  $id      Id of the thread
     *
     * @return View
     * @todo Add support page/pagesize/sorting/tree-depth parameters
     */
    public function getThreadCommentsAction(Request $request, $id)
    {
        return parent::getThreadCommentsAction($request, $id);
    }
}


text:
from django.contrib import admin

from django_unsaved_changes.admin import UnsavedChangesAdmin

from .models import *

class MatchUserInline(admin.TabularInline):
    model = MatchUser
    extra = 0

    autocomplete_lookup_fields = {
        'fk': ['user'],
    }
    raw_id_fields = ('user', )

class MatchAdmin(UnsavedChangesAdmin):

    #prepopulated_fields = {"slug": ("title",)}
    #inlines = [MatchUserInline]
    pass

class MatchUserAdmin(UnsavedChangesAdmin):

    autocomplete_lookup_fields = {
        'fk': ['match', 'user'],
    }
    raw_id_fields = ('match', 'user', )

class MatchLogsAdmin(UnsavedChangesAdmin):

    autocomplete_lookup_fields = {
        'fk': ['match', 'player', 'affected_player', 'logtype'],
    }
    raw_id_fields = ('match', 'player', 'affected_player', 'logtype', )

class PlayerAdmin(UnsavedChangesAdmin):

    autocomplete_lookup_fields = {
        'fk': ['current_match'],
    }
    raw_id_fields = ('current_match', )

class LogTypeAdmin(UnsavedChangesAdmin):
    pass

admin.site.register(Match, MatchAdmin)
admin.site.register(MatchUser, MatchUserAdmin)
admin.site.register(MatchLogs, MatchLogsAdmin)
admin.site.register(Player, PlayerAdmin)
admin.site.register(LogType, LogTypeAdmin)


text:
package org.unitime.timetable.model.base;

import java.io.Serializable;

import org.unitime.timetable.model.ExamType;
import org.unitime.timetable.model.RefTableEntry;

/**
 * Do not change this class. It has been automatically generated using ant create-model.
 * @see org.unitime.commons.ant.CreateBaseModelFromXml
 */
public abstract class BaseExamType extends RefTableEntry implements Serializable {
	private static final long serialVersionUID = 1L;

	private Integer iType;
	private Boolean iHighlightInEvents;

	public static String PROP_XTYPE = "type";
	public static String PROP_EVENTS = "highlightInEvents";

	public BaseExamType() {
		initialize();
	}

	public BaseExamType(Long uniqueId) {
		setUniqueId(uniqueId);
		initialize();
	}

	protected void initialize() {}

	public Integer getType() { return iType; }
	public void setType(Integer type) { iType = type; }

	public Boolean isHighlightInEvents() { return iHighlightInEvents; }
	public Boolean getHighlightInEvents() { return iHighlightInEvents; }
	public void setHighlightInEvents(Boolean highlightInEvents) { iHighlightInEvents = highlightInEvents; }

	public boolean equals(Object o) {
		if (o == null || !(o instanceof ExamType)) return false;
		if (getUniqueId() == null || ((ExamType)o).getUniqueId() == null) return false;
		return getUniqueId().equals(((ExamType)o).getUniqueId());
	}

	public int hashCode() {
		if (getUniqueId() == null) return super.hashCode();
		return getUniqueId().hashCode();
	}

	public String toString() {
		return "ExamType["+getUniqueId()+" "+getLabel()+"]";
	}

	public String toDebugString() {
		return "ExamType[" +
			"\n	HighlightInEvents: " + getHighlightInEvents() +
			"\n	Label: " + getLabel() +
			"\n	Reference: " + getReference() +
			"\n	Type: " + getType() +
			"\n	UniqueId: " + getUniqueId() +
			"]";
	}
}


text:
require "monster"

describe Monster do

  subject { Monster.new("Skeleton King", 5, 50, {strength: 5, dexterity: 10, constitution: 15, intelligence: 3}) }

  context "#initialize" do
    it "sets the name" do
      expect(subject.name).to eql("Skeleton King")
    end

    it "sets the level" do
      expect(subject.level).to eql(5)
    end

    it "sets the difficulty" do
      expect(subject.difficulty).to eql(50)
    end

    it "sets the attributes" do
      expect(subject.strength).to eql(5)
      expect(subject.dexterity).to eql(10)
      expect(subject.constitution).to eql(15)
      expect(subject.intelligence).to eql(3)
    end
  end

  context "#health_points" do
    it "calculates health points based on constitution" do
      expect(subject.health_points).to eql(45)
    end
  end

  context "#attack_power" do
    it "calculates the attack power based on strength" do
      expect(subject.attack_power).to eql(8)
    end
  end
end


text:
/* $NetBSD: _strtoul.h,v 1.7 2013/05/17 12:55:56 joerg Exp $ */

/*-
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Original version ID:
 * NetBSD: src/lib/libc/locale/_wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp
 */

/*
 * function template for strtoul, strtoull and strtoumax.
 *
 * parameters:
 *	_FUNCNAME  : function name
 *      __UINT     : return type
 *      __UINT_MAX : upper limit of the return type
 */
#if defined(_KERNEL) || defined(_STANDALONE) || \
    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
__UINT
_FUNCNAME(const char *nptr, char **endptr, int base)
#else
#include <locale.h>
#include "setlocale_local.h"
#define INT_FUNCNAME_(pre, name, post)	pre ## name ## post
#define INT_FUNCNAME(pre, name, post)	INT_FUNCNAME_(pre, name, post)

static __UINT
INT_FUNCNAME(_int_, _FUNCNAME, _l)(const char *nptr, char **endptr,
				   int base, locale_t loc)
#endif
{
	const char *s;
	__UINT acc, cutoff;
	unsigned char c;
	int i, neg, any, cutlim;

	_DIAGASSERT(nptr != NULL);
	/* endptr may be NULL */

	/* check base value */
	if (base && (base < 2 || base > 36)) {
#if !defined(_KERNEL) && !defined(_STANDALONE)
		errno = EINVAL;
		return(0);
#else
		panic("%s: invalid base %d", __func__, base);
#endif
	}

	/*
	 * Skip white space and pick up leading +/- sign if any.
	 * If base is 0, allow 0x for hex and 0 for octal, else
	 * assume decimal; if base is already 16, allow 0x.
	 */
	s = nptr;
#if defined(_KERNEL) || defined(_STANDALONE) || \
    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
	do {
		c = *s++;
	} while (isspace(c));
#else
	do {
		c = *s++;
	} while (isspace_l(c, loc));
#endif
	if (c == '-') {
		neg = 1;
		c = *s++;
	} else {
		neg = 0;
		if (c == '+')
			c = *s++;
	}
	if ((base == 0 || base == 16) &&
	    c == '0' && (*s == 'x' || *s == 'X')) {
		c = s[1];
		s += 2;
		base = 16;
	}
	if (base == 0)
		base = (c == '0' ? 8 : 10);

	/*
	 * See strtol for comments as to the logic used.
	 */
	cutoff = ((__UINT)__UINT_MAX / (__UINT)base);
	cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base);
	for (acc = 0, any = 0;; c = *s++) {
		if (c >= '0' && c <= '9')
			i = c - '0';
		else if (c >= 'a' && c <= 'z')
			i = (c - 'a') + 10;
		else if (c >= 'A' && c <= 'Z')
			i = (c - 'A') + 10;
		else
			break;
		if (i >= base)
			break;
		if (any < 0)
			continue;
		if (acc > cutoff || (acc == cutoff && i > cutlim)) {
			acc = __UINT_MAX;
#if !defined(_KERNEL) && !defined(_STANDALONE)
			any = -1;
			errno = ERANGE;
#else
			any = 0;
			break;
#endif
		} else {
			any = 1;
			acc *= (__UINT)base;
			acc += i;
		}
	}
	if (neg && any > 0)
		acc = -acc;
	if (endptr != NULL)
		/* LINTED interface specification */
		*endptr = __UNCONST(any ? s - 1 : nptr);
	return(acc);
}

#if !defined(_KERNEL) && !defined(_STANDALONE) && \
    !defined(HAVE_NBTOOL_CONFIG_H) && !defined(BCS_ONLY)
__UINT
_FUNCNAME(const char *nptr, char **endptr, int base)
{
	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base, _current_locale());
}

__UINT
INT_FUNCNAME(, _FUNCNAME, _l)(const char *nptr, char **endptr, int base, locale_t loc)
{
	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base, loc);
}
#endif


text:
module.exports = {
	_loadedRewardedVideoAd: false,
	_isShowingRewardedVideoAd: false,
	setLicenseKey: function (email, licenseKey) {
		var self = this;
        cordova.exec(
            null,
            null,
            'Vungle',
            'setLicenseKey',
            [email, licenseKey]
        );
    },
	setUp: function (appId) {
		var self = this;
        cordova.exec(
			function (result) {
				console.log('setUp succeeded.');

				if (typeof result == "string") {
					if (result == "onRewardedVideoAdLoaded") {
						self._loadedRewardedVideoAd = true;

						if (self.onRewardedVideoAdLoaded)
							self.onRewardedVideoAdLoaded();
					}
					else if (result == "onRewardedVideoAdShown") {
						self._loadedRewardedVideoAd = false;
						self._isShowingRewardedVideoAd = true;

						if (self.onRewardedVideoAdShown)
							self.onRewardedVideoAdShown();
					}
					else if (result == "onRewardedVideoAdHidden") {
						self._isShowingRewardedVideoAd = false;

						if (self.onRewardedVideoAdHidden)
							self.onRewardedVideoAdHidden();
					}
					else if (result == "onRewardedVideoAdCompleted") {
						self._isShowingRewardedVideoAd = false;

						if (self.onRewardedVideoAdCompleted)
							self.onRewardedVideoAdCompleted();
					}
/*
					else if (result == "onRewardedVideoAdNotCompleted") {
						self._isShowingRewardedVideoAd = false;

						if (self.onRewardedVideoAdNotCompleted)
							self.onRewardedVideoAdNotCompleted();
					}
*/
				}
				else {
					//var event = result["event"];
					//var location = result["message"];
					//if (event == "onXXX") {
					//	if (self.onXXX)
					//		self.onXXX(location);
					//}
				}
			},
			function (error) {
				console.log('setUp failed.');
			},
            'Vungle',
            'setUp',
			[appId]
        );
    },
    showRewardedVideoAd: function () {
		var self = this;
		cordova.exec(
 			null,
            null,
            'Vungle',
            'showRewardedVideoAd',
            []
        );
    },
	loadedRewardedVideoAd: function() {
		return this._loadedRewardedVideoAd;
	},
	isShowingRewardedVideoAd: function() {
		return this._isShowingRewardedVideoAd;
	},
/*
	//
	onAvailable: null,//deprecated
	onUnavailable: null,//deprecated
*/
	//
	onRewardedVideoAdLoaded: null,
	onRewardedVideoAdShown: null,
	onRewardedVideoAdHidden: null,
	onRewardedVideoAdCompleted: null
/*
	onRewardedVideoAdNotCompleted: null
*/
};


text:
import { Pipe, PipeTransform } from '@angular/core';
import { isIcon } from 'cd-common/utils';

/**
 * Test to see if an icon value is an icon config for a Cloud Platform icon (vs. Material)
 */
@Pipe({ name: 'isCloudIconPipe' })
export class IsCloudIconPipe implements PipeTransform {
  transform(value: any): boolean {
    return isIcon(value);
  }
}


text:
from django.test import SimpleTestCase

from corehq.apps.api.odata.serializers import (
    ODataCaseSerializer,
    ODataFormSerializer,
)
from corehq.apps.export.models import (
    CaseExportInstance,
    ExportColumn,
    ExportItem,
    FormExportInstance,
    PathNode,
    TableConfiguration,
)

class TestODataCaseSerializer(SimpleTestCase):

    def test_selected_column_included(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'owner_name': 'owner-name-value',
                    'properties': {},
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='owner-name-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='owner_name')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'owner-name-label': 'owner-name-value'}]
        )

    def test_unselected_column_excluded(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'owner_name': 'owner-name-value',
                    'properties': {},
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='owner-name-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='owner_name')
                                        ]
                                    ),
                                    selected=False,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{}]
        )

    def test_missing_value_is_null(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='owner-name-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='owner_name')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'owner-name-label': '---'}]
        )

    def test_non_standard_case_property(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'property_1': 'property-1-value',
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='property-1-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='property_1')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'property-1-label': 'property-1-value'}]
        )

    def test_case_id(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': 'case-id-value',
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='case-id-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='_id')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'case-id-label': 'case-id-value'}]
        )

    def test_case_name(self):
        self.assertEqual(
            ODataCaseSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'name': 'case-name-value',
                }],
                CaseExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='case-name-label',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='name')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'case-name-label': 'case-name-value'}]
        )

    def test_next_link_present(self):
        meta = {'next': '?limit=1&offset=1'}
        api_path = '/a/odata-test/api/v0.5/odata/cases/config_id'
        self.assertEqual(
            ODataCaseSerializer.get_next_url(meta, api_path),
            'http://localhost:8000/a/odata-test/api/v0.5/odata/cases/config_id?limit=1&offset=1'
        )

    def test_next_link_absent(self):
        meta = {'next': None}
        api_path = '/a/odata-test/api/v0.5/odata/cases/config_id'
        self.assertEqual(
            ODataCaseSerializer.get_next_url(meta, api_path),
            None
        )

class TestODataFormSerializer(SimpleTestCase):

    def test_selected_column_included(self):
        self.assertEqual(
            ODataFormSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'user_id': 'the-user-id',
                }],
                FormExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='user-id',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='user_id')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'user-id': 'the-user-id'}]
        )

    def test_unselected_column_excluded(self):
        self.assertEqual(
            ODataFormSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                    'user_id': 'the-user-id',
                }],
                FormExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='user-id',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='user_id')
                                        ]
                                    ),
                                    selected=False,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{}]
        )

    def test_missing_value_is_null(self):
        self.assertEqual(
            ODataFormSerializer.serialize_documents_using_config(
                [{
                    'domain': 'test_domain',
                    '_id': '54352-25234',
                }],
                FormExportInstance(
                    tables=[
                        TableConfiguration(
                            selected=True,
                            columns=[
                                ExportColumn(
                                    label='user-id',
                                    item=ExportItem(
                                        path=[
                                            PathNode(name='user_id')
                                        ]
                                    ),
                                    selected=True,
                                )
                            ]
                        )
                    ]
                ),
                0
            ),
            [{'user-id': '---'}]
        )

    def test_next_link_present(self):
        meta = {'next': '?limit=1&offset=1'}
        api_path = '/a/odata-test/api/v0.5/odata/forms/config_id'
        self.assertEqual(
            ODataFormSerializer.get_next_url(meta, api_path),
            'http://localhost:8000/a/odata-test/api/v0.5/odata/forms/config_id?limit=1&offset=1'
        )

    def test_next_link_absent(self):
        meta = {'next': None}
        api_path = '/a/odata-test/api/v0.5/odata/forms/config_id'
        self.assertEqual(
            ODataFormSerializer.get_next_url(meta, api_path),
            None
        )