text:
using System.Collections.Immutable;
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.DocumentationCommentFormatting;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.MetadataAsSource
{
    internal partial class AbstractMetadataAsSourceService
    {
        internal class DocCommentFormatter
        {
            private static readonly int s_indentSize = 2;
            private static readonly int s_wrapLength = 80;

            private static readonly string s_summaryHeader = FeaturesResources.Summary;
            private static readonly string s_paramHeader = FeaturesResources.Parameters;
            private static readonly string s_labelFormat = "{0}:";
            private static readonly string s_typeParameterHeader = FeaturesResources.TypeParameters;
            private static readonly string s_returnsHeader = FeaturesResources.Returns;
            private static readonly string s_exceptionsHeader = FeaturesResources.Exceptions;
            private static readonly string s_remarksHeader = FeaturesResources.Remarks;

            internal static ImmutableArray<string> Format(IDocumentationCommentFormattingService docCommentFormattingService, DocumentationComment docComment)
            {
                var formattedCommentLinesBuilder = ImmutableArray.CreateBuilder<string>();
                var lineBuilder = new StringBuilder();

                var formattedSummaryText = docCommentFormattingService.Format(docComment.SummaryText);
                if (!string.IsNullOrWhiteSpace(formattedSummaryText))
                {
                    formattedCommentLinesBuilder.Add(s_summaryHeader);
                    formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedSummaryText));
                }

                var parameterNames = docComment.ParameterNames;
                if (parameterNames.Length > 0)
                {
                    formattedCommentLinesBuilder.Add(string.Empty);
                    formattedCommentLinesBuilder.Add(s_paramHeader);

                    for (int i = 0; i < parameterNames.Length; i++)
                    {
                        if (i != 0)
                        {
                            formattedCommentLinesBuilder.Add(string.Empty);
                        }

                        lineBuilder.Clear();
                        lineBuilder.Append(' ', s_indentSize);
                        lineBuilder.Append(string.Format(s_labelFormat, parameterNames[i]));
                        formattedCommentLinesBuilder.Add(lineBuilder.ToString());

                        var rawParameterText = docComment.GetParameterText(parameterNames[i]);
                        var formattedParameterText = docCommentFormattingService.Format(rawParameterText);
                        if (!string.IsNullOrWhiteSpace(formattedParameterText))
                        {
                            formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedParameterText));
                        }
                    }
                }

                var typeParameterNames = docComment.TypeParameterNames;
                if (typeParameterNames.Length > 0)
                {
                    formattedCommentLinesBuilder.Add(string.Empty);
                    formattedCommentLinesBuilder.Add(s_typeParameterHeader);

                    for (int i = 0; i < typeParameterNames.Length; i++)
                    {
                        if (i != 0)
                        {
                            formattedCommentLinesBuilder.Add(string.Empty);
                        }

                        lineBuilder.Clear();
                        lineBuilder.Append(' ', s_indentSize);
                        lineBuilder.Append(string.Format(s_labelFormat, typeParameterNames[i]));
                        formattedCommentLinesBuilder.Add(lineBuilder.ToString());

                        var rawTypeParameterText = docComment.GetTypeParameterText(typeParameterNames[i]);
                        var formattedTypeParameterText = docCommentFormattingService.Format(rawTypeParameterText);
                        if (!string.IsNullOrWhiteSpace(formattedTypeParameterText))
                        {
                            formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedTypeParameterText));
                        }
                    }
                }

                var formattedReturnsText = docCommentFormattingService.Format(docComment.ReturnsText);
                if (!string.IsNullOrWhiteSpace(formattedReturnsText))
                {
                    formattedCommentLinesBuilder.Add(string.Empty);
                    formattedCommentLinesBuilder.Add(s_returnsHeader);
                    formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedReturnsText));
                }

                var exceptionTypes = docComment.ExceptionTypes;
                if (exceptionTypes.Length > 0)
                {
                    formattedCommentLinesBuilder.Add(string.Empty);
                    formattedCommentLinesBuilder.Add(s_exceptionsHeader);

                    for (int i = 0; i < exceptionTypes.Length; i++)
                    {
                        var rawExceptionTexts = docComment.GetExceptionTexts(exceptionTypes[i]);

                        for (int j = 0; j < rawExceptionTexts.Length; j++)
                        {
                            if (i != 0 || j != 0)
                            {
                                formattedCommentLinesBuilder.Add(string.Empty);
                            }

                            lineBuilder.Clear();
                            lineBuilder.Append(' ', s_indentSize);
                            lineBuilder.Append(string.Format(s_labelFormat, exceptionTypes[i]));
                            formattedCommentLinesBuilder.Add(lineBuilder.ToString());

                            var formattedExceptionText = docCommentFormattingService.Format(rawExceptionTexts[j]);
                            if (!string.IsNullOrWhiteSpace(formattedExceptionText))
                            {
                                formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedExceptionText));
                            }
                        }
                    }
                }

                var formattedRemarksText = docCommentFormattingService.Format(docComment.RemarksText);
                if (!string.IsNullOrWhiteSpace(formattedRemarksText))
                {
                    formattedCommentLinesBuilder.Add(string.Empty);
                    formattedCommentLinesBuilder.Add(s_remarksHeader);
                    formattedCommentLinesBuilder.AddRange(CreateWrappedTextFromRawText(formattedRemarksText));
                }

                // Eliminate any blank lines at the beginning.
                while (formattedCommentLinesBuilder.Count > 0 &&
                       formattedCommentLinesBuilder[0].Length == 0)
                {
                    formattedCommentLinesBuilder.RemoveAt(0);
                }

                // Eliminate any blank lines at the end.
                while (formattedCommentLinesBuilder.Count > 0 &&
                       formattedCommentLinesBuilder[formattedCommentLinesBuilder.Count - 1].Length == 0)
                {
                    formattedCommentLinesBuilder.RemoveAt(formattedCommentLinesBuilder.Count - 1);
                }

                return formattedCommentLinesBuilder.ToImmutable();
            }

            private static ImmutableArray<string> CreateWrappedTextFromRawText(string rawText)
            {
                var lines = ImmutableArray.CreateBuilder<string>();

                // First split the string into constituent lines.
                var split = rawText.Split(new[] { "\r\n" }, System.StringSplitOptions.None);

                // Now split each line into multiple lines.
                foreach (var item in split)
                {
                    SplitRawLineIntoFormattedLines(item, lines);
                }

                return lines.ToImmutable();
            }

            private static void SplitRawLineIntoFormattedLines(string line, ImmutableArray<string>.Builder lines)
            {
                var indent = new StringBuilder().Append(' ', s_indentSize * 2).ToString();

                var words = line.Split(' ');
                bool firstInLine = true;

                var sb = new StringBuilder();
                sb.Append(indent);
                foreach (var word in words)
                {
                    // We must always append at least one word to ensure progress.
                    if (firstInLine)
                    {
                        firstInLine = false;
                    }
                    else
                    {
                        sb.Append(' ');
                    }

                    sb.Append(word);

                    if (sb.Length >= s_wrapLength)
                    {
                        lines.Add(sb.ToString());
                        sb.Clear();
                        sb.Append(indent);
                        firstInLine = true;
                    }
                }

                if (sb.ToString().Trim() != string.Empty)
                {
                    lines.Add(sb.ToString());
                }
            }
        }
    }
}


text:
namespace url {
class GURL;
}

namespace net::test_server {
struct HttpRequest;

// The extension that is used to find a file containing mock headers to use
// for a test file. For example, a test data directory can have:
//   foo.html
//   foo.html.mock-http-headers
// When the test server serves foo.html, if it finds foo.html.mock-http-headers
// it will use the contents of that file for the headers.
extern const base::FilePath::CharType kMockHttpHeadersExtension[];

// Returns the Content-Type header value for a path based on its extension.
std::string GetContentType(const base::FilePath& path);

// This file is only meant for compatibility with testserver.py. No
// additional handlers should be added here that don't affect multiple
// distinct tests.

using RequestQuery = std::map<std::string, std::vector<std::string>>;

// Return whether |request| starts with a URL path of |url|.
bool ShouldHandle(const HttpRequest& request, const std::string& prefix_path);

// Calls |handler| if the |request| URL starts with |prefix|.
std::unique_ptr<HttpResponse> HandlePrefixedRequest(
    const std::string& prefix,
    const EmbeddedTestServer::HandleRequestCallback& handler,
    const HttpRequest& request);

// Parses |url| to get the query and places it into a map.
RequestQuery ParseQuery(const GURL& url);

// Returns a path that serves the contents of the file at |original_path|
// with all the text matching the elements of |text_to_replace| replaced
// with the corresponding values. The path is returned in |replacement_path|.
// The result path is only usable by HandleFileRequest which will perform the
// actual replacements of the file contents.
std::string GetFilePathWithReplacements(
    const std::string& original_path,
    const base::StringPairs& text_to_replace);

// Handles |request| by serving a file from under |server_root|.
std::unique_ptr<HttpResponse> HandleFileRequest(
    const base::FilePath& server_root,
    const HttpRequest& request);

}  // namespace net::test_server

#endif  // NET_TEST_EMBEDDED_TEST_SERVER_REQUEST_HANDLER_UTIL_H_

redpajama_set_name: RedPajamaGithub


text:
import type { ApolloError } from '@apollo/client';
import React from 'react';
import { UnmanagedMessage } from './UnmanagedMessage';
import { useLogEvent } from './utils/logging';

interface IApplicationQueryErrorProps {
  hasApplicationData: boolean;
  error: ApolloError;
}

export const ApplicationQueryError = ({ hasApplicationData, error }: IApplicationQueryErrorProps) => {
  const logEvent = useLogEvent('Error', 'AppQuery');
  React.useEffect(() => {
    if (error && hasApplicationData) {
      // Log events except for un-managed apps
      logEvent({ level: 'ERROR', error });
    }
  }, [error, logEvent, hasApplicationData]);

  if (!hasApplicationData) {
    return <UnmanagedMessage />;
  }

  return (

      Failed to load application data, please refresh and try again.

{error.message}

  );
};


text:
psql -a -f ./tools/drop-database.sql
psql -a -f ./tools/init-database.sql


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

  <title>Border Collapsing Test</title>

The black border below should not cut through the top left corner of
  the blue border. It would cut through with our old behavior, but
  this
  bug fix changed our behavior to match the spec.


text:
classdef DBTrader < handle
   properties
       TradeObj @ BaseTradeObj
       Strategy %@ BaseTrategy
       Listener
       GlobalParam
       LoginParam
   end

   methods
       function obj=DBTrader(Dir)
           % ÉèÖÃĬÈÏĿ¼/±¾ÎļþËùÔÚĿ¼
           if nargin<1
               p1 = mfilename('fullpath');
               i=strfind(p1,'\');
               Dir=p1(1:i(end-1));
           end
           obj.GlobalParam.Dir = Dir;
           addpath E:\CGTrader\AutoTrade
       end

       function tradeObjId = AddTradeObj(obj,TradeObjType,TradeObjName)
           % TradeObjType ¿ÉÒÔΪ CTP»òÕßIB

           if nargin >=3
               thisTradeObjName = TradeObjName;
           else
               thisTradeObjName = [];
           end

           if nargin >=2
               thisTradeObjType = upper(TradeObjType);
           else
               error('Please Input TradeObj Type!')
           end
           currentTradeObjName = {obj.TradeObj.name};
           currentTradeObjType = {obj.TradeObj.type};
           %ÒÔName×÷ΪÇø·Ö£¬±ÜÃâÖظ´Ìí¼ÓTradeObj
           Ind = strcmpi(thisTradeObjName,currentTradeObjName) & strcmpi(thisTradeObjType,currentTradeObjType);
           if any(Ind)
               tradeObjId = find(Ind,1);
                return
           else
               NumTradeObj = numel(obj.TradeObj);
               tradeObjId  = NumTradeObj+1;
           end
           obj.TradeObj(tradeObjId,1).name = thisTradeObjName;
           obj.TradeObj(tradeObjId,1).type = thisTradeObjType;
           obj.TradeObj(tradeObjId,1).obj = eval([upper(obj.TradeObj(tradeObjId).type),'_Drive']);
           obj.LoginParam{tradeObjId,1} = [];
       end

       function PresetLoginParam(obj,TradeObjNum,LoginParam)
            obj.LoginParam{TradeObjNum} = LoginParam;
       end

       function LoginTradeObj(obj,tradeObjIdVec)
            %ºóÐø¿É¸Ä½ø£º¸øÿ¸öTradeObjÉèÖõ¥¶ÀµÄµÇ½²ÎÊý
            if nargin < 2
               tradeObjIdVec = 1:numel(obj.TradeObj);
            end
            for tradeObjId=tradeObjIdVec
                if ~isempty(obj.LoginParam{tradeObjId})
                    s = obj.LoginParam{tradeObjId};
                    obj.TradeObj(tradeObjId).obj.LoginTrade(s);
                else
                    %ĬÈϵǽ²ÎÊý
                    obj.TradeObj(tradeObjId).obj.LoginTrade;
                end
                obj.TradeObj(tradeObjId).obj.InitializeDrive;
            end
       end

       function LogoutTradeObj(obj,tradeObjIdVec)
           if nargin < 2
               tradeObjIdVec = 1:numel(obj.TradeObj);
           end
           for tradeObjId=tradeObjIdVec
               obj.TradeObj(tradeObjId).obj.LogoutTrade;
           end
       end

       InitializeDBTrader(obj)

       function StartRiskEngine(obj,tradeObjId)
           listenerId = numel(obj.Listener)+1;
           obj.Listener(listenerId).name        = 'Risk';
           obj.Listener(listenerId).listenerObj = addlistener(obj.TradeObj(tradeObjId).obj,'Account','PostSet',@(src,evnt) funOnRisk(obj,src,evnt));
       end

       function contractId = AddContract(obj,contractInfo,tradeObjIdVec)
           if nargin < 2
               tradeObjIdVec = 1:numel(obj.TradeObj);
           end
           for tradeObjId=tradeObjIdVec
               contractId = obj.TradeObj(tradeObjId).obj.AddContract(contractInfo);
           end
       end

       function GetMarketData(obj,tradeObjIdVec)
           if nargin < 2
               tradeObjIdVec = 1:numel(obj.TradeObj);
           end
           for tradeObjId=tradeObjIdVec
               obj.TradeObj(tradeObjId).obj.GetMarketData;
           end
       end

       function listenerId = DuplicateMD(obj,sourceTradeObjId,targetTradeObjId,sourceContractId,targetContractId)
           listenerId = numel(obj.Listener)+1;
           if nargin < 4
               obj.Listener(listenerId).listenerObj = addlistener(obj.TradeObj(sourceTradeObjId).obj,'MarketData','PostSet',@(src,evnt) DuplicateMD_CallBack(obj,sourceTradeObjId,targetTradeObjId,src,evnt));
           else
               obj.Listener(listenerId).listenerObj = addlistener(obj.TradeObj(sourceTradeObjId).obj.MarketData(sourceContractId),'updateTime','PostSet',@(src,evnt) DuplicateMD_CallBack(obj,sourceTradeObjId,targetTradeObjId,sourceContractId,targetContractId,src,evnt));
           end
           %½«Ä³Ò»¸öTradeObj¶©ÔĵÄÐÐÇ鸴ÖƵ½ÁíÒ»¸öTradeObjÉÏ£¨½«ÐÐÇéÓë½»Ò×µÄͨµÀ·Ö¿ª£©
           meta(1) = metaclass(obj.TradeObj(sourceTradeObjId).obj);
           meta(2) = metaclass(obj.TradeObj(targetTradeObjId).obj);
           obj.Listener(listenerId).desc = ['Copy MarketData from TradeObj ',num2str(sourceTradeObjId),'-',meta(1).Name,' to TradeObj ',num2str(targetTradeObjId),'-',meta(2).Name];
       end

       function draftId = AddOrder(obj,tradeObjId,contractId,orderInfo)
           draftId = obj.TradeObj(tradeObjId).obj.AddOrder(contractId,orderInfo);
       end

       function TransmitOrder(obj,tradeObjId,draftId)
           obj.TradeObj(tradeObjId).obj.TransmitOrder(draftId);
       end

       function [cancelId,remark]=CancelDraftOrder(obj,tradeObjId,draftId)
           [cancelId,remark] = obj.TradeObj(tradeObjId).obj.CancelDraftOrder(draftId);
       end

       function cancelId = CancelOrder(obj,tradeObjId,orderId)
           [cancelId] = obj.TradeObj(tradeObjId).obj.CancelOrder(orderId);
       end

       function Clear(obj,tradeObjId,localSymbol)
           obj.TradeObj(tradeObjId).obj.Clear(localSymbol);
       end

       function AllClear(obj,tradeObjIdVec)
           if nargin<2
               tradeObjIdVec = 1:numel(obj.TradeObj);
           end
           for tradeObjId=tradeObjIdVec
               obj.TradeObj(tradeObjId).obj.AllClear;
           end
       end

       function strategyId = AddStrategy(obj,strategyType,strategyName)
           if nargin<2
               strategyName = strategyType;
           end
           strategyId = numel(obj.Strategy)+1;
           obj.Strategy(strategyId).type         = strategyType;
           obj.Strategy(strategyId).name         = strategyName;
           obj.Strategy(strategyId).Strategy.Obj = eval([strategyType,'(obj.GlobalParam.Dir,obj)']);
       end

       function SetStrategyParam(obj,strategyId,Param)
           obj.Strategy(strategyId).obj.Param = Param;
       end

       function StartStrategy(obj,strategyIdVec)
            if nargin < 2
               strategyIdVec = 1:numel(obj.Strategy);
            end
            for strategyId=1:numel(strategyIdVec)
                obj.Strategy(strategyId).obj.StartStrategy;
            end
       end

       function StopStrategy(obj,strategyIdVec)
           if nargin < 2
               strategyIdVec = 1:numel(obj.Strategy);
           end
           for strategyId=1:numel(strategyIdVec)
               obj.Strategy(strategyId).obj.StopStrategy;
           end
       end

       function StopSystem(obj,tradeObjIdVec)
           if nargin < 2
               tradeObjIdVec = 1:numel(obj.TradeObj);
           end
           for tradeObjId=1:numel(tradeObjIdVec)
               obj.TradeObj(tradeObjId).obj.StopSystem;
           end
       end
   end

   methods (Access = private)  %Callbacks
       function DuplicateMD_CallBack(obj,sourceTradeObjId,targetTradeObjId,varargin)
           obj.TradeObj(targetTradeObjId).obj.MarketData = obj.TradeObj(sourceTradeObjId).obj.MarketData;
       end
       function DuplicateMD_Contract_CallBack(obj,sourceTradeObjId,targetTradeObjId,sourceContractId,targetContractId,varargin)
           obj.TradeObj(targetTradeObjId).obj.MarketData(targetContractId) = obj.TradeObj(sourceTradeObjId).obj.MarketData(sourceContractId);
       end
       funOnRisk(obj,varargin)
   end
end


text:
<?php

namespace craft\utilities;

use Craft;
use craft\base\Utility;
use craft\helpers\App;
use GuzzleHttp\Client;
use Imagine\Gd\Imagine;
use RequirementsChecker;
use Twig_Environment;
use Yii;

/**
 * SystemReport represents a SystemReport dashboard widget.
 *
 * @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
 * @since 3.0
 */
class SystemReport extends Utility
{
    // Static
    // =========================================================================

    /**
     * @inheritdoc
     */
    public static function displayName(): string
    {
        return Craft::t('app', 'System Report');
    }

    /**
     * @inheritdoc
     */
    public static function id(): string
    {
        return 'system-report';
    }

    /**
     * @inheritdoc
     */
    public static function iconPath()
    {
        return Craft::getAlias('@app/icons/check.svg');
    }

    /**
     * @inheritdoc
     */
    public static function contentHtml(): string
    {
        return Craft::$app->getView()->renderTemplate('_components/utilities/SystemReport', [
            'appInfo' => self::_appInfo(),
            'plugins' => Craft::$app->getPlugins()->getAllPlugins(),
            'requirements' => self::_requirementResults(),
        ]);
    }

    /**
     * Returns application info.
     *
     * @return array
     */
    private static function _appInfo(): array
    {
        return [
            'PHP version' => App::phpVersion(),
            'Database driver & version' => self::_dbDriver(),
            'Image driver & version' => self::_imageDriver(),
            'Craft edition & version' => 'Craft '.App::editionName(Craft::$app->getEdition()).' '.Craft::$app->getVersion(),
            'Yii version' => Yii::getVersion(),
            'Twig version' => Twig_Environment::VERSION,
            'Guzzle version' => Client::VERSION,
            'Imagine version' => Imagine::VERSION,
        ];
    }

    /**
     * Returns the DB driver name and version
     *
     * @return string
     */
    private static function _dbDriver(): string
    {
        $db = Craft::$app->getDb();

        if ($db->getIsMysql()) {
            $driverName = 'MySQL';
        } else {
            $driverName = 'PostgreSQL';
        }

        return $driverName.' '.$db->getVersion();
    }

    /**
     * Returns the image driver name and version
     *
     * @return string
     */
    private static function _imageDriver(): string
    {
        $imagesService = Craft::$app->getImages();

        if ($imagesService->getIsGd()) {
            $driverName = 'GD';
        } else {
            $driverName = 'Imagick';
        }

        return $driverName.' '.$imagesService->getVersion();
    }

    /**
     * Runs the requirements checker and returns its results.
     *
     * @return array
     */
    private static function _requirementResults(): array
    {
        $reqCheck = new RequirementsChecker();
        $reqCheck->checkCraft();

        return $reqCheck->getResult()['requirements'];
    }
}


text:
      <link rel="stylesheet" type="text/css" href="https://visapi-gadgets.googlecode.com/svn/trunk/wordcloud/wc.css"/>

    <link rel="stylesheet" type="text/css" href="/stylesheets/tc.css"/>
    <link rel="stylesheet" type="text/css" href="/stylesheets/base.css"/>

Old archived keyword data:

        These data are real data, collected by W&S Market Research using the internal tool, VinaSocial.

        All usage must be informed to W&S and able to publish upon permission.

    <form id="frmtest" name="frmtest" method="post">
        Choose keyword: <select size="1" onchange="drawChart(this.value);">
            <option value="wws">WWS</option>
            <option value="evernote">evernote</option>
            <option value="nielsen">Nielsen</option>
            <option value="starbuck+vn">Starbuck VN</option>
        </select>
    </form>

Some detailed mentions:

Tada

Most repeated words in social mentions by users:


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'UserProfile'
        db.create_table('accounts_userprofile', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
            ('description', self.gf('django.db.models.fields.CharField')(max_length=160, blank=True)),
            ('avatar', self.gf('django.db.models.fields.files.ImageField')(max_length=100, blank=True)),
            ('domain', self.gf('django.db.models.fields.URLField')(max_length=50, blank=True)),
            ('location', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)),
            ('pro_user', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('sites', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'], null=True, blank=True)),
            ('language', self.gf('django.db.models.fields.CharField')(default='en', max_length=2)),
            ('background_color', self.gf('django.db.models.fields.CharField')(max_length=6, blank=True)),
            ('well_color', self.gf('django.db.models.fields.CharField')(max_length=6, blank=True)),
            ('font_color', self.gf('django.db.models.fields.CharField')(max_length=6, blank=True)),
            ('link_color', self.gf('django.db.models.fields.CharField')(max_length=6, blank=True)),
            ('facebook_profile', self.gf('django.db.models.fields.URLField')(max_length=300, blank=True)),
            ('twitter_profile', self.gf('django.db.models.fields.URLField')(max_length=300, blank=True)),
            ('analytics_account', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)),
        ))
        db.send_create_signal('accounts', ['UserProfile'])

    def backwards(self, orm):
        # Deleting model 'UserProfile'
        db.delete_table('accounts_userprofile')

    models = {
        'accounts.userprofile': {
            'Meta': {'object_name': 'UserProfile'},
            'analytics_account': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
            'background_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'}),
            'description': ('django.db.models.fields.CharField', [], {'max_length': '160', 'blank': 'True'}),
            'domain': ('django.db.models.fields.URLField', [], {'max_length': '50', 'blank': 'True'}),
            'facebook_profile': ('django.db.models.fields.URLField', [], {'max_length': '300', 'blank': 'True'}),
            'font_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
            'link_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'}),
            'location': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'pro_user': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'sites': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']", 'null': 'True', 'blank': 'True'}),
            'twitter_profile': ('django.db.models.fields.URLField', [], {'max_length': '300', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
            'well_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'})
        },
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'sites.site': {
            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        }
    }

    complete_apps = ['accounts']


text:
package uk.nhs.careconnect.ri.database.entity.medicationDispense;

import org.hl7.fhir.dstu3.model.MedicationDispense;
import uk.nhs.careconnect.ri.database.entity.codeSystem.ConceptEntity;
import uk.nhs.careconnect.ri.database.entity.encounter.EncounterEntity;
import uk.nhs.careconnect.ri.database.entity.organization.OrganisationEntity;
import uk.nhs.careconnect.ri.database.entity.practitioner.PractitionerEntity;
import uk.nhs.careconnect.ri.database.entity.BaseResource;
import uk.nhs.careconnect.ri.database.entity.episode.EpisodeOfCareEntity;
import uk.nhs.careconnect.ri.database.entity.location.LocationEntity;
import uk.nhs.careconnect.ri.database.entity.medicationRequest.MedicationEntity;
import uk.nhs.careconnect.ri.database.entity.medicationRequest.MedicationRequestEntity;
import uk.nhs.careconnect.ri.database.entity.patient.PatientEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "MedicationDispense",
        indexes = {
                @Index(name = "IDX_MEDICATION_HANDED_OVER_DATE", columnList="whenHandedOver"),
        })
public class MedicationDispenseEntity extends BaseResource {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="DISPENSE_ID")
    private Long id;

    @OneToMany(mappedBy="dispense", targetEntity = MedicationDispenseIdentifier.class)
    Set<MedicationDispenseIdentifier> identifiers = new HashSet<>();

    @Enumerated(EnumType.ORDINAL)
    @Column(name = "status")
    MedicationDispense.MedicationDispenseStatus status;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CATEGORY_CONCEPT",foreignKey= @ForeignKey(name="FK_DISPENSE_CATEGORY_CONCEPT"))
    ConceptEntity categoryCode;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn (name = "MEDICATION_CODE_CONCEPT_ID",nullable = true,foreignKey= @ForeignKey(name="FK_DISPENSE_MEDICATION_CODE"))
    private ConceptEntity medicationCode;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn (name ="MEDICATION_ID", nullable = true,foreignKey= @ForeignKey(name="FK_DISPENSE_MEDICATION"))
    private MedicationEntity medicationEntity;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn (name = "PATIENT_ID",nullable =false, foreignKey= @ForeignKey(name="FK_PATIENT_DISPENSE"))
    private PatientEntity patient;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="ENCOUNTER_ID",foreignKey= @ForeignKey(name="FK_DISPENSE_ENCOUNTER"))
    private EncounterEntity contextEncounter;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="EPISODE_ID",foreignKey= @ForeignKey(name="FK_DISPENSE_EPISODE"))
    private EpisodeOfCareEntity contextEpisodeOfCare;

    // Supporting Information

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PERFORMER_PRACTITIONER",foreignKey= @ForeignKey(name="FK_DISPENSE_PERFORMER_PRACTITIONER"))
    PractitionerEntity performerPractitioner;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PERFORMER_ORGANISATION",foreignKey= @ForeignKey(name="FK_DISPENSE_PERFORMER_ORGANISATION"))
    OrganisationEntity performerOrganisation;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="PRESCRIPTION_ID",foreignKey= @ForeignKey(name="FK_DISPENSE_PRECRIPTION_ID"))
    private MedicationRequestEntity prescription;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TYPE_CONCEPT",foreignKey= @ForeignKey(name="FK_DISPENSE_TYPE_CONCEPT"))
    ConceptEntity typeCode;

    @Column(name="quantityValue")
    private BigDecimal quantityValue;

    @Column(name="quantityUnit")
    private String quantityUnit;

    @Column(name="daysSupplyValue")
    private BigDecimal daysSupplyValue;

    @Column(name="daysSupplyUnit")
    private String daysSupplyUnit;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "whenPrepared")
    private Date whenPrepared;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "whenHandedOver")
    private Date whenHandedOver;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "LOCATION_ID",foreignKey= @ForeignKey(name="FK_DISPENSE_LOCATION_ID"))
    LocationEntity location;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "RECEIVER_PRACTITIONER",foreignKey= @ForeignKey(name="FK_DISPENSE_RECEIVER_PRACTITIONER"))
    PractitionerEntity receiverPractitioner;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "RECEIVER_ORGANISATION",foreignKey= @ForeignKey(name="FK_DISPENSE_RECEIVER_ORGANISATION"))
    OrganisationEntity receiverOrganisaton;

    @OneToMany(mappedBy="dispense", targetEntity = MedicationDispenseNote.class)
    Set<MedicationDispenseNote> notes = new HashSet<>();

    @OneToMany(mappedBy="dispense", targetEntity = MedicationDispenseDosage.class)
    Set<MedicationDispenseDosage> dosageInstructions = new HashSet<>();

    @Column(name = "substituted")
    Boolean substituted;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUBSTITUTION_TYPE_CONCEPT",foreignKey= @ForeignKey(name="FK_DISPENSE_SUBSTITUTION_TYPE_CONCEPT"))
    ConceptEntity substitutionTypeCode;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUBSTITUTION_REASON_CONCEPT",foreignKey= @ForeignKey(name="FK_DISPENSE_SUBSTITUTION_REASON_CONCEPT"))
    ConceptEntity substitutionReasonCode;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUBSTITUTION_PRACTITIONER_ID",foreignKey= @ForeignKey(name="FK_DISPENSE_SUBSTITUTION_PRACTITIONER"))
    PractitionerEntity substitutionPractitioner;

    @Column(name="noteDone")
    Boolean notDone;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "NOT_DONE_CONCEPT",foreignKey= @ForeignKey(name="FK_DISPENSE_NOT_DONE_CONCEPT"))
    ConceptEntity notDoneCode;

    public Set<MedicationDispenseIdentifier> getIdentifiers() {
        return identifiers;
    }

    public MedicationDispenseEntity setIdentifiers(Set<MedicationDispenseIdentifier> identifiers) {
        this.identifiers = identifiers;
        return this;
    }

    public Long getId() {
        return id;
    }

    public MedicationDispenseEntity setPatient(PatientEntity patient) {
        this.patient = patient;
        return this;
    }

    public PatientEntity getPatient() {
        return patient;
    }

    public EncounterEntity getContextEncounter() {
        return contextEncounter;
    }

    public MedicationDispenseEntity setContextEncounter(EncounterEntity contextEncounter) {
        this.contextEncounter = contextEncounter;
        return this;
    }

    public EpisodeOfCareEntity getContextEpisodeOfCare() {
        return contextEpisodeOfCare;
    }

    public MedicationDispenseEntity setContextEpisodeOfCare(EpisodeOfCareEntity contextEpisodeOfCare) {
        this.contextEpisodeOfCare = contextEpisodeOfCare;
        return this;
    }

    public MedicationDispense.MedicationDispenseStatus getStatus() {
        return status;
    }

    public MedicationDispenseEntity setStatus(MedicationDispense.MedicationDispenseStatus status) {
        this.status = status;
        return this;
    }

    public ConceptEntity getCategoryCode() {
        return categoryCode;
    }

    public MedicationDispenseEntity setCategoryCode(ConceptEntity categoryCode) {
        this.categoryCode = categoryCode;
        return this;
    }

    public MedicationEntity getMedicationEntity() {
        return medicationEntity;
    }

    public void setMedicationEntity(MedicationEntity medicationEntity) {
        this.medicationEntity = medicationEntity;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public PractitionerEntity getPerformerPractitioner() {
        return performerPractitioner;
    }

    public void setPerformerPractitioner(PractitionerEntity performerPractitioner) {
        this.performerPractitioner = performerPractitioner;
    }

    public OrganisationEntity getPerformerOrganisation() {
        return performerOrganisation;
    }

    public void setPerformerOrganisation(OrganisationEntity performerOrganisation) {
        this.performerOrganisation = performerOrganisation;
    }

    public MedicationRequestEntity getPrescription() {
        return prescription;
    }

    public void setPrescription(MedicationRequestEntity prescription) {
        this.prescription = prescription;
    }

    public ConceptEntity getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(ConceptEntity typeCode) {
        this.typeCode = typeCode;
    }

    public BigDecimal getQuantityValue() {
        return quantityValue;
    }

    public void setQuantityValue(BigDecimal quantityValue) {
        this.quantityValue = quantityValue;
    }

    public String getQuantityUnit() {
        return quantityUnit;
    }

    public void setQuantityUnit(String quantityUnit) {
        this.quantityUnit = quantityUnit;
    }

    public String getDaysSupplyUnit() {
        return daysSupplyUnit;
    }

    public void setDaysSupplyUnit(String daysSupplyUnit) {
        this.daysSupplyUnit = daysSupplyUnit;
    }

    public BigDecimal getDaysSupplyValue() {
        return daysSupplyValue;
    }

    public void setDaysSupplyValue(BigDecimal daysSupplyValue) {
        this.daysSupplyValue = daysSupplyValue;
    }

    public Date getWhenPrepared() {
        return whenPrepared;
    }

    public void setWhenPrepared(Date whenPrepared) {
        this.whenPrepared = whenPrepared;
    }

    public Date getWhenHandedOver() {
        return whenHandedOver;
    }

    public void setWhenHandedOver(Date whenHandedOver) {
        this.whenHandedOver = whenHandedOver;
    }

    public LocationEntity getLocation() {
        return location;
    }

    public void setLocation(LocationEntity location) {
        this.location = location;
    }

    public PractitionerEntity getReceiverPractitioner() {
        return receiverPractitioner;
    }

    public void setReceiverPractitioner(PractitionerEntity receiverPractitioner) {
        this.receiverPractitioner = receiverPractitioner;
    }

    public OrganisationEntity getReceiverOrganisaton() {
        return receiverOrganisaton;
    }

    public void setReceiverOrganisaton(OrganisationEntity receiverOrganisaton) {
        this.receiverOrganisaton = receiverOrganisaton;
    }

    public ConceptEntity getMedicationCode() {
        return medicationCode;
    }

    public void setMedicationCode(ConceptEntity medicationCode) {
        this.medicationCode = medicationCode;
    }

    public Set<MedicationDispenseNote> getNotes() {
        return notes;
    }

    public void setNotes(Set<MedicationDispenseNote> notes) {
        this.notes = notes;
    }

    public Boolean getSubstituted() {
        return substituted;
    }

    public void setSubstituted(Boolean substituted) {
        this.substituted = substituted;
    }

    public Set<MedicationDispenseDosage> getDosageInstructions() {
        return dosageInstructions;
    }

    public void setDosageInstructions(Set<MedicationDispenseDosage> dosageInstructions) {
        this.dosageInstructions = dosageInstructions;
    }

    public ConceptEntity getSubstitutionTypeCode() {
        return substitutionTypeCode;
    }

    public void setSubstitutionTypeCode(ConceptEntity substitutionTypeCode) {
        this.substitutionTypeCode = substitutionTypeCode;
    }

    public ConceptEntity getSubstitutionReasonCode() {
        return substitutionReasonCode;
    }

    public void setSubstitutionReasonCode(ConceptEntity substitutionReasonCode) {
        this.substitutionReasonCode = substitutionReasonCode;
    }

    public PractitionerEntity getSubstitutionPractitioner() {
        return substitutionPractitioner;
    }

    public void setSubstitutionPractitioner(PractitionerEntity substitutionPractitioner) {
        this.substitutionPractitioner = substitutionPractitioner;
    }

    public Boolean getNotDone() {
        return notDone;
    }

    public void setNotDone(Boolean notDone) {
        this.notDone = notDone;
    }

    public ConceptEntity getNotDoneCode() {
        return notDoneCode;
    }

    public void setNotDoneCode(ConceptEntity notDoneCode) {
        this.notDoneCode = notDoneCode;
    }
}


text:
package org.fest.assertions.internal;

import static org.fest.assertions.error.ShouldBeNullOrEmpty.shouldBeNullOrEmpty;
import static org.fest.assertions.test.ObjectArrays.emptyArray;
import static org.fest.assertions.test.TestFailures.expectedAssertionErrorNotThrown;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

import org.fest.assertions.description.Description;
import org.junit.Before;
import org.junit.Test;

/**
 * Tests for <code>{@link ObjectArrays#assertNullOrEmpty(Description, Object[])}</code>.
 *
 * @author Alex Ruiz
 * @author Yvonne Wang
 */
public class ObjectArrays_assertNullOrEmpty_Test {

  private ObjectArrays arrays;
  private Failures failures;
  private Description description;

  @Before
  public void setUp() {
    arrays = ObjectArrays.instance();
    Arrays parent = Arrays.instance();
    failures = spy(new Failures());
    parent.failures = failures;
    description = new TestDescription("testing");
  }

  @Test
  public void should_fail_if_array_is_not_null_and_is_not_empty() {
    Integer[] actual = new Integer[] { 5, 8 };
    try {
      arrays.assertNullOrEmpty(description, actual);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldBeNullOrEmpty(actual));
      return;
    }
    expectedAssertionErrorNotThrown();
  }

  @Test
  public void should_pass_if_array_is_null() {
    arrays.assertNullOrEmpty(description, null);
  }

  @Test
  public void should_pass_if_array_is_empty() {
    arrays.assertNullOrEmpty(description, emptyArray());
  }
}


text:
package org.logletlab.util;

import java.io.File;

/**
 * @author J
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class LogletLabOpenFileFilter extends XMLFileFilter {

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	public boolean accept(File f) {
		// check if native format, else check for other importable types
		if (super.accept(f)) {
			return true;
		}
		if (extension != null)
			return (extension.equals("xls") || extension.equals("txt")) ;
		else
			return false;
	}

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#getDescription()
	 */
	public String getDescription() {
		return "All importable files";
	}

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycotaxon 41(1): 225 (1991)

#### Original name
Pertusaria epacrospora A. W. Archer

### Remarks
null


text:
using NadekoBot.Core.Services;
using NadekoBot.Core.Modules.Gambling.Common.Events;
using System.Collections.Concurrent;
using NadekoBot.Modules.Gambling.Common;
using Discord;
using Discord.WebSocket;
using System.Threading.Tasks;
using System;
using NLog;
using NadekoBot.Core.Services.Database.Models;
using System.Net.Http;
using Newtonsoft.Json;
using System.Linq;

namespace NadekoBot.Modules.Gambling.Services
{
    public class CurrencyEventsService : INService
    {
        public class VoteModel
        {
            public ulong User { get; set; }
            public long Date { get; set; }
        }
        private readonly DbService _db;
        private readonly DiscordSocketClient _client;
        private readonly ICurrencyService _cs;
        private readonly IBotConfigProvider _bc;
        private readonly IBotCredentials _creds;
        private readonly IHttpClientFactory _http;
        private readonly Logger _log;
        private readonly ConcurrentDictionary<ulong, ICurrencyEvent> _events =
            new ConcurrentDictionary<ulong, ICurrencyEvent>();

        public CurrencyEventsService(DbService db, DiscordSocketClient client,
            IBotCredentials creds, ICurrencyService cs, IBotConfigProvider bc,
            IHttpClientFactory http)
        {
            _db = db;
            _client = client;
            _cs = cs;
            _bc = bc;
            _creds = creds;
            _http = http;
            _log = LogManager.GetCurrentClassLogger();

            if (_client.ShardId == 0)
            {
                Task t = BotlistUpvoteLoop();
            }
        }

        private async Task BotlistUpvoteLoop()
        {
            if (string.IsNullOrWhiteSpace(_creds.VotesUrl))
                return;
            while (true)
            {
                await Task.Delay(TimeSpan.FromHours(1)).ConfigureAwait(false);
                await TriggerVoteCheck().ConfigureAwait(false);
            }
        }

        private async Task TriggerVoteCheck()
        {
            try
            {
                using (var req = new HttpRequestMessage(HttpMethod.Get, _creds.VotesUrl))
                {
                    if (!string.IsNullOrWhiteSpace(_creds.VotesToken))
                        req.Headers.Add("Authorization", _creds.VotesToken);
                    using (var http = _http.CreateClient())
                    using (var res = await http.SendAsync(req).ConfigureAwait(false))
                    {
                        if (!res.IsSuccessStatusCode)
                        {
                            _log.Warn("Botlist API not reached.");
                            return;
                        }
                        var resStr = await res.Content.ReadAsStringAsync().ConfigureAwait(false);
                        var ids = JsonConvert.DeserializeObject<VoteModel[]>(resStr)
                            .Select(x => x.User)
                            .Distinct();
                        await _cs.AddBulkAsync(ids, ids.Select(x => "Voted - <https://discordbots.org/bot/nadeko/vote>"), ids.Select(x => 10L), true).ConfigureAwait(false);
                    }
                }
            }
            catch (Exception ex)
            {
                _log.Warn(ex);
            }
        }

        public async Task<bool> TryCreateEventAsync(ulong guildId, ulong channelId, CurrencyEvent.Type type,
            EventOptions opts, Func<CurrencyEvent.Type, EventOptions, long, EmbedBuilder> embed)
        {
            SocketGuild g = _client.GetGuild(guildId);
            SocketTextChannel ch = g?.GetChannel(channelId) as SocketTextChannel;
            if (ch == null)
                return false;

            ICurrencyEvent ce;

            if (type == CurrencyEvent.Type.Reaction)
            {
                ce = new ReactionEvent(_client, _cs, _bc, g, ch, opts, embed);
            }
            else if (type == CurrencyEvent.Type.GameStatus)
            {
                ce = new GameStatusEvent(_client, _cs, _bc, g, ch, opts, embed);
            }
            else
            {
                return false;
            }

            var added = _events.TryAdd(guildId, ce);
            if (added)
            {
                try
                {
                    ce.OnEnded += OnEventEnded;
                    await ce.StartEvent().ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    _log.Warn(ex);
                    _events.TryRemove(guildId, out ce);
                    return false;
                }
            }
            return added;
        }

        private Task OnEventEnded(ulong gid)
        {
            _events.TryRemove(gid, out _);
            return Task.CompletedTask;
        }
    }
}


text:
package com.esri.gpt.catalog.harvest.jobs;

import com.esri.gpt.framework.context.RequestContext;
import com.esri.gpt.framework.sql.ManagedConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Withdraw a single resource.
 */
public class HjWithdrawRequest  extends HjRequest {

/**
 * Creates instance of the request.
 * @param requestContext request context
 * @param resourceUuids resource UUIDs
 */
public HjWithdrawRequest(RequestContext requestContext, String [] resourceUuids) {
  super(requestContext, new HjCriteria(), new HjResult());
  this.getActionCriteria().setResourceUuids(resourceUuids);
}

/**
 * Executes request.
 * @return true if records has been found and deleted
 * @throws SQLException if deleting jobs fails
 */
public boolean execute() throws SQLException {
  if (this.getActionCriteria().getResourceUuidsForSql().length()==0) return false;

  // intitalize
  PreparedStatement st = null;

  // establish the connection
  ManagedConnection mc = returnConnection();
  Connection con = mc.getJdbcConnection();

  // prepare statement
  st = con.prepareStatement(
      "DELETE FROM " + getHarvestingJobsPendingTableName()+ " " +
      "WHERE HARVEST_ID IN ("+this.getActionCriteria().getResourceUuidsForSql()+")");

  // execute
  return st.executeUpdate()>0;
}

}


text:
This project is the Entity Framework Core SQL Server Compact providers for SQL Server Compact 4.0 and 3.5 SP2.

[![Build status](https://ci.appveyor.com/api/projects/status/y7eyabev603qgy7h/branch/master?svg=true)](https://ci.appveyor.com/project/ErikEJ/entityframework-sqlservercompact/branch/master)

This provider is mainly intended for desktop applications under .NET 4.6.1 (Console, WPF, WinForms and Services), but may also work under ASP.NET 4.6.1 and ASP.NET Core 2.0 when using the full .NET Framework runtime. It does **not** work under the .NET Core runtime.

See the [Wiki pages](https://github.com/ErikEJ/EntityFramework.SqlServerCompact/wiki) for information on how to get started with the source code and the NuGet package.

You can find the latest build on the [MyGet feed](https://www.myget.org/gallery/ef7-sqlce)

Testing, comments, questions, pull requests are most welcome!

![EF Core](https://github.com/ErikEJ/EntityFramework.SqlServerCompact/blob/master/Bitmap-MEDIUM_Entity-Framework-Core-Logo_2colors_Square_Boxed_RGB.png)


text:
<?php

namespace Tests\AppBundle\Model;

use AppBundle\Model\TimestampableTrait;
use PHPUnit\Framework\TestCase;

class TimestampableTraitTest extends TestCase
{
    public function testTimestamps()
    {
        $entity = $this->getMockForTrait(TimestampableTrait::class);
        $entity->onPrePersist();
        $this->assertNotNull($entity->getCreated());
        $this->assertEquals($entity->getCreated(), $entity->getModified());

        $entity->onPreUpdate();
        $this->assertGreaterThan($entity->getCreated(), $entity->getModified());
    }
}


text: Rails.application.config.session_store :cookie_store, key: '_intro_exercise_2015_session'


text:
module Alchemy
  class Config

    class << self

      # Returns the configuration for given parameter name.
      #
      # @param name [String]
      #
      def get(name)
        show[name.to_s]
      end
      alias_method :parameter, :get

      # Returns a merged configuration of the following files
      #
      # Alchemy´s default config: +gems/../alchemy_cms/config/alchemy/config.yml+
      # Your apps default config: +your_app/config/alchemy/config.yml+
      # Environment specific config: +your_app/config/alchemy/development.config.yml+
      #
      # An environment specific config overwrites the settings of your apps default config,
      # while your apps default config has precedence over Alchemy´s default config.
      #
      def show
        @config ||= merge_configs!(alchemy_config, main_app_config, env_specific_config)
      end

    private

      # Alchemy default configuration
      def alchemy_config
        read_file(File.join(File.dirname(__FILE__), '..', '..', 'config/alchemy/config.yml'))
      end

      # Application specific configuration
      def main_app_config
        read_file("#{Rails.root}/config/alchemy/config.yml")
      end

      # Rails Environment specific configuration
      def env_specific_config
        read_file("#{Rails.root}/config/alchemy/#{Rails.env}.config.yml")
      end

      # Tries to load yaml file from given path.
      # If it does not exist, or its empty, it returns an empty Hash.
      #
      def read_file(file)
        return YAML.load_file(file) || {} if File.exists?(file) # YAML.load_file returns false if file is empty.
        {}
      end

      # Merges all given configs together
      #
      def merge_configs!(*config_files)
        raise LoadError, 'No Alchemy config file found!' if config_files.map(&:blank?).all?
        config = {}
        config_files.each {|h| config.merge!(h.stringify_keys!) }
        config
      end

    end

  end
end


text:
package com.vertica.hadoop.deprecated;

import java.io.IOException;
import java.sql.Connection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputFormat;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.util.Progressable;

import com.vertica.hadoop.VerticaConfiguration;
import com.vertica.hadoop.VerticaOutputFormat;

public class VerticaStreamingOutput implements OutputFormat<Text, Text> {
	private static final Log LOG = LogFactory.getLog("com.vertica.hadoop");

	@Override
	public void checkOutputSpecs(FileSystem filesystem, JobConf job)
			throws IOException {
		VerticaConfiguration vtconfig = new VerticaConfiguration(job);
		VerticaOutputFormat.checkOutputSpecs(vtconfig);
	}

	@Override
	public RecordWriter<Text, Text> getRecordWriter(FileSystem filesystem,
			JobConf job, String name, Progressable progress) throws IOException {
		VerticaConfiguration vtconfig = new VerticaConfiguration(job);

		try {
			Connection conn = vtconfig. getConnection(true);
			return new VerticaStreamingRecordWriter(conn, vtconfig);
		}
		catch (Exception e) { throw new IOException(e); }
	}
}


text:
namespace EPiServer.SocialAlloy.Web.Social.Models.Groups
{
    /// <summary>
    /// A Community represents a group of site visitors who share common interest.
    /// </summary>
    public class Community
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">The name of the community</param>
        /// <param name="description">A description for the community</param>
        public Community(string name, string description) : this("", name, description, "")
        {

        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="id">The unique id of the community</param>
        /// <param name="name">The name of the community</param>
        /// <param name="description">A description for the community</param>
        public Community(string id, string name, string description): this(id, name, description, "")
        {
            Id = id;
            Name = name;
            Description = description;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="id">The unique id of the community</param>
        /// <param name="name">The name of the community</param>
        /// <param name="description">A description for the community</param>
        public Community(string id, string name, string description, string pageLink)
        {
            Id = id;
            Name = name;
            Description = description;
            PageLink = pageLink;
        }

        public string Id { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }

        public string PageLink { get; set; }
    }
}


text:
// The MIT License (MIT)
//
// Copyright (c) 2016 Nelson Corrêa V. Júnior
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace EnjoyCQRS.Projections
{
    public class ProjectionRebuilder : IProjectionRebuilder
    {
        protected readonly ProjectorMethodMapper ProjectorMethodMapper = new ProjectorMethodMapper();

        protected readonly IProjectionStore DocumentStore;
        protected readonly IEnumerable Projectors;

        public Action OnStartProcess;
        public Action OnCompleteProcess;

        public ProjectionRebuilder(IProjectionStore documentStore, IEnumerable projectors)
        {
            DocumentStore = documentStore ?? throw new ArgumentNullException(nameof(documentStore));
            Projectors = projectors ?? throw new ArgumentNullException(nameof(documentStore));

            ProjectorMethodMapper.CreateMap(projectors);
        }

        public async Task RebuildAsync<T>(T eventStreamReader, CancellationToken cancellationToken = default(CancellationToken))
            where T : EventStreamReader
        {
            if (eventStreamReader == null) throw new ArgumentNullException(nameof(eventStreamReader));

            OnStartProcess?.Invoke();

            try
            {
                await eventStreamReader.ReadAsync(cancellationToken, WireEvent).ConfigureAwait(false);

                var tasks = new List<Task>();

                foreach (var bucket in DocumentStore.GetBuckets())
                {
                    var task = Task.Run(async () =>
                    {
                        var contents = await DocumentStore.EnumerateContentsAsync(bucket).ConfigureAwait(false);

                        if (eventStreamReader.DeleteAllRecords)
                        {
                            DocumentStore.Cleanup(bucket);
                        }

                        await DocumentStore.ApplyAsync(bucket, contents).ConfigureAwait(false);
                    });

                    tasks.Add(task);
                }

                Task.WaitAll(tasks.ToArray());

                OnCompleteProcess?.Invoke();

            }
            catch (OperationCanceledException)
            {
                // TODO: logging
            }
            catch (Exception)
            {
                // TODO: logging
            }
        }

        protected void WireEvent(object @event, object metadata)
        {
            var wires = ProjectorMethodMapper.GetWiresOf(@event.GetType());

            wires?.ForEach(projectorMethod => projectorMethod.Call(@event, metadata));
        }
    }
}