text:
[%
    page.import({
        title    = 'Impatient Perl (free)',
        section  = 'learn',
        description
            = 'Perl.org free online Perl books: Impatient Perl',
    });
%]

by Greg London

View online (HTML)

View online (PDF)

Download (PDF)

Author's Website:
      www.greglondon.com

You write code for a living, and your inherit a legacy program written
in Perl. You can program in your native language in your sleep. But
you don't know Perl at all, or you've only dabbled with it. Your
deadline doesn't give you enough time to rewrite the legacy program in
your native language, but it needs new features. You need to learn
Perl, and you need to learn it NOW. "Impatient Perl" was written for
you.

The Impatient Introduction to Perl

This document is for people who either want to learn Perl or are
already programming in Perl and just don't have the patience to
scrounge for information to learn and use Perl.  This document should
also find use as a handy desk reference for some of the more common
perl related questions.

The history of Perl in 100 words or less

In the mid 1980's, Larry Wall was working as a sysadmin and found that
he needed to do a number of common, yet oddball functions over and
over again. And he didn't like any of the scripting languages that
were around at the time, so he invented Perl. Version 1 was released
circa 1987. A few changes have occurred between then and now. The
current version of Perl has exceeded 5.8.0 and is a highly recommended
upgrade.


text:
$(document).ready(function(jQuery) {

  // a mock object that looks sufficiently jQuery-ish
  var myLib = function() {
    return {
      attr: function() { return "spam" },
      html: function() { return "spam" },
      hasClass: function() { return "spam" }
    };
  };

  var viewAttrs = { id: 'test-setdomlibrary', className: 'test-setdomlibrary' }

  module("Backbone.setDomLibrary", {

    teardown: function() {
      Backbone.setDomLibrary(jQuery);
    }

  });

  test('Changing jQuery library to custom library', function() {
    Backbone.setDomLibrary(myLib);
    var view = new Backbone.View(viewAttrs);
    ok(view.$el.hasClass('test-setdomlibrary') === 'spam');
    Backbone.setDomLibrary(jQuery);
    var view = new Backbone.View(viewAttrs);
    ok(view.$el.hasClass('test-setdomlibrary'));
  });

});

redpajama_set_name: RedPajamaGithub


text:
Rails.application.routes.draw do
  devise_for :users
  resources :authors
  resources :publishers
  resources :books do
    post :search, on: :collection
    post :export, on: :collection
    post :update_from_open_library, on: :member
    get :new_by_isbn, on: :collection
    get :new_manual, on: :collection
    post :create_manual, on: :collection
    post :create_by_isbn, on: :collection
  end

  get '/search', to: 'search#index'
  get '/search/barcode', to: 'search#barcode'
  get '/search/title', to: 'search#title'
  post '/search/by_barcode', to: 'search#by_barcode'
  post '/search/by_title', to: 'search#by_title'

  namespace :admin do
    resource :system_config, only: [:edit, :update]
    resources :users
  end

  root to: 'books#index'
end


text:
libdispatch built on mac 10.10

build step refer to instruction in INSTALL file

sh autogen.sh

./configure CFLAGS='-arch x86_64 -arch i386' \
		--prefix=/usr --libdir=/usr/lib/system \
		--disable-dependency-tracking --disable-static \
		--disable-libdispatch-init-constructor \
		--enable-apple-tsd-optimizations \

you can get the dependency header files from apple open source directory ,such as xnu ,libclosure ,and so on


text:
package org.apereo.cas.configuration.model.support.saml.idp.metadata;

import org.apereo.cas.configuration.support.DurationCapable;
import org.apereo.cas.configuration.support.RequiresModule;

import com.fasterxml.jackson.annotation.JsonFilter;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * This is {@link CoreSamlMetadataProperties}.
 *
 * @author Misagh Moayyed
 * @since 6.4.0
 */
@RequiresModule(name = "cas-server-support-saml-idp")
@Getter
@Setter
@Accessors(chain = true)
@JsonFilter("CoreSamlMetadataProperties")
public class CoreSamlMetadataProperties implements Serializable {

    private static final long serialVersionUID = -8116473583467202828L;

    /**
     * Whether invalid metadata should eagerly fail quickly on startup
     * once the resource is parsed.
     */
    private boolean failFast = true;

    /**
     * How long should metadata be cached.
     */
    @DurationCapable
    private String cacheExpiration = "PT24H";

    /**
     * Whether valid metadata is required.
     */
    private boolean requireValidMetadata = true;

    /**
     * Whether metadata generation process
     * should support SSO service POST binding.
     */
    private boolean ssoServicePostBindingEnabled = true;
    /**
     * Whether metadata generation process
     * should support SSO service POST SimpleSign binding.
     */

    private boolean ssoServicePostSimpleSignBindingEnabled = true;
    /**
     * Whether metadata generation process
     * should support SSO service REDIRECT binding.
     */
    private boolean ssoServiceRedirectBindingEnabled = true;
    /**
     * Whether metadata generation process
     * should support SSO service SOAP binding.
     */
    private boolean ssoServiceSoapBindingEnabled = true;

    /**
     * Whether metadata generation process
     * should support SLO service POST binding.
     */
    private boolean sloServicePostBindingEnabled = true;
    /**
     * Whether metadata generation process
     * should support SLO service REDIRECT binding.
     */
    private boolean sloServiceRedirectBindingEnabled = true;

}


text:
'use strict'

const handlers = require('../handlers/reports')

module.exports = [
  {
    method: 'GET',
    path: '/reports/warnings/{groupID}',
    handler: handlers.getWarningsClassReport,
    config: {
      description: 'Warning Reports for a spesific class'
    }
  },
  {
    method: 'GET',
    path: '/reports/followups/{groupID}',
    handler: handlers.getFollowupsClassReport,
    config: {
      description: 'Followup Reports for a spesific class'
    }
  }
]


text:
'use strict';

var should = require('should');
var app = require('../../app');
var request = require('supertest');
var Meeting = require('./meeting.model');
var _ = require('lodash');
var agent = request.agent(app);
var MockMeeting = require('./meeting.mock');

describe('Meeting Items Api', function () {
   var meeting;
   var api;
   var item;
   var assignment;
   var newAssignment;
   var updateAssignment = {description: 'Rent a uhaul truck'};

   var endpoint = function (assignmentId) {
      var compiled = _.template('/api/meetings/<%= meetingId %>/items/<%= itemId %>/assignments/<%= assignmentId %>');
      return compiled({
         meetingId: meeting._id,
         itemId: item._id,
         assignmentId: assignmentId ? assignmentId : ''
      });
   };

   beforeEach(function (done) {
      Meeting.find({}).remove().exec().then(function () {
         Meeting.create(MockMeeting, function (error, meetingResponse) {
            if (error) { return done(error); }

            meeting = meetingResponse;
            item = _.first(meeting.items);
            assignment = _.first(item.assignments);

            newAssignment = {
               owner: _.sample(meeting.members),
               description: 'Prank call Home Depot'
            };

            done();
         });
      });
   });

   afterEach(function (done) {
      Meeting.find({}).remove().exec().then(function () {
         done();
      });
   });

   describe('GET all meeting item assignment assignments', function () {
      beforeEach(function () {
         api = agent//
            .get(endpoint())//
            .expect('Content-Type', /json/)//
            .expect(200);

      });
      it('should be a list of assignments', function (done) {
         api.end(function (error, res) {
            if (error) { done(error); }
            res.body.should.be.an.Array().with.length(1);
            done()
         });
      });
   });

   describe('GET A single meeting item assignment', function () {
      beforeEach(function () {
         api = agent//
            .get(endpoint(assignment._id))//
            .expect('Content-Type', /json/)//
            .expect(200);

      });
      it('should be a single item assignment', function (done) {
         api.end(function (error, res) {
            if (error) { done(error); }
            res.body.should.be.an.Object();
            done()
         });
      });

   });

   describe('POST A new meeting item assignment', function () {
      beforeEach(function () {
         api = agent//
            .post(endpoint())//
            .expect(201)//
            .expect('Content-Type', /json/)//
            .send(newAssignment);

      });
      it('should be an object with assignment properties', function (done) {
         api//
            .end(function (error, res) {
               if (error) { return done(error); }
               res.body.should.be.an.Object();
               res.body._id.should.match(/[a-f0-9]{24}/);
               res.body.owner.should.be.an.Object();
               res.body.owner.name.should.be.a.String();
               res.body.description.should.be.a.String();
               Date(res.body.opened).should.be.a.String();

               done()
            });
      });

      it('should have correct values', function (done) {
         api//
            .end(function (error, res) {
               if (error) { return done(error); }
               res.body.owner.name.should.be.equal(newAssignment.owner.name);
               res.body.description.should.be.equal(newAssignment.description);
               Date(res.body.opened).should.be.equal(Date());
               done()
            })
      });

   });

   describe('PATCH A meeting item assignment', function () {
      beforeEach(function () {
         api = agent//
            .patch(endpoint(assignment._id))//
            .expect(200)//
            .expect('Content-Type', /json/)//
            .send(updateAssignment);
      });

      it('should be the updated object', function (done) {
         api.end(function (error, res) {
            if (error) { return done(error); }

            res.body.should.be.an.Object();
            res.body.description.should.equal(updateAssignment.description);
            res.body.owner.name.should.be.equal(assignment.owner.name);

            done()
         });
      });

   });

   describe('DELETE A meeting item assignment', function () {
      beforeEach(function () {
         api = agent//
            .delete('/api/meetings/' + meeting._id + '/items/' + item._id)//
            .expect(200)//
            .expect('Content-Type', /json/);

      });

   });
});


text:
import queue
import threading
import os
import csv
import numpy as np
import time

import targets
import config
from classification import _scale_axis

class ClassificationProcessor:
    """"""

    def __init__(self, classifier, target_space, send_triggers,
                 auto_start_thread=True):
        self.classifier = classifier
        self.target_space = target_space
        self.send_triggers = send_triggers

        self.queue = queue.Queue()
        self.classification_count = 0

        if auto_start_thread: self.startThread()

    def addTargetToQueue(self, target):
        """Adds a target object to the 'to be classified' queue using the
        prioritization scheme defined for the class.

        First target in list will be considered front of queue (first to be popped).
        """
        self.queue.put(target)

    def startThread(self):
        """Start thread with all classification processing tasks defined
        in `threadFunctions`.
        """
        threading.Thread(target=self.threadFunctions).start()

    def threadFunctions(self):
        """Procedure to run when thread starts."""
        self.load_targets("current_model_targets.csv",'csv')
        self.fit_classifier()
        self.fitClassificationsAndTriggerRules()

    def fit_classifier(self):
        self.classifier.fit(self.target_space.tables['classifier_features'],
                            self.target_space.tables['classifier_classifications'])

    def load_targets(self, file, format, delimiter=';'):
        """Reads targets from file, creating Target instances and appending
        features and classification to relevant numpy array.
        """
        # TODO: right now, current model targets stored in ARTEMIS directory.
        # make this more robust, maybe in config file?
        dir = os.getcwd()
        file = os.path.join(dir, 'ARTEMIS', file)
        if format == 'csv':
            if os.path.isfile(file):
                with open(file, 'r') as f:
                    for record in csv.DictReader(f, delimiter = delimiter):

                        instance = targets.Target(self.target_space,
                                          source=record['source'],
                                          firstseen=record['date'],
                                          lastseen=record['date'])
                        index = len(self.target_space.tables['classifier_features'])
                        assert(len(self.target_space.tables['classifier_features'])
                                == len(self.target_space.tables['classifier_classifications']))
                        self.target_space.targets.append(index)

                        instance.indices['classifier'] = index
                        self.target_space.classifier_index_to_target[index] = instance
                        self.target_space.tables['classifier_features'].append([
                            _scale_axis(float(record['size']), 'size'),
                            _scale_axis(float(record['speed']), 'speed'),
                            _scale_axis(float(record['deltav']), 'deltav'),
                            _scale_axis(float(record['target_strength']),
                                    'target_strength'),
                            _scale_axis(float(record['time_of_day']),
                                    'time_of_day'),
                            _scale_axis(float(record['current']), 'current')])
                        self.target_space.tables['classifier_classifications'].append(
                                record['classification'])
            else:
                raise IOError("Unable to find csv file {0} to load targets.".
                        format(file))

    def fitClassificationsAndTriggerRules(self):
        """Continuously classifies any targets inside of queue."""
        while True:
            if not self.queue.empty():
                target = self.queue.get()
                if target.get_entry('nims') is not None: # TODO: Check that all targets are being classified, may be missingsome if removed first?
                    X = np.array(target.get_classifier_features()).reshape(1, -1)
                    classification = np.squeeze(self.classifier.predict(X)).tolist()
                    target.classification = classification
                    print('Classified target {0}, classification: {1}'.format(target, classification))
                    self.send_triggers.check_saving_rules(target, classification)
                    #print('trigger status: ', self.send_triggers.trigger_status)
                    self.classification_count += 1
                    if self.classification_count < config.refit_classifier_count:
                        self.fit_classifier()
                        self.classification_count = 0
            self.send_triggers.send_triggers_if_ready()

            time.sleep(0.01)


text:
var MathJax = {
    skipStartupTypeset: true,
    jax: ['input/TeX', 'output/HTML-CSS']
};

(function () {
    'use strict';

    var states = {start: 1, loading: 2, ready: 3, error: 4},
        state = states.start,
        typesetting = false,
        queue = [],
        src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
        element_prototype = Object.create(HTMLElement.prototype);

    function process_queue() {
        var typesets = [], reprocesses = [];
        queue.forEach(function (elem) {
            var state = MathJax.Hub.isJax(elem);
            if (state === -1)
                typesets.push(elem);
            else if (state === 1)
                reprocesses.push(elem);
        });
        queue = [];
        if (typesets.length) {
            if (typesets.length === 1) typesets = typesets[0];
            MathJax.Hub.Queue(['Typeset', MathJax.Hub, typesets]);
        }
        if (reprocesses.length) {
            if (reprocesses.length === 1) reprocesses = reprocesses[0];
            MathJax.Hub.Queue(['Reprocess', MathJax.Hub, reprocesses]);
        }
        if (typesets.length || reprocesses.length)
            MathJax.Hub.Queue(process_queue);
        else
            typesetting = false;
    }

    function check_queue() {
        if (state === states.ready && !typesetting) {
            typesetting = true;
            process_queue();
        }
    }

    function load_library() {
        state = states.loading;
        MathJax.AuthorInit = function () {
            MathJax.Hub.Register.StartupHook('End', function () {
                state = states.ready;
                check_queue();
            });
        };
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = src;
        script.async = true;
        script.onerror = function () {
            console.warn("Error loading MathJax library " + src);
            state = states.error;
            queue = [];
        };
        document.head.appendChild(script);
    }

    element_prototype.attachedCallback = function () {
        if (this.hasAttribute('src'))
            src = this.getAttribute('src');
        if (!this.hasAttribute('lazyload'))
            load_library();
    };

    element_prototype.typeset = function (elem) {
        if (state === states.error)
            return;
        queue.push(elem);
        if (state === state.ready)  // lazy load
            load_library();
        else
            check_queue();
    };

    document.registerElement('mathjax-loader', {
        prototype: element_prototype
    });

})();


text:
//
//  HWEmotionTool.m
//  黑马微博2期
//
//  Created by apple on 14-10-23.
//  Copyright (c) 2014年 heima. All rights reserved.
//

// 最近表情的存储路径
#define HWRecentEmotionsPath [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"emotions.archive"]

#import "HWEmotionTool.h"
#import <MJExtension.h>
#import "HWEmotion.h"

@implementation HWEmotionTool

static NSMutableArray *_recentEmotions;

+ (void)initialize
{
    _recentEmotions = [NSKeyedUnarchiver unarchiveObjectWithFile:HWRecentEmotionsPath];
    if (_recentEmotions == nil) {
        _recentEmotions = [NSMutableArray array];
    }
}

+ (HWEmotion *)emotionWithChs:(NSString *)chs
{
    NSArray *defaults = [self defaultEmotions];
    for (HWEmotion *emotion in defaults) {
        if ([emotion.chs isEqualToString:chs]) return emotion;
    }

    NSArray *lxhs = [self lxhEmotions];
    for (HWEmotion *emotion in lxhs) {
        if ([emotion.chs isEqualToString:chs]) return emotion;
    }

    return nil;
}

+ (void)addRecentEmotion:(HWEmotion *)emotion
{
    // 删除重复的表情
    [_recentEmotions removeObject:emotion];

    // 将表情放到数组的最前面
    [_recentEmotions insertObject:emotion atIndex:0];

    // 将所有的表情数据写入沙盒
    [NSKeyedArchiver archiveRootObject:_recentEmotions toFile:HWRecentEmotionsPath];
}

/**
 *  返回装着HWEmotion模型的数组
 */
+ (NSArray *)recentEmotions
{
    return _recentEmotions;
}

static NSArray *_emojiEmotions, *_defaultEmotions, *_lxhEmotions;
+ (NSArray *)emojiEmotions
{
    if (!_emojiEmotions) {
        NSString *path = [[NSBundle mainBundle] pathForResource:@"EmotionIcons/emoji/info.plist" ofType:nil];
        _emojiEmotions = [HWEmotion mj_objectArrayWithKeyValuesArray:[NSArray arrayWithContentsOfFile:path]];
    }
    return _emojiEmotions;
}

+ (NSArray *)defaultEmotions
{
    if (!_defaultEmotions) {
        NSString *path = [[NSBundle mainBundle] pathForResource:@"EmotionIcons/default/info.plist" ofType:nil];
        _defaultEmotions = [HWEmotion mj_objectArrayWithKeyValuesArray:[NSArray arrayWithContentsOfFile:path]];
    }
    return _defaultEmotions;
}

+ (NSArray *)lxhEmotions
{
    if (!_lxhEmotions) {
        NSString *path = [[NSBundle mainBundle] pathForResource:@"EmotionIcons/lxh/info.plist" ofType:nil];
        _lxhEmotions = [HWEmotion mj_objectArrayWithKeyValuesArray:[NSArray arrayWithContentsOfFile:path]];
    }
    return _lxhEmotions;
}
@end


text: Haskell playground.


text:
class SignupMailer < ActionMailer::Base

  default :from => 'no-reply@colcho.net'

  def confirm_email(user)
    @user = user
    @confirmation_link = confirmation_url({
      :token => @user.confirmation_token
    })

    mail({
      :to => user.email,
      :bcc => ['sign ups <signups@colcho.net>'],
      :subject => ['signup_mailer.confirm_email.subject']
    })
  end

end


text:
layout: post
title: "Popsugar Must Have Limited Edition Fall 2016 Box Review!"
description: ""
headline: "Popsugar Must Have Limited Edition Fall 2016 Box Review!"
categories:
      - Subscriptions
      - Reviews
tags: [Popsugar Must Have, Subscriptions, Reviews, September 2016]
comments: true
mathjax: null
published: true
featured: false
type: photo
imagefeature: "PopsugarLimitedEditionFall2016Items.jpg"
date: 2016-09-20 10:00:39 -08:00
---

[![Popsugar Must Have Limited Edition Fall 2016](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016Box.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Box:** [Popsugar Must Have](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"} Limited Edition Fall 2016 Box

**Cost:** $100 one time fee + Free Shipping (taxes apply to CA).

**What's in the box:** A special curation with a theme that stretches across fashion and beauty, perfect for the fall season.

[![First look at unboxing](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016OpenBox.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

I love it when the time comes for Popsugar's Limited Edition box to come out every season. Fall is one of my personal favorites so I was super excited when it finally arrived on my doorstep!

The Info Card:

[![Popsugar Limited Edition Fall 2016 Info Card](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016InfoCard.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![Popsugar Limited Edition Fall 2016 Info Card](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016InfoCard02.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

The fold out info card that they include details the items inside the box as well as their values.

And here are the items in the Popsugar Must Have Limited Edition Fall 2016 Box:

[![Popsugar Must Have Limited Edition Fall 2016 Items](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016Items.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

Items in detail:

[![CAEDEN Linea No.1 Faceted Ceramic & Rose Gold Headphones](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016CaedenLineaNo1OnEarHeadphones.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**CAEDEN** Linea No.1 Faceted Ceramic & Rose Gold Headphones, *Value $149.99*

This was revealed to be in the box so I knew I was getting this even before I received it. I was excited when I saw that I'll be getting these pretty headphones, and now I'm more excited to finally use it!

[![CAEDEN Linea No.1 Faceted Ceramic & Rose Gold Headphones](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016CaedenLineaNo1OnEarHeadphones02.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![CAEDEN Linea No.1 Faceted Ceramic & Rose Gold Headphones](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016CaedenLineaNo1OnEarHeadphones03.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

The sound on these headphones are quality, especially for its price. The white and rose gold screams feminine beauty and class, it totally fits my style. There's also buttons to control the volume and track, as well as a mic so you can use this to make or receive calls.

One thing that I was surprised with is how soft the headreset was. I wore it for quite some time while working and I didn't feel any pressure or pain.

[![CAEDEN Linea No.1 Faceted Ceramic & Rose Gold Headphones](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016CaedenLineaNo1OnEarHeadphones04.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

The manual that came with these headphones consisted of pictures and legends. It's pretty straightforward but for some reason, they failed to mention which end plugs into the headphones and which end plugs into your phone. Of course by simply trying to insert it you'll find out which one it is, but I thought it should at least be stated in the manual. FYI, the end that has the rose gold goes to your phone, just like my picture above.

[![Buji Baja Lavender Rib Scarf](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016BujiBajaLavenderScarf.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![Buji Baja Lavender Rib Scarf](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016BujiBajaLavenderScarf02.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Buji Baja** Lavender Rib Scarf, *Value $70*

A scarf is definitely appropriate to include for the Fall season so I wasn't surprised to see that they included this, especially since they tend to include scarves for their Fall or Winter boxes.

[![Buji Baja Lavender Rib Scarf](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016BujiBajaLavenderScarf03.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

This scarf is made of 90% acrylic and 10% mohair. It's soft and the length is perfect to do multiple styles of wraps.

[![Buji Baja Lavender Rib Scarf](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016BujiBajaLavenderScarf04.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![Buji Baja Lavender Rib Scarf](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016BujiBajaLavenderScarf05.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

The scarf also came with a travel card that has tips on how to travel effortlessly, courtesy of EuroStar (a train service in Europe). I personally have used EuroStar for my travels in Europe and their trains are superb. Very classy and comfortable. And these tips are spot on when it comes to traveling in Europe. So if you're headed there, definitely take note from these tips!

[![Jack & Lucy Faux Fur Pom Keychain](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016JackLucyFauxFurPomKeychain.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Jack & Lucy** Faux Fur Pom Keychain, *Value $41*

I love pom keychains, I have quite a few in my collection but I don't have red yet so I'm happy I got this! The fur is medium sized and it has both a ring to insert your keys and a clip to attach to your bag or other accessories.

[![Sloane Stationery Great Thoughts Notepad](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016SloaneStationeryGreatThoughtsNotepad.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Sloane Stationery** Great Thoughts Notepad, *Value $52*

This is one expensive and luxe notepad! It's handmade in England by traditionally trained craftsman with a lizard texture cover and the words "Great Thoughts" embossed in rose gold.

[![Sloane Stationery Great Thoughts Notepad](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016SloaneStationeryGreatThoughtsNotepad02.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![Sloane Stationery Great Thoughts Notepad](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016SloaneStationeryGreatThoughtsNotepad03.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

The notepad opens by lifting the cover vertically, and inside you'll see the lined pages ready for all your great thoughts.

[![Lancer Skincare Dani Glowing Skin Perfector](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016LancerSkincareDaniGlowingSkinPerfector.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Lancer** Skincare Dani Glowing Skin Perfector, *Value $95*

This lightweight cream promises to enhance your skin's natural radiance, blur pore visibility, and boost your skin's firmness. It has youth-building properties that create a natural glow that lasts all day.

[![Thrive Causemetics Triple Threat Color Stick in Joy](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016ThriveCausemeticsTripleThreatColorStickJoy.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

**Thrive Causemetics** Triple Threat Color Stick in Joy, *Value $36*

It's called triple threat because this handy little stick serves as a blush, highlighter and lip color.

[![Thrive Causemetics Triple Threat Color Stick in Joy](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016ThriveCausemeticsTripleThreatColorStickJoy02.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

[![Thrive Causemetics Triple Threat Color Stick in Joy](http://whatsupmailbox.com/images/PopsugarLimitedEditionFall2016ThriveCausemeticsTripleThreatColorStickJoy03.jpg)](http://popsugar-must-have.evyy.net/c/164125/198666/2706){:target="_blank"}

One end has a built-in brush, while the other holds the product. The brush comes in handy when you need to blend the color on your cheeks for that perfect glow or tint. What a nifty little beauty product!

 **My Thoughts:** This box was made for me! It had the right type of products and seasonally appropriate too. The fashion items are on-trend, and the beauty products are quality and useful. A great curation in my book! My favorite has got to be the headphones of course, it's such a statement piece to wear that's also functional, a combo that I need in my technological everyday life. It's so refreshing to get a box once in awhile that totally gets you and your style, and this was definitely it! Plus the total value came to a whopping $444, that's quadruple the cost! This has got to be one of my favorite limited edition boxes from them as of yet. Bravo Popsugar.

This box is a one-time purchase and is no longer available. But they have their monthly boxes for $39.95 and you can <big>subscribe here</big> or go to their website www.musthave.popsugar.com to learn more. Don't forget to use coupon code MUSTHAVE5 to get $5 off your first box!

Want more savings? Use EBATES to get 3% cashback on any purchase at Popsugar, I always use them and get money back!

Popsugar Limited Edition Fall 2016 Items

      Product
      Price

      CAEDEN Linea No.1 Headphones
      $149.99

      Buji Baja Lavender Scarf
      $70

      Jack & Lucy Faux Fur Pom Keychain
      $41

      Sloane Stationery Great Thoughts Notepad
      $52

      Lancer Skincare Dani Glowing Skin Perfector
      $95

      Thrive Causemetics Triple Threat Color Stick
      $36

      <big>TOTAL VALUE</big>
      <big>$443.99</big>

      <big>Box Cost</big>
      <big>$100</big>


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.cocos2dx.simplegame"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:label="@string/app_name" android:debuggable="true" android:icon="@drawable/icon">
        <activity android:name=".SimpleGame"
                  android:label="@string/app_name"
                  android:screenOrientation="landscape"
                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                  android:configChanges="orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <supports-screens android:largeScreens="true"
                      android:smallScreens="true"
                      android:anyDensity="true"
                      android:normalScreens="true"/>
</manifest>


text:
Третье практическое задание
===========================

Создать класс, который в конструкторе получает матрицу `A` и вектор `b`,
заданные списками. Если размерности не совпадают, бросается исключение.

После создания экземпляра класса, должна быть возможность с помощью оператора
индексации получить элемент вектора решения `x[i]`, где `x` - решение системы
линейных алгебраических уравнений `A x = b`. Если индекс `i` задан не в пределах
размерности, должно бросаться исключение.

Для выполнения задания должны быть созданы свои классы исключений.


text:
title: "Authentication"
linkTitle: "Authentication"
weight: 30
date: 2021-07-09
tags:
  - authentication
description: >

---


text:
@(error: String)

@main("Sign In", "user") {

                <button type="button" class="close" data-dismiss="alert">
                    ×
                    Close
                </button>
                @error

Secret Code

            <form class="form-signin" name="myForm" action="/secret" method="POST">

                    Code
                    <input name="code" id="inputCode" type="text" class="form-control" id="messageField" placeholder="Type code here" ng-model="code"/>

                <button type="submit" class="btn btn-primary">Enter code</button>
            </form>

}


text:
package redis.clients.jedis.tests.utils;

public class FailoverAbortedException extends RuntimeException {
    private static final long serialVersionUID = 1925110762858409954L;

    public FailoverAbortedException(String message) {
	super(message);
    }

    public FailoverAbortedException(Throwable cause) {
	super(cause);
    }

    public FailoverAbortedException(String message, Throwable cause) {
	super(message, cause);
    }
}


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

using Xunit;

namespace BeanIO.Parser.Xml.Record
{
    public sealed class XmlRecordTest : XmlParserTest
    {
        private readonly StreamFactory _factory;

        public XmlRecordTest()
        {
            _factory = NewStreamFactory("record_mapping.xml");
        }

        /// <summary>
        /// Test a nillable child bean.
        /// </summary>
        [Fact]
        public void TestRecordClassIsCollection()
        {
            var reader = _factory.CreateReader("stream", LoadReader("r1_in.xml"));

            var s = new StringWriter();
            var writer = _factory.CreateWriter("stream", s);

            try
            {
                var list = Assert.IsType<List<object>>(reader.Read());
                Assert.Collection(
                    list,
                    item => Assert.Equal("John", item),
                    Assert.Null,
                    item => Assert.Equal(22, item));

                writer.Write(list);
                writer.Close();
                Assert.Equal(Load("r1_in.xml"), s.ToString());
            }
            finally
            {
                reader.Close();
            }
        }
    }
}


text:
package de.stephanlindauer.criticalmaps.fragments;

import android.animation.LayoutTransition;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;

import butterknife.Bind;
import butterknife.ButterKnife;
import de.stephanlindauer.criticalmaps.R;

public class RulesFragment extends Fragment {

    private static final String KEY_SCROLLVIEW_POSITION = "scrollview_position";
    private static final String KEY_ACTIVE_PANEL_ID = "active_panel_id";

    private View currentlyShownPanel;

    @Bind(R.id.rules_subcontainer)
    LinearLayout linearLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.fragment_rules, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        prepareButtonToPanel(R.id.btnCorken, R.id.panelCorken);
        prepareButtonToPanel(R.id.btnOncomingTraffic, R.id.panelOncomingTraffic);
        prepareButtonToPanel(R.id.btnSlow, R.id.panelSlow);
        prepareButtonToPanel(R.id.btnBrake, R.id.panelBrake);
        prepareButtonToPanel(R.id.btnFriendly, R.id.panelFriendly);
        prepareButtonToPanel(R.id.btnFun, R.id.panelFun);
        prepareButtonToPanel(R.id.btnGreen, R.id.panelGreen);

        if (savedInstanceState != null) {
            Integer activePanelId = (Integer) savedInstanceState.get(KEY_ACTIVE_PANEL_ID);
            if (activePanelId != null) {
                currentlyShownPanel = findViewById(activePanelId);
                LayoutTransition layoutTransition = linearLayout.getLayoutTransition();
                long durationAppearing = layoutTransition.getDuration(LayoutTransition.APPEARING);
                layoutTransition.setDuration(LayoutTransition.APPEARING, 0);
                currentlyShownPanel.setVisibility(View.VISIBLE);
                layoutTransition.setDuration(LayoutTransition.APPEARING, durationAppearing);
            }

            if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
                final int scrollviewPosition = savedInstanceState.getInt(KEY_SCROLLVIEW_POSITION, 0);

                if (scrollviewPosition != 0) {
                    final ScrollView scrollView = (ScrollView) findViewById(R.id.rules_scrollview);

                    scrollView.post(new Runnable() {
                        public void run() {
                            scrollView.scrollTo(0, scrollviewPosition);
                        }
                    });
                }
            }
        }
    }

    private void prepareButtonToPanel(@IdRes int button, @IdRes int panel) {
        final View panelView = findViewById(panel);
        panelView.setVisibility(View.GONE);
        final PanelShowingOnClickListener onClickListener = new PanelShowingOnClickListener(panelView);
        findViewById(button).setOnClickListener(onClickListener);
    }

    private View findViewById(@IdRes final int resId) {
        return getActivity().findViewById(resId);
    }

    private class PanelShowingOnClickListener implements View.OnClickListener {

        private final View panel;

        private PanelShowingOnClickListener(final View panel) {
            this.panel = panel;
        }

        @Override
        public void onClick(final View v) {
            if (currentlyShownPanel != null) {
                currentlyShownPanel.setVisibility(View.GONE);
            }
            if (currentlyShownPanel == panel) {
                currentlyShownPanel = null;
            } else {
                currentlyShownPanel = panel;
                panel.setVisibility(View.VISIBLE);
            }
        }
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);

        if (currentlyShownPanel != null) {
            outState.putInt(KEY_ACTIVE_PANEL_ID, currentlyShownPanel.getId());
        }
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            outState.putInt(KEY_SCROLLVIEW_POSITION, findViewById(R.id.rules_scrollview).getScrollY());
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
        currentlyShownPanel = null;
    }
}


text:
namespace flutter {

//------------------------------------------------------------------------------
/// @brief      Creates a MTLTexture backed SkSurface and context that can be
///             used to render to in unit-tests.
///
class TestMetalSurface {
 public:
  static bool PlatformSupportsMetal();

  static std::unique_ptr<TestMetalSurface> Create(
      const TestMetalContext& test_metal_context,
      SkISize surface_size = SkISize::MakeEmpty());

  static std::unique_ptr<TestMetalSurface> Create(
      const TestMetalContext& test_metal_context,
      int64_t texture_id,
      SkISize surface_size = SkISize::MakeEmpty());

  virtual ~TestMetalSurface();

  virtual bool IsValid() const;

  virtual sk_sp<GrDirectContext> GetGrContext() const;

  virtual sk_sp<SkSurface> GetSurface() const;

  virtual sk_sp<SkImage> GetRasterSurfaceSnapshot();

  virtual TestMetalContext::TextureInfo GetTextureInfo();

 protected:
  TestMetalSurface();

 private:
  std::unique_ptr<TestMetalSurface> impl_;

  explicit TestMetalSurface(std::unique_ptr<TestMetalSurface> impl);

  FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurface);
};

}  // namespace flutter

#endif  // FLUTTER_TESTING_TEST_METAL_SURFACE_H_


text:
namespace solar {

	float_setting::float_setting(const char* group_name, const char* name, float default_value)
		: setting_template<float>(setting_value_type::INT, group_name, name, default_value) {
	}

	checksum float_setting::get_default_value_checksum() const {
		return checksum().add_float(get_default_value());
	}

	void float_setting::read_from_archive(archive_reader& reader, const char* name) {
		float read_value = 0;
		read_float(reader, name, read_value);
		set_current_value(read_value);
	}

	void float_setting::write_to_archive(archive_writer& writer, const char* name) const {
		write_float(writer, name, get_current_value());
	}

}


text:
<?php
/**
 * 客户端 产品价格 数据类
 * @category iCMS
 * @package iCMS_FrameWork1_RuleClass_DataProvider_Product
 * @author zhangchi
 */
class ProductPriceClientData extends BasePublicData {
    /**
     * 获取产品价格数组通用
     * @param int $productId   产品ID
     * @param string $order 排序方式
     * @param int $topCount 显示的条数
     * @return array  返回查询题目数组
     */
    public function GetList($productId, $order = "", $topCount = null)
    {
        $result = null;

        if ($topCount != null){
            $topCount = " limit " . $topCount;
        }

        else {
            $topCount = "";
        }
        if ($productId > 0) {
            switch ($order) {
                default:
                    $order = " ORDER BY Sort DESC,ProductPriceId ASC";
                    break;
            }
            $sql = "
            SELECT ProductPriceId,ProductId,ProductPriceValue,ProductPriceIntro,ProductCount,ProductUnit,Remark,Sort,State,CreateDate,ManageUserId
            FROM " . self::TableName_ProductPrice . "
            WHERE State=0 AND ProductId=:ProductId"
                . $order
                . $topCount;
            $dataProperty = new DataProperty();
            $dataProperty->AddField("ProductId", $productId);
            $result = $this->dbOperator->GetArrayList($sql, $dataProperty);
        }
        return $result;
    }

    /**
     * 修改库存数量
     * @param int $productPriceId
     * @param int $productCount
     * @return int
     */
    public function ModifyProductCount($productPriceId, $productCount){
        $result = -1;
        if($productPriceId>0){

            if(intval($productCount)<0){
                $productCount = 0;
            }

            $dataProperty = new DataProperty();
            $sql = "UPDATE " . self::TableName_ProductPrice . " SET
                        ProductCount = :ProductCount
                        WHERE ProductPriceId = :ProductPriceId
                        ;";
            $dataProperty->AddField("ProductCount", $productCount);
            $dataProperty->AddField("ProductPriceId", $productPriceId);
            $result = $this->dbOperator->Execute($sql, $dataProperty);

            $cacheDir = CACHE_PATH . DIRECTORY_SEPARATOR . 'product_price_data';
            $cacheFile = 'product_price_get_product_count.cache_' . $productPriceId . '';
            DataCache::Remove($cacheDir . DIRECTORY_SEPARATOR . $cacheFile);

        }
        return $result;
    }

    /**
     * 取得库存数量
     * @param int $productPriceId
     * @param bool $withCache
     * @return int
     */
    public function GetProductCount($productPriceId, $withCache)
    {
        $result = -1;
        if ($productPriceId > 0) {
            $cacheDir = CACHE_PATH . DIRECTORY_SEPARATOR . 'product_price_data';
            $cacheFile = 'product_price_get_product_count.cache_' . $productPriceId . '';
            $sql = "SELECT ProductCount FROM " . self::TableName_ProductPrice . " WHERE ProductPriceId=:ProductPriceId;";
            $dataProperty = new DataProperty();
            $dataProperty->AddField("ProductPriceId", $productPriceId);
            $result = $this->GetInfoOfIntValue($sql, $dataProperty, $withCache, $cacheDir, $cacheFile);
        }
        return $result;
    }

    /**
     * 取得价格
     * @param int $productPriceId
     * @param bool $withCache
     * @return float 价格
     */
    public function GetProductPriceValue($productPriceId, $withCache)
    {
        $result = -1;
        if ($productPriceId > 0) {
            $cacheDir = CACHE_PATH . DIRECTORY_SEPARATOR . 'product_price_data';
            $cacheFile = 'product_price_get_product_price_value.cache_' . $productPriceId . '';
            $sql = "SELECT ProductPriceValue FROM " . self::TableName_ProductPrice . " WHERE ProductPriceId=:ProductPriceId;";
            $dataProperty = new DataProperty();
            $dataProperty->AddField("ProductPriceId", $productPriceId);
            $result = $this->GetInfoOfFloatValue($sql, $dataProperty, $withCache, $cacheDir, $cacheFile);
        }
        return $result;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
					package="com.rubentxu.juegos.android"
					android:screenOrientation="landscape"
					android:versionCode="6"
					android:versionName="1.0.5">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-sdk android:minSdkVersion="6" android:targetSdkVersion="11" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />
	<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:debuggable="true">
		<activity android:screenOrientation="landscape" android:name="DreamsGameActivity"
							android:label="@string/app_name"
							android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
							android:configChanges="keyboard|keyboardHidden|orientation">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>
	</application>
</manifest>


text:
import * as asn1js from "asn1js";
import { getParametersValue, clearProps } from "pvutils";
//**************************************************************************************
/**
 * Class from RFC5280
 */
export default class BasicConstraints
{
	//**********************************************************************************
	/**
	 * Constructor for BasicConstraints class
	 * @param {Object} [parameters={}]
	 * @param {Object} [parameters.schema] asn1js parsed value to initialize the class from
	 * @property {Object} [cA]
	 * @property {Object} [pathLenConstraint]
	 */
	constructor(parameters = {})
	{
		//region Internal properties of the object
		/**
		 * @type {boolean}
		 * @desc cA
		 */
		this.cA = getParametersValue(parameters, "cA", false);

		if("pathLenConstraint" in parameters)
			/**
			 * @type {number|Integer}
			 * @desc pathLenConstraint
			 */
			this.pathLenConstraint = getParametersValue(parameters, "pathLenConstraint", 0);
		//endregion

		//region If input argument array contains "schema" for this object
		if("schema" in parameters)
			this.fromSchema(parameters.schema);
		//endregion
	}
	//**********************************************************************************
	/**
	 * Return default values for all class members
	 * @param {string} memberName String name for a class member
	 */
	static defaultValues(memberName)
	{
		switch(memberName)
		{
			case "cA":
				return false;
			default:
				throw new Error(`Invalid member name for BasicConstraints class: ${memberName}`);
		}
	}
	//**********************************************************************************
	/**
	 * Return value of pre-defined ASN.1 schema for current class
	 *
	 * ASN.1 schema:
	 * ```asn1
	 * BasicConstraints ::= SEQUENCE {
	 *    cA                      BOOLEAN DEFAULT FALSE,
	 *    pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
	 * ```
	 *
	 * @param {Object} parameters Input parameters for the schema
	 * @returns {Object} asn1js schema object
	 */
	static schema(parameters = {})
	{
		/**
		 * @type {Object}
		 * @property {string} [blockName]
		 * @property {string} [cA]
		 * @property {string} [pathLenConstraint]
		 */
		const names = getParametersValue(parameters, "names", {});

		return (new asn1js.Sequence({
			name: (names.blockName || ""),
			value: [
				new asn1js.Boolean({
					optional: true,
					name: (names.cA || "")
				}),
				new asn1js.Integer({
					optional: true,
					name: (names.pathLenConstraint || "")
				})
			]
		}));
	}
	//**********************************************************************************
	/**
	 * Convert parsed asn1js object into current class
	 * @param {!Object} schema
	 */
	fromSchema(schema)
	{
		//region Clear input data first
		clearProps(schema, [
			"cA",
			"pathLenConstraint"
		]);
		//endregion

		//region Check the schema is valid
		const asn1 = asn1js.compareSchema(schema,
			schema,
			BasicConstraints.schema({
				names: {
					cA: "cA",
					pathLenConstraint: "pathLenConstraint"
				}
			})
		);

		if(asn1.verified === false)
			throw new Error("Object's schema was not verified against input data for BasicConstraints");
		//endregion

		//region Get internal properties from parsed schema
		if("cA" in asn1.result)
			this.cA = asn1.result.cA.valueBlock.value;

		if("pathLenConstraint" in asn1.result)
		{
			if(asn1.result.pathLenConstraint.valueBlock.isHexOnly)
				this.pathLenConstraint = asn1.result.pathLenConstraint;
			else
				this.pathLenConstraint = asn1.result.pathLenConstraint.valueBlock.valueDec;
		}
		//endregion
	}
	//**********************************************************************************
	/**
	 * Convert current object to asn1js object and set correct values
	 * @returns {Object} asn1js object
	 */
	toSchema()
	{
		//region Create array for output sequence
		const outputArray = [];

		if(this.cA !== BasicConstraints.defaultValues("cA"))
			outputArray.push(new asn1js.Boolean({ value: this.cA }));

		if("pathLenConstraint" in this)
		{
			if(this.pathLenConstraint instanceof asn1js.Integer)
				outputArray.push(this.pathLenConstraint);
			else
				outputArray.push(new asn1js.Integer({ value: this.pathLenConstraint }));
		}
		//endregion

		//region Construct and return new ASN.1 schema for this object
		return (new asn1js.Sequence({
			value: outputArray
		}));
		//endregion
	}
	//**********************************************************************************
	/**
	 * Convertion for the class to JSON object
	 * @returns {Object}
	 */
	toJSON()
	{
		const object = {};

		if(this.cA !== BasicConstraints.defaultValues("cA"))
			object.cA = this.cA;

		if("pathLenConstraint" in this)
		{
			if(this.pathLenConstraint instanceof asn1js.Integer)
				object.pathLenConstraint = this.pathLenConstraint.toJSON();
			else
				object.pathLenConstraint = this.pathLenConstraint;
		}

		return object;
	}
	//**********************************************************************************
}
//**************************************************************************************


text:
import random
from functools import *
from operator import mul
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.path as mpath
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
import math
import os

edges = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,\
             24,47,48,71,72,95,96,119,120,143,144,167,168,191,192,215,216,\
             239,240,263,264,287,288,311,312,335,336,359,\
             360,361,362,363,364,365,366,367,368,369,370,371,\
             372,373,374,375,376,377,378,379,380,381,382,383,384]
topbottom= [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,\
             360,361,362,363,364,365,366,367,368,369,370,371,\
             372,373,374,375,376,377,378,379,380,381,382,383]

def drawPlate(welldict={}):
    fig, ax = plt.subplots()
    # create 3x3 grid to plot the artists
    grid = np.mgrid[0:1:24j,.7:0:16j].reshape(2, -1,order="F").T

    patches = []
    uniqconstructs = set([welldict[a] for a in welldict])
    numconstructs=len(uniqconstructs)
    colrange=np.linspace(0,1,numconstructs)
    random.shuffle(colrange)
    concolor = {a:b for a,b in zip(uniqconstructs,range(numconstructs))}
    print(concolor)
    colors=plt.cm.rainbow([0]+colrange)

    condiv=0
    #if(constructs>0):
        #condiv=int(384/constructs)
    # add a rectangle
    color=colrange[0]
    #print(len(colors))
    clist=[]
    centroids = [(0,0)]*numconstructs
    pcount = [0]*numconstructs
    for a in range(384):
        i = -1
        try:
            i=concolor[welldict[a]]
            color= colors[i]
        except KeyError:
            color="lightgray"
        if(i>=0):
            centroids[i] = \
                    (centroids[i][0]+grid[a][0],\
                    centroids[i][1]+grid[a][1])
            pcount[i]+=1
        rect = mpatches.Rectangle(grid[a], .6/17, 1/28, \
                                ec="none", fc=color,alpha=.7)
        plt.gca().add_patch(rect)
        #patches.append(rect)
    #label(grid[1], "Rectangle")
    centroids = [(a[0]/b,a[1]/b) for a,b in zip(centroids,pcount)]
    for construct,centpt in zip(uniqconstructs,centroids):
        offset = (len(construct)*.0125)/2
        plt.gca().text(centpt[0]-offset,centpt[1],construct,\
                        bbox={'facecolor':'white','edgecolor':'white',\
                                            'alpha':0.9,'pad':2})
    #colors = np.linspace(0, 1, len(patches))
    collection = PatchCollection(patches,alpha=.3)
    #collection.set_array(np.array(colors))
    #ax.add_collection(collection)
    #ax.add_line(line)

    plt.axis('equal')
    #plt.xlim([0,1.2])
    #plt.ylim([0,.8])
    plt.axis('off')
    #plt.tight_layout()

    plt.show()
def allcomb(listoflists):
    """creates all paths through a list"""
    if(len(listoflists)==1):
        return([[a] for a in listoflists[0]])
    outlist = []
    for element in listoflists[0]:
        for lists in allcomb(listoflists[1:]):
            outlist+=[[element]+lists]
    return outlist

def multid_dilution(inducers,wells,construct,fname,blacklist=[],constructnames = [],inducernames=[],shuffle=False,wellorder="across",draw=True, mypath="."):
    outfile = "Source Plate Name,Source Plate Type,Source Well,    Sample ID,Sample Name,Sample Group,Sample Comment,Destination Plate Name,    Destination Well,Transfer Volume\n"
    suppfile = "Well,Construct,"
    suppfile+= ",".join(inducernames)
    suppfile+= "\n"

    eachline = "Source[1],384PP_AQ_BP,{},,,,,Destination[1],{},{}\n"
    rows = "ABCDEFGHIJKLMNOP"

    columns = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
    wellslist=range(384)
    if(wellorder=="down"):
        wellslist=list(list(np.reshape(np.reshape(wellslist,(16,24)),(1,-1),order="F"))[0])
    wellsused = []
    wellct = 0
    wlist={}
    for con in construct:
        curconname = constructnames[construct.index(con)]
        wellct = rows.index(con[0])*len(columns)+columns.index(int(con[1:])) #this starts the
        #print(wellct)
        #print(wellslist)

        wellind = wellslist.index(wellct)

        #well counter at the right row, in the leftmost column
        #if(wellorder=="down"):
        #    wellct = rows.index(con[0])*len(columns)+columns.index(int(con[1:]))
        controlwell = [[0]*len(inducers)]

        acomb = allcomb(inducers)
        if(not controlwell in acomb):
            #you should really do some un-induced controls!!
            acomb+=controlwell

        if(shuffle):
            random.shuffle(acomb)
        #print(acomb[:15])
        iterct = reduce(mul,[len(a) for a in inducers],1) #this is the number of wells per construct
        lensum = sum([len(a) for a in inducers])
        ict2 = 0
        conwells=[]
        for iteration in acomb:
            while(wellslist[wellind] in blacklist):
                wellind+=1#moves over the current well if it is in the blacklist
            wellct=wellslist[wellind]
            colct = wellct%len(columns) #deciphering the well number to column and rows
            rowct = int(wellct/len(columns))
            wellstr = rows[rowct]+str(columns[colct])
            #print(iteration)
            suppfile+= ",".join([wellstr,curconname]+[str(a) for a in iteration])+"\n"

            #each comination of volumes is a list
            #where each element corresponds to an inducer
            for ind_i in range(len(iteration)):
                #this goes through every inducer and
                #tells the echo to pipet it.

                #print(rowct)
                #print(colct)

                if(iteration[ind_i]>0):
                    #don't tell the echo to pipet zero nl!
                    indname = inducernames[ind_i]

                    usewell = wells[ind_i]
                    if(type(usewell)==list):
                        #if we have multiple sources, randomly pick one of them!
                        usewell = random.choice(usewell)
                    outfile += eachline.format(usewell,wellstr,iteration[ind_i])
            #even 0,0 will be marked as used. This is good!
            wellsused+=[wellct]
            conwells+=[wellct]
            wlist.update({wellct:curconname})

            wellind+=1#here is where we just go along left to right, top to bottom
        #wlist+=[conwells]
    if(draw):
        drawPlate(wlist)
    outfle = open(os.path.join(mypath,fname),"w")
    outfle.write(outfile)
    outfle.close()
    print("wrote "+os.path.join(mypath,fname))
    supfleout= open(os.path.join(mypath,"supp_"+fname),"w")
    supfleout.write(suppfile)
    supfleout.close()
    print("wrote "+os.path.join(mypath,"supp_"+fname))
    return wellsused
def multid_dilution_wrapper(inducers,constructs,fname,avoidedges=[],maxinducer=500,\
                wellvol=50,shuffle=False,wellorder="across",mypath=".",start=None):
    """this function contains some helpful pre-sets for doing multiple
    inducer sweeps in a 384 well plate.
    inducers:
    this is a list of lists that looks like this:
    [ ["name",[int(amount1),int(amount2)],["well",number of wells]]]

    "name"
    is the name of the inducer. for example, "ATC" or "ARA"

    amount1, amount2
    are the percent of the 'maxinducer' volume to add. for
    example, if you put '50', that means 50 percent of the max inducer volume
    (which is default 500), so the echo will add 250 nl of that inducer.

    "well" is the well where your inducers will start, in the source plate.
    You will need about 220 ul to populate an entire 384 well plate which does
    not fit into one source plate well. This is why we usually do many source
    plate wells. The first of these is denoted by "well", and the rest are placed
    vertically downwards in the plate. For example if you put "K1" here, you also
    need to put inducer into wells "L1","M1", and "N1", or more or less wells in
    a vertical column as determined by the number given by 'number of wells.'

    constructs:

    This is a list of strings that denote the names of the different constructs
    you are going to use. Each construct gets the same array of inducers.

    fname:

    this is the name of the file you want to make. Usually "date.csv". The program
    also makes "supp_<fname>" as a supplementary data file used with the biotek analysis
    package.

    avoidedges:

    a list of numbers indicating which wells to avoid. Use the two predifined lists
    called "edges" or "topbottom" to block out all edge wells or the top and bottom rows

    maxinducer:

    "100%" volume of inducer to add. Usually 500 nl so it's 100x diluted into the
    50 uL culture volume.

    wellvol:

    culture volume

    shuffle:

    True means that the wells which recieve different inducer concentrations Will
    be randomly distributed within the set of wells set aside for each construct.

    wellorder:

    "across" means lettered rows from left to right. A1 -> A2 -> A3 etc
    "down" means columns down (letters in order) then left to right. So, A1 -> B1
    ->->A2 -> B2 etc.
    """
    if(avoidedges==edges):
        #print("edges")
        if(start==None):
             start="B2"
        rows=14
        cols=22
    elif(avoidedges==topbottom):
        if(start==None):
             start="B1"
        rows=14
        cols=24
    else:
        if(start==None):
             start="A1"
        rows=16
        cols=24
    #divideplate=int(rows/len(constructs))
    conwells=[]
    if(wellorder=="across"):
        divideplate=math.ceil(rows/len(constructs))
        while(divideplate*len(constructs)>rows):
            divideplate-=1
        for i in range(len(constructs)):
            conwells+=[chr(ord(start[0])+divideplate*i)+start[1:]]
    else:
        divideplate=math.ceil(cols/len(constructs))
        while(divideplate*len(constructs)>cols):
            divideplate-=1
        for i in range(len(constructs)):
            conwells+=[start[0]+str(int(start[1:])+divideplate*i)]

    indonly=[a[0] for a in inducers]
    volonly=[[int(b*maxinducer/100) for b in a[1]] for a in inducers]
    sourceonly=[]
    for src in [a[2] for a in inducers]:
        allwells=[]
        for i in range(src[1]):
            allwells+=[chr(ord(src[0][0])+i)+src[0][1:]]
        sourceonly+=[allwells]
    print("load inducers into: ")
    for ind,amts in zip(indonly,sourceonly):
        print("{} : {}".format(ind,str(amts)))
    print()
    inducervol=50*len(sourceonly[0])*1.1
    print("make %02f ul of 100x each inducer"%(inducervol))
    print()
    print("constructs start at: ")
    for cname,cwell in zip(constructs,conwells):
        print("{} : {}".format(cname,str(cwell)))
    print("prepare {} ml of each construct for {} well volume".format(int(wellvol*1.1*384/len(constructs))/1000,wellvol))
    return multid_dilution(volonly,sourceonly,conwells,fname,avoidedges,constructs,indonly,shuffle,wellorder=wellorder,mypath=mypath)


text:
name 'yum-epel'
maintainer 'Chef'
maintainer_email 'Sean OMeara <someara@getchef.com>'
license 'Apache 2.0'
description 'Installs/Configures yum-epel'
version '0.5.2'

depends 'yum', '~> 3.0'

supports 'redhat'
supports 'centos'
supports 'scientific'
supports 'amazon'


text:
const router = require('./facebook.router')

module.exports.init = function facebookResourceInit (app) {
    app
        .use(router.routes())
        .use(router.allowedMethods())
}


text:
.class public interface abstract Lcom/payu/android/sdk/shade/com/google/gson/JsonDeserializer;
.super Ljava/lang/Object;

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:Ljava/lang/Object;>Ljava/lang/Object;"
    }
.end annotation

# virtual methods
.method public abstract deserialize(Lcom/payu/android/sdk/shade/com/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/payu/android/sdk/shade/com/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/payu/android/sdk/shade/com/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/payu/android/sdk/shade/com/google/gson/JsonDeserializationContext;)TT;"
        }
    .end annotation
.end method


text:
<?php
namespace Avenue;

use Avenue\App;
use Avenue\Controller;
use Avenue\Interfaces\RouteInterface;

class Route implements RouteInterface
{
    /**
     * App class instance.
     *
     * @var \Avenue\App
     */
    protected $app;

    /**
     * The route rule.
     *
     * @var mixed
     */
    protected $rule;

    /**
     * The actual matched rule regular expression.
     *
     * @var mixed
     */
    protected $ruleRegex;

    /**
     * The route filters.
     *
     * @var array
     */
    protected $filters = [];

    /**
     * The route params.
     *
     * @var array
     */
    protected $params = [];

    /**
     * Flag to indicate route is fulfullied.
     *
     * @var boolean
     */
    protected $fulfill = false;

    /**
     * Current http path info.
     *
     * @var mixed
     */
    protected $pathInfo;

    /**
     * @var Route's regular expression patterns to be matched.
     */
    protected $regex = [
        ':alnum'    => '([a-zA-Z0-9-]+)',
        ':alpha'    => '([a-zA-Z]+)',
        ':lower'    => '([a-z]+)',
        ':lowernum' => '([a-z0-9-]+)',
        ':upper'    => '([A-Z]+)',
        ':uppernum' => '([A-Z0-9-]+)',
        ':digit'    => '([0-9]+)'
    ];

    /**
     * Route class constructor.
     *
     * @param App $app
     */
    public function __construct(App $app)
    {
        $this->app = $app;
    }

    /**
     * Dispatch route's rule and arguments for matching.
     *
     * @param array $args
     */
    public function dispatch(array $args)
    {
        if (count($args) !== 2) {
            throw new \InvalidArgumentException('Route method is expecting two arguments.');
        }

        if (!$this->app->arrIsAssoc($args[1])) {
            throw new \InvalidArgumentException('Invalid data type. Second argument must be associative array.');
        }

        $this->rule = $args[0];
        $this->filters = $args[1];

        if ($this->fulfill = $this->matchRoute()) {
            $this->setRouteParams()->initController();
        }
    }

    /**
     * Match the route URI with regular expression.
     * Return `true` if the particular route is matched.
     *
     * @return boolean
     */
    public function matchRoute()
    {
        // replace with the regexp patterns
        $this->ruleRegex = strtr(strtr($this->rule, $this->filters), $this->regex);
        $this->ruleRegex = '#^/?' . str_replace(')', ')?', $this->ruleRegex) . '/?$#';
        $this->pathInfo = $this->app->request()->getPathInfo();

        return preg_match($this->ruleRegex, $this->pathInfo);
    }

    /**
     * Set respective route params with actual value.
     *
     * @return \Avenue\Route
     */
    public function setRouteParams()
    {
        $fs = '/';
        $arrRule = [];
        $arrPathInfo = [];
        $this->rule = str_replace(')', '', str_replace('(', '', $this->rule));

        if (strpos($this->rule, $fs) !== false && strpos($this->pathInfo, $fs) !== false) {
            $arrRule = explode($fs, $this->rule);
            $arrPathInfo = explode($fs, $this->pathInfo);
        }

        foreach ($this->filters as $token => $regx) {
            if (substr($token, 0, 1) === '@') {
                $key = substr($token, 1, strlen($token));

                // replaced with the actual value, if found any in the matched rule
                if (in_array($token, $arrRule)) {
                    $index = array_search($token, $arrRule);

                    isset($arrPathInfo[$index])
                    ? $this->setParam($key, $arrPathInfo[$index])
                    : $this->setParam($key, null);
                } else {
                    $this->setParam($key, null);
                }
            }
        }

        $this->setDefaultRouteParams();
        return $this;
    }

    /**
     * Check and reset respective default route params if not provided or exist.
     *
     * @return \Avenue\Route
     */
    public function setDefaultRouteParams()
    {
        // set default prefix if empty
        if (empty($this->getParams('prefix'))) {
            $this->setParam('prefix', '');
        }

        // set default controller if empty
        if (empty($this->getParams('controller'))) {
            $this->setParam('controller', $this->app->getDefaultController());
        }

        // set default action if empty
        if (empty($this->getParams('action'))) {
            $this->setParam('action', Controller::DEFAULT_ACTION);
        }

        // proceed to resource mapping if token exist
        if (!isset($this->filters['@resource'])) {
            $this->setParam('resource', false);
        } else {
            $this->mapResourceMethod();
        }

        return $this;
    }

    /**
     * Check against resource token in route's filter and,
     * overwrite the controller action based on the http request method
     * when resource token is true or targeted controller is matched.
     *
     * example of @resource token format:
     *
     * @resource => true (applied to any controllers that fulfilled the route mapping)
     * @resource => 'default' (only applied to 'DefaultController' class)
     * @resource => 'default|dummy' (only applied to 'DefaultController' and 'DummyController' classes)
     */
    public function mapResourceMethod()
    {
        $delimiter = '|';
        $controller = $this->getParams('controller');
        $requestMethod = $this->app->request()->getRequestMethod(true);

        $resource = $this->filters['@resource'];
        $this->setParam('resource', $resource);

        // if true or with targeted controller
        if ($resource === true || (!strpos($resource, $delimiter) && $resource === $controller)) {
            $this->setParam('action', $requestMethod);
            return;
        }

        // if more than one controller
        if (strpos($resource, $delimiter) !== false) {
            $arrControllers = explode($delimiter, $resource);
            $filteredArrControllers = array_values(array_filter($arrControllers));

            if (count($arrControllers) !== count($filteredArrControllers)) {
                throw new \InvalidArgumentException(
                    sprintf('Invalid format of @resource token value [%s]!', $resource)
                );
            }

            if (in_array($controller, $arrControllers)) {
                $this->setParam('action', $requestMethod);
            }
        }
    }

    /**
     * Get the controller namespace and do the instantiation.
     *
     * @return object
     */
    public function initController()
    {
        $controllerNamespace = $this->buildControllerNamespace();
        $this->setParam('namespace', $controllerNamespace);

        // throw exception if no controller class found
        if (!class_exists($controllerNamespace)) {
            throw new \RuntimeException(sprintf('Controller [%s] not found.', $controllerNamespace), 404);
        }

        // check if controller class has parent controller
        if (!isset(class_parents($controllerNamespace)[Controller::class])) {
            throw new \RuntimeException('Controller must be extending the base controller!', 400);
        }

        return new $controllerNamespace($this->app);
    }

    /**
     * Build the controller namespace for the matched route.
     * If no controller is specified, the default controller will always be used.
     *
     * @return string
     */
    public function buildControllerNamespace()
    {
        $fs = '/';
        $bs = '\\';
        $namespace = '';
        $prefix = $this->getParams('prefix');
        $controller = $this->getParams('controller');
        $controller = ucfirst($controller . Controller::CONTROLLER_SUFFIX);

        // check prefix
        if (!empty($prefix)) {
            if (strpos($prefix, $fs) !== false) {
                $namespace .= implode($bs, array_map('ucfirst', explode($fs, $prefix))) . $bs;
            } else {
                $namespace .= ucfirst($prefix) . $bs;
            }
        }

        $namespace .= $controller;
        return Controller::NAMESPACE_PREFIX . $bs . $namespace;
    }

    /**
     * Set the particular URI token with a value.
     *
     * @param mixed $key
     * @param mixed $value
     */
    public function setParam($key, $value)
    {
        return $this->params[$key] = urldecode($value);
    }

    /**
     * Get the particular token value based on the key.
     * Return all params if key is not provided.
     *
     * @param mixed $key
     */
    public function getParams($key = null)
    {
        if (empty($key)) {
            return $this->params;
        }

        return $this->app->arrGet($key, $this->params, null);
    }

    /**
     * Check if particular route is fulfilled.
     */
    public function isFulfilled()
    {
        return $this->fulfill;
    }

    /**
     * Get the matched rule's regular expression.
     *
     * @return mixed
     */
    public function getMatchedRuleRegexp()
    {
        return $this->ruleRegex;
    }
}


text:
#ifndef SKY_ENGINE_WEB_WEBVIEWIMPL_H_
#define SKY_ENGINE_WEB_WEBVIEWIMPL_H_

#include "sky/engine/core/rendering/HitTestResult.h"
#include "sky/engine/platform/geometry/IntPoint.h"
#include "sky/engine/platform/geometry/IntRect.h"
#include "sky/engine/platform/graphics/Color.h"
#include "sky/engine/public/platform/WebInputEvent.h"
#include "sky/engine/public/platform/WebLayer.h"
#include "sky/engine/public/platform/WebPoint.h"
#include "sky/engine/public/platform/WebRect.h"
#include "sky/engine/public/platform/WebSize.h"
#include "sky/engine/public/platform/WebString.h"
#include "sky/engine/public/web/WebNavigationPolicy.h"
#include "sky/engine/public/web/WebView.h"
#include "sky/engine/web/ChromeClientImpl.h"
#include "sky/engine/web/EditorClientImpl.h"
#include "sky/engine/web/SpellCheckerClientImpl.h"
#include "sky/engine/wtf/OwnPtr.h"
#include "sky/engine/wtf/RefCounted.h"
#include "sky/engine/wtf/Vector.h"

namespace blink {

class Frame;
class WebLocalFrameImpl;
class WebImage;
class WebSettingsImpl;
class Page;

class WebViewImpl final : public WebView, public RefCounted<WebViewImpl> {
public:
    static WebViewImpl* create(WebViewClient*);

    // WebWidget methods:
    virtual void close() override;
    virtual WebSize size() override;

    virtual void resize(const WebSize&) override;

    virtual void beginFrame(const WebBeginFrameArgs&) override;

    virtual void layout() override;
    virtual void paint(WebCanvas*, const WebRect&) override;
    virtual bool handleInputEvent(const WebInputEvent&) override;
    virtual void setFocus(bool enable) override;
    virtual bool setComposition(
        const WebString& text,
        const WebVector<WebCompositionUnderline>& underlines,
        int selectionStart,
        int selectionEnd) override;
    virtual bool confirmComposition() override;
    virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior) override;
    virtual bool confirmComposition(const WebString& text) override;
    virtual WebTextInputInfo textInputInfo() override;

    // WebView methods:
    virtual void setMainFrame(WebFrame*) override;
    virtual void injectModule(const WebString&) override;
    virtual void setSpellCheckClient(WebSpellCheckClient*) override;
    virtual WebSettings* settings() override;
    virtual bool isTransparent() const override;
    virtual void setIsTransparent(bool value) override;
    virtual void setBaseBackgroundColor(WebColor) override;
    virtual bool isActive() const override;
    virtual void setIsActive(bool value) override;
    virtual WebFrame* mainFrame() override;
    virtual WebFrame* focusedFrame() override;
    virtual void setFocusedFrame(WebFrame*) override;
    virtual void setInitialFocus(bool reverse) override;
    virtual void clearFocusedElement() override;
    virtual void advanceFocus(bool reverse) override;

    virtual float deviceScaleFactor() const override;
    virtual void setDeviceScaleFactor(float) override;

    virtual void spellingMarkers(WebVector<uint32_t>* markers) override;
    virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& words) override;

    virtual void setShowPaintRects(bool) override;
    void setShowDebugBorders(bool);

    virtual void acceptLanguagesChanged() override;

    // WebViewImpl
    void setBackgroundColorOverride(WebColor);

    Color baseBackgroundColor() const { return m_baseBackgroundColor; }

    LocalFrame* focusedCoreFrame() const;

    // Returns the currently focused Element or null if no element has focus.
    Element* focusedElement() const;

    static WebViewImpl* fromPage(Page*);

    WebViewClient* client()
    {
        return m_client;
    }

    WebSpellCheckClient* spellCheckClient()
    {
        return m_spellCheckClient;
    }

    // Returns the page object associated with this view. This may be null when
    // the page is shutting down, but will be valid at all other times.
    Page* page() const
    {
        return m_page.get();
    }

    // Returns the main frame associated with this view. This may be null when
    // the page is shutting down, but will be valid at all other times.
    WebLocalFrameImpl* mainFrameImpl();

    // Notifies the WebView that a load has been committed. isNewNavigation
    // will be true if a new session history item should be created for that
    // load. isNavigationWithinPage will be true if the navigation does
    // not take the user away from the current page.
    void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage);

    void updateMainFrameLayoutSize();

    void scheduleVisualUpdate();

    virtual void setVisibilityState(WebPageVisibilityState, bool) override;

    // Exposed for the purpose of overriding device metrics.
    void sendResizeEventAndRepaint();

    WebSettingsImpl* settingsImpl();

    IntPoint clampOffsetAtScale(const IntPoint& offset, float scale);

    // Exposed for tests.
    WebVector<WebCompositionUnderline> compositionUnderlines() const;

    bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_matchesHeuristicsForGpuRasterization; }

private:
    IntSize contentsSize() const;

    void performResize();

    friend class WebView;  // So WebView::Create can call our constructor
    friend class WTF::RefCounted<WebViewImpl>;
    friend void setCurrentInputEventForTest(const WebInputEvent*);

    enum DragAction {
      DragEnter,
      DragOver
    };

    explicit WebViewImpl(WebViewClient*);
    virtual ~WebViewImpl();

    WebTextInputType textInputType();
    int textInputFlags();

    WebString inputModeOfFocusedElement();

    bool confirmComposition(const WebString& text, ConfirmCompositionBehavior);

    // Converts |pos| from window coordinates to contents coordinates and gets
    // the HitTestResult for it.
    HitTestResult hitTestResultForWindowPos(const IntPoint&);

    void doComposite();
    void reallocateRenderer();

    WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.)
    WebSpellCheckClient* m_spellCheckClient;

    ChromeClientImpl m_chromeClientImpl;
    EditorClientImpl m_editorClientImpl;
    SpellCheckerClientImpl m_spellCheckerClientImpl;

    WebSize m_size;
    bool m_fixedLayoutSizeLock;

    OwnPtr<Page> m_page;

    // An object that can be used to manipulate m_page->settings() without linking
    // against WebCore. This is lazily allocated the first time GetWebSettings()
    // is called.
    OwnPtr<WebSettingsImpl> m_webSettings;

    WebSize m_rootLayerOffset;
    float m_rootLayerScale;

    // Webkit expects keyPress events to be suppressed if the associated keyDown
    // event was handled. Safari implements this behavior by peeking out the
    // associated WM_CHAR event if the keydown was handled. We emulate
    // this behavior by setting this flag if the keyDown was handled.
    bool m_suppressNextKeypressEvent;

    // Represents whether or not this object should process incoming IME events.
    bool m_imeAcceptEvents;

    // Whether the webview is rendering transparently.
    bool m_isTransparent;

    WebLayer* m_rootLayer;
    bool m_matchesHeuristicsForGpuRasterization;
    // If true, the graphics context is being restored.
    bool m_recreatingGraphicsContext;
    static const WebInputEvent* m_currentInputEvent;

    WebPoint m_positionOnFlingStart;
    WebPoint m_globalPositionOnFlingStart;
    int m_flingModifier;
    bool m_flingSourceDevice;

    bool m_showPaintRects;
    bool m_showDebugBorders;
    WebColor m_baseBackgroundColor;
    WebColor m_backgroundColorOverride;
};

// We have no ways to check if the specified WebView is an instance of
// WebViewImpl because WebViewImpl is the only implementation of WebView.
DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);

} // namespace blink

#endif  // SKY_ENGINE_WEB_WEBVIEWIMPL_H_


text:
<?php

namespace JsonSchema\Constraints\TypeCheck;

interface TypeCheckInterface
{
    public static function isObject($value);

    public static function isArray($value);

    public static function propertyGet($value, $property);

    public static function propertyExists($value, $property);

    public static function propertyCount($value);
}


text:
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.toolWindow;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.ex.ToolWindowManagerListener;
import com.intellij.openapi.wm.impl.IdeFrameImpl;
import com.intellij.openapi.wm.impl.ProjectFrameHelper;
import com.intellij.openapi.wm.impl.ToolWindowManagerImpl;
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
import com.intellij.testFramework.ServiceContainerUtil;
import com.intellij.testFramework.SkipInHeadlessEnvironment;

/**
 * @author Dmitry Avdeev
 */
@SkipInHeadlessEnvironment
public abstract class ToolWindowManagerTestCase extends LightPlatformCodeInsightTestCase {
  protected ToolWindowManagerImpl manager;

  @Override
  public void setUp() throws Exception {
    super.setUp();

    Project project = getProject();
    manager = new ToolWindowManagerImpl(project) {
      @Override
      protected void fireStateChanged(ToolWindowManagerListener.ToolWindowManagerEventType changeType) {
      }
    };
    ServiceContainerUtil.replaceService(project, ToolWindowManager.class, manager, getTestRootDisposable());

    ProjectFrameHelper frame = new ProjectFrameHelper(new IdeFrameImpl(), null);
    frame.init();
    manager.doInit(frame, project.getMessageBus().connect(getTestRootDisposable()));
  }

  @Override
  public void tearDown() throws Exception {
    try {
      manager.projectClosed();
      manager = null;
    }
    catch (Throwable e) {
      addSuppressedException(e);
    }
    finally {
      super.tearDown();
    }
  }
}


text:
/*jslint node: true, indent: 2, passfail: true, continue: true */

module.exports = (function () {
  "use strict";

  var util = require('util'),
    FilterIteratorBase = require('./filterbase'),
    Iterable = require('../core/iterable');

  function TakeWhileIterator(test, iterable) {

    FilterIteratorBase.call(this, test, iterable);

  }
  util.inherits(TakeWhileIterator, FilterIteratorBase);

  TakeWhileIterator.prototype.test = function test(resolve, reject, value, pass) {

    if (!pass) {
      this.stop();
      this.iter(resolve, reject);
      return undefined;
    }

    resolve(value);

  };

  function TakeWhileIterable(test, iterable) {

    Iterable.call(this);
    this.source = iterable;
    this.test = test;

  }
  util.inherits(TakeWhileIterable, Iterable);

  TakeWhileIterable.prototype.iterator = function iterator() {

    return new TakeWhileIterator(this.test, this.source);

  };

  return TakeWhileIterable;

}());


text:
require 'spec_helper'
require 'puppet/daemon'
require 'puppet/agent'

def without_warnings
  flag = $VERBOSE
  $VERBOSE = nil
  yield
  $VERBOSE = flag
end

class TestClient
  def lockfile_path
    "/dev/null"
  end
end

describe Puppet::Daemon, :unless => Puppet.features.microsoft_windows? do
  include PuppetSpec::Files

  class RecordingScheduler
    attr_reader :jobs

    def run_loop(jobs)
      @jobs = jobs
    end
  end

  let(:server) { stub("Server", :start => nil, :wait_for_shutdown => nil) }
  let(:agent) { Puppet::Agent.new(TestClient.new, false) }

  let(:pidfile) { stub("PidFile", :lock => true, :unlock => true, :file_path => 'fake.pid') }
  let(:scheduler) { RecordingScheduler.new }

  let(:daemon) { Puppet::Daemon.new(pidfile, scheduler) }

  before do
    daemon.stubs(:close_streams).returns nil
  end

  it "should reopen the Log logs when told to reopen logs" do
    Puppet::Util::Log.expects(:reopen)
    daemon.reopen_logs
  end

  let(:server) { stub("Server", :start => nil, :wait_for_shutdown => nil) }

  describe "when setting signal traps" do
    signals = {:INT => :stop, :TERM => :stop }
    signals.update({:HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs}) unless Puppet.features.microsoft_windows?
    signals.each do |signal, method|
      it "should log and call #{method} when it receives #{signal}" do
        Signal.expects(:trap).with(signal).yields

        Puppet.expects(:notice)

        daemon.set_signal_traps
      end
    end
  end

  describe "when starting" do
    before do
      daemon.stubs(:set_signal_traps)
    end

    it "should fail if it has neither agent nor server" do
      expect { daemon.start }.to raise_error(Puppet::DevError)
    end

    it "should create its pidfile" do
      pidfile.expects(:lock).returns(true)

      daemon.agent = agent
      daemon.start
    end

    it "should fail if it cannot lock" do
      pidfile.expects(:lock).returns(false)
      daemon.agent = agent

      expect { daemon.start }.to raise_error(RuntimeError, "Could not create PID file: #{pidfile.file_path}")
    end

    it "should start its server if one is configured" do
      daemon.server = server

      server.expects(:start)

      daemon.start
    end

    it "disables the reparse of configs if the filetimeout is 0" do
      Puppet[:filetimeout] = 0
      daemon.agent = agent

      daemon.start

      scheduler.jobs[0].should_not be_enabled
    end

    it "disables the agent run when there is no agent" do
      Puppet[:filetimeout] = 0
      daemon.server = server

      daemon.start

      scheduler.jobs[1].should_not be_enabled
    end

    it "waits for the server to shutdown when there is one" do
      daemon.server = server

      server.expects(:wait_for_shutdown)

      daemon.start
    end

    it "waits for the server to shutdown when there is one" do
      daemon.server = server

      server.expects(:wait_for_shutdown)

      daemon.start
    end
  end

  describe "when stopping" do
    before do
      Puppet::Util::Log.stubs(:close_all)
      # to make the global safe to mock, set it to a subclass of itself,
      # then restore it in an after pass
      without_warnings { Puppet::Application = Class.new(Puppet::Application) }
    end

    after do
      # restore from the superclass so we lose the stub garbage
      without_warnings { Puppet::Application = Puppet::Application.superclass }
    end

    it "should stop its server if one is configured" do
      server.expects(:stop)

      daemon.server = server

      expect { daemon.stop }.to exit_with 0
    end

    it 'should request a stop from Puppet::Application' do
      Puppet::Application.expects(:stop!)
      expect { daemon.stop }.to exit_with 0
    end

    it "should remove its pidfile" do
      pidfile.expects(:unlock)

      expect { daemon.stop }.to exit_with 0
    end

    it "should close all logs" do
      Puppet::Util::Log.expects(:close_all)
      expect { daemon.stop }.to exit_with 0
    end

    it "should exit unless called with ':exit => false'" do
      expect { daemon.stop }.to exit_with 0
    end

    it "should not exit if called with ':exit => false'" do
      daemon.stop :exit => false
    end
  end

  describe "when reloading" do
    it "should do nothing if no agent is configured" do
      daemon.reload
    end

    it "should do nothing if the agent is running" do
      agent.expects(:running?).returns true

      daemon.agent = agent

      daemon.reload
    end

    it "should run the agent if one is available and it is not running" do
      agent.expects(:running?).returns false
      agent.expects(:run).with({:splay => false})

      daemon.agent = agent

      daemon.reload
    end
  end

  describe "when restarting" do
    before do
      without_warnings { Puppet::Application = Class.new(Puppet::Application) }
    end

    after do
      without_warnings { Puppet::Application = Puppet::Application.superclass }
    end

    it 'should set Puppet::Application.restart!' do
      Puppet::Application.expects(:restart!)
      daemon.stubs(:reexec)
      daemon.restart
    end

    it "should reexec itself if no agent is available" do
      daemon.expects(:reexec)

      daemon.restart
    end

    it "should reexec itself if the agent is not running" do
      agent.expects(:running?).returns false
      daemon.agent = agent
      daemon.expects(:reexec)

      daemon.restart
    end
  end

  describe "when reexecing it self" do
    before do
      daemon.stubs(:exec)
      daemon.stubs(:stop)
    end

    it "should fail if no argv values are available" do
      daemon.expects(:argv).returns nil
      lambda { daemon.reexec }.should raise_error(Puppet::DevError)
    end

    it "should shut down without exiting" do
      daemon.argv = %w{foo}
      daemon.expects(:stop).with(:exit => false)

      daemon.reexec
    end

    it "should call 'exec' with the original executable and arguments" do
      daemon.argv = %w{foo}
      daemon.expects(:exec).with($0 + " foo")

      daemon.reexec
    end
  end
end


text:
package com.github.vedunz.difftool.control;

import com.github.vedunz.difftool.diff.DiffResult;
import com.github.vedunz.difftool.diff.LineDiffService;
import com.github.vedunz.difftool.ui.VersionManager;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by vedun on 26.07.2017.
 */
public class LineDiffController {

    private final ExecutorService executorService = Executors.newSingleThreadExecutor();
    private final LineDiffService diffService = LineDiffService.createDefaultDiffService();
    private final VersionManager versionManager;
    private final List<LineDiffConsumer> lineDiffConsumerList = new ArrayList<>();

    public LineDiffController(VersionManager versionManager) {
        this.versionManager = versionManager;
    }

    public void addLineDiffConsumer(LineDiffConsumer lineDiffConsumer) {
        lineDiffConsumerList.add(lineDiffConsumer);
    }

    public void removeLineDiffConsumer(LineDiffConsumer lineDiffConsumer) {
        lineDiffConsumerList.remove(lineDiffConsumer);
    }

    public void requestDiff(String firstLine, String secondLine, int firstLineNo, int secondLineNo) {
        long currentVersion = versionManager.getVersion();
        executorService.submit(() -> {
            if (currentVersion != versionManager.getVersion())
                return;
            DiffResult results = diffService.getDiffResult(firstLine, secondLine);
            SwingUtilities.invokeLater(() -> {
                if (currentVersion == versionManager.getVersion()) {
                    for (LineDiffConsumer lineDiffConsumer : lineDiffConsumerList) {
                        lineDiffConsumer.updateDiffResult(results, firstLineNo, secondLineNo);
                    }
                }
            });
        });
    }

}


text:
package org.apache.ibatis.submitted.awful_table;

public class AwfulTable {
    private Integer customerId;
    private String firstFirstName;
    private String secondFirstName;
    private String thirdFirstName;
    private String lastName;
    private String eMail;
    private Integer id1;
    private Integer id2;
    private Integer id5;
    private Integer id6;
    private Integer id7;
    private String emailaddress;
    private String from;
    private boolean active;
    public Integer getCustomerId() {
        return customerId;
    }
    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }
    public String getFirstFirstName() {
        return firstFirstName;
    }
    public void setFirstFirstName(String firstFirstName) {
        this.firstFirstName = firstFirstName;
    }
    public String getSecondFirstName() {
        return secondFirstName;
    }
    public void setSecondFirstName(String secondFirstName) {
        this.secondFirstName = secondFirstName;
    }
    public String getThirdFirstName() {
        return thirdFirstName;
    }
    public void setThirdFirstName(String thirdFirstName) {
        this.thirdFirstName = thirdFirstName;
    }
    public String getLastName() {
        return lastName;
    }
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    public String geteMail() {
        return eMail;
    }
    public void seteMail(String eMail) {
        this.eMail = eMail;
    }
    public Integer getId1() {
        return id1;
    }
    public void setId1(Integer id1) {
        this.id1 = id1;
    }
    public Integer getId2() {
        return id2;
    }
    public void setId2(Integer id2) {
        this.id2 = id2;
    }
    public Integer getId5() {
        return id5;
    }
    public void setId5(Integer id5) {
        this.id5 = id5;
    }
    public Integer getId6() {
        return id6;
    }
    public void setId6(Integer id6) {
        this.id6 = id6;
    }
    public Integer getId7() {
        return id7;
    }
    public void setId7(Integer id7) {
        this.id7 = id7;
    }
    public String getEmailaddress() {
        return emailaddress;
    }
    public void setEmailaddress(String emailaddress) {
        this.emailaddress = emailaddress;
    }
    public String getFrom() {
        return from;
    }
    public void setFrom(String from) {
        this.from = from;
    }
    public boolean isActive() {
        return active;
    }
    public void setActive(boolean active) {
        this.active = active;
    }

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Historic
 * Date: 07.11.2015
 * Time: 16:46
 */

namespace Manager\Bundle\Extensions;

use Symfony\Component\Form\FormFactory;
use Manager\Bundle\Form\NoteType;

class FormExtension extends \Twig_Extension
{
    /**
     * Constructor
     * @param FormFactory $forms
     */

    public function __construct($forms)
    {
        $this->forms = $forms;
    }

    public function addNoteForm()
    {
        $form = $this->forms->createBuilder(new NoteType());
        $form->add('submit', 'submit');

        return $form;
    }

    public function getName()
    {
        return "form_extension";
    }
}


text:
cask 'blu-ray-player' do
  version '3.3.17,190812'
  sha256 'ea492419be6400530414cb3921f15dde4cf24d9f5445df56178756ee116a2862'

  url 'https://www.macblurayplayer.com/user/download/Mac_Bluray_Player.dmg'
  appcast "https://cdn.macblurayplayer.com/mac-bluray-player-#{version.major}/appcast/Appcast.xml"
  name 'Macgo Mac Blu-ray Player'
  homepage 'https://www.macblurayplayer.com/'

  app 'Blu-ray Player.app'
end


text:
/*global ot */

ot.SocketIOAdapter = (function () {
  'use strict';

  function SocketIOAdapter (socket) {
    this.socket = socket;

    var self = this;
    socket
      .on('client_left', function (clientId) {
        self.trigger('client_left', clientId);
      })
      .on('set_name', function (clientId, name) {
        self.trigger('set_name', clientId, name);
      })
      .on('ack', function () { self.trigger('ack'); })
      .on('operation', function (clientId, operation, selection) {
        self.trigger('operation', operation);
        self.trigger('selection', clientId, selection);
      })
      .on('selection', function (clientId, selection) {
        self.trigger('selection', clientId, selection);
      })
      .on('reconnect', function () {
        self.trigger('reconnect');
      });
  }

  SocketIOAdapter.prototype.sendOperation = function (revision, operation, selection) {
    this.socket.emit('operation', revision, operation, selection);
  };

  SocketIOAdapter.prototype.sendSelection = function (selection) {
    this.socket.emit('selection', selection);
  };

  SocketIOAdapter.prototype.registerCallbacks = function (cb) {
    this.callbacks = cb;
  };

  SocketIOAdapter.prototype.trigger = function (event) {
    var args = Array.prototype.slice.call(arguments, 1);
    var action = this.callbacks && this.callbacks[event];
    if (action) { action.apply(this, args); }
  };

  return SocketIOAdapter;

}());


text:
package org.dbpedia.spotlight.spot

import org.dbpedia.spotlight.log.SpotlightLog
import org.dbpedia.spotlight.model._

/**
 * @author scott white
 */
class ChainedSelector(selectors : List[SpotSelector]) extends UntaggedSpotSelector {

    SpotlightLog.info(this.getClass, "Creating a chained surface form selector with %s.", selectors)

    def select(occurrences: java.util.List[SurfaceFormOccurrence]) : java.util.List[SurfaceFormOccurrence] = {
        var occs = occurrences
        selectors.foreach(selector =>
          occs = selector.select(occs)
        )
        occs
    }

}