text:
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using StackExchange.Opserver.Helpers;
using StackExchange.Profiling;

namespace StackExchange.Opserver.Data.Dashboard.Providers
{
    public class OrionDataProvider : DashboardDataProvider<OrionSettings>
    {
        public override bool HasData => NodeCache.HasData();
        public string Host => Settings.Host;
        public int QueryTimeoutMs => Settings.QueryTimeoutMs;
        public override int MinSecondsBetweenPolls => 5;
        public override string NodeType => "Orion";

        public override IEnumerable<Cache> DataPollers
        {
            get { yield return NodeCache; }
        }

        public OrionDataProvider(OrionSettings settings) : base(settings) { }

        protected override IEnumerable<MonitorStatus> GetMonitorStatus() { yield break; }
        protected override string GetMonitorStatusReason() { return null; }

        public override List<Node> AllNodes => NodeCache.Data ?? new List<Node>();

        private Cache<List<Node>> _nodeCache;
        public Cache<List<Node>> NodeCache => _nodeCache ?? (_nodeCache = ProviderCache(GetAllNodes, 10));

        public async Task<List<Node>> GetAllNodes()
        {
            using (MiniProfiler.Current.Step("Get Server Nodes"))
            {
                using (var conn = await GetConnectionAsync())
                {
                    var nodes = await conn.QueryAsync<Node>(@"
Select Cast(n.NodeID as varchar(50)) as Id,
    Caption as Name,
    LastSync,
    MachineType,
    Cast(Status as int) Status,
    LastBoot,
    Coalesce(Cast(vm.CPULoad as smallint), n.CPULoad) as CPULoad,
    TotalMemory,
    MemoryUsed,
    IP_Address as Ip,
    PollInterval as PollIntervalSeconds,
    Cast(vmh.NodeID as varchar(50)) as VMHostID,
    Cast(IsNull(vh.HostID, 0) as Bit) IsVMHost,
    IsNull(UnManaged, 0) as IsUnwatched,
    UnManageFrom as UnwatchedFrom,
    UnManageUntil as UnwatchedUntil,
    hi.Manufacturer,
    hi.Model,
    hi.ServiceTag
From Nodes n
     Left Join VIM_VirtualMachines vm On n.NodeID = vm.NodeID
     Left Join VIM_Hosts vmh On vm.HostID = vmh.HostID
     Left Join VIM_Hosts vh On n.NodeID = vh.NodeID
     Left Join APM_HardwareInfo hi On n.NodeID = hi.NodeID
Order By Id, Caption", commandTimeout: QueryTimeoutMs);

                    var interfaces = await conn.QueryAsync<Interface>(@"
Select Cast(InterfaceID as varchar(50)) as Id,
       Cast(NodeID as varchar(50)) as NodeId,
       InterfaceIndex [Index],
       LastSync,
       InterfaceName as Name,
       FullName,
       Caption,
       Comments,
       InterfaceAlias Alias,
       IfName,
       InterfaceTypeDescription TypeDescription,
       PhysicalAddress,
       IsNull(UnManaged, 0) as IsUnwatched,
       UnManageFrom as UnwatchedFrom,
       UnManageUntil as UnwatchedUntil,
       Cast(Status as int) Status,
       InBps,
       OutBps,
       InPps,
       OutPps,
       InterfaceMTU as MTU,
       InterfaceSpeed as Speed
From Interfaces", commandTimeout: QueryTimeoutMs);

                    var volumes = await conn.QueryAsync<Volume>(@"
Select Cast(VolumeID as varchar(50)) as Id,
       Cast(NodeID as varchar(50)) as NodeId,
       LastSync,
       VolumeIndex as [Index],
       FullName as Name,
       Caption,
       VolumeDescription as [Description],
       VolumeType as Type,
       VolumeSize as Size,
       VolumeSpaceUsed as Used,
       VolumeSpaceAvailable as Available,
       VolumePercentUsed as PercentUsed
From Volumes", commandTimeout: QueryTimeoutMs);

                    var apps = await conn.QueryAsync<Application>(@"
Select Cast(com.ApplicationID as varchar(50)) as Id,
       Cast(NodeID as varchar(50)) as NodeId,
       app.Name as AppName,
       IsNull(app.Unmanaged, 0) as IsUnwatched,
       app.UnManageFrom as UnwatchedFrom,
       app.UnManageUntil as UnwatchedUntil,
       com.Name as ComponentName,
       ccs.TimeStamp as LastUpdated,
       --pe.PID as ProcessID,
       ccs.ProcessName,
       ccs.LastTimeUp,
       ccs.PercentCPU as CurrentPercentCPU,
       ccs.PercentMemory as CurrentPercentMemory,
       ccs.MemoryUsed as CurrentMemoryUsed,
       ccs.VirtualMemoryUsed as CurrentVirtualMemoryUsed,
       pe.AvgPercentCPU as PercentCPU,
       pe.AvgPercentMemory as PercentMemory,
       pe.AvgMemoryUsed as MemoryUsed,
       pe.AvgVirtualMemoryUsed as VirtualMemoryUsed,
       pe.ErrorMessage
From APM_Application app
     Inner Join APM_Component com
       On app.ID = com.ApplicationID
     Inner Join APM_CurrentComponentStatus ccs
       On com.ID = ccs.ComponentID
     Inner Join APM_ProcessEvidence pe
       On ccs.ComponentStatusID = pe.ComponentStatusID
Order By NodeID", commandTimeout: QueryTimeoutMs);

                    foreach (var a in apps)
                    {
                        a.NiceName = a.ComponentName == "Process Monitor - WMI" || a.ComponentName == "Wrapper Process"
                            ? a.AppName
                            : (a.ComponentName ?? "").Replace(" IIS App Pool", "");
                    }

                    var ips = await GetNodeIPMap(conn);

                    foreach (var n in nodes)
                    {
                        n.DataProvider = this;
                        n.ManagementUrl = GetManagementUrl(n);
                        n.Interfaces = interfaces.Where(i => i.NodeId == n.Id).ToList();
                        n.Volumes = volumes.Where(v => v.NodeId == n.Id).ToList();
                        n.Apps = apps.Where(a => a.NodeId == n.Id).ToList();
                        n.IPs = ips.Where(t => t.Item1 == n.Id).Select(t => t.Item2).ToList();
                        n.VMs = nodes.Where(on => on.VMHostID == n.Id).ToList();
                        n.VMHost = nodes.FirstOrDefault(on => n.VMHostID == on.Id);
                        n.SetReferences();
                    }

                    return nodes;
                }
            }
        }

        private class OrionIPMap
        {
            public int NodeID { get; set; }
            public int InterfaceIndex { get; set; }
        }

        public async Task<List<Tuple<string, IPAddress>>> GetNodeIPMap(DbConnection conn)
        {
            var ipList = await conn.QueryAsync<string, string, Tuple<string, string>>(
                @"Select Cast(NodeID as varchar(50)) NodeID, IPAddress From NodeIPAddresses",
                commandTimeout: QueryTimeoutMs,
                map: Tuple.Create,
                splitOn: "IPAddress");

            var result = new List<Tuple<string, IPAddress>>();
            foreach (var entry in ipList)
            {
                IPAddress addr;
                if (!IPAddress.TryParse(entry.Item2, out addr)) continue;
                result.Add(Tuple.Create(entry.Item1, addr));
            }
            return result;
        }

        public override string GetManagementUrl(Node node)
        {
            return !Host.HasValue() ? null : $"{Host}Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:{node.Id}";
        }

        public override async Task<List<GraphPoint>> GetCPUUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch,
       c.AvgLoad
  From CPULoad c
 Where c.DateTime > @minDate
   And c.NodeID = @id
 Order By c.DateTime";

            const string sampledSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch,
       c.AvgLoad
 From (Select c.DateTime,
              c.AvgLoad,
              Row_Number() Over(Order By c.DateTime) as RowNumber
         From CPULoad c
        Where {dateRange}
          And c.NodeID = @id) c
Where c.RowNumber % ((Select Count(*) + @intervals
                        From CPULoad c
                       Where {dateRange}
                         And c.NodeID = @id)/@intervals) = 0
Order By c.DateTime";

            return (await UtilizationQuery<Node.CPUUtilization>(node.Id, allSql, sampledSql, "c.DateTime", start, end, pointCount)).ToList<GraphPoint>();
        }

        public override async Task<List<GraphPoint>> GetMemoryUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch,
       c.AvgMemoryUsed
  From CPULoad c
 Where c.DateTime > @minDate
   And c.NodeID = @id
 Order By c.DateTime";

            const string sampledSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch,
       c.AvgMemoryUsed
 From (Select c.DateTime,
              c.AvgMemoryUsed,
              Row_Number() Over(Order By c.DateTime) as RowNumber
         From CPULoad c
        Where {dateRange}
          And c.NodeID = @id) c
Where c.RowNumber % ((Select Count(*) + @intervals
                        From CPULoad c
                       Where {dateRange}
                         And c.NodeID = @id)/@intervals) = 0
Order By c.DateTime";

            return (await UtilizationQuery<Node.MemoryUtilization>(node.Id, allSql, sampledSql, "c.DateTime", start, end, pointCount)).ToList<GraphPoint>();
        }

        public override async Task<List<DoubleGraphPoint>> GetNetworkUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select DateDiff(s, '1970-01-01', itd.DateTime) as DateEpoch,
       Sum(itd.In_Averagebps) InAvgBps,
       Sum(itd.Out_Averagebps) OutAvgBps
  From InterfaceTraffic itd
 Where itd.InterfaceID In @Ids
   And {dateRange}
 Group By itd.DateTime
 Order By itd.DateTime
";

            const string sampledSql = @"
Select DateDiff(s, '1970-01-01', itd.DateTime) as DateEpoch,
       Sum(itd.InAvgBps) InAvgBps,
       Sum(itd.OutAvgBps) OutAvgBps
  From (Select itd.DateTime,
		       itd.In_Averagebps InAvgBps,
		       itd.Out_Averagebps OutAvgBps,
		       Row_Number() Over(Order By itd.DateTime) RowNumber
          From InterfaceTraffic itd
         Where itd.InterfaceID In @Ids
           And {dateRange}) itd
 Where itd.RowNumber % ((Select Count(*) + @intervals
						   From InterfaceTraffic itd
					      Where itd.InterfaceID In @Ids
                            And {dateRange})/@intervals) = 0
 Group By itd.DateTime
 Order By itd.DateTime";

            if (!node.PrimaryInterfaces.Any()) return new List<DoubleGraphPoint>();

            using (var conn = await GetConnectionAsync())
            {
                var result = await conn.QueryAsync<Interface.InterfaceUtilization>(
                    (pointCount.HasValue ? sampledSql : allSql)
                        .Replace("{dateRange}", GetOptionalDateClause("itd.DateTime", start, end)),
                    new { Ids = node.PrimaryInterfaces.Select(i => int.Parse(i.Id)), start, end, intervals = pointCount });
                return result.ToList<DoubleGraphPoint>();
            }
        }

        public override async Task<List<GraphPoint>> GetUtilization(Volume volume, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', v.DateTime) as DateEpoch,
       v.AvgDiskUsed
  From VolumeUsage v
 Where {dateRange}
   And v.VolumeID = @id
 Order By v.DateTime";

            const string sampledSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', v.DateTime) as DateEpoch,
       v.AvgDiskUsed
  From (Select v.DateTime
               v.AvgDiskUsed,
               Row_Number() Over(Order By v.DateTime) as RowNumber
          From VolumeUsage v
         Where {dateRange}
           And v.VolumeID = @id) v
 Where v.RowNumber % ((Select Count(*) + @intervals
                         From VolumeUsage v
                        Where {dateRange}
                          And v.VolumeID = @id)/@intervals) = 0
 Order By v.DateTime";

            return (await UtilizationQuery<Volume.VolumeUtilization>(volume.Id, allSql, sampledSql, "v.DateTime", start, end, pointCount)).ToList<GraphPoint>();
        }

        public override async Task<List<DoubleGraphPoint>> GetUtilization(Interface nodeInteface, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', itd.DateTime) as DateEpoch,
       itd.In_Averagebps InAvgBps,
       itd.Out_Averagebps OutAvgBps
  From InterfaceTraffic itd
 Where itd.InterfaceID = @Id
   And {dateRange}
 Order By itd.DateTime
";

            const string sampledSql = @"
Select DateDiff(s, '1970-01-01 00:00:00', itd.DateTime) as DateEpoch,
       itd.InAvgBps,
       itd.OutAvgBps
  From (Select itd.DateTime,
		       itd.In_Averagebps InAvgBps,
		       itd.Out_Averagebps OutAvgBps,
		       Row_Number() Over(Order By itd.DateTime) RowNumber
          From InterfaceTraffic itd
         Where itd.InterfaceID = @Id
           And {dateRange}) itd
 Where itd.RowNumber % ((Select Count(*) + @intervals
						   From InterfaceTraffic itd
					      Where itd.InterfaceID = @Id
                            And {dateRange})/@intervals) = 0
 Order By itd.DateTime";

            return (await UtilizationQuery<Interface.InterfaceUtilization>(nodeInteface.Id, allSql, sampledSql, "itd.DateTime", start, end, pointCount)).ToList<DoubleGraphPoint>();
        }

        public Task<DbConnection> GetConnectionAsync()
        {
            return Connection.GetOpenAsync(Settings.ConnectionString, QueryTimeoutMs);
        }

        private string GetOptionalDateClause(string field, DateTime? start, DateTime? end)
        {
            if (start.HasValue && end.HasValue) // start & end
                return $"{field} Between @start and @end";
            if (start.HasValue) // no end
                return $"{field} >= @start";
            if (end.HasValue)
                return $"{field} <= @end";
            return "1 = 1";
        }

        private async Task<List<T>> UtilizationQuery<T>(string id, string allSql, string sampledSql, string dateField, DateTime? start, DateTime? end, int? pointCount) where T : IGraphPoint
        {
            using (var conn = await GetConnectionAsync())
            {
                return await conn.QueryAsync<T>(
                    (pointCount.HasValue ? sampledSql : allSql)
                        .Replace("{dateRange}", GetOptionalDateClause(dateField, start, end)),
                    new { id = int.Parse(id), start, end, intervals = pointCount });
            }
        }
    }
}


text:
Function Get-GitLabNamespace {
[cmdletbinding()]
[OutputType('GitLab.Namespace')]
param (
    [string]$search
)
    $GetUrlParameters = @()

    if ($search -ne $null) {
        $GetUrlParameters += @{search=$search}
    }
    $GetUrlParameters += @{per_page=100}
    $URLParameters = GetMethodParameters -GetURLParameters $GetUrlParameters
    #$Request.URI = "$($Request.URI)" + "$URLParameters"
    $Request = @{
        URI="/namespaces$URLParameters";
        Method='Get';
    }
    QueryGitLabAPI -Request $Request -ObjectType 'GitLab.Namespace'
}

redpajama_set_name: RedPajamaGithub


text:
Marks out disconnected "rooms" in a 2D
[ndarray](http://github.com/mikolalysenko/ndarray) for procedural map
generation.

## Installation ##

``` bash
npm install flood-scan
```

## Usage ##

### `require('flood-scan')(ndarray[, options])` ###

Performs a scan on the supplied array. This will fill all "empty" cells with
a number for each enclosed space. By default, this will replace all zeros with
numbers 2 and above. This behavior can be changed by passing in the following
options:

* `limit`: The maximum amount of rooms to mark. Defaults to infinity.
* `indexer`: A function which takes the room number and returns the value that
  its cells should be filled with. Defaults to `n + 2`.
* `empty`: A function which takes the value of a cell, and returns whether
  it should be considered empty. By default, only zero is considered empty.

This will return an array of objects (one for each room). Each have the
following properties, most of which are borrowed from
[flood-fill](http://github.com/hughsk/flood-fill):

* `hi`: the highest x/y positions filled.
* `lo`: the lowest x/y positions filled.
* `area`: the total amount of cells filled in this room.
* `start`: the first cell that was filled in this room.

See [eyeball.js](http://github.com/hughsk/flood-scan/blob/master/eyeball.js)
for a visual test, and a full usage example.

[![flood-scan example](https://raw.github.com/hughsk/flood-scan/master/screenshot.png)](http://github.com/hughsk/flood-scan/blob/master/eyeball.js)


text:
require 'pdf_ravager/field_types/acro_form'
require 'pdf_ravager/field_types/xfa'

module PDFRavager
  module Fields
    class Text
      include FieldTypes::AcroForm
      include FieldTypes::XFA

      attr_reader :name, :value

      def initialize(name, value)
        @name, @value = name, value
      end

      def ==(other)
        self.name == other.name && self.value == other.value
      end

    end
  end
end


text:
#include "config.h"
#include "LocalizedStrings.h"

#include "NotImplemented.h"
#include "PlatformString.h"

namespace WebCore {

String submitButtonDefaultLabel()
{
    return String::fromUTF8("Submit");
}

String inputElementAltText()
{
    return String::fromUTF8("Submit");
}

String resetButtonDefaultLabel()
{
    return String::fromUTF8("Reset");
}

String defaultDetailsSummaryText()
{
    return String::fromUTF8("Details");
}

String searchableIndexIntroduction()
{
    return String::fromUTF8("This is a searchable index. Enter search keywords: ");
}

String fileButtonChooseFileLabel()
{
    return String::fromUTF8("Choose File");
}

String fileButtonChooseMultipleFilesLabel()
{
    return String::fromUTF8("Choose Files");
}

String fileButtonNoFileSelectedLabel()
{
    return String::fromUTF8("No file selected");
}

String contextMenuItemTagOpenLinkInNewWindow()
{
    return String::fromUTF8("Open Link in New Window");
}

String contextMenuItemTagDownloadLinkToDisk()
{
    return String::fromUTF8("Download Linked File");
}

String contextMenuItemTagCopyLinkToClipboard()
{
    return String::fromUTF8("Copy Link Location");
}

String contextMenuItemTagOpenImageInNewWindow()
{
    return String::fromUTF8("Open Image in New Window");
}

String contextMenuItemTagDownloadImageToDisk()
{
    return String::fromUTF8("Save Image As");
}

String contextMenuItemTagCopyImageToClipboard()
{
    return String::fromUTF8("Copy Image");
}

String contextMenuItemTagOpenVideoInNewWindow()
{
    return String::fromUTF8("Open Video in New Window");
}

String contextMenuItemTagOpenAudioInNewWindow()
{
    return String::fromUTF8("Open Audio in New Window");
}

String contextMenuItemTagCopyVideoLinkToClipboard()
{
    return String::fromUTF8("Copy Video Link Location");
}

String contextMenuItemTagCopyAudioLinkToClipboard()
{
    return String::fromUTF8("Copy Audio Link Location");
}

String contextMenuItemTagToggleMediaControls()
{
    return String::fromUTF8("Toggle Media Controls");
}

String contextMenuItemTagToggleMediaLoop()
{
    return String::fromUTF8("Toggle Media Loop Playback");
}

String contextMenuItemTagEnterVideoFullscreen()
{
    return String::fromUTF8("Switch Video to Fullscreen");
}

String contextMenuItemTagMediaPlay()
{
    return String::fromUTF8("Play");
}

String contextMenuItemTagMediaPause()
{
    return String::fromUTF8("Pause");
}

String contextMenuItemTagMediaMute()
{
    return String::fromUTF8("Mute");
}

String contextMenuItemTagOpenFrameInNewWindow()
{
    return String::fromUTF8("Open Frame in New Window");
}

String contextMenuItemTagCopy()
{
    static String stockLabel = String::fromUTF8("Copy");
    return stockLabel;
}

String contextMenuItemTagDelete()
{
    static String stockLabel = String::fromUTF8("Delete");
    return stockLabel;
}

String contextMenuItemTagSelectAll()
{
    static String stockLabel = String::fromUTF8("Select All");
    return stockLabel;
}

String contextMenuItemTagUnicode()
{
    return String::fromUTF8("Insert Unicode Control Character");
}

String contextMenuItemTagInputMethods()
{
    return String::fromUTF8("Input Methods");
}

String contextMenuItemTagGoBack()
{
    static String stockLabel = String::fromUTF8("Go Back");
    return stockLabel;
}

String contextMenuItemTagGoForward()
{
    static String stockLabel = String::fromUTF8("Go Forward");
    return stockLabel;
}

String contextMenuItemTagStop()
{
    static String stockLabel = String::fromUTF8("Stop");
    return stockLabel;
}

String contextMenuItemTagReload()
{
    return String::fromUTF8("Reload");
}

String contextMenuItemTagCut()
{
    static String stockLabel = String::fromUTF8("Cut");
    return stockLabel;
}

String contextMenuItemTagPaste()
{
    static String stockLabel = String::fromUTF8("Paste");
    return stockLabel;
}

String contextMenuItemTagNoGuessesFound()
{
    return String::fromUTF8("No Guesses Found");
}

String contextMenuItemTagIgnoreSpelling()
{
    return String::fromUTF8("Ignore Spelling");
}

String contextMenuItemTagLearnSpelling()
{
    return String::fromUTF8("Learn Spelling");
}

String contextMenuItemTagSearchWeb()
{
    return String::fromUTF8("Search the Web");
}

String contextMenuItemTagLookUpInDictionary(const String&)
{
    return String::fromUTF8("Look Up in Dictionary");
}

String contextMenuItemTagOpenLink()
{
    return String::fromUTF8("Open Link");
}

String contextMenuItemTagIgnoreGrammar()
{
    return String::fromUTF8("Ignore Grammar");
}

String contextMenuItemTagSpellingMenu()
{
    return String::fromUTF8("Spelling and Grammar");
}

String contextMenuItemTagShowSpellingPanel(bool show)
{
    return String::fromUTF8(show ? "Show Spelling and Grammar" : "Hide Spelling and Grammar");
}

String contextMenuItemTagCheckSpelling()
{
    return String::fromUTF8("Check Document Now");
}

String contextMenuItemTagCheckSpellingWhileTyping()
{
    return String::fromUTF8("Check Spelling While _Typing");
}

String contextMenuItemTagCheckGrammarWithSpelling()
{
    return String::fromUTF8("Check Grammar With Spelling");
}

String contextMenuItemTagFontMenu()
{
    return String::fromUTF8("Font");
}

String contextMenuItemTagBold()
{
    static String stockLabel = String::fromUTF8("Bold");
    return stockLabel;
}

String contextMenuItemTagItalic()
{
    static String stockLabel = String::fromUTF8("Italic");
    return stockLabel;
}

String contextMenuItemTagUnderline()
{
    static String stockLabel = String::fromUTF8("Underline");
    return stockLabel;
}

String contextMenuItemTagOutline()
{
    return String::fromUTF8("Outline");
}

String contextMenuItemTagInspectElement()
{
    return String::fromUTF8("Inspect Element");
}

String contextMenuItemTagRightToLeft()
{
    return String();
}

String contextMenuItemTagLeftToRight()
{
    return String();
}

String contextMenuItemTagWritingDirectionMenu()
{
    return String();
}

String contextMenuItemTagTextDirectionMenu()
{
    return String();
}

String contextMenuItemTagDefaultDirection()
{
    return String();
}

String searchMenuNoRecentSearchesText()
{
    return String::fromUTF8("No recent searches");
}

String searchMenuRecentSearchesText()
{
    return String::fromUTF8("Recent searches");
}

String searchMenuClearRecentSearchesText()
{
    return String::fromUTF8("Clear recent searches");
}

String AXDefinitionListTermText()
{
    return String::fromUTF8("term");
}

String AXDefinitionListDefinitionText()
{
    return String::fromUTF8("definition");
}

String AXButtonActionVerb()
{
    return String::fromUTF8("press");
}

String AXRadioButtonActionVerb()
{
    return String::fromUTF8("select");
}

String AXTextFieldActionVerb()
{
    return String::fromUTF8("activate");
}

String AXCheckedCheckBoxActionVerb()
{
    return String::fromUTF8("uncheck");
}

String AXUncheckedCheckBoxActionVerb()
{
    return String::fromUTF8("check");
}

String AXLinkActionVerb()
{
    return String::fromUTF8("jump");
}

String unknownFileSizeText()
{
    return String::fromUTF8("Unknown");
}

String imageTitle(const String& filename, const IntSize& size)
{
    notImplemented();
    return String();
}

#if ENABLE(VIDEO)
String localizedMediaControlElementString(const String& name)
{
    notImplemented();
    return String();
}

String localizedMediaControlElementHelpText(const String& name)
{
    notImplemented();
    return String();
}

String localizedMediaTimeDescription(float time)
{
    notImplemented();
    return String();
}
#endif

String mediaElementLoadingStateText()
{
    return String::fromUTF8("Loading...");
}

String mediaElementLiveBroadcastStateText()
{
    return String::fromUTF8("Live Broadcast");
}

String validationMessagePatternMismatchText()
{
    return String::fromUTF8("pattern mismatch");
}

String validationMessageRangeOverflowText(const String&)
{
    return String::fromUTF8("range overflow");
}

String validationMessageRangeUnderflowText(const String&)
{
    return String::fromUTF8("range underflow");
}

String validationMessageStepMismatchText(const String&, const String&)
{
    return String::fromUTF8("step mismatch");
}

String validationMessageTooLongText(int, int)
{
    return String::fromUTF8("too long");
}

String validationMessageTypeMismatchText()
{
    return String::fromUTF8("type mismatch");
}

String validationMessageTypeMismatchForEmailText()
{
    return String::fromUTF8("type mismatch");
}

String validationMessageTypeMismatchForMultipleEmailText()
{
    return String::fromUTF8("type mismatch");
}

String validationMessageTypeMismatchForURLText()
{
    return String::fromUTF8("type mismatch");
}

String validationMessageValueMissingText()
{
    return String::fromUTF8("value missing");
}

String validationMessageValueMissingForCheckboxText()
{
    notImplemented();
    return validationMessageValueMissingText();
}

String validationMessageValueMissingForFileText()
{
    notImplemented();
    return validationMessageValueMissingText();
}

String validationMessageValueMissingForMultipleFileText()
{
    notImplemented();
    return validationMessageValueMissingText();
}

String validationMessageValueMissingForRadioText()
{
    notImplemented();
    return validationMessageValueMissingText();
}

String validationMessageValueMissingForSelectText()
{
    notImplemented();
    return validationMessageValueMissingText();
}

String missingPluginText()
{
    return String::fromUTF8("missing plugin");
}

String AXMenuListPopupActionVerb()
{
    return String();
}

String AXMenuListActionVerb()
{
    return String();
}

String multipleFileUploadText(unsigned numberOfFiles)
{
    return String::number(numberOfFiles) + String::fromUTF8(" files");
}

String crashedPluginText()
{
    return String::fromUTF8("plugin crashed");
}

}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | The caching prefix used to lookup the cart
    |--------------------------------------------------------------------------
    |
    */
    'cache_prefix' => 'laracart',

    /*
    |--------------------------------------------------------------------------
    | Locale is used to convert money into a readable format for the user,
    | please note the UTF-8, helps to make sure its encoded correctly
    |
    | Common Locales
    |
    | English - United States (en_US): 123,456.00
    | English - United Kingdom (en_GB) 123,456.00
    | Spanish - Spain (es_ES): 123.456,000
    | Dutch - Netherlands (nl_NL): 123 456,00
    | German - Germany (de_DE): 123.456,00
    | French - France (fr_FR): 123 456,00
    | Italian - Italy (it_IT): 123.456,00
    |
    | This site is pretty useful : http://lh.2xlibre.net/locales/
    |
    |--------------------------------------------------------------------------
    |
    */
    'locale' => 'en_US.UTF-8',

    /*
    |--------------------------------------------------------------------------
    | If true, displays the international format rather than the national format
    |--------------------------------------------------------------------------
    |
    */
    'international_format' => false,

    /*
    |--------------------------------------------------------------------------
    | Sets the tax for the cart and items, you can change per item
    | via the object later if needed
    |--------------------------------------------------------------------------
    |
    */
    'tax' => null,

    /*
    |--------------------------------------------------------------------------
    | Calculate tax per item, rather than subtotal
    | https://github.com/lukepolo/laracart/issues/180
    |
    | This will vary, please investigate to follow the rules of your local laws
    | https://money.stackexchange.com/questions/15051/sales-tax-rounded-then-totaled-or-totaled-then-rounded
    |--------------------------------------------------------------------------
    |
    */
    'tax_by_item' => false,

    /*
    |--------------------------------------------------------------------------
    | If you need to tax items before discount you can turn it on
    |--------------------------------------------------------------------------
    |
    */
    'tax_item_before_discount' => false,

    /*
    |--------------------------------------------------------------------------
    | Allows you to choose if the discounts applied are taxable
    |--------------------------------------------------------------------------
    |
    */
    'discountTaxable' => false,

    /*
    |--------------------------------------------------------------------------
    | If your discounts are already pre taxes but items are not,
    | you can set this here to get the correct values
    |--------------------------------------------------------------------------
    |
    */
    'discountsAlreadyTaxed' => false,

    /*
    |--------------------------------------------------------------------------
    | Allows you to choose if the discounts applied to fees
    |--------------------------------------------------------------------------
    |
    */
    'discountOnFees' => false,

    /*
    |--------------------------------------------------------------------------
    | Allows you to configure if a user can apply multiple coupons
    |--------------------------------------------------------------------------
    |
    */
    'multiple_coupons' => false,

    /*
    |--------------------------------------------------------------------------
    | The default item model for your relations
    |--------------------------------------------------------------------------
    |
    */
    'item_model' => null,

    /*
    |--------------------------------------------------------------------------
    | Binds your data into the correct spots for LaraCart
    |--------------------------------------------------------------------------
    |
    */
    'item_model_bindings' => [
        \LukePOLO\LaraCart\CartItem::ITEM_ID      => 'id',
        \LukePOLO\LaraCart\CartItem::ITEM_NAME    => 'name',
        \LukePOLO\LaraCart\CartItem::ITEM_PRICE   => 'price',
        \LukePOLO\LaraCart\CartItem::ITEM_TAXABLE => 'taxable',
        \LukePOLO\LaraCart\CartItem::ITEM_OPTIONS => [
            // put columns here for additional options,
            // these will be merged with options that are passed in
            // e.x
            // tax => .07
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | The default item relations to the item_model
    |--------------------------------------------------------------------------
    |
    */
    'item_model_relations' => [],

    /*
    |--------------------------------------------------------------------------
    | This allows you to use multiple devices based on your logged in user
    |--------------------------------------------------------------------------
    |
    */
    'cross_devices' => false,

    /*
    |--------------------------------------------------------------------------
    | This allows you to use custom guard to get logged in user
    |--------------------------------------------------------------------------
    |
    */
    'guard' => null,
];


text:
.mblCheckBox {
  background-image: url(compat/button-bg.png);
}
.mblCheckBoxSelected {
  background-image: url(compat/button-sel-bg.png);
}
.mblCheckBoxChecked,
.mblCheckBox:checked {
  background-image: url(compat/button-chk-bg.png);
}
.mblCheckBoxChecked.mblCheckBoxSelected,
.mblCheckBox:checked.mblCheckBoxSelected {
  background-image: url(compat/button-unsel-bg.png);
}
.dj_gecko .mblCheckBox {
  background-image: -moz-linear-gradient(top, #f7fbf7 0%, #ced3ce 50%, #cecfd6 100%);
  -moz-appearance: none;
}
.dj_gecko .mblCheckBoxSelected {
  background-image: -moz-linear-gradient(top, #088eef 0%, #0869c6 50%, #0851ad 100%);
}
.dj_gecko .mblCheckBoxChecked,
.dj_gecko .mblCheckBox:checked {
  background-image: -moz-linear-gradient(top, #f7fbf7 0%, #ced3ce 50%, #cecfd6 100%);
}
.dj_gecko .mblCheckBoxChecked::after,
.dj_gecko .mblCheckBox:checked::after {
  -moz-transform: rotate(45deg);
  -moz-transform-origin: 50% 50%;
}
.dj_gecko .mblCheckBoxChecked.mblCheckBoxSelected,
.dj_gecko .mblCheckBox:checked.mblCheckBoxSelected {
  background-image: -moz-linear-gradient(top, #088eef 0%, #0869c6 50%, #0851ad 100%);
}
.dj_ff3 .mblCheckBox {
  -moz-border-radius: 6px;
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ibenben.mapper.WmsSchemaMapper" >
  <resultMap id="BaseResultMap" type="com.ibenben.domain.WmsSchema" >
    <id column="schema_id" property="schemaId" jdbcType="BIGINT" />
    <result column="schema_code" property="schemaCode" jdbcType="VARCHAR" />
    <result column="schema_name" property="schemaName" jdbcType="VARCHAR" />
    <result column="create_produce_package_task" property="createProducePackageTask" jdbcType="VARCHAR" />
    <result column="stock_2_production" property="stock2Production" jdbcType="VARCHAR" />
    <result column="raw_material_2_finish" property="rawMaterial2Finish" jdbcType="VARCHAR" />
    <result column="create_print_task" property="createPrintTask" jdbcType="VARCHAR" />
    <result column="print" property="print" jdbcType="VARCHAR" />
    <result column="shipping_out" property="shippingOut" jdbcType="VARCHAR" />
  </resultMap>

  <resultMap type="com.ibenben.domain.WmsSchema" id="WmsSchemaFacilityMap" extends="BaseResultMap">
    <result column="facility_id" property="facilityId" jdbcType="TINYINT" />
  </resultMap>

  <sql id="Base_Column_List" >
    schema_id, schema_code, schema_name, create_produce_package_task, stock_2_production,
    raw_material_2_finish, create_print_task, print, shipping_out
  </sql>

  <select id="getFacilitySchema" parameterType="java.lang.Integer" resultMap="WmsSchemaFacilityMap">
    select
    ws.*,
    f.facility_id
    from facility f
    inner join wms_schema ws on ws.schema_code = f.schema_code
    where f.facility_id = #{facility_id,jdbcType=INTEGER}
  </select>

  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select
    <include refid="Base_Column_List" />
    from wms_schema
    where schema_id = #{schemaId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from wms_schema
    where schema_id = #{schemaId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.ibenben.domain.WmsSchema" >
    insert into wms_schema (schema_id, schema_code, schema_name,
      create_produce_package_task, stock_2_production,
      raw_material_2_finish, create_print_task, print,
      shipping_out)
    values (#{schemaId,jdbcType=BIGINT}, #{schemaCode,jdbcType=VARCHAR}, #{schemaName,jdbcType=VARCHAR},
      #{createProducePackageTask,jdbcType=VARCHAR}, #{stock2Production,jdbcType=VARCHAR},
      #{rawMaterial2Finish,jdbcType=VARCHAR}, #{createPrintTask,jdbcType=VARCHAR}, #{print,jdbcType=VARCHAR},
      #{shippingOut,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ibenben.domain.WmsSchema" >
    insert into wms_schema
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="schemaId != null" >
        schema_id,
      </if>
      <if test="schemaCode != null" >
        schema_code,
      </if>
      <if test="schemaName != null" >
        schema_name,
      </if>
      <if test="createProducePackageTask != null" >
        create_produce_package_task,
      </if>
      <if test="stock2Production != null" >
        stock_2_production,
      </if>
      <if test="rawMaterial2Finish != null" >
        raw_material_2_finish,
      </if>
      <if test="createPrintTask != null" >
        create_print_task,
      </if>
      <if test="print != null" >
        print,
      </if>
      <if test="shippingOut != null" >
        shipping_out,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="schemaId != null" >
        #{schemaId,jdbcType=BIGINT},
      </if>
      <if test="schemaCode != null" >
        #{schemaCode,jdbcType=VARCHAR},
      </if>
      <if test="schemaName != null" >
        #{schemaName,jdbcType=VARCHAR},
      </if>
      <if test="createProducePackageTask != null" >
        #{createProducePackageTask,jdbcType=VARCHAR},
      </if>
      <if test="stock2Production != null" >
        #{stock2Production,jdbcType=VARCHAR},
      </if>
      <if test="rawMaterial2Finish != null" >
        #{rawMaterial2Finish,jdbcType=VARCHAR},
      </if>
      <if test="createPrintTask != null" >
        #{createPrintTask,jdbcType=VARCHAR},
      </if>
      <if test="print != null" >
        #{print,jdbcType=VARCHAR},
      </if>
      <if test="shippingOut != null" >
        #{shippingOut,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ibenben.domain.WmsSchema" >
    update wms_schema
    <set >
      <if test="schemaCode != null" >
        schema_code = #{schemaCode,jdbcType=VARCHAR},
      </if>
      <if test="schemaName != null" >
        schema_name = #{schemaName,jdbcType=VARCHAR},
      </if>
      <if test="createProducePackageTask != null" >
        create_produce_package_task = #{createProducePackageTask,jdbcType=VARCHAR},
      </if>
      <if test="stock2Production != null" >
        stock_2_production = #{stock2Production,jdbcType=VARCHAR},
      </if>
      <if test="rawMaterial2Finish != null" >
        raw_material_2_finish = #{rawMaterial2Finish,jdbcType=VARCHAR},
      </if>
      <if test="createPrintTask != null" >
        create_print_task = #{createPrintTask,jdbcType=VARCHAR},
      </if>
      <if test="print != null" >
        print = #{print,jdbcType=VARCHAR},
      </if>
      <if test="shippingOut != null" >
        shipping_out = #{shippingOut,jdbcType=VARCHAR},
      </if>
    </set>
    where schema_id = #{schemaId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ibenben.domain.WmsSchema" >
    update wms_schema
    set schema_code = #{schemaCode,jdbcType=VARCHAR},
      schema_name = #{schemaName,jdbcType=VARCHAR},
      create_produce_package_task = #{createProducePackageTask,jdbcType=VARCHAR},
      stock_2_production = #{stock2Production,jdbcType=VARCHAR},
      raw_material_2_finish = #{rawMaterial2Finish,jdbcType=VARCHAR},
      create_print_task = #{createPrintTask,jdbcType=VARCHAR},
      print = #{print,jdbcType=VARCHAR},
      shipping_out = #{shippingOut,jdbcType=VARCHAR}
    where schema_id = #{schemaId,jdbcType=BIGINT}
  </update>
</mapper>


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USBD_CDC_IF_H
#define __USBD_CDC_IF_H

/* Includes ------------------------------------------------------------------*/
#include "usbd_cdc.h"

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* User can use this section to tailor USARTx/UARTx instance used and associated
   resources */
/* Definition for USARTx clock resources */
#define USARTx                           USART3
#define USARTx_CLK_ENABLE()              __HAL_RCC_USART3_CLK_ENABLE();
#define DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
#define USARTx_RX_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOC_CLK_ENABLE()
#define USARTx_TX_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOC_CLK_ENABLE()

#define USARTx_FORCE_RESET()             __HAL_RCC_USART3_FORCE_RESET()
#define USARTx_RELEASE_RESET()           __HAL_RCC_USART3_RELEASE_RESET()

/* Definition for USARTx Pins */
#define USARTx_TX_PIN                    GPIO_PIN_10
#define USARTx_TX_GPIO_PORT              GPIOC
#define USARTx_TX_AF                     GPIO_AF7_USART3
#define USARTx_RX_PIN                    GPIO_PIN_11
#define USARTx_RX_GPIO_PORT              GPIOC
#define USARTx_RX_AF                     GPIO_AF7_USART3

/* Definition for USARTx's NVIC: used for receiving data over Rx pin */
#define USARTx_IRQn                      USART3_IRQn
#define USARTx_IRQHandler                USART3_IRQHandler

/* Definition for USARTx's DMA: used for transmitting data over Tx pin */
#define USARTx_TX_DMA_CHANNEL            DMA_CHANNEL_4
#define USARTx_TX_DMA_STREAM             DMA1_Stream3
#define USARTx_DMA_TX_IRQHandler         DMA1_Stream3_IRQHandler
#define USARTx_DMA_TX_IRQn               DMA1_Stream3_IRQn

/* Definition for TIMx clock resources */
#define TIMx                             TIM3
#define TIMx_CLK_ENABLE                  __HAL_RCC_TIM3_CLK_ENABLE
#define TIMx_FORCE_RESET()               __HAL_RCC_USART3_FORCE_RESET()
#define TIMx_RELEASE_RESET()             __HAL_RCC_USART3_RELEASE_RESET()

/* Definition for TIMx's NVIC */
#define TIMx_IRQn                        TIM3_IRQn
#define TIMx_IRQHandler                  TIM3_IRQHandler

/* Periodically, the state of the buffer "UserTxBuffer" is checked.
   The period depends on CDC_POLLING_INTERVAL */
#define CDC_POLLING_INTERVAL             5 /* in ms. The max is 65 and the min is 1 */

extern USBD_CDC_ItfTypeDef  USBD_CDC_fops;

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif /* __USBD_CDC_IF_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
opal_filter "Date" do
  fails "Date#>> returns the day of the reform if date falls within calendar reform"
  fails "Date#ajd determines the Astronomical Julian day"
  fails "Date#amjd determines the Astronomical Modified Julian day"
  fails "Date#civil creates a Date for different calendar reform dates"
  fails "Date#civil doesn't create dates for invalid arguments"
  fails "Date#commercial creates a Date for Julian Day Number day 0 by default"
  fails "Date#commercial creates a Date for the correct day given the year, week and day number" # NoMethodError: undefined method `commercial' for Date
  fails "Date#commercial creates a Date for the monday in the year and week given" # NoMethodError: undefined method `commercial' for Date
  fails "Date#commercial creates only Date objects for valid weeks"
  fails "Date#cwyear determines the commercial year"
  fails "Date#day_fraction determines the day fraction"
  fails "Date#england converts a date object into another with the English calendar reform"
  fails "Date#gregorian converts a date object into another with the Gregorian calendar"
  fails "Date#gregorian? marks a day after the calendar reform as Julian"
  fails "Date#gregorian? marks a day before the calendar reform as Julian"
  fails "Date#hash returns the same value for equal dates"
  fails "Date#italy converts a date object into another with the Italian calendar reform"
  fails "Date#julian converts a date object into another with the Julian calendar"
  fails "Date#julian? marks a day before the calendar reform as Julian"
  fails "Date#ld determines the Modified Julian day"
  fails "Date#mday determines the day of the month"
  fails "Date#mjd determines the Modified Julian day"
  fails "Date#mon determines the month"
  fails "Date#new_start converts a date object into another with a new calendar reform"
  fails "Date#parse parses a day name into a Date object"
  fails "Date#parse parses a month day into a Date object"
  fails "Date#parse parses a month name into a Date object"
  fails "Date#parse raises a TypeError trying to parse non-String-like object" # ArgumentError: invalid date
  fails "Date#strftime should be able to print the commercial year with leading zeroes"
  fails "Date#strftime should be able to print the commercial year with only two digits"
  fails "Date#strftime should be able to print the julian day with leading zeroes"
  fails "Date#strftime should be able to show a full notation"
  fails "Date#strftime should be able to show the commercial week day"
  fails "Date#strftime should be able to show the commercial week"
  fails "Date#strftime should be able to show the number of seconds since the unix epoch for a date" # Expected "954964800" to equal "954979200"
  fails "Date#strftime should be able to show the number of seconds since the unix epoch"
  fails "Date#strftime should be able to show the timezone of the date with a : separator"
  fails "Date#strftime should be able to show the timezone with a : separator"
  fails "Date#strftime should be able to show the week number with the week starting on Sunday (%U) and Monday (%W)"
  fails "Date#strftime shows the number of milliseconds since epoch"
  fails "Date#strptime parses a century"
  fails "Date#strptime parses a commercial week day"
  fails "Date#strptime parses a commercial week"
  fails "Date#strptime parses a commercial year with leading zeroes"
  fails "Date#strptime parses a commercial year with only two digits"
  fails "Date#strptime parses a date given MM/DD/YY"
  fails "Date#strptime parses a date given as YYYY-MM-DD"
  fails "Date#strptime parses a date given in full notation"
  fails "Date#strptime parses a date with slashes"
  fails "Date#strptime parses a full date"
  fails "Date#strptime parses a full day name"
  fails "Date#strptime parses a full month name"
  fails "Date#strptime parses a month day with leading spaces"
  fails "Date#strptime parses a month day with leading zeroes"
  fails "Date#strptime parses a month with leading zeroes"
  fails "Date#strptime parses a short day name"
  fails "Date#strptime parses a short month name"
  fails "Date#strptime parses a week day"
  fails "Date#strptime parses a week number for a week starting on Monday"
  fails "Date#strptime parses a week number for a week starting on Sunday"
  fails "Date#strptime parses a year day with leading zeroes"
  fails "Date#strptime parses a year in YY format"
  fails "Date#strptime parses a year in YYYY format"
  fails "Date#strptime returns January 1, 4713 BCE when given no arguments"
  fails "Date#strptime uses the default format when not given a date format"
  fails "Date#valid_civil? handles negative months and days"
  fails "Date#valid_civil? returns false if it is not a valid civil date"
  fails "Date#valid_civil? returns true if it is a valid civil date"
  fails "Date#valid_commercial? handles negative week and day numbers"
  fails "Date#valid_commercial? returns false it is not a valid commercial date"
  fails "Date#valid_commercial? returns true if it is a valid commercial date"
  fails "Date#valid_date? handles negative months and days"
  fails "Date#valid_date? returns false if it is not a valid civil date"
  fails "Date#valid_date? returns true if it is a valid civil date"
  fails "Date#yday determines the year"
  fails "Date.iso8601 parses YYYY-MM-DD into a Date object" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 parses YYYYMMDD into a Date object" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 parses a StringSubclass into a Date object" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 parses a Symbol into a Date object" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 parses a negative Date" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 raises a TypeError when passed an Object" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.iso8601 raises an ArgumentError when passed a Symbol without a valid Date" # NoMethodError: undefined method `iso8601' for Date
  fails "Date.jd constructs a Date object if passed a Julian day"
  fails "Date.jd constructs a Date object if passed a negative number"
  fails "Date.jd returns a Date object representing Julian day 0 (-4712-01-01) if no arguments passed"
  fails "Date.julian_leap? determines whether a year is a leap year in the Julian calendar"
  fails "Date.julian_leap? determines whether a year is not a leap year in the Julian calendar"
  fails "Date.new creates a Date for different calendar reform dates"
  fails "Date.new doesn't create dates for invalid arguments"
  fails "Date.ordinal constructs a Date object from an ordinal date"
  fails "Date.valid_jd? returns false if passed nil"
  fails "Date.valid_jd? returns true if passed any value other than nil"
  fails "Date.valid_jd? returns true if passed false"
  fails "Date.valid_ordinal? determines if the date is a valid ordinal date"
  fails "Date.valid_ordinal? handles negative day numbers"
end


text: package com.tle.web.discoverability.scripting.objects;


text:
import win32ui
from pywin.mfc import docview
from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding
from scintillacon import *
import win32con
import string
import array

ParentScintillaDocument=docview.Document
class CScintillaDocument(ParentScintillaDocument):
	"A SyntEdit document. "
	def DeleteContents(self):
		pass

	def OnOpenDocument(self, filename):
		# init data members
		#print "Opening", filename
		self.SetPathName(filename) # Must set this early!
		try:
			if is_platform_unicode:
				# Scintilla in UTF-8 mode - translate accordingly.
				import codecs
				f = codecs.open(filename, 'rb', default_platform_encoding)
			else:
				f = open(filename, 'rb')
			try:
				text = f.read()
			finally:
				f.close()
			if is_platform_unicode:
				# Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla
				text = text.encode(default_scintilla_encoding)
		except IOError:
			win32ui.MessageBox("Could not load the file from %s" % filename)
			return 0

		self._SetLoadedText(text)
##		if self.GetFirstView():
##			self.GetFirstView()._SetLoadedText(text)
##		self.SetModifiedFlag(0) # No longer dirty
		return 1

	def SaveFile(self, fileName):
		view = self.GetFirstView()
		ok = view.SaveTextFile(fileName)
		if ok:
			view.SCISetSavePoint()
		return ok

	def ApplyFormattingStyles(self):
		self._ApplyOptionalToViews("ApplyFormattingStyles")

	# #####################
	# File related functions
	# Helper to transfer text from the MFC document to the control.
	def _SetLoadedText(self, text):
		view = self.GetFirstView()
		if view.IsWindow():
			# Turn off undo collection while loading
			view.SendScintilla(SCI_SETUNDOCOLLECTION, 0, 0)
			# Make sure the control isnt read-only
			view.SetReadOnly(0)

			doc = self
			view.SendScintilla(SCI_CLEARALL)
			view.SendMessage(SCI_ADDTEXT, buffer(text))
			view.SendScintilla(SCI_SETUNDOCOLLECTION, 1, 0)
			view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0)

	def FinalizeViewCreation(self, view):
		pass

	def HookViewNotifications(self, view):
		parent = view.GetParentFrame()
		parent.HookNotify(ViewNotifyDelegate(self, "OnBraceMatch"), SCN_CHECKBRACE)
		parent.HookNotify(ViewNotifyDelegate(self, "OnMarginClick"), SCN_MARGINCLICK)
		parent.HookNotify(ViewNotifyDelegate(self, "OnNeedShown"), SCN_NEEDSHOWN)

		parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointReached"), SCN_SAVEPOINTREACHED)
		parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointLeft"), SCN_SAVEPOINTLEFT)
		parent.HookNotify(DocumentNotifyDelegate(self, "OnModifyAttemptRO"), SCN_MODIFYATTEMPTRO)
		# Tell scintilla what characters should abort auto-complete.
		view.SCIAutoCStops(string.whitespace+"()[]:;+-/*=\\?'!#@$%^&,<>\"'|" )

		if view != self.GetFirstView():
			view.SCISetDocPointer(self.GetFirstView().SCIGetDocPointer())

	def OnSavePointReached(self, std, extra):
		self.SetModifiedFlag(0)

	def OnSavePointLeft(self, std, extra):
		self.SetModifiedFlag(1)

	def OnModifyAttemptRO(self, std, extra):
		self.MakeDocumentWritable()

	# All Marker functions are 1 based.
	def MarkerAdd( self, lineNo, marker ):
		self.GetEditorView().SCIMarkerAdd(lineNo-1, marker)

	def MarkerCheck(self, lineNo, marker ):
		v = self.GetEditorView()
		lineNo = lineNo - 1 # Make 0 based
		markerState = v.SCIMarkerGet(lineNo)
		return markerState & (1<<marker) != 0

	def MarkerToggle( self, lineNo, marker ):
		v = self.GetEditorView()
		if self.MarkerCheck(lineNo, marker):
			v.SCIMarkerDelete(lineNo-1, marker)
		else:
			v.SCIMarkerAdd(lineNo-1, marker)
	def MarkerDelete( self, lineNo, marker ):
		self.GetEditorView().SCIMarkerDelete(lineNo-1, marker)
	def MarkerDeleteAll( self, marker ):
		self.GetEditorView().SCIMarkerDeleteAll(marker)
	def MarkerGetNext(self, lineNo, marker):
		return self.GetEditorView().SCIMarkerNext( lineNo-1, 1 << marker )+1
	def MarkerAtLine(self, lineNo, marker):
		markerState = self.GetEditorView().SCIMarkerGet(lineNo-1)
		return markerState & (1<<marker)

	# Helper for reflecting functions to views.
	def _ApplyToViews(self, funcName, *args):
		for view in self.GetAllViews():
			func = getattr(view, funcName)
			apply(func, args)
	def _ApplyOptionalToViews(self, funcName, *args):
		for view in self.GetAllViews():
			func = getattr(view, funcName, None)
			if func is not None:
				apply(func, args)
	def GetEditorView(self):
		# Find the first frame with a view,
		# then ask it to give the editor view
		# as it knows which one is "active"
		try:
			frame_gev = self.GetFirstView().GetParentFrame().GetEditorView
		except AttributeError:
			return self.GetFirstView()
		return frame_gev()

# Delegate to the correct view, based on the control that sent it.
class ViewNotifyDelegate:
	def __init__(self, doc, name):
		self.doc = doc
		self.name = name
	def __call__(self, std, extra):
		(hwndFrom, idFrom, code) = std
		for v in self.doc.GetAllViews():
			if v.GetSafeHwnd() == hwndFrom:
				return apply(getattr(v, self.name), (std, extra))

# Delegate to the document, but only from a single view (as each view sends it seperately)
class DocumentNotifyDelegate:
	def __init__(self, doc, name):
		self.doc = doc
		self.delegate = getattr(doc, name)
	def __call__(self, std, extra):
		(hwndFrom, idFrom, code) = std
		if hwndFrom == self.doc.GetEditorView().GetSafeHwnd():
				apply(self.delegate, (std, extra))


text:
QAT

{{ title }}


text:
//
// Created by dapl on 2017-04-14.
//

#ifndef PROJECT_REALTIMETASK_H
#define PROJECT_REALTIMETASK_H

#include "Task.hpp"
#include "Time.hpp"

namespace PiOS {
    /*!
     * \brief Class, which represents RealTimeTask, that can be performed by the OS
     */
    class RealTimeTask : public Task {
    public:
        /*!
         * \brief Functional object, that makes comparison of the tasks possible.
         *
         * Class makes possible to compare Tasks using it's deadline and release times.
         * Useable for sorting with std::sorts
         */
        class RTTaskComparator {
        public:
            enum CompareType {
                RELEASE_TIME, DEADLINE
            };

            /*!
             * \brief Constructor, which decides, how the comparator will be comparing the tasks.
             * \param compareType Type of comparison, that Comparator is to be performed.
             */
            explicit RTTaskComparator(CompareType compareType) : mCompareType(compareType) {}

            /*!
             * \brief Function operator, which performs comparison.
             *
             * Returns true if lhs is less than rhs, false otherwise (acocording to standard
             * comparison operators).
             *
             * @param lhs Left Hand Side of comparison
             * @param rhs Right Hand Side of comparison
             * @return Returns true if lhs is less than rhs, false otherwise.
             */
            bool operator()(PiOS::Time rhs, const RealTimeTask *lhs) {
                if (mCompareType == RELEASE_TIME)
                    return lhs->releaseTime() > rhs;
                else
                    return lhs->deadline() > rhs;
            }

        private:
            CompareType mCompareType;
        };

        /*!
         * \brief Constructor. Creates RealTimeTask with RealTime constants required for proper scheduling.
         *
         * \param job Job to be executed by the Task.
         * \param startTime Release time of the Task.
         * \param deadline Deadline of the Task.
         * \param stackSize Size of the task's stack.
         * \param startUpFunction StartUp of the job. Usually calls current job and exit system call.
         */
        explicit RealTimeTask(const TaskJob &job, const Time &startTime, const Time &deadline, std::size_t stackSize,
                              StartUp startUpFunction = Task::defaultStartUp)
                : Task(job, stackSize, startUpFunction),
                  mDeadline(deadline),
                  mReleaseTime(startTime) {}

        RealTimeTask(const RealTimeTask &rhs) = delete;

        /*!
         * \brief Move constructor
         * @param rhs Right Hand Side of constructor.
         */
        RealTimeTask(RealTimeTask &&rhs);

        /*!
         * \brief Allows to get release time of the Task.
         * @return Release time of the Task.
         */
        Time & releaseTime() { return mReleaseTime; }
        const Time & releaseTime() const { return mReleaseTime; }

        /*!
         * \brief Allows to get deadline time of the Task.
         * @return Deadline time of the Task.
         */
        Time & deadline() { return mDeadline; }
        const Time & deadline() const { return mDeadline; }

    private:
        Time mDeadline;
        Time mReleaseTime;
    };
}

#endif //PROJECT_REALTIMETASK_H


text:
System.register(['aurelia-binding'], function(exports_1, context_1) {
    "use strict";
    var __moduleName = context_1 && context_1.id;
    var aurelia_binding_1;
    function getObject(expression, objectExpression, source) {
        var value = objectExpression.evaluate(source, null);
        if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
            return value;
        }
        if (value === null) {
            value = 'null';
        }
        else if (value === undefined) {
            value = 'undefined';
        }
        throw new Error("The '" + objectExpression + "' part of '" + expression + "' evaluates to " + value + " instead of an object.");
    }
    /**
     * Retrieves the object and property name for the specified expression.
     * @param expression The expression
     * @param source The scope
     */
    function getPropertyInfo(expression, source) {
        var originalExpression = expression;
        while (expression instanceof aurelia_binding_1.BindingBehavior || expression instanceof aurelia_binding_1.ValueConverter) {
            expression = expression.expression;
        }
        var object;
        var propertyName;
        if (expression instanceof aurelia_binding_1.AccessScope) {
            object = source.bindingContext;
            propertyName = expression.name;
        }
        else if (expression instanceof aurelia_binding_1.AccessMember) {
            object = getObject(originalExpression, expression.object, source);
            propertyName = expression.name;
        }
        else if (expression instanceof aurelia_binding_1.AccessKeyed) {
            object = getObject(originalExpression, expression.object, source);
            propertyName = expression.key.evaluate(source);
        }
        else {
            throw new Error("Expression '" + originalExpression + "' is not compatible with the validate binding-behavior.");
        }
        return { object: object, propertyName: propertyName };
    }
    exports_1("getPropertyInfo", getPropertyInfo);
    return {
        setters:[
            function (aurelia_binding_1_1) {
                aurelia_binding_1 = aurelia_binding_1_1;
            }],
        execute: function() {
        }
    }
});


text:
'use strict';

var should = require('chai').should(),
    stripDebug = require('./../');

describe('# Testing diferents enter data types', function() {
    it ('With a number should returns a exception', function() {
        (function() {stripDebug(637)})
            .should
            .throw();
    });
    it ('With a array should returns a exception', function() {
        (function() {stripDebug(['637'])})
            .should
            .throw();
    });
    it ('With undefined should returns a exception', function() {
        (function() {stripDebug(undefined)})
            .should
            .throw();
    });
    it ('With a empty string should returns a exception', function() {
        (function() {stripDebug(null)})
            .should
            .throw();
    });
    it ('With a empty string should returns a exception', function() {
        (function() {stripDebug('')})
            .should
            .throw();
    });
});


text:
import boto3
import json
from urllib import request

import common

class Activity:
  # Subclasses must override these.
  ec2_iam_arn = None
  activity_arn = None
  script_name = None
  # Optional.
  init_script = None
  after_task_script = None

  def __init__(self, event):
    self.event = event
    self.fake_ec2 = common.fake_ec2(event)
    self.is_test_build = common.is_test_build(event)

  def version(self):
    return self.event['version']

  def platform(self):
    return self.event['platform']

  def worker_env(self):
    # Subclasses can provide extra environment variables for worker.sh (will
    # also be available from self.init_script)
    return {}

  def task_env(self):
    # Subclasses can provide extra environment variables for the individual
    # task's script (self.script_name and self.after_task_script)
    return {}

  def needs_ec2_worker(self):
    # Subclasses may override.
    return True

  def has_ec2_workers(self):
    # pylint: disable=no-member
    for _ in boto3.resource('ec2').instances.filter(
      Filters=[
        {'Name': 'tag:ActivityArn', 'Values': [self.activity_arn]},
        {'Name': 'instance-state-name', 'Values': ['pending', 'running']},
      ],
      MaxResults=5,
    ):
      return True
    return False

  def ec2_params(self):
    if not self.ec2_iam_arn or not self.activity_arn or not self.script_name:
      raise Exception('missing config in ' + type(self).__name__)

    script_url = common.url(
      'aws/hhvm1/worker/dummy-task.sh' if self.fake_ec2
      else 'aws/userdata/' + self.script_name
    )
    init_url = (
      common.url(self.init_script)
        if self.init_script and not self.fake_ec2
        else ''
    )
    after_task_url = (
      common.url(self.after_task_script)
        if self.after_task_script and not self.fake_ec2
        else ''
    )
    return {
      'ImageId': 'ami-03d5c68bab01f3496',  # ubuntu 20.04
      'MaxCount': 1,
      'MinCount': 1,
      'InstanceType': 't2.micro',
      'SecurityGroups': ['hhvm-binary-package-builders'],
      'InstanceInitiatedShutdownBehavior': 'terminate',
      'IamInstanceProfile': {'Arn': self.ec2_iam_arn},
      'KeyName': 'hhvm-package-builders',
      'TagSpecifications': [{
        'ResourceType': 'instance',
        'Tags': [
          {
            'Key': 'Name',
            'Value': 'ww-0-' + type(self).__name__,
          },
          {
            'Key': 'ActivityArn',
            'Value': self.activity_arn,
          },
        ],
      }],
      'UserData': f'''#!/bin/bash
        ACTIVITY_ARN="{self.activity_arn}"
        SCRIPT_URL="{script_url}"
        INIT_URL="{init_url}"
        AFTER_TASK_URL="{after_task_url}"
        {common.format_env(self.worker_env())}
        {common.fetch('aws/hhvm1/worker/worker.sh')}
      ''',
    }

class MakeSourceTarball(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-source-tarball-builder'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-make-source-tarball'
  script_name = 'make-source-tarball.sh'

  def should_run(self):
    env = common.env_for_version(self.version())
    return not any(
      obj['Key'] == env['S3_PATH']
        for obj in boto3.client('s3')
          .list_objects(Bucket=env['S3_BUCKET'], Prefix=env['S3_PATH'])
          .get('Contents', [])
    )

  def ec2_params(self):
    params = super().ec2_params()
    params.update({
      'BlockDeviceMappings': [{
        'DeviceName': '/dev/sda1',
        'Ebs': {
          'DeleteOnTermination': True,
          'VolumeSize': 16,  # GB
          'VolumeType': 'gp2',
        },
      }],
    })
    return params

class MakeBinaryPackage(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-binary-package-builder'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-make-binary-package'
  script_name = 'make-binary-package.sh'
  after_task_script = 'aws/hhvm1/worker/after-task/make-binary-package.sh'

  def task_env(self):
    if self.is_test_build:
      return {'SKIP_PUBLISH': '1'}
    return {}

  def should_run(self):
    return common.build_status(self.version(), self.platform()) == 'not_built'

  def ec2_params(self):
    params = super().ec2_params()
    params.update({
      'InstanceType': 'r6i.4xlarge',  # 16 cores, 128GB RAM
      'BlockDeviceMappings': [{
        'DeviceName': '/dev/sda1',
        'Ebs': {
          'DeleteOnTermination': True,
          'VolumeSize': 256,  # GB
          'VolumeType': 'gp2',
        },
      }],
    })
    return params

class PublishBinaryPackages(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-repo-builders'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-publish-binary-packages'
  script_name = 'update-repos.sh'

  def task_env(self):
    return {'REPOS_ONLY': '1'}

  def should_run(self):
    return any(
      status == 'built_not_published'
        for platform, status in common.build_statuses(self.version()).items()
        if common.is_linux(platform)
    )

  def ec2_params(self):
    params = super().ec2_params()
    params.update({
      # This is required as we have a persistent EBS volume containing the
      # repositories, and the instance must be in the same availability zone
      # as an EBS volume to attach it.
      'Placement': {'AvailabilityZone': 'us-west-2a'},
      'BlockDeviceMappings': [{
        'DeviceName': '/dev/sda1',
        'Ebs': {
          'DeleteOnTermination': True,
          'VolumeSize': 100,  # GB
          'VolumeType': 'gp2',
        },
      }],
    })
    return params

  def needs_ec2_worker(self):
    # These access a shared EBS volume, so only one can run at a time.
    return not self.has_ec2_workers()

class PublishSourceTarball(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-source-tarball-builder'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-publish-source-tarball'
  script_name = 'publish-release-source.sh'

  def should_run(self):
    if common.is_nightly(self.version()):
      return False
    statuses = common.build_statuses(self.version())
    return (
      statuses.get('source') == 'built_not_published' or
      statuses.get('source_gpg') == 'built_not_published'
    )

class PublishDockerImages(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-repo-builders'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-publish-docker-images'
  script_name = 'update-repos.sh'

  def task_env(self):
    return {'DOCKER_ONLY': '1'}

  def should_run(self):
    return True

class BuildAndPublishMacOS(Activity):
  ec2_iam_arn = 'arn:aws:iam::223121549624:instance-profile/hhvm-macos-builds-triggerer'
  activity_arn = 'arn:aws:states:us-west-2:223121549624:activity:hhvm-build-and-publish-macos'
  script_name = 'trigger-macos-builds.sh'

  def platforms_to_build(self):
    requested = common.Config.macos_versions.keys()
    if self.event['buildInput']['platforms']:
      requested = {
        p for p in requested if p in self.event['buildInput']['platforms']
      }

    return set() if not requested else {
      platform
        for platform, status in common.build_statuses(self.version()).items()
        if status != 'succeeded' and platform in requested
    }

  def worker_env(self):
    if self.fake_ec2:
      return {}
    return {'SKIP_SEND_TASK_SUCCESS': '1'}

  def task_env(self):
    task_env = {}

    if self.is_test_build:
      task_env['SKIP_PUBLISH'] = '1'

    # Right now we can only correctly trigger a build for a single platform or
    # for all platforms, but the Azure pipeline will skip any platforms that are
    # already built, so at worst this wastes a few CPU cycles.
    platforms = self.platforms_to_build()
    if len(platforms) == 1:
      task_env['PLATFORM'] = common.Config.macos_versions[next(iter(platforms))]

    return task_env

  def should_run(self):
    return bool(self.platforms_to_build())


text:
'use strict';

module.exports = Component;

var path      = require('path');
var assign    = require('object-assign');
var json      = require('read-json-sync');
var camelCase = require('camelcase');
var isSymlink = require('is-symlink-sync');
var mainFiles = require('./utils/main-files');
var getDeps   = require('./utils/get-deps');
var depFiles  = require('./utils/dep-files');

function Component(options) {

  // options = {
  //   name: '',
  //   dir: ''
  // }
  assign(this, options);

  // Set the path
  this.path = path.resolve(this.dir, this.name);

  // Get this bower.json
  var bowerFile = isSymlink(this.path) ? 'bower.json' : this.componentJson;
  this.json = json(path.resolve(this.path, bowerFile));

  // Apply the overrides
  assign(this.json, this.overrides[this.name]);

  if (!this.json.main) {
    throw new Error(this.name + ' has no main property');
  }

  // Get the main files
  this.files = mainFiles(this.json.main, this.path);

  // Get the dependencies
  this.dependencies = getDeps(this.json.dependencies, {
    dir: this.dir,
    overrides: this.overrides,
    componentJson: this.componentJson
  });

}

Component.prototype.getFiles = function () {
  return depFiles(this.dependencies, this.files);
};

Component.prototype.getDeps = function (useCamelCase) {
  var hash = {};
  var name = useCamelCase ? camelCase(this.name) : this.name;
  hash[name] = this.files;
  return assign(hash, depFiles.depHash(this.dependencies));
};


text:
package org.lyon_yan.app.android.lib_lyon_yan_utils.widget;

import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.support.annotation.NonNull;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

/**
 * Created by IntelliJ IDEA. User: keith. Date: 14-10-9. Time: 17:04.
 */
public class PaperButton extends View {

	private static final long ANIMATION_DURATION = 200;
	private static final int StateNormal = 1;
	private static final int StateTouchDown = 2;
	private static final int StateTouchUp = 3;
	@SuppressWarnings("unused")
	private static final float SHADOW_RADIUS = 8.0f;
	@SuppressWarnings("unused")
	private static final float SHADOW_OFFSET_X = 0.0f;
	@SuppressWarnings("unused")
	private static final float SHADOW_OFFSET_Y = 4.0f;
	private static final float MIN_SHADOW_COLOR_ALPHA = 0.1f;
	private static final float MAX_SHADOW_COLOR_ALPHA = 0.4f;

	private int mState = StateNormal;
	private long mStartTime;
	private int mColor;
	private int mShadowColor;
	private int mCornerRadius;
	private int mPadding;
	private int mTextSize;
	private int mTextColor;
	private float mShadowRadius;
	private float mShadowOffsetX;
	private float mShadowOffsetY;
	private CharSequence mText;
	private RectF backgroundRectF;
	private Rect mFingerRect;
	private Path rippleClipPath;
	private boolean mMoveOutside;
	private Point mTouchPoint = new Point();

	private Paint backgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	private Paint ripplePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	private TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);

	public PaperButton(Context context) {
		this(context, null);
	}

	public PaperButton(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public PaperButton(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);

		backgroundPaint.setColor(mColor);
		backgroundPaint.setStyle(Paint.Style.FILL);
		int shadowColor = changeColorAlpha(mShadowColor, MIN_SHADOW_COLOR_ALPHA);
		backgroundPaint.setShadowLayer(mShadowRadius, mShadowOffsetX,
				mShadowOffsetY, shadowColor);

		textPaint.setColor(mTextColor);
		textPaint.setTextSize(mTextSize);
		textPaint.setTextAlign(TextPaint.Align.CENTER);

		ripplePaint.setColor(darkenColor(mColor));

		setWillNotDraw(false);
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
			setLayerType(View.LAYER_TYPE_SOFTWARE, null);
		}
	}

	private int changeColorAlpha(int color, float value) {
		int alpha = Math.round(Color.alpha(color) * value);
		int red = Color.red(color);
		int green = Color.green(color);
		int blue = Color.blue(color);
		return Color.argb(alpha, red, green, blue);
	}

	private int darkenColor(int color) {
		float[] hsv = new float[3];
		Color.colorToHSV(color, hsv);
		hsv[2] *= 0.9f;
		return Color.HSVToColor(hsv);
	}

	public void setColor(int color) {
		mColor = color;
		backgroundPaint.setColor(mColor);
		invalidate();
	}

	public void setShadowColor(int color) {
		mShadowColor = color;
		backgroundPaint.setShadowLayer(mShadowRadius, mShadowOffsetX,
				mShadowOffsetY, mShadowColor);
		invalidate();
	}

	public void setTextSize(int pixel) {
		mTextSize = pixel;
		textPaint.setTextSize(mTextSize);
		invalidate();
	}

	public void setTextColor(int color) {
		mTextColor = color;
		textPaint.setColor(mTextColor);
		invalidate();
	}

	public void setText(String text) {
		mText = text;
		invalidate();
	}

	public String getText() {
		return mText.toString();
	}

	private RectF getRectF() {
		if (backgroundRectF == null) {
			backgroundRectF = new RectF();
			backgroundRectF.left = mPadding;
			backgroundRectF.top = mPadding;
			backgroundRectF.right = getWidth() - mPadding;
			backgroundRectF.bottom = getHeight() - mPadding;
		}
		return backgroundRectF;
	}

	@Override
	public boolean onTouchEvent(@NonNull MotionEvent event) {
		switch (event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			mMoveOutside = false;
			mFingerRect = new Rect(getLeft(), getTop(), getRight(), getBottom());
			mTouchPoint.set(Math.round(event.getX()), Math.round(event.getY()));
			mState = StateTouchDown;
			mStartTime = System.currentTimeMillis();
			invalidate();
			break;
		case MotionEvent.ACTION_MOVE:
			if (!mFingerRect.contains(getLeft() + (int) event.getX(), getTop()
					+ (int) event.getY())) {
				mMoveOutside = true;
				mState = StateNormal;
				invalidate();
			}
			break;
		case MotionEvent.ACTION_UP:
			if (!mMoveOutside) {
				mState = StateTouchUp;
				mStartTime = System.currentTimeMillis();
				invalidate();
				performClick();
			}
			break;
		case MotionEvent.ACTION_CANCEL:
			mState = StateNormal;
			invalidate();
			break;
		}
		return true;
	}

	@Override
	protected void onDraw(@NonNull Canvas canvas) {
		super.onDraw(canvas);
		int radius = 0;
		int shadowColor = changeColorAlpha(mShadowColor, MIN_SHADOW_COLOR_ALPHA);
		long elapsed = System.currentTimeMillis() - mStartTime;
		switch (mState) {
		case StateNormal:
			shadowColor = changeColorAlpha(mShadowColor, MIN_SHADOW_COLOR_ALPHA);
			break;
		case StateTouchDown:
			ripplePaint.setAlpha(255);
			if (elapsed < ANIMATION_DURATION) {
				radius = Math.round(elapsed * getWidth() / 2
						/ ANIMATION_DURATION);
				float shadowAlpha = (MAX_SHADOW_COLOR_ALPHA - MIN_SHADOW_COLOR_ALPHA)
						* elapsed / ANIMATION_DURATION + MIN_SHADOW_COLOR_ALPHA;
				shadowColor = changeColorAlpha(mShadowColor, shadowAlpha);
			} else {
				radius = getWidth() / 2;
				shadowColor = changeColorAlpha(mShadowColor,
						MAX_SHADOW_COLOR_ALPHA);
			}
			postInvalidate();
			break;
		case StateTouchUp:
			if (elapsed < ANIMATION_DURATION) {
				int alpha = Math.round((ANIMATION_DURATION - elapsed) * 255
						/ ANIMATION_DURATION);
				ripplePaint.setAlpha(alpha);
				radius = getWidth()
						/ 2
						+ Math.round(elapsed * getWidth() / 2
								/ ANIMATION_DURATION);
				float shadowAlpha = (MAX_SHADOW_COLOR_ALPHA - MIN_SHADOW_COLOR_ALPHA)
						* (ANIMATION_DURATION - elapsed)
						/ ANIMATION_DURATION
						+ MIN_SHADOW_COLOR_ALPHA;
				shadowColor = changeColorAlpha(mShadowColor, shadowAlpha);
			} else {
				mState = StateNormal;
				radius = 0;
				ripplePaint.setAlpha(0);
				shadowColor = changeColorAlpha(mShadowColor,
						MIN_SHADOW_COLOR_ALPHA);
			}
			postInvalidate();
			break;
		}
		backgroundPaint.setShadowLayer(mShadowRadius, mShadowOffsetX,
				mShadowOffsetY, shadowColor);
		canvas.drawRoundRect(getRectF(), mCornerRadius, mCornerRadius,
				backgroundPaint);
		canvas.save();
		if (mState == StateTouchDown || mState == StateTouchUp) {
			if (rippleClipPath == null) {
				rippleClipPath = new Path();
				rippleClipPath.addRoundRect(getRectF(), mCornerRadius,
						mCornerRadius, Path.Direction.CW);
			}
			canvas.clipPath(rippleClipPath);
		}
		canvas.drawCircle(mTouchPoint.x, mTouchPoint.y, radius, ripplePaint);
		canvas.restore();
		if (mText != null && mText.length() > 0) {
			int y = (int) (getHeight() / 2 - ((textPaint.descent() + textPaint
					.ascent()) / 2));
			canvas.drawText(mText.toString(), getWidth() / 2, y, textPaint);
		}
	}
}


text:
define([
  'jquery',
  'underscore',
  'backbone'
], function($, _, Backbone) {

  var AppView = Backbone.View.extend({
    el: $('.main-container'),

    setViews : function(view) {
      var closingView = this.view;

      this.view = view;
      this.view.render();
      this.view.$el.hide();
      this.$el.append(this.view.el);

      this.openView(this.view);
      this.closeView(closingView);
    },

    openView: function(view){
      view.$el.slideToggle(500);
    },

    closeView: function(view){
      if (view){
        view.unbind();
        view.$el.slideToggle(500, function(){
          $(this).remove();
        });
      }
    }

  });

  return AppView;
});


text:
"""Hue sensor entities."""
from homeassistant.const import (
    DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS)
from homeassistant.helpers.entity import Entity
from homeassistant.components.hue.sensor_base import (
    GenericZLLSensor, async_setup_entry as shared_async_setup_entry)

LIGHT_LEVEL_NAME_FORMAT = "{} light level"
TEMPERATURE_NAME_FORMAT = "{} temperature"

async def async_setup_entry(hass, config_entry, async_add_entities):
    """Defer sensor setup to the shared sensor module."""
    await shared_async_setup_entry(
        hass, config_entry, async_add_entities, binary=False)

class GenericHueGaugeSensorEntity(GenericZLLSensor, Entity):
    """Parent class for all 'gauge' Hue device sensors."""

    async def _async_update_ha_state(self, *args, **kwargs):
        await self.async_update_ha_state(self, *args, **kwargs)

class HueLightLevel(GenericHueGaugeSensorEntity):
    """The light level sensor entity for a Hue motion sensor device."""

    device_class = DEVICE_CLASS_ILLUMINANCE
    unit_of_measurement = "lx"

    @property
    def state(self):
        """Return the state of the device."""
        # https://developers.meethue.com/develop/hue-api/supported-devices/#clip_zll_lightlevel
        # Light level in 10000 log10 (lux) +1 measured by sensor. Logarithm
        # scale used because the human eye adjusts to light levels and small
        # changes at low lux levels are more noticeable than at high lux
        # levels.
        return 10 ** ((self.sensor.lightlevel - 1) / 10000)

    @property
    def device_state_attributes(self):
        """Return the device state attributes."""
        attributes = super().device_state_attributes
        attributes.update({
            "threshold_dark": self.sensor.tholddark,
            "threshold_offset": self.sensor.tholdoffset,
        })
        return attributes

class HueTemperature(GenericHueGaugeSensorEntity):
    """The temperature sensor entity for a Hue motion sensor device."""

    device_class = DEVICE_CLASS_TEMPERATURE
    unit_of_measurement = TEMP_CELSIUS

    @property
    def state(self):
        """Return the state of the device."""
        return self.sensor.temperature / 100


text:
/*!
 * Bootstrap Confirmation v1.0.5
 * https://github.com/tavicu/bs-confirmation
 */
+function (c) {
    var b = false;
    var d = function (f, e) {
        var g = this;
        this.init("confirmation", f, e);
        c(f).on("show.bs.confirmation", function (j) {
            g.options.onShow(j, this);
            c(this).addClass("open");
            var h = g.options;
            var i = h.all_selector;
            if (h.singleton) {
                c(i).not(g.$element).each(function () {
                    if (c(this).hasClass("open")) {
                        c(this).confirmation("hide")
                    }
                })
            }
        });
        c(f).on("hide.bs.confirmation", function (h) {
            g.options.onHide(h, this);
            c(this).removeClass("open")
        });
        c(f).on("shown.bs.confirmation", function (j) {
            var h = g.options;
            var i = h.all_selector;
            if (g.isPopout()) {
                if (!b) {
                    b = c("body").on("click", function (k) {
                        if (g.$element.is(k.target)) {
                            return
                        }
                        if (g.$element.has(k.target).length) {
                            return
                        }
                        if (c(".popover").has(k.target).length) {
                            return
                        }
                        g.hide();
                        g.inState.click = false;
                        c("body").unbind(k);
                        b = false;
                        return
                    })
                }
            }
        });
        if (e.selector) {
            c(f).on("click.bs.confirmation", e.selector, function (h) {
                h.preventDefault()
            })
        } else {
            c(f).on("click.bs.confirmation", function (h) {
                h.preventDefault()
            })
        }
    };
    if (!c.fn.popover || !c.fn.tooltip) {
        throw new Error("Confirmation requires popover.js and tooltip.js")
    }
    d.VERSION = "1.0.5";
    d.DEFAULTS = c.extend({}, c.fn.popover.Constructor.DEFAULTS, {
        placement: "right",
        title: "Are you sure?",
        btnOkClass: "btn btn-sm btn-danger",
        btnOkLabel: "Delete",
        btnOkIcon: "glyphicon glyphicon-ok",
        btnCancelClass: "btn btn-sm btn-default",
        btnCancelLabel: "Cancel",
        btnCancelIcon: "glyphicon glyphicon-remove",
        href: "#",
        target: "_self",
        singleton: true,
        popout: true,
        onShow: function (f, e) {
        },
        onHide: function (f, e) {
        },
        onConfirm: function (f, e) {
        },
        onCancel: function (f, e) {
        },
        template: '

YesNo

'
    });
    d.prototype = c.extend({}, c.fn.popover.Constructor.prototype);
    d.prototype.constructor = d;
    d.prototype.getDefaults = function () {
        return d.DEFAULTS
    };
    d.prototype.setContent = function () {
        var h = this;
        var j = this.tip();
        var i = this.getTitle();
        var e = j.find('[data-apply="confirmation"]');
        var f = j.find('[data-dismiss="confirmation"]');
        var g = this.options;
        e.addClass(this.getBtnOkClass()).html(this.getBtnOkLabel()).prepend(c("").addClass(this.getBtnOkIcon()), " ").attr("href", this.getHref()).attr("target", this.getTarget()).off("click").on("click", function (k) {
            g.onConfirm(k, h.$element);
            if (h.$element.attr("type") == "submit") {
                h.$element.closest("form:first").submit()
            }
            h.hide();
            h.inState.click = false
        });
        f.addClass(this.getBtnCancelClass()).html(this.getBtnCancelLabel()).prepend(c("").addClass(this.getBtnCancelIcon()), " ").off("click").on("click", function (k) {
            g.onCancel(k, h.$element);
            h.hide();
            h.inState.click = false
        });
        j.find(".popover-title")[this.options.html ? "html" : "text"](i);
        j.removeClass("fade top bottom left right in");
        if (!j.find(".popover-title").html()) {
            j.find(".popover-title").hide()
        }
    };
    d.prototype.getBtnOkClass = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnOkClass") || (typeof f.btnOkClass == "function" ? f.btnOkClass.call(this, e[0]) : f.btnOkClass)
    };
    d.prototype.getBtnOkLabel = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnOkLabel") || (typeof f.btnOkLabel == "function" ? f.btnOkLabel.call(this, e[0]) : f.btnOkLabel)
    };
    d.prototype.getBtnOkIcon = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnOkIcon") || (typeof f.btnOkIcon == "function" ? f.btnOkIcon.call(this, e[0]) : f.btnOkIcon)
    };
    d.prototype.getBtnCancelClass = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnCancelClass") || (typeof f.btnCancelClass == "function" ? f.btnCancelClass.call(this, e[0]) : f.btnCancelClass)
    };
    d.prototype.getBtnCancelLabel = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnCancelLabel") || (typeof f.btnCancelLabel == "function" ? f.btnCancelLabel.call(this, e[0]) : f.btnCancelLabel)
    };
    d.prototype.getBtnCancelIcon = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-btnCancelIcon") || (typeof f.btnCancelIcon == "function" ? f.btnCancelIcon.call(this, e[0]) : f.btnCancelIcon)
    };
    d.prototype.getHref = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-href") || (typeof f.href == "function" ? f.href.call(this, e[0]) : f.href)
    };
    d.prototype.getTarget = function () {
        var e = this.$element;
        var f = this.options;
        return e.attr("data-target") || (typeof f.target == "function" ? f.target.call(this, e[0]) : f.target)
    };
    d.prototype.isPopout = function () {
        var f;
        var e = this.$element;
        var g = this.options;
        f = e.attr("data-popout") || (typeof g.popout == "function" ? g.popout.call(this, e[0]) : g.popout);
        if (f == "false") {
            f = false
        }
        return f
    };
    var a = c.fn.confirmation;
    c.fn.confirmation = function (e) {
        var f = this;
        return this.each(function () {
            var i = c(this);
            var h = i.data("bs.confirmation");
            var g = typeof e == "object" && e;
            g = g || {};
            g.all_selector = f.selector;
            if (!h && e == "destroy") {
                return
            }
            if (!h) {
                i.data("bs.confirmation", (h = new d(this, g)))
            }
            if (typeof e == "string") {
                h[e]()
            }
        })
    };
    c.fn.confirmation.Constructor = d;
    c.fn.confirmation.noConflict = function () {
        c.fn.confirmation = a;
        return this
    }
}(jQuery);


text:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Launch CaSH" type="Application" factoryName="Application">
    <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
      <pattern>
        <option name="PATTERN" value="com.cinchapi.concourse.shell.*" />
        <option name="ENABLED" value="true" />
      </pattern>
    </extension>
    <option name="MAIN_CLASS_NAME" value="com.cinchapi.concourse.shell.ConcourseShell" />
    <option name="VM_PARAMETERS" value="" />
    <option name="PROGRAM_PARAMETERS" value="" />
    <option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
    <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
    <option name="ALTERNATIVE_JRE_PATH" />
    <option name="ENABLE_SWING_INSPECTOR" value="false" />
    <option name="ENV_VARIABLES" />
    <option name="PASS_PARENT_ENVS" value="true" />
    <module name="concourse-shell" />
    <envs />
    <method />
  </configuration>
</component>