text:
namespace llvm {
  class GlobalVariable;
  class MemoryBuffer;
  class Module;
  class TargetOptions;
  class TargetMachine;
}

namespace swift {
  class GenericSignatureBuilder;
  class ASTContext;
  class CodeCompletionCallbacksFactory;
  class Decl;
  class DeclContext;
  class DelayedParsingCallbacks;
  class DiagnosticConsumer;
  class DiagnosticEngine;
  class FileUnit;
  class GenericEnvironment;
  class GenericParamList;
  class IRGenOptions;
  class LangOptions;
  class ModuleDecl;
  class Parser;
  class PersistentParserState;
  class SerializationOptions;
  class SILOptions;
  class SILModule;
  class SILParserTUState;
  class SourceFile;
  class SourceManager;
  class Token;
  class TopLevelContext;
  struct TypeLoc;

  /// SILParserState - This is a context object used to optionally maintain SIL
  /// parsing context for the parser.
  class SILParserState {
  public:
    SILModule *M;
    SILParserTUState *S;

    explicit SILParserState(SILModule *M);
    ~SILParserState();
  };

  /// @{

  /// \returns true if the declaration should be verified.  This can return
  /// false to decrease the number of declarations we verify in a single
  /// compilation.
  bool shouldVerify(const Decl *D, const ASTContext &Context);

  /// \brief Check that the source file is well-formed, aborting and spewing
  /// errors if not.
  ///
  /// "Well-formed" here means following the invariants of the AST, not that the
  /// code written by the user makes sense.
  void verify(SourceFile &SF);
  void verify(Decl *D);

  /// @}

  /// \brief Parse a single buffer into the given source file.
  ///
  /// If the source file is the main file, stop parsing after the next
  /// stmt-brace-item with side-effects.
  ///
  /// \param SF the file within the module being parsed.
  ///
  /// \param BufferID the buffer to parse from.
  ///
  /// \param[out] Done set to \c true if end of the buffer was reached.
  ///
  /// \param SIL if non-null, we're parsing a SIL file.
  ///
  /// \param PersistentState if non-null the same PersistentState object can
  /// be used to resume parsing or parse delayed function bodies.
  ///
  /// \param DelayedParseCB if non-null enables delayed parsing for function
  /// bodies.
  ///
  /// \return true if the parser found code with side effects.
  bool parseIntoSourceFile(SourceFile &SF, unsigned BufferID, bool *Done,
                           SILParserState *SIL = nullptr,
                           PersistentParserState *PersistentState = nullptr,
                           DelayedParsingCallbacks *DelayedParseCB = nullptr);

  /// \brief Finish the parsing by going over the nodes that were delayed
  /// during the first parsing pass.
  void performDelayedParsing(DeclContext *DC,
                             PersistentParserState &PersistentState,
                             CodeCompletionCallbacksFactory *Factory);

  /// \brief Lex and return a vector of tokens for the given buffer.
  std::vector<Token> tokenize(const LangOptions &LangOpts,
                              const SourceManager &SM, unsigned BufferID,
                              unsigned Offset = 0, unsigned EndOffset = 0,
                              bool KeepComments = true,
                              bool TokenizeInterpolatedString = true,
                              ArrayRef<Token> SplitTokens = ArrayRef<Token>());

  /// \brief Lex and return a vector of `RC<TokenSyntax>` tokens, which include
  /// leading and trailing trivia.
  std::vector<std::pair<syntax::RC<syntax::TokenSyntax>,
                                   syntax::AbsolutePosition>>
  tokenizeWithTrivia(const LangOptions &LangOpts,
                     const SourceManager &SM,
                     unsigned BufferID,
                     unsigned Offset = 0,
                     unsigned EndOffset = 0);

  /// Once parsing is complete, this walks the AST to resolve imports, record
  /// operators, and do other top-level validation.
  ///
  /// \param StartElem Where to start for incremental name binding in the main
  ///                  source file.
  void performNameBinding(SourceFile &SF, unsigned StartElem = 0);

  /// Once parsing and name-binding are complete, this optionally transforms the
  /// ASTs to add calls to external logging functions.
  ///
  /// \param HighPerformance True if the playground transform should omit
  /// instrumentation that has a high runtime performance impact.
  void performPlaygroundTransform(SourceFile &SF, bool HighPerformance);

  /// Once parsing and name-binding are complete this optionally walks the ASTs
  /// to add calls to externally provided functions that simulate
  /// "program counter"-like debugging events.
  void performPCMacro(SourceFile &SF, TopLevelContext &TLC);

  /// Flags used to control type checking.
  enum class TypeCheckingFlags : unsigned {
    /// Whether to delay checking that benefits from having the entire
    /// module parsed, e.g., Objective-C method override checking.
    DelayWholeModuleChecking = 1 << 0,

    /// If set, dumps wall time taken to check each function body to
    /// llvm::errs().
    DebugTimeFunctionBodies = 1 << 1,

    /// Indicates that the type checker is checking code that will be
    /// immediately executed.
    ForImmediateMode = 1 << 2,

    /// If set, dumps wall time taken to type check each expression to
    /// llvm::errs().
    DebugTimeExpressions = 1 << 3,
  };

  /// Once parsing and name-binding are complete, this walks the AST to resolve
  /// types and diagnose problems therein.
  ///
  /// \param StartElem Where to start for incremental type-checking in the main
  /// source file.
  ///
  /// \param WarnLongFunctionBodies If non-zero, warn when a function body takes
  /// longer than this many milliseconds to type-check
  void performTypeChecking(SourceFile &SF, TopLevelContext &TLC,
                           OptionSet<TypeCheckingFlags> Options,
                           unsigned StartElem = 0,
                           unsigned WarnLongFunctionBodies = 0);

  /// Once type checking is complete, this walks protocol requirements
  /// to resolve default witnesses.
  void finishTypeChecking(SourceFile &SF);

  /// Now that we have type-checked an entire module, perform any type
  /// checking that requires the full module, e.g., Objective-C method
  /// override checking.
  ///
  /// Note that clients still perform this checking file-by-file to
  /// provide a somewhat defined order in which diagnostics should be
  /// emitted.
  void performWholeModuleTypeChecking(SourceFile &SF);

  /// Incrementally type-check only added external definitions.
  void typeCheckExternalDefinitions(SourceFile &SF);

  /// \brief Recursively validate the specified type.
  ///
  /// This is used when dealing with partial source files (e.g. SIL parsing,
  /// code completion).
  ///
  /// \returns false on success, true on error.
  bool performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
                              DeclContext *DC,
                              bool ProduceDiagnostics = true);

  /// \brief Recursively validate the specified type.
  ///
  /// This is used when dealing with partial source files (e.g. SIL parsing,
  /// code completion).
  ///
  /// \returns false on success, true on error.
  bool performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
                              bool isSILMode,
                              bool isSILType,
                              GenericEnvironment *GenericEnv,
                              DeclContext *DC,
                              bool ProduceDiagnostics = true);

  /// Expose TypeChecker's handling of GenericParamList to SIL parsing.
  GenericEnvironment *handleSILGenericParams(ASTContext &Ctx,
                                             GenericParamList *genericParams,
                                             DeclContext *DC);

  /// Turn the given module into SIL IR.
  ///
  /// The module must contain source files.
  ///
  /// If \p makeModuleFragile is true, all functions and global variables of
  /// the module are marked as fragile. This is used for compiling the stdlib.
  /// if \p wholeModuleCompilation is true, the optimizer assumes that the SIL
  /// of all files in the module is present in the SILModule.
  std::unique_ptr<SILModule>
  performSILGeneration(ModuleDecl *M, SILOptions &options,
                       bool makeModuleFragile = false,
                       bool wholeModuleCompilation = false);

  /// Turn a source file into SIL IR.
  ///
  /// If \p StartElem is provided, the module is assumed to be only part of the
  /// SourceFile, and any optimizations should take that into account.
  /// If \p makeModuleFragile is true, all functions and global variables of
  /// the module are marked as fragile. This is used for compiling the stdlib.
  std::unique_ptr<SILModule>
  performSILGeneration(FileUnit &SF, SILOptions &options,
                       Optional<unsigned> StartElem = None,
                       bool makeModuleFragile = false);

  using ModuleOrSourceFile = PointerUnion<ModuleDecl *, SourceFile *>;

  /// Serializes a module or single source file to the given output file.
  void serialize(ModuleOrSourceFile DC, const SerializationOptions &options,
                 const SILModule *M = nullptr);

  /// Get the CPU and subtarget feature options to use when emitting code.
  std::tuple<llvm::TargetOptions, std::string, std::vector<std::string>>
  getIRTargetOptions(IRGenOptions &Opts, ASTContext &Ctx);

  /// Turn the given Swift module into either LLVM IR or native code
  /// and return the generated LLVM IR module.
  /// If you set an outModuleHash, then you need to call performLLVM.
  std::unique_ptr<llvm::Module>
  performIRGeneration(IRGenOptions &Opts, ModuleDecl *M,
                      std::unique_ptr<SILModule> SILMod,
                      StringRef ModuleName, llvm::LLVMContext &LLVMContext,
                      llvm::GlobalVariable **outModuleHash = nullptr);

  /// Turn the given Swift module into either LLVM IR or native code
  /// and return the generated LLVM IR module.
  /// If you set an outModuleHash, then you need to call performLLVM.
  std::unique_ptr<llvm::Module>
  performIRGeneration(IRGenOptions &Opts, SourceFile &SF,
                      std::unique_ptr<SILModule> SILMod,
                      StringRef ModuleName, llvm::LLVMContext &LLVMContext,
                      unsigned StartElem = 0,
                      llvm::GlobalVariable **outModuleHash = nullptr);

  /// Given an already created LLVM module, construct a pass pipeline and run
  /// the Swift LLVM Pipeline upon it. This does not cause the module to be
  /// printed, only to be optimized.
  void performLLVMOptimizations(IRGenOptions &Opts, llvm::Module *Module,
                                llvm::TargetMachine *TargetMachine);

  /// Wrap a serialized module inside a swift AST section in an object file.
  void createSwiftModuleObjectFile(SILModule &SILMod, StringRef Buffer,
                                   StringRef OutputPath);

  /// Turn the given LLVM module into native code and return true on error.
  bool performLLVM(IRGenOptions &Opts, ASTContext &Ctx,
                   llvm::Module *Module);

  /// Run the LLVM passes. In multi-threaded compilation this will be done for
  /// multiple LLVM modules in parallel.
  /// \param Diags may be null if LLVM code gen diagnostics are not required.
  /// \param DiagMutex may also be null if a mutex around \p Diags is not
  ///                  required.
  /// \param HashGlobal used with incremental LLVMCodeGen to know if a module
  ///                   was already compiled, may be null if not desired.
  /// \param Module LLVM module to code gen, required.
  /// \param TargetMachine target of code gen, required.
  /// \param effectiveLanguageVersion version of the language, effectively.
  /// \param OutputFilename Filename for output.
  bool performLLVM(IRGenOptions &Opts, DiagnosticEngine *Diags,
                   llvm::sys::Mutex *DiagMutex,
                   llvm::GlobalVariable *HashGlobal,
                   llvm::Module *Module,
                   llvm::TargetMachine *TargetMachine,
                   const version::Version &effectiveLanguageVersion,
                   StringRef OutputFilename);

  /// Creates a TargetMachine from the IRGen opts and AST Context.
  std::unique_ptr<llvm::TargetMachine>
  createTargetMachine(IRGenOptions &Opts, ASTContext &Ctx);

  /// A convenience wrapper for Parser functionality.
  class ParserUnit {
  public:
    ParserUnit(SourceManager &SM, unsigned BufferID,
               const LangOptions &LangOpts, StringRef ModuleName);
    ParserUnit(SourceManager &SM, unsigned BufferID);
    ParserUnit(SourceManager &SM, unsigned BufferID,
               unsigned Offset, unsigned EndOffset);

    ~ParserUnit();

    Parser &getParser();
    SourceFile &getSourceFile();
    DiagnosticEngine &getDiagnosticEngine();
    const LangOptions &getLangOptions() const;

  private:
    struct Implementation;
    Implementation &Impl;
  };
} // end namespace swift

#endif // SWIFT_SUBSYSTEMS_H


text:
import java.util.List;

class X {
  void test(List<?> list) {
    list.stream().filter(x -> x instanceof String s && !s.isEmpty()).filter(x -> x.hashCode() > 0).forEach(System.out::println);
  }
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import

from django.conf import settings

from sentry.utils.services import LazyServiceWrapper

from .base import RateLimiter  # NOQA

backend = LazyServiceWrapper(
    RateLimiter, settings.SENTRY_RATELIMITER, settings.SENTRY_RATELIMITER_OPTIONS
)
backend.expose(locals())


text:
import React from 'react'
import { Icon, Card } from 'antd'
import CountUp from 'react-countup'

const CountUpCard = ({ icon, title, number, color, handleClick }) => {
  return (
    <Card style={{padding: '32px', marginBottom: '24px', cursor: 'pointer'}}
     bordered={false} bodyStyle={{ padding: 0 }} onClick={handleClick}>
      <Icon style={{fontSize: '54px', float: 'left', color: color}} type={icon} />

{title}

          <CountUp
            start={0}
            end={number}
            duration={2.75}
            useEasing
            useGrouping
            separator=","
          />

    </Card>
  )
}

export default CountUpCard


text:
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Create Security Group" %}{% endblock %}

{% block main %}
  {% include 'project/access_and_security/security_groups/_create.html' %}
{% endblock %}


text:
const AbilityTargetMessages = require('./AbilityTargetMessages');
const AbilityChoiceSelection = require('./AbilityChoiceSelection');
const CardSelector = require('./CardSelector.js');
const Messages = require('./Messages');

class AbilityTarget {
    static create(name, properties) {
        let {message, messages, ...rest} = properties;
        let defaultMessages = ['each', 'eachOpponent'].includes(properties.choosingPlayer) ? Messages.eachPlayerTargeting : null;

        let abilityMessages = new AbilityTargetMessages({
            message,
            messages: messages || defaultMessages
        });

        return new AbilityTarget(name, Object.assign(rest, { messages: abilityMessages }));
    }

    constructor(name, properties) {
        this.type = properties.type || 'choose';
        this.choosingPlayer = properties.choosingPlayer || 'current';
        this.name = name;
        this.properties = properties;
        this.selector = CardSelector.for(properties);
        this.messages = properties.messages;
        this.ifAble = !!properties.ifAble;
    }

    canResolve(context) {
        const players = this.getChoosingPlayers(context);
        return this.ifAble || players.length > 0 && players.every(choosingPlayer => {
            context.choosingPlayer = choosingPlayer;
            return this.selector.hasEnoughTargets(context);
        });
    }

    resolve(context) {
        let results = this.getChoosingPlayers(context).map(choosingPlayer => {
            context.choosingPlayer = choosingPlayer;
            let eligibleCards = this.selector.getEligibleTargets(context);
            return new AbilityChoiceSelection({
                choosingPlayer: choosingPlayer,
                eligibleChoices: eligibleCards,
                targetingType: this.type,
                name: this.name
            });
        });

        for(let result of results) {
            context.game.queueSimpleStep(() => {
                this.resolveAction(result, context);
            });
        }

        return results;
    }

    getChoosingPlayers(context) {
        if(typeof this.choosingPlayer === 'function') {
            return context.game.getPlayersInFirstPlayerOrder().filter(player => this.choosingPlayer(player));
        }

        if(this.choosingPlayer === 'each') {
            return context.game.getPlayersInFirstPlayerOrder();
        }

        if(this.choosingPlayer === 'eachOpponent') {
            return context.game.getOpponentsInFirstPlayerOrder(context.player);
        }

        return [context.player];
    }

    resolveAction(result, context) {
        context.choosingPlayer = result.choosingPlayer;
        context.currentTargetSelection = result;

        let unableToSelect = !this.selector.hasEnoughTargets(context) || this.selector.optional && result.hasNoChoices();
        if(this.ifAble && unableToSelect) {
            this.messages.outputUnable(context.game, context);
            result.reject();
            return;
        }

        let otherProperties = Object.assign({}, this.properties);
        delete otherProperties.cardCondition;
        delete otherProperties.choosingPlayer;
        delete otherProperties.messages;
        let promptProperties = {
            context: context,
            source: context.source,
            selector: this.selector,
            onSelect: (player, card) => {
                result.resolve(card);
                if(!card || card.length === 0) {
                    this.messages.outputNoneSelected(context.game, context);
                } else {
                    this.messages.outputSelected(context.game, context);
                }
                return true;
            },
            onCancel: () => {
                if(this.ifAble) {
                    result.reject();
                } else {
                    result.cancel();
                }
                this.messages.outputSkipped(context.game, context);
                return true;
            }
        };
        context.game.promptForSelect(result.choosingPlayer, Object.assign(promptProperties, otherProperties));
    }
}

module.exports = AbilityTarget;


text:
package com.dotcool.reader.task;

import java.util.ArrayList;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import com.dotcool.R;
import com.dotcool.reader.callback.CallbackEventData;
import com.dotcool.reader.callback.ICallbackEventData;
import com.dotcool.reader.callback.ICallbackNotifier;
import com.dotcool.reader.dao.NovelsDao;
import com.dotcool.reader.helper.AsyncTaskResult;
import com.dotcool.reader.model.NovelCollectionModel;
import com.dotcool.reader.model.PageModel;

public class DownloadNovelDetailsTask extends AsyncTask<PageModel, ICallbackEventData, AsyncTaskResult<NovelCollectionModel[]>> implements ICallbackNotifier {
	public volatile IAsyncTaskOwner owner;
	private int currentPart = 0;
	private int totalParts = 0;
	private final String taskId;

	public DownloadNovelDetailsTask(IAsyncTaskOwner owner) {
		this.owner = owner;
		this.taskId = this.toString();
	}

	@Override
	protected void onPreExecute() {
		// executed on UI thread.
		// owner.toggleProgressBar(true);
		boolean exists = false;
		exists = owner.downloadListSetup(this.taskId, null, 0, false);
		if (exists)
			this.cancel(true);
	}

	public void onCallback(ICallbackEventData message) {
		publishProgress(message);
	}

	@Override
	protected AsyncTaskResult<NovelCollectionModel[]> doInBackground(PageModel... params) {
		Context ctx = owner.getContext();
		ArrayList<NovelCollectionModel> result = new ArrayList<NovelCollectionModel>();
		totalParts = params.length;
		for (PageModel pageModel : params) {
			currentPart++;
			try {
				publishProgress(new CallbackEventData(ctx.getResources().getString(R.string.download_novel_details_task_progress, pageModel.getTitle())));
				NovelCollectionModel novelCol = NovelsDao.getInstance().getNovelDetailsFromInternet(pageModel, this);
				Log.d("DownloadNovelDetailsTask", "Downloaded: " + novelCol.getPage());
				result.add(novelCol);
			} catch (Exception e) {
				Log.e("DownloadNovelDetailsTask", "Failed to download novel details for " + pageModel.getPage() + ": " + e.getMessage(), e);
				publishProgress(new CallbackEventData(ctx.getResources().getString(R.string.download_novel_details_task_error, pageModel.getPage(), e.getMessage())));
				return new AsyncTaskResult<NovelCollectionModel[]>(e);
			}
		}
		return new AsyncTaskResult<NovelCollectionModel[]>(result.toArray(new NovelCollectionModel[result.size()]));
	}

	@Override
	protected void onProgressUpdate(ICallbackEventData... values) {
		// executed on UI thread.
		owner.setMessageDialog(values[0]);
		owner.updateProgress(this.taskId, currentPart, totalParts, values[0].getMessage());
	}

	@Override
	protected void onPostExecute(AsyncTaskResult<NovelCollectionModel[]> result) {
		owner.setMessageDialog(new CallbackEventData(owner.getContext().getResources().getString(R.string.download_novel_details_task_complete)));
		owner.onGetResult(result, NovelCollectionModel[].class);
		owner.downloadListSetup(this.taskId, null, 2, result.getError() != null ? true : false);
	}
}


text:
layout:     post
title:      "Hello my first post"
subtitle:   "Because everything has a beginning"
date:       2015-05-18 12:06:00
author:     "Benoit VALLON"
header-img: "/img/2015-05-18-hello-my-first-post/post-hello-my-first-post.jpg"
comments:   true
categories: welcome
tags:       [good, morning]
---

# Let's start!

Because everything has a beginning and because when you are a developer there is a special kind of beginning. I will try to make it a little bit different.

```js
console.log('Hello my first post!');
// => Hello my first post!
```

As new New Yorker for a month and a half now I can't omit this one as well.

```js
console.log('Hello New York!');
// => Hello New York!
```

# Why this blog?

Quite short for a first post, isn't it? But that the style that I would like to give to this blog. I read a lot of blogs and books about code and I have always felt that they could have been as clear as they are with less talking. I will try to make my posts as clear as I can and limit the talking to focus on code. We are developers after all.

The following coming soon.


text:
OCAMLBUILD = ocamlbuild -use-ocamlfind -classic-display

lib:
	$(OCAMLBUILD) lib/imap.cma
	-$(OCAMLBUILD) lib/imap.cmxa
	-$(OCAMLBUILD) lib/imap.cmxs

imap_shell:
	$(OCAMLBUILD) test/imap_shell.byte

wait_mail:
	$(OCAMLBUILD) test/wait_mail.byte

all: lib imap_shell wait_mail

clean:
	$(OCAMLBUILD) -clean

doc:
	$(OCAMLBUILD) -docflags -colorize-code,-css-style,style.css doc/api.docdir/index.html
	cp doc/style.css api.docdir/

install: lib
	opam-installer --prefix=`opam config var prefix` imap.install

uninstall:
	opam-installer --prefix=`opam config var prefix` -u imap.install

reinstall: uninstall install

gh-pages: doc
	git clone `git config --get remote.origin.url` .gh-pages --reference .
	git -C .gh-pages checkout --orphan gh-pages
	git -C .gh-pages reset
	git -C .gh-pages clean -dxf
	cp api.docdir/* .gh-pages/
	git -C .gh-pages add .
	git -C .gh-pages commit -m "Update Pages"
	git -C .gh-pages push origin gh-pages -f
	rm -rf .gh-pages

prepare: lib doc
ifdef VERSION
	git diff --quiet && git diff --cached --quiet # make sure there are no uncommited changes
	git tag -f "v$(VERSION)"
	git push origin master
	git push --force origin "v$(VERSION)"
	opam-publish prepare "imap.$(VERSION)" \
		"https://github.com/nojb/ocaml-imap/archive/v$(VERSION).tar.gz"
else
	$(error VERSION is undefined)
endif

publish: gh-pages
	opam-publish submit "./imap.$(VERSION)"

.PHONY: lib clean doc imap_shell wait_mail install uninstall


text:
<Alloy>
	<Window id="add_holder">
		<TextField id="title" hintText="Titulo"></TextField>
		<TextField id="descripction" hintText="Descripcion de la nota..."></TextField>
		<Button id="select_photo"></Button>
		<ImageView id="photo_selected"></ImageView>

		<Button id="save"></Button>
	</Window>
</Alloy>


text:
package com.weibo.motan.demo.service;

import java.util.List;
import java.util.Map;

import com.weibo.api.motan.protocol.yar.annotation.YarConfig;

@YarConfig(path = "/openapi/yarserver/test")
public interface YarService {

    public String hello(String name);

    public void testVoid();

    public String testArgVoid();

    public String testString(String arg);

    public int testInt(int i);

    public Integer testInteger(Integer integer);

    public boolean testBoolean(boolean b);

    public long testLong(long l);

    public float testFloat(Float f);

    public double testDouble(Double d);

    public List<Object> testList(List<Object> list);

    public Map<String, Object> testMap(Map<String, Object> map);

}


text:
local open = io.open
local function read_file(path)
    local file = open(path, "rb") -- r read mode and b binary mode
    if not file then return nil end
    local content = file:read "*a" -- *a or *all reads the whole file
    file:close()
    return content
end

wrk.method = "POST"
wrk.body   = read_file("payload.txt")
wrk.headers["Content-Type"] = "multipart/mixed; boundary=\"batch_45cdcaaf-774f-40c6-8a12-dbb835d3132e\""


text:
'use strict';

var _ = require('lodash');
var moment = require('moment');
var ObjectID = require('bson-objectid');

module.exports = {
    get: function * () {

        var widgetId = this.params.widgetId;
        var timePeriod = this.request.query.timePeriod;

        // Get the widget details
        var widget = yield this.mongo.collection('monitor.widgets')
            .find({ _id: ObjectID(this.params.widgetId) })
            .limit(1)
            .next();

        if (!timePeriod) {
            timePeriod = widget.timePeriod || 'lastHour';
        }

        // Holds the conditions
        var baseConditions = {};

        // Filter by the specified hosts
        if (widget.hosts) {
            baseConditions.hostId = { $in: widget.hosts };
        }

        var chart = _.defaultsDeep(widget.chartOptions || {}, {
            chart: { zoomType: 'x' },
            xAxis: { categories: [] },
            yAxis: { title: { text: null } },
            legend: { align: 'center', verticalAlign: 'top' },
            tooltip: { shared: true },
            plotOptions: {
                line: { marker: { enabled: false } },
                spline: { marker: { enabled: false } },
                area: { marker: { enabled: false } },
                areaspline: { marker: { enabled: false } },
                column: { borderColor: 'transparent' }
            },
            series: []
        });

        switch (timePeriod) {
            case 'latest': {

                let stats = yield this.mongo.collection('monitor.stats.hourly')
                    .find(baseConditions)
                    .limit(1)
                    .sort({ createdAt: -1 })
                    .next()

                console.log('Stats:', stats);

                break;
            }
            case 'lastHour': {

                let now = moment.utc();
                let currentHour = moment(now).startOf('hour');
                let previousHour = moment(currentHour).subtract(1, 'hour');
                let fromMinute = now.minute();
                let toMinute = fromMinute - 1;

                // Select stats from the previous and current hour
                baseConditions.$or = [
                    { createdAt: previousHour.toDate() },
                    { createdAt: currentHour.toDate() }
                ];

                // Set x-axis labels
                for (let minute = fromMinute; minute < 60; minute++) {
                    chart.xAxis.categories.push(
                        moment(previousHour)
                            .local()
                            .set({ minutes: minute })
                            .format('h:mma')
                    );
                }
                for (let minute = 0; minute <= toMinute; minute++) {
                    chart.xAxis.categories.push(
                        moment(currentHour)
                            .local()
                            .set({ minutes: minute })
                            .format('h:mma')
                    );
                }

                // Add the series data
                for (let widgetSeries of widget.series) {

                    // Clone the conditions object so mutations don't collide
                    let conditions = _.clone(baseConditions);

                    // Set the ID of the service to filter by
                    conditions.serviceId = widgetSeries.serviceId;

                    let stats = yield this.mongo.collection('monitor.stats.hourly').find(conditions).toArray();

                    // Split the data into lists with the previous hour and the current hour
                    let prevStatsArr = _.filter(stats, function (stat) { return previousHour.isSame(stat.createdAt); });
                    let curStatsArr = _.filter(stats, function (stat) { return currentHour.isSame(stat.createdAt); });

                    // Initialize the series
                    let series = _.defaultsDeep(widgetSeries.options, {
                        type: 'column',
                        data: []
                    });

                    let ranges = [{
                        from: fromMinute,
                        to: 59,
                        stats: prevStatsArr
                    }, {
                        from: 0,
                        to: toMinute,
                        stats: curStatsArr
                    }];

                    // For each range, populate the series values for each minute
                    for (let range of ranges) {
                        for (let minute = range.from; minute <= range.to; minute++) {

                            let value = null;
                            let total = 0;
                            let num = 0;

                            // Loop through each set of stats
                            for (let stats of range.stats) {

                                // Check if the specified minute / key combo exist
                                if (minute in stats.values && widgetSeries.key in stats.values[minute]) {
                                    total += stats.values[minute][widgetSeries.key];
                                    num++;
                                }

                            }

                            // If there is at least one value then calcuate the average
                            if (num) {
                                value = Math.round(total / num);
                            }

                            // Push the value onto the stack
                            series.data.push(value);

                        }
                    }

                    // Add the series to the chart data
                    chart.series.push(series);

                }

                break;
            }
        }

        this.status = 200;
        this.body = chart;
    }
}


text:
namespace ce {

/// \brief Contains an OpenGL shader object.
class Shader {
    public:
        typedef std::unique_ptr<Shader> ptr;

        Shader() = delete;

        /// \brief Construct a shader from a string source.
        Shader( const std::string& shaderCode, GLenum shaderType );
        ~Shader();

        //make uncopyable for now
        Shader( const Shader& )             = delete;
        Shader( Shader&& )                  = delete;
        Shader& operator=( const Shader& )  = delete;
        Shader& operator=( Shader&& )       = delete;

        /// \brief Get the OpenGL handle.
        GLuint object() const;

    private:
        GLuint object_{ 0u };
};

}

#endif // SHADER_H


text:
title: Asylum, Migration and Integration Fund (AMIF)
objectives: To promote the efficient management of migration flows and the implementation,
  strenghtening and development of a common Union approach to asylum and immigration.
mff_heading: 3) Security and citizenship
policy_supported: Home Affairs
european_structural_and_investment_funds_esif: 'NO'
y2014_2020_mffceilings_current_prices:
y2015_commitments_appropriations:
y2015_payments_appropriations:
centralised_direct_management:
centralised_indirect_management:
shared_management:
decentralised_management:
joint_management:
managing_countries:
managing_dg_or_agencies:
eu_members_states_excluded:
funds_url: http://ec.europa.eu/dgs/home-affairs/financing/fundings/migration-asylum-borders/asylum-migration-integration-fund/index_en.htm
data_on_beneficiaries:
---


text:
var assign = require('object-assign');

module.exports = function (opt) {
    opt = opt || {};
    var thickness = typeof opt.thickness === 'number' ? opt.thickness : 0.1;
    var opacity = typeof opt.opacity === 'number' ? opt.opacity : 1.0;
    var diffuse = opt.diffuse !== null ? opt.diffuse : 0xffffff;

    // remove to satisfy r73
    delete opt.thickness;
    delete opt.opacity;
    delete opt.diffuse;
    delete opt.precision;

    var ret = assign({
        uniforms: {
            thickness: {type: 'f', value: thickness},
            opacity: {type: 'f', value: opacity},
            diffuse: {type: 'c', value: new THREE.Color(diffuse)}
        },
        vertexShader: [
            'uniform float thickness;',
            'attribute float lineMiter;',
            'attribute vec2 lineNormal;',
            'void main() {',
            'vec3 pointPos = position.xyz + vec3(lineNormal * thickness / 2.0 * lineMiter, 0.0);',
            'gl_Position = projectionMatrix * modelViewMatrix * vec4(pointPos, 1.0);',
            '}'
        ].join('\n'),
        fragmentShader: [
            'uniform vec3 diffuse;',
            'uniform float opacity;',
            'void main() {',
            'gl_FragColor = vec4(diffuse, opacity);',
            '}'
        ].join('\n'),
        side: THREE.DoubleSide
    }, opt);

    var threeVers = (parseInt(THREE.REVISION, 10) || 0) | 0;
    if (threeVers < 72) {
        // Old versions need to specify shader attributes
        ret.attributes = {
            lineMiter: {type: 'f', value: 0},
            lineNormal: {type: 'v2', value: new THREE.Vector2()}
        };
    }
    return ret;
};


text:
<?php

require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

/**
 * Thrown for exceptions encountered with database operations. Provides
 * information regarding which operations failed and the query (if any) it
 * failed on.
 *
 * @category   Testing
 * @package    PHPUnit
 * @author     Mike Lively <m@digitalsandwich.com>
 * @copyright  2008 Mike Lively <m@digitalsandwich.com>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 3.2.9
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.2.0
 */
class PHPUnit_Extensions_Database_Operation_Exception extends RuntimeException {

  /**
   * @var string
   */
  protected $operation;

  /**
   * @var string
   */
  protected $preparedQuery;

  /**
   * @var array
   */
  protected $preparedArgs;

  /**
   * @var PHPUnit_Extensions_Database_DataSet_ITable
   */
  protected $table;

  /**
   * @var string
   */
  protected $error;

  /**
   * Creates a new dbunit operation exception
   *
   * @param string $operation
   * @param string $current_query
   * @param PHPUnit_Extensions_Database_DataSet_ITable $current_table
   * @param string $error
   */
  public function __construct($operation, $current_query, $current_args, $current_table, $error) {
    parent::__construct("{$operation} operation failed on query: {$current_query} using args: " . print_r($current_args, true) . " [{$error}]");
    $this->operation = $operation;
    $this->preparedQuery = $current_query;
    $this->preparedArgs = $current_args;
    $this->table = $current_table;
    $this->error = $error;
  }

  public function getOperation() {
    return $this->operation;
  }

  public function getQuery() {
    return $this->preparedQuery;
  }

  public function getTable() {
    return $this->table;
  }

  public function getArgs() {
    return $this->preparedArgs;
  }

  public function getError() {
    return $this->error;
  }
}
?>


text:
(function($) {
    'use strict';

    var url = 'http://184.106.153.149/channels/113321/feeds.json?results=10';

    var tel = '080-261-8207';

    $('#tel').val(tel);

    feedData();

    $('#refresh').click(function(){
        feedData();
    });

    function feedData(){
        $.ajax({
            method: 'GET',
            url: url
        }).done(function(result){
            var data = result.feeds;
            var latestData = data[data.length - 1];
            setLatestData(latestData);
            generateDataTable(data);
            console.log(data);
            console.log(latestData);
        })
    }

    function setLatestData(latestData){
        $('#light').val(latestData.field1)
        $('#temperature').val(latestData.field2)
        $('#time').val(moment(latestData.created_at, moment.ISO_8601).format('DD-MM-YYYY HH:mm น.'));
    }

    function generateDataTable(data){
        $.each(data.reverse(), function(index, value){
            addRow(value);
        })
    }

    function addRow(value){

        var element = "
";
        element += value.entry_id + "	";
        element += value.field1 + "	";
        element += value.field2 + "	";
        element += moment(value.created_at, moment.ISO_8601).format('DD-MM-YYYY HH:mm น.') + "	";
        element += "
";
        $('#data').append(element);
    }

}(jQuery));


text:
(function() {
	if (WebImage) {
		return;
	}
	var WebImage = function() {
		this.image = new Image();
		this.image.crossOrigin = 'anonymous';
		this.canvas = null;
		this.context = null;
		this.image_data = null;
		this.width = null;
		this.height = null;
		this.callback_done = false;
	};
	WebImage.load = function(url, size, onload, onerror, timeout) {
		var web_image = new WebImage();
		web_image.image.onload = function() {
			if (this.callback_done) { return; }
			this.callback_done = true;
			this.canvas = document.createElement('canvas');
			this.context = this.canvas.getContext('2d');
			if (size && size.width && size.height) {
				this.width = size.width;
				this.height = size.height;
			} else {
				this.width = this.image.width;
				this.height = this.image.height;
			}
			this.canvas.width = this.width;
			this.canvas.height = this.height;
			this.context.drawImage(this.image, 0, 0, this.width, this.height);
			this.image_data = this.context.getImageData(0, 0, this.width, this.height);
			onload();
		}.bind(web_image);
		web_image.image.onerror = function() {
			if (this.callback_done) { return; }
			this.callback_done = true;
			onerror();
		}.bind(web_image);
		if (timeout) {
			setTimeout(function() {
				if (!this.canvas) {
					this.image.src = "";
					if (this.callback_done) { return; }
					this.callback_done = true;
					onerror();
				}
			}.bind(web_image), timeout);
		}
		web_image.image.src = url;
		return web_image;
	};
	WebImage.prototype.get = function(x, y) {
		var offset = (x + y * this.width) * 4;
		return new Color(this.image_data.data[offset], this.image_data.data[offset + 1], this.image_data.data[offset + 2], this.image_data.data[offset + 3]);
	};
	WebImage.prototype.set = function(x, y, color) {
		var offset = (x + y * this.width) * 4;
		this.image_data.data[offset] = color.r;
		this.image_data.data[offset + 1] = color.g;
		this.image_data.data[offset + 2] = color.b;
		this.image_data.data[offset + 3] = color.a;
	};
	WebImage.prototype.getImageElement = function() {
		this.context.putImageData(this.image_data, 0, 0);
		var image = document.createElement('img');
		image.src = this.canvas.toDataURL();
		return image;
	};

	("global", eval)("this").WebImage = WebImage;
})();

(function() {
	if (Color) {
		return;
	}
	var Color = function(r, g, b, a) {
		this.r = r;
		this.g = g;
		this.b = b;
		this.a = a;
	};

	("global", eval)("this").Color = Color;
})();


text:
using System;
using System.Collections.Generic;
using System.Web.Http;
using RoleAuthorize.Api;

namespace SampleWebApplication.Controllers
{
    [RoleAuthorize(RoleNames = "Admin")]
    public class TestController : ApiController
    {
        // GET: api/Api
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET: api/Api/5
        public string Get(int id)
        {
            return "value";
        }

        // POST: api/Api
        public void Post([FromBody]string value)
        {
        }

        // PUT: api/Api/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE: api/Api/5
        public void Delete(int id)
        {
        }
    }
}


text:
using System;
using System.Globalization;
using System.Windows.Data;

namespace StockTraderRI.Infrastructure.Converters
{
    public class DecimalToColorConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || !(value is decimal))
            {
                return null;
            }

            decimal decimalValue = (decimal) value;
            string color;
            if (decimalValue < 0m)
            {
                color = "#ffff0000";
            }
            else
            {
                color = "#ff00cc00";
            }

            return color;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }

        #endregion
    }
}


text:
Article 647
----
Tout propriétaire peut clore son héritage, sauf l'exception portée en l'article
682.


text:
package org.sakaiproject.gradebook.entity;

/**
 * This represents the basic information for a gradebook item. See {@link GradebookItem} for additional
 * properties
 */
public class SparseGradebookItem {
    public Long id;
    public String name;

    protected SparseGradebookItem() {}
    public SparseGradebookItem(Long id, String name) {
        this.id = id;

        if (name == null || "".equals(name)) {
            throw new IllegalArgumentException("name must be set");
        }

        this.name = name;
    }

}


text:
package org.kaaproject.kaa.server.admin.client.mvp.view.application;

import org.kaaproject.avro.ui.gwt.client.widget.grid.AbstractGrid;
import org.kaaproject.kaa.common.dto.ApplicationDto;
import org.kaaproject.kaa.server.admin.client.mvp.view.base.BaseListViewImpl;
import org.kaaproject.kaa.server.admin.client.util.Utils;

import com.google.gwt.dom.client.Style.Unit;

public class ApplicationsViewImpl extends BaseListViewImpl<ApplicationDto> {

        public ApplicationsViewImpl(boolean editable) {
            super(editable);
        }

        @Override
        protected AbstractGrid<ApplicationDto, String> createGrid() {
            return new ApplicationsGrid(Unit.PX);
        }

        @Override
        protected String titleString() {
            return Utils.constants.applications();
        }

        @Override
        protected String addButtonString() {
            return Utils.constants.addNewApplication();
        }
}


text:
#ifndef MIRTK_ImplicitSurfaceForce_H
#define MIRTK_ImplicitSurfaceForce_H

#include "mirtk/SurfaceForce.h"

#include "mirtk/LinearInterpolateImageFunction.h"
#include "mirtk/FastLinearImageGradientFunction.h"

class vtkDataArray;

namespace mirtk {

/**
 * Base class of external forces based on a target implicit surface
 *
 * The input _Image of these force terms is the discrete distance function of
 * the implicit surface, e.g., a signed Euclidean distance transform of a binary
 * object mask.
 */
class ImplicitSurfaceForce : public SurfaceForce
{
  mirtkAbstractMacro(ImplicitSurfaceForce);

  // ---------------------------------------------------------------------------
  // Types
public:

  typedef GenericLinearInterpolateImageFunction<ImageType>  ImageFunction;
  typedef GenericFastLinearImageGradientFunction<ImageType> ImageGradient;

  /// Enumeration of implicit surface distance measures
  enum DistanceMeasureType
  {
    DM_Unknown,
    DM_Minimum,  ///< Minimum implicit surface distance
    DM_Normal    ///< Implicit surface distance in normal direction
  };

  // ---------------------------------------------------------------------------
  // Attributes
private:

  /// Type of implicit surface distance
  mirtkPublicAttributeMacro(DistanceMeasureType, DistanceMeasure);

  /// Signed distance offset
  mirtkPublicAttributeMacro(double, Offset);

  /// Minimum length of step when casting ray in normal direction
  mirtkPublicAttributeMacro(double, MinStepLength);

  /// Maximum implicit surface distance considered for ray casting
  mirtkPublicAttributeMacro(double, MaxDistance);

  /// Tolerance for implicit surface distance evaluation
  mirtkPublicAttributeMacro(double, Tolerance);

  /// Number of (normal) distance smoothing iterations
  ///
  /// \note Used only when DistanceMeasure is DM_Normal.
  mirtkPublicAttributeMacro(int, DistanceSmoothing);

  /// Whether to use heuristic to detect "holes" in implicit surface based on
  /// the normal distances and to fill in these distances by average distances
  /// of "hole" boundary points.
  ///
  /// \note Used only when DistanceMeasure is DM_Normal.
  mirtkPublicAttributeMacro(bool, FillInHoles);

  /// Continuous implicit surface distance function
  ImageFunction _Distance;

  /// Continuous implicit surface distance function gradient
  ImageGradient _DistanceGradient;

  /// Copy attributes of this class from another instance
  void CopyAttributes(const ImplicitSurfaceForce &);

  // ---------------------------------------------------------------------------
  // Construction/Destruction
protected:

  /// Constructor
  ImplicitSurfaceForce(const char * = "", double = 1.0);

  /// Copy constructor
  ImplicitSurfaceForce(const ImplicitSurfaceForce &);

  /// Assignment operator
  ImplicitSurfaceForce &operator =(const ImplicitSurfaceForce &);

public:

  /// Destructor
  virtual ~ImplicitSurfaceForce();

  /// Initialize force term once input and parameters have been set
  virtual void Initialize();

  // ---------------------------------------------------------------------------
  // Configuration
protected:

  /// Set parameter value from string
  virtual bool SetWithPrefix(const char *, const char *);

  /// Set parameter value from string
  virtual bool SetWithoutPrefix(const char *, const char *);

public:

  // Import other overloads
  using SurfaceForce::Parameter;

  /// Get parameter name/value pairs
  virtual ParameterList Parameter() const;

  // ---------------------------------------------------------------------------
  // Surface distance

  /// Get self-distance value at given world position along specified direction
  double SelfDistance(const double p[3], const double n[3]) const;

  /// Get distance value at given world position
  ///
  /// \param[in] p Point at which to evaluate implicit surface distance function.
  ///
  /// \returns Interpolated implicit surface distance function value.
  double Distance(const double p[3]) const;

  /// Get distance value at given world position along specified direction
  ///
  /// \param[in] p Starting point for ray casting.
  /// \param[in] n Direction of ray (incl. opposite direction).
  ///
  /// \returns Distance of closest intersection of ray cast from point \p p in
  ///          direction \p n (opposite directions) of length \c _MaxDistance.
  ///          If no intersection occurs, \c _MaxDistance is returned.
  double Distance(const double p[3], const double n[3]) const;

  /// Get (normalized) distance gradient at given world position
  ///
  /// \param[in]  p         Point at which to evaluate implicit surface distance gradient.
  /// \param[out] g         Gradient of implicit surface distance.
  /// \param[in]  normalize Whether to normalize the gradient vector.
  void DistanceGradient(const double p[3], double g[3], bool normalize = false) const;

protected:

  /// Get pointer to point data array of minimum implicit surface distances
  vtkDataArray *MinimumDistances() const;

  /// Initialize point data array used to store minimum implicit surface distances
  void InitializeMinimumDistances();

  /// Update minimum distances to implicit surface
  void UpdateMinimumDistances();

  /// Get pointer to point data array of implicit surface distances in normal directions
  vtkDataArray *NormalDistances() const;

  /// Initialize point data array used to store implicit surface distances in normal directions
  void InitializeNormalDistances();

  /// Update distances from implicit surface in normal direction
  void UpdateNormalDistances();

  /// Get pointer to point data array of implicit surface distances
  vtkDataArray *Distances() const;

  /// Initialize point data array used to store implicit surface distances
  void InitializeDistances();

  /// Update implicit surface distance measures
  void UpdateDistances();

};

////////////////////////////////////////////////////////////////////////////////
// ImplicitSurfaceForce::Measure from/to string conversion
////////////////////////////////////////////////////////////////////////////////

// -----------------------------------------------------------------------------
/// Convert implicit surface distance measure enumeration value to string
template <>
inline string ToString(const enum ImplicitSurfaceForce::DistanceMeasureType &value,
                       int w, char c, bool left)
{
  const char *str;
  switch (value) {
    case ImplicitSurfaceForce::DM_Minimum: str = "Minimum"; break;
    case ImplicitSurfaceForce::DM_Normal:  str = "Normal";  break;
    default:                               str = "Unknown"; break;
  }
  return ToString(str, w, c, left);
}

// -----------------------------------------------------------------------------
/// Convert string to implicit surface distance measure enumeration value
template <>
inline bool FromString(const char *str, enum ImplicitSurfaceForce::DistanceMeasureType &value)
{
  string lstr = ToLower(str);
  if      (lstr == "minimum") value = ImplicitSurfaceForce::DM_Minimum;
  else if (lstr == "normal")  value = ImplicitSurfaceForce::DM_Normal;
  else                        value = ImplicitSurfaceForce::DM_Unknown;
  return (value != ImplicitSurfaceForce::DM_Unknown);
}

} // namespace mirtk

#endif // MIRTK_ImplicitSurfaceForce_H


text:
<?php

namespace Magento\Catalog\Model\Indexer\Product\Eav;

class Processor extends \Magento\Framework\Indexer\AbstractProcessor
{
    /**
     * Indexer ID
     */
    const INDEXER_ID = 'catalog_product_attribute';
}


text:
Spree::HomeController.class_eval do
  include SortingParams

  alias_method :old_index, :index

  def index
    old_index # Like calling super: http://stackoverflow.com/a/13806783/73673
    @products = @searcher.retrieve_products.send(sorting_scope)
  end
end


text:
namespace Glyph3
{
	class Entity3D;

	class ViewRiftHighlight : public SceneRenderTask
	{
	public:
		ViewRiftHighlight( RiftHMDPtr hmd, ResourcePtr RenderTarget, int SwapChain );
		virtual ~ViewRiftHighlight();

		virtual void Update( float fTime );
		virtual void QueuePreTasks( RendererDX11* pRenderer );
		virtual void ExecuteTask( PipelineManagerDX11* pPipelineManager, IParameterManager* pParamManager );
		virtual void Resize( UINT width, UINT height );

		virtual std::wstring GetName();

	private:

		static const unsigned int eye_count = 2;

		std::array<Matrix4f,eye_count>			m_view;
		std::array<Matrix4f,eye_count>			m_proj;

		ResourcePtr								m_DepthTarget;

		ResourcePtr								m_SilhouetteTarget;
		FullscreenActor							m_SilhouetteActor;

		RiftHMDPtr m_pHmd;
	};
};
//--------------------------------------------------------------------------------
#endif // ViewRiftHighlight_h
//--------------------------------------------------------------------------------


text:
using namespace std;

#define V vector
typedef long long int LL;
typedef V<int> vi;
typedef V<LL> vl;
typedef V<pair<int ,int>> vpii;

#define rep(i,a) for(int i = 0; i<a ; i++)
#define fov(i,v) rep(i,v.size())
#define fs first
#define sc second
#define mp make_pair
#define pb push_back

#define el cout<<endl

const int inf = numeric_limits<int>::max();
const LL linf = numeric_limits<LL>::max();

int main(){
	int t;
	cin>>t;
	while(t--){
		long double n,k;
		cin>>n>>k;
		long double ans = 2 + (1 - (1/k))*(long double)2*(n-1);
		cout<<fixed<<setprecision(10)<<ans<<endl;
	}
	return 0;
}


text:
#import "NSObject.h"

@class NSString;

@interface TSTimedTraceSubtrace : NSObject
{
    double _startTime;
    NSString *_userDescription;
    double _lastMarkTime;
    unsigned long long _markCount;
    double _averageTimeBetweenMarks;
}

+ (void)initialize;
- (double)averageTimeBetweenMarks;
- (double)lastMarkTime;
- (void)setLastMarkTime:(double)arg1;
- (id)description;
- (id)userDescription;
- (void)setStartTime:(double)arg1;
- (double)startTime;
- (void)dealloc;
- (id)initWithStartTime:(double)arg1 userDescription:(id)arg2;

@end


text:
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
{
 public:
    inline wxStaticBitmap() { Init(); }

    inline wxStaticBitmap( wxWindow*         pParent
                          ,wxWindowID        nId
                          ,const wxGDIImage& rLabel
                          ,const wxPoint&    rPos = wxDefaultPosition
                          ,const wxSize&     rSize = wxDefaultSize
                          ,long              lStyle = 0
                          ,const wxString&   rName = wxStaticBitmapNameStr
                         )
    {
        Create(pParent, nId, rLabel, rPos, rSize, lStyle, rName);
    }

    bool Create( wxWindow*         pParent
                ,wxWindowID        nId
                ,const wxGDIImage& rLabel
                ,const wxPoint&    rPos = wxDefaultPosition
                ,const wxSize&     rSize = wxDefaultSize
                ,long              lStyle = 0
                ,const wxString&   rName = wxStaticBitmapNameStr
               );
    inline virtual ~wxStaticBitmap() { Free(); }

    virtual void SetIcon(const wxIcon& rIcon) { SetImage(rIcon); }
    virtual void SetBitmap(const wxBitmap& rBitmap) { SetImage(rBitmap); }

    // assert failure is provoked by an attempt to get an icon from bitmap or
    // vice versa
    wxIcon GetIcon() const
      { wxASSERT( m_bIsIcon ); return *(wxIcon *)m_pImage; }
    wxBitmap GetBitmap() const
      { wxASSERT( !m_bIsIcon ); return *(wxBitmap *)m_pImage; }

    // overridden base class virtuals
    virtual bool AcceptsFocus() const { return FALSE; }
    virtual MRESULT OS2WindowProc( WXUINT   uMsg
                                  ,WXWPARAM wParam
                                  ,WXLPARAM lParam
                                 );
    void OnPaint(wxPaintEvent& rEvent);

protected:
    virtual wxSize DoGetBestSize() const;

    void Init() { m_bIsIcon = TRUE; m_pImage = NULL; }
    void Free();

    // TRUE if icon/bitmap is valid
    bool ImageIsOk() const;

    void SetImage(const wxGDIImage& rImage);

    // we can have either an icon or a bitmap
    bool                            m_bIsIcon;
    wxGDIImage*                     m_pImage;
private:
    DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
    DECLARE_EVENT_TABLE()
}; // end of wxStaticBitmap

#endif
    // _WX_STATBMP_H_


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">
    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        android:icon="@android:drawable/ic_menu_preferences"
        app:showAsAction="never" />
    <item
        android:id="@+id/action_logout"
        android:orderInCategory="100"
        android:title="@string/action_logout"
        app:showAsAction="never" />
    <item android:title="Other"
        android:icon="@android:drawable/ic_menu_edit" >
        <menu>
            <item android:title="Byt lösenord"
                android:id="@+id/action_change_password"
                android:icon="@android:drawable/ic_lock_idle_lock"/>
        </menu>
    </item>
</menu>


text:
package io.reactivex.internal.operators.maybe;

import io.reactivex.*;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.disposables.DisposableHelper;
import io.reactivex.internal.fuseable.*;
import io.reactivex.plugins.RxJavaPlugins;

/**
 * Signals true if the source Maybe signals onComplete, signals false if the source Maybe
 * signals onSuccess.
 *
 * @param <T> the value type
 */
public final class MaybeIsEmptySingle<T> extends Single<Boolean>
implements HasUpstreamMaybeSource<T>, FuseToMaybe<Boolean> {

    final MaybeSource<T> source;

    public MaybeIsEmptySingle(MaybeSource<T> source) {
        this.source = source;
    }

    @Override
    public MaybeSource<T> source() {
        return source;
    }

    @Override
    public Maybe<Boolean> fuseToMaybe() {
        return RxJavaPlugins.onAssembly(new MaybeIsEmpty<T>(source));
    }

    @Override
    protected void subscribeActual(SingleObserver<? super Boolean> observer) {
        source.subscribe(new IsEmptyMaybeObserver<T>(observer));
    }

    static final class IsEmptyMaybeObserver<T>
    implements MaybeObserver<T>, Disposable {

        final SingleObserver<? super Boolean> downstream;

        Disposable upstream;

        IsEmptyMaybeObserver(SingleObserver<? super Boolean> downstream) {
            this.downstream = downstream;
        }

        @Override
        public void dispose() {
            upstream.dispose();
            upstream = DisposableHelper.DISPOSED;
        }

        @Override
        public boolean isDisposed() {
            return upstream.isDisposed();
        }

        @Override
        public void onSubscribe(Disposable d) {
            if (DisposableHelper.validate(this.upstream, d)) {
                this.upstream = d;

                downstream.onSubscribe(this);
            }
        }

        @Override
        public void onSuccess(T value) {
            upstream = DisposableHelper.DISPOSED;
            downstream.onSuccess(false);
        }

        @Override
        public void onError(Throwable e) {
            upstream = DisposableHelper.DISPOSED;
            downstream.onError(e);
        }

        @Override
        public void onComplete() {
            upstream = DisposableHelper.DISPOSED;
            downstream.onSuccess(true);
        }
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Sp. pl. ed. 2, 2:1325. 1763

#### Original name
null

### Remarks
null


text:
<?php namespace App\Http\Controllers;
use App\Models\Bait;
use App\Models\Fish;
use App\Models\County;
use App\Models\Article;
use App\Models\Subscribes;
use App\Models\ArticleTypes;
use App\User as User;
use Request;
use Auth;
use Input;
use Validator;
use Redirect;
use Session;
use Hash;

class HomeController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Home Controller
	|--------------------------------------------------------------------------
	|
	| This controller renders your application's "dashboard" for users that
	| are authenticated. Of course, you are free to change or remove the
	| controller as you wish. It is just here to get your app started!
	|
	*/

	/**
	 * Create a new controller instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		//$this->middleware('auth');
	}

	/**
	 * Show the application dashboard to the user.
	 *
	 * @return Response
	 */
	public function index()
	{
		//echo storage_path().'\framework\sessions';exit;
		$baits  = Bait::lists('id','name_ro');
		$fishs  = Fish::where('enabled',1)->orderBy('name_hu')->get();
		$county = County::orderBy('name','asc')->get();
	//	print_r($county);exit;
		return view('home')->with(['baits'=>$baits,'fishs' => $fishs,'county' => $county]);
	}

	public function subscribe()
	{
		if (Request::isMethod('post') && Input::get('email'))
		{
			$email = strip_tags(addslashes(Input::get('email')));
			$exist =  Subscribes::where('email', '=',$email)->count();
			if($exist == 0)
			{
			  	$rules = [
			        'email'    => 'required|email'
			    ];
			    $validator = Validator::make(Input::all(), $rules);
		       if ($validator->fails())
		    	{
		    		$messages = $validator->messages();
    			 	 return Redirect::to('/')
		            ->withErrors($messages)->withInput();;
		    	}
				$ussubscribe = new Subscribes();
		  		$ussubscribe->email  = $email;
		  		$ussubscribe->date   = date('Y-m-d H:i:s');
		  		$ussubscribe->save();
		  		 return Redirect::to('/')->with('message', 'Sikeresen felíratkozoztt hírlevelünkre');
	  		}
	  		else
	  		{
	  			return Redirect::to('/')->with('message', 'Már korábban felíratkozoztt hírlevelünkre');;
	  		}
		}
		else
		{
			return Redirect::to('/')->with('message', 'Sikertelen hírlevél feliratkozás')->withInput();;
		}
	}
	public function fake404()
	{
		return view('home.fake404');
	}

	public function terms()
	{
		return view('home.terms');
	}

	public function privacy()
	{
		return view('home.privacy');
	}
	public function impressum()
	{
		return view('home.impressum');
	}

	public function changePassword()
	{
		if(!Auth::id())
			return Redirect::to('bejelentkezes');

		if (Request::isMethod('post'))
		{
		  	$rules = [
		        'password'    => 'required|min:6|confirmed',
		        'password_confirmation'    => 'required|min:6',
		        'oldpassword'  => 'required|passcheck'
		    ];

		    $messages = array(
			    'passcheck' => 'Régi jelszó helytelen',
			);
		    Validator::extend('passcheck', function ($attribute, $value, $parameters)
			{
			    return Hash::check($value, Auth::user()->getAuthPassword());
			});
		    $validator = Validator::make(Input::all(), $rules, $messages);

		    if ($validator->fails())
		    {
		        $messages = $validator->messages();
		        return Redirect::to('jelszocsere')
		            ->withErrors($messages)->withInput();;
		    }
		    else
		    {
		  		$user = User::find(Auth::id());
		  		$user->password  = Hash::make(Input::get('password'));
		  		$user->save();
		  		Auth::logout();
		  		 return Redirect::to('bejelentkezes');
		    }
		}
		return view('home.changepassword');
	}

	public function changePersonalData()
	{

		if(!Auth::id())
			return Redirect::to('bejelentkezes');

		$user = User::find(Auth::id());
		if (Request::isMethod('post'))
		{
		  	$rules = [

		        'password'  => 'required|passcheck',
		        'name'  => 'required|min:5',
		        'email'  => 'required|email'
		    ];

		    $messages = array(
			    'passcheck' => 'Jelenlegi jelszó helytelen',
			);
		    Validator::extend('passcheck', function ($attribute, $value, $parameters)
			{
			    return Hash::check($value, Auth::user()->getAuthPassword());
			});
		    $validator = Validator::make(Input::all(), $rules, $messages);

		    if ($validator->fails())
		    {
		        $messages = $validator->messages();
		        return Redirect::to('adatok-modositasa')
		            ->withErrors($messages)->withInput(Input::except('password'));
		    }
		    else
		    {
		  		$user = User::find(Auth::id());
		  		$user->name  = Input::get('name');
		  		$user->email = Input::get('email');
		  		$user->save();
		  		Auth::logout();
		  		 return Redirect::to('bejelentkezes');
		    }
		}
		return view('home.changedata',['user' => $user]);
	}

	public function profile()
	{
		$this->middleware('auth');
		$profile = User::with('article')->where('id','=',Auth::id())->first();

		return view('home.profile',['details' => $profile]);
	}

	public function blog($title)
	{
		$selectedPostType = addslashes($title);
		$postCategoryName = ArticleTypes::where(['seo_url' => $selectedPostType])->first();

		if(!$postCategoryName)
			return redirect('/');

		$articles = Article::with('type')->whereHas('type',  function($query) use ($selectedPostType)  {
    		$query->where(['seo_url'=> $selectedPostType]);
    	})->with('author')->paginate(5);

		$popular = Article::with('type')->whereHas('type',  function($query) use ($selectedPostType)  {
    		$query->where(['seo_url'=> $selectedPostType]);
    	})->with('author')->orderBy('viewed')->take(5)->get()->toArray();

		//$popular  = Article::with(['author','type'])->where(['seo_url' => $title])->orderBy('viewed')->take(5)->get()->toArray();

		return view('blog.bloghome',['articles' => $articles,'popular' => $popular,'postCategoryName' => $postCategoryName]);
	}

	public function blogcontent()
	{
		return view('blog.blogcontent');
	}

	public function godtoknow()
	{
		return view('blog.godtoknow');
	}

	public function about()
	{
		return view('home.about');
	}

	public function contact()
	{
		return view('home.contact');
	}

	public function newLake()
	{
		return view('home.newlake');
	}

	public function errorreporting()
	{
		return view('home.errorreporting');
	}

}


text:
var mongoose = require('mongoose'),
    _ = require('lodash');

module.exports = function (req, res) {
    var connectionDB = mongoose.connection.db;
    connectionDB.collection('giftcards', function (err, collection) {
        collection.find({}, function(err, cursor){
            if (err) {
                console.log(err)
            } else {
                var giftcards = [];
                cursor.toArray(function (err, result) {
                    if (err) {
                        console.log(err);
                    } else {
                        _.map(result, function(g){
                            giftcards.push(g);
                        });
                        res.jsonp(giftcards);
                    }
                });
            }
        })
    });
};


text:
package com.w.jinone.base;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.io.Serializable;

public class JsonData  implements Serializable {

    public JsonData(){}

    public JsonData(int showStyle){
        this.showStyle=showStyle;
    }

    protected int showStyle;

    public int getShowStyle() {
        return showStyle;
    }

    public void setShowStyle(int showStyle) {
        this.showStyle = showStyle;
    }

    @Override
    public String toString() {
        Gson gson=new GsonBuilder().serializeNulls().create();
        String json = gson.toJson(this);
        return json;
    }
}


text:
package com.github.jxsd.xml;

public abstract class NameNormalizer {
    public static final NameNormalizer DEFAULT = new NameNormalizer() {
        @Override
        public String normalize(String name) {
            return name;
        }
    };

    public static final NameNormalizer FIRST_LOWER_CASE = new NameNormalizer() {
        @Override
        public String normalize(String name) {
            return name.substring(0, 1).toLowerCase() + name.substring(1);
        }
    };

    public abstract String normalize(String name);
}


text:
extern crate test;

mod dispatch;
mod pattern;


text:
package com.pinhuba.common.activiti.graph;

public class Edge extends GraphElement {
    private Node src;
    private Node dest;

    public Node getSrc() {
        return src;
    }

    public void setSrc(Node src) {
        this.src = src;
    }

    public Node getDest() {
        return dest;
    }

    public void setDest(Node dest) {
        this.dest = dest;
    }
}


text:
[QEMU Raspberry Pi 3](https://github.com/bztsrc/qemu-raspi3)

## Layers

1. kernel layer
2. root single user layer
3. userpsace containers layer

In the root layer live system demons.
ABI/syscalls is not stable here.

In the user layer live common programms.
Only cloudabi is available here.

## File Hierarchy

- `/bin/` contains executables
- `/etc/` configuration files
- `/lib/` shared libraries
- `/sys/` virtual file system
- `/usr/` home directories
- `/var/` contains variable files

## Memory layout for AArch64

| 4KB pages + 3 levels                    | Sizeof  | Use    |
| ---                                     | ---     | ---    |
| `00000000_00000000 - 0000007f_ffffffff` | 512GB   | user   |
| `ffffff80_00000000 - ffffffff_ffffffff` | 512GB   | kernel |

| 4KB pages + 4 levels                    | Sizeof  | Use    |
| ---                                     | ---     | ---    |
| `00000000_00000000 - 0000ffff_ffffffff` | 256TB   | user   |
| `ffff0000_00000000 - ffffffff_ffffffff` | 256TB   | kernel |

| 64KB pages + 2 levels                   | Sizeof  | Use    |
| ---                                     | ---     | ---    |
| `00000000_00000000 - 000003ff_ffffffff` | 4TB     | user   |
| `fffffc00_00000000 - ffffffff_ffffffff` | 4TB     | kernel |

| 64KB pages + 3 levels                   | Sizeof  | Use    |
| ---                                     | ---     | ---    |
| `00000000_00000000 - 0000ffff_ffffffff` | 256TB   | user   |
| `ffff0000_00000000 - ffffffff_ffffffff` | 256TB   | kernel |

## References

- https://web.stanford.edu/class/cs140e/
- https://github.com/shacharr/videocoreiv-qpu-driver
- https://github.com/raspberrypi
- http://jaystation2.maisonikkoku.com/
- https://github.com/NuxiNL/cloudabi
- https://nanomsg.github.io/nng/index.html


text:
#pragma once

#include <memory>

#include "RenderDevice.h"
#include "DeviceContext.h"
#include "RefCntAutoPtr.hpp"
#include "IUnityGraphics.h"
#include "DiligentGraphicsAdapter.h"
#include "ResourceStateTransitionHandler.h"

typedef void* (*TLoadPluginFunction)(const char *FunctionName);

class UnitySceneBase
{
public:
    virtual ~UnitySceneBase() = 0;

    virtual void OnPluginLoad(TLoadPluginFunction LoadPluginFunctionCallback) = 0;

    virtual void OnPluginUnload() = 0;

    virtual void OnGraphicsInitialized() = 0;

    virtual void OnWindowResize(int NewWidth, int NewHeight)
    {
        m_WindowWidth = NewWidth;
        m_WindowHeight = NewHeight;
    }

    virtual const char* GetSceneName()const = 0;

    virtual const char* GetPluginName()const = 0;

    virtual void Update(double CurrTime, double ElapsedTime) = 0;
    virtual void Render(UnityRenderingEvent RenderEventFunc) = 0;

    void SetDiligentGraphicsAdapter(DiligentGraphicsAdapter *DiligentGraphics)
    {
        m_DiligentGraphics = DiligentGraphics;
    }

    IResourceStateTransitionHandler* GetStateTransitionHandler() { return m_pStateTransitionHandler.get(); }

protected:
    DiligentGraphicsAdapter* m_DiligentGraphics = nullptr;
    std::unique_ptr<IResourceStateTransitionHandler> m_pStateTransitionHandler;

    int m_WindowWidth = 640;
    int m_WindowHeight = 480;
};

inline UnitySceneBase::~UnitySceneBase() {}

extern UnitySceneBase* CreateScene();


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>String Extensions Testing</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">

Test String Extensions

                    <input id="sample_text" type="text" class="validate" />
                    Sample Text

                    What Function would you like to test?
                    <select id="selected_function" class="browser-default" style="margin-top: 40px; margin-bottom: 20px">
                        <option value="hasVowels">hasVowels</option>
                        <option value="toUpper">toUpper</option>
                        <option value="toLower">toLower</option>
                        <option value="ucFirst">ucFirst</option>
                        <option value="isQuestion">isQuestion</option>
                        <option value="words">words</option>
                        <option value="wordCount">wordCount</option>
                        <option value="toCurrency">toCurrency</option>
                        <option value="fromCurrency">fromCurrency</option>
                        <option value="inverseCase">inverseCase</option>
                        <option value="alternatingCase">alternatingCase</option>
                        <option value="getMiddle">getMiddle</option>
                        <option value="numberWords">numberWords</option>
                        <option value="isDigit">isDigit</option>
                        <option value="doubleCheck">doubleCheck</option>
                    </select>
                    <button class="waves-effect waves-light btn" onClick="runIt();">TEST</button>

                    RESULT


text:
/**
 *
 * @author Mike Zrimsek
 * @version 03.15.2015
 *
 */

import java.util.InputMismatchException;
import java.util.Scanner;

public class PeopleTree
{
	public static void main(String[] args)
	{
		BinaryTree<Person> people = new BinaryTree<Person>();

		Scanner sc = new Scanner(System.in);
		for(int i = 0; i < 15; i++)
		{
			System.out.print("Enter name: ");
			String name = sc.nextLine();
			Double weight = -1.0;
			do
			{
				try
				{
					System.out.print("Enter weight: ");
					weight = sc.nextDouble();
				}
				catch(InputMismatchException ime)
				{
					weight = -1.0;
					sc.nextLine();
				}
				if(weight < 0)
					System.out.println("Please enter a valid weight.");
			} while(weight < 0);
			people.insert(new Person(name, weight));
			sc.nextLine();
		}

		System.out.println("Height: " + people.height());
		System.out.println("Leaves: " + people.leaves());

		people.inorderTraversal();
		people.preorderTraversal();
		people.postorderTraversal();

		System.out.print("Enter name to search for: ");
		String search = sc.nextLine();

		// comparing Person objects compares on the name and is not case sensitive
		Person searchedPerson = people.find(new Person(search));
		if(searchedPerson != null)
			System.out.println("Weight for " + searchedPerson.getName() + " is " + searchedPerson.getWeight() + ".");
		else
			System.out.println("Not found in tree.");

		System.out.println("First person alphabetically: " + getFirstAlphabetically(people.getRoot()));
		System.out.println("Lowest weight: " + getLowestWeight(people.getRoot()));

		sc.close();
	}

	public static Person getFirstAlphabetically(TreeNode<Person> root)
	{
		if(root.getLeft() == null)
			return root.getData();
		else
			return getFirstAlphabetically(root.getLeft());
	}

	public static Double getLowestWeight(TreeNode<Person> root)
	{
		Double lowest = root.getData().getWeight();

		TreeNode<Person> head = root;

		while(root.getLeft() != null)
		{
			Double leftVal = root.getLeft().getData().getWeight();
			lowest = Math.min(lowest, leftVal);
			root = root.getLeft();
		}

		root = head;

		while(root.getRight() != null)
		{
			Double rightVal = root.getRight().getData().getWeight();
			lowest = Math.min(lowest, rightVal);
			root = root.getRight();
		}

		return lowest;
	}
}


text:
using System;
using System.Globalization;
using Smellyriver.TankInspector.Pro.Data;

namespace Smellyriver.TankInspector.Pro.Graphics
{
    public class ModelPrimitiveGroup : XQueryableWrapper
    {

        public int Id { get; private set; }

        private readonly Lazy<ModelMaterial> _lazyMaterial;

        public ModelMaterial Material
        {
            get { return _lazyMaterial.Value; }
        }

        public uint StartIndex { get; set; }

        public uint StartVertex { get; set; }

        public uint EndIndex { get; set; }

        public uint EndVertex { get; set; }

        public bool Sectioned { get; set; }

        public uint PrimitiveCount { get; set; }

        public uint VerticesCount { get; set; }

        public ModelPrimitiveGroup(IXQueryable data)
            : base(data)
        {
            this.Id = int.Parse(this.Text, CultureInfo.InvariantCulture);
            _lazyMaterial = new Lazy<ModelMaterial>(this.ReadMaterial);
        }

        private ModelMaterial ReadMaterial()
        {
            return new ModelMaterial(this.Query("material"));
        }

    }
}


text:
package com.thoughtworks.gauge.example.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;

public class ProductListPage extends ProductPage{
    public static String ProductsUrl = Url.concat("admin/products/");

    public WebElement q_title;

    public WebElement q_submit;

    @FindBy(how = How.CSS, css = "#main_content table tbody tr:nth-child(1) td.product a")
    public WebElement firstProduct;

    public void search(String name) {
        q_title.sendKeys(name);
        q_submit.click();
    }

    public void openFirstProduct() {
        firstProduct.click();
    }
}


text:
package YaraParser.Structures;

import java.util.ArrayList;

public class Sentence implements Comparable {
    /**
     * shows the tokens of a specific sentence
     */
    private int[] words;
    private int[] tags;

    private int[] brownCluster4thPrefix;
    private int[] brownCluster6thPrefix;
    private int[] brownClusterFullString;

    public Sentence(ArrayList<Integer> tokens, ArrayList<Integer> pos, ArrayList<Integer> brownCluster4thPrefix, ArrayList<Integer> brownCluster6thPrefix, ArrayList<Integer> brownClusterFullString) {
        words = new int[tokens.size()];
        tags = new int[tokens.size()];
        this.brownCluster4thPrefix = new int[tokens.size()];
        this.brownCluster6thPrefix = new int[tokens.size()];
        this.brownClusterFullString = new int[tokens.size()];
        for (int i = 0; i < tokens.size(); i++) {
            words[i] = tokens.get(i);
            tags[i] = pos.get(i);
            this.brownCluster4thPrefix[i] = brownCluster4thPrefix.get(i);
            this.brownCluster6thPrefix[i] = brownCluster6thPrefix.get(i);
            this.brownClusterFullString[i] = brownClusterFullString.get(i);
        }
    }

    public int size() {
        return words.length;
    }

    public int posAt(int position) {
        if (position == 0)
            return 0;

        return tags[position - 1];
    }

    public int[] getWords() {
        return words;
    }

    public int[] getTags() {
        return tags;
    }

    public int[] getBrownCluster4thPrefix() {
        return brownCluster4thPrefix;
    }

    public int[] getBrownCluster6thPrefix() {
        return brownCluster6thPrefix;
    }

    public int[] getBrownClusterFullString() {
        return brownClusterFullString;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Sentence) {
            Sentence sentence = (Sentence) obj;
            if (sentence.words.length != words.length)
                return false;
            for (int i = 0; i < sentence.words.length; i++) {
                if (sentence.words[i] != words[i])
                    return false;
                if (sentence.tags[i] != tags[i])
                    return false;
            }
            return true;
        }
        return false;
    }

    @Override
    public int compareTo(Object o) {
        if (equals(o))
            return 0;
        return hashCode() - o.hashCode();
    }

    @Override
    public int hashCode() {
        int hash = 0;
        for (int tokenId = 0; tokenId < words.length; tokenId++) {
            hash ^= (words[tokenId] * tags[tokenId]);
        }
        return hash;
    }

}


text:
package domain.news.sources;

import java.util.ArrayList;
import java.util.Arrays;

import domain.NewsSourceDataModel;

public class HuffingtonPostDataModel extends NewsSourceDataModel {

	public HuffingtonPostDataModel() {

		super.setTitleTag("//h1[@class='headline__title']");
		super.setImageTag("//img[@class='image__src']");
		super.setCaptionTag("//figcaption[@class='image__caption']");
		super.setTextTag("//div[@class='content-list-component text']/p");
		super.setPublicationDateTag("//time[@class='dateline']");
		super.setName("The huffington Post");
		super.setID("http://www.huffingtonpost.com/");
		super.setLang("en");
		super.setType("Newspaper");
		super.setMusthaveUrls(new ArrayList<String>(Arrays.asList("/201")));
	}
}


text:
import time

from codebox.utils.models import Model, String, Float
from codebox.apps.auth.models import User

class Snippet(Model):
    org = String()
    user = String()
    text = String()
    keywords = String(required=False)
    lang = String()
    created_at = Float(default=time.time)

    languages = [
        ('text', 'Plaintext'),
        ('diff', 'Diff'),
        ('javascript', 'JavaScript'),
        ('html', 'HTML'),
        ('php', 'PHP'),
        ('python', 'Python'),
        ('ruby', 'Ruby'),
        ('applescript', 'AppleScript'),
        ('bash', 'Bash'),
        ('c', 'C'),
        ('c++', 'C++'),
        ('css', 'CSS'),
        ('erlang', 'Erlang'),
        ('java', 'Java'),
        ('scala', 'Scala'),
        ('sql', 'SQL'),
        ('xml', 'XML'),
    ]

    class Meta:
        index = (('org',), ('user',))

    def post_create(self):
        from codebox.apps.organizations.models import Organization
        # Fill our dashboard index
        for user in Organization.objects.get(self.org).get_all_members():
            Snippet.objects.add_to_index(self.pk, dashboard=user.pk)

    def get_user(self):
        return User.objects.get(self.user)


text:
namespace TheXDS.MCART.ViewModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using TheXDS.MCART.Helpers;
using TheXDS.MCART.Resources;
using static TheXDS.MCART.Misc.Internals;

/// <summary>
/// Describe un comando que observa a un objeto que implemente
/// <see cref="INotifyPropertyChanged" /> y
/// escucha cualquier cambio ocurrido en el valor de sus propiedades
/// para habilitar o deshabilitar automáticamente la ejecución del
/// comando.
/// </summary>
public class ObservingCommand : CommandBase
{
    private Func<INotifyPropertyChanged, object?, bool>? _canExecute;
    private readonly HashSet<string> _properties = new();

    /// <summary>
    /// Inicializa una nueva instancia de la clase
    /// <see cref="ObservingCommand" />.
    /// </summary>
    /// <param name="observedSource">Origen de datos observado.</param>
    /// <param name="action">Acción a ejecutar.</param>
    public ObservingCommand(INotifyPropertyChanged observedSource, Action action) : this(observedSource, (_) => action()) { }

    /// <summary>
    /// Inicializa una nueva instancia de la clase
    /// <see cref="ObservingCommand" />.
    /// </summary>
    /// <param name="observedSource">Origen de datos observado.</param>
    /// <param name="task">Tarea a ejecutar.</param>
    public ObservingCommand(INotifyPropertyChanged observedSource, Func<Task> task) : this(observedSource, (Action<object?>)(async (_) => await task())) { }

    /// <summary>
    /// Inicializa una nueva instancia de la clase
    /// <see cref="ObservingCommand" />.
    /// </summary>
    /// <param name="observedSource">Origen de datos observado.</param>
    /// <param name="task">Tarea a ejecutar.</param>
    public ObservingCommand(INotifyPropertyChanged observedSource, Func<object?, Task> task) : this(observedSource, (Action<object?>)(async (object? o) => await task(o))) { }

    /// <summary>
    /// Inicializa una nueva instancia de la clase
    /// <see cref="ObservingCommand" />.
    /// </summary>
    /// <param name="observedSource">Origen de datos observado.</param>
    /// <param name="action">Acción a ejecutar.</param>
    public ObservingCommand(INotifyPropertyChanged observedSource, Action<object?> action) : base(action)
    {
        ObservedSource = NullChecked(observedSource, nameof(observedSource));
    }

    /// <summary>
    /// Referencia al origen de datos observado por este <see cref="ObservingCommand"/>.
    /// </summary>
    public INotifyPropertyChanged ObservedSource { get; }

    /// <summary>
    /// Enumera las propiedades que están siendo observadas por este <see cref="ObservingCommand"/>.
    /// </summary>
    public IEnumerable<string> ObservedProperties => _properties.ToArray();

    /// <summary>
    /// Define el método que determina si el comando puede ejecutarse
    /// en su estado actual.
    /// </summary>
    /// <param name="parameter">
    /// Datos que usa el comando. Si el comando no exige pasar los
    /// datos, se puede establecer este objeto en
    /// <see langword="null" />.
    /// </param>
    /// <returns>
    /// <see langword="true" /> si se puede ejecutar este comando; de
    /// lo contrario, <see langword="false" />.
    /// </returns>
    public override bool CanExecute(object? parameter)
    {
        return _canExecute?.Invoke(ObservedSource, parameter) ?? true;
    }

    /// <summary>
    /// Registra una nueva propiedad a observar en este comando.
    /// </summary>
    /// <param name="properties">
    /// Nombre(s) de la(s) propiedad(es) a observar.
    /// </param>
    /// <returns>
    /// Esta misma instancia, lo que permite usar esta función con
    /// sintaxis fluent.
    /// </returns>
    public ObservingCommand RegisterObservedProperty(params string[] properties)
    {
        foreach (string? j in properties.NotEmpty())
        {
            _properties.Add(j);
        }
        return this;
    }

    /// <summary>
    /// Registra una nueva propiedad a observar en este comando.
    /// </summary>
    /// <param name="property">Nombre de la propiedad a observar.</param>
    /// <returns>
    /// Esta misma instancia, lo que permite usar esta función con
    /// sintaxis fluent.
    /// </returns>
    public ObservingCommand RegisterObservedProperty(Expression<Func<object?>> property)
    {
        PropertyInfo? prop = (ReflectionHelpers.GetMember(property) as PropertyInfo) ?? throw new ArgumentException(null, nameof(property));
        RegisterObservedProperty(prop.Name);
        return this;
    }

    /// <summary>
    /// Establece la función de comprobación a ejecutar cuando se desee
    /// saber si es posible ejecutar el comando.
    /// </summary>
    /// <param name="canExecute">
    /// Función a ejecutar para determinar la posibilidad de ejecutar
    /// el comando.
    /// </param>
    /// <returns>
    /// Esta misma instancia, lo que permite usar esta función con
    /// sintaxis fluent.
    /// </returns>
    public ObservingCommand SetCanExecute(Func<bool> canExecute)
    {
        NullCheck(canExecute, nameof(canExecute));
        return SetCanExecute(_ => canExecute());
    }

    /// <summary>
    /// Establece la función de comprobación a ejecutar cuando se desee
    /// saber si es posible ejecutar el comando.
    /// </summary>
    /// <param name="canExecute">
    /// Función a ejecutar para determinar la posibilidad de ejecutar
    /// el comando.
    /// </param>
    /// <returns>
    /// Esta misma instancia, lo que permite usar esta función con
    /// sintaxis fluent.
    /// </returns>
    public ObservingCommand SetCanExecute(Func<object?, bool> canExecute)
    {
        NullCheck(canExecute, nameof(canExecute));
        return SetCanExecute((_, o) => canExecute(o));
    }

    /// <summary>
    /// Establece la función de comprobación a ejecutar cuando se desee
    /// saber si es posible ejecutar el comando.
    /// </summary>
    /// <param name="canExecute">
    /// Función a ejecutar para determinar la posibilidad de ejecutar
    /// el comando.
    /// </param>
    /// <returns>
    /// Esta misma instancia, lo que permite usar esta función con
    /// sintaxis fluent.
    /// </returns>
    public ObservingCommand SetCanExecute(Func<INotifyPropertyChanged, object?, bool>? canExecute)
    {
        if (canExecute is null)
        {
            ObservedSource.PropertyChanged -= RaiseCanExecuteChanged;
        }
        else if (_canExecute is null)
        {
            ObservedSource.PropertyChanged += RaiseCanExecuteChanged;
        }
        _canExecute = canExecute;
        return this;
    }

    /// <summary>
    /// Desconecta la función establecida para comprobar la posibilidad
    /// de ejecutar este comando.
    /// </summary>
    public void UnsetCanExecute() => SetCanExecute((Func<INotifyPropertyChanged, object?, bool>?)null);

    private void RaiseCanExecuteChanged(object? sender, PropertyChangedEventArgs e)
    {
        if (_properties.Contains(e.PropertyName ?? throw UiErrors.NullValue("e.PropertyName"))) RaiseCanExecuteChanged();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using VoteWeb.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;

namespace VoteWeb.Controllers
{
    public class AccountController : Controller
    {
        #region 构造函数
        private SignInManager<User> SignInManager;
        private UserManager<User> UserManager;
        public AccountController(SignInManager<User> _SignInManager, UserManager<User> _UserManager)
        {
            SignInManager = _SignInManager;
            UserManager = _UserManager;
        }
        #endregion

        // GET: /<controller>/
        /// <summary>
        /// 渲染登陆视图
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult Login()
        {
            return View();
        }
        /// <summary>
        /// 执行登陆方法
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> Login(string username,string password)
        {
            var result = await SignInManager.PasswordSignInAsync(username, password, false, false);
            if (result.Succeeded)
            {
                return Redirect("/Admin/Home/Index");
            }
            return RedirectToAction("Login", "Account");
        }

        /// <summary>
        /// 登出方法
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> Logout()
        {
            await SignInManager.SignOutAsync();
            return RedirectToAction("Index", "Home");
        }

    }
}


text:
class ServiceActionator < ActiveRecord::Base

  belongs_to :service_definition

  has_many :variables, as: :variable_consumer, dependent: :destroy
  accepts_nested_attributes_for :variables, reject_if: :all_blank, allow_destroy: true

  # def as_json(options={})
  #   options[:except] ||= [:created_at, :updated_at, :id, :service_definition_id]
  #   super
  # end

end