text:
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* SAMPLE                                                                 */
/*                                                                        */
/* (c) Copyright IBM Corp. 2017 All Rights Reserved                       */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or disclosure */
/* restricted by GSA ADP Schedule Contract with IBM Corp                  */
/*                                                                        */

package com.ibm.cicsdev.vsam.ksds;

import com.ibm.cics.server.Task;
import com.ibm.cicsdev.bean.StockPart;
import com.ibm.cicsdev.vsam.StockPartHelper;

/**
 * Simple example to demonstrate deleting a record from a VSAM KSDS file using JCICS.
 *
 * This class is just the driver of the test. The main JCICS work is done in the
 * common class {@link KsdsExampleCommon}.
 */
public class KsdsExample4
{
    /**
     * Main entry point to a CICS OSGi program.
     *
     * The FQ name of this class should be added to the CICS-MainClass entry in
     * the parent OSGi bundle's manifest.
     */
    public static void main(String[] args)
    {
        // Get details about our current CICS task
        Task task = Task.getTask();
        task.out.println(" - Starting KsdsExample4");
        task.out.println("VSAM KSDS record delete example");

        // Create a new instance of the common example class
        KsdsExampleCommon ex = new KsdsExampleCommon();

        /*
         * Create a record in the file so we have something to work with.
         */

        // Keep track of the generated key
        int key;

        // Scoping of local variables
        {
            // Add a new record to the file
            StockPart sp = StockPartHelper.generate();
            ex.addRecord(sp);

            // Commit the unit of work
            ex.commitUnitOfWork();

            // Get hold of the new part ID
            key = sp.getPartId();

            // Write out the key
            task.out.println( String.format("Wrote to key 0x%08X", key) );
        }

        /*
         * Delete the record.
         */

        // Scoping of local variables
        {
            // Now delete this known record
            StockPart sp = ex.deleteRecord(key);

            // Display the result
            String strMsg = "Deleted record with description %s";
            task.out.println( String.format(strMsg, sp.getDescription().trim()) );
        }

        // Unit of work containing the delete will be committed at normal end of task

        // Completion message
        task.out.println("Completed KsdsExample4");
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Vardius\Bundle\CrudBundle\Event;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\Request;
use Vardius\Bundle\CrudBundle\Controller\CrudController;
use Vardius\Bundle\CrudBundle\Data\DataProviderInterface;

/**
 * ActionEvent
 *
 * @author Rafał Lorenz <vardius@gmail.com>
 */
class ActionEvent
{
    /** @var  Request */
    protected $request;
    /** @var CrudController */
    protected $controller;

    /**
     * @param CrudController $controller
     * @param Request $request
     */
    function __construct(CrudController $controller, Request $request)
    {
        $this->controller = $controller;
        $this->request = $request;
    }

    /**
     * @return Request
     */
    public function getRequest():Request
    {
        return $this->request;
    }

    /**
     * @return CrudController
     */
    public function getController():CrudController
    {
        return $this->controller;
    }

    /**
     * @return AbstractType
     */
    public function getFormType():AbstractType
    {
        return $this->controller->getFormType();
    }

    /**
     * @return string
     */
    public function getView():string
    {
        return $this->controller->getView();
    }

    /**
     * @return DataProviderInterface
     */
    public function getDataProvider():DataProviderInterface
    {
        return $this->controller->getDataProvider();
    }
}


text:
package org.infinispan.demo.carmart.session;

import org.infinispan.manager.EmbeddedCacheManager;

/**
 *
 * Subclasses should create an instance of a cache manager (DefaultCacheManager, RemoteCacheManager, etc.)
 *
 *
 */
public interface CacheContainerProvider {

    public EmbeddedCacheManager getCacheContainer();

}


text:
from django.contrib import admin

from .models import Team, Question, Survey, Answer, Report, DailyReport

class SurveyInline(admin.StackedInline):
    model = Survey

class QuestionAdmin(admin.ModelAdmin):
    pass

class MembershipInline(admin.TabularInline):
    model = Team.users.through
    raw_id_fields = ('user',)

class TeamAdmin(admin.ModelAdmin):
    raw_id_fields = ('admin',)
    inlines = (MembershipInline,)

class SurveyAdmin(admin.ModelAdmin):
    pass

class AnswerAdmin(admin.ModelAdmin):
    pass

class DailyReportInline(admin.TabularInline):
    model = DailyReport
    extra = 1

class ReportAdmin(admin.ModelAdmin):
    inlines = (DailyReportInline,)

admin.site.register(Report, ReportAdmin)
admin.site.register(Survey, SurveyAdmin)
admin.site.register(Question, QuestionAdmin)
admin.site.register(Team, TeamAdmin)
admin.site.register(Answer, AnswerAdmin)


text:
module Tilia
  module VObject
    # Exception thrown by parser when the end of the stream has been reached,
    # before this was expected.
    class EofException < ParseException
    end
  end
end


text:
<?php
namespace UserAuth\Form;

/**
 * Class LoginFormAwareTrait
 *
 * @package UserAuth\Form
 */
trait LoginFormAwareTrait
{
    /** @var  LoginForm */
    private $loginForm;

    /**
     * @param LoginForm $loginForm
     */
    public function setLoginForm(LoginForm $loginForm)
    {
        $this->loginForm = $loginForm;
    }
}


text:
package mock

import (
	"sync"

	"github.com/hyperledger/fabric/core/chaincode/lifecycle"
	"github.com/hyperledger/fabric/core/ledger"
)

type LegacyLifecycle struct {
	ChaincodeEndorsementInfoStub        func(string, string, ledger.SimpleQueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error)
	chaincodeEndorsementInfoMutex       sync.RWMutex
	chaincodeEndorsementInfoArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 ledger.SimpleQueryExecutor
	}
	chaincodeEndorsementInfoReturns struct {
		result1 *lifecycle.ChaincodeEndorsementInfo
		result2 error
	}
	chaincodeEndorsementInfoReturnsOnCall map[int]struct {
		result1 *lifecycle.ChaincodeEndorsementInfo
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfo(arg1 string, arg2 string, arg3 ledger.SimpleQueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error) {
	fake.chaincodeEndorsementInfoMutex.Lock()
	ret, specificReturn := fake.chaincodeEndorsementInfoReturnsOnCall[len(fake.chaincodeEndorsementInfoArgsForCall)]
	fake.chaincodeEndorsementInfoArgsForCall = append(fake.chaincodeEndorsementInfoArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 ledger.SimpleQueryExecutor
	}{arg1, arg2, arg3})
	fake.recordInvocation("ChaincodeEndorsementInfo", []interface{}{arg1, arg2, arg3})
	fake.chaincodeEndorsementInfoMutex.Unlock()
	if fake.ChaincodeEndorsementInfoStub != nil {
		return fake.ChaincodeEndorsementInfoStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.chaincodeEndorsementInfoReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfoCallCount() int {
	fake.chaincodeEndorsementInfoMutex.RLock()
	defer fake.chaincodeEndorsementInfoMutex.RUnlock()
	return len(fake.chaincodeEndorsementInfoArgsForCall)
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfoCalls(stub func(string, string, ledger.SimpleQueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error)) {
	fake.chaincodeEndorsementInfoMutex.Lock()
	defer fake.chaincodeEndorsementInfoMutex.Unlock()
	fake.ChaincodeEndorsementInfoStub = stub
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfoArgsForCall(i int) (string, string, ledger.SimpleQueryExecutor) {
	fake.chaincodeEndorsementInfoMutex.RLock()
	defer fake.chaincodeEndorsementInfoMutex.RUnlock()
	argsForCall := fake.chaincodeEndorsementInfoArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfoReturns(result1 *lifecycle.ChaincodeEndorsementInfo, result2 error) {
	fake.chaincodeEndorsementInfoMutex.Lock()
	defer fake.chaincodeEndorsementInfoMutex.Unlock()
	fake.ChaincodeEndorsementInfoStub = nil
	fake.chaincodeEndorsementInfoReturns = struct {
		result1 *lifecycle.ChaincodeEndorsementInfo
		result2 error
	}{result1, result2}
}

func (fake *LegacyLifecycle) ChaincodeEndorsementInfoReturnsOnCall(i int, result1 *lifecycle.ChaincodeEndorsementInfo, result2 error) {
	fake.chaincodeEndorsementInfoMutex.Lock()
	defer fake.chaincodeEndorsementInfoMutex.Unlock()
	fake.ChaincodeEndorsementInfoStub = nil
	if fake.chaincodeEndorsementInfoReturnsOnCall == nil {
		fake.chaincodeEndorsementInfoReturnsOnCall = make(map[int]struct {
			result1 *lifecycle.ChaincodeEndorsementInfo
			result2 error
		})
	}
	fake.chaincodeEndorsementInfoReturnsOnCall[i] = struct {
		result1 *lifecycle.ChaincodeEndorsementInfo
		result2 error
	}{result1, result2}
}

func (fake *LegacyLifecycle) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.chaincodeEndorsementInfoMutex.RLock()
	defer fake.chaincodeEndorsementInfoMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *LegacyLifecycle) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ lifecycle.Lifecycle = new(LegacyLifecycle)


text:
if __name__ == "__main__":
    # amend sys.path to ensure the law package relative to _this_ file is imported
    import os
    import sys

    parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    sys.path.insert(0, parent_dir)

    # load the law cli
    from law.cli import run
    run()


text:
package main

import (
	"encoding/json"
	"errors"
	"fmt"
	"log"

	"sourcegraph.com/sourcegraph/srclib/graph"
)

func init() {
	_, err := flagParser.AddCommand("fmt",
		"format a Go object (def, doc)",
		"The fmt command takes an object and formats it.",
		&fmtCmd,
	)
	if err != nil {
		log.Fatal(err)
	}
}

type FmtCmd struct {
	UnitType   string `short:"u" long:"unit-type" description:"Unit type" required:"yes"`
	ObjectType string `short:"t" long:"object-type" description:"Object type ('def', 'doc')" required:"yes"`
	Format     string `short:"f" long:"format" description:"Format to output ('full', 'decl')" default:"full"`

	Object string `long:"object" description:"Object to format, serialized as JSON" required:"yes"`
}

var fmtCmd FmtCmd

func (c *FmtCmd) Execute(args []string) error {
	switch c.ObjectType {
	case "def":
		var d *graph.Def
		if err := json.Unmarshal([]byte(c.Object), &d); err != nil {
			return err
		}
		f := d.Fmt()
		fmt.Printf("%s %s%s%s", f.Kind(), f.Name(graph.Unqualified), f.NameAndTypeSeparator(), f.Type(graph.Unqualified))
		return nil
	case "doc":
		return errors.New("Doc formatting yet to be implemented")
	default:
		return errors.New("Object type not recognized: %s")
	}
}


text:
<?php namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract {

	use Authenticatable, CanResetPassword;

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'users';

	/**
	 * The attributes that are mass assignable.
	 *
	 * @var array
	 */
	protected $fillable = ['name', 'email', 'password'];

	/**
	 * The attributes excluded from the model's JSON form.
	 *
	 * @var array
	 */
	protected $hidden = ['password', 'remember_token'];

    /**
     * A user can have many posts associated with them
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function posts()
    {
        return $this->hasMany('App\Post');
    }

}


text:
typedef void (^ATVCancelBlock)();
typedef void (^ATVSelectionBlock)(int selectedRow);

@interface GCAlertTableView : UIAlertView <UITableViewDelegate, UITableViewDataSource> {
	UITableView *_tableView;
    UIImageView *_overlayImageView;
}
@property (nonatomic, retain, readonly) UITableView *tableView;
@property (nonatomic, retain) NSArray *arrayDatasource;

+ (UIAlertView*) alertViewWithTitle:(NSString *)title
                  cancelButtonTitle:(NSString *)cancelButtonTitle
                        arrayOfRows:(NSArray  *)arrayOfRows
                           onCancel:(ATVCancelBlock)cancelled
                        onSelectRow:(ATVSelectionBlock)selectedRow;

@end


text:
require.ensure([], function(require) {
require("./120.async.js");
require("./240.async.js");
require("./481.async.js");
require("./962.async.js");
});
module.exports = 963;


text:
namespace media {

class MEDIA_EXPORT AudioInputController
    : public base::RefCountedThreadSafe<AudioInputController>,
      public AudioInputStream::AudioInputCallback {
 public:
  // An event handler that receives events from the AudioInputController. The
  // following methods are all called on the audio thread.
  class MEDIA_EXPORT EventHandler {
   public:
    virtual void OnCreated(AudioInputController* controller) = 0;
    virtual void OnRecording(AudioInputController* controller) = 0;
    virtual void OnError(AudioInputController* controller, int error_code) = 0;
    virtual void OnData(AudioInputController* controller, const uint8* data,
                        uint32 size) = 0;

   protected:
    virtual ~EventHandler() {}
  };

  // A synchronous writer interface used by AudioInputController for
  // synchronous writing.
  class SyncWriter {
   public:
    virtual ~SyncWriter() {}

    // Notify the synchronous writer about the number of bytes in the
    // soundcard which has been recorded.
    virtual void UpdateRecordedBytes(uint32 bytes) = 0;

    // Write certain amount of data from |data|. This method returns
    // number of written bytes.
    virtual uint32 Write(const void* data, uint32 size, double volume) = 0;

    // Close this synchronous writer.
    virtual void Close() = 0;
  };

  // AudioInputController::Create() can use the currently registered Factory
  // to create the AudioInputController. Factory is intended for testing only.
  class Factory {
   public:
    virtual AudioInputController* Create(AudioManager* audio_manager,
                                         EventHandler* event_handler,
                                         AudioParameters params) = 0;
   protected:
    virtual ~Factory() {}
  };

  // Factory method for creating an AudioInputController.
  // The audio device will be created on the audio thread, and when that is
  // done, the event handler will receive an OnCreated() call from that same
  // thread.
  static scoped_refptr<AudioInputController> Create(
      AudioManager* audio_manager,
      EventHandler* event_handler,
      const AudioParameters& params);

  // Sets the factory used by the static method Create(). AudioInputController
  // does not take ownership of |factory|. A value of NULL results in an
  // AudioInputController being created directly.
  static void set_factory_for_testing(Factory* factory) { factory_ = factory; }
  AudioInputStream* stream_for_testing() { return stream_; }

  // Factory method for creating an AudioInputController for low-latency mode.
  // The audio device will be created on the audio thread, and when that is
  // done, the event handler will receive an OnCreated() call from that same
  // thread.
  static scoped_refptr<AudioInputController> CreateLowLatency(
      AudioManager* audio_manager,
      EventHandler* event_handler,
      const AudioParameters& params,
      const std::string& device_id,
      // External synchronous writer for audio controller.
      SyncWriter* sync_writer);

  // Starts recording using the created audio input stream.
  // This method is called on the creator thread.
  virtual void Record();

  // Closes the audio input stream. The state is changed and the resources
  // are freed on the audio thread. |closed_task| is then executed on the thread
  // that called Close().
  // Callbacks (EventHandler and SyncWriter) must exist until |closed_task|
  // is called.
  // It is safe to call this method more than once. Calls after the first one
  // will have no effect.
  // This method trampolines to the audio thread.
  virtual void Close(const base::Closure& closed_task);

  // Sets the capture volume of the input stream. The value 0.0 corresponds
  // to muted and 1.0 to maximum volume.
  virtual void SetVolume(double volume);

  // Sets the Automatic Gain Control (AGC) state of the input stream.
  // Changing the AGC state is not supported while recording is active.
  virtual void SetAutomaticGainControl(bool enabled);

  // AudioInputCallback implementation. Threading details depends on the
  // device-specific implementation.
  virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size,
                      uint32 hardware_delay_bytes, double volume) OVERRIDE;
  virtual void OnClose(AudioInputStream* stream) OVERRIDE;
  virtual void OnError(AudioInputStream* stream, int code) OVERRIDE;

  bool LowLatencyMode() const { return sync_writer_ != NULL; }

 protected:
  friend class base::RefCountedThreadSafe<AudioInputController>;

  // Internal state of the source.
  enum State {
    kEmpty,
    kCreated,
    kRecording,
    kClosed,
    kError
  };

  AudioInputController(EventHandler* handler, SyncWriter* sync_writer);
  virtual ~AudioInputController();

  // Methods called on the audio thread (owned by the AudioManager).
  void DoCreate(AudioManager* audio_manager, const AudioParameters& params,
                const std::string& device_id);
  void DoRecord();
  void DoClose();
  void DoReportError(int code);
  void DoSetVolume(double volume);
  void DoSetAutomaticGainControl(bool enabled);

  // Method which ensures that OnError() is triggered when data recording
  // times out. Called on the audio thread.
  void DoCheckForNoData();

  // Helper method that stops, closes, and NULL:s |*stream_|.
  // Signals event when done if the event is not NULL.
  void DoStopCloseAndClearStream(base::WaitableEvent* done);

  void SetDataIsActive(bool enabled);
  bool GetDataIsActive();

  // Gives access to the message loop of the creating thread.
  scoped_refptr<base::MessageLoopProxy> creator_loop_;

  // The message loop of audio-manager thread that this object runs on.
  scoped_refptr<base::MessageLoopProxy> message_loop_;

  // Contains the AudioInputController::EventHandler which receives state
  // notifications from this class.
  EventHandler* handler_;

  // Pointer to the audio input stream object.
  AudioInputStream* stream_;

  // |no_data_timer_| is used to call OnError() when we stop receiving
  // OnData() calls without an OnClose() call. This can occur
  // when an audio input device is unplugged whilst recording on Windows.
  // See http://crbug.com/79936 for details.
  // This member is only touched by the audio thread.
  scoped_ptr<base::Timer> no_data_timer_;

  // This flag is used to signal that we are receiving OnData() calls, i.e,
  // that data is active. It can be touched by the audio thread and by the
  // low-level audio thread which calls OnData(). E.g. on Windows, the
  // low-level audio thread is called wasapi_capture_thread.
  base::subtle::Atomic32 data_is_active_;

  // |state_| is written on the audio thread and is read on the hardware audio
  // thread. These operations need to be locked. But lock is not required for
  // reading on the audio input controller thread.
  State state_;

  base::Lock lock_;

  // SyncWriter is used only in low-latency mode for synchronous writing.
  SyncWriter* sync_writer_;

  static Factory* factory_;

  double max_volume_;

  DISALLOW_COPY_AND_ASSIGN(AudioInputController);
};

}  // namespace media

#endif  // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<resources name="en" flag="gb" title="English">
	<string name="_bx_ntfs"><![CDATA[Notifications]]></string>

	<string name="_bx_ntfs_page_title_system_view"><![CDATA[Notifications]]></string>
	<string name="_bx_ntfs_page_title_view"><![CDATA[Notifications]]></string>
	<string name="_bx_ntfs_page_block_title_view"><![CDATA[Notifications]]></string>

	<string name="_bx_ntfs_menu_title_submenu"><![CDATA[Notifications Submenu]]></string>
	<string name="_bx_ntfs_menu_set_title_submenu"><![CDATA[Notifications Submenu]]></string>
	<string name="_bx_ntfs_menu_item_title_system_notifications_all"><![CDATA[All Notifications]]></string>
	<string name="_bx_ntfs_menu_item_title_notifications_all"><![CDATA[All Notifications]]></string>
    <string name="_bx_ntfs_menu_item_title_system_notifications"><![CDATA[Notifications]]></string>
    <string name="_bx_ntfs_menu_item_title_notifications"><![CDATA[Notifications]]></string>

	<string name="_bx_ntfs_option_events_per_page"><![CDATA[Number of events are displayed on View page]]></string>
	<string name="_bx_ntfs_option_events_hide"><![CDATA[Show events in Notifications]]></string>

	<string name="_bx_ntfs_alert_action_added"><![CDATA[add]]></string>

	<string name="_bx_ntfs_txt_msg_no_results"><![CDATA[Empty]]></string>
	<string name="_bx_ntfs_txt_item_added"><![CDATA[{owner_name} added a new {entry_sample} {entry_caption}]]></string>
</resources>


text:
package org.skfiy.typhon.dispatcher;

import com.google.common.base.Predicate;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.reflections.Reflections;
import org.reflections.adapters.JavaReflectionAdapter;
import org.reflections.scanners.MethodAnnotationsScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
import org.skfiy.typhon.Container;
import org.skfiy.typhon.packet.Packet;
import org.skfiy.typhon.annotation.Action;

/**
 *
 * @author Kevin Zou <<kevinz@skfiy.org>>
 */
class ActionHelper {

    private Map<Class<?>, List<ActionMapping>> actionMappings;
    private Map<String, Class<Packet>> packetClass;

    ActionHelper(Container container) {
        actionMappings = new HashMap<>();
        packetClass = new HashMap<>();

        // 扫描已经被管理的所有Class
        final Map<String, Object> scanUrls = new HashMap<>();
        for (Class clazz : container.getAllBindingClasses()) {
            scanUrls.put(clazz.getCanonicalName() + ".class", null);
        }

        MethodAnnotationsScanner methodScanner = new MethodAnnotationsScanner();
        ConfigurationBuilder builder = ConfigurationBuilder.build(methodScanner,
                new Predicate<String>() {
            @Override
            public boolean apply(String t) {
                return scanUrls.containsKey(t);
            }
        });
        builder.setMetadataAdapter(new JavaReflectionAdapter());

        builder.setUrls(ClasspathHelper.forPackage("org.skfiy.typhon"));

        // 扫描Action注解描述的Method
        Reflections refls = builder.build();
        Set<Method> methods = refls.getMethodsAnnotatedWith(Action.class);
        for (Method m : methods) {
            Class clazz = m.getDeclaringClass();

            List<ActionMapping> anns;
            if (actionMappings.containsKey(clazz)) {
                anns = actionMappings.get(clazz);
            } else {
                anns = new ArrayList<>();
                actionMappings.put(clazz, anns);
            }

            Action ac = m.getAnnotation(Action.class);

            // @Action 注解映射详细
            ActionMapping mapping = new ActionMapping();
            mapping.setNs(ac.value());
            mapping.setMethod(m);
            mapping.setPacketClass(m.getParameterTypes()[0]);
            anns.add(mapping);

            packetClass.put(ac.value(), mapping.getPacketClass());
        }
    }

    Map<Class<?>, List<ActionMapping>> getActionMappings() {
        return actionMappings;
    }

    Class<Packet> getPacketClass(String ns) {
        return packetClass.get(ns);
    }
}


text:
"""Defines Rainbow DQN, using JAX."""

import dataclasses
from typing import Callable

from acme import specs
from acme.agents.jax.dqn import actor as dqn_actor
from acme.agents.jax.dqn import builder
from acme.agents.jax.dqn import config as dqn_config
from acme.agents.jax.dqn import losses
from acme.jax import networks as networks_lib
from acme.jax import utils
import rlax

NetworkFactory = Callable[[specs.EnvironmentSpec],
                          networks_lib.FeedForwardNetwork]

@dataclasses.dataclass
class RainbowConfig(dqn_config.DQNConfig):
  """(Additional) configuration options for RainbowDQN."""
  max_abs_reward: float = 1.0  # For clipping reward

def apply_policy_and_sample(
    network: networks_lib.FeedForwardNetwork,) -> dqn_actor.EpsilonPolicy:
  """Returns a function that computes actions.

  Note that this differs from default_behavior_policy with that it
  expects c51-style network head which returns a tuple with the first entry
  representing q-values.

  Args:
    network: A c51-style feedforward network.

  Returns:
    A feedforward policy.
  """

  def apply_and_sample(params, key, obs, epsilon):
    # TODO(b/161332815): Make JAX Actor work with batched or unbatched inputs.
    obs = utils.add_batch_dim(obs)
    action_values = network.apply(params, obs)[0]
    action_values = utils.squeeze_batch_dim(action_values)
    return rlax.epsilon_greedy(epsilon).sample(key, action_values)

  return apply_and_sample

def eval_policy(network: networks_lib.FeedForwardNetwork,
                eval_epsilon: float) -> dqn_actor.EpsilonPolicy:
  """Returns a function that computes actions.

  Note that this differs from default_behavior_policy with that it
  expects c51-style network head which returns a tuple with the first entry
  representing q-values.

  Args:
    network: A c51-style feedforward network.
    eval_epsilon: for epsilon-greedy exploration.

  Returns:
    A feedforward policy.
  """
  policy = apply_policy_and_sample(network)

  def apply_and_sample(params, key, obs, _):
    return policy(params, key, obs, eval_epsilon)

  return apply_and_sample

def make_builder(config: RainbowConfig):
  """Returns a DQNBuilder with a pre-built loss function."""
  loss_fn = losses.PrioritizedCategoricalDoubleQLearning(
      discount=config.discount,
      importance_sampling_exponent=config.importance_sampling_exponent,
      max_abs_reward=config.max_abs_reward,
  )
  return builder.DQNBuilder(config, loss_fn=loss_fn)


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using MahApps.Metro.Controls;
using MahApps.Metro.Tests.TestHelpers;
using MahApps.Metro.Tests.Views;
using Xunit;

namespace MahApps.Metro.Tests.Tests
{
    public class FlyoutTest : AutomationTestBase
    {
        [Fact]
        [DisplayTestMethodName]
        public async Task AdaptsWindowCommandsToDarkFlyout()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            var flyout = new Flyout { Theme = FlyoutTheme.Dark };
            window.Flyouts?.Items.Add(flyout);

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);

            window.AssertWindowButtonCommandsColor(((SolidColorBrush)flyout.Foreground).Color);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task DefaultFlyoutPositionIsLeft()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.Equal(Position.Left, window.DefaultFlyout.Position);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task FlyoutIsClosedByDefault()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.False(window.DefaultFlyout.IsOpen);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task FlyoutIsHiddenByDefault()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            // root grid should be hidden
            Assert.Equal(Visibility.Hidden, window.DefaultFlyout.Visibility);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task HiddenIconIsBelowFlyout()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            window.IconOverlayBehavior = OverlayBehavior.Never;

            Assert.NotNull(window.Icon);
            var icon = window.FindChild<FrameworkElement>("PART_Icon");
            Assert.NotNull(icon);

            var flyout = window.LeftFlyout;

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);

            var iconZIndex = Panel.GetZIndex(icon);
            var flyoutZIndex = Panel.GetZIndex(flyout);

            Assert.Equal(0, flyoutZIndex);
            Assert.Equal(1, iconZIndex);
            Assert.True(flyoutZIndex < iconZIndex);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task HiddenLeftWindowCommandsAreBelowFlyout()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            window.LeftWindowCommandsOverlayBehavior = WindowCommandsOverlayBehavior.Never;

            var windowCommands = window.FindChild<ContentPresenter>("PART_LeftWindowCommands");
            Assert.NotNull(windowCommands);

            var flyout = window.LeftFlyout;

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);

            var windowCommandsZIndex = Panel.GetZIndex(windowCommands);
            var flyoutZIndex = Panel.GetZIndex(flyout);

            Assert.Equal(0, flyoutZIndex);
            Assert.Equal(1, windowCommandsZIndex);
            Assert.True(flyoutZIndex < windowCommandsZIndex);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task HiddenRightWindowCommandsAreBelowFlyout()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            window.RightWindowCommandsOverlayBehavior = WindowCommandsOverlayBehavior.Never;

            var windowCommands = window.FindChild<ContentPresenter>("PART_RightWindowCommands");
            Assert.NotNull(windowCommands);

            var flyout = window.RightFlyout;

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);

            var windowCommandsZIndex = Panel.GetZIndex(windowCommands);
            var flyoutZIndex = Panel.GetZIndex(flyout);

            Assert.Equal(0, flyoutZIndex);
            Assert.Equal(1, windowCommandsZIndex);
            Assert.True(flyoutZIndex < windowCommandsZIndex);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task WindowButtonCommandsAreOverFlyout()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            var windowCommands = window.FindChild<ContentPresenter>("PART_WindowButtonCommands");
            Assert.NotNull(windowCommands);

            var flyout = window.RightFlyout;

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);

            var windowCommandsZIndex = Panel.GetZIndex(windowCommands);
            var flyoutZIndex = Panel.GetZIndex(flyout);

            Assert.True(windowCommandsZIndex > flyoutZIndex);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task RaisesIsOpenChangedEvent()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            var flyout = window.RightFlyout;

            var completionSource = new TaskCompletionSource<bool>();

            void FlyoutOnIsOpenChanged(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.IsOpenChanged -= FlyoutOnIsOpenChanged;
                completionSource.SetResult(flyout.IsOpen);
            }

            flyout.IsOpenChanged += FlyoutOnIsOpenChanged;

            flyout.IsOpen = true;

            var opened = await completionSource.Task;
            Assert.True(opened);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task RaisesClosingFinishedEvent()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            var flyout = window.RightFlyout;

            var openingCompletionSource = new TaskCompletionSource<bool>();
            var closingCompletionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                openingCompletionSource.SetResult(flyout.IsOpen);
            }

            void FlyoutOnClosingFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.ClosingFinished -= FlyoutOnClosingFinished;
                closingCompletionSource.SetResult(!flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;
            flyout.ClosingFinished += FlyoutOnClosingFinished;

            flyout.IsOpen = true;

            var opened = await openingCompletionSource.Task;
            Assert.True(opened);

            flyout.IsOpen = false;

            var closed = await closingCompletionSource.Task;
            Assert.True(closed);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task FindFlyoutWithFindChildren()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            var ex = Record.Exception(() =>
                {
                    var flyouts = (window.Content as DependencyObject).FindChildren<Flyout>(true);
                    var flyoutOnGrid = flyouts.FirstOrDefault(f => f.Name == nameof(window.FlyoutOnGrid));
                    Assert.NotNull(flyoutOnGrid);
                });
            Assert.Null(ex);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task DefaultFlyoutThemeIsDark()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.Equal(FlyoutTheme.Dark, window.DefaultFlyout.Theme);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task WindowButtonCommandsForegroundBrushShouldBeAlwaysOverrideDefaultWindowCommandsBrush()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.NotNull(window.WindowButtonCommands);

            var brush = Brushes.Red;

            window.OverrideDefaultWindowCommandsBrush = brush;

            var flyout = window.RightFlyout;

            var openingCompletionSource = new TaskCompletionSource<bool>();
            var closingCompletionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                openingCompletionSource.SetResult(flyout.IsOpen);
            }

            void FlyoutOnClosingFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.ClosingFinished -= FlyoutOnClosingFinished;
                closingCompletionSource.SetResult(!flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;
            flyout.ClosingFinished += FlyoutOnClosingFinished;

            flyout.IsOpen = true;

            var opened = await openingCompletionSource.Task;
            Assert.True(opened);

            Assert.Equal(brush, window.WindowButtonCommands.Foreground);

            flyout.IsOpen = false;

            var closed = await closingCompletionSource.Task;
            Assert.True(closed);

            Assert.Equal(brush, window.WindowButtonCommands.Foreground);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task LeftWindowCommandsForegroundBrushShouldAlwaysOverrideDefaultWindowCommandsBrush()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.NotNull(window.LeftWindowCommands);

            var brush = Brushes.Red;

            window.OverrideDefaultWindowCommandsBrush = brush;

            var flyout = window.LeftFlyout;

            var openingCompletionSource = new TaskCompletionSource<bool>();
            var closingCompletionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                openingCompletionSource.SetResult(flyout.IsOpen);
            }

            void FlyoutOnClosingFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.ClosingFinished -= FlyoutOnClosingFinished;
                closingCompletionSource.SetResult(!flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;
            flyout.ClosingFinished += FlyoutOnClosingFinished;

            flyout.IsOpen = true;

            var opened = await openingCompletionSource.Task;
            Assert.True(opened);

            Assert.Equal(brush, window.LeftWindowCommands.Foreground);

            flyout.IsOpen = false;

            var closed = await closingCompletionSource.Task;
            Assert.True(closed);

            Assert.Equal(brush, window.LeftWindowCommands.Foreground);
        }

        [Fact]
        [DisplayTestMethodName]
        public async Task RightWindowCommandsForegroundBrushShouldAlwaysOverrideDefaultWindowCommandsBrush()
        {
            await TestHost.SwitchToAppThread();
            var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();

            Assert.NotNull(window.RightWindowCommands);

            var brush = Brushes.Red;

            window.OverrideDefaultWindowCommandsBrush = brush;

            var flyout = window.RightFlyout;

            var openingCompletionSource = new TaskCompletionSource<bool>();
            var closingCompletionSource = new TaskCompletionSource<bool>();

            void FlyoutOnOpeningFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.OpeningFinished -= FlyoutOnOpeningFinished;
                openingCompletionSource.SetResult(flyout.IsOpen);
            }

            void FlyoutOnClosingFinished(object o, RoutedEventArgs routedEventArgs)
            {
                flyout.ClosingFinished -= FlyoutOnClosingFinished;
                closingCompletionSource.SetResult(!flyout.IsOpen);
            }

            flyout.OpeningFinished += FlyoutOnOpeningFinished;
            flyout.ClosingFinished += FlyoutOnClosingFinished;

            flyout.IsOpen = true;

            var opened = await openingCompletionSource.Task;
            Assert.True(opened);

            Assert.Equal(brush, window.RightWindowCommands.Foreground);

            flyout.IsOpen = false;

            var closed = await closingCompletionSource.Task;
            Assert.True(closed);

            Assert.Equal(brush, window.RightWindowCommands.Foreground);
        }
    }
}


text:
Avro schema derivation and data parsing from cobol copybook for Scala.

The pipeline can be explained as follows :
The Scala App takes an COBOL copybook as input and tokenizes it to identify the
copybook schema. Then a parser takes the tokens generated from the copybook and
builds an AST(abstract syntax tree). The AST is then written to a .scala file.
The generated .scala class file is used to create a AVRO schema.
At this moment only the keys reside in the AVRO schema. The raw binary file is then
parsed with Scodec to human readable values. These values are then added to the
correct corresponding key in the generic record.

https://drive.google.com/a/zenaptix.com/file/d/0B5KPFloE62GlQWI4SjNRQlFXWUU/view?usp=sharing

## Build project
```$ sbt```

```$ <project> clean compile ```
###
```<project> = cobolCopyBook/macros```

## Run main app
```$ project cobolCopyBook```

```$ clean compile```

### Create .scala types from cobolCopybook
```$ run "<copybook dir>" -C ```

### Run app
```$ clean compile```

```$ run "<copybook dir>" -R "<binary dir>" <bitOffset> "<output .csv dir>" <number of records>```


text: This is the website used to promote PyCon Argentina 2015.


text:
package nu.validator.saxtree;

/**
 * A prefix mapping.
 * @version $Id$
 * @author hsivonen
 */
public final class PrefixMapping {
    /**
     * The namespace prefix.
     */
    private final String prefix;
    /**
     * The namespace URI.
     */
    private final String uri;
    /**
     * Constructor.
     * @param prefix the prefix
     * @param uri the URI
     */
    public PrefixMapping(final String prefix, final String uri) {
        this.prefix = prefix;
        this.uri = uri;
    }
    /**
     * Returns the prefix.
     *
     * @return the prefix
     */
    public String getPrefix() {
        return prefix;
    }
    /**
     * Returns the uri.
     *
     * @return the uri
     */
    public String getUri() {
        return uri;
    }
}


text:
#ifndef __LINUX_BACKING_DEV_DEFS_H
#define __LINUX_BACKING_DEV_DEFS_H

#include <linux/list.h>
#include <linux/radix-tree.h>
#include <linux/rbtree.h>
#include <linux/spinlock.h>
#include <linux/percpu_counter.h>
#include <linux/percpu-refcount.h>
#include <linux/flex_proportions.h>
#include <linux/timer.h>
#include <linux/workqueue.h>

struct page;
struct device;
struct dentry;

/*
 * Bits in bdi_writeback.state
 */
enum wb_state {
	WB_registered,		/* bdi_register() was done */
	WB_writeback_running,	/* Writeback is in progress */
	WB_has_dirty_io,	/* Dirty inodes on ->b_{dirty|io|more_io} */
};

enum wb_congested_state {
	WB_async_congested,	/* The async (write) queue is getting full */
	WB_sync_congested,	/* The sync queue is getting full */
};

typedef int (congested_fn)(void *, int);

enum wb_stat_item {
	WB_RECLAIMABLE,
	WB_WRITEBACK,
	WB_DIRTIED,
	WB_WRITTEN,
	NR_WB_STAT_ITEMS
};

#define WB_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))

/*
 * For cgroup writeback, multiple wb's may map to the same blkcg.  Those
 * wb's can operate mostly independently but should share the congested
 * state.  To facilitate such sharing, the congested state is tracked using
 * the following struct which is created on demand, indexed by blkcg ID on
 * its bdi, and refcounted.
 */
struct bdi_writeback_congested {
	unsigned long state;		/* WB_[a]sync_congested flags */
	atomic_t refcnt;		/* nr of attached wb's and blkg */

#ifdef CONFIG_CGROUP_WRITEBACK
	struct backing_dev_info *bdi;	/* the associated bdi */
	int blkcg_id;			/* ID of the associated blkcg */
	struct rb_node rb_node;		/* on bdi->cgwb_congestion_tree */
#endif
};

/*
 * Each wb (bdi_writeback) can perform writeback operations, is measured
 * and throttled, independently.  Without cgroup writeback, each bdi
 * (bdi_writeback) is served by its embedded bdi->wb.
 *
 * On the default hierarchy, blkcg implicitly enables memcg.  This allows
 * using memcg's page ownership for attributing writeback IOs, and every
 * memcg - blkcg combination can be served by its own wb by assigning a
 * dedicated wb to each memcg, which enables isolation across different
 * cgroups and propagation of IO back pressure down from the IO layer upto
 * the tasks which are generating the dirty pages to be written back.
 *
 * A cgroup wb is indexed on its bdi by the ID of the associated memcg,
 * refcounted with the number of inodes attached to it, and pins the memcg
 * and the corresponding blkcg.  As the corresponding blkcg for a memcg may
 * change as blkcg is disabled and enabled higher up in the hierarchy, a wb
 * is tested for blkcg after lookup and removed from index on mismatch so
 * that a new wb for the combination can be created.
 */
struct bdi_writeback {
	struct backing_dev_info *bdi;	/* our parent bdi */

	unsigned long state;		/* Always use atomic bitops on this */
	unsigned long last_old_flush;	/* last old data flush */

	struct list_head b_dirty;	/* dirty inodes */
	struct list_head b_io;		/* parked for writeback */
	struct list_head b_more_io;	/* parked for more writeback */
	struct list_head b_dirty_time;	/* time stamps are dirty */
	spinlock_t list_lock;		/* protects the b_* lists */

	struct percpu_counter stat[NR_WB_STAT_ITEMS];

	struct bdi_writeback_congested *congested;

	unsigned long bw_time_stamp;	/* last time write bw is updated */
	unsigned long dirtied_stamp;
	unsigned long written_stamp;	/* pages written at bw_time_stamp */
	unsigned long write_bandwidth;	/* the estimated write bandwidth */
	unsigned long avg_write_bandwidth; /* further smoothed write bw, > 0 */

	/*
	 * The base dirty throttle rate, re-calculated on every 200ms.
	 * All the bdi tasks' dirty rate will be curbed under it.
	 * @dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit
	 * in small steps and is much more smooth/stable than the latter.
	 */
	unsigned long dirty_ratelimit;
	unsigned long balanced_dirty_ratelimit;

	struct fprop_local_percpu completions;
	int dirty_exceeded;

	spinlock_t work_lock;		/* protects work_list & dwork scheduling */
	struct list_head work_list;
	struct delayed_work dwork;	/* work item used for writeback */

	struct list_head bdi_node;	/* anchored at bdi->wb_list */

#ifdef CONFIG_CGROUP_WRITEBACK
	struct percpu_ref refcnt;	/* used only for !root wb's */
	struct fprop_local_percpu memcg_completions;
	struct cgroup_subsys_state *memcg_css; /* the associated memcg */
	struct cgroup_subsys_state *blkcg_css; /* and blkcg */
	struct list_head memcg_node;	/* anchored at memcg->cgwb_list */
	struct list_head blkcg_node;	/* anchored at blkcg->cgwb_list */

	union {
		struct work_struct release_work;
		struct rcu_head rcu;
	};
#endif
};

struct backing_dev_info {
	struct list_head bdi_list;
	unsigned long ra_pages;	/* max readahead in PAGE_CACHE_SIZE units */
	unsigned int capabilities; /* Device capabilities */
	congested_fn *congested_fn; /* Function pointer if device is md/dm */
	void *congested_data;	/* Pointer to aux data for congested func */

	char *name;

	unsigned int min_ratio;
	unsigned int max_ratio, max_prop_frac;

	/*
	 * Sum of avg_write_bw of wbs with dirty inodes.  > 0 if there are
	 * any dirty wbs, which is depended upon by bdi_has_dirty().
	 */
	atomic_long_t tot_write_bandwidth;

	struct bdi_writeback wb;  /* the root writeback info for this bdi */
	struct list_head wb_list; /* list of all wbs */
#ifdef CONFIG_CGROUP_WRITEBACK
	struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
	struct rb_root cgwb_congested_tree; /* their congested states */
	atomic_t usage_cnt; /* counts both cgwbs and cgwb_contested's */
#else
	struct bdi_writeback_congested *wb_congested;
#endif
	wait_queue_head_t wb_waitq;

	struct device *dev;

	struct timer_list laptop_mode_wb_timer;

#ifdef CONFIG_DEBUG_FS
	struct dentry *debug_dir;
	struct dentry *debug_stats;
#endif
};

enum {
	BLK_RW_ASYNC	= 0,
	BLK_RW_SYNC	= 1,
};

void clear_wb_congested(struct bdi_writeback_congested *congested, int sync);
void set_wb_congested(struct bdi_writeback_congested *congested, int sync);

static inline void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
{
	clear_wb_congested(bdi->wb.congested, sync);
}

static inline void set_bdi_congested(struct backing_dev_info *bdi, int sync)
{
	set_wb_congested(bdi->wb.congested, sync);
}

#ifdef CONFIG_CGROUP_WRITEBACK

/**
 * wb_tryget - try to increment a wb's refcount
 * @wb: bdi_writeback to get
 */
static inline bool wb_tryget(struct bdi_writeback *wb)
{
	if (wb != &wb->bdi->wb)
		return percpu_ref_tryget(&wb->refcnt);
	return true;
}

/**
 * wb_get - increment a wb's refcount
 * @wb: bdi_writeback to get
 */
static inline void wb_get(struct bdi_writeback *wb)
{
	if (wb != &wb->bdi->wb)
		percpu_ref_get(&wb->refcnt);
}

/**
 * wb_put - decrement a wb's refcount
 * @wb: bdi_writeback to put
 */
static inline void wb_put(struct bdi_writeback *wb)
{
	if (wb != &wb->bdi->wb)
		percpu_ref_put(&wb->refcnt);
}

/**
 * wb_dying - is a wb dying?
 * @wb: bdi_writeback of interest
 *
 * Returns whether @wb is unlinked and being drained.
 */
static inline bool wb_dying(struct bdi_writeback *wb)
{
	return percpu_ref_is_dying(&wb->refcnt);
}

#else	/* CONFIG_CGROUP_WRITEBACK */

static inline bool wb_tryget(struct bdi_writeback *wb)
{
	return true;
}

static inline void wb_get(struct bdi_writeback *wb)
{
}

static inline void wb_put(struct bdi_writeback *wb)
{
}

static inline bool wb_dying(struct bdi_writeback *wb)
{
	return false;
}

#endif	/* CONFIG_CGROUP_WRITEBACK */

#endif	/* __LINUX_BACKING_DEV_DEFS_H */


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta name="author" content="Martin Suchan">
	<title>wp10.14905.to.wp10.14915.fulldiff</title>

Windows <input checked type="checkbox" id="id3304f70c6a6a453c892129f76384f1db" />

ApplicationModel <input checked type="checkbox" id="ida76b0ba5c2a1412db5e3c626a44365f0" />

Activation <input checked type="checkbox" id="id205f895f56d44dc59d15e4f1f12df89d" />

ActivationKind <input checked type="checkbox" id="idb5cc2cf92e034fa1bd88f4baa44637ac" />

LockScreenComponent : 1016,

LockScreenComponentActivatedEventArgs <input checked type="checkbox" id="id52932996acc4498c99e2d7978cd11d28" />

Kind { get; } : ActivationKind

PreviousExecutionState { get; } : ApplicationExecutionState

SplashScreen { get; } : SplashScreen

Devices <input checked type="checkbox" id="id1caa7efa84074187845f63cf621a577e" />

Gpio <input checked type="checkbox" id="id45d448e44438430ca940ab20df4857f8" />

GpioInterruptBuffer <input checked type="checkbox" id="idc685ff81c8ea436ba3fb1c0770b2d1c9" />

Capacity { get; } : Int32

Clear() : Void

Count { get; } : Int32

IsEmpty { get; } : Boolean

IsOverflowed { get; } : Boolean

Overflowed event : TypedEventHandler<GpioInterruptBuffer,Object>

Peek() : GpioInterruptEvent

Pop() : GpioInterruptEvent

WaitForItemsAsync(Int32 count) : IAsyncOperation<Int32>

GpioInterruptEvent <input checked type="checkbox" id="idfe27ae0d3d8a4a8ea0ae858714bebd47" />

Edge : GpioPinEdge

RelativeTime : TimeSpan

GpioPin <input checked type="checkbox" id="id5360e698997b4664bc08c5762a3bcac4" />

CreateInterruptBuffer() : Void

CreateInterruptBuffer(Int32 minimumCapacity) : Void

InterruptBuffer { get; } : GpioInterruptBuffer

StartInterruptBuffer() : Void

StartInterruptBuffer(GpioPinEdge edge) : Void

StopInterruptBuffer() : Void

Media <input checked type="checkbox" id="id96436eb77c684a94888045805d1c1e71" />

Core <input checked type="checkbox" id="idd52218ae7aff4cae90d110cb4111e485" />

MediaSource <input checked type="checkbox" id="id2341c1fdb8604c2ebef08834edebe1a6" />

StorageFile { get; } : IStorageFile

Stream { get; } : IRandomAccessStream

Playback <input checked type="checkbox" id="id0eddc3c19d5944389448a3ac87518ef8" />

AutoLoadedDisplayPropertyKind <input checked type="checkbox" id="idd108a65027374ba8b3885f891351f6fc" />

None : 0,

MusicOrVideo : 1,

Music : 2,

Video : 3,

CurrentMediaPlaybackItemChangedEventArgs <input checked type="checkbox" id="idaed379658c2241f086fc32c83d246b8e" />

ItemChangedReason { get; } : MediaPlaybackItemChangedReason

Reason { get; } : MediaPlaybackItemChangedReason

MediaPlaybackItem <input checked type="checkbox" id="id4046098f954747f784402a0e8aaa4379" />

AutoLoadedDisplayProperties { get; set; } : AutoLoadedDisplayPropertyKind

DownloadProgress { get; } : Double

IsAutoLoadDisplayPropertiesEnabled { get; set; } : Boolean

IsDisabledInPlaybackList { get; set; } : Boolean

IsEnabled { get; set; } : Boolean

TotalDownloadProgress { get; } : Double

MediaPlaybackList <input checked type="checkbox" id="idfa31430b50974fc2916ec98f7f1dea2b" />

MaxItemsToKeepOpen { get; set; } : Nullable<UInt32>

MaxPlayedItemsToKeepOpen { get; set; } : Nullable<UInt32>

Protection <input checked type="checkbox" id="ide2577e7fa5d34a44b682aa545a218ac1" />

PlayReady <input checked type="checkbox" id="id03075a1e6d314428869d648f45a9ecaf" />

IPlayReadyLicense2 <input checked type="checkbox" id="id554e8d829d3f4edf98d4b64311c386e9" />

HasRealTimeExpiration { get; } : Boolean

IsInMemoryOnly { get; } : Boolean

SecureStopId { get; } : Guid

SecurityLevel { get; } : UInt32

IPlayReadyLicenseSession2 <input checked type="checkbox" id="id7bb36bd1222e466fbe54a1a88e724b24" />

CreateLicenseIterable() : PlayReadyLicenseIterable

PlayReadyLicense <input checked type="checkbox" id="id5ea17790db10488cada93cbb6716ceed" />

HasRealTimeExpiration { get; } : Boolean

IsInMemoryOnly { get; } : Boolean

SecureStopId { get; } : Guid

SecurityLevel { get; } : UInt32

PlayReadyLicenseIterable <input checked type="checkbox" id="idcf4999f539f54ddc8b22d004c02e7c6d" />

ctor(PlayReadyLicenseSession licenseSession, PlayReadyContentHeader contentHeader, Boolean fullyEvaluated)

PlayReadyLicenseSession <input checked type="checkbox" id="idacd63206d1c7476387f6c804d66a3f9e" />

CreateLicenseIterable() : PlayReadyLicenseIterable

Services <input checked type="checkbox" id="id03ddf9a7705c42d4a8e4043a79247b96" />

Maps <input checked type="checkbox" id="id3a1fccf58e7143b1b0dd39e5162612f3" />

OfflineMaps <input checked type="checkbox" id="ida56c3a7192b44beea4ca17f8e8ba0361" />

MapPackage <input checked type="checkbox" id="idac8fbd14082c436db686acfb5df50d8c" />

DownloadAsync() : IAsyncOperation<MapPackageOperationResult>

Name { get; } : String

ParentName { get; } : String

SizeInKilobytes { get; } : Double

Status { get; } : MapPackageStatus

StatusChanged event : TypedEventHandler<MapPackage,Object>

MapPackageManager <input checked type="checkbox" id="idcac5ec8f41f54e19a8d60a3bf99da5ab" />

QueryMapPackageAsync(GeoboundingBox queryBoundingBox) static : IAsyncOperation<MapPackageQueryResult>

QueryMapPackageAsync(Geocircle queryCircle) static : IAsyncOperation<MapPackageQueryResult>

QueryMapPackageAsync(Geopoint queryPoint) static : IAsyncOperation<MapPackageQueryResult>

MapPackageOperationResult <input checked type="checkbox" id="id174be3310bf1483094ce4a4fb45a1316" />

Status { get; } : MapPackageOperationStatus

MapPackageOperationStatus <input checked type="checkbox" id="id84177712d5fd44909550ced2f51c7cc0" />

Success : 0,

UnknownError : 1,

InvalidCredentials : 2,

Cancelled : 3,

MapPackageQueryResult <input checked type="checkbox" id="id39424c58f73b4d059a7bc419081617c6" />

Packages { get; } : IReadOnlyList<MapPackage>

Status { get; } : MapPackageQueryStatus

MapPackageQueryStatus <input checked type="checkbox" id="id32ce5bf3074f4983b5fb1f7f7e0f39b1" />

Success : 0,

UnknownError : 1,

NetworkFailure : 2,

MapPackageStatus <input checked type="checkbox" id="id0bb54c9357c344769ddd7ed72891fe35" />

NotDownloaded : 0,

Downloaded : 1,

Downloading : 2,

Deleting : 3,

MapService <input checked type="checkbox" id="idfed893e3dcfe454688cecfff678e605f" />

LimitNetworkUsage static { get; set; } : Boolean

UI <input checked type="checkbox" id="idfd943984d5854955b6d96d5458c6e2a8" />

Composition <input checked type="checkbox" id="id43f33ef613bf428b8108230aadc036ab" />

CompositionVisualSurface <input checked type="checkbox" id="id9e8b791fe3f64bb1a50f7086df606bff" />

Freeze() : Void

RealizationSize { get; set; } : Size

RealizationSize { get; set; } : Vector2

SourceRectangle { get; set; } : Rect

SourceRectangleBottom { get; set; } : Single

SourceRectangleLeft { get; set; } : Single

SourceRectangleRight { get; set; } : Single

SourceRectangleTop { get; set; } : Single

Input <input checked type="checkbox" id="iddced813fb1994754b5f35ba0c88a5005" />

RadialControllerConfiguration <input checked type="checkbox" id="idb1dc3809444d41f8abe7d10edaedd142" />

DefaultControllerWhenSuppressed { get; set; } : RadialController

IsMenuSuppressed { get; set; } : Boolean

RadialControllerMenuItem <input checked type="checkbox" id="id7f3bb61db30d48a0995034fdc2f6ca54" />

CreateFromFontGlyph(String displayText, String glyph, String fontFamily) static : RadialControllerMenuItem

CreateFromFontGlyphWithPath(String displayText, String glyph, String fontFamily, Uri fontUri) static : RadialControllerMenuItem

Text <input checked type="checkbox" id="ida67b080a474e42c9b51c0564573dc331" />

TextDecorations <input checked type="checkbox" id="id648b893ffa9349a898079dbb6db439ba" />

None : 0,

Underline : 1,

Strikethrough : 2,

WebUI <input checked type="checkbox" id="id275d70cf6a8a41039c9d6403a8252d08" />

WebUILockScreenComponentActivatedEventArgs <input checked type="checkbox" id="idf07126bdd9e741f5bb2c552044d4deff" />

ActivatedOperation { get; } : ActivatedOperation

Kind { get; } : ActivationKind

PreviousExecutionState { get; } : ApplicationExecutionState

SplashScreen { get; } : SplashScreen

Xaml <input checked type="checkbox" id="idd05580debb99456e8b0625660aa765a7" />

Controls <input checked type="checkbox" id="id3ce7b3ee55bb404cae3d12cf0fbb3bf7" />

InkToolbar <input checked type="checkbox" id="id1e99d0b2beb04bbcbfb1c74fa4d58e14" />

EraserFlyoutButtonClicked event : TypedEventHandler<InkToolbar,Object>

GetSelectionButton(InkToolbarSelection selection) : InkToolbarSelectionButton

IsSelectionButtonChecked { get; set; } : Boolean

IsSelectionButtonCheckedChanged event : TypedEventHandler<InkToolbar,Object>

IsSelectionButtonCheckedProperty static { get; } : DependencyProperty

SelectionFlyoutButtonClicked event : TypedEventHandler<InkToolbar,Object>

InkToolbarEraserButton <input checked type="checkbox" id="id71334269f8014b9e8a1f475c095af401" />

PointEraseSize { get; set; } : Size

PointEraseSizeProperty static { get; } : DependencyProperty

PointEraseTipShape { get; set; } : InkToolbarEraserTipShape

PointEraseTipShapeProperty static { get; } : DependencyProperty

ShowPointErase { get; set; } : Boolean

ShowPointEraseProperty static { get; } : DependencyProperty

ShowStrokeErase { get; set; } : Boolean

ShowStrokeEraseProperty static { get; } : DependencyProperty

InkToolbarEraserButtonKind <input checked type="checkbox" id="idb8e679693da149f7a487393043307710" />

PointErase : 0,

StrokeErase : 1,

ClearAll : 2,

InkToolbarEraserTipShape <input checked type="checkbox" id="id8c9031c618db4bb481adeca2de9b308f" />

Circle : 0,

InkToolbarSelection <input checked type="checkbox" id="ide80d0e0858744622a3cb10ef05aada42" />

Stencil : 0,

InkToolbarSelectionButton <input checked type="checkbox" id="id9561319710034f66971960c4462488f4" />

IsExtensionGlyphShown { get; set; } : Boolean

IsExtensionGlyphShownProperty static { get; } : DependencyProperty

Ruler { get; } : InkPresenterRuler

RulerProperty static { get; } : DependencyProperty

SelectionKind { get; } : InkToolbarSelection

ShowProtractorButton { get; set; } : Boolean

ShowProtractorButtonProperty static { get; } : DependencyProperty

ShowRulerButton { get; set; } : Boolean

ShowRulerButtonProperty static { get; } : DependencyProperty

ShowTriangleButton { get; set; } : Boolean

ShowTriangleButtonProperty static { get; } : DependencyProperty

RichTextBlock <input checked type="checkbox" id="id33720d511b7a41ac8939d3772c544d08" />

TextDecorations { get; set; } : TextDecorations

TextDecorationsProperty static { get; } : DependencyProperty

TextBlock <input checked type="checkbox" id="idc7a5d012029946a5ac408c273e3065a3" />

TextDecorations { get; set; } : TextDecorations

TextDecorationsProperty static { get; } : DependencyProperty

Documents <input checked type="checkbox" id="idb8bf16aeb9ed4c3fba4edeebf59c8247" />

TextElement <input checked type="checkbox" id="id1e8ef339dccc43f397ae6a4470d829a2" />

TextDecorations { get; set; } : TextDecorations

TextDecorationsProperty static { get; } : DependencyProperty

Input <input checked type="checkbox" id="id7faebdcfe09f43448ca53013e9bc9ed5" />

AccessKeyManager <input checked type="checkbox" id="idd6642accf7fd4400bd6cc539c76f0910" />

AreKeyTipsEnabled static { get; set; } : Boolean


text:
package frontend;

import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.geometry.Rectangle2D;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 *
 * Entry point of Cell Society simulations
 *
 */
public class CellWorld extends Application {
	private CellViewer myViewer;
	private int ANIMATION_WIDTH;
	private int ANIMATION_HEIGHT;

	@Override
	public void start(Stage stage) {
		getScreenBounds();
		stage.setTitle("Cell Society");
		startAnimation();
		Scene view = myViewer.init(stage, ANIMATION_WIDTH, ANIMATION_HEIGHT);
		stage.setScene(view);
		stage.show();
	}

	public void startAnimation() {
		Timeline animation = new Timeline();
		myViewer = new CellViewer(animation, this);
		KeyFrame frame = myViewer.start();
		animation.setCycleCount(Timeline.INDEFINITE);
		animation.getKeyFrames().add(frame);
	}

	private void getScreenBounds() {
		Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
		ANIMATION_HEIGHT =(int) (screenBounds.getHeight()/1.1);
		ANIMATION_WIDTH = (int) (screenBounds.getWidth()/1.7);
	}

	public static void main(String [] args) {
		launch(args);
	}
}


text:
ProcessMemory
-------------

This gem extends `Process` module with `memory` method, which returns memory usage in kilobytes, without swap.

```ruby
Process.memory
# => 112884
```


text:
package plugins

import (
	"context"
	"errors"
	"fmt"
	"strings"

	"github.com/traefik/traefik/v2/pkg/log"
)

// Setup setup plugins environment.
func Setup(client *Client, plugins map[string]Descriptor, devPlugin *DevPlugin) error {
	err := checkPluginsConfiguration(plugins)
	if err != nil {
		return fmt.Errorf("invalid configuration: %w", err)
	}

	err = client.CleanArchives(plugins)
	if err != nil {
		return fmt.Errorf("failed to clean archives: %w", err)
	}

	ctx := context.Background()

	for pAlias, desc := range plugins {
		log.FromContext(ctx).Debugf("loading of plugin: %s: %s@%s", pAlias, desc.ModuleName, desc.Version)

		hash, err := client.Download(ctx, desc.ModuleName, desc.Version)
		if err != nil {
			_ = client.ResetAll()
			return fmt.Errorf("failed to download plugin %s: %w", desc.ModuleName, err)
		}

		err = client.Check(ctx, desc.ModuleName, desc.Version, hash)
		if err != nil {
			_ = client.ResetAll()
			return fmt.Errorf("failed to check archive integrity of the plugin %s: %w", desc.ModuleName, err)
		}
	}

	err = client.WriteState(plugins)
	if err != nil {
		_ = client.ResetAll()
		return fmt.Errorf("failed to write plugins state: %w", err)
	}

	for _, desc := range plugins {
		err = client.Unzip(desc.ModuleName, desc.Version)
		if err != nil {
			_ = client.ResetAll()
			return fmt.Errorf("failed to unzip archive: %w", err)
		}
	}

	if devPlugin != nil {
		err := checkDevPluginConfiguration(devPlugin)
		if err != nil {
			return fmt.Errorf("invalid configuration: %w", err)
		}
	}

	return nil
}

func checkDevPluginConfiguration(plugin *DevPlugin) error {
	if plugin == nil {
		return nil
	}

	if plugin.GoPath == "" {
		return errors.New("missing Go Path (prefer a dedicated Go Path)")
	}

	if plugin.ModuleName == "" {
		return errors.New("missing module name")
	}

	m, err := ReadManifest(plugin.GoPath, plugin.ModuleName)
	if err != nil {
		return err
	}

	if m.Type != "middleware" {
		return errors.New("unsupported type")
	}

	if m.Import == "" {
		return errors.New("missing import")
	}

	if !strings.HasPrefix(m.Import, plugin.ModuleName) {
		return fmt.Errorf("the import %q must be related to the module name %q", m.Import, plugin.ModuleName)
	}

	if m.DisplayName == "" {
		return errors.New("missing DisplayName")
	}

	if m.Summary == "" {
		return errors.New("missing Summary")
	}

	if m.TestData == nil {
		return errors.New("missing TestData")
	}

	return nil
}

func checkPluginsConfiguration(plugins map[string]Descriptor) error {
	if plugins == nil {
		return nil
	}

	uniq := make(map[string]struct{})

	var errs []string
	for pAlias, descriptor := range plugins {
		if descriptor.ModuleName == "" {
			errs = append(errs, fmt.Sprintf("%s: plugin name is missing", pAlias))
		}

		if descriptor.Version == "" {
			errs = append(errs, fmt.Sprintf("%s: plugin version is missing", pAlias))
		}

		if strings.HasPrefix(descriptor.ModuleName, "/") || strings.HasSuffix(descriptor.ModuleName, "/") {
			errs = append(errs, fmt.Sprintf("%s: plugin name should not start or end with a /", pAlias))
			continue
		}

		if _, ok := uniq[descriptor.ModuleName]; ok {
			errs = append(errs, fmt.Sprintf("only one version of a plugin is allowed, there is a duplicate of %s", descriptor.ModuleName))
			continue
		}

		uniq[descriptor.ModuleName] = struct{}{}
	}

	if len(errs) > 0 {
		return errors.New(strings.Join(errs, ": "))
	}

	return nil
}


text:
import { createStore, applyMiddleware, combineReducers, compose } from 'redux';
import replicate from 'redux-replicate';

export function getClientState({ providerKey }) {
  if (typeof window !== 'undefined' && window.clientStates) {
    const clientState = window.clientStates[providerKey];

    if (typeof clientState !== 'undefined') {
      return clientState;
    }
  }

  return null;
}

export function getInitialState({ providerKey, state }) {
  const clientState = getClientState({ providerKey, state });

  if (clientState) {
    delete window.clientStates[providerKey];

    return state ? { ...state, ...clientState } : clientState;
  }

  return state || {};
}

/**
 * Creates and returns a store specifically for some provider instance.
 *
 * @param {Object} providerInstance
 * @param {Mixed} storeKey Optional
 * @param {Object} createState Optional
 * @param {Function} createFunction Optional
 * @param {Object} creatorStore Optional
 * @return {Object}
 * @api public
 */
export default function createProviderStore(
  providerInstance, storeKey, createState, createFunction, creatorStore
) {
  const { reducers, middleware, enhancer, replication } = providerInstance;
  const watchedReducers = {};
  const watching = {};
  let enhancers = [];
  let create;
  let store;
  let setState;
  let settingState;
  let combinedReducers;

  if (typeof storeKey === 'undefined') {
    storeKey = providerInstance.providerKey;
  }

  function unshiftReplication({
    key, reducerKeys, queryable, baseQuery, replicator
  }) {
    if (replicator) {
      if (baseQuery) {
        if (Array.isArray(reducerKeys)) {
          for (let reducerKey in baseQuery) {
            if (reducerKeys.indexOf(reducerKey) < 0) {
              reducerKeys.push(reducerKey);
            }
          }
        }

        if (Array.isArray(queryable)) {
          for (let reducerKey in baseQuery) {
            if (queryable.indexOf(reducerKey) < 0) {
              queryable.push(reducerKey);
            }
          }
        }
      }

      enhancers.unshift(
        replicate({
          key: typeof key === 'undefined' ? storeKey : key,
          reducerKeys,
          queryable,
          replicator,
          create: createFunction || Boolean(createState),
          clientState: getClientState(providerInstance),
          creatorStore
        })
      );
    }
  }

  if (middleware) {
    enhancers.push(applyMiddleware.apply(null, [].concat(middleware)));
  }

  if (enhancer) {
    enhancers = enhancers.concat(enhancer);
  }

  if (replication) {
    if (Array.isArray(replication)) {
      for (let { key } of replication) {
        if (typeof key !== 'undefined') {
          storeKey = key;
          break;
        }
      }

      replication.forEach(unshiftReplication);
    } else {
      unshiftReplication(replication);
    }
  }

  if (enhancers.length) {
    create = compose(...enhancers)(createStore);
  } else {
    create = createStore;
  }

  const initialState = {};
  const preInitialState = {
    ...(createState || getInitialState(providerInstance))
  };

  Object.keys(reducers).forEach(reducerKey => {
    if (typeof preInitialState[reducerKey] !== 'undefined') {
      initialState[reducerKey] = preInitialState[reducerKey];
    }

    watchedReducers[reducerKey] = (state, action) => {
      let nextState;

      if (settingState && typeof settingState[reducerKey] !== 'undefined') {
        nextState = settingState[reducerKey];
      } else {
        nextState = reducers[reducerKey](state, action);
      }

      if (watching[reducerKey] && state !== nextState) {
        watching[reducerKey].forEach(fn => fn(nextState));
      }

      return nextState;
    };
  });

  combinedReducers = combineReducers(watchedReducers);
  store = create(combinedReducers, initialState);

  // we use a custom `watch` method with instead of a replicator
  // since it's slightly more efficient and every clock cycle counts,
  // especially with potentially thousands or even millions of components
  store.watch = (reducerKey, fn) => {
    if (!watching[reducerKey]) {
      watching[reducerKey] = new Set();
    }

    watching[reducerKey].add(fn);

    return () => watching[reducerKey].delete(fn);
  };

  setState = store.setState;
  store.setState = (...args) => {
    const [ nextState ] = args;
    const state = store.getState();

    if (setState) {
      for (let reducerKey in nextState) {
        let current = state[reducerKey];
        let next = nextState[reducerKey];

        if (watching[reducerKey] && current !== next) {
          watching[reducerKey].forEach(fn => fn(next));
        }
      }

      setState(...args);
    } else {
      settingState = nextState;
      store.replaceReducer(combinedReducers);
      settingState = null;
    }
  };

  return store;
}


text:
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Web.Mvc;
using System.Diagnostics.Contracts;
using HyperSlackers.Bootstrap.Core;
using HyperSlackers.Bootstrap.Extensions;

namespace HyperSlackers.Bootstrap
{
    /// <summary>
    /// Represents a Bootstrap Carousel (slideshow) object
    /// </summary>
	public class Carousel : HtmlElement<Carousel>
	{
        // TODO: add width/height to carousel? or just make user deal with it?
        internal uint indicators;
        internal uint interval;
        internal Icon nextIcon = new FontAwesomeIcon(FontAwesomeIconType.ChevronRight);
        internal Icon prevIcon = new FontAwesomeIcon(FontAwesomeIconType.ChevronLeft);
        internal bool pause;
        internal bool withJs;

        /// <summary>
        /// Initializes a new instance of the <see cref="Carousel"/> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
		public Carousel(string id)
            : base("div")
		{
            Contract.Requires<ArgumentException>(!id.IsNullOrWhiteSpace());

			this.id = HtmlHelper.GenerateIdFromName(id);
            interval = 3500;
            AddClass("carousel slide");
            MergeHtmlAttribute("data-ride", "carousel");
            AddOrReplaceHtmlAttribute("id", this.id);
		}

        /// <summary>
        /// Sets the icon to use for the next button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>The current Carousel object.</returns>
		public Carousel NextIcon(GlyphIconType icon)
        {
            Contract.Ensures(Contract.Result<Carousel>() != null);

            nextIcon = new GlyphIcon(icon);

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the next button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>The current Carousel object.</returns>
        public Carousel NextIcon(FontAwesomeIconType icon)
        {
            Contract.Ensures(Contract.Result<Carousel>() != null);

            nextIcon = new FontAwesomeIcon(icon);

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the next button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel NextIcon(Icon icon)
        {
            Contract.Requires<ArgumentNullException>(icon != null, "icon");
            Contract.Ensures(Contract.Result<Carousel>() != null);

            nextIcon = icon;

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the next button.
        /// </summary>
        /// <param name="iconCssClass">The icon CSS class.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel NextIcon(string iconCssClass)
        {
            Contract.Requires<ArgumentException>(!iconCssClass.IsNullOrWhiteSpace());
            Contract.Ensures(Contract.Result<Carousel>() != null);

            nextIcon = new GlyphIcon(iconCssClass);

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the previous button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel PrevIcon(GlyphIconType icon)
        {
            Contract.Ensures(Contract.Result<Carousel>() != null);

            prevIcon = new GlyphIcon(icon);

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the previous button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel PrevIcon(FontAwesomeIconType icon)
        {
            Contract.Ensures(Contract.Result<Carousel>() != null);

            prevIcon = new FontAwesomeIcon(icon);

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the previous button.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel PrevIcon(Icon icon)
        {
            Contract.Requires<ArgumentNullException>(icon != null, "icon");
            Contract.Ensures(Contract.Result<Carousel>() != null);

            prevIcon = icon;

            return this;
        }

        /// <summary>
        /// Sets the icon to use for the previous button.
        /// </summary>
        /// <param name="iconCssClass">The icon CSS class.</param>
        /// <returns>
        /// The current Carousel object.
        /// </returns>
        public Carousel PrevIcon(string iconCssClass)
        {
            Contract.Requires<ArgumentException>(!iconCssClass.IsNullOrWhiteSpace());
            Contract.Ensures(Contract.Result<Carousel>() != null);

            prevIcon = new GlyphIcon(iconCssClass);

            return this;
        }

        /// <summary>
        /// Removes the sliding animation from the Carousel.
        /// </summary>
        /// <returns>The current carousel object.</returns>
        public Carousel DontSlide()
		{
            Contract.Ensures(Contract.Result<Carousel>() != null);

            RemoveClass("slide");

			return this;
		}

        /// <summary>
        /// Adds the specified number of indicator icons to the bottom of the Carousel.
        /// </summary>
        /// <param name="indicators">The number of indicators to display.</param>
        /// <returns>The current carousel object.</returns>
		public Carousel Indicators(uint indicators)
		{
            Contract.Ensures(Contract.Result<Carousel>() != null);

			this.indicators = indicators;

			return this;
		}

        /// <summary>
        /// Sets the interval (in milliseconds) between slide transitions.
        /// </summary>
        /// <param name="interval">The interval.</param>
        /// <returns>The current carousel object.</returns>
		public Carousel Interval(uint interval)
		{
            Contract.Requires<ArgumentOutOfRangeException>(interval > 0);
            Contract.Ensures(Contract.Result<Carousel>() != null);

			this.interval = interval;
            AddOrReplaceHtmlAttribute("data-interval", interval.ToString());

			return this;
		}

        /// <summary>
        /// Causes the Carousel to pause on mouse hover and resume animation on mouse exit.
        /// </summary>
        /// <returns>The current carousel object.</returns>
		public Carousel Pause()
		{
            Contract.Ensures(Contract.Result<Carousel>() != null);

            pause = true;
            AddOrReplaceHtmlAttribute("data-pause", "hover");

			return this;
		}

        /// <summary>
        /// Renders javascript to begin the carousel animation.
        /// </summary>
        /// <returns>The current carousel object.</returns>
		public Carousel WithJs()
		{
            Contract.Ensures(Contract.Result<Carousel>() != null);

            withJs = true;

			return this;
		}
	}
}


text:
/**
 *    @file
 *      This file defines constant enumerations for all public (or
 *      common) protocols.
 *
 */

#pragma once

#include <lib/core/CHIPVendorIdentifiers.hpp>

namespace chip {
namespace Protocols {

//
// CHIP Protocol Ids (32-bits max)
//
class Id
{
public:
    constexpr Id(VendorId aVendorId, uint16_t aProtocolId) : mVendorId(aVendorId), mProtocolId(aProtocolId) {}

    constexpr bool operator==(const Id & aOther) const
    {
        return mVendorId == aOther.mVendorId && mProtocolId == aOther.mProtocolId;
    }

    constexpr bool operator!=(const Id & aOther) const { return !(*this == aOther); }

    // Convert the Protocols::Id to a TLV profile id.
    // NOTE: We may want to change the TLV reader/writer to take Protocols::Id
    // directly later on and get rid of this method.
    constexpr uint32_t ToTLVProfileId() const { return ToUint32(); }

    // Convert the protocol id to a 32-bit unsigned integer "fully qualified"
    // form as defined in the spec.  This should only be used in the places
    // where the spec defines a 32-bit unsigned in as a wire representation of
    // protocol id.
    constexpr uint32_t ToFullyQualifiedSpecForm() const { return ToUint32(); }

    constexpr VendorId GetVendorId() const { return mVendorId; }
    constexpr uint16_t GetProtocolId() const { return mProtocolId; }

    static constexpr uint32_t kVendorIdShift = 16;

    static Id FromFullyQualifiedSpecForm(uint32_t aSpecForm)
    {
        return Id(static_cast<VendorId>(aSpecForm >> kVendorIdShift),
                  static_cast<uint16_t>(aSpecForm & ((1 << kVendorIdShift) - 1)));
    }

private:
    constexpr uint32_t ToUint32() const { return (static_cast<uint32_t>(mVendorId) << kVendorIdShift) | mProtocolId; }

    chip::VendorId mVendorId;
    uint16_t mProtocolId;
};

// Common Protocols
//
// NOTE: Do not attempt to allocate these values yourself.
#define CHIP_STANDARD_PROTOCOL(name, id)                                                                                \
    namespace name {                                                                                \
    static constexpr Protocols::Id Id(VendorId::Common, id);                                                                       \
    } // namespace name.

CHIP_STANDARD_PROTOCOL(SecureChannel, 0x0000)             // Secure Channel Protocol
CHIP_STANDARD_PROTOCOL(InteractionModel, 0x0001)          // Interaction Model Protocol
CHIP_STANDARD_PROTOCOL(BDX, 0x0002)                       // Bulk Data Exchange Protocol
CHIP_STANDARD_PROTOCOL(UserDirectedCommissioning, 0x0003) // User Directed Commissioning Protocol
CHIP_STANDARD_PROTOCOL(Echo, 0x0004)                      // Echo Protocol.  To be removed or standardized.

#undef CHIP_STANDARD_PROTOCOL

// Protocols reserved for internal protocol use
static constexpr Id NotSpecified(VendorId::NotSpecified, 0xFFFF); // The profile ID is either not specified or a wildcard

// Pre-delare our MessageTypeTraits so message type headers know what they are
// specializing.
template <typename T>
struct MessageTypeTraits;

} // namespace Protocols
} // namespace chip


text:
@echo off

SET ASM=%1
SET EXARG=

if NOT X%PROCESSOR_ARCHITECTURE% == X goto defined

echo Processor Architecture Undefined: defaulting to X86

goto X86

:defined

if %PROCESSOR_ARCHITECTURE% == x86 goto X86

if %PROCESSOR_ARCHITECTURE% == IA64 goto IA64

if %PROCESSOR_ARCHITECTURE% == AMD64 goto AMD64

echo Processor Architecture Unrecognized: defaulting to X86

:X86
echo Auto Configuring for X86

SET TARGET=VC-WIN32
if x%ASM% == xno-asm goto compile
SET ASM=nasm

goto compile

:IA64

echo Auto Configuring for IA64
SET TARGET=VC-WIN64I

goto compile

:AMD64

echo Auto Configuring for AMD64
SET TARGET=VC-WIN64A
if x%ASM% == xno-asm goto compile
SET ASM=nasm

:compile

if x%ASM% == xno-asm SET EXARG=no-asm
perl Configure %TARGET% %EXARG% fipscheck
pause

echo on

perl util\mkfiles.pl >MINFO
@if ERRORLEVEL 1 goto error
perl util\mk1mf.pl dll %ASM% %TARGET% >ms\ntdll.mak
@if ERRORLEVEL 1 goto error

nmake -f ms\ntdll.mak clean
nmake -f ms\ntdll.mak
@if ERRORLEVEL 1 goto error
nmake -f ms\ntdll.mak install
@if ERRORLEVEL 1 goto error

@echo.
@echo.
@echo.
@echo ***************************
@echo ****FIPS BUILD SUCCESS*****
@echo ***************************

@goto end

:error

@echo.
@echo.
@echo.
@echo ***************************
@echo ****FIPS BUILD FAILURE*****
@echo ***************************

:end


text:
Changelog
========

Master
------

0.1.14
------
 - Fix: Facets now accepts arrays and inline arguments

0.1.14
------
 - Fix: OrFilter now works appropriately if _cache is specified with multiple filters/queries
 - Fix: AndFilter now behaves like OrFilter

0.1.13
------
 - Fix: Fix _Analyzer mapping
 - Change: RawRequest added, RawQuery "downgraded" to affecting only "query: {}" portion of query, RawFilter + RawFacet added
 - Fix: Bool Filter/Query fixed when a single object is provided
 - Fix: Throw a new DocumentMissingException when attempting to delete a nonexistent document
 - Fix: FilterQuery now correctly converts child filter data to json
 - Feature: Add boost param to Term Query
 - Feature: Add fields param to Search request
 - Feature: Add GeoPoint mappings
 - In-progress: Refactor components to use static methods
 - In-progress: Refactor components to set only arguments that have been sepcified (no more defaults)
 - Fix: General refactoring
 - Fix: CustomFilterScore now supports the boost parameter
 - Addition: custom CodeSniffer code standard now included in repo for contributors to use

0.1.12
------
 - Feature: Performance enhancements to RollingCurl when the pending request buffer is large
 - Feature: Add filter_facets to facets
 - Feature: Add Update capability to indexing operations
 - Feature: Add _Analyzer mapping support

0.1.11
------
 - Fix: Mappings on index creation were not working properly

0.1.10
------
 - Fix: Search requests were using malformed JSON
 - Fix: All requests lacked appropriate Content-Type headers, leading to HTTP requests with url-encoding specified

0.1.9
-----
 - Fix: Relax the version requirement for Event-Dispatcher to ~2.1

0.1.8
-----
 - Internal: Replace Guzzle with RollingCurl (also [Fixes #20](https://github.com/polyfractal/sherlock/issues/20))
 - Feature: Batch document indexing. [Closes #24](https://github.com/polyfractal/sherlock/issues/24)
 - Feature: Some of the more commone ES errors are now returned as Exceptions. [Closes #21](https://github.com/polyfractal/sherlock/issues/21)
 - Fix: Raw query now is 100% "raw", rather than wrapping inside a "query". [Closes #23](https://github.com/polyfractal/sherlock/pull/23)

0.1.7
-----
 - Breaking Change: Sherlock static builder functions refactored with consistent naming scheme [Fixes #5](https://github.com/polyfractal/sherlock/issues/5)
 - Internal: Refactor composeFinalQuery to use assoc arrays instead of strings [Fixes #13](https://github.com/polyfractal/sherlock/issues/13)
 - Feature: Add support for all facets (Terms, Range, Histogram, DateHistogram, Filter, Query, Statistical, TermsStats, Geodistance) [Closes #16](https://github.com/polyfractal/sherlock/issues/16)

0.1.6
-----
 - Fix: Sort ordering fixed, uses "order" instead of "sort_order" [Fixes #14](https://github.com/polyfractal/sherlock/pull/14)

0.1.5
-----
 - Fix: Change default logging state to disabled [474fa95](https://github.com/polyfractal/sherlock/commit/474fa957c61b550fa043315757a4e279179dc0d8)
 - Fix: Integrate Symfony EventDispatcher to decouple nodes from Requests. [Fixes #10](https://github.com/polyfractal/sherlock/issues/10)
 - Feature: Enable custom logging handlers [Usage](https://github.com/polyfractal/sherlock/issues/12#issuecomment-14682664) [474fa95](https://github.com/polyfractal/sherlock/commit/474fa957c61b550fa043315757a4e279179dc0d8)

0.1.4
-----
 - Fix: Updated Analog dependency to remove a logging bug [4c3c69e](https://github.com/polyfractal/sherlock/commit/4c3c69e59365784e70c2ec8d0d83bc8d5a060fda)

0.1.3
------
 - Feature: Enable sorting on Search Requests
 - Fix: From/Size fixed
 - Fix: Match query now allows 'type' to be set
 - Fix: Default fuzziness for Match query set to 'null'
 - Fix: Default fuzziness for MultiMatch query set to 'null'