text
stringlengths
2
99.9k
meta
dict
<import src="../../../common/head.wxml"/> <import src="../../../common/foot.wxml"/> <view class="container"> <template is="head" data="{{title: 'templateMessage'}}"/> <form class="page-body" bindsubmit="submitForm" report-submit="true"> <view class="weui-cells__title">点击提交,发送示例模板消息</view> <view class="weui-cells weui-cells_after-title"> <view class="weui-cell weui-cell_input"> <view class="weui-cell__hd"> <view class="weui-label">示例地点</view> </view> <view class="weui-cell__bd"> <input class="weui-input" type="text" disabled="{{true}}" value="{{formData.address}}" name="address"></input> </view> </view> <view class="weui-cell weui-cell_input"> <view class="weui-cell__hd"> <view class="weui-label">示例时间</view> </view> <view class="weui-cell__bd"> <input class="weui-input" type="text" disabled="{{true}}" value="{{formData.time}}" name="time"></input> </view> </view> <view class="weui-cell weui-cell_input"> <view class="weui-cell__hd"> <view class="weui-label">示例物品</view> </view> <view class="weui-cell__bd"> <input class="weui-input" type="text" disabled="{{true}}" value="{{formData.name}}" name="name"></input> </view> </view> <view class="weui-cell weui-cell_input"> <view class="weui-cell__hd"> <view class="weui-label">示例单号</view> </view> <view class="weui-cell__bd"> <input class="weui-input" type="text" disabled="{{true}}" value="{{formData.serial}}" name="serial"></input> </view> </view> </view> <view class="btn-area"> <button type="primary" size="40" formType="submit" loading="{{loading}}">点我提交</button> </view> </form> <template is="foot" /> </view>
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js * @description Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array */ function testcase() { var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { testResult = (curVal === 1); } } try { Object.defineProperty(Array.prototype, "1", { get: function () { return "9"; }, configurable: true }); [0, 1, 2].reduce(callbackfn, initialValue); return testResult; } finally { delete Array.prototype[1]; } } runTestCase(testcase);
{ "pile_set_name": "Github" }
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "Action.h" class ConvDiffMetaAction : public Action { public: static InputParameters validParams(); ConvDiffMetaAction(const InputParameters & params); virtual void act(); };
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @interface IDEMenuBuilder : NSObject { } + (id)_buildSubmenuItemForMenuDefinitionIdentifier:(id)arg1 forViewController:(id)arg2 fillingExtensionIdToMenuMap:(id)arg3; + (id)_menuForMenuDefinitionIdentifier:(id)arg1 forViewController:(id)arg2 fillingExtensionIdToMenuMap:(id)arg3; + (id)_menuItemForMenuItemElement:(id)arg1 inMenuWithIdentifierUsedForDebugging:(id)arg2 forViewController:(id)arg3 fillingExtensionIdToMenuMap:(id)arg4; + (void)_placePinnedGroups:(id)arg1 inMenu:(id)arg2 withPriorities:(id)arg3 topPinned:(BOOL)arg4; + (void)_replacePlaceholderItemWithTag:(unsigned long long)arg1 inMenu:(id)arg2 withGroups:(id)arg3 priorities:(id)arg4; + (void)insertMenuItemsForContextualMenuItemIdentifier:(id)arg1 intoMenu:(id)arg2 forSubArea:(id)arg3 fileType:(id)arg4 editorDocumentExtension:(id)arg5; + (id)menuForMenuDefinitionIdentifier:(id)arg1 extensionIdToMenuMap:(id *)arg2; + (id)menuForMenuDefinitionIdentifier:(id)arg1 forViewController:(id)arg2 extensionIdToMenuMap:(id *)arg3; @end
{ "pile_set_name": "Github" }
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * requestFileSystem * * IN: * args * 0 - type (TEMPORARY = 0, PERSISTENT = 1) * 1 - size * OUT: * success - FileSystem object * - name - the human readable directory name * - root - DirectoryEntry object * - isDirectory * - isFile * - name * - fullPath * fail - FileError code */ var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'); module.exports = function (success, fail, args) { var fsType = args[0] === 0 ? 'temporary' : 'persistent', size = args[1], onSuccess = function (fs) { var directory = { name: fsType, root: fs }; success(directory); }; resolve(onSuccess, fail, ['cdvfile://localhost/' + fsType + '/', undefined, size]); };
{ "pile_set_name": "Github" }
<?php namespace thinkbuilder\generator\html; use thinkbuilder\Cache; use thinkbuilder\generator\Generator; use thinkbuilder\helper\TemplateHelper; class LayoutFooter extends Generator { public function generate(): Generator { $tags = [ 'COMPANY_NAME' => Cache::getInstance()->get('company'), 'TB_VERSION' => VERSION, ]; $this->content = TemplateHelper::parseTemplateTags($tags, $this->params['template']); return $this; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/rocket-lander.iml" filepath="$PROJECT_DIR$/.idea/rocket-lander.iml" /> </modules> </component> </project>
{ "pile_set_name": "Github" }
@@@This line is not value Ruby #!rub_y puts 'success'
{ "pile_set_name": "Github" }
/* * This file is part of the SDWebImage package. * (c) Olivier Poitrey <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #import "SDAnimatedImageView+WebCache.h" #if SD_UIKIT || SD_MAC #import "UIView+WebCache.h" #import "SDAnimatedImage.h" @implementation SDAnimatedImageView (WebCache) - (void)sd_setImageWithURL:(nullable NSURL *)url { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:context progress:nil completed:nil]; } - (void)sd_setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { Class animatedImageClass = [SDAnimatedImage class]; SDWebImageMutableContext *mutableContext; if (context) { mutableContext = [context mutableCopy]; } else { mutableContext = [NSMutableDictionary dictionary]; } mutableContext[SDWebImageContextAnimatedImageClass] = animatedImageClass; [self sd_internalSetImageWithURL:url placeholderImage:placeholder options:options context:mutableContext setImageBlock:nil progress:progressBlock completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { if (completedBlock) { completedBlock(image, error, cacheType, imageURL); } }]; } @end #endif
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using WCell.Constants; using WCell.Constants.World; using WCell.RealmServer; using WCell.RealmServer.Entities; using WCell.RealmServer.Global; using WCell.RealmServer.Lang; using WCell.Util.Graphics; namespace WCell.Addons.Default.Teleport { public class TeleportNode : INamedWorldZoneLocation { public delegate WorldObject TeleporterCreatorFunc(TeleportNode node, Map map, Vector3 pos); private string[] m_Names = new string[(int)ClientLocale.End]; public readonly List<INamedWorldZoneLocation> Destinations = new List<INamedWorldZoneLocation>(5); public TeleporterCreatorFunc TeleportCreator = TeleportNetwork.CreateDefaultPortal; private Vector3 m_Position; public TeleportNode(string defaultName, MapId id, Vector3 pos) { DefaultName = defaultName; Map = World.GetNonInstancedMap(id); if (Map == null) { throw new ArgumentException("Map is not a continent: " + id); } Position = pos; } public WorldObject TeleporterObject; public TeleportNode(string defaultName, Map rgn, Vector3 pos) { DefaultName = defaultName; Map = rgn; Position = pos; } public string[] Names { get { return m_Names; } set { m_Names = value; } } public string DefaultName { get { return Names.LocalizeWithDefaultLocale(); } set { Names[(int)RealmServerConfiguration.DefaultLocale] = value; } } public MapId MapId { get { return Map.Id; } } public Map Map { get; set; } public Vector3 Position { get { return m_Position; } set { m_Position = value; } } public uint Phase { get { return WorldObject.DefaultPhase; } } public ZoneId ZoneId { get { return ZoneId.None; } } public ZoneTemplate ZoneTemplate { get { return null; } } public void Spawn() { if (TeleporterObject == null || !TeleporterObject.IsInWorld) { TeleporterObject = TeleportCreator(this, Map, m_Position); } } } }
{ "pile_set_name": "Github" }
#region License Information (GPL v3) /* ShareX - A program that allows you to take screenshots and share any file type Copyright (c) 2007-2020 ShareX Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Optionally you can also view the license at <http://www.gnu.org/licenses/>. */ #endregion License Information (GPL v3) using ShareX.HelpersLib; using ShareX.UploadersLib.Properties; using System; using System.ComponentModel; namespace ShareX.UploadersLib { public class OAuthInfo : ICloneable { public enum OAuthInfoSignatureMethod { HMAC_SHA1, RSA_SHA1 } public string Description { get; set; } [Browsable(false)] public string OAuthVersion { get; set; } [Browsable(false)] public string ConsumerKey { get; set; } // Used for HMAC_SHA1 signature [Browsable(false)] public string ConsumerSecret { get; set; } // Used for RSA_SHA1 signature [Browsable(false)] public string ConsumerPrivateKey { get; set; } [Browsable(false)] public OAuthInfoSignatureMethod SignatureMethod { get; set; } [Browsable(false)] public string AuthToken { get; set; } [Browsable(false), JsonEncrypt] public string AuthSecret { get; set; } [JsonEncrypt, Description("Verification Code from the Authorization Page")] public string AuthVerifier { get; set; } [Browsable(false)] public string UserToken { get; set; } [Browsable(false), JsonEncrypt] public string UserSecret { get; set; } public OAuthInfo() { Description = Resources.OAuthInfo_OAuthInfo_New_account; OAuthVersion = "1.0"; } public OAuthInfo(string consumerKey) : this() { ConsumerKey = consumerKey; } public OAuthInfo(string consumerKey, string consumerSecret) : this() { ConsumerKey = consumerKey; ConsumerSecret = consumerSecret; } public OAuthInfo(string consumerKey, string consumerSecret, string userToken, string userSecret) : this(consumerKey, consumerSecret) { UserToken = userToken; UserSecret = userSecret; } public static bool CheckOAuth(OAuthInfo oauth) { return oauth != null && !string.IsNullOrEmpty(oauth.ConsumerKey) && ((oauth.SignatureMethod == OAuthInfoSignatureMethod.HMAC_SHA1 && !string.IsNullOrEmpty(oauth.ConsumerSecret)) || (oauth.SignatureMethod == OAuthInfoSignatureMethod.RSA_SHA1 && !string.IsNullOrEmpty(oauth.ConsumerPrivateKey))) && !string.IsNullOrEmpty(oauth.UserToken) && !string.IsNullOrEmpty(oauth.UserSecret); } public OAuthInfo Clone() { return MemberwiseClone() as OAuthInfo; } object ICloneable.Clone() { return Clone(); } public override string ToString() { return Description; } } }
{ "pile_set_name": "Github" }
polygon 1 8.823469E+00 4.512076E+01 8.823105E+00 4.512028E+01 8.823346E+00 4.512017E+01 8.823584E+00 4.512018E+01 8.823931E+00 4.512013E+01 8.824608E+00 4.512002E+01 8.825624E+00 4.511981E+01 8.827492E+00 4.511971E+01 8.829180E+00 4.511923E+01 8.826551E+00 4.511499E+01 8.826561E+00 4.511489E+01 8.828509E+00 4.511386E+01 8.829706E+00 4.511315E+01 8.830642E+00 4.511266E+01 8.831702E+00 4.511216E+01 8.833246E+00 4.511131E+01 8.833078E+00 4.511088E+01 8.833019E+00 4.511060E+01 8.832964E+00 4.511047E+01 8.832899E+00 4.511038E+01 8.832780E+00 4.511034E+01 8.832328E+00 4.511057E+01 8.831871E+00 4.511093E+01 8.831319E+00 4.511143E+01 8.831136E+00 4.511160E+01 8.830912E+00 4.511173E+01 8.830789E+00 4.511178E+01 8.830667E+00 4.511186E+01 8.830598E+00 4.511189E+01 8.830582E+00 4.511194E+01 8.830611E+00 4.511200E+01 8.830540E+00 4.511206E+01 8.830135E+00 4.511213E+01 8.829725E+00 4.511214E+01 8.829541E+00 4.511212E+01 8.829438E+00 4.511209E+01 8.829322E+00 4.511208E+01 8.829086E+00 4.511209E+01 8.828893E+00 4.511209E+01 8.828777E+00 4.511205E+01 8.828653E+00 4.511200E+01 8.828496E+00 4.511195E+01 8.828321E+00 4.511199E+01 8.828111E+00 4.511208E+01 8.827867E+00 4.511212E+01 8.827320E+00 4.511181E+01 8.827246E+00 4.511176E+01 8.827099E+00 4.511096E+01 8.827106E+00 4.511082E+01 8.827109E+00 4.511063E+01 8.827191E+00 4.511041E+01 8.827270E+00 4.511005E+01 8.827358E+00 4.510977E+01 8.827494E+00 4.510950E+01 8.827576E+00 4.510929E+01 8.827645E+00 4.510894E+01 8.827818E+00 4.510893E+01 8.827993E+00 4.510891E+01 8.828184E+00 4.510890E+01 8.828409E+00 4.510891E+01 8.828525E+00 4.510892E+01 8.828643E+00 4.510895E+01 8.828787E+00 4.510900E+01 8.828962E+00 4.510910E+01 8.829249E+00 4.510923E+01 8.829446E+00 4.510930E+01 8.829671E+00 4.510939E+01 8.829808E+00 4.510942E+01 8.829946E+00 4.510939E+01 8.830027E+00 4.510933E+01 8.830103E+00 4.510891E+01 8.830058E+00 4.510880E+01 8.829967E+00 4.510866E+01 8.829833E+00 4.510852E+01 8.829700E+00 4.510837E+01 8.829332E+00 4.510817E+01 8.827820E+00 4.510737E+01 8.827788E+00 4.510732E+01 8.827744E+00 4.510719E+01 8.827763E+00 4.510705E+01 8.827778E+00 4.510691E+01 8.827804E+00 4.510679E+01 8.827857E+00 4.510668E+01 8.827964E+00 4.510653E+01 8.828045E+00 4.510636E+01 8.828261E+00 4.510609E+01 8.828602E+00 4.510573E+01 8.828694E+00 4.510554E+01 8.828766E+00 4.510539E+01 8.828832E+00 4.510529E+01 8.828986E+00 4.510515E+01 8.829195E+00 4.510499E+01 8.829720E+00 4.510464E+01 8.830424E+00 4.510431E+01 8.830828E+00 4.510412E+01 8.831159E+00 4.510387E+01 8.831658E+00 4.510366E+01 8.832481E+00 4.510336E+01 8.833621E+00 4.510282E+01 8.834010E+00 4.510266E+01 8.834172E+00 4.510250E+01 8.834322E+00 4.510233E+01 8.834485E+00 4.510211E+01 8.834579E+00 4.510191E+01 8.834629E+00 4.510173E+01 8.834640E+00 4.510161E+01 8.834631E+00 4.510154E+01 8.834595E+00 4.510147E+01 8.834550E+00 4.510141E+01 8.834441E+00 4.510132E+01 8.834187E+00 4.510120E+01 8.833809E+00 4.510105E+01 8.833394E+00 4.510085E+01 8.833214E+00 4.510075E+01 8.833056E+00 4.510063E+01 8.832508E+00 4.510014E+01 8.832077E+00 4.509977E+01 8.831890E+00 4.509958E+01 8.831755E+00 4.509942E+01 8.831670E+00 4.509924E+01 8.831611E+00 4.509913E+01 8.831610E+00 4.509897E+01 8.831617E+00 4.509872E+01 8.831699E+00 4.509850E+01 8.831830E+00 4.509831E+01 8.831935E+00 4.509817E+01 8.832064E+00 4.509799E+01 8.832376E+00 4.509789E+01 8.833085E+00 4.509754E+01 8.833680E+00 4.509728E+01 8.834190E+00 4.509705E+01 8.834514E+00 4.509694E+01 8.834743E+00 4.509683E+01 8.835140E+00 4.509672E+01 8.835475E+00 4.509659E+01 8.835627E+00 4.509653E+01 8.835784E+00 4.509653E+01 8.835983E+00 4.509650E+01 8.836215E+00 4.509643E+01 8.836397E+00 4.509636E+01 8.836530E+00 4.509625E+01 8.836550E+00 4.509616E+01 8.836563E+00 4.509605E+01 8.836574E+00 4.509591E+01 8.836552E+00 4.509576E+01 8.836546E+00 4.509567E+01 8.836664E+00 4.509551E+01 8.836800E+00 4.509528E+01 8.836952E+00 4.509499E+01 8.837114E+00 4.509480E+01 8.837221E+00 4.509475E+01 8.837331E+00 4.509472E+01 8.837499E+00 4.509469E+01 8.837755E+00 4.509461E+01 8.838203E+00 4.509449E+01 8.838560E+00 4.509436E+01 8.838897E+00 4.509425E+01 8.839169E+00 4.509413E+01 8.839499E+00 4.509400E+01 8.839806E+00 4.509397E+01 8.840224E+00 4.509385E+01 8.840603E+00 4.509376E+01 8.841125E+00 4.509371E+01 8.841459E+00 4.509370E+01 8.841823E+00 4.509369E+01 8.841978E+00 4.509373E+01 8.842382E+00 4.509380E+01 8.842901E+00 4.509386E+01 8.843914E+00 4.509402E+01 8.844098E+00 4.509410E+01 8.844339E+00 4.509427E+01 8.844514E+00 4.509436E+01 8.844707E+00 4.509447E+01 8.844961E+00 4.509467E+01 8.845289E+00 4.509497E+01 8.845503E+00 4.509517E+01 8.845690E+00 4.509536E+01 8.845866E+00 4.509555E+01 8.846068E+00 4.509573E+01 8.846213E+00 4.509585E+01 8.846325E+00 4.509591E+01 8.846528E+00 4.509600E+01 8.846709E+00 4.509605E+01 8.846862E+00 4.509607E+01 8.847035E+00 4.509606E+01 8.847156E+00 4.509605E+01 8.847297E+00 4.509603E+01 8.847378E+00 4.509599E+01 8.847544E+00 4.509591E+01 8.847754E+00 4.509576E+01 8.847907E+00 4.509565E+01 8.848131E+00 4.509543E+01 8.848228E+00 4.509530E+01 8.848359E+00 4.509503E+01 8.848459E+00 4.509477E+01 8.848518E+00 4.509453E+01 8.848500E+00 4.509429E+01 8.848446E+00 4.509409E+01 8.848380E+00 4.509376E+01 8.847834E+00 4.509325E+01 8.847523E+00 4.509295E+01 8.847342E+00 4.509272E+01 8.847173E+00 4.509247E+01 8.847017E+00 4.509219E+01 8.846942E+00 4.509204E+01 8.846892E+00 4.509188E+01 8.846882E+00 4.509162E+01 8.846907E+00 4.509112E+01 8.846895E+00 4.509076E+01 8.846947E+00 4.509015E+01 8.846885E+00 4.508983E+01 8.846857E+00 4.508965E+01 8.846816E+00 4.508956E+01 8.846681E+00 4.508940E+01 8.846504E+00 4.508921E+01 8.846215E+00 4.508887E+01 8.846100E+00 4.508864E+01 8.846002E+00 4.508853E+01 8.845921E+00 4.508846E+01 8.845770E+00 4.508835E+01 8.845667E+00 4.508825E+01 8.845580E+00 4.508812E+01 8.845558E+00 4.508807E+01 8.845524E+00 4.508801E+01 8.845474E+00 4.508793E+01 8.845379E+00 4.508782E+01 8.845346E+00 4.508777E+01 8.845340E+00 4.508766E+01 8.845326E+00 4.508751E+01 8.845308E+00 4.508730E+01 8.845308E+00 4.508715E+01 8.845307E+00 4.508694E+01 8.845330E+00 4.508681E+01 8.845337E+00 4.508671E+01 8.845354E+00 4.508661E+01 8.845436E+00 4.508647E+01 8.845504E+00 4.508631E+01 8.845598E+00 4.508613E+01 8.845707E+00 4.508593E+01 8.845857E+00 4.508555E+01 8.845939E+00 4.508536E+01 8.846046E+00 4.508525E+01 8.846129E+00 4.508507E+01 8.846217E+00 4.508489E+01 8.846291E+00 4.508479E+01 8.846417E+00 4.508469E+01 8.846700E+00 4.508459E+01 8.847064E+00 4.508448E+01 8.847344E+00 4.508437E+01 8.847686E+00 4.508431E+01 8.848204E+00 4.508424E+01 8.848663E+00 4.508413E+01 8.849111E+00 4.508409E+01 8.849222E+00 4.508408E+01 8.849777E+00 4.508409E+01 8.850132E+00 4.508412E+01 8.850594E+00 4.508415E+01 8.851033E+00 4.508417E+01 8.851485E+00 4.508421E+01 8.851749E+00 4.508424E+01 8.852092E+00 4.508421E+01 8.852376E+00 4.508418E+01 8.852929E+00 4.508408E+01 8.853123E+00 4.508400E+01 8.853511E+00 4.508387E+01 8.853802E+00 4.508377E+01 8.853958E+00 4.508369E+01 8.854049E+00 4.508357E+01 8.854195E+00 4.508339E+01 8.854404E+00 4.508316E+01 8.854508E+00 4.508298E+01 8.854616E+00 4.508274E+01 8.854729E+00 4.508256E+01 8.854822E+00 4.508235E+01 8.854932E+00 4.508211E+01 8.855016E+00 4.508183E+01 8.855106E+00 4.508133E+01 8.854658E+00 4.508116E+01 8.854651E+00 4.508110E+01 8.854394E+00 4.508101E+01 8.852515E+00 4.508040E+01 8.851325E+00 4.507998E+01 8.850548E+00 4.507982E+01 8.851860E+00 4.507853E+01 8.850399E+00 4.507737E+01 8.850450E+00 4.507718E+01 8.850497E+00 4.507703E+01 8.850544E+00 4.507675E+01 8.850291E+00 4.507670E+01 8.850072E+00 4.507664E+01 8.849717E+00 4.507653E+01 8.849447E+00 4.507642E+01 8.848984E+00 4.507622E+01 8.849157E+00 4.507569E+01 8.849257E+00 4.507566E+01 8.849362E+00 4.507562E+01 8.849506E+00 4.507563E+01 8.849610E+00 4.507564E+01 8.849719E+00 4.507570E+01 8.849903E+00 4.507568E+01 8.850250E+00 4.507564E+01 8.850431E+00 4.507565E+01 8.850562E+00 4.507571E+01 8.850646E+00 4.507578E+01 8.852809E+00 4.507590E+01 8.852982E+00 4.507601E+01 8.853140E+00 4.507611E+01 8.853232E+00 4.507623E+01 8.853254E+00 4.507640E+01 8.853184E+00 4.507688E+01 8.853323E+00 4.507690E+01 8.853483E+00 4.507697E+01 8.853738E+00 4.507707E+01 8.853944E+00 4.507719E+01 8.854011E+00 4.507725E+01 8.854033E+00 4.507731E+01 8.854125E+00 4.507778E+01 8.854192E+00 4.507802E+01 8.854302E+00 4.507829E+01 8.854360E+00 4.507843E+01 8.854411E+00 4.507861E+01 8.854464E+00 4.507889E+01 8.854514E+00 4.507911E+01 8.854596E+00 4.507932E+01 8.854684E+00 4.507942E+01 8.854755E+00 4.507955E+01 8.854815E+00 4.507970E+01 8.854858E+00 4.507997E+01 8.855643E+00 4.507986E+01 8.855082E+00 4.507765E+01 8.855000E+00 4.507725E+01 8.854898E+00 4.507681E+01 8.854953E+00 4.507647E+01 8.854950E+00 4.507618E+01 8.855072E+00 4.507587E+01 8.855106E+00 4.507559E+01 8.855085E+00 4.507524E+01 8.855047E+00 4.507501E+01 8.855062E+00 4.507485E+01 8.855121E+00 4.507464E+01 8.855190E+00 4.507451E+01 8.855274E+00 4.507437E+01 8.855618E+00 4.507396E+01 8.855762E+00 4.507369E+01 8.855820E+00 4.507328E+01 8.856020E+00 4.507210E+01 8.856100E+00 4.507178E+01 8.856156E+00 4.507152E+01 8.856228E+00 4.507134E+01 8.856287E+00 4.507121E+01 8.856381E+00 4.507112E+01 8.856472E+00 4.507103E+01 8.856572E+00 4.507099E+01 8.856766E+00 4.507097E+01 8.857096E+00 4.507092E+01 8.857422E+00 4.507089E+01 8.857665E+00 4.507088E+01 8.857825E+00 4.507091E+01 8.858113E+00 4.507098E+01 8.858396E+00 4.507111E+01 8.858512E+00 4.507115E+01 8.858676E+00 4.507118E+01 8.858897E+00 4.507120E+01 8.859022E+00 4.507119E+01 8.859193E+00 4.507118E+01 8.859287E+00 4.507114E+01 8.859456E+00 4.507105E+01 8.859640E+00 4.507096E+01 8.859818E+00 4.507083E+01 8.860046E+00 4.507070E+01 8.860265E+00 4.507057E+01 8.860462E+00 4.507054E+01 8.860605E+00 4.507054E+01 8.860743E+00 4.507055E+01 8.860893E+00 4.507050E+01 8.861024E+00 4.507049E+01 8.861128E+00 4.507053E+01 8.861353E+00 4.507057E+01 8.861524E+00 4.507062E+01 8.861672E+00 4.507065E+01 8.861769E+00 4.507065E+01 8.861843E+00 4.507069E+01 8.861930E+00 4.507079E+01 8.862016E+00 4.507095E+01 8.862184E+00 4.507118E+01 8.862381E+00 4.507151E+01 8.862557E+00 4.507178E+01 8.862635E+00 4.507185E+01 8.862712E+00 4.507189E+01 8.862809E+00 4.507190E+01 8.862860E+00 4.507192E+01 8.862912E+00 4.507197E+01 8.862969E+00 4.507209E+01 8.863039E+00 4.507224E+01 8.863103E+00 4.507237E+01 8.863209E+00 4.507254E+01 8.863263E+00 4.507263E+01 8.863426E+00 4.507274E+01 8.863517E+00 4.507283E+01 8.863716E+00 4.507299E+01 8.863874E+00 4.507307E+01 8.863964E+00 4.507308E+01 8.864061E+00 4.507307E+01 8.864404E+00 4.507302E+01 8.864610E+00 4.507300E+01 8.864741E+00 4.507291E+01 8.865148E+00 4.507270E+01 8.865638E+00 4.507239E+01 8.865881E+00 4.507227E+01 8.866084E+00 4.507223E+01 8.866241E+00 4.507224E+01 8.866453E+00 4.507226E+01 8.866613E+00 4.507227E+01 8.866784E+00 4.507231E+01 8.866945E+00 4.507240E+01 8.867048E+00 4.507250E+01 8.867092E+00 4.507263E+01 8.867147E+00 4.507272E+01 8.867241E+00 4.507279E+01 8.867353E+00 4.507287E+01 8.867482E+00 4.507296E+01 8.867597E+00 4.507312E+01 8.867873E+00 4.507339E+01 8.867963E+00 4.507353E+01 8.868220E+00 4.507361E+01 8.868633E+00 4.507378E+01 8.868861E+00 4.507391E+01 8.869010E+00 4.507401E+01 8.869139E+00 4.507405E+01 8.869293E+00 4.507406E+01 8.869486E+00 4.507405E+01 8.869633E+00 4.507402E+01 8.869704E+00 4.507395E+01 8.869992E+00 4.507377E+01 8.870223E+00 4.507367E+01 8.870516E+00 4.507363E+01 8.870807E+00 4.507361E+01 8.871075E+00 4.507364E+01 8.871342E+00 4.507372E+01 8.871858E+00 4.507391E+01 8.874768E+00 4.507503E+01 8.874907E+00 4.507376E+01 8.874950E+00 4.507350E+01 8.874984E+00 4.507326E+01 8.875041E+00 4.507296E+01 8.875047E+00 4.507276E+01 8.875062E+00 4.507259E+01 8.875147E+00 4.507230E+01 8.878581E+00 4.507201E+01 8.880739E+00 4.507166E+01 8.882263E+00 4.507430E+01 8.882273E+00 4.507431E+01 8.882784E+00 4.507525E+01 8.882989E+00 4.507564E+01 8.883043E+00 4.507583E+01 8.883125E+00 4.507616E+01 8.883257E+00 4.507698E+01 8.883925E+00 4.507693E+01 8.884570E+00 4.507692E+01 8.884785E+00 4.507693E+01 8.885813E+00 4.507699E+01 8.884436E+00 4.507820E+01 8.884602E+00 4.507832E+01 8.884637E+00 4.507842E+01 8.884675E+00 4.507851E+01 8.884656E+00 4.507862E+01 8.884619E+00 4.507871E+01 8.884574E+00 4.507875E+01 8.884506E+00 4.507878E+01 8.884390E+00 4.507881E+01 8.884209E+00 4.507884E+01 8.884069E+00 4.507886E+01 8.883765E+00 4.507911E+01 8.883159E+00 4.507955E+01 8.882470E+00 4.508024E+01 8.882735E+00 4.508044E+01 8.882817E+00 4.508052E+01 8.882830E+00 4.508059E+01 8.882758E+00 4.508071E+01 8.882408E+00 4.508099E+01 8.881565E+00 4.508159E+01 8.881183E+00 4.508134E+01 8.880999E+00 4.508124E+01 8.880705E+00 4.508114E+01 8.880450E+00 4.508120E+01 8.880102E+00 4.508123E+01 8.879795E+00 4.508129E+01 8.879584E+00 4.508140E+01 8.879362E+00 4.508159E+01 8.879124E+00 4.508176E+01 8.878852E+00 4.508191E+01 8.878450E+00 4.508211E+01 8.878029E+00 4.508223E+01 8.877363E+00 4.508243E+01 8.877567E+00 4.508288E+01 8.878129E+00 4.508285E+01 8.878136E+00 4.508394E+01 8.878427E+00 4.508394E+01 8.878416E+00 4.508534E+01 8.878472E+00 4.508644E+01 8.878601E+00 4.508772E+01 8.878750E+00 4.508939E+01 8.878872E+00 4.509257E+01 8.875180E+00 4.510400E+01 8.877784E+00 4.510479E+01 8.877378E+00 4.510570E+01 8.877911E+00 4.510567E+01 8.877974E+00 4.510650E+01 8.877993E+00 4.510666E+01 8.878128E+00 4.510738E+01 8.878127E+00 4.510748E+01 8.878084E+00 4.510757E+01 8.877943E+00 4.510761E+01 8.877831E+00 4.510767E+01 8.877700E+00 4.510769E+01 8.877517E+00 4.510823E+01 8.877511E+00 4.510837E+01 8.877588E+00 4.510854E+01 8.877642E+00 4.510869E+01 8.877694E+00 4.510883E+01 8.877888E+00 4.510890E+01 8.878088E+00 4.510890E+01 8.878260E+00 4.510885E+01 8.878401E+00 4.510876E+01 8.878564E+00 4.510857E+01 8.878835E+00 4.510823E+01 8.878944E+00 4.510808E+01 8.879078E+00 4.510800E+01 8.879139E+00 4.510792E+01 8.879257E+00 4.510781E+01 8.879489E+00 4.510767E+01 8.879775E+00 4.510758E+01 8.880322E+00 4.510737E+01 8.880669E+00 4.510722E+01 8.881095E+00 4.510699E+01 8.881235E+00 4.510690E+01 8.881307E+00 4.510683E+01 8.881345E+00 4.510679E+01 8.881336E+00 4.510669E+01 8.881517E+00 4.510665E+01 8.882205E+00 4.510670E+01 8.882979E+00 4.510658E+01 8.883717E+00 4.510625E+01 8.883951E+00 4.510609E+01 8.884089E+00 4.510599E+01 8.884201E+00 4.510587E+01 8.885256E+00 4.510717E+01 8.885297E+00 4.510723E+01 8.885229E+00 4.510731E+01 8.884919E+00 4.510752E+01 8.884550E+00 4.510772E+01 8.884281E+00 4.510785E+01 8.884160E+00 4.510790E+01 8.884176E+00 4.510799E+01 8.884213E+00 4.510809E+01 8.884194E+00 4.510812E+01 8.883781E+00 4.510824E+01 8.883780E+00 4.510824E+01 8.883781E+00 4.510824E+01 8.883452E+00 4.510836E+01 8.883064E+00 4.510845E+01 8.882589E+00 4.510855E+01 8.882110E+00 4.510864E+01 8.882039E+00 4.510870E+01 8.882062E+00 4.510878E+01 8.882078E+00 4.510897E+01 8.882103E+00 4.510911E+01 8.882106E+00 4.510923E+01 8.882058E+00 4.510941E+01 8.882018E+00 4.510957E+01 8.882010E+00 4.510959E+01 8.882010E+00 4.510961E+01 8.881992E+00 4.510965E+01 8.881979E+00 4.510978E+01 8.882008E+00 4.510992E+01 8.882001E+00 4.511010E+01 8.881571E+00 4.511045E+01 8.881098E+00 4.511081E+01 8.880669E+00 4.511117E+01 8.880418E+00 4.511140E+01 8.880245E+00 4.511152E+01 8.880048E+00 4.511163E+01 8.879770E+00 4.511173E+01 8.879604E+00 4.511184E+01 8.879322E+00 4.511200E+01 8.879112E+00 4.511211E+01 8.878941E+00 4.511220E+01 8.878573E+00 4.511247E+01 8.877900E+00 4.511297E+01 8.878456E+00 4.511301E+01 8.878956E+00 4.511302E+01 8.879378E+00 4.511297E+01 8.879406E+00 4.511297E+01 8.879327E+00 4.511339E+01 8.878943E+00 4.511466E+01 8.878918E+00 4.511481E+01 8.879008E+00 4.511491E+01 8.879162E+00 4.511496E+01 8.879449E+00 4.511504E+01 8.879326E+00 4.511557E+01 8.878974E+00 4.511747E+01 8.878883E+00 4.511784E+01 8.878892E+00 4.511793E+01 8.878949E+00 4.511802E+01 8.879534E+00 4.511860E+01 8.879588E+00 4.511872E+01 8.879616E+00 4.511882E+01 8.879691E+00 4.511891E+01 8.879816E+00 4.511896E+01 8.879991E+00 4.511898E+01 8.880141E+00 4.511894E+01 8.880312E+00 4.511886E+01 8.880522E+00 4.511870E+01 8.880723E+00 4.511864E+01 8.880990E+00 4.511858E+01 8.881155E+00 4.511854E+01 8.881353E+00 4.511850E+01 8.881659E+00 4.511841E+01 8.881973E+00 4.511827E+01 8.882135E+00 4.511823E+01 8.882316E+00 4.511829E+01 8.882504E+00 4.511831E+01 8.882779E+00 4.511830E+01 8.883004E+00 4.511828E+01 8.883276E+00 4.511820E+01 8.883647E+00 4.511810E+01 8.883980E+00 4.511804E+01 8.884194E+00 4.511792E+01 8.884188E+00 4.511762E+01 8.884258E+00 4.511777E+01 8.884314E+00 4.511815E+01 8.884377E+00 4.511849E+01 8.884412E+00 4.511877E+01 8.884424E+00 4.511917E+01 8.884442E+00 4.511951E+01 8.883759E+00 4.511954E+01 8.882565E+00 4.511963E+01 8.881457E+00 4.511971E+01 8.880671E+00 4.511976E+01 8.880322E+00 4.511979E+01 8.880771E+00 4.512018E+01 8.881455E+00 4.512076E+01 8.882169E+00 4.512137E+01 8.880651E+00 4.512171E+01 8.881075E+00 4.512286E+01 8.881692E+00 4.512458E+01 8.881732E+00 4.512468E+01 8.881744E+00 4.512487E+01 8.879563E+00 4.512550E+01 8.875309E+00 4.512669E+01 8.874896E+00 4.512537E+01 8.874131E+00 4.512551E+01 8.873268E+00 4.512567E+01 8.871920E+00 4.512594E+01 8.871693E+00 4.512600E+01 8.869991E+00 4.512653E+01 8.867302E+00 4.512730E+01 8.867311E+00 4.512745E+01 8.866222E+00 4.512761E+01 8.864412E+00 4.512816E+01 8.863975E+00 4.512828E+01 8.863636E+00 4.512846E+01 8.863163E+00 4.512873E+01 8.862868E+00 4.512897E+01 8.862529E+00 4.512935E+01 8.861900E+00 4.512982E+01 8.861903E+00 4.512987E+01 8.861638E+00 4.513014E+01 8.860832E+00 4.513098E+01 8.860527E+00 4.513099E+01 8.860320E+00 4.513103E+01 8.859787E+00 4.513119E+01 8.859105E+00 4.513136E+01 8.858604E+00 4.513147E+01 8.858313E+00 4.513150E+01 8.858103E+00 4.513148E+01 8.857650E+00 4.513143E+01 8.857214E+00 4.513138E+01 8.857040E+00 4.513139E+01 8.856649E+00 4.513136E+01 8.855793E+00 4.513107E+01 8.854849E+00 4.513075E+01 8.853655E+00 4.513028E+01 8.852345E+00 4.512984E+01 8.851763E+00 4.512966E+01 8.851498E+00 4.512961E+01 8.851382E+00 4.512958E+01 8.849466E+00 4.512808E+01 8.848760E+00 4.512761E+01 8.848481E+00 4.512666E+01 8.847649E+00 4.512688E+01 8.847495E+00 4.512690E+01 8.847314E+00 4.512685E+01 8.842146E+00 4.512407E+01 8.841886E+00 4.512102E+01 8.840445E+00 4.512145E+01 8.836686E+00 4.512257E+01 8.832586E+00 4.512381E+01 8.832508E+00 4.512380E+01 8.830602E+00 4.512133E+01 8.829954E+00 4.512053E+01 8.828586E+00 4.512095E+01 8.825004E+00 4.512209E+01 8.825032E+00 4.512217E+01 8.824556E+00 4.512233E+01 8.823469E+00 4.512076E+01 END END
{ "pile_set_name": "Github" }
# Index of doubly_linked_list * [Doubly Linked List](doubly_linked_list.py)
{ "pile_set_name": "Github" }
function f = perform_wavortho_transf(f,Jmin,dir,options) % perform_wavortho_transf - compute orthogonal wavelet transform % % fw = perform_wavortho_transf(f,Jmin,dir,options); % % You can give the filter in options.h. % % Works in arbitrary dimension. % % Copyright (c) 2009 Gabriel Peyre options.null = 0; h = getoptions(options,'h', compute_wavelet_filter('Daubechies',4) ); g = [0 h(length(h):-1:2)] .* (-1).^(1:length(h)); n = size(f,1); Jmax = log2(n)-1; if dir==1 %%% FORWARD %%% for j=Jmax:-1:Jmin sel = 1:2^(j+1); a = subselect(f,sel); for d=1:nb_dims(f) a = cat(d, subsampling(cconv(a,h,d),d), subsampling(cconv(a,g,d),d) ); end f = subassign(f,sel,a); end else %%% FORWARD %%% for j=Jmin:Jmax sel = 1:2^(j+1); a = subselect(f,sel); for d=1:nb_dims(f) w = subselectdim(a,2^j+1:2^(j+1),d); a = subselectdim(a,1:2^j,d); a = cconv(upsampling(a,d),reverse(h),d) + cconv(upsampling(w,d),reverse(g),d); end f = subassign(f,sel,a); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function f = subselect(f,sel) switch nb_dims(f) case 1 f = f(sel); case 2 f = f(sel,sel); case 3 f = f(sel,sel,sel); case 4 f = f(sel,sel,sel,sel); case 5 f = f(sel,sel,sel,sel,sel); case 6 f = f(sel,sel,sel,sel,sel,sel); case 7 f = f(sel,sel,sel,sel,sel,sel,sel); case 8 f = f(sel,sel,sel,sel,sel,sel,sel,sel); otherwise error('Not implemented'); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function f = subselectdim(f,sel,d) switch d case 1 f = f(sel,:,:,:,:,:,:,:); case 2 f = f(:,sel,:,:,:,:,:,:); case 3 f = f(:,:,sel,:,:,:,:,:); case 4 f = f(:,:,:,sel,:,:,:,:); case 5 f = f(:,:,:,:,sel,:,:,:); case 6 f = f(:,:,:,:,:,sel,:,:); case 7 f = f(:,:,:,:,:,:,sel,:); case 8 f = f(:,:,:,:,:,:,:,sel); otherwise error('Not implemented'); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function f = subassign(f,sel,g) switch nb_dims(f) case 1 f(sel) = g; case 2 f(sel,sel) = g; case 3 f(sel,sel,sel) = g; case 4 f(sel,sel,sel,sel) = g; case 5 f(sel,sel,sel,sel,sel) = g; case 6 f(sel,sel,sel,sel,sel,sel) = g; case 7 f(sel,sel,sel,sel,sel,sel,sel) = g; case 8 f(sel,sel,sel,sel,sel,sel,sel,sel) = g; otherwise error('Not implemented'); end
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic // PR1892, PR11354 void f(double a[restrict][5]) { __typeof(a) x = 10; } // expected-warning {{(aka 'double (*restrict)[5]')}} int foo (__const char *__path); int foo(__const char *__restrict __file); void func(const char*); // expected-note {{previous declaration is here}} void func(char*); // expected-error{{conflicting types for 'func'}} void g(int (*)(const void **, const void **)); void g(int (*compar)()) { } void h(); // expected-note {{previous declaration is here}} void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}} // PR1965 int t5(b); // expected-error {{parameter list without types}} int t6(int x, g); // expected-warning {{type specifier missing, defaults to 'int'}} int t7(, ); // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}} int t8(, int a); // expected-error {{expected parameter declarator}} int t9(int a, ); // expected-error {{expected parameter declarator}} // PR2042 void t10(){} void t11(){t10(1);} // expected-warning{{too many arguments}} // PR3208 void t12(int) {} // expected-error{{parameter name omitted}} // PR2790 void t13() { return 0; // expected-error {{void function 't13' should not return a value}} } int t14() { return; // expected-error {{non-void function 't14' should return a value}} } // <rdar://problem/6097326> y(y) { return y; } // expected-warning{{parameter 'y' was not declared, defaulting to type 'int'}} \ // expected-warning{{type specifier missing, defaults to 'int'}} // PR3137, <rdar://problem/6127293> extern int g0_3137(void); void f0_3137() { int g0_3137(void); } void f1_3137() { int (*fp)(void) = g0_3137; } void f1static() { static void f2static(int); // expected-error{{function declared in block scope cannot have 'static' storage class}} register void f2register(int); // expected-error{{illegal storage class on function}} } struct incomplete_test a(void) {} // expected-error{{incomplete result type 'struct incomplete_test' in function definition}} \ // expected-note{{forward declaration of 'struct incomplete_test'}} extern __inline __attribute__((__gnu_inline__)) void gnu_inline1() {} void __attribute__((__gnu_inline__)) // expected-warning {{'gnu_inline' attribute requires function to be marked 'inline', attribute ignored}} gnu_inline2() {} // rdar://6802350 inline foo_t invalid_type() { // expected-error {{unknown type name 'foo_t'}} } typedef void fn_t(void); fn_t t17; // PR4049 unknown_type t18(void*) { // expected-error {{unknown type name 'unknown_type'}} expected-error{{parameter name omitted}} } unknown_type t19(int* P) { // expected-error {{unknown type name 'unknown_type'}} P = P+1; // no warning. } // missing ',' before '...' void t20(int i...) { } // expected-error {{requires a comma}} int n; void t21(int n, int (*array)[n]); int func_e(int x) { int func_n(int y) { // expected-error {{function definition is not allowed here}} if (y > 22) { return y+2; } else { return y-2; } } return x + 3; } void decays(int a[3][3]); // expected-note {{passing argument to parameter 'a' here}} void no_decay(int (*a)[3]); // expected-note {{passing argument to parameter 'a' here}} void t22(int *ptr, int (*array)[3]) { decays(ptr); // expected-warning {{incompatible pointer types passing 'int *' to parameter of type 'int (*)[3]'}} no_decay(ptr); // expected-warning {{incompatible pointer types passing 'int *' to parameter of type 'int (*)[3]'}} decays(array); no_decay(array); }
{ "pile_set_name": "Github" }
#include <jni.h> #include <string.h> #include <unistd.h> //#include <speex/speex.h> //#include <speex/speex_echo.h> /*start*/ #include <fcntl.h> #include <speex/speex.h> #include <speex/speex_echo.h> #include <speex/speex_preprocess.h> #include <speex/speex_bits.h> #include <speex/speex_buffer.h> #include <speex/speex_header.h> #include <speex/speex_types.h> // the header length of the RTP frame (must skip when en/decoding) static const int rtp_header = 0; int codec_status = 0; const int CODEC_OPENED = 1; const int CODEC_CLOSED = 0; int aec_status = 0; const int AEC_OPENED = 1; const int AEC_CLOSED = 0; SpeexEchoState *echoState; SpeexPreprocessState *den; int sampleRate = 16000; /*end*/ static int codec_open = 0; static int dec_frame_size; static int enc_frame_size; static SpeexBits ebits, dbits; void *enc_state; void *dec_state; static JavaVM *gJavaVM; extern "C" JNIEXPORT jint JNICALL Java_com_dtalk_dd_imservice_support_audio_Speex_open( JNIEnv *env, jobject obj, jint compression) { int tmp = 0; if (codec_open++ != 0) return (jint) 0; speex_bits_init(&ebits); speex_bits_init(&dbits); enc_state = speex_encoder_init(&speex_nb_mode); dec_state = speex_decoder_init(&speex_nb_mode); tmp = compression; speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &tmp); speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &enc_frame_size); speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &dec_frame_size); SpeexPreprocessState * m_st; m_st = speex_preprocess_state_init(enc_frame_size, 8000); int denoise = 1; int noiseSuppress = -25; speex_preprocess_ctl(m_st, SPEEX_PREPROCESS_SET_DENOISE, &denoise); speex_preprocess_ctl(m_st, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &noiseSuppress); return (jint) 0; } extern "C" JNIEXPORT jint JNICALL Java_com_dtalk_dd_imservice_support_audio_Speex_encode( JNIEnv *env, jobject obj, jshortArray lin, jint offset, jbyteArray encoded, jint size) { jshort buffer[enc_frame_size]; jbyte output_buffer[enc_frame_size]; int nsamples = (size - 1) / enc_frame_size + 1; int i, tot_bytes = 0; if (!codec_open) return 0; speex_bits_reset(&ebits); for (i = 0; i < nsamples; i++) { env->GetShortArrayRegion(lin, offset + i * enc_frame_size, enc_frame_size, buffer); speex_encode_int(enc_state, buffer, &ebits); } //env->GetShortArrayRegion(lin, offset, enc_frame_size, buffer); //speex_encode_int(enc_state, buffer, &ebits); tot_bytes = speex_bits_write(&ebits, (char *) output_buffer, enc_frame_size); env->SetByteArrayRegion(encoded, 0, tot_bytes, output_buffer); return (jint) tot_bytes; } extern "C" JNIEXPORT jint Java_com_dtalk_dd_imservice_support_audio_Speex_decode( JNIEnv *env, jobject obj, jbyteArray encoded, jshortArray lin, jint size) { jbyte buffer[dec_frame_size]; jshort output_buffer[dec_frame_size]; jsize encoded_length = size; if (!codec_open) return 0; env->GetByteArrayRegion(encoded, 0, encoded_length, buffer); speex_bits_read_from(&dbits, (char *) buffer, encoded_length); speex_decode_int(dec_state, &dbits, output_buffer); env->SetShortArrayRegion(lin, 0, dec_frame_size, output_buffer); return (jint) dec_frame_size; } extern "C" JNIEXPORT jint JNICALL Java_com_dtalk_dd_imservice_support_audio_Speex_getFrameSize( JNIEnv *env, jobject obj) { if (!codec_open) return 0; return (jint) enc_frame_size; } extern "C" JNIEXPORT void JNICALL Java_com_dtalk_dd_imservice_support_audio_Speex_close( JNIEnv *env, jobject obj) { if (--codec_open != 0) return; speex_bits_destroy(&ebits); speex_bits_destroy(&dbits); speex_decoder_destroy(dec_state); speex_encoder_destroy(enc_state); } extern "C" JNIEXPORT void Java_com_dtalk_dd_imservice_support_audio_Speex_initEcho( JNIEnv *env, jobject jobj, jint frame_size, jint filter_length) { if (aec_status == AEC_OPENED) return; aec_status = AEC_OPENED; int frm_size; int f_length; frm_size = frame_size; f_length = filter_length; echoState = speex_echo_state_init(frame_size, filter_length); den = speex_preprocess_state_init(frame_size, sampleRate); speex_echo_ctl(echoState, SPEEX_ECHO_SET_SAMPLING_RATE, &sampleRate); speex_preprocess_ctl(den, SPEEX_PREPROCESS_SET_ECHO_STATE, echoState); } extern "C" JNIEXPORT void Java_com_dtalk_dd_imservice_support_audio_Speex_echoCancellation( JNIEnv *env, jshortArray rec, jshortArray play, jshortArray out) { jshort echo_buf[enc_frame_size]; jshort ref_buf[enc_frame_size]; jshort e_buf[enc_frame_size]; env->GetShortArrayRegion(rec, 0, enc_frame_size, echo_buf); env->GetShortArrayRegion(play, 0, enc_frame_size, ref_buf); speex_echo_cancellation(echoState, echo_buf, ref_buf, e_buf); // speex_preprocess_run(den, e_buf); env->SetShortArrayRegion(out, 0, enc_frame_size, e_buf); } extern "C" JNIEXPORT int Java_com_dtalk_dd_imservice_support_audio_Speex_echoCancellationEncode( JNIEnv *env, jshortArray rec, jshortArray play, jbyteArray encoded) { jshort echo_buf[enc_frame_size]; jshort ref_buf[enc_frame_size]; jshort e_buf[enc_frame_size]; jbyte output_buffer[enc_frame_size]; env->GetShortArrayRegion(rec, 0, enc_frame_size, echo_buf); env->GetShortArrayRegion(play, 0, enc_frame_size, ref_buf); speex_echo_cancellation(echoState, echo_buf, ref_buf, e_buf); speex_preprocess_run(den, e_buf); speex_bits_reset(&ebits); speex_encode_int(enc_state, e_buf, &ebits); jint tot_bytes = speex_bits_write(&ebits, (char *) output_buffer, enc_frame_size); env->SetByteArrayRegion(encoded, 0, tot_bytes, output_buffer); return (jint) tot_bytes; } extern "C" JNIEXPORT jint JNICALL Java_com_dtalk_dd_imservice_support_audio_Speex_getAecStatus() { return (jint) aec_status; } extern "C" JNIEXPORT void Java_com_dtalk_dd_imservice_support_audio_Speex_destroyEcho( JNIEnv * env, jobject jobj) { if (aec_status == AEC_CLOSED) return; aec_status = AEC_CLOSED; speex_echo_state_destroy(echoState); speex_preprocess_state_destroy(den); }
{ "pile_set_name": "Github" }
locale loop hu hu/locale/hu/
{ "pile_set_name": "Github" }
// Copyright 2009 the Sputnik authors. All rights reserved. /** * The production CharacterClass :: [ [lookahead \notin {^}] ClassRanges ] evaluates by evaluating ClassRanges to obtain a CharSet and returning that CharSet and the boolean false * * @path ch15/15.10/15.10.2/15.10.2.13/S15.10.2.13_A1_T12.js * @description Execute /a[b]c/.exec("abc") and check results */ __executed = /a[b]c/.exec("abc"); __expected = ["abc"]; __expected.index = 0; __expected.input = "abc"; //CHECK#1 if (__executed.length !== __expected.length) { $ERROR('#1: __executed = /a[b]c/.exec("abc"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); } //CHECK#2 if (__executed.index !== __expected.index) { $ERROR('#2: __executed = /a[b]c/.exec("abc"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); } //CHECK#3 if (__executed.input !== __expected.input) { $ERROR('#3: __executed = /a[b]c/.exec("abc"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); } //CHECK#4 for(var index=0; index<__expected.length; index++) { if (__executed[index] !== __expected[index]) { $ERROR('#4: __executed = /a[b]c/.exec("abc"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); } }
{ "pile_set_name": "Github" }
/** * Copyright (C) 2010-2018 Gordon Fraser, Andrea Arcuri and EvoSuite * contributors * * This file is part of EvoSuite. * * EvoSuite is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3.0 of the License, or * (at your option) any later version. * * EvoSuite is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>. */ package org.evosuite.testcase; import org.evosuite.runtime.annotation.*; import org.evosuite.runtime.util.Inputs; import org.evosuite.symbolic.expr.Constraint; import org.evosuite.testcase.statements.*; import org.evosuite.testcase.variable.NullReference; import org.evosuite.testcase.variable.VariableReference; import org.evosuite.utils.Randomness; import org.evosuite.utils.generic.GenericAccessibleObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.annotation.Annotation; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; /** * Class used to verify that the constraints on the usage of the external * resources (mock environment and JavaEE) are properly satisfied. * * <p>The checks are mainly for debugging EvoSuite, as constraints should * always hold by construction. Here we are just interested to see if any * mutation does break the constraints </p> * * <p>Note: checks here are lightweight (ie not 100% precise), and only * check what is in the test, not what should had been there </p> * * Created by Andrea Arcuri on 06/06/15. */ public class ConstraintVerifier { private static final Logger logger = LoggerFactory.getLogger(ConstraintVerifier.class); /** * During the search, assertions have not been generated yet. * Here, do check if any method, that is only for assertions, was * included in the test * * @param tc * @return */ public static boolean hasAnyOnlyForAssertionMethod(TestCase tc){ for(int i=0; i<tc.size(); i++) { Statement st = tc.getStatement(i); if (! canStatementHaveConstraints(st)){ continue; } AccessibleObject ao = null; if(st instanceof MethodStatement) { MethodStatement ms = (MethodStatement) st; ao = ms.getMethod().getMethod(); } else if(st instanceof ConstructorStatement){ ConstructorStatement cs = (ConstructorStatement) st; ao = cs.getConstructor().getConstructor(); } else { return false; } for(Annotation annotation : ao.getDeclaredAnnotations()){ if(annotation instanceof EvoSuiteAssertionOnly){ return true; } } } return false; } /** * Can the statement at the given position be deleted? * A case in which it is not possible is for example if it is * using an existing bounded variable * * @param tc * @param pos * @return */ public static boolean canDelete(TestCase tc, int pos) throws IllegalArgumentException { return dependentPositions(tc,pos).isEmpty(); } public static Set<Integer> dependentPositions(TestCase tc, int pos) throws IllegalArgumentException{ Inputs.checkNull(tc); Set<Integer> dep = new LinkedHashSet<>(); Statement st = tc.getStatement(pos); if(! canStatementHaveConstraints(st)){ /* the statement itself has no constraints. however, others might have dependencies on it. An example is methods with "noNullInput" using it */ VariableReference ret = st.getReturnValue(); for (int i = pos + 1; i < tc.size(); i++) { Statement toCheck = tc.getStatement(i); Constraints constraint = ConstraintHelper.getConstraints(toCheck); if(constraint==null || !constraint.noNullInputs()){ continue; } if(! (toCheck instanceof EntityWithParametersStatement)){ continue; } EntityWithParametersStatement entity = (EntityWithParametersStatement) toCheck; for(VariableReference input : entity.getParameterReferences()){ if(input.same(ret)){ //var is used as input in a method that accepts no null input, so cannot be deleted dep.add(i); } } } return dep; } //first look at bounded variables for(Annotation[] array : getParameterAnnotations(st)){ for(int i=0; i<array.length; i++){ Annotation an = array[i]; if(an instanceof BoundInputVariable){ EntityWithParametersStatement e = (EntityWithParametersStatement) st; int boundingVarPos = e.getParameterReferences().get(i).getStPosition(); dep.add(boundingVarPos); } } } //check if there is an 'after' constraint if(st instanceof MethodStatement) { MethodStatement current = (MethodStatement) st; String currentKlassName = current.getMethod().getDeclaringClass().getCanonicalName(); String currentMethodName = current.getMethod().getName(); for (int i = pos + 1; i < tc.size(); i++) { Statement toCheck = tc.getStatement(i); Constraints constraints = ConstraintHelper.getConstraints(toCheck); if (constraints == null) { continue; } String after = constraints.after(); if (after == null || after.trim().isEmpty()) { continue; } MethodStatement ms = (MethodStatement) toCheck; String[] klassAndMethod = ConstraintHelper.getClassAndMethod(after, ms.getMethod().getDeclaringClass()); String afterKlassName = klassAndMethod[0]; String afterMethodName = klassAndMethod[1]; if(afterKlassName.equals(currentKlassName) && afterMethodName.equals(currentMethodName)){ dep.add(i); } } } return dep; } public static boolean isValidPositionForInsertion(GenericAccessibleObject<?> obj, TestCase tc, int pos) throws IllegalArgumentException{ Inputs.checkNull(obj,tc); /* if the given 'obj' (a method/constructor) belongs to a class for which there is an instance before "pos" which is bounded after "pos", then we cannot add it, as could break bounding constraints if such instance is chosen as callee for "obj". Note: we could force to never use such instance (ie use another one if exists, or create it), but that would complicate a lot all the algorithms in the test factory :( */ List<VariableReference> possibleCallees = tc.getObjects(obj.getOwnerType(), pos); for(VariableReference ref : possibleCallees){ int boundPos = ConstraintHelper.getLastPositionOfBounded(ref, tc); if(boundPos >= pos){ return false; } } Constraints constraints = obj.getAccessibleObject().getAnnotation(Constraints.class); if(constraints == null){ return true; } if(! canBeInsertedRegardlessOfPosition(obj, tc)){ return false; } int minPos = getMinPosForAfter(obj,tc,tc.size()); if(minPos < 0 || pos < minPos){ return false; } return true; } /** * * @param obj * @param tc * @param lastValid * @return position where the object can be inserted, otherwise a negative value if no insertion is possible * @throws IllegalArgumentException */ public static int getAValidPositionForInsertion(GenericAccessibleObject<?> obj, TestCase tc, int lastValid) throws IllegalArgumentException{ Inputs.checkNull(obj,tc); Constraints constraints = obj.getAccessibleObject().getAnnotation(Constraints.class); if(constraints == null){ if(lastValid <= 0){ return 0; } return Randomness.nextInt(0,lastValid); } if(! canBeInsertedRegardlessOfPosition(obj, tc)){ return -1; } //TODO //bounded int minPos = getMinPosForAfter(obj, tc, lastValid); if(minPos < 0){ return -1; } else if(minPos > 0) { return minPos; //try to add immediately 'after' the constraining method } else { assert minPos==0; if(lastValid<=0){ return 0; } return Randomness.nextInt(0,lastValid); } } private static int getMinPosForAfter(GenericAccessibleObject<?> obj, TestCase tc, int lastValid){ Constraints constraints = obj.getAccessibleObject().getAnnotation(Constraints.class); Class<?> declaringClass = obj.getDeclaringClass(); //after int minPos = 0; String after = constraints.after(); if(after!=null && !after.isEmpty()){ String[] pair = ConstraintHelper.getClassAndMethod(after,declaringClass); int afterPos = ConstraintHelper.getLastPositionOfMethodCall(tc,pair[0],pair[1],lastValid); if(afterPos < 0){ /* The current method cannot be inserted, because it has to be 'after' X, but X is not in the test */ return -1; } minPos = afterPos+1; } return minPos; } private static boolean canBeInsertedRegardlessOfPosition(GenericAccessibleObject<?> obj, TestCase tc){ Constraints constraints = obj.getAccessibleObject().getAnnotation(Constraints.class); if(constraints == null){ return true; } if(constraints.noDirectInsertion()){ return false; } Class<?> declaringClass = obj.getDeclaringClass(); String declaringClassName = declaringClass.getCanonicalName(); String name = obj.getName(); //check atMostOnce if(constraints.atMostOnce()){ int counter = ConstraintHelper.countNumberOfMethodCalls(tc,declaringClass,name); if(counter == 1){ //cannot insert it again return false; } else if(counter > 1){ throw new RuntimeException("Violated 'atMostOnce' constraint for "+obj.getName()); } } //excludeOthers List<String[]> othersExcluded = ConstraintHelper.getExcludedMethods(tc); if(othersExcluded != null && othersExcluded.size() > 0){ for(String[] pair : othersExcluded){ if(pair[0].equals(declaringClassName) && pair[1].equals(name)){ //this method/constructor cannot be added return false; } } } //dependOnProperties String[] properties = constraints.dependOnProperties(); if(properties!=null && properties.length>0){ for(String property : properties){ if(! tc.getAccessedEnvironment().hasProperty(property)){ return false; } } } return true; } public static boolean verifyTest(TestChromosome tc){ return verifyTest(tc.getTestCase()); } /** * * @param tc * @return true if the test case does satisfy all the constraints */ public static boolean verifyTest(TestCase tc) throws IllegalArgumentException{ Inputs.checkNull(tc); Set<Object> seenAtMostOnce = new LinkedHashSet<>(); //look at each statement in the test case, one at a time for(int i=0; i<tc.size(); i++){ Statement st = tc.getStatement(i); if (! canStatementHaveConstraints(st)){ continue; } if(! checkFunctionalMockUsage(st, tc)){ return false; } //data we need for calculations Object reflectionRef = null; List<VariableReference> inputs = null; List<VariableReference> boundedInitializingInputs = null; Annotation[] methodAnnotations = null; Annotation[][] parameterAnnotations = null; Class<?> declaringClass = null; //init data based on whether current statement is a constructor or regular method if(st instanceof MethodStatement) { MethodStatement ms = (MethodStatement) st; inputs = ms.getParameterReferences(); Method m = ms.getMethod().getMethod(); reflectionRef = m; methodAnnotations = m.getDeclaredAnnotations(); declaringClass = m.getDeclaringClass(); parameterAnnotations = m.getParameterAnnotations(); boundedInitializingInputs = getBoundedInitializingVariables(inputs, parameterAnnotations); if(! checkBoundedVariableAtMostOnce(tc,i,ms)){ return false; } } else if(st instanceof ConstructorStatement){ ConstructorStatement cs = (ConstructorStatement) st; inputs = cs.getParameterReferences(); Constructor c = cs.getConstructor().getConstructor(); reflectionRef = c; methodAnnotations = c.getDeclaredAnnotations(); declaringClass = c.getDeclaringClass(); parameterAnnotations = c.getParameterAnnotations(); boundedInitializingInputs = getBoundedInitializingVariables(inputs, parameterAnnotations); } //should the method had been directly excluded from the tests? boolean declaringClassExcluded = isDeclaringExcluded(declaringClass); if(declaringClassExcluded){ if(! hasIncludeAnnotation(methodAnnotations)){ logger.error("'excludeClass' constraint violated at position "+i+" in test case:\n"+tc.toCode()); return false; } } //the method is an initializer for some bounded variable if(! boundedInitializingInputs.isEmpty()){ for(VariableReference vr : boundedInitializingInputs){ if(!checkInitializingBoundedVariable(tc,i,vr)){ return false; } } } //look at each annotation on the method for(Annotation annotation : methodAnnotations){ if(annotation instanceof EvoSuiteExclude && declaringClassExcluded){ logger.error("Wrong constraints: class "+declaringClass.getName()+" is a " + EvoSuiteClassExclude.class.getSimpleName() + " but uses " + EvoSuiteExclude.class.getSimpleName() + " on the method" + reflectionRef.toString()); return false; } if(annotation instanceof EvoSuiteInclude && !declaringClassExcluded){ logger.error("Wrong constraints: class "+declaringClass.getName()+" is not a " + EvoSuiteClassExclude.class.getSimpleName() + " but uses " + EvoSuiteInclude.class.getSimpleName() + " on the method" + reflectionRef.toString()); return false; } if(annotation instanceof EvoSuiteExclude){ logger.error("'excludeMethod' constraint violated at position "+i+" in test case:\n"+tc.toCode()); return false; } //found an annotation defining one or more constraints if(annotation instanceof Constraints){ Constraints c = (Constraints) annotation; //check for methods that should appear only once if(c.atMostOnce()){ if(seenAtMostOnce.contains(reflectionRef)){ logger.error("'atMostOne' constraint violated at position "+i+" in test case:\n"+tc.toCode()); return false; } seenAtMostOnce.add(reflectionRef); } //check for methods that should have no null inputs if(c.noNullInputs()){ for(VariableReference vr : inputs){ boolean invalid = ConstraintHelper.isNull(vr,tc); if(invalid){ logger.error("'noNullInputs' constraint violated at position "+i+" in test case:\n"+tc.toCode()); return false; } } } //'excludeOthers' constraint check if(c.excludeOthers() != null && c.excludeOthers().length > 0){ if (! checkExcludeOthers(tc, i, declaringClass, c)){ return false; } } //'after' constraint check if(c.after() != null && !c.after().trim().isEmpty()){ if (! checkAfter(tc, i, declaringClass, c)){ return false; } } break; } } } return true; //everything was OK } /** * No method should be called on the return value of a mock creation. * This is because a functional mock object should only be used as an input value. * Calling any method on it would make no sense * * @param st */ private static boolean checkFunctionalMockUsage(Statement st, TestCase tc) { if(! (st instanceof MethodStatement)){ return true; } MethodStatement ms = (MethodStatement) st; VariableReference callee = ms.getCallee(); if(callee==null){ //ie, static method return true; } Statement source = tc.getStatement(callee.getStPosition()); if(source instanceof FunctionalMockStatement){ logger.error("Mock object created at position "+source.getPosition()+" has a method called in position "+ st.getPosition()); return false; } return true; } private static Annotation[][] getParameterAnnotations(Statement st){ if(st instanceof MethodStatement){ return ((MethodStatement) st).getMethod().getMethod().getParameterAnnotations(); } else if(st instanceof ConstructorStatement){ return ((ConstructorStatement)st).getConstructor().getConstructor().getParameterAnnotations(); } else { return null; } } private static AccessibleObject getAccessibleObject(Statement st){ if(st instanceof MethodStatement){ return ((MethodStatement) st).getMethod().getMethod(); } else if(st instanceof ConstructorStatement){ return ((ConstructorStatement)st).getConstructor().getConstructor(); } else { return null; } } private static boolean canStatementHaveConstraints(Statement st) { //constraints are defined only on methods and constructors (eg, no primitive variable field declarations) if(! (st instanceof MethodStatement) && ! (st instanceof ConstructorStatement)){ return false; } return true; } private static boolean checkBoundedVariableAtMostOnce(TestCase tc, int i, MethodStatement ms) { Annotation[][] annotations = ms.getMethod().getMethod().getParameterAnnotations(); List<VariableReference> inputs = ms.getParameterReferences(); List<VariableReference> atMostOnce = new ArrayList<>(); //check if input method has any bounded variable declared as atMostOnce outer : for(int j=0; j<annotations.length; j++){ Annotation[] array = annotations[j]; for(Annotation annotation : array){ if(annotation instanceof BoundInputVariable){ BoundInputVariable biv = (BoundInputVariable) annotation; if(biv.atMostOnce()){ atMostOnce.add(inputs.get(j)); continue outer; } } } } if(atMostOnce.isEmpty()){ return true; } for(int j=i-1; j>=0; j--){ Statement st = tc.getStatement(j); if(! (st instanceof MethodStatement)){ continue; } MethodStatement other = (MethodStatement) st; if(! other.getMethod().getMethod().equals( ms.getMethod().getMethod())){ continue; } //ok, same method. but is it called with the same bounded variables? for(VariableReference ref : other.getParameterReferences()){ for(VariableReference bounded : atMostOnce){ if(ref.same(bounded)){ logger.error("Bounded variable declared in "+ref.getStPosition()+" can only be used once as input for the " + "method "+other.getMethod().getName()+" : it is wrongly used both at position "+j+" and "+i); return false; } } } } return true; } private static boolean checkInitializingBoundedVariable(TestCase tc, int i, VariableReference vr) { for(int j = i-1; j>vr.getStPosition() ; j--){ Statement st = tc.getStatement(j); MethodStatement ms = null; ConstructorStatement cs = null; Annotation[][] annotations = null; List<VariableReference> inputs = null; if(st instanceof MethodStatement){ ms = (MethodStatement) st; annotations = ms.getMethod().getMethod().getParameterAnnotations(); inputs = ms.getParameterReferences(); //is any other method of the bounded variable been called? VariableReference callee = ms.getCallee(); if(vr.same(callee)){ logger.error("Invalid method call at position "+j+ " on bounded variable created in "+vr.getStPosition()+" " + "and initialized in "+i + "\nTest case code:\n" + tc.toCode()); return false; } } if(st instanceof ConstructorStatement){ cs = (ConstructorStatement) st; annotations = cs.getConstructor().getConstructor().getParameterAnnotations(); inputs = cs.getParameterReferences(); } if(inputs==null || inputs.isEmpty()){ continue; } //is the bounded variable used as input in another method? outer : for(int k=0; k<inputs.size(); k++){ VariableReference input = inputs.get(k); Annotation[] varAnns = annotations[k]; for(Annotation ann : varAnns){ if(ann instanceof BoundInputVariable){ continue outer; // it is fine if bounded variable is used several methods (eg injectors for each field) } } if (vr.same(input)) { logger.error("Bounded variable of type " + vr.getType() + " created at position " + vr.getStPosition() + " is used as input in " + j + " before its bounding initializer at position " + i + ". Statement at position "+j+" is:\n"+tc.getStatement(j).getCode() + "\nTest case code:\n" + tc.toCode()); return false; } } } Statement declaration = tc.getStatement(vr.getStPosition()); if(! (declaration instanceof ConstructorStatement)){ logger.error("Bounded variable is declared in "+vr.getStPosition()+" but not with a 'new' constructor." + "Statement:\n"+declaration+"\nTest code:\n"+tc.toCode()); return false; } return true; } /** * This method assumes the two data structures are aligned * * @param inputs * @param annotations * @return */ private static List<VariableReference> getBoundedInitializingVariables(List<VariableReference> inputs, Annotation[][] annotations) { List<VariableReference> bounded = new ArrayList<>(); outer : for(int i=0; i<inputs.size(); i++){ Annotation[] array = annotations[i]; for(Annotation annotation : array){ if(annotation instanceof BoundInputVariable){ BoundInputVariable biv = (BoundInputVariable) annotation; if(biv.initializer()){ bounded.add(inputs.get(i)); continue outer; } } } } return bounded; } private static boolean checkAfter(TestCase tc, int i, Class<?> declaringClass, Constraints c) { String after = c.after(); String[] klassAndMethod = ConstraintHelper.getClassAndMethod(after, declaringClass); String afterKlassName = klassAndMethod[0]; String afterMethodName = klassAndMethod[1]; for(int j=i-1; j>=0 ; j--){ Statement previous = tc.getStatement(j); if(! (previous instanceof MethodStatement)){ continue; } MethodStatement ms = (MethodStatement) previous; if(ms.getMethod().getName().equals(afterMethodName) && ms.getMethod().getDeclaringClass().getName().equals(afterKlassName)){ //found it. it is in the test before the statement. return true; } } logger.error("'after' constraint violated at position "+i+". Not found previous call to '"+ after + "' in test case:\n"+tc.toCode()); return false; } private static boolean hasIncludeAnnotation(Annotation[] methodAnnotations) { for(Annotation annotation : methodAnnotations){ if(annotation instanceof EvoSuiteInclude){ return true; } } return false; } private static boolean isDeclaringExcluded(Class<?> declaringClass) { Annotation ann = declaringClass.getAnnotation(EvoSuiteClassExclude.class); return ann != null; } private static boolean checkExcludeOthers(TestCase tc, int i, Class<?> declaringClass, Constraints c) { Statement st = tc.getStatement(i); for(String excluded : c.excludeOthers()){ String[] klassAndMethod = ConstraintHelper.getClassAndMethod(excluded, declaringClass); String klassName = klassAndMethod[0]; String excludedName = klassAndMethod[1]; //check if it exists, ie whether the constraint is valid try { Class<?> klass = Class.forName(klassName); boolean found = false; for(Method k : klass.getDeclaredMethods()){ if(k.getName().equals(excludedName)){ found = true; break; } } if(!found){ logger.error("Invalid constraint definition for " + declaringClass.getCanonicalName()+". The excluded method " +excludedName+" does not exist."); return false; } } catch (ClassNotFoundException e) { logger.error("Invalid constraint definition for " + declaringClass.getCanonicalName()+". The excluded method in class " +klassName+" does not exist."); return false; } //look at all the other statements for(int j=0; j<tc.size(); j++) { Statement other = tc.getStatement(j); if (j==i || !(other instanceof MethodStatement)) { continue; } MethodStatement oms = (MethodStatement) other; if(oms.getMethod().getName().equals(excludedName) && oms.getMethod().getDeclaringClass().getName().equals(klassName)){ logger.error("'excludeOthers' constraint violated at position "+i+" in test case:\n"+tc.toCode()); return false; } } } return true; } }
{ "pile_set_name": "Github" }
/* * Copyright 2015-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Contains support classes for the Lease feature of the RSocket protocol. * * @see <a * href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#resuming-operation">Resuming * Operation</a> */ @NonNullApi package io.rsocket.lease; import reactor.util.annotation.NonNullApi;
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012 - 2020 Splice Machine, Inc. * * This file is part of Splice Machine. * Splice Machine is free software: you can redistribute it and/or modify it under the terms of the * GNU Affero General Public License as published by the Free Software Foundation, either * version 3, or (at your option) any later version. * Splice Machine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with Splice Machine. * If not, see <http://www.gnu.org/licenses/>. */ package com.splicemachine.orc.stream; import com.splicemachine.orc.checkpoint.StreamCheckpoint; import javax.annotation.Nullable; import java.io.IOException; import static com.google.common.base.MoreObjects.toStringHelper; import static java.util.Objects.requireNonNull; public class CheckpointStreamSource<S extends ValueStream<C>, C extends StreamCheckpoint> implements StreamSource<S> { public static <S extends ValueStream<C>, C extends StreamCheckpoint> CheckpointStreamSource<S, C> createCheckpointStreamSource(S stream, StreamCheckpoint checkpoint) { requireNonNull(stream, "stream is null"); requireNonNull(checkpoint, "checkpoint is null"); Class<? extends C> checkpointType = stream.getCheckpointType(); C verifiedCheckpoint = (C) checkpoint; return new CheckpointStreamSource<>(stream, verifiedCheckpoint); } private final S stream; private final C checkpoint; public CheckpointStreamSource(S stream, C checkpoint) { this.stream = requireNonNull(stream, "stream is null"); this.checkpoint = requireNonNull(checkpoint, "checkpoint is null"); } @Override public Class<S> getStreamType() { return (Class<S>) stream.getClass(); } @Nullable @Override public S openStream() throws IOException { stream.seekToCheckpoint(checkpoint); return stream; } @Override public String toString() { return toStringHelper(this) .add("stream", stream) .add("checkpoint", checkpoint) .toString(); } }
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2014 Benoit Steiner <[email protected]> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H #define EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H namespace Eigen { /** \class TensorImagePatch * \ingroup CXX11_Tensor_Module * * \brief Patch extraction specialized for image processing. * This assumes that the input has a least 3 dimensions ordered as follow: * 1st dimension: channels (of size d) * 2nd dimension: rows (of size r) * 3rd dimension: columns (of size c) * There can be additional dimensions such as time (for video) or batch (for * bulk processing after the first 3. * Calling the image patch code with patch_rows and patch_cols is equivalent * to calling the regular patch extraction code with parameters d, patch_rows, * patch_cols, and 1 for all the additional dimensions. */ namespace internal { template<DenseIndex Rows, DenseIndex Cols, typename XprType> struct traits<TensorImagePatchOp<Rows, Cols, XprType> > : public traits<XprType> { typedef typename internal::remove_const<typename XprType::Scalar>::type Scalar; typedef traits<XprType> XprTraits; typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; typedef typename remove_reference<Nested>::type _Nested; static const int NumDimensions = XprTraits::NumDimensions + 1; static const int Layout = XprTraits::Layout; }; template<DenseIndex Rows, DenseIndex Cols, typename XprType> struct eval<TensorImagePatchOp<Rows, Cols, XprType>, Eigen::Dense> { typedef const TensorImagePatchOp<Rows, Cols, XprType>& type; }; template<DenseIndex Rows, DenseIndex Cols, typename XprType> struct nested<TensorImagePatchOp<Rows, Cols, XprType>, 1, typename eval<TensorImagePatchOp<Rows, Cols, XprType> >::type> { typedef TensorImagePatchOp<Rows, Cols, XprType> type; }; } // end namespace internal template<DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorImagePatchOp : public TensorBase<TensorImagePatchOp<Rows, Cols, XprType>, ReadOnlyAccessors> { public: typedef typename Eigen::internal::traits<TensorImagePatchOp>::Scalar Scalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename Eigen::internal::nested<TensorImagePatchOp>::type Nested; typedef typename Eigen::internal::traits<TensorImagePatchOp>::StorageKind StorageKind; typedef typename Eigen::internal::traits<TensorImagePatchOp>::Index Index; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorImagePatchOp(const XprType& expr, DenseIndex patch_rows, DenseIndex patch_cols, DenseIndex row_strides, DenseIndex col_strides, DenseIndex in_row_strides, DenseIndex in_col_strides, DenseIndex row_inflate_strides, DenseIndex col_inflate_strides, PaddingType padding_type, Scalar padding_value) : m_xpr(expr), m_patch_rows(patch_rows), m_patch_cols(patch_cols), m_row_strides(row_strides), m_col_strides(col_strides), m_in_row_strides(in_row_strides), m_in_col_strides(in_col_strides), m_row_inflate_strides(row_inflate_strides), m_col_inflate_strides(col_inflate_strides), m_padding_explicit(false), m_padding_top(0), m_padding_bottom(0), m_padding_left(0), m_padding_right(0), m_padding_type(padding_type), m_padding_value(padding_value) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorImagePatchOp(const XprType& expr, DenseIndex patch_rows, DenseIndex patch_cols, DenseIndex row_strides, DenseIndex col_strides, DenseIndex in_row_strides, DenseIndex in_col_strides, DenseIndex row_inflate_strides, DenseIndex col_inflate_strides, DenseIndex padding_top, DenseIndex padding_bottom, DenseIndex padding_left, DenseIndex padding_right, Scalar padding_value) : m_xpr(expr), m_patch_rows(patch_rows), m_patch_cols(patch_cols), m_row_strides(row_strides), m_col_strides(col_strides), m_in_row_strides(in_row_strides), m_in_col_strides(in_col_strides), m_row_inflate_strides(row_inflate_strides), m_col_inflate_strides(col_inflate_strides), m_padding_explicit(true), m_padding_top(padding_top), m_padding_bottom(padding_bottom), m_padding_left(padding_left), m_padding_right(padding_right), m_padding_type(PADDING_VALID), m_padding_value(padding_value) {} EIGEN_DEVICE_FUNC DenseIndex patch_rows() const { return m_patch_rows; } EIGEN_DEVICE_FUNC DenseIndex patch_cols() const { return m_patch_cols; } EIGEN_DEVICE_FUNC DenseIndex row_strides() const { return m_row_strides; } EIGEN_DEVICE_FUNC DenseIndex col_strides() const { return m_col_strides; } EIGEN_DEVICE_FUNC DenseIndex in_row_strides() const { return m_in_row_strides; } EIGEN_DEVICE_FUNC DenseIndex in_col_strides() const { return m_in_col_strides; } EIGEN_DEVICE_FUNC DenseIndex row_inflate_strides() const { return m_row_inflate_strides; } EIGEN_DEVICE_FUNC DenseIndex col_inflate_strides() const { return m_col_inflate_strides; } EIGEN_DEVICE_FUNC bool padding_explicit() const { return m_padding_explicit; } EIGEN_DEVICE_FUNC DenseIndex padding_top() const { return m_padding_top; } EIGEN_DEVICE_FUNC DenseIndex padding_bottom() const { return m_padding_bottom; } EIGEN_DEVICE_FUNC DenseIndex padding_left() const { return m_padding_left; } EIGEN_DEVICE_FUNC DenseIndex padding_right() const { return m_padding_right; } EIGEN_DEVICE_FUNC PaddingType padding_type() const { return m_padding_type; } EIGEN_DEVICE_FUNC Scalar padding_value() const { return m_padding_value; } EIGEN_DEVICE_FUNC const typename internal::remove_all<typename XprType::Nested>::type& expression() const { return m_xpr; } protected: typename XprType::Nested m_xpr; const DenseIndex m_patch_rows; const DenseIndex m_patch_cols; const DenseIndex m_row_strides; const DenseIndex m_col_strides; const DenseIndex m_in_row_strides; const DenseIndex m_in_col_strides; const DenseIndex m_row_inflate_strides; const DenseIndex m_col_inflate_strides; const bool m_padding_explicit; const DenseIndex m_padding_top; const DenseIndex m_padding_bottom; const DenseIndex m_padding_left; const DenseIndex m_padding_right; const PaddingType m_padding_type; const Scalar m_padding_value; }; // Eval as rvalue template<DenseIndex Rows, DenseIndex Cols, typename ArgType, typename Device> struct TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device> { typedef TensorImagePatchOp<Rows, Cols, ArgType> XprType; typedef typename XprType::Index Index; static const int NumInputDims = internal::array_size<typename TensorEvaluator<ArgType, Device>::Dimensions>::value; static const int NumDims = NumInputDims + 1; typedef DSizes<Index, NumDims> Dimensions; typedef typename internal::remove_const<typename XprType::Scalar>::type Scalar; typedef TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device> Self; typedef TensorEvaluator<ArgType, Device> Impl; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType; static const int PacketSize = internal::unpacket_traits<PacketReturnType>::size; enum { IsAligned = false, PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess, Layout = TensorEvaluator<ArgType, Device>::Layout, CoordAccess = false, RawAccess = false }; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device) #ifdef EIGEN_USE_SYCL , m_op(op) #endif { EIGEN_STATIC_ASSERT((NumDims >= 4), YOU_MADE_A_PROGRAMMING_MISTAKE); m_paddingValue = op.padding_value(); const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions(); // Caches a few variables. if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { m_inputDepth = input_dims[0]; m_inputRows = input_dims[1]; m_inputCols = input_dims[2]; } else { m_inputDepth = input_dims[NumInputDims-1]; m_inputRows = input_dims[NumInputDims-2]; m_inputCols = input_dims[NumInputDims-3]; } m_row_strides = op.row_strides(); m_col_strides = op.col_strides(); // Input strides and effective input/patch size m_in_row_strides = op.in_row_strides(); m_in_col_strides = op.in_col_strides(); m_row_inflate_strides = op.row_inflate_strides(); m_col_inflate_strides = op.col_inflate_strides(); // The "effective" input rows and input cols are the input rows and cols // after inflating them with zeros. // For examples, a 2x3 matrix with row_inflate_strides and // col_inflate_strides of 2 comes from: // A B C // D E F // // to a matrix is 3 x 5: // // A . B . C // . . . . . // D . E . F m_input_rows_eff = (m_inputRows - 1) * m_row_inflate_strides + 1; m_input_cols_eff = (m_inputCols - 1) * m_col_inflate_strides + 1; m_patch_rows_eff = op.patch_rows() + (op.patch_rows() - 1) * (m_in_row_strides - 1); m_patch_cols_eff = op.patch_cols() + (op.patch_cols() - 1) * (m_in_col_strides - 1); if (op.padding_explicit()) { m_outputRows = numext::ceil((m_input_rows_eff + op.padding_top() + op.padding_bottom() - m_patch_rows_eff + 1.f) / static_cast<float>(m_row_strides)); m_outputCols = numext::ceil((m_input_cols_eff + op.padding_left() + op.padding_right() - m_patch_cols_eff + 1.f) / static_cast<float>(m_col_strides)); m_rowPaddingTop = op.padding_top(); m_colPaddingLeft = op.padding_left(); } else { // Computing padding from the type switch (op.padding_type()) { case PADDING_VALID: m_outputRows = numext::ceil((m_input_rows_eff - m_patch_rows_eff + 1.f) / static_cast<float>(m_row_strides)); m_outputCols = numext::ceil((m_input_cols_eff - m_patch_cols_eff + 1.f) / static_cast<float>(m_col_strides)); // Calculate the padding m_rowPaddingTop = numext::maxi<Index>(0, ((m_outputRows - 1) * m_row_strides + m_patch_rows_eff - m_input_rows_eff) / 2); m_colPaddingLeft = numext::maxi<Index>(0, ((m_outputCols - 1) * m_col_strides + m_patch_cols_eff - m_input_cols_eff) / 2); break; case PADDING_SAME: m_outputRows = numext::ceil(m_input_rows_eff / static_cast<float>(m_row_strides)); m_outputCols = numext::ceil(m_input_cols_eff / static_cast<float>(m_col_strides)); // Calculate the padding m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + m_patch_rows_eff - m_input_rows_eff) / 2; m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + m_patch_cols_eff - m_input_cols_eff) / 2; break; default: eigen_assert(false && "unexpected padding"); m_outputCols=0; // silence the uninitialised warnig; m_outputRows=0; //// silence the uninitialised warnig; } } eigen_assert(m_outputRows > 0); eigen_assert(m_outputCols > 0); // Dimensions for result of extraction. if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { // ColMajor // 0: depth // 1: patch_rows // 2: patch_cols // 3: number of patches // 4 and beyond: anything else (such as batch). m_dimensions[0] = input_dims[0]; m_dimensions[1] = op.patch_rows(); m_dimensions[2] = op.patch_cols(); m_dimensions[3] = m_outputRows * m_outputCols; for (int i = 4; i < NumDims; ++i) { m_dimensions[i] = input_dims[i-1]; } } else { // RowMajor // NumDims-1: depth // NumDims-2: patch_rows // NumDims-3: patch_cols // NumDims-4: number of patches // NumDims-5 and beyond: anything else (such as batch). m_dimensions[NumDims-1] = input_dims[NumInputDims-1]; m_dimensions[NumDims-2] = op.patch_rows(); m_dimensions[NumDims-3] = op.patch_cols(); m_dimensions[NumDims-4] = m_outputRows * m_outputCols; for (int i = NumDims-5; i >= 0; --i) { m_dimensions[i] = input_dims[i]; } } // Strides for moving the patch in various dimensions. if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { m_colStride = m_dimensions[1]; m_patchStride = m_colStride * m_dimensions[2] * m_dimensions[0]; m_otherStride = m_patchStride * m_dimensions[3]; } else { m_colStride = m_dimensions[NumDims-2]; m_patchStride = m_colStride * m_dimensions[NumDims-3] * m_dimensions[NumDims-1]; m_otherStride = m_patchStride * m_dimensions[NumDims-4]; } // Strides for navigating through the input tensor. m_rowInputStride = m_inputDepth; m_colInputStride = m_inputDepth * m_inputRows; m_patchInputStride = m_inputDepth * m_inputRows * m_inputCols; // Fast representations of different variables. m_fastOtherStride = internal::TensorIntDivisor<Index>(m_otherStride); m_fastPatchStride = internal::TensorIntDivisor<Index>(m_patchStride); m_fastColStride = internal::TensorIntDivisor<Index>(m_colStride); m_fastInflateRowStride = internal::TensorIntDivisor<Index>(m_row_inflate_strides); m_fastInflateColStride = internal::TensorIntDivisor<Index>(m_col_inflate_strides); m_fastInputColsEff = internal::TensorIntDivisor<Index>(m_input_cols_eff); // Number of patches in the width dimension. m_fastOutputRows = internal::TensorIntDivisor<Index>(m_outputRows); if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { m_fastOutputDepth = internal::TensorIntDivisor<Index>(m_dimensions[0]); } else { m_fastOutputDepth = internal::TensorIntDivisor<Index>(m_dimensions[NumDims-1]); } } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar* /*data*/) { m_impl.evalSubExprsIfNeeded(NULL); return true; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() { m_impl.cleanup(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const { // Patch index corresponding to the passed in index. const Index patchIndex = index / m_fastPatchStride; // Find the offset of the element wrt the location of the first element. const Index patchOffset = (index - patchIndex * m_patchStride) / m_fastOutputDepth; // Other ways to index this element. const Index otherIndex = (NumDims == 4) ? 0 : index / m_fastOtherStride; const Index patch2DIndex = (NumDims == 4) ? patchIndex : (index - otherIndex * m_otherStride) / m_fastPatchStride; // Calculate col index in the input original tensor. const Index colIndex = patch2DIndex / m_fastOutputRows; const Index colOffset = patchOffset / m_fastColStride; const Index inputCol = colIndex * m_col_strides + colOffset * m_in_col_strides - m_colPaddingLeft; const Index origInputCol = (m_col_inflate_strides == 1) ? inputCol : ((inputCol >= 0) ? (inputCol / m_fastInflateColStride) : 0); if (inputCol < 0 || inputCol >= m_input_cols_eff || ((m_col_inflate_strides != 1) && (inputCol != origInputCol * m_col_inflate_strides))) { return Scalar(m_paddingValue); } // Calculate row index in the original input tensor. const Index rowIndex = patch2DIndex - colIndex * m_outputRows; const Index rowOffset = patchOffset - colOffset * m_colStride; const Index inputRow = rowIndex * m_row_strides + rowOffset * m_in_row_strides - m_rowPaddingTop; const Index origInputRow = (m_row_inflate_strides == 1) ? inputRow : ((inputRow >= 0) ? (inputRow / m_fastInflateRowStride) : 0); if (inputRow < 0 || inputRow >= m_input_rows_eff || ((m_row_inflate_strides != 1) && (inputRow != origInputRow * m_row_inflate_strides))) { return Scalar(m_paddingValue); } const int depth_index = static_cast<int>(Layout) == static_cast<int>(ColMajor) ? 0 : NumDims - 1; const Index depth = index - (index / m_fastOutputDepth) * m_dimensions[depth_index]; const Index inputIndex = depth + origInputRow * m_rowInputStride + origInputCol * m_colInputStride + otherIndex * m_patchInputStride; return m_impl.coeff(inputIndex); } template<int LoadMode> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const { EIGEN_STATIC_ASSERT((PacketSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE) eigen_assert(index+PacketSize-1 < dimensions().TotalSize()); if (m_in_row_strides != 1 || m_in_col_strides != 1 || m_row_inflate_strides != 1 || m_col_inflate_strides != 1) { return packetWithPossibleZero(index); } const Index indices[2] = {index, index + PacketSize - 1}; const Index patchIndex = indices[0] / m_fastPatchStride; if (patchIndex != indices[1] / m_fastPatchStride) { return packetWithPossibleZero(index); } const Index otherIndex = (NumDims == 4) ? 0 : indices[0] / m_fastOtherStride; eigen_assert(otherIndex == indices[1] / m_fastOtherStride); // Find the offset of the element wrt the location of the first element. const Index patchOffsets[2] = {(indices[0] - patchIndex * m_patchStride) / m_fastOutputDepth, (indices[1] - patchIndex * m_patchStride) / m_fastOutputDepth}; const Index patch2DIndex = (NumDims == 4) ? patchIndex : (indices[0] - otherIndex * m_otherStride) / m_fastPatchStride; eigen_assert(patch2DIndex == (indices[1] - otherIndex * m_otherStride) / m_fastPatchStride); const Index colIndex = patch2DIndex / m_fastOutputRows; const Index colOffsets[2] = {patchOffsets[0] / m_fastColStride, patchOffsets[1] / m_fastColStride}; // Calculate col indices in the original input tensor. const Index inputCols[2] = {colIndex * m_col_strides + colOffsets[0] - m_colPaddingLeft, colIndex * m_col_strides + colOffsets[1] - m_colPaddingLeft}; if (inputCols[1] < 0 || inputCols[0] >= m_inputCols) { return internal::pset1<PacketReturnType>(Scalar(m_paddingValue)); } if (inputCols[0] == inputCols[1]) { const Index rowIndex = patch2DIndex - colIndex * m_outputRows; const Index rowOffsets[2] = {patchOffsets[0] - colOffsets[0]*m_colStride, patchOffsets[1] - colOffsets[1]*m_colStride}; eigen_assert(rowOffsets[0] <= rowOffsets[1]); // Calculate col indices in the original input tensor. const Index inputRows[2] = {rowIndex * m_row_strides + rowOffsets[0] - m_rowPaddingTop, rowIndex * m_row_strides + rowOffsets[1] - m_rowPaddingTop}; if (inputRows[1] < 0 || inputRows[0] >= m_inputRows) { return internal::pset1<PacketReturnType>(Scalar(m_paddingValue)); } if (inputRows[0] >= 0 && inputRows[1] < m_inputRows) { // no padding const int depth_index = static_cast<int>(Layout) == static_cast<int>(ColMajor) ? 0 : NumDims - 1; const Index depth = index - (index / m_fastOutputDepth) * m_dimensions[depth_index]; const Index inputIndex = depth + inputRows[0] * m_rowInputStride + inputCols[0] * m_colInputStride + otherIndex * m_patchInputStride; return m_impl.template packet<Unaligned>(inputIndex); } } return packetWithPossibleZero(index); } EIGEN_DEVICE_FUNC Scalar* data() const { return NULL; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorEvaluator<ArgType, Device>& impl() const { return m_impl; } #ifdef EIGEN_USE_SYCL EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const XprType& xpr() const { return m_op; } #endif Index rowPaddingTop() const { return m_rowPaddingTop; } Index colPaddingLeft() const { return m_colPaddingLeft; } Index outputRows() const { return m_outputRows; } Index outputCols() const { return m_outputCols; } Index userRowStride() const { return m_row_strides; } Index userColStride() const { return m_col_strides; } Index userInRowStride() const { return m_in_row_strides; } Index userInColStride() const { return m_in_col_strides; } Index rowInflateStride() const { return m_row_inflate_strides; } Index colInflateStride() const { return m_col_inflate_strides; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const { // We conservatively estimate the cost for the code path where the computed // index is inside the original image and // TensorEvaluator<ArgType, Device>::CoordAccess is false. const double compute_cost = 3 * TensorOpCost::DivCost<Index>() + 6 * TensorOpCost::MulCost<Index>() + 8 * TensorOpCost::MulCost<Index>(); return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, compute_cost, vectorized, PacketSize); } protected: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packetWithPossibleZero(Index index) const { EIGEN_ALIGN_MAX typename internal::remove_const<CoeffReturnType>::type values[PacketSize]; for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index+i); } PacketReturnType rslt = internal::pload<PacketReturnType>(values); return rslt; } Dimensions m_dimensions; Index m_otherStride; Index m_patchStride; Index m_colStride; Index m_row_strides; Index m_col_strides; Index m_in_row_strides; Index m_in_col_strides; Index m_row_inflate_strides; Index m_col_inflate_strides; Index m_input_rows_eff; Index m_input_cols_eff; Index m_patch_rows_eff; Index m_patch_cols_eff; internal::TensorIntDivisor<Index> m_fastOtherStride; internal::TensorIntDivisor<Index> m_fastPatchStride; internal::TensorIntDivisor<Index> m_fastColStride; internal::TensorIntDivisor<Index> m_fastInflateRowStride; internal::TensorIntDivisor<Index> m_fastInflateColStride; internal::TensorIntDivisor<Index> m_fastInputColsEff; Index m_rowInputStride; Index m_colInputStride; Index m_patchInputStride; Index m_inputDepth; Index m_inputRows; Index m_inputCols; Index m_outputRows; Index m_outputCols; Index m_rowPaddingTop; Index m_colPaddingLeft; internal::TensorIntDivisor<Index> m_fastOutputRows; internal::TensorIntDivisor<Index> m_fastOutputDepth; Scalar m_paddingValue; TensorEvaluator<ArgType, Device> m_impl; #ifdef EIGEN_USE_SYCL const XprType& m_op; #endif }; } // end namespace Eigen #endif // EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H
{ "pile_set_name": "Github" }
import sys import requests import threading import re import math import time import os from requests.packages.urllib3.exceptions import InsecureRequestWarning # 禁用安全请求警告 requests.packages.urllib3.disable_warnings(InsecureRequestWarning) def getUrls(filename): f = open(filename,'r',encoding="utf8") lines = f.readlines() urls = [url.strip() for url in lines] return urls def check_http(target): """检测目录是否为http服务""" target = target.strip() headers={"User-Agent":"Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)"} try: url = "%s://%s/" % ("http",target) req = requests.get(url,headers=headers,verify=False,timeout=10) if req.status_code == 302 and "Location" in req.headers.keys(): if str(req.headers['Location']).startswith('https'): return "https" if req.status_code == 200: r = re.search(r"<meta\shttp-equiv=\"refresh\"\scontent=\"[0-9]*;url=(.*?)\">",req.text) if r: if r.group(1).startswith('https'): return "https" return "http" except: try: url = "%s://%s/" % ("https",target) requests.get(url,headers=headers,verify=False,timeout=10) return "https" except: return False def get_console_width(): return int(os.get_terminal_size().columns) def getTitle(url): server = "" console_width = get_console_width() aa = (0.3,0.3,0.1) if console_width > 80 else (0.4,0.2,0.3) a5 = int(console_width*aa[0]) a4 = int(console_width*aa[1]) try: http = check_http(url) if http: url = "%s://%s/" % (http,url) reqs = requests.get(url,timeout=10,verify=False) if reqs.status_code == 200: html = reqs.text if 'Content-Type' in reqs.headers.keys() and 'charset' in reqs.headers['Content-Type']: en = re.search(";(\s|)charset=(.*?)$|charset=\"(.*?)\"",reqs.headers['Content-Type']) else: en = re.search(";(\s|)charset=(.*?)\"|charset=\"(.*?)\"",reqs.text) if en: reqs.encoding=en.group(3) if en.group(2) == None else en.group(2) html = reqs.text title_re = re.search(r"<title>(.*?)</title>", html) if title_re: t = title_re.group(1) if 'Server' in reqs.headers.keys(): server = reqs.headers['Server'] print(url.ljust(a5),server.ljust(a4),t) elif reqs.status_code in [404,403]: pass print(url.ljust(a5),server.ljust(a4),reqs.status_code) except Exception as e: pass #print(e) def start(filename,threads=2): urls = getUrls(filename) for url in urls: while threading.active_count() > int(threads): time.sleep(0.5) threading.Thread(target=getTitle,args=(url,)).start() if len(sys.argv) >2: start(sys.argv[1],sys.argv[2]) else: start(sys.argv[1])
{ "pile_set_name": "Github" }
var capability = require('./capability') var inherits = require('inherits') var stream = require('readable-stream') var rStates = exports.readyStates = { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 } var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) { var self = this stream.Readable.call(self) self._mode = mode self.headers = {} self.rawHeaders = [] self.trailers = {} self.rawTrailers = [] // Fake the 'close' event, but only once 'end' fires self.on('end', function () { // The nextTick is necessary to prevent the 'request' module from causing an infinite loop process.nextTick(function () { self.emit('close') }) }) if (mode === 'fetch') { self._fetchResponse = response self.url = response.url self.statusCode = response.status self.statusMessage = response.statusText response.headers.forEach(function (header, key){ self.headers[key.toLowerCase()] = header self.rawHeaders.push(key, header) }) if (capability.writableStream) { var writable = new WritableStream({ write: function (chunk) { return new Promise(function (resolve, reject) { if (self._destroyed) { reject() } else if(self.push(Buffer.from(chunk))) { resolve() } else { self._resumeFetch = resolve } }) }, close: function () { global.clearTimeout(fetchTimer) if (!self._destroyed) self.push(null) }, abort: function (err) { if (!self._destroyed) self.emit('error', err) } }) try { response.body.pipeTo(writable).catch(function (err) { global.clearTimeout(fetchTimer) if (!self._destroyed) self.emit('error', err) }) return } catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this } // fallback for when writableStream or pipeTo aren't available var reader = response.body.getReader() function read () { reader.read().then(function (result) { if (self._destroyed) return if (result.done) { global.clearTimeout(fetchTimer) self.push(null) return } self.push(Buffer.from(result.value)) read() }).catch(function (err) { global.clearTimeout(fetchTimer) if (!self._destroyed) self.emit('error', err) }) } read() } else { self._xhr = xhr self._pos = 0 self.url = xhr.responseURL self.statusCode = xhr.status self.statusMessage = xhr.statusText var headers = xhr.getAllResponseHeaders().split(/\r?\n/) headers.forEach(function (header) { var matches = header.match(/^([^:]+):\s*(.*)/) if (matches) { var key = matches[1].toLowerCase() if (key === 'set-cookie') { if (self.headers[key] === undefined) { self.headers[key] = [] } self.headers[key].push(matches[2]) } else if (self.headers[key] !== undefined) { self.headers[key] += ', ' + matches[2] } else { self.headers[key] = matches[2] } self.rawHeaders.push(matches[1], matches[2]) } }) self._charset = 'x-user-defined' if (!capability.overrideMimeType) { var mimeType = self.rawHeaders['mime-type'] if (mimeType) { var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/) if (charsetMatch) { self._charset = charsetMatch[1].toLowerCase() } } if (!self._charset) self._charset = 'utf-8' // best guess } } } inherits(IncomingMessage, stream.Readable) IncomingMessage.prototype._read = function () { var self = this var resolve = self._resumeFetch if (resolve) { self._resumeFetch = null resolve() } } IncomingMessage.prototype._onXHRProgress = function () { var self = this var xhr = self._xhr var response = null switch (self._mode) { case 'text': response = xhr.responseText if (response.length > self._pos) { var newData = response.substr(self._pos) if (self._charset === 'x-user-defined') { var buffer = Buffer.alloc(newData.length) for (var i = 0; i < newData.length; i++) buffer[i] = newData.charCodeAt(i) & 0xff self.push(buffer) } else { self.push(newData, self._charset) } self._pos = response.length } break case 'arraybuffer': if (xhr.readyState !== rStates.DONE || !xhr.response) break response = xhr.response self.push(Buffer.from(new Uint8Array(response))) break case 'moz-chunked-arraybuffer': // take whole response = xhr.response if (xhr.readyState !== rStates.LOADING || !response) break self.push(Buffer.from(new Uint8Array(response))) break case 'ms-stream': response = xhr.response if (xhr.readyState !== rStates.LOADING) break var reader = new global.MSStreamReader() reader.onprogress = function () { if (reader.result.byteLength > self._pos) { self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos)))) self._pos = reader.result.byteLength } } reader.onload = function () { self.push(null) } // reader.onerror = ??? // TODO: this reader.readAsArrayBuffer(response) break } // The ms-stream case handles end separately in reader.onload() if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { self.push(null) } }
{ "pile_set_name": "Github" }
{ "translations": { "Phone Sync" : "Sincronizar o teléfono", "An app to sync SMS with your cloud" : "Unha aplicación para sincronizar os SMS coa súa nube", "Cancel" : "Cancelar", "Confirm" : "Confirmar", "No contact found." : "Non se atopaou ningún contacto.", "Settings" : "Axustes", "Max messages to load per conversation" : "Máximo de mensaxes a cargar por conversa", "Invalid message limit" : "Límite incorrecto de mensaxes", "Default country code" : "Orde predeterminado de país", "Contact ordering" : "Ordenación de contactos", "Last message" : "Última mensaxe", "Label" : "Etiqueta", "Reverse ?" : "Inverter?", "Notification settings" : "Axustes de notificación", "Enable" : "Activar", "Disable" : "Desactivar", "Are you sure you want to wipe all your messages ?" : "Confirma que quere limpar todas as súas mensaxes?", "Reset all messages" : "Restabelecer todas as mensaxes", "%s messages shown of %s messages stored in database." : "%s mensaxes amosadas de %s mensaxes almacenadas na base de datos.", "Please select a conversation from the list to load it." : "Seleccione unha conversa da lista para cargala." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
{ "pile_set_name": "Github" }
<div class="intro"> <p>This example is the same as the "Drag Delegation with Drop Target" example except we add some plugins.</p> </div> <div class="example"> {{>delegate-plugins-source}} </div> <h3>Adding Plugins to a Delegate instance</h3> <p>`DD.Delegate` provides a reference to the `dd` instance so you can plug into the underlying `dd` with `del.dd.plug()`. This allows you to use DD plugins on a Delegate instance, as well as provides the ability to write plugins for Delegate itself. </p> <h3>Constrain Plugin</h3> <p>Here is how you would add the constrain plugin to a `DD.Delegate` instance.</p> ``` YUI().use('dd-delegate', 'dd-constrain', function(Y) { var del = new Y.DD.Delegate({ container: '#demo', nodes: 'li' }); del.dd.plug(Y.Plugin.DDConstrained, { constrain2node: '#play' }); }); ``` <h3>DDProxy Plugin</h3> <p>Here is how you would add the dd-proxy plugin to a `DD.Delegate` instance.</p> ``` YUI().use('dd-delegate', 'dd-proxy', function(Y) { var del = new Y.DD.Delegate({ container: '#demo', nodes: 'li' }); del.dd.plug(Y.Plugin.DDProxy, { moveOnEnd: false, cloneNode: true }); }); ``` <h3>Full Example Source</h3> <h4>HTML</h4> ``` {{>delegate-plugins-source-html}} ``` <h4>CSS</h4> ``` {{>delegate-plugins-source-css}} ``` <h4>Javascript</h4> ``` {{>delegate-plugins-source-js}} ```
{ "pile_set_name": "Github" }
package com.taobao.yugong.extractor; import lombok.Getter; import lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.taobao.yugong.common.lifecycle.AbstractYuGongLifeCycle; import com.taobao.yugong.common.model.ExtractStatus; import com.taobao.yugong.common.stats.ProgressTracer; /** * @author agapple 2014年2月25日 下午11:38:06 * @since 1.0.0 */ public abstract class AbstractRecordExtractor extends AbstractYuGongLifeCycle implements RecordExtractor { protected final Logger logger = LoggerFactory.getLogger(this.getClass()); @Getter @Setter protected volatile ExtractStatus status = ExtractStatus.NORMAL; public ExtractStatus status() { return status; } @Getter @Setter protected volatile ProgressTracer tracer; }
{ "pile_set_name": "Github" }
FROM nodesource/fedora20-base MAINTAINER William Blankenship <[email protected]> RUN curl -sL -o ns.rpm https://rpm.nodesource.com/pub_0.12/fc/20/x86_64/nodejs-0.12.6-1nodesource.fc20.x86_64.rpm \ && rpm -i --nosignature --force ns.rpm \ && rm -f ns.rpm RUN npm install -g pangyp\ && ln -s $(which pangyp) $(dirname $(which pangyp))/node-gyp\ && npm cache clear\ && node-gyp configure || echo "" ENV NODE_ENV production WORKDIR /usr/src/app CMD ["npm","start"]
{ "pile_set_name": "Github" }
//! A CRDT that stores a collection of distinct elements. use Error; use dot::{Dot, SiteId, Counter, Summary}; use map_tuple_vec; use serde::ser::Serialize; use serde::de::DeserializeOwned; use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::hash::Hash; pub trait SetElement: Clone + Eq + Hash + Serialize + DeserializeOwned {} impl<T: Clone + Eq + Hash + Serialize + DeserializeOwned> SetElement for T {} /// A Set is a `HashSet`-like collection of distinct elements. /// As with `HashSet`, `Set` requires that the elements implement /// the `Eq` and `Hash` traits. To allow for CRDT replication, they /// must also implement the `Clone`, `Serialize`, and `Deserialize` /// traits. /// /// Internally, Set is a variant of OR-Set. It allows op-based replication /// via [`execute_op`](#method.execute_op) and state-based replication /// via [`merge`](#method.merge). State-based replication allows /// out-of-order delivery but op-based replication does not. /// /// `Set` has a spatial complexity of *O(N + S)*, where /// *N* is the number of values concurrently held in the `Set` and /// *S* is the number of sites that have inserted values into the `Set`. /// It has the following performance characteristics: /// /// * [`insert`](#method.insert): *O(1)* /// * [`remove`](#method.remove): *O(1)* /// * [`contains`](#method.contains): *O(1)* /// * [`execute_op`](#method.execute_op): *O(1)* /// * [`merge`](#method.merge): *O(N1 + N2 + S1 + S2)*, where *N1* and /// *N2* are the number of values in the sets being merged, /// and *S1* and *S2* are the number of sites that have edited sets /// being merged. /// #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(bound(deserialize = ""))] pub struct Set<T: SetElement> { inner: Inner<T>, summary: Summary, site_id: SiteId, cached_ops: Vec<Op<T>>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(bound(deserialize = ""))] pub struct SetState<'a, T: SetElement + 'a>{ inner: Cow<'a, Inner<T>>, summary: Cow<'a, Summary>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub(crate) struct Inner<T: SetElement>(#[serde(with = "map_tuple_vec")] pub HashMap<T, Vec<Dot>>); #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Op<T> { value: T, inserted_dot: Option<Dot>, removed_dots: Vec<Dot>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub enum LocalOp<T> { Insert(T), Remove(T), } impl<T: SetElement> Set<T> { /// Constructs and returns a new set CRDT. /// The set has site 1 and counter 0. pub fn new() -> Self { let inner = Inner::new(); let summary = Summary::default(); let site_id = 1; Set{inner, summary, site_id, cached_ops: vec![]} } /// Returns true iff the set contains the value. pub fn contains(&self, value: &T) -> bool { self.inner.contains(value) } /// Inserts a value into the set and returns a remote op /// that can be sent to remote sites for replication. /// If the set does not have a site allocated, it caches /// the op and returns an `AwaitingSite` error. pub fn insert(&mut self, value: T) -> Result<Op<T>, Error> { let counter = self.summary.increment(self.site_id); let op = self.inner.insert(value, self.site_id, counter); self.after_op(op) } /// Removes a value from the set and returns a remote op /// that can be sent to remote sites for replication. /// If the set does not have a site allocated, it caches /// the op and returns an `AwaitingSite` error. pub fn remove(&mut self, value: &T) -> Option<Result<Op<T>, Error>> { let op = self.inner.remove(value)?; Some(self.after_op(op)) } crdt_impl2! { Set, SetState<T>, SetState<'static, T>, SetState, Inner<T>, Op<T>, Option<LocalOp<T>>, HashSet<T>, } } impl<T: SetElement> Inner<T> { fn new() -> Self { Inner(HashMap::new()) } fn contains(&self, value: &T) -> bool { self.0.contains_key(value) } fn insert(&mut self, value: T, site_id: SiteId, counter: Counter) -> Op<T> { let inserted_dot = Dot{site_id, counter}; let removed_dots = self.0.insert(value.clone(), vec![inserted_dot]).unwrap_or(vec![]); Op{value, inserted_dot: Some(inserted_dot), removed_dots} } fn remove(&mut self, value: &T) -> Option<Op<T>> { let removed_dots = self.0.remove(value)?; Some(Op{value: value.clone(), inserted_dot: None, removed_dots}) } fn execute_op(&mut self, op: Op<T>) -> Option<LocalOp<T>> { let mut dots = self.0.remove(&op.value).unwrap_or_else(|| vec![]); let exists_before = !dots.is_empty(); dots.retain(|r| !op.removed_dots.contains(r)); if let Some(new_dot) = op.inserted_dot { if let Err(idx) = dots.binary_search_by(|r| r.cmp(&new_dot)) { dots.insert(idx, new_dot); } } let exists_after = !dots.is_empty(); if exists_before && exists_after { self.0.insert(op.value, dots); None } else if exists_after { self.0.insert(op.value.clone(), dots); Some(LocalOp::Insert(op.value)) } else if exists_before { Some(LocalOp::Remove(op.value)) } else { None } } fn merge(&mut self, other: Inner<T>, summary: &Summary, other_summary: &Summary) { let mut other_elements = other.0; // retain an element in self iff: // - the element is in in both self and other, OR // - the element has not been inserted into other self.0.retain(|value, dots| { let mut other_dots = other_elements.remove(value).unwrap_or_else(|| vec![]); dots.retain(|r| other_dots.contains(r) || !other_summary.contains(r)); other_dots.retain(|r| !dots.contains(r) && !summary.contains(r)); dots.append(&mut other_dots); dots.sort(); !dots.is_empty() }); // insert any element that is in other but not yet inserted into self for (value, mut dots) in other_elements.to_owned() { dots.retain(|r| !summary.contains(r)); if !dots.is_empty() { self.0.insert(value, dots); } } } fn add_site_id(&mut self, site_id: SiteId) { for dots in self.0.values_mut() { for dot in dots { if dot.site_id == 0 { dot.site_id = site_id }; } } } fn validate_no_unassigned_sites(&self) -> Result<(), Error> { for dots in self.0.values() { for dot in dots { if dot.site_id == 0 { return Err(Error::InvalidSiteId); } } } Ok(()) } fn local_value(&self) -> HashSet<T> { self.0.keys().cloned().collect() } } impl<T: SetElement> Op<T> { /// Returns the `Op`'s value. pub fn value(&self) -> &T { &self.value } /// Returns a reference to the `Op`'s inserted dot. pub fn inserted_dot(&self) -> Option<Dot> { self.inserted_dot } /// Returns a reference to the `Op`'s removed dots. pub fn removed_dots(&self) -> &[Dot] { &self.removed_dots } /// Assigns a site id to any unassigned inserts and removes pub fn add_site_id(&mut self, site_id: SiteId) { if let Some(ref mut r) = self.inserted_dot { if r.site_id == 0 { r.site_id = site_id }; } for r in &mut self.removed_dots { if r.site_id == 0 { r.site_id = site_id }; } } /// Validates that the `Op`'s site id is equal to the given site id. pub fn validate(&self, site_id: SiteId) -> Result<(), Error> { if let Some(ref r) = self.inserted_dot { if r.site_id != site_id { return Err(Error::InvalidOp) }; } Ok(()) } pub(crate) fn inserted_dots(&self) -> Vec<Dot> { if let Some(dot) = self.inserted_dot { vec![dot] } else { vec![] } } }
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package generators import ( "bytes" "fmt" "io" "path/filepath" "reflect" "sort" "strings" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" openapi "k8s.io/kube-openapi/pkg/common" "k8s.io/klog" ) // This is the comment tag that carries parameters for open API generation. const tagName = "k8s:openapi-gen" const tagOptional = "optional" // Known values for the tag. const ( tagValueTrue = "true" tagValueFalse = "false" ) // Used for temporary validation of patch struct tags. // TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. var tempPatchTags = [...]string{ "patchMergeKey", "patchStrategy", } func getOpenAPITagValue(comments []string) []string { return types.ExtractCommentTags("+", comments)[tagName] } func getSingleTagsValue(comments []string, tag string) (string, error) { tags, ok := types.ExtractCommentTags("+", comments)[tag] if !ok || len(tags) == 0 { return "", nil } if len(tags) > 1 { return "", fmt.Errorf("multiple values are not allowed for tag %s", tag) } return tags[0], nil } func hasOpenAPITagValue(comments []string, value string) bool { tagValues := getOpenAPITagValue(comments) for _, val := range tagValues { if val == value { return true } } return false } // hasOptionalTag returns true if the member has +optional in its comments or // omitempty in its json tags. func hasOptionalTag(m *types.Member) bool { hasOptionalCommentTag := types.ExtractCommentTags( "+", m.CommentLines)[tagOptional] != nil hasOptionalJsonTag := strings.Contains( reflect.StructTag(m.Tags).Get("json"), "omitempty") return hasOptionalCommentTag || hasOptionalJsonTag } func apiTypeFilterFunc(c *generator.Context, t *types.Type) bool { // There is a conflict between this codegen and codecgen, we should avoid types generated for codecgen if strings.HasPrefix(t.Name.Name, "codecSelfer") { return false } pkg := c.Universe.Package(t.Name.Package) if hasOpenAPITagValue(pkg.Comments, tagValueTrue) { return !hasOpenAPITagValue(t.CommentLines, tagValueFalse) } if hasOpenAPITagValue(t.CommentLines, tagValueTrue) { return true } return false } const ( specPackagePath = "github.com/go-openapi/spec" openAPICommonPackagePath = "k8s.io/kube-openapi/pkg/common" ) // openApiGen produces a file with auto-generated OpenAPI functions. type openAPIGen struct { generator.DefaultGen // TargetPackage is the package that will get GetOpenAPIDefinitions function returns all open API definitions. targetPackage string imports namer.ImportTracker } func newOpenAPIGen(sanitizedName string, targetPackage string) generator.Generator { return &openAPIGen{ DefaultGen: generator.DefaultGen{ OptionalName: sanitizedName, }, imports: generator.NewImportTracker(), targetPackage: targetPackage, } } const nameTmpl = "schema_$.type|private$" func (g *openAPIGen) Namers(c *generator.Context) namer.NameSystems { // Have the raw namer for this file track what it imports. return namer.NameSystems{ "raw": namer.NewRawNamer(g.targetPackage, g.imports), "private": &namer.NameStrategy{ Join: func(pre string, in []string, post string) string { return strings.Join(in, "_") }, PrependPackageNames: 4, // enough to fully qualify from k8s.io/api/... }, } } func (g *openAPIGen) isOtherPackage(pkg string) bool { if pkg == g.targetPackage { return false } if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { return false } return true } func (g *openAPIGen) Imports(c *generator.Context) []string { importLines := []string{} for _, singleImport := range g.imports.ImportLines() { importLines = append(importLines, singleImport) } return importLines } func argsFromType(t *types.Type) generator.Args { return generator.Args{ "type": t, "ReferenceCallback": types.Ref(openAPICommonPackagePath, "ReferenceCallback"), "OpenAPIDefinition": types.Ref(openAPICommonPackagePath, "OpenAPIDefinition"), "SpecSchemaType": types.Ref(specPackagePath, "Schema"), } } func (g *openAPIGen) Init(c *generator.Context, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "$", "$") sw.Do("func GetOpenAPIDefinitions(ref $.ReferenceCallback|raw$) map[string]$.OpenAPIDefinition|raw$ {\n", argsFromType(nil)) sw.Do("return map[string]$.OpenAPIDefinition|raw${\n", argsFromType(nil)) for _, t := range c.Order { err := newOpenAPITypeWriter(sw, c).generateCall(t) if err != nil { return err } } sw.Do("}\n", nil) sw.Do("}\n\n", nil) return sw.Error() } func (g *openAPIGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { klog.V(5).Infof("generating for type %v", t) sw := generator.NewSnippetWriter(w, c, "$", "$") err := newOpenAPITypeWriter(sw, c).generate(t) if err != nil { return err } return sw.Error() } func getJsonTags(m *types.Member) []string { jsonTag := reflect.StructTag(m.Tags).Get("json") if jsonTag == "" { return []string{} } return strings.Split(jsonTag, ",") } func getReferableName(m *types.Member) string { jsonTags := getJsonTags(m) if len(jsonTags) > 0 { if jsonTags[0] == "-" { return "" } else { return jsonTags[0] } } else { return m.Name } } func shouldInlineMembers(m *types.Member) bool { jsonTags := getJsonTags(m) return len(jsonTags) > 1 && jsonTags[1] == "inline" } type openAPITypeWriter struct { *generator.SnippetWriter context *generator.Context refTypes map[string]*types.Type GetDefinitionInterface *types.Type } func newOpenAPITypeWriter(sw *generator.SnippetWriter, c *generator.Context) openAPITypeWriter { return openAPITypeWriter{ SnippetWriter: sw, context: c, refTypes: map[string]*types.Type{}, } } func methodReturnsValue(mt *types.Type, pkg, name string) bool { if len(mt.Signature.Parameters) != 0 || len(mt.Signature.Results) != 1 { return false } r := mt.Signature.Results[0] return r.Name.Name == name && r.Name.Package == pkg } func hasOpenAPIV3DefinitionMethod(t *types.Type) bool { for mn, mt := range t.Methods { if mn != "OpenAPIV3Definition" { continue } return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") } return false } func hasOpenAPIDefinitionMethod(t *types.Type) bool { for mn, mt := range t.Methods { if mn != "OpenAPIDefinition" { continue } return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") } return false } func hasOpenAPIDefinitionMethods(t *types.Type) bool { var hasSchemaTypeMethod, hasOpenAPISchemaFormat bool for mn, mt := range t.Methods { switch mn { case "OpenAPISchemaType": hasSchemaTypeMethod = methodReturnsValue(mt, "", "[]string") case "OpenAPISchemaFormat": hasOpenAPISchemaFormat = methodReturnsValue(mt, "", "string") } } return hasSchemaTypeMethod && hasOpenAPISchemaFormat } // typeShortName returns short package name (e.g. the name x appears in package x definition) dot type name. func typeShortName(t *types.Type) string { return filepath.Base(t.Name.Package) + "." + t.Name.Name } func (g openAPITypeWriter) generateMembers(t *types.Type, required []string) ([]string, error) { var err error for _, m := range t.Members { if hasOpenAPITagValue(m.CommentLines, tagValueFalse) { continue } if shouldInlineMembers(&m) { required, err = g.generateMembers(m.Type, required) if err != nil { return required, err } continue } name := getReferableName(&m) if name == "" { continue } if !hasOptionalTag(&m) { required = append(required, name) } if err = g.generateProperty(&m, t); err != nil { klog.Errorf("Error when generating: %v, %v\n", name, m) return required, err } } return required, nil } func (g openAPITypeWriter) generateCall(t *types.Type) error { // Only generate for struct type and ignore the rest switch t.Kind { case types.Struct: args := argsFromType(t) g.Do("\"$.$\": ", t.Name) hasV2Definition := hasOpenAPIDefinitionMethod(t) hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) hasV3Definition := hasOpenAPIV3DefinitionMethod(t) switch { case hasV2DefinitionTypeAndFormat: g.Do(nameTmpl+"(ref),\n", args) case hasV2Definition && hasV3Definition: g.Do("common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.type|raw${}.OpenAPIDefinition()),\n", args) case hasV2Definition: g.Do("$.type|raw${}.OpenAPIDefinition(),\n", args) case hasV3Definition: g.Do("$.type|raw${}.OpenAPIV3Definition(),\n", args) default: g.Do(nameTmpl+"(ref),\n", args) } } return g.Error() } func (g openAPITypeWriter) generate(t *types.Type) error { // Only generate for struct type and ignore the rest switch t.Kind { case types.Struct: hasV2Definition := hasOpenAPIDefinitionMethod(t) hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) hasV3Definition := hasOpenAPIV3DefinitionMethod(t) if hasV2Definition || (hasV3Definition && !hasV2DefinitionTypeAndFormat) { // already invoked directly return nil } args := argsFromType(t) g.Do("func "+nameTmpl+"(ref $.ReferenceCallback|raw$) $.OpenAPIDefinition|raw$ {\n", args) switch { case hasV2DefinitionTypeAndFormat && hasV3Definition: g.Do("return common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.OpenAPIDefinition|raw${\n"+ "Schema: spec.Schema{\n"+ "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ "},\n"+ "},\n"+ "})\n}\n\n", args) return nil case hasV2DefinitionTypeAndFormat: g.Do("return $.OpenAPIDefinition|raw${\n"+ "Schema: spec.Schema{\n"+ "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ "},\n"+ "},\n"+ "}\n}\n\n", args) return nil } g.Do("return $.OpenAPIDefinition|raw${\nSchema: spec.Schema{\nSchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type: []string{\"object\"},\n", nil) // write members into a temporary buffer, in order to postpone writing out the Properties field. We only do // that if it is not empty. propertiesBuf := bytes.Buffer{} bsw := g bsw.SnippetWriter = generator.NewSnippetWriter(&propertiesBuf, g.context, "$", "$") required, err := bsw.generateMembers(t, []string{}) if err != nil { return err } if propertiesBuf.Len() > 0 { g.Do("Properties: map[string]$.SpecSchemaType|raw${\n", args) g.Do(strings.Replace(propertiesBuf.String(), "$", "$\"$\"$", -1), nil) // escape $ (used as delimiter of the templates) g.Do("},\n", nil) } if len(required) > 0 { g.Do("Required: []string{\"$.$\"},\n", strings.Join(required, "\",\"")) } g.Do("},\n", nil) if err := g.generateStructExtensions(t); err != nil { return err } g.Do("},\n", nil) // Map order is undefined, sort them or we may get a different file generated each time. keys := []string{} for k := range g.refTypes { keys = append(keys, k) } sort.Strings(keys) deps := []string{} for _, k := range keys { v := g.refTypes[k] if t, _ := openapi.GetOpenAPITypeFormat(v.String()); t != "" { // This is a known type, we do not need a reference to it // Will eliminate special case of time.Time continue } deps = append(deps, k) } if len(deps) > 0 { g.Do("Dependencies: []string{\n", args) for _, k := range deps { g.Do("\"$.$\",", k) } g.Do("},\n", nil) } g.Do("}\n}\n\n", nil) } return nil } func (g openAPITypeWriter) generateStructExtensions(t *types.Type) error { extensions, errors := parseExtensions(t.CommentLines) // Initially, we will only log struct extension errors. if len(errors) > 0 { for _, e := range errors { klog.Errorf("[%s]: %s\n", t.String(), e) } } unions, errors := parseUnions(t) if len(errors) > 0 { for _, e := range errors { klog.Errorf("[%s]: %s\n", t.String(), e) } } // TODO(seans3): Validate struct extensions here. g.emitExtensions(extensions, unions) return nil } func (g openAPITypeWriter) generateMemberExtensions(m *types.Member, parent *types.Type) error { extensions, parseErrors := parseExtensions(m.CommentLines) validationErrors := validateMemberExtensions(extensions, m) errors := append(parseErrors, validationErrors...) // Initially, we will only log member extension errors. if len(errors) > 0 { errorPrefix := fmt.Sprintf("[%s] %s:", parent.String(), m.String()) for _, e := range errors { klog.V(2).Infof("%s %s\n", errorPrefix, e) } } g.emitExtensions(extensions, nil) return nil } func (g openAPITypeWriter) emitExtensions(extensions []extension, unions []union) { // If any extensions exist, then emit code to create them. if len(extensions) == 0 && len(unions) == 0 { return } g.Do("VendorExtensible: spec.VendorExtensible{\nExtensions: spec.Extensions{\n", nil) for _, extension := range extensions { g.Do("\"$.$\": ", extension.xName) if extension.hasMultipleValues() { g.Do("[]interface{}{\n", nil) } for _, value := range extension.values { g.Do("\"$.$\",\n", value) } if extension.hasMultipleValues() { g.Do("},\n", nil) } } if len(unions) > 0 { g.Do("\"x-kubernetes-unions\": []interface{}{\n", nil) for _, u := range unions { u.emit(g) } g.Do("},\n", nil) } g.Do("},\n},\n", nil) } // TODO(#44005): Move this validation outside of this generator (probably to policy verifier) func (g openAPITypeWriter) validatePatchTags(m *types.Member, parent *types.Type) error { // TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. for _, tagKey := range tempPatchTags { structTagValue := reflect.StructTag(m.Tags).Get(tagKey) commentTagValue, err := getSingleTagsValue(m.CommentLines, tagKey) if err != nil { return err } if structTagValue != commentTagValue { return fmt.Errorf("Tags in comment and struct should match for member (%s) of (%s)", m.Name, parent.Name.String()) } } return nil } func (g openAPITypeWriter) generateDescription(CommentLines []string) { var buffer bytes.Buffer delPrevChar := func() { if buffer.Len() > 0 { buffer.Truncate(buffer.Len() - 1) // Delete the last " " or "\n" } } for _, line := range CommentLines { // Ignore all lines after --- if line == "---" { break } line = strings.TrimRight(line, " ") leading := strings.TrimLeft(line, " ") switch { case len(line) == 0: // Keep paragraphs delPrevChar() buffer.WriteString("\n\n") case strings.HasPrefix(leading, "TODO"): // Ignore one line TODOs case strings.HasPrefix(leading, "+"): // Ignore instructions to go2idl default: if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") { delPrevChar() line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..." } else { line += " " } buffer.WriteString(line) } } postDoc := strings.TrimRight(buffer.String(), "\n") postDoc = strings.Replace(postDoc, "\\\"", "\"", -1) // replace user's \" to " postDoc = strings.Replace(postDoc, "\"", "\\\"", -1) // Escape " postDoc = strings.Replace(postDoc, "\n", "\\n", -1) postDoc = strings.Replace(postDoc, "\t", "\\t", -1) postDoc = strings.Trim(postDoc, " ") if postDoc != "" { g.Do("Description: \"$.$\",\n", postDoc) } } func (g openAPITypeWriter) generateProperty(m *types.Member, parent *types.Type) error { name := getReferableName(m) if name == "" { return nil } if err := g.validatePatchTags(m, parent); err != nil { return err } g.Do("\"$.$\": {\n", name) if err := g.generateMemberExtensions(m, parent); err != nil { return err } g.Do("SchemaProps: spec.SchemaProps{\n", nil) g.generateDescription(m.CommentLines) jsonTags := getJsonTags(m) if len(jsonTags) > 1 && jsonTags[1] == "string" { g.generateSimpleProperty("string", "") g.Do("},\n},\n", nil) return nil } t := resolveAliasAndPtrType(m.Type) // If we can get a openAPI type and format for this type, we consider it to be simple property typeString, format := openapi.GetOpenAPITypeFormat(t.String()) if typeString != "" { g.generateSimpleProperty(typeString, format) g.Do("},\n},\n", nil) return nil } switch t.Kind { case types.Builtin: return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", t) case types.Map: if err := g.generateMapProperty(t); err != nil { return err } case types.Slice, types.Array: if err := g.generateSliceProperty(t); err != nil { return err } case types.Struct, types.Interface: g.generateReferenceProperty(t) default: return fmt.Errorf("cannot generate spec for type %v", t) } g.Do("},\n},\n", nil) return g.Error() } func (g openAPITypeWriter) generateSimpleProperty(typeString, format string) { g.Do("Type: []string{\"$.$\"},\n", typeString) g.Do("Format: \"$.$\",\n", format) } func (g openAPITypeWriter) generateReferenceProperty(t *types.Type) { g.refTypes[t.Name.String()] = t g.Do("Ref: ref(\"$.$\"),\n", t.Name.String()) } func resolveAliasAndPtrType(t *types.Type) *types.Type { var prev *types.Type for prev != t { prev = t if t.Kind == types.Alias { t = t.Underlying } if t.Kind == types.Pointer { t = t.Elem } } return t } func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { keyType := resolveAliasAndPtrType(t.Key) elemType := resolveAliasAndPtrType(t.Elem) // According to OpenAPI examples, only map from string is supported if keyType.Name.Name != "string" { return fmt.Errorf("map with non-string keys are not supported by OpenAPI in %v", t) } g.Do("Type: []string{\"object\"},\n", nil) g.Do("AdditionalProperties: &spec.SchemaOrBool{\nAllows: true,\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) typeString, format := openapi.GetOpenAPITypeFormat(elemType.String()) if typeString != "" { g.generateSimpleProperty(typeString, format) g.Do("},\n},\n},\n", nil) return nil } switch elemType.Kind { case types.Builtin: return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) case types.Struct: g.generateReferenceProperty(elemType) case types.Slice, types.Array: g.generateSliceProperty(elemType) default: return fmt.Errorf("map Element kind %v is not supported in %v", elemType.Kind, t.Name) } g.Do("},\n},\n},\n", nil) return nil } func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { elemType := resolveAliasAndPtrType(t.Elem) g.Do("Type: []string{\"array\"},\n", nil) g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) typeString, format := openapi.GetOpenAPITypeFormat(elemType.String()) if typeString != "" { g.generateSimpleProperty(typeString, format) g.Do("},\n},\n},\n", nil) return nil } switch elemType.Kind { case types.Builtin: return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) case types.Struct: g.generateReferenceProperty(elemType) case types.Slice, types.Array: g.generateSliceProperty(elemType) default: return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t) } g.Do("},\n},\n},\n", nil) return nil }
{ "pile_set_name": "Github" }
import * as React from 'react'; export class ClassNamed extends React.Component { render() { return <h1>Named Export Class</h1>; } }
{ "pile_set_name": "Github" }
<html> <head> <title>SockJS example</title> <script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script> </head> <body> <script> var sock = new SockJS("/socks"); sock.onmessage = function(msg) { document.getElementById('out').value = msg.data; }; function send() { var msg = document.getElementById('in').value; sock.send(msg); } </script> <p> Entering a value in the left-hand box below and submitting the form sends the value to the server, which will helpfully uppercase it before sending it back to be shown in the right-hand box. </p> <form onsubmit="send(); return false;"> <input id="in" type="text"/> <input type="submit" value="Send"/> <input id="out" type="text" disabled="true"/> </form> </body> </html>
{ "pile_set_name": "Github" }
**Are you the copyright owner or authorized to act on the copyright owner's behalf?** I am the creator and owner. **Please provide a detailed description of the original copyrighted work that has allegedly been infringed. If possible, include a URL to where it is posted online.** Image is full size "Back" side of my Purple Space Nebula Skybox image. http://u3d.as/ack **What files should be taken down? Please provide URLs for each file, or if the entire repository, the repository's URL:** https://github.com/dirty-casuals/Bloom/blob/master/Assets/Textures/Skybox/Back_MauveSpaceBox.png **Have you searched for any forks of the allegedly infringing files or repositories? Each fork is a distinct repository and must be identified separately if you believe it is infringing and wish to have it taken down.** No **Is the work licensed under an open source license? If so, which open source license? Are the allegedly infringing files being used under the open source license, or are they in violation of the license?** No it is a Unity Asset Store item **What would be the best solution for the alleged infringement? Are there specific changes the other person can make other than removal?** **Do you have the alleged infringer's contact information? If so, please provide it:** No **Type (or copy and paste) the following statement: "I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law. I have taken fair use into consideration."** I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law. I have taken fair use into consideration. **Type (or copy and paste) the following statement: "I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed."** I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed. **Please confirm that you have you have read our Guide to Submitting a DMCA Takedown Notice: https://help.github.com/articles/guide-to-submitting-a-dmca-takedown-notice/** So confirmed **So that we can get back to you, please provide either your telephone number or physical address:** TL Multimedia Limited [private] **Please type your full legal name below to sign this request:** [private]
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Windows.Forms; namespace CSharpGL { partial class FormIListEditor<T> : Form { private ITypeDescriptorContext context; private IServiceProvider provider; private IList<T> list; public FormIListEditor(ITypeDescriptorContext context, IServiceProvider provider, IList<T> list) { InitializeComponent(); this.lblSelectedType.Text = string.Empty; this.context = context; this.provider = provider; if (list != null) { foreach (T item in list) { this.lstMember.Items.Add(item); } this.list = list; this.Text = string.Format("{0} List Editor", typeof(T).Name); } } private void btnAdd_Click(object sender, EventArgs e) { var frmSelectType = new FormSelectType(typeof(T)); if (frmSelectType.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Type type = frmSelectType.SelectedType; try { var obj = (T)Activator.CreateInstance(type); this.lstMember.Items.Add(obj); this.list.Add(obj); this.propertyGrid.SelectedObject = obj; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.Message, string.Format("Error when Adding instance of [{0}]!", type.Name)); } } } private void btnRemove_Click(object sender, EventArgs e) { int index = this.lstMember.SelectedIndex; if (0 <= index) { this.lstMember.Items.RemoveAt(index); this.list.RemoveAt(index); } } private void btnCancel_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; } private void lstMember_SelectedIndexChanged(object sender, EventArgs e) { object obj = this.lstMember.SelectedItem; this.propertyGrid.SelectedObject = obj; if (obj != null) { this.lblSelectedType.Text = string.Format("{0}", obj.GetType()); } else { this.lblSelectedType.Text = string.Format("NULL"); } } private void btnMoveUp_Click(object sender, EventArgs e) { int index = this.lstMember.SelectedIndex; if (0 < index) { object item = this.lstMember.Items[index]; this.lstMember.Items.RemoveAt(index); T obj = this.list[index]; this.list.RemoveAt(index); this.lstMember.Items.Insert(index - 1, item); this.list.Insert(index - 1, obj); this.lstMember.SelectedIndex = index - 1; } } private void btnMoveDown_Click(object sender, EventArgs e) { int index = this.lstMember.SelectedIndex; if (0 <= index && index + 1 < this.lstMember.Items.Count) { object item = this.lstMember.Items[index]; this.lstMember.Items.RemoveAt(index); T obj = this.list[index]; this.list.RemoveAt(index); this.lstMember.Items.Insert(index + 1, item); this.list.Insert(index + 1, obj); this.lstMember.SelectedIndex = index + 1; } } } }
{ "pile_set_name": "Github" }
#include "script_component.hpp" /* * Author: SzwedzikPL * Check dogtag self menu action. * * Arguments: * 0: Player <OBJECT> * 1: Target <OBJECT> * 2: Item class <STRING> * * Return Value: * None * * Example: * [player, unit, "itemClass"] call ace_dogtags_fnc_checkDogtagItem * * Public: No */ params ["_player", "_target", "_item"]; [QGVAR(sendDogtagData), [_player, _item]] call CBA_fnc_serverEvent;
{ "pile_set_name": "Github" }
{ "btnReadmePrompt": "Посмотреть Readme", "cardGreetingText": "Добро пожаловать в Flex TV!", "cardReadmeButton": "Посмотреть Readme", "cardReadmeTitle": "Добро пожаловать!", "commandSynonymsArray": { "play": [ "продолжить" ], "skip": [ "Прыгать", "идти" ], "step": [ "искать" ], "forward": [ "впереди" ], "back": [ "назад" ], "seekBack": [ "перемотка" ], "seek": [ "быстро" ], "skipNext": [ "пропустить вперед" ], "skipPrevious": [ "пропустить назад" ], "stepForward": [ "перемотка вперед", "искать вперед" ], "stepBack": [ "искать назад" ], "volume up": [ "увеличить громкость" ], "volume down": [ "убавить звук" ] }, "errorHelpSuggestionsArray": [ "Ниже приведены некоторые советы, которые вы можете попробовать.", "Вот несколько возможных команд.", "Конечно, почему бы вам не попробовать один из них?" ], "errorHelpCommandsArray": [ "Что на палубе?", "Какие новые фильмы у меня есть?", "Приостановить воспроизведение.", "Играйте в Batman Begins." ], "fetchSynonymsArray": { "season": [ "время года" ], "episode": [ "эпизод" ], "movie": [ "кинофильм" ], "show": [ "показать", "серии" ], "latest": [ "последний", "новый", "новейший", "последний", "последний", "новейший" ] }, "javaStrings": [ "Чем могу помочь?", "Что я могу сделать для вас?", "Ты сказал:", "Мой ответ:", "повторное сканирование устройств" ], "parseStripArray": [ "из", "", "", "", "в", "го", "й", "в", "из", "&#39;", "s", "а также" ], "parseMediaArray": [ "время года", "серии", "показать", "эпизод", "кино", "фильм", "начало", "отдых", "конец", "минут", "минут", "часов", "час", "секунд", "второй" ], "parseFilterArray": [ "жанр", "год", "актер", "директор", "направленный", "в главной роли", "с участием", "с", "сделал", "созданный", "выпущенный", "снят" ], "parseNumberArray": [ "первый", "пилот", "второй", "в третьих", "последний", "окончательный", "последний", "случайный" ], "parsedDvrFailStart": "Добавьте носитель с именем", "parsedDvrSuccessNamed": "названный", "parsedDvrSuccessStart": "Добавить", "speechAiringsAfternoon": "Сегодня днем,", "speechAiringsErrors": [ "У меня нет ничего в списке для", "У вас нет ничего запланированного для" ], "speechAiringsMids": [ "я нашел", "я вижу", "у тебя есть" ], "speechAiringsOn": "На", "speechAiringsReturn": "Вот список запланированных записей:", "speechAiringsToday": "Cегодня", "speechAiringsTomorrow": "Завтра,", "speechAiringsTonight": "Сегодня ночью,", "speechAiringsWeekend": "Эти выходные,", "speechAiringTails": [ "подходящий.", "по графику.", "установленный для записи." ], "speechBy": "от", "speechChangDeviceFailureStart": "Извините, но я не мог найти", "speechChange": "+ Изменить", "speechChangeDeviceFailEnd": "в списке устройств.", "speechChangeDevicePrompt": ", конечно. Какое устройство вы хотели бы использовать?", "speechChangeDeviceSuccessStart": "Хорошо, я переключил", "speechChangeDeviceWarnEnd1": "Foo", "speechChangeDeviceWarnEnd2": "Foo", "speechChangeDeviceWarnStart1": "Foo", "speechChangeDeviceWarnStart2": "Foo", "speechChangeDeviceWarnStart3": "Foo", "speechChangeMind": "Хорошо, дайте мне знать, если вы передумаете.", "speechControlConfirm1": "Отправка команды", "speechControlConfirmGenericArray": [ "Подумайте об этом.", "Хорошо.", "Конечно.", "Ты понял." ], "speechControlConfirmPauseArray": [ "Хорошо, я остановил телевизор для вас.", "Приостановка воспроизведения.", "Теперь Plex должен быть приостановлен." ], "speechControlConfirmPlayArray": [ "Воспроизведение.", "Плекс должен играть.", "Возобновление воспроизведения." ], "speechControlConfirmStopArray": [ "Plex останавливается.", "Теперь Plex должен быть остановлен.", "Остановка." ], "speechControlConfirmSubsOffArray": [ "Отключение субтитров.", "Удаление Вавилонской рыбы.", "Субтитры отключены." ], "speechControlConfirmSubsOnArray": [ "Включение субтитров.", "Привлечение универсального переводчика.", "Субтитры были включены." ], "speechControlArray": [ "Как вы приказываете.", "Сделано и сделано.", "Тогда хорошо.", "Ты понял!", "Вот так." ], "speechControlGeneric1": "Отправка команды", "speechControlGeneric2": "Хорошо, я скажу Plex", "speechControlVolumeDown": "Хорошо, я немного поверну.", "speechControlVolumeSet": "Хорошо, установив громкость", "speechControlVolumeUp": "Хорошо, я немного подниму его.", "speechDeviceListError": "Ошибка в получении списка устройств. Повторите попытку позже.", "speechDeviceListErrorArray": [ "Я хотел бы помочь вам в этом, но я вижу только одно устройство, с которым я могу сейчас разговаривать.", "Извините, у меня есть только одно устройство для выбора.", "К сожалению, у вас есть только одно устройство прямо сейчас, и оно уже выбрано." ], "speechDontUnderstand1": "Мне жаль, но &#39;", "speechDontUnderstand2": "«Кажется, не соответствует тому, что я только что сказал.", "speechDownloadAdded1": "Хорошо, я добавил", "speechDownloadAdded2": "в список выборки.", "speechDownloadErrorArray": [ "Извините, но я не мог найти это ни в одном из ваших поисковиков.", "Это раздражительно. Кажется, я ничего не могу найти.", "К сожалению, я не смог найти что-либо с этим заголовком для загрузки." ], "speechDownloadExistsArray": [ "<html> Это выглядит как <TITLE> уже настроен для загрузки на &lt;\/ html&gt;", "<html><TITLE> уже находится в списке просмотра &lt;\/ html&gt;", "<html> Я уже ищу <TITLE> на &lt;\/ html&gt;" ], "speechDownloadExists1": "Это выглядит как", "speechDownloadExists2": "уже установлен для загрузки.", "speechDvrFailStart": "Я не смог найти никаких результатов в руководстве по эпизодам,", "speechDvrNoDevice": "Извините, но я не нашел примеров использования Plex DVR.", "speechDvrSuccessEnd": "к графику записи.", "speechDvrSuccessStart": "Эй, посмотри на это. Я добавил", "speechEggArray": { "attack the block": "<html> Вы доктор? Воспроизведение <TITLE> . &lt;\/ Html&gt;", "avengers": "<html> Семья собирается! Пришло время смотреть <TITLE> . &lt;\/ Html&gt;", "batman": "<html> Священные пиратские СМИ, Бэтмен! Это <TITLE> . &lt;\/ Html&gt;", "big hero": "<html> Привет, я Baymax, для лечения, я рекомендую смотреть <TITLE> . &lt;\/ Html&gt;", "evil dead": "<html> Приветствуй короля, детка! Давай посмотрим <TITLE> . &lt;\/ Html&gt;", "fifth element": "<html> Leeloo Dallas Mul-ti-Pass! Mul-ти частот. наслаждаться <TITLE> . &lt;\/ Html&gt;", "frozen": "<html> Позвольте этому идти, пусть это идет! Давайте сядем и посмотрим <TITLE> . &lt;\/ Html&gt;", "game of thrones": "<html> Подцепите себя ... <TITLE> играет. &lt;\/ html&gt;", "ghostbusters": "<html> Кого вы позовете? <TITLE> &lt;\/ Html&gt;", "heathers": "<html> Хорошо, заряжайте меня осторожно бензопилой. Или смотреть <TITLE> . &lt;\/ Html&gt;", "iron man": "<html> Да, мистер Старк, включив <TITLE> . &lt;\/ Html&gt;", "space odyssey": "Прости, Дэйв. Боюсь, я не могу этого сделать.", "resident evil": "<html> T-минус 1 минута до заражения. Администрирование <TITLE> . &lt;\/ Html&gt;", "star wars": "<html> Помоги мне, Оби-Ван-Кеноби. <TITLE> моя единственная надежда. &lt;\/ html&gt;", "they live": "<html> Я здесь, чтобы пережевывать пузырь и играть <TITLE> , и я весь из пузыря. &lt;\/ html&gt;", "wall-e": "<html> Благодарим вас за покупки Buy and Large и наслаждайтесь, когда мы начнем <TITLE> . &lt;\/ Html&gt;", "monty python": "<html> Твоя мать была хомяком, а твой отец пахнул койкой. Воспроизведение <TITLE> &lt;\/ Html&gt;", "guide to the end of the universe": "<html> Эй, ты, пьяница. я собираюсь играть <TITLE> для вас. &lt;\/ html&gt;", "rocky horror": "О, Рокки!", "citizen kane": "Rosebud ...", "godfather": "<html> Я собираюсь сделать вам предложение, от которого вы не можете отказаться. я собираюсь играть <TITLE> . &lt;\/ Html&gt;", "with the wind": "Честно говоря, моя дорогая, я не даю iPhone.", "dirty harry": "Давай, ты уже сделал свой день.", "taxi driver": "<html> Ты говоришь со мной? Просто проверяю. Воспроизведение <TITLE> Теперь. &lt;\/ html&gt;", "apocalypse now": "Я люблю запах озона утром.", "e.t.": "<html> Телефон Google домой! Воспроизведение <TITLE> . &lt;\/ Html&gt;", "silence of the lambs": "Этот фильм будет отлично сочетаться с некоторыми фавовыми фасолями и красивыми кьянти.", "jerry maguire": "<html> Покажи мне деньги! И я покажу вам <TITLE> . &lt;\/ Html&gt;", "a few good men": "<html> Вы не можете справиться с правдой. Но, может быть, вы справитесь <TITLE> . &lt;\/ Html&gt;", "jaws": "Тебе понадобится большая лодка.", "a streetcar named": "STELLA !!!!", "super troopers": "<html> Засоряемся и ... Засоряемся и ... Засоряемся и наблюдаем <TITLE> . &lt;\/ Html&gt;" }, "speechGreetingArray": [ "Приветствую!", "Привет!", "Привет, я Flex TV.", "Добро пожаловать на вечеринку!", "Дилли Дилли!" ], "speechGreetingHelpPrompt": [ "Если вам нужен список команд, вы можете сказать «Справка» или «Каковы ваши команды?».", "Вы можете сказать «Помощь» или «Что вы можете сделать», чтобы узнать больше обо мне.", "Попробуйте попросить меня что-нибудь сыграть или сказать «помощь» для получения дополнительных команд." ], "speechHookCustomDefault": "Поздравляем, вы уволили пользовательскую команду webhook!", "speechMoreInfoArray": [ "Вот еще информация об этом.", "Вот что я нашел для этого элемента.", "Я посмотрел на тебя." ], "speechMultiResultArray": [ "Я нашел несколько возможных результатов для этого, был один из них, что вы хотели?", "Было несколько вещей, которые, я думаю, вы могли бы просить, это все?", "Что вы имели в виду?", "У вас есть несколько вещей, которые могут соответствовать этому поиску, являются ли они одним из них?" ], "speechNotUnderstoodArray": [ "Опасность будет Робинсон! Я не понимаю команду &#39;", "Боюсь, я не понимаю, что вы подразумеваете под", "К сожалению, я не мог понять, когда ты сказал:" ], "speechOndeckRecentError": "К сожалению, я не смог найти никаких результатов для этого. Пожалуйста, повторите попытку позже.", "speechNoInfoResultsArray": [ "К сожалению, я не мог найти <VAR>в вашей библиотеке прямо сейчас.<\/var>", "Извините, я проверил, но результатов не получил <VAR>.<\/var>", "Хммм. Кажется, на вашем сервере ничего не указано <VAR>.<\/var>", "Я не нашел ничего подобного <VAR>.<\/var>" ], "speechNoResultsArray": [ "К сожалению, я не смог найти никаких результатов для этого.", "Извините, но я не мог найти ничего для этого поиска.", "Я посмотрел, но я не смог помочь с этой просьбой." ], "speechOndeckRecentTail": "Если вы хотите что-то посмотреть, просто скажите имя, иначе вы можете сказать «отменить».", "speechPlaybackAffirmatives": [ "<html> Тогда хорошо, играя <TITLE> . &lt;\/ Html&gt;", "<html> По команде, начиная <TITLE> . &lt;\/ Html&gt;", "<html> Нет проблем, стрельба <TITLE> . &lt;\/ Html&gt;", "<html> Хорошо, играя <TITLE> . &lt;\/ Html&gt;", "<html> Конечно, играя <TITLE> . &lt;\/ Html&gt;", "<html> Да, капитан, включив <TITLE> . &lt;\/ Html&gt;", "<html> Да, мастер, я буду играть <TITLE> для вас. &lt;\/ html&gt;", "<html> Вы получили это, начиная <TITLE> . &lt;\/ Html&gt;", "<html> Да, <TITLE> это. &lt;\/ html&gt;", "<html> Роджер, что, включив <TITLE> . &lt;\/ Html&gt;", "<html> Подтверждаю. начало <TITLE> . &lt;\/ Html&gt;" ], "speechPlaybackAffirmativeShort": "<html> Воспроизведение <TITLE> . &lt;\/ Html&gt;", "speechControlShort": "Хорошо.", "speechFetchAffirmatives": [ "Allright,", "Хорошо,", "Успех!" ], "speechPlayer": "игрок", "speechPlayError3": "Я не мог найти это в библиотеке, вы хотите, чтобы я попытался загрузить его?", "speechPlayErrorEnd1": "в вашей библиотеке. Должен ли я попытаться добавить его в списки просмотра?", "speechPlayErrorEnd2": "&#39; играть. Должен ли я попытаться забрать его для вас?", "speechPlayErrorStart1": "Я не смог найти", "speechPlayErrorStart2": "Я не нашел ничего,", "speechPlayerStatus1": "В настоящее время", "speechPlayerStatus2": "играет на", "speechPlayerStatus3": "В настоящее время сезон", "speechPlayerStatus4": "играет. Этот эпизод назван", "speechPlayerStatus5": "Похоже, вы слушаете", "speechPlayerStatus6": "из альбома", "speechPlayerStatusBy": "от", "speechPlayerStatusEpisode": "эпизод", "speechPlayerStatusOf": "из", "speechPlaying": "Воспроизведение", "speechReturnOndeck": "Вот список предметов на палубе:", "speechReturnRecent": "Вот список последних", "speechReturnInfoArray": [ "Вот список <TYPE> :", "Для <TYPE> , у тебя есть:", "Я нашел эти <TYPE> в вашей библиотеке:" ], "speechServer": "сервер", "speechShuffleResponse": "Хорошо, перетасовать", "speechStatusNothingPlaying": "Не похоже, что сейчас что-то играет.", "speechWordAnd": "а также", "speechWordOkay": "Хорошо", "speechWordTo": "в", "suggestionCancel": "Отмена.", "suggestionCouch": "Скачать фильм Трон.", "suggestionDvr": "DVR Jeopardy.", "suggestionSick": [ "Принесите шоу Сорняки.", "Загрузите последний эпизод Corporate." ], "suggestionsApps": { "show": [ "Загрузите последний эпизод Jeopardy", "Принесите шоу Young Sheldon" ], "movie": [ "Загрузить Ghost Rider", "Привлечение Ghostbusters 1989" ], "music": [ "Загрузите последний альбом Metallica", "Возьмите новую песню Glitch Mob" ], "dvr": [ "Запись Колеса Фортуны", "DVR Dr. Phil" ] }, "suggestionYesNo": [ "нет", "да" ], "uiGreetingDefault": "Чем могу помочь?", "uiPageTitle": "Flex TV (Web)", "uiPlayerSelectPrompt": "Выберите игрока для управления.", "uiRescanDevices": "Повторно сканировать устройства", "uiSettingAccountLinking": "Учетная запись", "uiSettingApiKey": "Ключ API:", "uiSettingAutoUpdate": "Автоматическая установка обновлений", "uiSettingNotifyUpdate": "Уведомлять, когда доступны обновления", "uiSettingBtnReset": "СБРОС", "uiSettingBtnTest": "КОНТРОЛЬНАЯ РАБОТА", "uiSettingCastLogs": "Скачать литые журналы", "uiSettingCopyIFTTT": "Нажмите, чтобы скопировать URL-адрес IFTTT:", "uiSettingDevices": "Статические устройства", "uiSettingDevicesAddNew": "Добавить новое устройство", "uiSettingDevicesNameLabel": "Имя устройства", "uiSettingDvrEndOffset": "Смещение конца (минуты):", "uiSettingDvrNewAirings": "Только запись новых сообщений", "uiSettingDvrRecordPartials": "Запись частичных эпизодов", "uiSettingDvrReplaceLower": "Заменить записи низкого качества", "uiSettingDvrComskipEnabled": "Пропустить рекламные ролики", "uiSettingDvrResolution": "разрешение", "uiSettingDvrResolutionAny": "Любые", "uiSettingDvrResolutionHD": "Высокое разрешение", "uiSettingDvrServer": "Сервер DVR", "uiSettingDvrStartOffset": "Начало смещения (минуты):", "uiSettingEnable": "включить", "uiSettingFetcherPath": "Путь (необязательно)", "uiSettingFetcherPort": "порт", "uiSettingFetcherQualityProfile": "Профиль качества", "uiSettingFetcherToken": "знак", "uiSettingForceSSL": "Force SSL", "uiSettingForceSSLHint": "Принудительный SSL, если он доступен. Требуется для прогрессивных веб-приложений.", "uiSettingGeneral": "Генеральная", "uiSettingHeaderDevices": "приборы", "uiSettingHeaderMovies": "Кино", "uiSettingHeaderShows": "шоу", "uiSettingHeaderMusic": "Музыка", "uiSettingHeaderLogs": "бревна", "uiSettingHeaderPhlex": "Генеральная", "uiSettingHeaderPlex": "Plex", "uiSettingHookCustom": "изготовленный на заказ", "uiSettingHookCustomPhrase": "Пользовательский ответ", "uiSettingHookFetch": "получать", "uiSettingHookGeneric": "URL:", "uiSettingHookLabel": "Webhooks", "uiSettingHookPause": "Пауза", "uiSettingHookPlayback": "воспроизведение", "uiSettingHookPlayHint": "? param = {{media name}} будет добавлено", "uiSettingHookStop": "Стоп", "uiSettingHookUrlGeneral": "URL веб-ссылки:", "uiSettingInstallUpdates": "УСТАНОВИТЬ", "uiSettingLangEnglish": "английский", "uiSettingLangFrench": "Французский", "uiSettingLanguage": "Язык:", "uiSettingLinkAmazon": "LINK AMAZON", "uiSettingLinkGoogle": "LINK GOOGLE", "uiSettingLogCount": "Количество:", "uiSettingLogLevel": "Уровень:", "uiSettingLogUpdate": "Обновить", "uiSettingMasterUser": "Главный пользователь", "uiSettingMasterUserHint": "Там может быть только один! ... и ты.", "uiSettingNoNewUsers": "Предотвращение новых пользователей", "uiSettingNoNewUsersHint": "Отключите разрешение новых пользователей на использование Flex TV.", "uiSettingNoPlexDirect": "Нет HTTPS \/ реле", "uiSettingNoPlexDirectHint": "{EXPERIMENTAL) Отключить HTTPS и URL-адрес ретрансляции, необходимый для некоторых сетей.", "uiSettingObscureLogs": "Нечеткие чувствительные данные в журналах", "uiSettingOndeckRecent": "Количество на палубе \/ последние позиции для возврата:", "uiSettingPlaybackServer": "Предпочтительный сервер:", "uiSettingPlaybackServerHint": "Если результаты найдены на нескольких серверах, выберите те, которые были найдены на этом сервере.", "uiSettingPlexDVR": "Plex DVR", "uiSettingPublicAddress": "Публичный адресс:", "uiSettingRefreshUpdates": "ОБНОВЛЕНИЕ", "uiSettingRescanHint": "Как часто перезаписывать устройства.", "uiSettingRescanInterval": "Интервал проверки устройства (минуты):", "uiSettingSearchAccuracy": "Точность поиска (%):", "uiSettingSeparateHookUrl": "Отдельные URL-адреса", "uiSettingShortAnswers": "Использовать короткие ответы", "uiSettingTestButton": "КОНТРОЛЬНАЯ РАБОТА", "uiSettingTestServer": "Возможность тестирования", "uiSettingThemeColor": "Использовать темную тему", "uiSettingUpdates": "Обновления", "uiSettingUseCast": "Использовать литые устройства" }
{ "pile_set_name": "Github" }
/*********************************************************************** Copyright (c) 2017 Google Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************/ #ifndef SILK_BIQUAD_ALT_ARM_H # define SILK_BIQUAD_ALT_ARM_H # include "celt/arm/armcpu.h" # if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) void silk_biquad_alt_stride2_neon( const opus_int16 *in, /* I input signal */ const opus_int32 *B_Q28, /* I MA coefficients [3] */ const opus_int32 *A_Q28, /* I AR coefficients [2] */ opus_int32 *S, /* I/O State vector [4] */ opus_int16 *out, /* O output signal */ const opus_int32 len /* I signal length (must be even) */ ); # if !defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_PRESUME_NEON) # define OVERRIDE_silk_biquad_alt_stride2 (1) # define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((void)(arch), PRESUME_NEON(silk_biquad_alt_stride2)(in, B_Q28, A_Q28, S, out, len)) # endif # endif # if !defined(OVERRIDE_silk_biquad_alt_stride2) /*Is run-time CPU detection enabled on this platform?*/ # if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) extern void (*const SILK_BIQUAD_ALT_STRIDE2_IMPL[OPUS_ARCHMASK+1])( const opus_int16 *in, /* I input signal */ const opus_int32 *B_Q28, /* I MA coefficients [3] */ const opus_int32 *A_Q28, /* I AR coefficients [2] */ opus_int32 *S, /* I/O State vector [4] */ opus_int16 *out, /* O output signal */ const opus_int32 len /* I signal length (must be even) */ ); # define OVERRIDE_silk_biquad_alt_stride2 (1) # define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((*SILK_BIQUAD_ALT_STRIDE2_IMPL[(arch)&OPUS_ARCHMASK])(in, B_Q28, A_Q28, S, out, len)) # elif defined(OPUS_ARM_PRESUME_NEON_INTR) # define OVERRIDE_silk_biquad_alt_stride2 (1) # define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((void)(arch), silk_biquad_alt_stride2_neon(in, B_Q28, A_Q28, S, out, len)) # endif # endif #endif /* end SILK_BIQUAD_ALT_ARM_H */
{ "pile_set_name": "Github" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================================= ** ** ** ** Purpose: Exception base class for all errors from Interop or Structured ** Exception Handling code. ** ** =============================================================================*/ using System; using System.Globalization; using System.Runtime.Serialization; namespace System.Runtime.InteropServices { // Base exception for COM Interop errors &; Structured Exception Handler // exceptions. [Bridge.NonScriptable] [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class ExternalException : SystemException { public ExternalException() : base("External component has thrown an exception.") // TODO: SR //: base(SR.Arg_ExternalException) { HResult = HResults.E_FAIL; } public ExternalException(string message) : base(message) { HResult = HResults.E_FAIL; } public ExternalException(string message, Exception inner) : base(message, inner) { HResult = HResults.E_FAIL; } public ExternalException(string message, int errorCode) : base(message) { HResult = errorCode; } // TODO: NotSupported //protected ExternalException(SerializationInfo info, StreamingContext context) // : base(info, context) //{ //} public virtual int ErrorCode { get { return HResult; } } public override string ToString() { string message = Message; string className = GetType().ToString(); string s = className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")"; if (!(String.IsNullOrEmpty(message))) { s = s + ": " + message; } Exception innerException = InnerException; if (innerException != null) { s = s + " ---> " + innerException.ToString(); } if (StackTrace != null) s += Environment.NewLine + StackTrace; return s; } } }
{ "pile_set_name": "Github" }
//index.js //获取应用实例 var app = getApp() Page({ data: { motto: 'Hello World wechat', userInfo: {}, modalHidden: true }, //事件处理函数 selectCommunity: function() { wx.navigateTo({ url: '../community/community' }) }, //点击确认后进入model内容 confirmMessage: function(){ this.setData({ modalHidden: false }) }, //model中点击"进入社区“ confirmMessageYes: function(){ this.setData({ modalHidden: true }) //TODO 用户点击“进入社区”后,将数据发送给API保存 并且开始将用户信息发送给社区随机人员 wx.navigateTo({ url: '../story/story' }) }, //用户选择“撤销验证“ cancel: function(){ this.setData({ modalHidden: true }) }, // 用户选择“先不认证,进社区看看” withoutAuthenticated:function(){ wx.navigateTo({ url: '../story/story' }) }, formSubmit: function(e){ console.log(e.detail.value) }, onLoad: function () { console.log('onLoad') var that = this //调用应用实例的方法获取全局数据 app.getUserInfo(function(userInfo){ //更新数据 that.setData({ userInfo:userInfo }) that.update() }) } })
{ "pile_set_name": "Github" }
// *** WARNING: this file was generated by pulumigen. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../../types/input"; import * as outputs from "../../types/output"; import * as utilities from "../../utilities"; /** * HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. */ export class HorizontalPodAutoscalerList extends pulumi.CustomResource { /** * Get an existing HorizontalPodAutoscalerList resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): HorizontalPodAutoscalerList { return new HorizontalPodAutoscalerList(name, undefined as any, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'kubernetes:autoscaling/v2beta1:HorizontalPodAutoscalerList'; /** * Returns true if the given object is an instance of HorizontalPodAutoscalerList. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is HorizontalPodAutoscalerList { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === HorizontalPodAutoscalerList.__pulumiType; } /** * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ public readonly apiVersion!: pulumi.Output<"autoscaling/v2beta1">; /** * items is the list of horizontal pod autoscaler objects. */ public readonly items!: pulumi.Output<outputs.autoscaling.v2beta1.HorizontalPodAutoscaler[]>; /** * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ public readonly kind!: pulumi.Output<"HorizontalPodAutoscalerList">; /** * metadata is the standard list metadata. */ public readonly metadata!: pulumi.Output<outputs.meta.v1.ListMeta>; /** * Create a HorizontalPodAutoscalerList resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: HorizontalPodAutoscalerListArgs, opts?: pulumi.CustomResourceOptions) { let inputs: pulumi.Inputs = {}; if (!(opts && opts.id)) { if (!args || args.items === undefined) { throw new Error("Missing required property 'items'"); } inputs["apiVersion"] = "autoscaling/v2beta1"; inputs["items"] = args ? args.items : undefined; inputs["kind"] = "HorizontalPodAutoscalerList"; inputs["metadata"] = args ? args.metadata : undefined; } else { inputs["apiVersion"] = undefined /*out*/; inputs["items"] = undefined /*out*/; inputs["kind"] = undefined /*out*/; inputs["metadata"] = undefined /*out*/; } if (!opts) { opts = {} } if (!opts.version) { opts.version = utilities.getVersion(); } super(HorizontalPodAutoscalerList.__pulumiType, name, inputs, opts); } } /** * The set of arguments for constructing a HorizontalPodAutoscalerList resource. */ export interface HorizontalPodAutoscalerListArgs { /** * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ readonly apiVersion?: pulumi.Input<"autoscaling/v2beta1">; /** * items is the list of horizontal pod autoscaler objects. */ readonly items: pulumi.Input<pulumi.Input<inputs.autoscaling.v2beta1.HorizontalPodAutoscaler>[]>; /** * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ readonly kind?: pulumi.Input<"HorizontalPodAutoscalerList">; /** * metadata is the standard list metadata. */ readonly metadata?: pulumi.Input<inputs.meta.v1.ListMeta>; }
{ "pile_set_name": "Github" }
--- layout: page title: "Q67008: Syntax Error When Watching Variables That Begin with &quot;P&quot;" permalink: /pubs/pc/reference/microsoft/kb/Q67008/ --- ## Q67008: Syntax Error When Watching Variables That Begin with &quot;P&quot; Article: Q67008 Version(s): 2.20 2.30 | 2.20 2.30 Operating System: MS-DOS | OS/2 Flags: ENDUSER | buglist2.10 buglist2.20 fixlist3.00 Last Modified: 18-NOV-1990 When the following command is entered in the Command window to watch a variable that begins with the letter "p", the result is a syntax error: > W pvariable The syntax for watching a memory location is W[type] range, where the type and range specify the format and length of memory to be displayed, respectively. When no type is declared, as in the above example, the default type is used. The default type will be the last type used by a Dump, Enter, Watch Memory, or Tracepoint Memory command. If none of these commands has been used during the session, the default type is byte. The workaround for this problem is to explicitly declare a type in the watch statement, for example: > WB pvariable. Microsoft has confirmed this to be a problem in Microsoft CodeView versions 2.x. This problem has been corrected in Microsoft CodeView version 3.00. Additional keywords: buglist2.30 buglist2.35
{ "pile_set_name": "Github" }
{ "parameters": { "name": "cache1", "resourceGroupName": "rg1", "api-version": "2016-04-01", "subscriptionId": "subid", "parameters": { "shardId": 0, "rebootType": "AllNodes" } }, "responses": { "200": { "body": { "Message": "reboot operation enqueued" } } } }
{ "pile_set_name": "Github" }
menuconfig SND_AOA tristate "Apple Onboard Audio driver" depends on PPC_PMAC select SND_PCM ---help--- This option enables the new driver for the various Apple Onboard Audio components. if SND_AOA source "sound/aoa/fabrics/Kconfig" source "sound/aoa/codecs/Kconfig" source "sound/aoa/soundbus/Kconfig" endif # SND_AOA
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2001, 2012 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ * or the Apache License, Version 2.0 which accompanies this distribution and * is available at https://www.apache.org/licenses/LICENSE-2.0. * * This Source Code may also be made available under the following * Secondary Licenses when the conditions for such availability set * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU * General Public License, version 2 with the GNU Classpath * Exception [1] and GNU General Public License, version 2 with the * OpenJDK Assembly Exception [2]. * * [1] https://www.gnu.org/software/classpath/license.html * [2] http://openjdk.java.net/legal/assembly-exception.html * * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception *******************************************************************************/ package j9vm.test.threads.regression; public class Sleeper { public static void main(String[] args) { try { Thread.sleep(4000); } catch (InterruptedException e) { System.out.println(": Did not expect to be interrupted this time !!!!"); } System.out.println("DONE"); } }
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/admissionregistration/v1" cache "k8s.io/client-go/tools/cache" ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for // MutatingWebhookConfigurations. type MutatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1.MutatingWebhookConfigurationLister } type mutatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(options) }, }, &admissionregistrationv1.MutatingWebhookConfiguration{}, resyncPeriod, indexers, ) } func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1.MutatingWebhookConfiguration{}, f.defaultInformer) } func (f *mutatingWebhookConfigurationInformer) Lister() v1.MutatingWebhookConfigurationLister { return v1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) }
{ "pile_set_name": "Github" }
# Stubs for scrapy.utils.spider (Python 3) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from scrapy.spiders import Spider from typing import Any, Optional logger: Any def iterate_spider_output(result: Any): ... def iter_spider_classes(module: Any) -> None: ... def spidercls_for_request(spider_loader: Any, request: Any, default_spidercls: Optional[Any] = ..., log_none: bool = ..., log_multiple: bool = ...): ... class DefaultSpider(Spider): name: str = ...
{ "pile_set_name": "Github" }
using System; using NetOffice; using NetOffice.Attributes; namespace NetOffice.MSHTMLApi.Enums { /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] [EntityType(EntityType.IsEnum)] public enum _stylePageBreak { /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>0</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakNotSet = 0, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>1</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakAuto = 1, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>2</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakAlways = 2, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>3</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakLeft = 3, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>4</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakRight = 4, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>5</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreakAvoid = 5, /// <summary> /// SupportByVersion MSHTML 4 /// </summary> /// <remarks>2147483647</remarks> [SupportByVersion("MSHTML", 4)] stylePageBreak_Max = 2147483647 } }
{ "pile_set_name": "Github" }
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6_test import ( "bytes" "net" "runtime" "strings" "sync" "testing" "golang.org/x/net/internal/iana" "golang.org/x/net/internal/nettest" "golang.org/x/net/ipv6" ) func BenchmarkReadWriteUnicast(b *testing.B) { c, err := nettest.NewLocalPacketListener("udp6") if err != nil { b.Skipf("not supported on %s/%s: %v", runtime.GOOS, runtime.GOARCH, err) } defer c.Close() dst := c.LocalAddr() wb, rb := []byte("HELLO-R-U-THERE"), make([]byte, 128) b.Run("NetUDP", func(b *testing.B) { for i := 0; i < b.N; i++ { if _, err := c.WriteTo(wb, dst); err != nil { b.Fatal(err) } if _, _, err := c.ReadFrom(rb); err != nil { b.Fatal(err) } } }) b.Run("IPv6UDP", func(b *testing.B) { p := ipv6.NewPacketConn(c) cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU if err := p.SetControlMessage(cf, true); err != nil { b.Fatal(err) } cm := ipv6.ControlMessage{ TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced, HopLimit: 1, } ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback) if ifi != nil { cm.IfIndex = ifi.Index } for i := 0; i < b.N; i++ { if _, err := p.WriteTo(wb, &cm, dst); err != nil { b.Fatal(err) } if _, _, _, err := p.ReadFrom(rb); err != nil { b.Fatal(err) } } }) } func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) { switch runtime.GOOS { case "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { t.Skip("ipv6 is not supported") } c, err := nettest.NewLocalPacketListener("udp6") if err != nil { t.Fatal(err) } defer c.Close() p := ipv6.NewPacketConn(c) defer p.Close() dst := c.LocalAddr() ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback) cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU wb := []byte("HELLO-R-U-THERE") if err := p.SetControlMessage(cf, true); err != nil { // probe before test if nettest.ProtocolNotSupported(err) { t.Skipf("not supported on %s", runtime.GOOS) } t.Fatal(err) } var wg sync.WaitGroup reader := func() { defer wg.Done() rb := make([]byte, 128) if n, cm, _, err := p.ReadFrom(rb); err != nil { t.Error(err) return } else if !bytes.Equal(rb[:n], wb) { t.Errorf("got %v; want %v", rb[:n], wb) return } else { s := cm.String() if strings.Contains(s, ",") { t.Errorf("should be space-separated values: %s", s) } } } writer := func(toggle bool) { defer wg.Done() cm := ipv6.ControlMessage{ TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced, Src: net.IPv6loopback, } if ifi != nil { cm.IfIndex = ifi.Index } if err := p.SetControlMessage(cf, toggle); err != nil { t.Error(err) return } if n, err := p.WriteTo(wb, &cm, dst); err != nil { t.Error(err) return } else if n != len(wb) { t.Errorf("got %d; want %d", n, len(wb)) return } } const N = 10 wg.Add(N) for i := 0; i < N; i++ { go reader() } wg.Add(2 * N) for i := 0; i < 2*N; i++ { go writer(i%2 != 0) } wg.Add(N) for i := 0; i < N; i++ { go reader() } wg.Wait() }
{ "pile_set_name": "Github" }
// // SFHFKeychainUtils.h // // Created by Buzz Andersen on 10/20/08. // Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. // Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. // // 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. // #import <UIKit/UIKit.h> /** Renamed it to LTHKeychainUtils because it could have conflicted with SFHFKeychainUtils already present in the project. This version is ARC-compliant, but all the rights and thanks go to Buzz Andersen for SFHFKeychainUtils. */ @interface LTHKeychainUtils : NSObject { } + (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; + (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error; + (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; @end
{ "pile_set_name": "Github" }
====================================================== 11:43:13 AM http://127.0.0.1:80 ====================================================== GET /hello.html?id=1 HTTP/1.1 Host: 127.0.0.1 Proxy-Connection: keep-alive Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Upgrade-Insecure-Requests: 1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 ======================================================
{ "pile_set_name": "Github" }
# sonarQubeSimulationServer sonarQubeSimulationServer was replaced with a simple command-line switch: - --simulateSonarServer=true simulates a sonar server in the background - --simulateSonarServer=false (or no property at all) uses the real sonar server
{ "pile_set_name": "Github" }
/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of <rpcndr.h> #endif #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif #ifndef __bitscfg_h__ #define __bitscfg_h__ #ifndef __IBITSExtensionSetup_FWD_DEFINED__ #define __IBITSExtensionSetup_FWD_DEFINED__ typedef struct IBITSExtensionSetup IBITSExtensionSetup; #endif #ifndef __IBITSExtensionSetupFactory_FWD_DEFINED__ #define __IBITSExtensionSetupFactory_FWD_DEFINED__ typedef struct IBITSExtensionSetupFactory IBITSExtensionSetupFactory; #endif #ifndef __BITSExtensionSetupFactory_FWD_DEFINED__ #define __BITSExtensionSetupFactory_FWD_DEFINED__ #ifdef __cplusplus typedef class BITSExtensionSetupFactory BITSExtensionSetupFactory; #else typedef struct BITSExtensionSetupFactory BITSExtensionSetupFactory; #endif #endif #include "oaidl.h" #include "ocidl.h" #include "mstask.h" #ifdef __cplusplus extern "C"{ #endif #ifndef __MIDL_user_allocate_free_DEFINED__ #define __MIDL_user_allocate_free_DEFINED__ void *__RPC_API MIDL_user_allocate(size_t); void __RPC_API MIDL_user_free(void *); #endif #ifndef __IBITSExtensionSetup_INTERFACE_DEFINED__ #define __IBITSExtensionSetup_INTERFACE_DEFINED__ EXTERN_C const IID IID_IBITSExtensionSetup; #if defined(__cplusplus) && !defined(CINTERFACE) struct IBITSExtensionSetup : public IDispatch { public: virtual HRESULT WINAPI EnableBITSUploads(void) = 0; virtual HRESULT WINAPI DisableBITSUploads(void) = 0; virtual HRESULT WINAPI GetCleanupTaskName(BSTR *pTaskName) = 0; virtual HRESULT WINAPI GetCleanupTask(REFIID riid,IUnknown **ppUnk) = 0; }; #else typedef struct IBITSExtensionSetupVtbl { BEGIN_INTERFACE HRESULT (WINAPI *QueryInterface)(IBITSExtensionSetup *This,REFIID riid,void **ppvObject); ULONG (WINAPI *AddRef)(IBITSExtensionSetup *This); ULONG (WINAPI *Release)(IBITSExtensionSetup *This); HRESULT (WINAPI *GetTypeInfoCount)(IBITSExtensionSetup *This,UINT *pctinfo); HRESULT (WINAPI *GetTypeInfo)(IBITSExtensionSetup *This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo); HRESULT (WINAPI *GetIDsOfNames)(IBITSExtensionSetup *This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId); HRESULT (WINAPI *Invoke)(IBITSExtensionSetup *This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr); HRESULT (WINAPI *EnableBITSUploads)(IBITSExtensionSetup *This); HRESULT (WINAPI *DisableBITSUploads)(IBITSExtensionSetup *This); HRESULT (WINAPI *GetCleanupTaskName)(IBITSExtensionSetup *This,BSTR *pTaskName); HRESULT (WINAPI *GetCleanupTask)(IBITSExtensionSetup *This,REFIID riid,IUnknown **ppUnk); END_INTERFACE } IBITSExtensionSetupVtbl; struct IBITSExtensionSetup { CONST_VTBL struct IBITSExtensionSetupVtbl *lpVtbl; }; #ifdef COBJMACROS #define IBITSExtensionSetup_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) #define IBITSExtensionSetup_AddRef(This) (This)->lpVtbl->AddRef(This) #define IBITSExtensionSetup_Release(This) (This)->lpVtbl->Release(This) #define IBITSExtensionSetup_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo) #define IBITSExtensionSetup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo) #define IBITSExtensionSetup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) #define IBITSExtensionSetup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) #define IBITSExtensionSetup_EnableBITSUploads(This) (This)->lpVtbl->EnableBITSUploads(This) #define IBITSExtensionSetup_DisableBITSUploads(This) (This)->lpVtbl->DisableBITSUploads(This) #define IBITSExtensionSetup_GetCleanupTaskName(This,pTaskName) (This)->lpVtbl->GetCleanupTaskName(This,pTaskName) #define IBITSExtensionSetup_GetCleanupTask(This,riid,ppUnk) (This)->lpVtbl->GetCleanupTask(This,riid,ppUnk) #endif #endif HRESULT WINAPI IBITSExtensionSetup_EnableBITSUploads_Proxy(IBITSExtensionSetup *This); void __RPC_STUB IBITSExtensionSetup_EnableBITSUploads_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); HRESULT WINAPI IBITSExtensionSetup_DisableBITSUploads_Proxy(IBITSExtensionSetup *This); void __RPC_STUB IBITSExtensionSetup_DisableBITSUploads_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); HRESULT WINAPI IBITSExtensionSetup_GetCleanupTaskName_Proxy(IBITSExtensionSetup *This,BSTR *pTaskName); void __RPC_STUB IBITSExtensionSetup_GetCleanupTaskName_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); HRESULT WINAPI IBITSExtensionSetup_GetCleanupTask_Proxy(IBITSExtensionSetup *This,REFIID riid,IUnknown **ppUnk); void __RPC_STUB IBITSExtensionSetup_GetCleanupTask_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); #endif #ifndef __IBITSExtensionSetupFactory_INTERFACE_DEFINED__ #define __IBITSExtensionSetupFactory_INTERFACE_DEFINED__ EXTERN_C const IID IID_IBITSExtensionSetupFactory; #if defined(__cplusplus) && !defined(CINTERFACE) struct IBITSExtensionSetupFactory : public IDispatch { public: virtual HRESULT WINAPI GetObject(BSTR Path,IBITSExtensionSetup **ppExtensionSetup) = 0; }; #else typedef struct IBITSExtensionSetupFactoryVtbl { BEGIN_INTERFACE HRESULT (WINAPI *QueryInterface)(IBITSExtensionSetupFactory *This,REFIID riid,void **ppvObject); ULONG (WINAPI *AddRef)(IBITSExtensionSetupFactory *This); ULONG (WINAPI *Release)(IBITSExtensionSetupFactory *This); HRESULT (WINAPI *GetTypeInfoCount)(IBITSExtensionSetupFactory *This,UINT *pctinfo); HRESULT (WINAPI *GetTypeInfo)(IBITSExtensionSetupFactory *This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo); HRESULT (WINAPI *GetIDsOfNames)(IBITSExtensionSetupFactory *This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId); HRESULT (WINAPI *Invoke)(IBITSExtensionSetupFactory *This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr); HRESULT (WINAPI *GetObject)(IBITSExtensionSetupFactory *This,BSTR Path,IBITSExtensionSetup **ppExtensionSetup); END_INTERFACE } IBITSExtensionSetupFactoryVtbl; struct IBITSExtensionSetupFactory { CONST_VTBL struct IBITSExtensionSetupFactoryVtbl *lpVtbl; }; #ifdef COBJMACROS #define IBITSExtensionSetupFactory_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) #define IBITSExtensionSetupFactory_AddRef(This) (This)->lpVtbl->AddRef(This) #define IBITSExtensionSetupFactory_Release(This) (This)->lpVtbl->Release(This) #define IBITSExtensionSetupFactory_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo) #define IBITSExtensionSetupFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo) #define IBITSExtensionSetupFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) #define IBITSExtensionSetupFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) #define IBITSExtensionSetupFactory_GetObject(This,Path,ppExtensionSetup) (This)->lpVtbl->GetObject(This,Path,ppExtensionSetup) #endif #endif HRESULT WINAPI IBITSExtensionSetupFactory_GetObject_Proxy(IBITSExtensionSetupFactory *This,BSTR Path,IBITSExtensionSetup **ppExtensionSetup); void __RPC_STUB IBITSExtensionSetupFactory_GetObject_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); #endif #ifndef __BITSExtensionSetup_LIBRARY_DEFINED__ #define __BITSExtensionSetup_LIBRARY_DEFINED__ EXTERN_C const IID LIBID_BITSExtensionSetup; EXTERN_C const CLSID CLSID_BITSExtensionSetupFactory; #ifdef __cplusplus class BITSExtensionSetupFactory; #endif #endif ULONG __RPC_API BSTR_UserSize(ULONG *,ULONG,BSTR *); unsigned char *__RPC_API BSTR_UserMarshal(ULONG *,unsigned char *,BSTR *); unsigned char *__RPC_API BSTR_UserUnmarshal(ULONG *,unsigned char *,BSTR *); void __RPC_API BSTR_UserFree(ULONG *,BSTR *); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
var createFlow = require('./_createFlow'); /** * This method is like `_.flow` except that it creates a function that * invokes the given functions from right to left. * * @static * @since 3.0.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 */ var flowRight = createFlow(true); module.exports = flowRight;
{ "pile_set_name": "Github" }
/* sfzutf-perf.c * * Description: SFZUTF performance test suite. */ /***************************************************************************** * Copyright (c) 2008-2016 INSIDE Secure Oy. All Rights Reserved. * * The latest version of this code is available at http://www.matrixssl.org * * This software is open source; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This General Public License does NOT permit incorporating this software * into proprietary programs. If you are unable to comply with the GPL, a * commercial license for this software may be purchased from INSIDE at * http://www.insidesecure.com/ * * This program is distributed in WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * http://www.gnu.org/copyleft/gpl.html *****************************************************************************/ #include "implementation_defs.h" #include "sfzutf_internal.h" #include "sfzutf-perf.h" #if defined __GNUC__ && (defined __i386__ || defined __x86_64__) /* Directly access cycle counter. */ void sfzutf_perf_test_update(uint32_t perftest_array_ent[ SFZUTF_PERFTEST_ENTRIES_PER_COUNT]) { /* Read cycle counter and store it to given memory location. Uses cpuid to force serialized instruction execution. */ __asm__ volatile ("subl %%eax, %%eax\n\t" "cpuid\n\t" "rdtsc\n\t" "movl %%eax,(%0)\n\t" "movl %%edx,4(%0)\n\t" "subl %%eax, %%eax\n\t" "cpuid" : : "S" (perftest_array_ent) : "memory", "%eax", "%ebx", "%ecx", "%edx"); } static uint64_t sfzutf_perf_test_normalize(uint32_t perftest_array_ent[ SFZUTF_PERFTEST_ENTRIES_PER_COUNT]) { /* No normalization, only conversion uin32_t * 2 => uint64_t */ return *(uint64_t *) perftest_array_ent; } static const char sfzutf_perf_units[] = "cycles"; #else /* Fallback to using gettimeofday */ # include "osdep_sys_time.h" # include <time.h> void sfzutf_perf_test_update(uint32_t perftest_array_ent[ SFZUTF_PERFTEST_ENTRIES_PER_COUNT]) { struct timeval target; int res; res = gettimeofday(&target, NULL); (void) res; /* perf_fail_if may expand to nothing. */ perf_fail_if(res != 0, "gettimeofday() function failed."); perftest_array_ent[0] = target.tv_sec; perftest_array_ent[1] = target.tv_usec; } static uint64_t sfzutf_perf_test_normalize( uint32_t perftest_array_ent[SFZUTF_PERFTEST_ENTRIES_PER_COUNT]) { /* Values need to be normalized. This normalization procedure produces the numbers out as nanoseconds. */ uint64_t combined_value; combined_value = (perftest_array_ent[0] * 1000000000LL) + (perftest_array_ent[1] * 1000); return combined_value; } static const char sfzutf_perf_units[] = "ns"; #endif /* defined __GNUC__ && (defined __i386__ || defined __x86_64__) */ /* Static variable to remember initialization status of performance test. */ static enum { SFZUTF_PERF_STATE_UNINITIALIZED, SFZUTF_PERF_STATE_CALIBRATING, SFZUTF_PERF_STATE_INITIALIZED } sfzutf_perf_state = SFZUTF_PERF_STATE_UNINITIALIZED; static uint32_t sfzutf_perf_repeats; static uint64_t sfzutf_perf_calibrate_delta; /* Builtin "performance test": calibrates with empty loop. */ START_PERF_TEST(sfzutf_perf_calibrate, 1) { PERF_EXECUTE_TEST_SLOW({ /* Do nothing */ }); } END_PERF_TEST void sfzutf_perf_test_begin(const char *funcname, uint32_t repeats, uint32_t perftest_array[SFZUTF_PERFTEST_ENTRIES]) { uint32_t i; PARAMETER_NOT_USED(funcname); if (sfzutf_perf_state == SFZUTF_PERF_STATE_UNINITIALIZED) { sfzutf_perf_state = SFZUTF_PERF_STATE_CALIBRATING; L_TESTLOG(LF_CALIBRATING, "Invoking performance measurement calibration"); sfzutf_perf_calibrate(0); sfzutf_perf_state = SFZUTF_PERF_STATE_INITIALIZED; } /* Store repeat counter. */ sfzutf_perf_repeats = repeats; /* Read timecounter to perftest_array[0-1]: side-effect fetch sfzutf_perf_test_update to instruction cache. */ sfzutf_perf_test_update(perftest_array); /* Clear the perftests array (and as important side-effect make sure the whole array is in TLB and caches). */ for (i = 0; i < SFZUTF_PERFTEST_ENTRIES; i++) { perftest_array[i] = 0; } } void sfzutf_perf_test_end(const char *funcname, uint32_t perftest_array[SFZUTF_PERFTEST_ENTRIES]) { uint64_t prev; uint64_t delta; uint64_t smallest_delta = 0ULL - 1ULL; uint32_t i; PARAMETER_NOT_USED(funcname); /* Logic: find the smallest measurement. (Ie. the one that has no context switches or the lest number of them).*/ prev = sfzutf_perf_test_normalize(perftest_array); for (i = 1; i < SFZUTF_PERFTEST_COUNT; i++) { delta = sfzutf_perf_test_normalize( &perftest_array[i * SFZUTF_PERFTEST_ENTRIES_PER_COUNT]) - prev; L_TESTLOG(LF_PERF_MEASUREMENT, "%" PRIu64 " %s", delta, sfzutf_perf_units); if (delta < smallest_delta) { smallest_delta = delta; } prev = delta + prev; } fail_if(smallest_delta < sfzutf_perf_calibrate_delta, "Measured performance value is less than calibrated minimum."); if (sfzutf_perf_state == SFZUTF_PERF_STATE_CALIBRATING) { fail_if(sfzutf_perf_repeats != 1, "Calibrate always with repeats == 1"); L_TESTLOG(LF_PERF_ACCEPTED_CALIBRATION, "%" PRIu64 ".000 %s", smallest_delta, sfzutf_perf_units); } else { /* Check that SFZUTF initialization has been done. */ ASSERT(sfzutf_perf_state == SFZUTF_PERF_STATE_INITIALIZED); /* Decrement calibration result from the smallest delta. */ smallest_delta -= sfzutf_perf_calibrate_delta; /* Choose formatting according to number of repeats. This is to avoid floating point mathematics... */ if (sfzutf_perf_repeats == 1) { L_TESTLOG(LF_PERF_ACCEPTED_MEASUREMENT, "%" PRIu64 ".000 %s", smallest_delta, sfzutf_perf_units); } else if (sfzutf_perf_repeats == 10) { L_TESTLOG(LF_PERF_ACCEPTED_MEASUREMENT, "%" PRIu64 ".%" PRIu64 "00 %s", smallest_delta / 10, smallest_delta % 10, sfzutf_perf_units); } else if (sfzutf_perf_repeats == 100) { L_TESTLOG(LF_PERF_ACCEPTED_MEASUREMENT, "%" PRIu64 ".%02" PRIu64 "0 %s", smallest_delta / 100, smallest_delta % 100, sfzutf_perf_units); } else { fail("Unsupported value for sfzutf_perf_repeats."); } } } /* end of file sfzutf-perf.c */
{ "pile_set_name": "Github" }
#!/usr/bin/env python import os.path import sys import timeit DIR = os.path.dirname(os.path.abspath(__file__)) REPO = os.path.dirname(os.path.dirname(DIR)) sys.path.insert(0, REPO) N = 2500 TEXTS = ["aa " * N, "\\\\ " * N, "\\ " * N, "== " * N, "$$ " * N, "$= " * N] ITERATIONS = 10 ** 0 for text in TEXTS: timer = timeit.Timer( "HASHTAG.findall(text)", setup='from rednotebook.data import HASHTAG; text = "{text}"'.format( **locals() ), ) print(text[:10], timer.timeit(ITERATIONS))
{ "pile_set_name": "Github" }
## 人生是美好的,但过程确实是痛苦的 2008年4月10日 【背景】2006年5月28日,华为员工、25岁的胡某因病毒性脑炎死亡;2007年7月18日,年仅26岁的华为员工张某在深圳梅林某小区的楼道内自缢身亡;2007年8月11日,华为长春办事处员工赵某纵身从7楼跳下身亡; 2008年2月26日,华为成都员工李某从研发中心楼跃下。 知道大家都是先进党员,我很羡慕你们,你们很光荣,你们是我们公司中很重要的榜样,榜样的力量是无穷的。今天主要跟大家交流,应该怎么来看待现实生活和工作中的问题,以及帮助一些认识上还有差距的同事。同时,通过你们向下传达一个精神:就是我认为人生是非常美好的,但过程确实是痛苦的。 人生出来最终要死,那何必要生呢?人不努力可以天天晒太阳,那何必要努力以后再去度假晒太阳呢?如果从终极目标来讲,觉得什么都是虚无的,可以不努力,那样就会产生悲观的情绪。我们生命有七八十年,这七八十年中努力和努力不一样,各方面都会不一样的。在产生美的结果的过程中,确实充满着痛苦。农夫要耕耘才会有收获;建筑工人不惧日晒雨淋,才会有城市的美好;没有炼钢工人在炉火旁熏烤,就没有你的潇洒美丽,没有你驾驶的汽车,而他们不再需要什么护肤品;海军陆战队员不进行艰苦顽强的训练,一登陆,就会命丧沙滩。少壮不努力,老大徒伤悲,我想各位考上大学,都脱了一层皮吧……所有一切,没有付出,是绝不会有收获的。鲜花的美丽,没有肥料,以及精心照料,是不可能的。当然这些都是必要的痛苦,我今天要讲讲如何避免一些不必要的痛苦。 一、不要做一个完人,做完人很痛苦的。要充分发挥自己的优点,使自己充满信心去做一个有益于社会的人 金无足赤,人无完人。完人实际上是很少的, 我不希望大家去做一个完人。大家要充分发挥自己的优点,做一个有益于社会的人,这已经很不错了。我们为了修炼做一个完人,抹去了身上许多的棱角,自己的优势往往被压抑了,成了一个被驯服的工具。但外部的压抑并不会使人的本性完全消失,人的内在本性的优势,与外在完人的表现形式,不断地形成内心冲突,使人非常的痛苦。我希望把你的优势充分发挥出来,贡献于社会,贡献于集体,贡献于我们的事业。每个人的优势加在一起,就可以形成一个具有“完人”特制的集体。 我的缺点和劣势是明显的。我大学时代,没有能参加共青团,通不过呀,我是优点很突出,缺点也很突出的人,怎么能通得过呢?我在军队这个大熔炉里,尽管我非常努力,但也加入不了共产党。我加入共产党是在粉碎四人帮以后,上级领导认为我有重大贡献,在其直接干预下,我才加入了共产党。按正常情况来看,我肯定也是有问题的。我并不埋怨任何人,他们指出的确实是我的不足。我们公司以前有位员工,已经到美国去了,他走的时候跟我说,你这个人只能当老板,如果你要打工,没有公司会录用你。 我在人生的路上自我感觉是什么呢?就是充分发挥自己的优势。比如说我英文不好,是现在不好,但是不等于说我外语能力不行,我在大学可是外语课代表,我那时还自学了英语、日语,都能简单交流,看书了。但后来为什么不行了呢?20年军旅生涯没使用这个工具,就生疏了。当我走向新的事业的时候,虽然语言对我很有用处,但发现我的身上最主要的优势是对逻辑及方向的理解,远远深刻于对语言的修炼。如果用很多精力去练语言,可能对逻辑的理解就很弱化。我放弃对语言的努力,集中发挥我的优势,这个选择是正确的。对于我来说,虽然英文好,可能我在人们面前会挺风光的,但是我对社会价值的贡献完全不一样了。我就放弃一些东西,集中精力充分发挥我的优点。我确实注重于重要东西的思维,可能忽略了小的东西。小的东西不等于不需要重视,但我确实没有注意。 在人生的路上,我希望大家不要努力去做完人。一个人把自己一生的主要精力用于去改造缺点,等你改造完了对人类有什么贡献呢?我们所有的辛苦努力,不能对客户产生价值,是不行的。从这个角度来说,希望大家能够重视自己优点的发挥。当然不是说不必去改造缺点。为什么要讲这句话呢,完人的心理负荷太重了,大多数忧郁症的患者,包括精神病患者,他们中的大多数在社会中是非常优秀的人,他们绝不是一般人,一般人得不了这个病,就是因为太优秀了,对自己追求目标太高了,这个目标实现不了,而产生的心理压力。我不是说你不可以做出伟大的业绩来,我认为最主要的是要发挥自己的优势,实现比较现实的目标。这样心理的包袱压力才不会太重,才能增强自己的信心,当然这个信心包括活下去的信心,生命的信心。希望各级组织在和党员进行教育的时候,不要过多关注缺点,多关注他人的优点。 每个人都发挥自己的优势,也多看看别人的优点,从而减少自己心理太多的压抑。要正确地估计自己,绝大多数人都会比较过高估计自己。我们的豪言壮语如果偏离了我们的实际,你会浪费你很多精力,而不能实现你的理想。有一首歌叫《铃儿响叮当》,这首歌现在已经成为西方圣诞节里不可缺少的歌,其作者是约翰·皮尔彭特。他的一生从来就是过高地估计自己,他设计的人生目标最后全都失败了。直到87岁,那天出去参加人家的圣诞平安夜,在途中,赶着雪橇车的时候,随意哼唱出这首歌,结果这首歌就成了脍炙人口的世界名曲。你看看,过去的失败,就因为他没有正确对待自己,没有正确对待自己的人生,他浪费了80多年不应该浪费的光阴。 大家要正确估计自己,然后作出对自己的正确判断,这样才能够充分发挥自己的作用。同时,要认识这个社会上差距是客观存在的。没有水位差,就不会有水的流动;没有温度差,风就不能流动;就算是机器人,机器人还有温差,对吧?人和人的差距是永远存在的。同一个父母生下的小孩,也是有差距的,更何况你们不同父母。当自己的同学、同事进步了,产生了差距,应该判别自己是否已经发挥了自己的优势,若已经发挥了,就不要去攀比,若没有发挥好,就发挥出来。 公司有的员工,心里面常常忿忿不平,觉得委屈他啦!其实我们公司很简单,并不像他们说的那样不公平。一个新员工进入这个公司,他们前半年先培训,后面一年左右主要是熟悉工作,他们真正产生贡献是在两年后,他们进公司时大约五六千块钱,这样的报酬在社会上已经不低了。但是他们和老员工对比,觉得忿忿不平,说老员工有股票。大家也要想一想,红军从爬雪山过草地,到了北京,这过程仅仅经历了十四年。他们从一个少年才变成一个青年,到北京就当了部长。这个差异是客观存在的。战火纷飞的时候,别人攻上山头,给他一个英雄或者给他一个连长,然后也有人忿忿不平:“我不就是没冲上这个山头吗?”那不就是你没有过雪山草地,不就是你没有冲上山头吗?就是说,你在这个创业风险时期,你没有出现,当时公司处在风险时期,他们将工资奖金全部家当都投入到公司了。你那时还没有进入这个公司,所以你没有分享到那时的一份风险与一份幸福。 人生一定要有一个自我的满足感。你要和社会去比,和自己的纵向比,和你爸爸妈妈比。你想你爷爷那个时候可能一个月只有四五十块钱的工资,到你爸爸妈妈那时候一个月可能就有四五百工资了,到了你有四五千块工资啊。实际上你已经有很大进步了,对吧?你需要更大的进步,你就需要更大的努力,所以不存在新老员工之差。新老员工在薪酬体系上是处于同一个轨道的。在公司创业初期,公司需要大量的资金投入,老员工就把自己的工资拿出来了,换成了公司给他的一张纸,这张纸就是告诉他,红军长征胜利回来以后,我挖过你的红苕,你拿这张纸事后可以领大洋。华为一旦崩溃了,他们就将一无所有,那张纸就变成了废纸。现在已实行饱和配股,已经可以缓解以后的差距,你也会成为老员工的。华为公司是无法帮助解决你的不公平的,你选择了华为,你就选择了艰苦奋斗,因为我们这种没有背景的公司,活下去的唯一可能就是要比别人多努力一点,不然它不可能活下去。有些拥有资源的公司,情况会好一些。 人要有进取心,要努力,要做出贡献,但是也要有满足感。自己的力量发挥到最大,就应对人生无愧无悔。 员工暴露出的思想问题,我认为还是缺少对一些客观的认识,对客观规律和客观现实的认识。如果我们都不能认识这个问题,我们的心理障碍就很大。想想不舒服,嫉妒之心不就是这么来的。不舒服的情绪慢慢使自己变成忧闷,慢慢就成为一个死结,最后打不开这个死结,慢慢就成为一个心理障碍了。当然你们先进党员是没这个问题啊,我是通过你们党员给我们全体员工,通过党员活动给周围的员工一些关爱,给他们思想作一些辅导,因为他们太年轻了,他们不太懂得自己的人生。 我曾经在公司讲过,人生最美好的就是生命,没有什么东西比生命更高贵,所以一切都要为了生命。 要爱惜生命,不管是在工作中,还是生活中,不管在哪方面都要爱惜生命。工作太累了一定要休息。公司现在有文件,对那些冲击项目短期太累的员工,可以短期到海滨度假休整一下,由行政费用开支,公司已有文件。有的员工奋斗强度太大,太艰苦了,主管看到你脸色不太好了,可以从前线把他拖下来,休养休养,缓冲一下。 近期有些员工自杀,我心里是很沉重的,也很理解他们,因为从99年到2007年,其实我个人就有多次有感觉活不下去的经历,我跟他们是同类,所以我才有这么多感触。但是我有一个最大的优点,我开放,我讲出来。我知道自己是病,难受得很,实在受不了的时候,我会往外打电话,诉说自己的心里感受,没有一个人会劝你自杀的。我以前不知道这是病,也不知道这个能治,后来就治好了。我记得郭平在美国跟我谈心的时候说:“老板,你要找一些无聊的事情来干”。所谓无聊的事情就是瞎聊瞎侃,把精神岔开,慢慢就不会想这件事,可能病也就好了。后来我写了一篇文章,到北京景山公园去看看唱歌啊,到云南丽江看少数民族对歌啊,到热闹的地方去哄一哄、闹一闹啊,可能人就释放,就会好一点。 员工要多一些朋友,很多出问题的员工,最大的问题是没朋友,我希望员工在这个时候要多几个朋友。多一个朋友,就多有一个打电话的地方,实在闷得受不了就打电话嘛,疏导一些总会有好处的。 大家要珍惜生命,近些年来有员工自杀,大多数是个人原因,有些进来也就一个月不到两个月左右,时间比较短。我们忽略了心理测试,对他们的心理关怀也不够,不论谁出现这种情况,他们都是我们的战友,我们都是心疼的,我很理解他们,我希望大家也理解他们。希望好好理解我上面讲的话,看到自己生命中的优点,不断地激励自己,不要光看自己的缺点,背那么多包袱,背那么重的包袱。 整个社会的环境和氛围已经很宽容了,同性恋在这个社会上也不会受到太多的谴责和歧视!你既然有这么大的精神压力,你为什么要选择这条道路呢?你既然选择了这条路,就说明你认为它是正确的,是你的追求,那你怕什么呢?所以我认为我们很多员工面对生命过于草率,实在不好,不好。特别是工作没有成绩啊,决策失误啊,走向这一步,更不好!我们有的员工的精神包袱太大,在这个进取的团队里面,落伍了就感到有点压力。有什么压力啊?做员工有什么不可以的啊?这个世界上多数都是做员工的啊!做领袖的人总的还是少数的,领袖也是偶然机会啊,也不是说是必然机会的啊。所以说公平有时候是无从说起啊。 华为公司总的来说是个内部很宽容的公司,不像社会上想象的那样。有些误解的人,主要是不了解我们,我也是可以理解的。千秋功罪,何必要评说呢?你何必要等到评说呢?没人会给你评说,你放心好了。你就好好珍惜自己,不要太多地听信闲言碎语,不要有太多的精神压力和包袱。 我讲的第二个问题,是大家要对经济全球化以及市场竞争的艰难性、残酷性做好充分的心理准备。 经济全球化是美国推出来的,美国最后看到经济全球化对美国并不有利,所以美国在退向贸易保护主义,但是保也保不住,经济全球化这个火烧起来了,就会越烧越旺。过去的一百多年,经济的竞争方式是以火车、轮船、电报、传真等手段来进行的,竞争强度是不大的,从而促进了资本主义在前一百多年,有序的、很好的获得发展。而现在,由于光纤与计算机的发展,形成网络经济,形成资源的全球化配置。使交付、服务更加贴近客户,快速而优质的服务;使制造更加贴近低成本;研发更加贴近人才集中的低成本地区……。这使竞争的强度大大增强,将会使优势企业越来越强,没优势的企业越来越困难。特别是电子产业将会永远的供过于求,困难的程度,是可以想象的。 经济全球化使得竞争越来越残酷了,特别是我们电子行业,竞争极其残酷。我就举个例子来看:电子产品的性能、质量越来越高,越来越需高素质人才,而且是成千上万,数万的需求,这些人必需有高的报酬才合理。但电子产品却越来越便宜。这就成了一个矛盾,如何得以解决,我们期待某一个经济学家,能获得电子经济诺贝尔奖。 我们仅是比其他公司对这个竞争残酷性早了一点点认识,我们才幸免于难。你们读书的时候都很崇拜贝尔实验室的吧?十多年前,我去贝尔实验室,当时DWDM还处在发明阶段,发明的一个波,就是GW载波,当时光纤还只能有三个载波,发明这项技术的博士亲自给我做图形表演。结果没多久光传输像排山倒海一样,迅速的形成过剩,把贝尔实验室也席卷了,大水冲了龙王庙。成则亦光,败则亦光。我们也在这里苟延残喘。我们的光传输产品,七、八年来降价了二十倍。市场经济的过剩就像绞杀战一样。绞杀战如什么呢?就如拧毛巾,这毛巾只要拧出水来,就说明还有竞争空间,毛巾拧断了企业也完了,只有毛巾拧干了,毛巾还不断,这才是最佳状态。华为公司能长久保持到这个状态吗?我这两天批了一个文件给业务口征求意见,我写了一段对话,我提到了思科,当然我是歌颂了钱伯斯,思科现在开始实行很多政策,如减少员工出差,减少会议,来提高效率,高层领导出差不能坐头等舱,要坐,须自己掏钱,等等这一系列的措施。思科尚且如此,华为就能独善其身? 支撑信息产业发展的两个要素,一是数码,取之不尽用之不竭,还不用缴任何专利费;二是二氧化硅,做硅片的。这两个东西取之不尽用之不竭的,导致电子产品过剩。过剩的结果就是大家都拧毛巾,绞杀战。西方公司过去日子太好了,拧的水太多了,所以拧着拧着把自己拧死了,我们也不是最佳状态。我们公司的铺张浪费还很多的。 在这种情况下,怎么办?当然我曾经悲观过啊,但是每次犯忧郁症的时候就是那种病态,但不是我的完整思想。我曾经很发愁,觉得苦闷啊。华为公司只要稍稍不行了,怎么发工资啊?我觉得这是很大的压力。我们不是悲观主义者,但也要对经济全球化以及市场竞争的残酷性要有充分的心理准备。如果华为衰落怎么办?如何才能不衰落呢?总有一天,别人在发展,而我们在落后的。 这个世界的变化是很大的,唯一不变的是变化。面对这样的变化,每个企业,如果不能奋起,最终就是灭亡,而且灭亡的速度很快。以前我们还有祖传秘方,比如说爷爷打菜刀打得很好,方圆五十里都知道我们家菜刀好,然后孙子继承了爷爷的手艺。在方圆五十里我还是优秀的铁匠,就能娶到了一朵金花啊。那现在铁匠还行吗?现在经济全球化啦。人家用碳纤维做的刀,削铁如泥,比钢刀还好得多。你在方圆几公里几十公里曾经流传几十年几百年的祖传,就被经济全球化在几秒钟内打得粉碎。所以在这样的情况下,就给每个人带来了生存的困难,所以每个人都要寻找生存的基点。 但是,竞争是好,还是坏?竞争使这个世界进步了,加速了,美好了。我们享受了这种美好。五十年前,我记得我上小学的时候还打赤脚,还穿草鞋。我的梦想就是穿一双橡胶底的鞋。你看现在好多人都开汽车了,五十年的变化是不可想像的。当年我在欧洲坐豪华的列车时,就想“哎,中国这是没戏啰!”我在美国坐了豪华大巴时,“哎,在中国可能我坐不上了,看不见了。”中国在这么短的时间发展这么快,我想都没想到,社会进步是很快的,这个社会进步给每个人带来了美好,但是也带来了痛苦。WTO是把物价降下来了,但是也让很多人失业了。 美国竞争失利是因为他们薪酬太高而失利,而不是因为华为的崛起使他们失败了。所以美国很多要人跟我交流,我就讲是你们失败是因为你们的薪酬点太高了,不可能这么高的薪酬,怎么可能啊?你们的薪酬从哪里来的?是从那些GDP只有200多个美金的非洲的弟兄们那儿取来的钱,来供这些IT皇帝们,能供得起吗?供不起的。最终有一天会支撑不起的。 我们要加强对员工的关怀。我最近不是讲了吗?我们EMT作的决定,就是对那些前线竞争进行投标、进行高强度作业、压力太大的员工,可以短时间到海滨去度假,费用由公司支付。还有一些奋斗强度太大,短时间身体不太好的,可以临时拖到五星级酒店缓冲一下。我们的国际救援都是一级救援的啊。我们买的是美国AIA的保险,我们每年为员工支付的各种保障费用大约是八个亿,我们员工在海外有意外,有直升飞机送到他们认证的医院去抢救,我们当然不希望这种事情发生。 我们希望大家要互相关爱,特别是各级党组织的支部书记、支委员,能不能跟员工交交朋友,跟他们谈谈心,吃顿饭?你想想,在非洲那么荒凉的地方,大家出去撮一顿,大家可能就增强了友谊,可能就是因为你跟他的友谊,他给你打了一个电话,你救了他一条命。所以我号召我们党组织要跟员工做朋友。当然我讲每级行政管理团队都要和员工有一个定时间的沟通,定一个时间,多长时间你们和员工有一个沟通,十分钟、十五分钟都是可以的,你要沟通。在调动工作时,主管一定要和本人做沟通,不能什么都不告诉他,简单命令一下,这样草率,草菅人命,不好。这种东西容易引起很多矛盾。其实很多事情并不是这样子,讲清楚就好了。所以我讲的就是希望大家互相关爱,这种关爱精神一定要有。这样可以平缓竞争给人们带来的心理压力。 第三点,如何面对当前的形势,如何面对竞争对手,我们应该怎么办? 其实就是必须继续努力,要一天比一天有一点点进步。我们没有奋斗的终极目标,不奋斗是没有出路的。不管形势如何变化,只要我们团结合作,紧张而镇定,总会有活路的。同时我们也不要仅为自己生存,而去做一些不应该做的行为。我们要做一个国际市场秩序的维护者,而不是一个破坏者。我们要遵循这些规律,而不是颠覆这些规律。我们要积极地向强者学习,尊重他们的市场领导地位,积极、但有序地开展竞争,以激活双方的组织体系,实现共赢。 近几年,我国的经济形势也可能出现下滑,希望高级干部要有充分的心理准备。也许2009年、2010年还会更加困难。宏观经济不好,对我们员工来说应该不会有太大的影响,但对你们的家庭可能有很多困难。比如说肉涨价啦,奶粉涨价啦,大米涨价啦,都会带来你周围的亲戚、朋友的困难。我们应该怎么办? 我要讲的是,一定要理解国家在这个变革时期的困难。中国这三十年来的变化是巨大的,国家的富强是我们想象都想象不到的。但快速发展的经济,也不可能持久不变,也会遇到调整。中国历史上走过的路都是弯弯曲曲走过来的,右一阵子左一阵子,左一阵子右一阵子,但是它总的还是在往前走,所以我们对“左一阵子右一阵子”要忍耐。不要去发表任何不负责任的言论,更不要“指点江山,激扬文字”。我们一定要有忍耐!我为什么有点担心呢?担心社会可能不忍耐。如果社会不能忍耐,出了乱子的时候,我们应严格要求员工,不准发表任何政治言论,更不允许上街去参加什么活动。去年经济好的时候,你讲的话出格就算啦,没关系,现在不要讲了。关键时刻你不能发表任何讲话,给社会添麻烦。要保持与党和国家一致,千万不要在这个时候拆国家的台。国家也很难。我们态度讲清楚:你乱发表言论,你上街游行,我们是要辞退的。但,你的退职金还是要发给你的。 要有一个思想准备,不见得我们是这么平安,这么平稳的。千万不要以为自己能改变这个世界,其实我们才是幼稚可笑的,不要有太多幻想。努力做好你们的份内工作,就是对这个国家最大的忠诚。我们会处于一个敏感的政治时期。这个时期特别是党员要带头,与党和国家保持一致。也可能这个时候,可能在很多问题上有自己的见解,我认为这都是可能的,但是你的行为必须要被约束。 看看大家还有什么问题要提一提,我讲的不对的大家也可以批评。 党员1:我是中央研发部的刘桑,是一个支部书记。有几点我想谈一下感想啊。第一个就是基层的员工对党组织这一块儿还是相当认同的。以我们支部为例,去年就有20多个人递交入党申请书。我觉得还是很欣慰的,就是我们员工对党的兴致是很高的。第二点,就是您谈到的自我满足感。我深有同感,我想起了我以前在读大学的时候一些事情。当时遇到很烦心事情的时候,我就跑到工地上去看看,看民工在工地里挖土地,看他们吃青菜,几个人吃一碗青菜,我就觉得很多事情都可以去解决。我觉得这种满足感对我们的成长是很有利的。 任总:对有人积极要求入党,我也很高兴,但是他们一定要严格按照共产党员的标准来要求自己,不要图时髦。你要认识到党员的责任、义务,你才进入这个党。你怎么继续改造自己?入了党就增加一种约束,你愿意有这种约束,而且你愿意履行这种义务,甚至一生一世,这是要想清楚的。 党员2:就是刚才任总在你的讲话中提到了,你有近20年的这样的军旅生涯。我想问的就是,在这20年的军旅生涯中,从今天回过头来看,您的认识和思考有着怎样的变化,是怎样变化的? 任总:这20年对我起到的作用,就是服从、吃苦和忍耐。收获的最多的就是服从。军人最后的结果就是服从。叫你怎么干就怎么干,错的也得干。我们现在的青年中,自由度是很大了。我们那个时代是不考虑有自由的,我们怎么敢乱说话?老老实实搞点技术,一句话都不过问的。看到你们今天活蹦乱跳的,我们好羡慕。我真想倒过来和你们换换年龄。 党员3:任总,我是中研负责员工关系的,我不是优秀党员。我有一个问题是在工作中遇到的,就是现在80后员工中有一个说法,就是要“快乐工作,快乐生活”。我想了很久,要做到“快乐工作”是很难的,我认为工作其实是很辛苦的,有的时候是痛苦的,但是生活或者说工作的目标是可以很快乐的。我想了解一下任总您是怎么看,因为如果说我们对这个工作或者是生活的看法,认为一直是快乐的,如果遇到挫折他可能就不能接受。我个人认为,就应该告诉80后,工作和生活其实是有冲突的。 任总:首先要搞清楚什么叫快乐。如果不搞清什么是快乐呢,那就不知道快乐涵义是什么。如果快乐是精神的,应该没问题,如果是物质的,可能就很难了。精神在你自己,是不需要成本的,只要你心里快乐就一定快乐。但物质就不一样,物质在别人手里,他要等价交换的。你不付出别人就不会提供给你的。但如果你把人生的目标定义为希望做一件事,然后为这件事付出多大的努力都在所不辞,你觉得这是快乐,那它就是快乐。你的快乐就是你的奉献,使你产生快乐,你没有奉献就不能产生快乐。所以快乐的定义是什么?首先要定义什么是快乐。80后的年轻人,很坦诚、不隐晦、比较好交流,大家也可以相互讨论一下,怎么能快乐。其实80前,80后没有什么本质区别,80后总有人要承担起国家兴亡的责任的。
{ "pile_set_name": "Github" }
define( ({ insertEntity: "Symbool invoegen" }) );
{ "pile_set_name": "Github" }
--- title: "'System.Runtime.InteropServices.DllImportAttribute' no se puede aplicar a métodos de interfaz." ms.date: 07/20/2015 f1_keywords: - bc31530 - vbc31530 helpviewer_keywords: - BC31530 ms.assetid: e63f1f7d-b7df-4637-a0f4-2783479ca1af ms.openlocfilehash: 501d9ace06571df85eb62a56eeb68332a0df44f7 ms.sourcegitcommit: bf5c5850654187705bc94cc40ebfb62fe346ab02 ms.translationtype: MT ms.contentlocale: es-ES ms.lasthandoff: 09/23/2020 ms.locfileid: "91062751" --- # <a name="systemruntimeinteropservicesdllimportattribute-cannot-be-applied-to-interface-methods"></a>'System.Runtime.InteropServices.DllImportAttribute' no se puede aplicar a métodos de interfaz. Un procedimiento se define dentro de una interfaz, pero la definición de procedimiento se aplica <xref:System.Runtime.InteropServices.DllImportAttribute>. Common Language Runtime (CLR) reconoce este atributo y su propiedad <xref:System.Runtime.InteropServices._Assembly.EntryPoint%2A> como la designación de un procedimiento de reemplazo definido en una biblioteca de vínculos dinámicos (DLL) no administrada fuera de .NET Framework. Si el código llama al procedimiento en el que se aplica <xref:System.Runtime.InteropServices.DllImportAttribute> , Common Language Runtime llama en su lugar al procedimiento no administrado designado. Dado que la definición de un procedimiento dentro de una interfaz no incluye ninguna implementación, no puede interoperar con plataformas no administradas fuera de .NET Framework. **Identificador de error:** BC31530 ## <a name="to-correct-this-error"></a>Para corregir este error - Quite <xref:System.Runtime.InteropServices.DllImportAttribute> de la definición de este procedimiento. ## <a name="see-also"></a>Vea también - <xref:System.Runtime.InteropServices.DllImportAttribute> - [Instrucción Interface](../language-reference/statements/interface-statement.md)
{ "pile_set_name": "Github" }
// Copyright 2009, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: [email protected] (Zhanyong Wan) // This program is meant to be run by gtest_help_test.py. Do not run // it directly. #include "gtest/gtest.h" // When a help flag is specified, this program should skip the tests // and exit with 0; otherwise the following test will be executed, // causing this program to exit with a non-zero code. TEST(HelpFlagTest, ShouldNotBeRun) { ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; } #if GTEST_HAS_DEATH_TEST TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} #endif
{ "pile_set_name": "Github" }
SMDKC100 BOARD M: Minkyu Kang <[email protected]> S: Maintained F: board/samsung/smdkc100/ F: include/configs/smdkc100.h F: configs/smdkc100_defconfig
{ "pile_set_name": "Github" }
/* * VFIO API definition * * Copyright (C) 2012 Red Hat, Inc. All rights reserved. * Author: Alex Williamson <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _UAPIVFIO_H #define _UAPIVFIO_H #include <linux/types.h> #include <linux/ioctl.h> #define VFIO_API_VERSION 0 /* Kernel & User level defines for VFIO IOCTLs. */ /* Extensions */ #define VFIO_TYPE1_IOMMU 1 #define VFIO_SPAPR_TCE_IOMMU 2 #define VFIO_TYPE1v2_IOMMU 3 /* * IOMMU enforces DMA cache coherence (ex. PCIe NoSnoop stripping). This * capability is subject to change as groups are added or removed. */ #define VFIO_DMA_CC_IOMMU 4 /* Check if EEH is supported */ #define VFIO_EEH 5 /* Two-stage IOMMU */ #define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ /* * The IOCTL interface is designed for extensibility by embedding the * structure length (argsz) and flags into structures passed between * kernel and userspace. We therefore use the _IO() macro for these * defines to avoid implicitly embedding a size into the ioctl request. * As structure fields are added, argsz will increase to match and flag * bits will be defined to indicate additional fields with valid data. * It's *always* the caller's responsibility to indicate the size of * the structure passed by setting argsz appropriately. */ #define VFIO_TYPE (';') #define VFIO_BASE 100 /* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */ /** * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0) * * Report the version of the VFIO API. This allows us to bump the entire * API version should we later need to add or change features in incompatible * ways. * Return: VFIO_API_VERSION * Availability: Always */ #define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0) /** * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32) * * Check whether an extension is supported. * Return: 0 if not supported, 1 (or some other positive integer) if supported. * Availability: Always */ #define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1) /** * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32) * * Set the iommu to the given type. The type must be supported by an * iommu driver as verified by calling CHECK_EXTENSION using the same * type. A group must be set to this file descriptor before this * ioctl is available. The IOMMU interfaces enabled by this call are * specific to the value set. * Return: 0 on success, -errno on failure * Availability: When VFIO group attached */ #define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2) /* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */ /** * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3, * struct vfio_group_status) * * Retrieve information about the group. Fills in provided * struct vfio_group_info. Caller sets argsz. * Return: 0 on succes, -errno on failure. * Availability: Always */ struct vfio_group_status { __u32 argsz; __u32 flags; #define VFIO_GROUP_FLAGS_VIABLE (1 << 0) #define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1) }; #define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3) /** * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32) * * Set the container for the VFIO group to the open VFIO file * descriptor provided. Groups may only belong to a single * container. Containers may, at their discretion, support multiple * groups. Only when a container is set are all of the interfaces * of the VFIO file descriptor and the VFIO group file descriptor * available to the user. * Return: 0 on success, -errno on failure. * Availability: Always */ #define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4) /** * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5) * * Remove the group from the attached container. This is the * opposite of the SET_CONTAINER call and returns the group to * an initial state. All device file descriptors must be released * prior to calling this interface. When removing the last group * from a container, the IOMMU will be disabled and all state lost, * effectively also returning the VFIO file descriptor to an initial * state. * Return: 0 on success, -errno on failure. * Availability: When attached to container */ #define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5) /** * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char) * * Return a new file descriptor for the device object described by * the provided string. The string should match a device listed in * the devices subdirectory of the IOMMU group sysfs entry. The * group containing the device must already be added to this context. * Return: new file descriptor on success, -errno on failure. * Availability: When attached to container */ #define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6) /* --------------- IOCTLs for DEVICE file descriptors --------------- */ /** * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7, * struct vfio_device_info) * * Retrieve information about the device. Fills in provided * struct vfio_device_info. Caller sets argsz. * Return: 0 on success, -errno on failure. */ struct vfio_device_info { __u32 argsz; __u32 flags; #define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */ #define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */ __u32 num_regions; /* Max region index + 1 */ __u32 num_irqs; /* Max IRQ index + 1 */ }; #define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7) /** * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8, * struct vfio_region_info) * * Retrieve information about a device region. Caller provides * struct vfio_region_info with index value set. Caller sets argsz. * Implementation of region mapping is bus driver specific. This is * intended to describe MMIO, I/O port, as well as bus specific * regions (ex. PCI config space). Zero sized regions may be used * to describe unimplemented regions (ex. unimplemented PCI BARs). * Return: 0 on success, -errno on failure. */ struct vfio_region_info { __u32 argsz; __u32 flags; #define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */ #define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */ #define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */ __u32 index; /* Region index */ __u32 resv; /* Reserved for alignment */ __u64 size; /* Region size (bytes) */ __u64 offset; /* Region offset from start of device fd */ }; #define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8) /** * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9, * struct vfio_irq_info) * * Retrieve information about a device IRQ. Caller provides * struct vfio_irq_info with index value set. Caller sets argsz. * Implementation of IRQ mapping is bus driver specific. Indexes * using multiple IRQs are primarily intended to support MSI-like * interrupt blocks. Zero count irq blocks may be used to describe * unimplemented interrupt types. * * The EVENTFD flag indicates the interrupt index supports eventfd based * signaling. * * The MASKABLE flags indicates the index supports MASK and UNMASK * actions described below. * * AUTOMASKED indicates that after signaling, the interrupt line is * automatically masked by VFIO and the user needs to unmask the line * to receive new interrupts. This is primarily intended to distinguish * level triggered interrupts. * * The NORESIZE flag indicates that the interrupt lines within the index * are setup as a set and new subindexes cannot be enabled without first * disabling the entire index. This is used for interrupts like PCI MSI * and MSI-X where the driver may only use a subset of the available * indexes, but VFIO needs to enable a specific number of vectors * upfront. In the case of MSI-X, where the user can enable MSI-X and * then add and unmask vectors, it's up to userspace to make the decision * whether to allocate the maximum supported number of vectors or tear * down setup and incrementally increase the vectors as each is enabled. */ struct vfio_irq_info { __u32 argsz; __u32 flags; #define VFIO_IRQ_INFO_EVENTFD (1 << 0) #define VFIO_IRQ_INFO_MASKABLE (1 << 1) #define VFIO_IRQ_INFO_AUTOMASKED (1 << 2) #define VFIO_IRQ_INFO_NORESIZE (1 << 3) __u32 index; /* IRQ index */ __u32 count; /* Number of IRQs within this index */ }; #define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9) /** * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set) * * Set signaling, masking, and unmasking of interrupts. Caller provides * struct vfio_irq_set with all fields set. 'start' and 'count' indicate * the range of subindexes being specified. * * The DATA flags specify the type of data provided. If DATA_NONE, the * operation performs the specified action immediately on the specified * interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]: * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1. * * DATA_BOOL allows sparse support for the same on arrays of interrupts. * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]): * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3, * data = {1,0,1} * * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd. * A value of -1 can be used to either de-assign interrupts if already * assigned or skip un-assigned interrupts. For example, to set an eventfd * to be trigger for interrupts [0,0] and [0,2]: * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3, * data = {fd1, -1, fd2} * If index [0,1] is previously set, two count = 1 ioctls calls would be * required to set [0,0] and [0,2] without changing [0,1]. * * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used * with ACTION_TRIGGER to perform kernel level interrupt loopback testing * from userspace (ie. simulate hardware triggering). * * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER * enables the interrupt index for the device. Individual subindex interrupts * can be disabled using the -1 value for DATA_EVENTFD or the index can be * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0. * * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while * ACTION_TRIGGER specifies kernel->user signaling. */ struct vfio_irq_set { __u32 argsz; __u32 flags; #define VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */ #define VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */ #define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */ #define VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */ #define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */ #define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */ __u32 index; __u32 start; __u32 count; __u8 data[]; }; #define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10) #define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | \ VFIO_IRQ_SET_DATA_BOOL | \ VFIO_IRQ_SET_DATA_EVENTFD) #define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | \ VFIO_IRQ_SET_ACTION_UNMASK | \ VFIO_IRQ_SET_ACTION_TRIGGER) /** * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11) * * Reset a device. */ #define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11) /* * The VFIO-PCI bus driver makes use of the following fixed region and * IRQ index mapping. Unimplemented regions return a size of zero. * Unimplemented IRQ types return a count of zero. */ enum { VFIO_PCI_BAR0_REGION_INDEX, VFIO_PCI_BAR1_REGION_INDEX, VFIO_PCI_BAR2_REGION_INDEX, VFIO_PCI_BAR3_REGION_INDEX, VFIO_PCI_BAR4_REGION_INDEX, VFIO_PCI_BAR5_REGION_INDEX, VFIO_PCI_ROM_REGION_INDEX, VFIO_PCI_CONFIG_REGION_INDEX, /* * Expose VGA regions defined for PCI base class 03, subclass 00. * This includes I/O port ranges 0x3b0 to 0x3bb and 0x3c0 to 0x3df * as well as the MMIO range 0xa0000 to 0xbffff. Each implemented * range is found at it's identity mapped offset from the region * offset, for example 0x3b0 is region_info.offset + 0x3b0. Areas * between described ranges are unimplemented. */ VFIO_PCI_VGA_REGION_INDEX, VFIO_PCI_NUM_REGIONS }; enum { VFIO_PCI_INTX_IRQ_INDEX, VFIO_PCI_MSI_IRQ_INDEX, VFIO_PCI_MSIX_IRQ_INDEX, VFIO_PCI_ERR_IRQ_INDEX, VFIO_PCI_NUM_IRQS }; /** * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12, * struct vfio_pci_hot_reset_info) * * Return: 0 on success, -errno on failure: * -enospc = insufficient buffer, -enodev = unsupported for device. */ struct vfio_pci_dependent_device { __u32 group_id; __u16 segment; __u8 bus; __u8 devfn; /* Use PCI_SLOT/PCI_FUNC */ }; struct vfio_pci_hot_reset_info { __u32 argsz; __u32 flags; __u32 count; struct vfio_pci_dependent_device devices[]; }; #define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) /** * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13, * struct vfio_pci_hot_reset) * * Return: 0 on success, -errno on failure. */ struct vfio_pci_hot_reset { __u32 argsz; __u32 flags; __u32 count; __s32 group_fds[]; }; #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) /* -------- API for Type1 VFIO IOMMU -------- */ /** * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info) * * Retrieve information about the IOMMU object. Fills in provided * struct vfio_iommu_info. Caller sets argsz. * * XXX Should we do these by CHECK_EXTENSION too? */ struct vfio_iommu_type1_info { __u32 argsz; __u32 flags; #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ __u64 iova_pgsizes; /* Bitmap of supported page sizes */ }; #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) /** * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map) * * Map process virtual addresses to IO virtual addresses using the * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required. */ struct vfio_iommu_type1_dma_map { __u32 argsz; __u32 flags; #define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */ __u64 vaddr; /* Process virtual address */ __u64 iova; /* IO virtual address */ __u64 size; /* Size of mapping (bytes) */ }; #define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13) /** * VFIO_IOMMU_UNMAP_DMA - _IOWR(VFIO_TYPE, VFIO_BASE + 14, * struct vfio_dma_unmap) * * Unmap IO virtual addresses using the provided struct vfio_dma_unmap. * Caller sets argsz. The actual unmapped size is returned in the size * field. No guarantee is made to the user that arbitrary unmaps of iova * or size different from those used in the original mapping call will * succeed. */ struct vfio_iommu_type1_dma_unmap { __u32 argsz; __u32 flags; __u64 iova; /* IO virtual address */ __u64 size; /* Size of mapping (bytes) */ }; #define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) /* * IOCTLs to enable/disable IOMMU container usage. * No parameters are supported. */ #define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15) #define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16) /* -------- Additional API for SPAPR TCE (Server POWERPC) IOMMU -------- */ /* * The SPAPR TCE info struct provides the information about the PCI bus * address ranges available for DMA, these values are programmed into * the hardware so the guest has to know that information. * * The DMA 32 bit window start is an absolute PCI bus address. * The IOVA address passed via map/unmap ioctls are absolute PCI bus * addresses too so the window works as a filter rather than an offset * for IOVA addresses. * * A flag will need to be added if other page sizes are supported, * so as defined here, it is always 4k. */ struct vfio_iommu_spapr_tce_info { __u32 argsz; __u32 flags; /* reserved for future use */ __u32 dma32_window_start; /* 32 bit window start (bytes) */ __u32 dma32_window_size; /* 32 bit window size (bytes) */ }; #define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) /* * EEH PE operation struct provides ways to: * - enable/disable EEH functionality; * - unfreeze IO/DMA for frozen PE; * - read PE state; * - reset PE; * - configure PE. */ struct vfio_eeh_pe_op { __u32 argsz; __u32 flags; __u32 op; }; #define VFIO_EEH_PE_DISABLE 0 /* Disable EEH functionality */ #define VFIO_EEH_PE_ENABLE 1 /* Enable EEH functionality */ #define VFIO_EEH_PE_UNFREEZE_IO 2 /* Enable IO for frozen PE */ #define VFIO_EEH_PE_UNFREEZE_DMA 3 /* Enable DMA for frozen PE */ #define VFIO_EEH_PE_GET_STATE 4 /* PE state retrieval */ #define VFIO_EEH_PE_STATE_NORMAL 0 /* PE in functional state */ #define VFIO_EEH_PE_STATE_RESET 1 /* PE reset in progress */ #define VFIO_EEH_PE_STATE_STOPPED 2 /* Stopped DMA and IO */ #define VFIO_EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */ #define VFIO_EEH_PE_STATE_UNAVAIL 5 /* State unavailable */ #define VFIO_EEH_PE_RESET_DEACTIVATE 5 /* Deassert PE reset */ #define VFIO_EEH_PE_RESET_HOT 6 /* Assert hot reset */ #define VFIO_EEH_PE_RESET_FUNDAMENTAL 7 /* Assert fundamental reset */ #define VFIO_EEH_PE_CONFIGURE 8 /* PE configuration */ #define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21) /* ***************************************************************** */ #endif /* _UAPIVFIO_H */
{ "pile_set_name": "Github" }
#ifndef __DATA_STORAGE_H__ #define __DATA_STORAGE_H__ #include <cstdint> #include <type_traits> #include <utility> #include <vector> #include "../falconn_global.h" #include "prefetchers.h" // TODO: add tests namespace falconn { namespace core { class DataStorageError : public FalconnError { public: DataStorageError(const char* msg) : FalconnError(msg) {} }; // A class for providing access to points stored in a std::vector. // Using a DataStorage class in NearestNeighborQuery (as opposed to a // std::vector) allows us to use the same implementation of // NearestNeighborQuery for points stored in std::vectors, arbitrary memory // locations (keys are pointers), and contiguous data in an Eigen matrix. // TODO: implement EigenMatrixDataStorage and PointerDataStorage. template <typename PointType, typename KeyType = int32_t> class ArrayDataStorage { public: class FullSequenceIterator { public: FullSequenceIterator(const ArrayDataStorage& parent) : parent_(&parent) { if (parent_->data_.size() == 0) { parent_ = nullptr; index_ = -1; } else { index_ = 0; // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_, 0); if (parent_->data_.size() >= 2) { prefetcher_.prefetch(parent_->data_, 1); if (parent_->data_.size() >= 3) { prefetcher_.prefetch(parent_->data_, 2); } } } } FullSequenceIterator() {} const PointType& get_point() const { return parent_->data_[index_]; } const KeyType& get_key() const { return index_; } bool is_valid() const { return parent_ != nullptr; } void operator++() { if (index_ >= 0 && index_ + 1 < static_cast<int_fast64_t>(parent_->data_.size())) { index_ += 1; if (index_ + 2 < static_cast<int_fast64_t>(parent_->data_.size())) { // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_, index_ + 2); } } else { if (index_ == -1) { throw DataStorageError("Advancing invalid FullSequenceIterator."); } else { parent_ = nullptr; index_ = -1; } } } private: int_fast64_t index_ = -1; const ArrayDataStorage* parent_ = nullptr; StdVectorPrefetcher<PointType> prefetcher_; }; class SubsequenceIterator { public: SubsequenceIterator(const std::vector<KeyType>& keys, const ArrayDataStorage& parent) : keys_(&keys), parent_(&parent) { if (keys_->size() == 0) { keys_ = nullptr; parent_ = nullptr; index_ = -1; } else { index_ = 0; // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_, (*keys_)[0]); if (keys_->size() >= 2) { prefetcher_.prefetch(parent_->data_, (*keys_)[1]); if (keys_->size() >= 3) { prefetcher_.prefetch(parent_->data_, (*keys_)[2]); } } } } SubsequenceIterator() {} // Not using STL-style iterators for now because the custom format below // makes more sense in NearestNeighborQuery. /*const PointType& operator * () const { return parent->data[(*keys)[index_]]; }*/ const PointType& get_point() const { return parent_->data_[(*keys_)[index_]]; } const KeyType& get_key() const { return (*keys_)[index_]; } bool is_valid() const { return parent_ != nullptr; } /*bool operator != (const Iterator& rhs) const { if (parent_ != rhs.parent_) { return true; } else if (keys_ != rhs.keys_) { return true; } else if (index_ != rhs.index_) { return true; } return false; }*/ void operator++() { if (index_ >= 0 && index_ + 1 < static_cast<int_fast64_t>(keys_->size())) { index_ += 1; if (index_ + 2 < static_cast<int_fast64_t>(keys_->size())) { // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_, (*keys_)[index_ + 2]); } } else { if (index_ == -1) { throw DataStorageError("Advancing invalid SubsequenceIterator."); } keys_ = nullptr; parent_ = nullptr; index_ = -1; } } private: int_fast64_t index_ = -1; const std::vector<KeyType>* keys_ = nullptr; const ArrayDataStorage* parent_ = nullptr; StdVectorPrefetcher<PointType> prefetcher_; }; ArrayDataStorage(const std::vector<PointType>& data) : data_(data) {} /*std::pair<Iterator, Iterator> get_sequence(const std::vector<KeyType>& keys) const { return std::make_pair(Iterator(keys, *this), Iterator()); }*/ /*const PointType& operator [] (int_fast64_t index) const { return data_[index]; }*/ int_fast64_t size() const { return data_.size(); } SubsequenceIterator get_subsequence(const std::vector<KeyType>& keys) const { return SubsequenceIterator(keys, *this); } FullSequenceIterator get_full_sequence() const { return FullSequenceIterator(*this); } private: const std::vector<PointType>& data_; }; template <typename PointType, typename KeyType = int32_t> class PlainArrayDataStorage { PlainArrayDataStorage() { static_assert(FalseStruct<PointType>::value, "Point type not supported."); } template <typename PT> struct FalseStruct : std::false_type {}; }; template <typename CoordinateType, typename KeyType> class PlainArrayDataStorage<DenseVector<CoordinateType>, KeyType> { public: typedef Eigen::Map<const DenseVector<CoordinateType>> ConstVectorMap; typedef Eigen::Map<DenseVector<CoordinateType>> VectorMap; class FullSequenceIterator { public: FullSequenceIterator(const PlainArrayDataStorage& parent) : parent_(&parent), tmp_map_(nullptr, 0) { if (parent_->size() == 0) { parent_ = nullptr; index_ = -1; } else { index_ = 0; // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_); if (parent_->size() >= 2) { prefetcher_.prefetch(parent_->data_ + parent_->dim_); if (parent_->size() >= 3) { prefetcher_.prefetch(parent_->data_ + 2 * parent_->dim_); } } } } FullSequenceIterator() {} const ConstVectorMap& get_point() { new (&tmp_map_) ConstVectorMap(&(parent_->data_[index_ * parent_->dim_]), static_cast<int>(parent_->dim_)); return tmp_map_; } const KeyType& get_key() const { return index_; } bool is_valid() const { return parent_ != nullptr; } void operator++() { if (index_ >= 0 && index_ + 1 < static_cast<int_fast64_t>(parent_->size())) { index_ += 1; if (index_ + 2 < static_cast<int_fast64_t>(parent_->size())) { // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_ + (index_ + 2) * parent_->dim_); } } else { if (index_ == -1) { throw DataStorageError("Advancing invalid FullSequenceIterator."); } else { parent_ = nullptr; index_ = -1; } } } private: int_fast64_t index_ = -1; const PlainArrayDataStorage* parent_ = nullptr; ConstVectorMap tmp_map_; PlainArrayPrefetcher<CoordinateType> prefetcher_; }; class SubsequenceIterator { public: SubsequenceIterator(const std::vector<KeyType>& keys, const PlainArrayDataStorage& parent) : keys_(&keys), parent_(&parent), tmp_map_(nullptr, 0) { if (keys_->size() == 0) { keys_ = nullptr; parent_ = nullptr; index_ = -1; } else { index_ = 0; // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_ + (*keys_)[0] * parent_->dim_); if (keys_->size() >= 2) { prefetcher_.prefetch(parent_->data_ + (*keys_)[1] * parent_->dim_); if (keys_->size() >= 3) { prefetcher_.prefetch(parent_->data_ + (*keys_)[2] * parent_->dim_); } } } } SubsequenceIterator() {} const ConstVectorMap& get_point() { new (&tmp_map_) ConstVectorMap(&(parent_->data_[(*keys_)[index_] * parent_->dim_]), static_cast<int>(parent_->dim_)); return tmp_map_; } const KeyType& get_key() const { return (*keys_)[index_]; } bool is_valid() const { return parent_ != nullptr; } void operator++() { if (index_ >= 0 && index_ + 1 < static_cast<int_fast64_t>(keys_->size())) { index_ += 1; if (index_ + 2 < static_cast<int_fast64_t>(keys_->size())) { // TODO: try different prefetching steps prefetcher_.prefetch(parent_->data_ + (*keys_)[index_ + 2] * parent_->dim_); } } else { if (index_ == -1) { throw DataStorageError("Advancing invalid SubsequenceIterator."); } keys_ = nullptr; parent_ = nullptr; index_ = -1; } } private: int_fast64_t index_ = -1; const std::vector<KeyType>* keys_ = nullptr; const PlainArrayDataStorage* parent_ = nullptr; ConstVectorMap tmp_map_; PlainArrayPrefetcher<CoordinateType> prefetcher_; }; PlainArrayDataStorage(const CoordinateType* data, int_fast64_t num_points, int_fast64_t dim) : data_(data), num_points_(num_points), dim_(dim) {} int_fast64_t size() const { return num_points_; } SubsequenceIterator get_subsequence(const std::vector<KeyType>& keys) const { return SubsequenceIterator(keys, *this); } FullSequenceIterator get_full_sequence() const { return FullSequenceIterator(*this); } private: const CoordinateType* data_; int_fast64_t num_points_; int_fast64_t dim_; }; template <typename PointType, typename Transformation, typename InnerDataStorage, typename KeyType = int32_t> class TransformedDataStorage { public: class FullSequenceIterator { public: FullSequenceIterator(const TransformedDataStorage& parent) : parent_(&parent), iter_(parent.storage_.get_full_sequence()) {} FullSequenceIterator() {} const PointType& get_point() { tmp_point_ = iter_.get_point(); parent_->transformation_.apply(&tmp_point_); return tmp_point_; } const KeyType& get_key() const { return iter_.get_key(); } bool is_valid() const { return iter_.is_valid(); } void operator++() { ++iter_; } private: const TransformedDataStorage* parent_ = nullptr; typename InnerDataStorage::FullSequenceIterator iter_; PointType tmp_point_; }; class SubsequenceIterator { public: SubsequenceIterator(const TransformedDataStorage& parent, const std::vector<KeyType>& keys) : parent_(&parent), iter_(parent.storage_.get_sub_sequence(keys)) {} SubsequenceIterator() {} const PointType& get_point() { tmp_point_ = iter_.get_point(); parent_->transformation_->apply(&tmp_point_); return tmp_point_; } const KeyType& get_key() const { return iter_.get_key(); } bool is_valid() const { return iter_.is_valid(); } void operator++() { ++iter_; } private: const TransformedDataStorage* parent_ = nullptr; typename InnerDataStorage::SubsequenceIterator iter_; PointType tmp_point_; }; TransformedDataStorage(const Transformation& transformation, const InnerDataStorage& storage) : transformation_(transformation), storage_(storage) {} int_fast64_t size() const { return storage_.size(); } SubsequenceIterator get_subsequence(const std::vector<KeyType>& keys) const { return SubsequenceIterator(keys, *this); } FullSequenceIterator get_full_sequence() const { return FullSequenceIterator(*this); } private: const Transformation& transformation_; const InnerDataStorage& storage_; }; } // namespace core } // namespace falconn #endif
{ "pile_set_name": "Github" }
*> \brief \b ZLAHEF computes a partial factorization of a complex Hermitian indefinite matrix using the Bunch-Kaufman diagonal pivoting method (blocked algorithm, calling Level 3 BLAS). * * =========== DOCUMENTATION =========== * * Online html documentation available at * http://www.netlib.org/lapack/explore-html/ * *> \htmlonly *> Download ZLAHEF + dependencies *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlahef.f"> *> [TGZ]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlahef.f"> *> [ZIP]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlahef.f"> *> [TXT]</a> *> \endhtmlonly * * Definition: * =========== * * SUBROUTINE ZLAHEF( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO ) * * .. Scalar Arguments .. * CHARACTER UPLO * INTEGER INFO, KB, LDA, LDW, N, NB * .. * .. Array Arguments .. * INTEGER IPIV( * ) * COMPLEX*16 A( LDA, * ), W( LDW, * ) * .. * * *> \par Purpose: * ============= *> *> \verbatim *> *> ZLAHEF computes a partial factorization of a complex Hermitian *> matrix A using the Bunch-Kaufman diagonal pivoting method. The *> partial factorization has the form: *> *> A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or: *> ( 0 U22 ) ( 0 D ) ( U12**H U22**H ) *> *> A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L' *> ( L21 I ) ( 0 A22 ) ( 0 I ) *> *> where the order of D is at most NB. The actual order is returned in *> the argument KB, and is either NB or NB-1, or N if N <= NB. *> Note that U**H denotes the conjugate transpose of U. *> *> ZLAHEF is an auxiliary routine called by ZHETRF. It uses blocked code *> (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or *> A22 (if UPLO = 'L'). *> \endverbatim * * Arguments: * ========== * *> \param[in] UPLO *> \verbatim *> UPLO is CHARACTER*1 *> Specifies whether the upper or lower triangular part of the *> Hermitian matrix A is stored: *> = 'U': Upper triangular *> = 'L': Lower triangular *> \endverbatim *> *> \param[in] N *> \verbatim *> N is INTEGER *> The order of the matrix A. N >= 0. *> \endverbatim *> *> \param[in] NB *> \verbatim *> NB is INTEGER *> The maximum number of columns of the matrix A that should be *> factored. NB should be at least 2 to allow for 2-by-2 pivot *> blocks. *> \endverbatim *> *> \param[out] KB *> \verbatim *> KB is INTEGER *> The number of columns of A that were actually factored. *> KB is either NB-1 or NB, or N if N <= NB. *> \endverbatim *> *> \param[in,out] A *> \verbatim *> A is COMPLEX*16 array, dimension (LDA,N) *> On entry, the Hermitian matrix A. If UPLO = 'U', the leading *> n-by-n upper triangular part of A contains the upper *> triangular part of the matrix A, and the strictly lower *> triangular part of A is not referenced. If UPLO = 'L', the *> leading n-by-n lower triangular part of A contains the lower *> triangular part of the matrix A, and the strictly upper *> triangular part of A is not referenced. *> On exit, A contains details of the partial factorization. *> \endverbatim *> *> \param[in] LDA *> \verbatim *> LDA is INTEGER *> The leading dimension of the array A. LDA >= max(1,N). *> \endverbatim *> *> \param[out] IPIV *> \verbatim *> IPIV is INTEGER array, dimension (N) *> Details of the interchanges and the block structure of D. *> *> If UPLO = 'U': *> Only the last KB elements of IPIV are set. *> *> If IPIV(k) > 0, then rows and columns k and IPIV(k) were *> interchanged and D(k,k) is a 1-by-1 diagonal block. *> *> If IPIV(k) = IPIV(k-1) < 0, then rows and columns *> k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) *> is a 2-by-2 diagonal block. *> *> If UPLO = 'L': *> Only the first KB elements of IPIV are set. *> *> If IPIV(k) > 0, then rows and columns k and IPIV(k) were *> interchanged and D(k,k) is a 1-by-1 diagonal block. *> *> If IPIV(k) = IPIV(k+1) < 0, then rows and columns *> k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) *> is a 2-by-2 diagonal block. *> \endverbatim *> *> \param[out] W *> \verbatim *> W is COMPLEX*16 array, dimension (LDW,NB) *> \endverbatim *> *> \param[in] LDW *> \verbatim *> LDW is INTEGER *> The leading dimension of the array W. LDW >= max(1,N). *> \endverbatim *> *> \param[out] INFO *> \verbatim *> INFO is INTEGER *> = 0: successful exit *> > 0: if INFO = k, D(k,k) is exactly zero. The factorization *> has been completed, but the block diagonal matrix D is *> exactly singular. *> \endverbatim * * Authors: * ======== * *> \author Univ. of Tennessee *> \author Univ. of California Berkeley *> \author Univ. of Colorado Denver *> \author NAG Ltd. * *> \date December 2016 * *> \ingroup complex16HEcomputational * *> \par Contributors: * ================== *> *> \verbatim *> *> December 2016, Igor Kozachenko, *> Computer Science Division, *> University of California, Berkeley *> \endverbatim * * ===================================================================== SUBROUTINE ZLAHEF( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO ) * * -- LAPACK computational routine (version 3.7.0) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- * December 2016 * * .. Scalar Arguments .. CHARACTER UPLO INTEGER INFO, KB, LDA, LDW, N, NB * .. * .. Array Arguments .. INTEGER IPIV( * ) COMPLEX*16 A( LDA, * ), W( LDW, * ) * .. * * ===================================================================== * * .. Parameters .. DOUBLE PRECISION ZERO, ONE PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) COMPLEX*16 CONE PARAMETER ( CONE = ( 1.0D+0, 0.0D+0 ) ) DOUBLE PRECISION EIGHT, SEVTEN PARAMETER ( EIGHT = 8.0D+0, SEVTEN = 17.0D+0 ) * .. * .. Local Scalars .. INTEGER IMAX, J, JB, JJ, JMAX, JP, K, KK, KKW, KP, $ KSTEP, KW DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, R1, ROWMAX, T COMPLEX*16 D11, D21, D22, Z * .. * .. External Functions .. LOGICAL LSAME INTEGER IZAMAX EXTERNAL LSAME, IZAMAX * .. * .. External Subroutines .. EXTERNAL ZCOPY, ZDSCAL, ZGEMM, ZGEMV, ZLACGV, ZSWAP * .. * .. Intrinsic Functions .. INTRINSIC ABS, DBLE, DCONJG, DIMAG, MAX, MIN, SQRT * .. * .. Statement Functions .. DOUBLE PRECISION CABS1 * .. * .. Statement Function definitions .. CABS1( Z ) = ABS( DBLE( Z ) ) + ABS( DIMAG( Z ) ) * .. * .. Executable Statements .. * INFO = 0 * * Initialize ALPHA for use in choosing pivot block size. * ALPHA = ( ONE+SQRT( SEVTEN ) ) / EIGHT * IF( LSAME( UPLO, 'U' ) ) THEN * * Factorize the trailing columns of A using the upper triangle * of A and working backwards, and compute the matrix W = U12*D * for use in updating A11 (note that conjg(W) is actually stored) * * K is the main loop index, decreasing from N in steps of 1 or 2 * * KW is the column of W which corresponds to column K of A * K = N 10 CONTINUE KW = NB + K - N * * Exit from loop * IF( ( K.LE.N-NB+1 .AND. NB.LT.N ) .OR. K.LT.1 ) $ GO TO 30 * KSTEP = 1 * * Copy column K of A to column KW of W and update it * CALL ZCOPY( K-1, A( 1, K ), 1, W( 1, KW ), 1 ) W( K, KW ) = DBLE( A( K, K ) ) IF( K.LT.N ) THEN CALL ZGEMV( 'No transpose', K, N-K, -CONE, A( 1, K+1 ), LDA, $ W( K, KW+1 ), LDW, CONE, W( 1, KW ), 1 ) W( K, KW ) = DBLE( W( K, KW ) ) END IF * * Determine rows and columns to be interchanged and whether * a 1-by-1 or 2-by-2 pivot block will be used * ABSAKK = ABS( DBLE( W( K, KW ) ) ) * * IMAX is the row-index of the largest off-diagonal element in * column K, and COLMAX is its absolute value. * Determine both COLMAX and IMAX. * IF( K.GT.1 ) THEN IMAX = IZAMAX( K-1, W( 1, KW ), 1 ) COLMAX = CABS1( W( IMAX, KW ) ) ELSE COLMAX = ZERO END IF * IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN * * Column K is zero or underflow: set INFO and continue * IF( INFO.EQ.0 ) $ INFO = K KP = K A( K, K ) = DBLE( A( K, K ) ) ELSE * * ============================================================ * * BEGIN pivot search * * Case(1) IF( ABSAKK.GE.ALPHA*COLMAX ) THEN * * no interchange, use 1-by-1 pivot block * KP = K ELSE * * BEGIN pivot search along IMAX row * * * Copy column IMAX to column KW-1 of W and update it * CALL ZCOPY( IMAX-1, A( 1, IMAX ), 1, W( 1, KW-1 ), 1 ) W( IMAX, KW-1 ) = DBLE( A( IMAX, IMAX ) ) CALL ZCOPY( K-IMAX, A( IMAX, IMAX+1 ), LDA, $ W( IMAX+1, KW-1 ), 1 ) CALL ZLACGV( K-IMAX, W( IMAX+1, KW-1 ), 1 ) IF( K.LT.N ) THEN CALL ZGEMV( 'No transpose', K, N-K, -CONE, $ A( 1, K+1 ), LDA, W( IMAX, KW+1 ), LDW, $ CONE, W( 1, KW-1 ), 1 ) W( IMAX, KW-1 ) = DBLE( W( IMAX, KW-1 ) ) END IF * * JMAX is the column-index of the largest off-diagonal * element in row IMAX, and ROWMAX is its absolute value. * Determine only ROWMAX. * JMAX = IMAX + IZAMAX( K-IMAX, W( IMAX+1, KW-1 ), 1 ) ROWMAX = CABS1( W( JMAX, KW-1 ) ) IF( IMAX.GT.1 ) THEN JMAX = IZAMAX( IMAX-1, W( 1, KW-1 ), 1 ) ROWMAX = MAX( ROWMAX, CABS1( W( JMAX, KW-1 ) ) ) END IF * * Case(2) IF( ABSAKK.GE.ALPHA*COLMAX*( COLMAX / ROWMAX ) ) THEN * * no interchange, use 1-by-1 pivot block * KP = K * * Case(3) ELSE IF( ABS( DBLE( W( IMAX, KW-1 ) ) ).GE.ALPHA*ROWMAX ) $ THEN * * interchange rows and columns K and IMAX, use 1-by-1 * pivot block * KP = IMAX * * copy column KW-1 of W to column KW of W * CALL ZCOPY( K, W( 1, KW-1 ), 1, W( 1, KW ), 1 ) * * Case(4) ELSE * * interchange rows and columns K-1 and IMAX, use 2-by-2 * pivot block * KP = IMAX KSTEP = 2 END IF * * * END pivot search along IMAX row * END IF * * END pivot search * * ============================================================ * * KK is the column of A where pivoting step stopped * KK = K - KSTEP + 1 * * KKW is the column of W which corresponds to column KK of A * KKW = NB + KK - N * * Interchange rows and columns KP and KK. * Updated column KP is already stored in column KKW of W. * IF( KP.NE.KK ) THEN * * Copy non-updated column KK to column KP of submatrix A * at step K. No need to copy element into column K * (or K and K-1 for 2-by-2 pivot) of A, since these columns * will be later overwritten. * A( KP, KP ) = DBLE( A( KK, KK ) ) CALL ZCOPY( KK-1-KP, A( KP+1, KK ), 1, A( KP, KP+1 ), $ LDA ) CALL ZLACGV( KK-1-KP, A( KP, KP+1 ), LDA ) IF( KP.GT.1 ) $ CALL ZCOPY( KP-1, A( 1, KK ), 1, A( 1, KP ), 1 ) * * Interchange rows KK and KP in last K+1 to N columns of A * (columns K (or K and K-1 for 2-by-2 pivot) of A will be * later overwritten). Interchange rows KK and KP * in last KKW to NB columns of W. * IF( K.LT.N ) $ CALL ZSWAP( N-K, A( KK, K+1 ), LDA, A( KP, K+1 ), $ LDA ) CALL ZSWAP( N-KK+1, W( KK, KKW ), LDW, W( KP, KKW ), $ LDW ) END IF * IF( KSTEP.EQ.1 ) THEN * * 1-by-1 pivot block D(k): column kw of W now holds * * W(kw) = U(k)*D(k), * * where U(k) is the k-th column of U * * (1) Store subdiag. elements of column U(k) * and 1-by-1 block D(k) in column k of A. * (NOTE: Diagonal element U(k,k) is a UNIT element * and not stored) * A(k,k) := D(k,k) = W(k,kw) * A(1:k-1,k) := U(1:k-1,k) = W(1:k-1,kw)/D(k,k) * * (NOTE: No need to use for Hermitian matrix * A( K, K ) = DBLE( W( K, K) ) to separately copy diagonal * element D(k,k) from W (potentially saves only one load)) CALL ZCOPY( K, W( 1, KW ), 1, A( 1, K ), 1 ) IF( K.GT.1 ) THEN * * (NOTE: No need to check if A(k,k) is NOT ZERO, * since that was ensured earlier in pivot search: * case A(k,k) = 0 falls into 2x2 pivot case(4)) * R1 = ONE / DBLE( A( K, K ) ) CALL ZDSCAL( K-1, R1, A( 1, K ), 1 ) * * (2) Conjugate column W(kw) * CALL ZLACGV( K-1, W( 1, KW ), 1 ) END IF * ELSE * * 2-by-2 pivot block D(k): columns kw and kw-1 of W now hold * * ( W(kw-1) W(kw) ) = ( U(k-1) U(k) )*D(k) * * where U(k) and U(k-1) are the k-th and (k-1)-th columns * of U * * (1) Store U(1:k-2,k-1) and U(1:k-2,k) and 2-by-2 * block D(k-1:k,k-1:k) in columns k-1 and k of A. * (NOTE: 2-by-2 diagonal block U(k-1:k,k-1:k) is a UNIT * block and not stored) * A(k-1:k,k-1:k) := D(k-1:k,k-1:k) = W(k-1:k,kw-1:kw) * A(1:k-2,k-1:k) := U(1:k-2,k:k-1:k) = * = W(1:k-2,kw-1:kw) * ( D(k-1:k,k-1:k)**(-1) ) * IF( K.GT.2 ) THEN * * Factor out the columns of the inverse of 2-by-2 pivot * block D, so that each column contains 1, to reduce the * number of FLOPS when we multiply panel * ( W(kw-1) W(kw) ) by this inverse, i.e. by D**(-1). * * D**(-1) = ( d11 cj(d21) )**(-1) = * ( d21 d22 ) * * = 1/(d11*d22-|d21|**2) * ( ( d22) (-cj(d21) ) ) = * ( (-d21) ( d11 ) ) * * = 1/(|d21|**2) * 1/((d11/cj(d21))*(d22/d21)-1) * * * * ( d21*( d22/d21 ) conj(d21)*( - 1 ) ) = * ( ( -1 ) ( d11/conj(d21) ) ) * * = 1/(|d21|**2) * 1/(D22*D11-1) * * * * ( d21*( D11 ) conj(d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = (1/|d21|**2) * T * ( d21*( D11 ) conj(d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = ( (T/conj(d21))*( D11 ) (T/d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = ( conj(D21)*( D11 ) D21*( -1 ) ) * ( ( -1 ) ( D22 ) ), * * where D11 = d22/d21, * D22 = d11/conj(d21), * D21 = T/d21, * T = 1/(D22*D11-1). * * (NOTE: No need to check for division by ZERO, * since that was ensured earlier in pivot search: * (a) d21 != 0, since in 2x2 pivot case(4) * |d21| should be larger than |d11| and |d22|; * (b) (D22*D11 - 1) != 0, since from (a), * both |D11| < 1, |D22| < 1, hence |D22*D11| << 1.) * D21 = W( K-1, KW ) D11 = W( K, KW ) / DCONJG( D21 ) D22 = W( K-1, KW-1 ) / D21 T = ONE / ( DBLE( D11*D22 )-ONE ) D21 = T / D21 * * Update elements in columns A(k-1) and A(k) as * dot products of rows of ( W(kw-1) W(kw) ) and columns * of D**(-1) * DO 20 J = 1, K - 2 A( J, K-1 ) = D21*( D11*W( J, KW-1 )-W( J, KW ) ) A( J, K ) = DCONJG( D21 )* $ ( D22*W( J, KW )-W( J, KW-1 ) ) 20 CONTINUE END IF * * Copy D(k) to A * A( K-1, K-1 ) = W( K-1, KW-1 ) A( K-1, K ) = W( K-1, KW ) A( K, K ) = W( K, KW ) * * (2) Conjugate columns W(kw) and W(kw-1) * CALL ZLACGV( K-1, W( 1, KW ), 1 ) CALL ZLACGV( K-2, W( 1, KW-1 ), 1 ) * END IF * END IF * * Store details of the interchanges in IPIV * IF( KSTEP.EQ.1 ) THEN IPIV( K ) = KP ELSE IPIV( K ) = -KP IPIV( K-1 ) = -KP END IF * * Decrease K and return to the start of the main loop * K = K - KSTEP GO TO 10 * 30 CONTINUE * * Update the upper triangle of A11 (= A(1:k,1:k)) as * * A11 := A11 - U12*D*U12**H = A11 - U12*W**H * * computing blocks of NB columns at a time (note that conjg(W) is * actually stored) * DO 50 J = ( ( K-1 ) / NB )*NB + 1, 1, -NB JB = MIN( NB, K-J+1 ) * * Update the upper triangle of the diagonal block * DO 40 JJ = J, J + JB - 1 A( JJ, JJ ) = DBLE( A( JJ, JJ ) ) CALL ZGEMV( 'No transpose', JJ-J+1, N-K, -CONE, $ A( J, K+1 ), LDA, W( JJ, KW+1 ), LDW, CONE, $ A( J, JJ ), 1 ) A( JJ, JJ ) = DBLE( A( JJ, JJ ) ) 40 CONTINUE * * Update the rectangular superdiagonal block * CALL ZGEMM( 'No transpose', 'Transpose', J-1, JB, N-K, $ -CONE, A( 1, K+1 ), LDA, W( J, KW+1 ), LDW, $ CONE, A( 1, J ), LDA ) 50 CONTINUE * * Put U12 in standard form by partially undoing the interchanges * in columns k+1:n looping backwards from k+1 to n * J = K + 1 60 CONTINUE * * Undo the interchanges (if any) of rows JJ and JP at each * step J * * (Here, J is a diagonal index) JJ = J JP = IPIV( J ) IF( JP.LT.0 ) THEN JP = -JP * (Here, J is a diagonal index) J = J + 1 END IF * (NOTE: Here, J is used to determine row length. Length N-J+1 * of the rows to swap back doesn't include diagonal element) J = J + 1 IF( JP.NE.JJ .AND. J.LE.N ) $ CALL ZSWAP( N-J+1, A( JP, J ), LDA, A( JJ, J ), LDA ) IF( J.LT.N ) $ GO TO 60 * * Set KB to the number of columns factorized * KB = N - K * ELSE * * Factorize the leading columns of A using the lower triangle * of A and working forwards, and compute the matrix W = L21*D * for use in updating A22 (note that conjg(W) is actually stored) * * K is the main loop index, increasing from 1 in steps of 1 or 2 * K = 1 70 CONTINUE * * Exit from loop * IF( ( K.GE.NB .AND. NB.LT.N ) .OR. K.GT.N ) $ GO TO 90 * KSTEP = 1 * * Copy column K of A to column K of W and update it * W( K, K ) = DBLE( A( K, K ) ) IF( K.LT.N ) $ CALL ZCOPY( N-K, A( K+1, K ), 1, W( K+1, K ), 1 ) CALL ZGEMV( 'No transpose', N-K+1, K-1, -CONE, A( K, 1 ), LDA, $ W( K, 1 ), LDW, CONE, W( K, K ), 1 ) W( K, K ) = DBLE( W( K, K ) ) * * Determine rows and columns to be interchanged and whether * a 1-by-1 or 2-by-2 pivot block will be used * ABSAKK = ABS( DBLE( W( K, K ) ) ) * * IMAX is the row-index of the largest off-diagonal element in * column K, and COLMAX is its absolute value. * Determine both COLMAX and IMAX. * IF( K.LT.N ) THEN IMAX = K + IZAMAX( N-K, W( K+1, K ), 1 ) COLMAX = CABS1( W( IMAX, K ) ) ELSE COLMAX = ZERO END IF * IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN * * Column K is zero or underflow: set INFO and continue * IF( INFO.EQ.0 ) $ INFO = K KP = K A( K, K ) = DBLE( A( K, K ) ) ELSE * * ============================================================ * * BEGIN pivot search * * Case(1) IF( ABSAKK.GE.ALPHA*COLMAX ) THEN * * no interchange, use 1-by-1 pivot block * KP = K ELSE * * BEGIN pivot search along IMAX row * * * Copy column IMAX to column K+1 of W and update it * CALL ZCOPY( IMAX-K, A( IMAX, K ), LDA, W( K, K+1 ), 1 ) CALL ZLACGV( IMAX-K, W( K, K+1 ), 1 ) W( IMAX, K+1 ) = DBLE( A( IMAX, IMAX ) ) IF( IMAX.LT.N ) $ CALL ZCOPY( N-IMAX, A( IMAX+1, IMAX ), 1, $ W( IMAX+1, K+1 ), 1 ) CALL ZGEMV( 'No transpose', N-K+1, K-1, -CONE, A( K, 1 ), $ LDA, W( IMAX, 1 ), LDW, CONE, W( K, K+1 ), $ 1 ) W( IMAX, K+1 ) = DBLE( W( IMAX, K+1 ) ) * * JMAX is the column-index of the largest off-diagonal * element in row IMAX, and ROWMAX is its absolute value. * Determine only ROWMAX. * JMAX = K - 1 + IZAMAX( IMAX-K, W( K, K+1 ), 1 ) ROWMAX = CABS1( W( JMAX, K+1 ) ) IF( IMAX.LT.N ) THEN JMAX = IMAX + IZAMAX( N-IMAX, W( IMAX+1, K+1 ), 1 ) ROWMAX = MAX( ROWMAX, CABS1( W( JMAX, K+1 ) ) ) END IF * * Case(2) IF( ABSAKK.GE.ALPHA*COLMAX*( COLMAX / ROWMAX ) ) THEN * * no interchange, use 1-by-1 pivot block * KP = K * * Case(3) ELSE IF( ABS( DBLE( W( IMAX, K+1 ) ) ).GE.ALPHA*ROWMAX ) $ THEN * * interchange rows and columns K and IMAX, use 1-by-1 * pivot block * KP = IMAX * * copy column K+1 of W to column K of W * CALL ZCOPY( N-K+1, W( K, K+1 ), 1, W( K, K ), 1 ) * * Case(4) ELSE * * interchange rows and columns K+1 and IMAX, use 2-by-2 * pivot block * KP = IMAX KSTEP = 2 END IF * * * END pivot search along IMAX row * END IF * * END pivot search * * ============================================================ * * KK is the column of A where pivoting step stopped * KK = K + KSTEP - 1 * * Interchange rows and columns KP and KK. * Updated column KP is already stored in column KK of W. * IF( KP.NE.KK ) THEN * * Copy non-updated column KK to column KP of submatrix A * at step K. No need to copy element into column K * (or K and K+1 for 2-by-2 pivot) of A, since these columns * will be later overwritten. * A( KP, KP ) = DBLE( A( KK, KK ) ) CALL ZCOPY( KP-KK-1, A( KK+1, KK ), 1, A( KP, KK+1 ), $ LDA ) CALL ZLACGV( KP-KK-1, A( KP, KK+1 ), LDA ) IF( KP.LT.N ) $ CALL ZCOPY( N-KP, A( KP+1, KK ), 1, A( KP+1, KP ), 1 ) * * Interchange rows KK and KP in first K-1 columns of A * (columns K (or K and K+1 for 2-by-2 pivot) of A will be * later overwritten). Interchange rows KK and KP * in first KK columns of W. * IF( K.GT.1 ) $ CALL ZSWAP( K-1, A( KK, 1 ), LDA, A( KP, 1 ), LDA ) CALL ZSWAP( KK, W( KK, 1 ), LDW, W( KP, 1 ), LDW ) END IF * IF( KSTEP.EQ.1 ) THEN * * 1-by-1 pivot block D(k): column k of W now holds * * W(k) = L(k)*D(k), * * where L(k) is the k-th column of L * * (1) Store subdiag. elements of column L(k) * and 1-by-1 block D(k) in column k of A. * (NOTE: Diagonal element L(k,k) is a UNIT element * and not stored) * A(k,k) := D(k,k) = W(k,k) * A(k+1:N,k) := L(k+1:N,k) = W(k+1:N,k)/D(k,k) * * (NOTE: No need to use for Hermitian matrix * A( K, K ) = DBLE( W( K, K) ) to separately copy diagonal * element D(k,k) from W (potentially saves only one load)) CALL ZCOPY( N-K+1, W( K, K ), 1, A( K, K ), 1 ) IF( K.LT.N ) THEN * * (NOTE: No need to check if A(k,k) is NOT ZERO, * since that was ensured earlier in pivot search: * case A(k,k) = 0 falls into 2x2 pivot case(4)) * R1 = ONE / DBLE( A( K, K ) ) CALL ZDSCAL( N-K, R1, A( K+1, K ), 1 ) * * (2) Conjugate column W(k) * CALL ZLACGV( N-K, W( K+1, K ), 1 ) END IF * ELSE * * 2-by-2 pivot block D(k): columns k and k+1 of W now hold * * ( W(k) W(k+1) ) = ( L(k) L(k+1) )*D(k) * * where L(k) and L(k+1) are the k-th and (k+1)-th columns * of L * * (1) Store L(k+2:N,k) and L(k+2:N,k+1) and 2-by-2 * block D(k:k+1,k:k+1) in columns k and k+1 of A. * (NOTE: 2-by-2 diagonal block L(k:k+1,k:k+1) is a UNIT * block and not stored) * A(k:k+1,k:k+1) := D(k:k+1,k:k+1) = W(k:k+1,k:k+1) * A(k+2:N,k:k+1) := L(k+2:N,k:k+1) = * = W(k+2:N,k:k+1) * ( D(k:k+1,k:k+1)**(-1) ) * IF( K.LT.N-1 ) THEN * * Factor out the columns of the inverse of 2-by-2 pivot * block D, so that each column contains 1, to reduce the * number of FLOPS when we multiply panel * ( W(kw-1) W(kw) ) by this inverse, i.e. by D**(-1). * * D**(-1) = ( d11 cj(d21) )**(-1) = * ( d21 d22 ) * * = 1/(d11*d22-|d21|**2) * ( ( d22) (-cj(d21) ) ) = * ( (-d21) ( d11 ) ) * * = 1/(|d21|**2) * 1/((d11/cj(d21))*(d22/d21)-1) * * * * ( d21*( d22/d21 ) conj(d21)*( - 1 ) ) = * ( ( -1 ) ( d11/conj(d21) ) ) * * = 1/(|d21|**2) * 1/(D22*D11-1) * * * * ( d21*( D11 ) conj(d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = (1/|d21|**2) * T * ( d21*( D11 ) conj(d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = ( (T/conj(d21))*( D11 ) (T/d21)*( -1 ) ) = * ( ( -1 ) ( D22 ) ) * * = ( conj(D21)*( D11 ) D21*( -1 ) ) * ( ( -1 ) ( D22 ) ), * * where D11 = d22/d21, * D22 = d11/conj(d21), * D21 = T/d21, * T = 1/(D22*D11-1). * * (NOTE: No need to check for division by ZERO, * since that was ensured earlier in pivot search: * (a) d21 != 0, since in 2x2 pivot case(4) * |d21| should be larger than |d11| and |d22|; * (b) (D22*D11 - 1) != 0, since from (a), * both |D11| < 1, |D22| < 1, hence |D22*D11| << 1.) * D21 = W( K+1, K ) D11 = W( K+1, K+1 ) / D21 D22 = W( K, K ) / DCONJG( D21 ) T = ONE / ( DBLE( D11*D22 )-ONE ) D21 = T / D21 * * Update elements in columns A(k) and A(k+1) as * dot products of rows of ( W(k) W(k+1) ) and columns * of D**(-1) * DO 80 J = K + 2, N A( J, K ) = DCONJG( D21 )* $ ( D11*W( J, K )-W( J, K+1 ) ) A( J, K+1 ) = D21*( D22*W( J, K+1 )-W( J, K ) ) 80 CONTINUE END IF * * Copy D(k) to A * A( K, K ) = W( K, K ) A( K+1, K ) = W( K+1, K ) A( K+1, K+1 ) = W( K+1, K+1 ) * * (2) Conjugate columns W(k) and W(k+1) * CALL ZLACGV( N-K, W( K+1, K ), 1 ) CALL ZLACGV( N-K-1, W( K+2, K+1 ), 1 ) * END IF * END IF * * Store details of the interchanges in IPIV * IF( KSTEP.EQ.1 ) THEN IPIV( K ) = KP ELSE IPIV( K ) = -KP IPIV( K+1 ) = -KP END IF * * Increase K and return to the start of the main loop * K = K + KSTEP GO TO 70 * 90 CONTINUE * * Update the lower triangle of A22 (= A(k:n,k:n)) as * * A22 := A22 - L21*D*L21**H = A22 - L21*W**H * * computing blocks of NB columns at a time (note that conjg(W) is * actually stored) * DO 110 J = K, N, NB JB = MIN( NB, N-J+1 ) * * Update the lower triangle of the diagonal block * DO 100 JJ = J, J + JB - 1 A( JJ, JJ ) = DBLE( A( JJ, JJ ) ) CALL ZGEMV( 'No transpose', J+JB-JJ, K-1, -CONE, $ A( JJ, 1 ), LDA, W( JJ, 1 ), LDW, CONE, $ A( JJ, JJ ), 1 ) A( JJ, JJ ) = DBLE( A( JJ, JJ ) ) 100 CONTINUE * * Update the rectangular subdiagonal block * IF( J+JB.LE.N ) $ CALL ZGEMM( 'No transpose', 'Transpose', N-J-JB+1, JB, $ K-1, -CONE, A( J+JB, 1 ), LDA, W( J, 1 ), $ LDW, CONE, A( J+JB, J ), LDA ) 110 CONTINUE * * Put L21 in standard form by partially undoing the interchanges * of rows in columns 1:k-1 looping backwards from k-1 to 1 * J = K - 1 120 CONTINUE * * Undo the interchanges (if any) of rows JJ and JP at each * step J * * (Here, J is a diagonal index) JJ = J JP = IPIV( J ) IF( JP.LT.0 ) THEN JP = -JP * (Here, J is a diagonal index) J = J - 1 END IF * (NOTE: Here, J is used to determine row length. Length J * of the rows to swap back doesn't include diagonal element) J = J - 1 IF( JP.NE.JJ .AND. J.GE.1 ) $ CALL ZSWAP( J, A( JP, 1 ), LDA, A( JJ, 1 ), LDA ) IF( J.GT.1 ) $ GO TO 120 * * Set KB to the number of columns factorized * KB = K - 1 * END IF RETURN * * End of ZLAHEF * END
{ "pile_set_name": "Github" }
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; using System.Runtime.Serialization; /// <summary> /// Defines values for FindSimilarMatchMode. /// </summary> [JsonConverter(typeof(StringEnumConverter))] public enum FindSimilarMatchMode { [EnumMember(Value = "matchPerson")] MatchPerson, [EnumMember(Value = "matchFace")] MatchFace } internal static class FindSimilarMatchModeEnumExtension { internal static string ToSerializedValue(this FindSimilarMatchMode? value) { return value == null ? null : ((FindSimilarMatchMode)value).ToSerializedValue(); } internal static string ToSerializedValue(this FindSimilarMatchMode value) { switch( value ) { case FindSimilarMatchMode.MatchPerson: return "matchPerson"; case FindSimilarMatchMode.MatchFace: return "matchFace"; } return null; } internal static FindSimilarMatchMode? ParseFindSimilarMatchMode(this string value) { switch( value ) { case "matchPerson": return FindSimilarMatchMode.MatchPerson; case "matchFace": return FindSimilarMatchMode.MatchFace; } return null; } } }
{ "pile_set_name": "Github" }
define({ "button.addtoc.tooltip": "Taula de continguts" });
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sun.org.apache.xerces.internal.parsers; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Locale; import java.util.Map; /** * <p> This class provides an easy way for a user to preparse grammars * of various types. By default, it knows how to preparse external * DTD's and schemas; it provides an easy way for user applications to * register classes that know how to parse additional grammar types. * By default, it does no grammar caching; but it provides ways for * user applications to do so. * * @author Neil Graham, IBM * * @LastModified: Oct 2017 */ public class XMLGrammarPreparser { // // Constants // // feature: continue-after-fatal-error private final static String CONTINUE_AFTER_FATAL_ERROR = Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE; /** Property identifier: symbol table. */ protected static final String SYMBOL_TABLE = Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY; /** Property identifier: error reporter. */ protected static final String ERROR_REPORTER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY; /** Property identifier: error handler. */ protected static final String ERROR_HANDLER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; /** Property identifier: entity resolver. */ protected static final String ENTITY_RESOLVER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; /** Property identifier: grammar pool . */ protected static final String GRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; // the "built-in" grammar loaders private static final Map<String, String> KNOWN_LOADERS; static { Map<String, String> loaders = new HashMap<>(); loaders.put(XMLGrammarDescription.XML_SCHEMA, "com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader"); loaders.put(XMLGrammarDescription.XML_DTD, "com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader"); KNOWN_LOADERS = Collections.unmodifiableMap(loaders); } /** Recognized properties. */ private static final String[] RECOGNIZED_PROPERTIES = { SYMBOL_TABLE, ERROR_REPORTER, ERROR_HANDLER, ENTITY_RESOLVER, GRAMMAR_POOL, }; // Data protected SymbolTable fSymbolTable; protected XMLErrorReporter fErrorReporter; protected XMLEntityResolver fEntityResolver; protected XMLGrammarPool fGrammarPool; protected Locale fLocale; // Map holding our loaders private Map<String, XMLGrammarLoader> fLoaders; // // Constructors // /** Default constructor. */ public XMLGrammarPreparser() { this(new SymbolTable()); } // <init>() /** * Constructs a preparser using the specified symbol table. * * @param symbolTable The symbol table to use. */ public XMLGrammarPreparser (SymbolTable symbolTable) { fSymbolTable = symbolTable; fLoaders = new HashMap<>(); fErrorReporter = new XMLErrorReporter(); setLocale(Locale.getDefault()); fEntityResolver = new XMLEntityManager(); // those are all the basic properties... } // <init>(SymbolTable) // // Public methods // /* * Register a type of grammar to make it preparsable. If * the second parameter is null, the parser will use its built-in * facilities for that grammar type. * This should be called by the application immediately * after creating this object and before initializing any properties/features. * @param type URI identifying the type of the grammar * @param loader an object capable of preparsing that type; null if the ppreparser should use built-in knowledge. * @return true if successful; false if no built-in knowledge of * the type or if unable to instantiate the string we know about */ public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) { if(loader == null) { // none specified! if(KNOWN_LOADERS.containsKey(grammarType)) { // got one; just instantiate it... String loaderName = KNOWN_LOADERS.get(grammarType); try { XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true)); fLoaders.put(grammarType, gl); } catch (Exception e) { return false; } return true; } return false; } // were given one fLoaders.put(grammarType, loader); return true; } // registerPreparser(String, XMLGrammarLoader): boolean /** * Parse a grammar from a location identified by an * XMLInputSource. * This method also adds this grammar to the XMLGrammarPool * * @param type The type of the grammar to be constructed * @param is The XMLInputSource containing this grammar's * information * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it * available to the EntityResolver</strong> * @return The newly created <code>Grammar</code>. * @exception XNIException thrown on an error in grammar * construction * @exception IOException thrown if an error is encountered * in reading the file */ public Grammar preparseGrammar(String type, XMLInputSource is) throws XNIException, IOException { if(fLoaders.containsKey(type)) { XMLGrammarLoader gl = fLoaders.get(type); // make sure gl's been set up with all the "basic" properties: gl.setProperty(SYMBOL_TABLE, fSymbolTable); gl.setProperty(ENTITY_RESOLVER, fEntityResolver); gl.setProperty(ERROR_REPORTER, fErrorReporter); // potentially, not all will support this one... if(fGrammarPool != null) { try { gl.setProperty(GRAMMAR_POOL, fGrammarPool); } catch(Exception e) { // too bad... } } return gl.loadGrammar(is); } return null; } // preparseGrammar(String, XMLInputSource): Grammar /** * Set the locale to use for messages. * * @param locale The locale object to use for localization of messages. * * @exception XNIException Thrown if the parser does not support the * specified locale. */ public void setLocale(Locale locale) { fLocale = locale; fErrorReporter.setLocale(locale); } // setLocale(Locale) /** Return the Locale the XMLGrammarLoader is using. */ public Locale getLocale() { return fLocale; } // getLocale(): Locale /** * Sets the error handler. * * @param errorHandler The error handler. */ public void setErrorHandler(XMLErrorHandler errorHandler) { fErrorReporter.setProperty(ERROR_HANDLER, errorHandler); } // setErrorHandler(XMLErrorHandler) /** Returns the registered error handler. */ public XMLErrorHandler getErrorHandler() { return fErrorReporter.getErrorHandler(); } // getErrorHandler(): XMLErrorHandler /** * Sets the entity resolver. * * @param entityResolver The new entity resolver. */ public void setEntityResolver(XMLEntityResolver entityResolver) { fEntityResolver = entityResolver; } // setEntityResolver(XMLEntityResolver) /** Returns the registered entity resolver. */ public XMLEntityResolver getEntityResolver() { return fEntityResolver; } // getEntityResolver(): XMLEntityResolver /** * Sets the grammar pool. * * @param grammarPool The new grammar pool. */ public void setGrammarPool(XMLGrammarPool grammarPool) { fGrammarPool = grammarPool; } // setGrammarPool(XMLGrammarPool) /** Returns the registered grammar pool. */ public XMLGrammarPool getGrammarPool() { return fGrammarPool; } // getGrammarPool(): XMLGrammarPool // it's possible the application may want access to a certain loader to do // some custom work. public XMLGrammarLoader getLoader(String type) { return fLoaders.get(type); } // getLoader(String): XMLGrammarLoader // set a feature. This method tries to set it on all // registered loaders; it eats any resulting exceptions. If // an app needs to know if a particular feature is supported // by a grammar loader of a particular type, it will have // to retrieve that loader and use the loader's setFeature method. public void setFeature(String featureId, boolean value) { for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) { try { XMLGrammarLoader gl = entry.getValue(); gl.setFeature(featureId, value); } catch(Exception e) { // eat it up... } } // since our error reporter is a property we set later, // make sure features it understands are also set. if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) { fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, value); } } //setFeature(String, boolean) // set a property. This method tries to set it on all // registered loaders; it eats any resulting exceptions. If // an app needs to know if a particular property is supported // by a grammar loader of a particular type, it will have // to retrieve that loader and use the loader's setProperty method. // <p> <strong>An application should use the explicit method // in this class to set "standard" properties like error handler etc.</strong> public void setProperty(String propId, Object value) { for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) { try { XMLGrammarLoader gl = entry.getValue(); gl.setProperty(propId, value); } catch(Exception e) { // eat it up... } } } //setProperty(String, Object) // get status of feature in a particular loader. This // catches no exceptions--including NPE's--so the application had // better make sure the loader exists and knows about this feature. // @param type type of grammar to look for the feature in. // @param featureId the feature string to query. // @return the value of the feature. public boolean getFeature(String type, String featureId) { XMLGrammarLoader gl = fLoaders.get(type); return gl.getFeature(featureId); } // getFeature (String, String): boolean // get status of property in a particular loader. This // catches no exceptions--including NPE's--so the application had // better make sure the loader exists and knows about this property. // <strong>For standard properties--that will be supported // by all loaders--the specific methods should be queried!</strong> // @param type type of grammar to look for the property in. // @param propertyId the property string to query. // @return the value of the property. public Object getProperty(String type, String propertyId) { XMLGrammarLoader gl = fLoaders.get(type); return gl.getProperty(propertyId); } // getProperty(String, String): Object } // class XMLGrammarPreparser
{ "pile_set_name": "Github" }
/* * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include <yarp/rosmsg/SharedData.h> #include <iostream> #include <yarp/os/Network.h> #include <yarp/os/BufferedPort.h> #include <yarp/os/Time.h> using namespace std; int main() { yarp::os::Network network; yarp::os::Port port; if (!port.open("/sender")) { cerr<<"Error opening port, check your yarp network\n"; return -1; } cout<<"Starting sender\n"; double count=0.0; while(true) { yarp::rosmsg::SharedData d; // d.text is a string d.text="Hello from sender"; //d.content is a vector, let's push some data d.content.push_back(count++); d.content.push_back(count++); port.write(d); yarp::os::Time::delay(0.1); } return 0; }
{ "pile_set_name": "Github" }
#!/usr/bin/env ruby $:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib' require 'rubygems' require 'bundler/setup' require 'openssl' require 'socket' require 'cryptcheck' ::CryptCheck::Logger.level = ENV['LOG'] || :info OpenSSL::PKey::EC.send :alias_method, :private?, :private_key? # [512, 768, 1024, 2048, 3072, 4096].each do |s| # file = "config/rsa-#{s}.pem" # unless File.exists? file # puts :rsa, s # dh = OpenSSL::PKey::RSA.new s # File.write file, dh.to_pem # end # # file = "config/dh-#{s}.pem" # unless File.exists? file # puts :dh, s # dh = OpenSSL::PKey::DH.new s # File.write file, dh.to_pem # end # end # exit def certificate(key) CryptCheck::Logger.info 'Generating certificate' cert = OpenSSL::X509::Certificate.new cert.version = 2 cert.serial = rand 2 ** (20 * 8 - 1)..2 ** (20 * 8) cert.not_before = Time.now cert.not_after = Time.now + 365 * 24 * 60 * 60 cert.public_key = case key when OpenSSL::PKey::EC curve = key.group.curve_name public = OpenSSL::PKey::EC.new curve public.public_key = key.public_key public else key.public_key end name = OpenSSL::X509::Name.parse 'CN=localhost' cert.subject = name cert.issuer = name extension_factory = OpenSSL::X509::ExtensionFactory.new nil, cert extension_factory.subject_certificate = cert extension_factory.issuer_certificate = cert cert.add_extension extension_factory.create_extension 'basicConstraints', 'CA:TRUE', true cert.add_extension extension_factory.create_extension 'keyUsage', 'keyEncipherment, dataEncipherment, digitalSignature,nonRepudiation,keyCertSign' cert.add_extension extension_factory.create_extension 'extendedKeyUsage', 'serverAuth, clientAuth' cert.add_extension extension_factory.create_extension 'subjectKeyIdentifier', 'hash' cert.add_extension extension_factory.create_extension 'authorityKeyIdentifier', 'keyid:always' cert.add_extension extension_factory.create_extension 'subjectAltName', 'DNS:localhost' cert.add_extension OpenSSL::X509::Extension.new '1.3.6.1.5.5.7.1.24', '0', true cert.sign key, OpenSSL::Digest::SHA512.new CryptCheck::Logger.info 'Certificate generated' cert end rsa_key = OpenSSL::PKey::RSA.new File.read 'config/rsa-2048.pem' rsa_cert = certificate rsa_key ec_key = OpenSSL::PKey::EC.new('prime256v1').generate_key ec_cert = certificate ec_key CryptCheck::Logger.info 'Starting server' context = OpenSSL::SSL::SSLContext.new #context = OpenSSL::SSL::SSLContext.new :SSLv3 #context = OpenSSL::SSL::SSLContext.new :TLSv1_1 if context.respond_to? :add_certificate context.add_certificate ec_cert, ec_key context.add_certificate rsa_cert, rsa_key else context.certs = [ec_cert, rsa_cert] context.keys = [ec_key, rsa_key] end ciphers = ARGV[0] || 'EECDH+AESGCM' puts ciphers context.ciphers = ciphers dh = OpenSSL::PKey::DH.new File.read 'config/dh-2048.pem' # context.tmp_dh_callback = proc { dh } # context.ecdh_curves = CryptCheck::Tls::Server::SUPPORTED_CURVES.join ':' # context.ecdh_curves = 'prime256v1:secp384r1:secp521r1:sect571r1' # context.ecdh_curves = 'prime256v1' # ecdh = OpenSSL::PKey::EC.new('prime256v1').generate_key # context.tmp_ecdh_callback = proc { ecdh } host, port = '::', 5000 tcp_server = TCPServer.new host, port tls_server = OpenSSL::SSL::SSLServer.new tcp_server, context ::CryptCheck::Logger.info "Server started on #{host}:#{port}" # ::CryptCheck::Logger.info "Supported ciphers:" # context.ciphers.each { |c| ::CryptCheck::Logger.info c.first } loop do begin connection = tls_server.accept method = connection.ssl_version dh = connection.tmp_key cipher = connection.cipher cipher = CryptCheck::Tls::Cipher.new method, cipher.first states = cipher.states # p states # text = %i(critical error warning good perfect best).collect do |s| # states[s].collect { |t| t.to_s.colorize s }.join ' ' # end.reject &:empty? # text = [] # text = text.join ' ' # text = '' dh = dh ? " (#{'PFS'.colorize :good} : #{CryptCheck::Tls.key_to_s dh})" : '' CryptCheck::Logger.info { "#{cipher}#{dh}" } data = connection.gets if data CryptCheck::Logger.info data end connection.puts 'HTTP/1.1 200 OK' connection.puts 'Strict-Transport-Security: max-age=31536000' connection.close rescue OpenSSL::SSL::SSLError, SystemCallError end end
{ "pile_set_name": "Github" }
module Apotomo module JavascriptMethods # Returns the escaped script. def escape_js(script) Apotomo.js_generator.escape(script) end # Wraps the rendered content in a replace statement according to your +Apotomo.js_framework+ setting. # Received the same options as #render plus an optional +selector+ to change the selector. # # Example (with <tt>Apotomo.js_framework = :jquery</tt>): # # def hungry # replace # # will render the current state's view and wrap it like # # "jQuery(\"#mouse\").replaceWith(\"<div id=\\\"mouse\\\">hungry!<\\/div>\")" # # You may pass a selector and pass options to render here, as well. # # replace "#jerry h1", :view => :squeak # #=> "jQuery(\"#jerry h1\").replaceWith(\"<div id=\\\"mouse\\\">squeak!<\\/div>\")" def replace(*args) wrap_in_javascript_for(:replace, *args) end # Same as #replace except that the content is wrapped in an update statement. # # Example for +:jquery+: # # update :view => :peek # #=> "jQuery(\"#mouse\").html(\"looking...")" def update(*args) wrap_in_javascript_for(:update, *args) end private def wrap_in_javascript_for(mode, *args) selector = args.first.is_a?(String) ? args.shift : false content = render(*args) selector ? Apotomo.js_generator.send(mode, selector, content) : # replace(:twitter) Apotomo.js_generator.send("#{mode}_id", name, content) # replace_id(:twitter) end end end
{ "pile_set_name": "Github" }
{ "name": "safe-eval", "version": "0.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { "acorn": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-jsx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { "acorn": "3.3.0" }, "dependencies": { "acorn": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } } }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { "co": "4.6.0", "fast-deep-equal": "1.1.0", "fast-json-stable-stringify": "2.0.0", "json-schema-traverse": "0.3.1" } }, "ajv-keywords": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" } }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", "dev": true, "requires": { "define-properties": "1.1.2", "es-abstract": "1.12.0" } }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { "array-uniq": "1.0.3" } }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", "js-tokens": "3.0.2" }, "dependencies": { "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true } } }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "buffer-from": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", "dev": true }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { "callsites": "0.2.0" } }, "callsites": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.2", "has-ansi": "2.0.0", "strip-ansi": "3.0.1", "supports-color": "2.0.0" }, "dependencies": { "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } }, "chardet": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "dev": true }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "color-convert": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { "color-name": "1.1.1" } }, "color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { "buffer-from": "1.1.0", "inherits": "2.0.3", "readable-stream": "2.3.6", "typedarray": "0.0.6" } }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { "lru-cache": "4.1.3", "shebang-command": "1.2.0", "which": "1.3.1" }, "dependencies": { "lru-cache": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" } } } }, "debug-log": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, "define-properties": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { "foreach": "2.0.5", "object-keys": "1.0.12" } }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", "is-path-in-cwd": "1.0.1", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", "rimraf": "2.6.2" } }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "0.2.1" } }, "es-abstract": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "dev": true, "requires": { "es-to-primitive": "1.1.1", "function-bind": "1.1.1", "has": "1.0.3", "is-callable": "1.1.4", "is-regex": "1.0.4" } }, "es-to-primitive": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { "is-callable": "1.1.4", "is-date-object": "1.0.1", "is-symbol": "1.0.1" } }, "escape-string-regexp": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", "dev": true }, "eslint-config-standard-jsx": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz", "integrity": "sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg==", "dev": true }, "eslint-import-resolver-node": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { "debug": "2.6.9", "resolve": "1.8.1" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, "eslint-module-utils": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", "dev": true, "requires": { "debug": "2.6.9", "pkg-dir": "1.0.0" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, "eslint-plugin-import": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz", "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=", "dev": true, "requires": { "builtin-modules": "1.1.1", "contains-path": "0.1.0", "debug": "2.6.9", "doctrine": "1.5.0", "eslint-import-resolver-node": "0.3.2", "eslint-module-utils": "2.2.0", "has": "1.0.3", "lodash": "4.17.10", "minimatch": "3.0.4", "read-pkg-up": "2.0.0" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "2.0.2", "isarray": "1.0.0" } }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, "eslint-plugin-node": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", "dev": true, "requires": { "ignore": "3.3.10", "minimatch": "3.0.4", "resolve": "1.8.1", "semver": "5.5.0" }, "dependencies": { "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true } } }, "eslint-plugin-promise": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz", "integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==", "dev": true }, "eslint-scope": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", "dev": true, "requires": { "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", "dev": true }, "esquery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "4.2.0" } }, "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { "estraverse": "4.2.0" } }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, "external-editor": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { "chardet": "0.4.2", "iconv-lite": "0.4.23", "tmp": "0.0.33" } }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" }, "dependencies": { "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "2.0.1" } } } }, "flat-cache": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", "del": "2.2.2", "graceful-fs": "4.1.11", "write": "0.2.1" } }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, "globby": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { "array-union": "1.0.2", "arrify": "1.0.1", "glob": "7.1.2", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1" }, "dependencies": { "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } } } }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "1.1.1" } }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "iconv-lite": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { "safer-buffer": "2.1.2" } }, "ignore": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" } }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "1.1.1" } }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", "dev": true }, "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "1.0.1" } }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" } }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { "has": "1.0.3" } }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", "dev": true }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { "argparse": "1.0.10", "esprima": "4.0.1" }, "dependencies": { "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true } } }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema-traverse": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, "jsx-ast-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", "dev": true, "requires": { "array-includes": "3.0.3" } }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", "pify": "2.3.0", "strip-bom": "3.0.0" } }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "2.0.0", "path-exists": "3.0.0" }, "dependencies": { "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { "js-tokens": "4.0.0" }, "dependencies": { "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true } } }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" } }, "mocha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, "requires": { "browser-stdout": "1.3.1", "commander": "2.15.1", "debug": "3.1.0", "diff": "3.5.0", "escape-string-regexp": "1.0.5", "glob": "7.1.2", "growl": "1.10.5", "he": "1.1.1", "minimatch": "3.0.4", "mkdirp": "0.5.1", "supports-color": "5.4.0" }, "dependencies": { "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } } } }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "2.7.1", "is-builtin-module": "1.0.0", "semver": "4.3.6", "validate-npm-package-license": "3.0.3" } }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1.0.2" } }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "1.0.0" } }, "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "1.3.0" } }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { "error-ex": "1.3.2" } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { "pify": "2.3.0" } }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } }, "pkg-conf": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { "find-up": "2.1.0", "load-json-file": "4.0.0" }, "dependencies": { "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "2.0.0" } }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "4.0.0", "pify": "3.0.0", "strip-bom": "3.0.0" } }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "1.3.2", "json-parse-better-errors": "1.0.2" } }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "pkg-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", "dev": true, "requires": { "debug-log": "1.0.1", "find-root": "1.1.0", "xtend": "4.0.1" }, "dependencies": { "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true } } }, "pkg-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { "find-up": "1.1.2" } }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", "dev": true }, "prop-types": { "version": "15.6.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", "dev": true, "requires": { "loose-envify": "1.4.0", "object-assign": "4.1.1" } }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { "load-json-file": "2.0.0", "normalize-package-data": "2.4.0", "path-type": "2.0.0" } }, "read-pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { "find-up": "2.1.0", "read-pkg": "2.0.0" }, "dependencies": { "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "2.0.0" } } } }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", "safe-buffer": "5.1.2", "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { "caller-path": "0.1.0", "resolve-from": "1.0.1" } }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { "path-parse": "1.0.5" } }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "7.1.2" }, "dependencies": { "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } } } }, "run-parallel": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", "dev": true }, "rx-lite": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, "rx-lite-aggregates": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", "dev": true, "requires": { "rx-lite": "3.1.2" } }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", "dev": true }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "1.0.0" } }, "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0" }, "dependencies": { "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true } } }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { "spdx-expression-parse": "3.0.0", "spdx-license-ids": "3.0.0" } }, "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { "spdx-exceptions": "2.1.0", "spdx-license-ids": "3.0.0" } }, "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "standard": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/standard/-/standard-11.0.1.tgz", "integrity": "sha512-nu0jAcHiSc8H+gJCXeiziMVZNDYi8MuqrYJKxTgjP4xKXZMKm311boqQIzDrYI/ktosltxt2CbDjYQs9ANC8IA==", "dev": true, "requires": { "eslint": "4.18.2", "eslint-config-standard": "11.0.0", "eslint-config-standard-jsx": "5.0.0", "eslint-plugin-import": "2.9.0", "eslint-plugin-node": "6.0.1", "eslint-plugin-promise": "3.7.0", "eslint-plugin-react": "7.7.0", "eslint-plugin-standard": "3.0.1", "standard-engine": "8.0.1" }, "dependencies": { "ansi-escapes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.2" } }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", "supports-color": "5.4.0" } }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { "restore-cursor": "2.0.0" } }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } }, "deglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", "dev": true, "requires": { "find-root": "1.1.0", "glob": "7.1.2", "ignore": "3.3.10", "pkg-config": "1.1.1", "run-parallel": "1.1.9", "uniq": "1.0.1" } }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "2.0.2" } }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "eslint": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz", "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==", "dev": true, "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", "chalk": "2.4.1", "concat-stream": "1.6.2", "cross-spawn": "5.1.0", "debug": "3.1.0", "doctrine": "2.1.0", "eslint-scope": "3.7.3", "eslint-visitor-keys": "1.0.0", "espree": "3.5.4", "esquery": "1.0.1", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", "globals": "11.7.0", "ignore": "3.3.10", "imurmurhash": "0.1.4", "inquirer": "3.3.0", "is-resolvable": "1.1.0", "js-yaml": "3.12.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.10", "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.5.0", "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", "table": "4.0.2", "text-table": "0.2.0" } }, "eslint-config-standard": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", "dev": true }, "eslint-plugin-react": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz", "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==", "dev": true, "requires": { "doctrine": "2.1.0", "has": "1.0.3", "jsx-ast-utils": "2.0.1", "prop-types": "15.6.2" } }, "eslint-plugin-standard": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", "dev": true }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { "acorn": "5.7.1", "acorn-jsx": "3.0.1" } }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { "escape-string-regexp": "1.0.5" } }, "file-entry-cache": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "globals": { "version": "11.7.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", "dev": true }, "inquirer": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { "ansi-escapes": "3.1.0", "chalk": "2.4.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", "external-editor": "2.2.0", "figures": "2.0.0", "lodash": "4.17.10", "mute-stream": "0.0.7", "run-async": "2.3.0", "rx-lite": "4.0.8", "rx-lite-aggregates": "4.0.8", "string-width": "2.1.1", "strip-ansi": "4.0.0", "through": "2.3.8" } }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" } }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, "onetime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { "mimic-fn": "1.2.0" } }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", "levn": "0.3.0", "prelude-ls": "1.1.2", "type-check": "0.3.2", "wordwrap": "1.0.0" } }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { "onetime": "2.0.1", "signal-exit": "3.0.2" } }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { "is-promise": "2.1.0" } }, "rx-lite": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", "dev": true }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "standard-engine": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-8.0.1.tgz", "integrity": "sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==", "dev": true, "requires": { "deglob": "2.1.1", "get-stdin": "6.0.0", "minimist": "1.2.0", "pkg-conf": "2.1.0" } }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" } }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "3.0.0" } }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true } } }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "5.1.2" } }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "table": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { "ajv": "5.5.2", "ajv-keywords": "2.1.1", "chalk": "2.4.1", "lodash": "4.17.10", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.2" } }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", "supports-color": "5.4.0" } }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" } }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "3.0.0" } }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } } } }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "1.0.2" } }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "1.1.2" } }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { "spdx-correct": "3.0.0", "spdx-expression-parse": "3.0.0" } }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "2.0.0" } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { "mkdirp": "0.5.1" } }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true } } }
{ "pile_set_name": "Github" }
中田みのり最新番号 【BSJ-034】爆淫!人妻レッドカーペット</a>2008-07-31ビースバル$$$熟(ビースバル)241分钟
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='iso-8859-1'?> <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'> <head> <title> baud.sh </title> <meta http-equiv='content-type' content='text/html;iso-8859-1'/> <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/> <meta name='author' content='[email protected]'/> <meta name='robots' content='noindex,nofollow'/> <link href='toolkit.css' rel='stylesheet' type='text/css'/> </head> <body> <div class='headerlink'> [<a href='toolkit.html' title=' Index '>PREV</a>] [<a href='toolkit.html' title=' Index '>HOME</a>] [<a href='bootp.sh.html' title=' bootp.sh '>NEXT</a>] </div> <pre> #!/bin/sh # ==================================================================== # set serial port parameters on a Linux system; # -------------------------------------------------------------------- stty -F /dev/ttyUSB1 1115200 cs8 -cstopb -ixon </pre> <div class='footerlink'> [<a href='toolkit.html' title=' Index '>PREV</a>] [<a href='toolkit.html' title=' Index '>HOME</a>] [<a href='bootp.sh.html' title=' bootp.sh '>NEXT</a>] </div> </body> </html>
{ "pile_set_name": "Github" }
<?php class WP_Test_REST_Controller extends WP_Test_REST_TestCase { function test_validate_schema_type_integer() { $controller = new WP_REST_Test_Controller(); $this->assertTrue( $controller->validate_schema_property( '123', null, 'someinteger' ) ); $this->assertErrorResponse( 'rest_invalid_param', $controller->validate_schema_property( 'abc', null, 'someinteger' ) ); } function test_validate_schema_type_string() { $controller = new WP_REST_Test_Controller(); $this->assertTrue( $controller->validate_schema_property( '123', null, 'somestring' ) ); $this->assertErrorResponse( 'rest_invalid_param', $controller->validate_schema_property( array( 'foo' => 'bar' ), null, 'somestring' ) ); } function test_validate_schema_enum() { $controller = new WP_REST_Test_Controller(); $this->assertTrue( $controller->validate_schema_property( 'a', null, 'someenum' ) ); $this->assertErrorResponse( 'rest_invalid_param', $controller->validate_schema_property( 'd', null, 'someenum' ) ); } function test_validate_schema_format_email() { $controller = new WP_REST_Test_Controller(); $this->assertTrue( $controller->validate_schema_property( '[email protected]', null, 'someemail' ) ); $this->assertErrorResponse( 'rest_invalid_email', $controller->validate_schema_property( 'd', null, 'someemail' ) ); } function test_validate_schema_format_date_time() { $controller = new WP_REST_Test_Controller(); $this->assertTrue( $controller->validate_schema_property( '2010-01-01T12:00:00', null, 'somedate' ) ); $this->assertErrorResponse( 'rest_invalid_date', $controller->validate_schema_property( '2010-18-18T12:00:00', null, 'somedate' ) ); } function test_get_endpoint_args_for_item_schema_arg_options() { $controller = new WP_REST_Test_Controller(); $args = $controller->get_endpoint_args_for_item_schema(); $this->assertFalse( $args['someargoptions']['required'] ); $this->assertEquals( '__return_true', $args['someargoptions']['sanitize_callback'] ); } function test_get_endpoint_args_for_item_schema_default_value() { $controller = new WP_REST_Test_Controller(); $args = $controller->get_endpoint_args_for_item_schema(); $this->assertEquals( 'a', $args['somedefault']['default'] ); } }
{ "pile_set_name": "Github" }
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "de.", "du." ], "DAY": [ "vas\u00e1rnap", "h\u00e9tf\u0151", "kedd", "szerda", "cs\u00fct\u00f6rt\u00f6k", "p\u00e9ntek", "szombat" ], "ERANAMES": [ "id\u0151sz\u00e1m\u00edt\u00e1sunk el\u0151tt", "id\u0151sz\u00e1m\u00edt\u00e1sunk szerint" ], "ERAS": [ "i. e.", "i. sz." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "janu\u00e1r", "febru\u00e1r", "m\u00e1rcius", "\u00e1prilis", "m\u00e1jus", "j\u00fanius", "j\u00falius", "augusztus", "szeptember", "okt\u00f3ber", "november", "december" ], "SHORTDAY": [ "V", "H", "K", "Sze", "Cs", "P", "Szo" ], "SHORTMONTH": [ "jan.", "febr.", "m\u00e1rc.", "\u00e1pr.", "m\u00e1j.", "j\u00fan.", "j\u00fal.", "aug.", "szept.", "okt.", "nov.", "dec." ], "STANDALONEMONTH": [ "janu\u00e1r", "febru\u00e1r", "m\u00e1rcius", "\u00e1prilis", "m\u00e1jus", "j\u00fanius", "j\u00falius", "augusztus", "szeptember", "okt\u00f3ber", "november", "december" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "y. MMMM d., EEEE", "longDate": "y. MMMM d.", "medium": "y. MMM d. H:mm:ss", "mediumDate": "y. MMM d.", "mediumTime": "H:mm:ss", "short": "y. MM. dd. H:mm", "shortDate": "y. MM. dd.", "shortTime": "H:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Ft", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "hu", "localeID": "hu", "pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
{ "pile_set_name": "Github" }
{ "": [ "--------------------------------------------------------------------------------------------", "Copyright (c) Microsoft Corporation. All rights reserved.", "Licensed under the Source EULA. See License.txt in the project root for license information.", "--------------------------------------------------------------------------------------------", "Do not edit this file. It is machine generated." ], "saveAsCsv": "另存為 CSV", "saveAsJson": "另存為 JSON", "saveAsExcel": "另存為 Excel", "saveAsXml": "另存為 xml", "copySelection": "複製", "copyWithHeaders": "隨標頭一同複製", "selectAll": "全選", "copyMessages": "複製", "copyAll": "全部複製", "maximize": "最大化", "restore": "還原", "chart": "圖表", "showQueryPlan": "顯示查詢計劃" }
{ "pile_set_name": "Github" }
<!doctype html> <html lang="en"> <head> <title>Code coverage report for core/parsing_translator.js</title> <meta charset="utf-8"> <link rel="stylesheet" href="../prettify.css"> <style> body, html { margin:0; padding: 0; } body { font-family: Helvetica Neue, Helvetica,Arial; font-size: 10pt; } div.header, div.footer { background: #eee; padding: 1em; } div.header { z-index: 100; position: fixed; top: 0; border-bottom: 1px solid #666; width: 100%; } div.footer { border-top: 1px solid #666; } div.body { margin-top: 10em; } div.meta { font-size: 90%; text-align: center; } h1, h2, h3 { font-weight: normal; } h1 { font-size: 12pt; } h2 { font-size: 10pt; } pre { font-family: Consolas, Menlo, Monaco, monospace; margin: 0; padding: 0; line-height: 14px; font-size: 14px; -moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; } div.path { font-size: 110%; } div.path a:link, div.path a:visited { color: #000; } table.coverage { border-collapse: collapse; margin:0; padding: 0 } table.coverage td { margin: 0; padding: 0; color: #111; vertical-align: top; } table.coverage td.line-count { width: 50px; text-align: right; padding-right: 5px; } table.coverage td.line-coverage { color: #777 !important; text-align: right; border-left: 1px solid #666; border-right: 1px solid #666; } table.coverage td.text { } table.coverage td span.cline-any { display: inline-block; padding: 0 5px; width: 40px; } table.coverage td span.cline-neutral { background: #eee; } table.coverage td span.cline-yes { background: #b5d592; color: #999; } table.coverage td span.cline-no { background: #fc8c84; } .cstat-yes { color: #111; } .cstat-no { background: #fc8c84; color: #111; } .fstat-no { background: #ffc520; color: #111 !important; } .cbranch-no { background: yellow !important; color: #111; } .cstat-skip { background: #ddd; color: #111; } .fstat-skip { background: #ddd; color: #111 !important; } .cbranch-skip { background: #ddd !important; color: #111; } .missing-if-branch { display: inline-block; margin-right: 10px; position: relative; padding: 0 4px; background: black; color: yellow; } .skip-if-branch { display: none; margin-right: 10px; position: relative; padding: 0 4px; background: #ccc; color: white; } .missing-if-branch .typ, .skip-if-branch .typ { color: inherit !important; } .entity, .metric { font-weight: bold; } .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } .metric small { font-size: 80%; font-weight: normal; color: #666; } div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } div.coverage-summary th.file { border-right: none !important; } div.coverage-summary th.pic { border-left: none !important; text-align: right; } div.coverage-summary th.pct { border-right: none !important; } div.coverage-summary th.abs { border-left: none !important; text-align: right; } div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; } div.coverage-summary td.pic { min-width: 120px !important; } div.coverage-summary a:link { text-decoration: none; color: #000; } div.coverage-summary a:visited { text-decoration: none; color: #333; } div.coverage-summary a:hover { text-decoration: underline; } div.coverage-summary tfoot td { border-top: 1px solid #666; } div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator { height: 10px; width: 7px; display: inline-block; margin-left: 0.5em; } div.coverage-summary .yui3-datatable-sort-indicator { background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent; } div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator { background-position: 0 -20px; } div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator { background-position: 0 -10px; } .high { background: #b5d592 !important; } .medium { background: #ffe87c !important; } .low { background: #fc8c84 !important; } span.cover-fill, span.cover-empty { display:inline-block; border:1px solid #444; background: white; height: 12px; } span.cover-fill { background: #ccc; border-right: 1px solid #444; } span.cover-empty { background: white; border-left: none; } span.cover-full { border-right: none !important; } pre.prettyprint { border: none !important; padding: 0 !important; margin: 0 !important; } .com { color: #999 !important; } .ignore-none { color: #999; font-weight: normal; } </style> </head> <body> <div class="header medium"> <h1>Code coverage report for <span class="entity">core/parsing_translator.js</span></h1> <h2> Statements: <span class="metric">79.7% <small>(161 / 202)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Branches: <span class="metric">71.43% <small>(165 / 231)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Functions: <span class="metric">87.5% <small>(28 / 32)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Lines: <span class="metric">79.7% <small>(161 / 202)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp; </h2> <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">core/</a> &#187; parsing_translator.js</div> </div> <div class="body"> <pre><table class="coverage"> <tr><td class="line-count">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362</td><td class="line-coverage"><span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1327</span> <span class="cline-any cline-yes">1327</span> <span class="cline-any cline-yes">2853</span> <span class="cline-any cline-yes">797</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2056</span> <span class="cline-any cline-yes">1822</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1327</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">577</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-yes">7</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">42</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">7</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">91</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">437</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">525</span> <span class="cline-any cline-yes">80</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">525</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">35</span> <span class="cline-any cline-yes">35</span> <span class="cline-any cline-yes">35</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">35</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12</span> <span class="cline-any cline-yes">17</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">3</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">169</span> <span class="cline-any cline-yes">169</span> <span class="cline-any cline-yes">109</span> <span class="cline-any cline-yes">109</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">154</span> <span class="cline-any cline-yes">68</span> <span class="cline-any cline-yes">68</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">50</span> <span class="cline-any cline-yes">72</span> <span class="cline-any cline-yes">72</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">230</span> <span class="cline-any cline-yes">222</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">221</span> <span class="cline-any cline-yes">221</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">47</span> <span class="cline-any cline-yes">47</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">47</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-yes">47</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">47</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">530</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">530</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">530</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">1822</span> <span class="cline-any cline-yes">1822</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">108</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">77</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">528</span> <span class="cline-any cline-yes">35</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">493</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">493</span> <span class="cline-any cline-yes">422</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">71</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">493</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">493</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">(function () { var $D = Date; &nbsp; var flattenAndCompact = function (ax) { var rx = []; for (var i = 0; i &lt; ax.length; i++) { if (ax[i] instanceof Array) { rx = rx.concat(flattenAndCompact(ax[i])); } else { if (ax[i]) { rx.push(ax[i]); } } } return rx; }; &nbsp; var parseMeridian = function () { if (this.meridian &amp;&amp; (this.hour || <span class="branch-2 cbranch-no" title="branch not covered" >this.hour === 0)</span>) { <span class="missing-if-branch" title="if path not taken" >I</span>if (this.meridian === "a" &amp;&amp; this.hour &gt; 11 &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >Date.Config.strict24hr)</span>{ <span class="cstat-no" title="statement not covered" > throw "Invalid hour and meridian combination";</span> } else <span class="missing-if-branch" title="if path not taken" >I</span>if (this.meridian === "p" &amp;&amp; this.hour &lt; 12 &amp;&amp; Date.Config.strict24hr){ <span class="cstat-no" title="statement not covered" > throw "Invalid hour and meridian combination";</span> } else if (this.meridian === "p" &amp;&amp; this.hour &lt; 12) { this.hour = this.hour + 12; } else <span class="missing-if-branch" title="if path not taken" >I</span>if (this.meridian === "a" &amp;&amp; this.hour === 12) { <span class="cstat-no" title="statement not covered" > this.hour = 0;</span> } } }; &nbsp; var setDefaults = function () { var now = new Date(); <span class="missing-if-branch" title="if path not taken" >I</span>if ((this.hour || this.minute) &amp;&amp; (<span class="branch-2 cbranch-no" title="branch not covered" >!this.month </span>&amp;&amp; <span class="branch-3 cbranch-no" title="branch not covered" >!this.year </span>&amp;&amp; <span class="branch-4 cbranch-no" title="branch not covered" >!this.day)</span>) { <span class="cstat-no" title="statement not covered" > this.day = now.getDate();</span> } &nbsp; if (!this.year) { this.year = now.getFullYear(); } <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.month &amp;&amp; this.month !== 0) { this.month = now.getMonth(); } if (!this.day) { this.day = 1; } <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.hour) { this.hour = 0; } <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.minute) { this.minute = 0; } &nbsp; <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.second) { this.second = 0; } <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.millisecond) { this.millisecond = 0; } }; &nbsp; var finishUtils = { getToday: function () { if (this.now || "hour minute second".indexOf(this.unit) !== -1) { return new Date(); } else { return $D.today(); } }, setDaysFromWeekday: function (today, orient){ var gap; orient = orient || <span class="branch-1 cbranch-no" title="branch not covered" >1;</span> this.unit = "day"; gap = ($D.getDayNumberFromName(this.weekday) - today.getDay()); this.days = gap ? ((gap + (orient * 7)) % 7) : (<span class="branch-1 cbranch-no" title="branch not covered" >orient * 7)</span>; return this; }, setMonthsFromMonth: function (today, orient) { var gap; orient = orient || <span class="branch-1 cbranch-no" title="branch not covered" >1;</span> this.unit = "month"; gap = (this.month - today.getMonth()); this.months = gap ? ((gap + (orient * 12)) % 12) : (<span class="branch-1 cbranch-no" title="branch not covered" >orient * 12)</span>; this.month = null; return this; }, setDMYFromWeekday: function () { var d = Date[this.weekday](); this.day = d.getDate(); <span class="missing-if-branch" title="else path not taken" >E</span>if (!this.month) { this.month = d.getMonth(); } this.year = d.getFullYear(); return this; }, setUnitValue: function (orient) { <span class="missing-if-branch" title="if path not taken" >I</span>if (!this.value &amp;&amp; this.operator &amp;&amp; this.operator !== null &amp;&amp; this[this.unit + "s"] &amp;&amp; <span class="branch-4 cbranch-no" title="branch not covered" >this[this.unit + "s"] !== null)</span> { <span class="cstat-no" title="statement not covered" > this[this.unit + "s"] = this[this.unit + "s"] + ((this.operator === "add") ? 1 : -1) + (this.value||0) * orient;</span> } else if (this[this.unit + "s"] == null || this.operator != null) { if (!this.value) { this.value = 1; } this[this.unit + "s"] = this.value * orient; } }, generateDateFromWeeks: function () { var weekday = (this.weekday !== undefined) ? this.weekday : "today"; var d = Date[weekday]().addWeeks(this.weeks); if (this.now) { d.setTimeToNow(); } return d; } }; &nbsp; $D.Translator = { hour: function (s) { return function () { this.hour = Number(s); }; }, minute: function (s) { return function () { this.minute = Number(s); }; }, second: <span class="fstat-no" title="function not covered" >function (s) {</span> <span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >function () {</span></span> <span class="cstat-no" title="statement not covered" > this.second = Number(s);</span> }; }, /* for ss.s format */ secondAndMillisecond: <span class="fstat-no" title="function not covered" >function (s) {</span> <span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >function () {</span></span> <span class="cstat-no" title="statement not covered" > var mx = s.match(/^([0-5][0-9])\.([0-9]{1,3})/);</span> <span class="cstat-no" title="statement not covered" > this.second = Number(mx[1]);</span> <span class="cstat-no" title="statement not covered" > this.millisecond = Number(mx[2]);</span> }; }, meridian: function (s) { return function () { this.meridian = s.slice(0, 1).toLowerCase(); }; }, timezone: function (s) { return function () { var n = s.replace(/[^\d\+\-]/g, ""); <span class="missing-if-branch" title="if path not taken" >I</span>if (n.length) { <span class="cstat-no" title="statement not covered" > this.timezoneOffset = Number(n);</span> } else { this.timezone = s.toLowerCase(); } }; }, day: function (x) { var s = x[0]; return function () { this.day = Number(s.match(/\d+/)[0]); <span class="missing-if-branch" title="if path not taken" >I</span>if (this.day &lt; 1) { <span class="cstat-no" title="statement not covered" > throw "invalid day";</span> } }; }, month: function (s) { return function () { this.month = (s.length === 3) ? "jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s)/4 : Number(s) - 1; <span class="missing-if-branch" title="if path not taken" >I</span>if (this.month &lt; 0) { <span class="cstat-no" title="statement not covered" > throw "invalid month";</span> } }; }, year: function (s) { return function () { var n = Number(s); this.year = ((s.length &gt; 2) ? n : (n + (((n + 2000) &lt; Date.CultureInfo.twoDigitYearMax) ? 2000 : 1900))); }; }, rday: function (s) { return function () { switch (s) { <span class="branch-0 cbranch-no" title="branch not covered" > case "yesterday":</span> <span class="cstat-no" title="statement not covered" > this.days = -1;</span> <span class="cstat-no" title="statement not covered" > break;</span> <span class="branch-1 cbranch-no" title="branch not covered" > case "tomorrow":</span> <span class="cstat-no" title="statement not covered" > this.days = 1;</span> <span class="cstat-no" title="statement not covered" > break;</span> case "today": this.days = 0; break; case "now": this.days = 0; this.now = true; break; } }; }, finishExact: function (x) { var d; x = (x instanceof Array) ? x : <span class="branch-1 cbranch-no" title="branch not covered" >[x];</span> &nbsp; for (var i = 0 ; i &lt; x.length ; i++) { <span class="missing-if-branch" title="else path not taken" >E</span>if (x[i]) { x[i].call(this); } } setDefaults.call(this); parseMeridian.call(this); &nbsp; if (this.day &gt; $D.getDaysInMonth(this.year, this.month)) { throw new RangeError(this.day + " is not a valid value for days."); } &nbsp; d = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); <span class="missing-if-branch" title="if path not taken" >I</span>if (this.year &lt; 100) { <span class="cstat-no" title="statement not covered" > d.setFullYear(this.year); </span>// means years less that 100 are process correctly. JS will parse it otherwise as 1900-1999. } <span class="missing-if-branch" title="if path not taken" >I</span>if (this.timezone) { <span class="cstat-no" title="statement not covered" > d.set({ timezone: this.timezone });</span> } else <span class="missing-if-branch" title="if path not taken" >I</span>if (this.timezoneOffset) { <span class="cstat-no" title="statement not covered" > d.set({ timezoneOffset: this.timezoneOffset });</span> } return d; }, finish: function (x) { var today, expression, orient, temp; &nbsp; x = (x instanceof Array) ? flattenAndCompact(x) : <span class="branch-1 cbranch-no" title="branch not covered" >[ x ];</span> &nbsp; if (x.length === 0) { return null; } &nbsp; for (var i = 0 ; i &lt; x.length ; i++) { <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof x[i] === "function") { x[i].call(this); } } <span class="missing-if-branch" title="if path not taken" >I</span>if (this.now &amp;&amp; !this.unit &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >!this.operator)</span> { <span class="cstat-no" title="statement not covered" > return new Date();</span> } else { today = finishUtils.getToday.call(this); } expression = !!(this.days &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this.days !== null </span>|| this.orient || this.operator); orient = ((this.orient === "past" || this.operator === "subtract") ? -1 : 1); &nbsp; if (this.month &amp;&amp; this.unit === "week") { this.value = this.month + 1; delete this.month; delete this.day; } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if ((this.month || this.month === 0) &amp;&amp; "year day hour minute second".indexOf(this.unit) !== -1) { <span class="cstat-no" title="statement not covered" > if (!this.value) {</span> <span class="cstat-no" title="statement not covered" > this.value = this.month + 1;</span> } <span class="cstat-no" title="statement not covered" > this.month = null;</span> <span class="cstat-no" title="statement not covered" > expression = true;</span> } &nbsp; if (!expression &amp;&amp; this.weekday &amp;&amp; !this.day &amp;&amp; !this.days) { finishUtils.setDMYFromWeekday.call(this); } &nbsp; if (expression &amp;&amp; this.weekday &amp;&amp; this.unit !== "month" &amp;&amp; this.unit !== "week") { finishUtils.setDaysFromWeekday.call(this, today, orient); } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (this.weekday &amp;&amp; this.unit !== "week" &amp;&amp; !this.day &amp;&amp; !this.days) { <span class="cstat-no" title="statement not covered" > temp = Date[this.weekday]();</span> <span class="cstat-no" title="statement not covered" > this.day = temp.getDate();</span> <span class="cstat-no" title="statement not covered" > if (temp.getMonth() !== today.getMonth()) {</span> <span class="cstat-no" title="statement not covered" > this.month = temp.getMonth();</span> } } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (this.month &amp;&amp; this.unit === "day" &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >this.operator)</span> { <span class="cstat-no" title="statement not covered" > if (!this.value) {</span> <span class="cstat-no" title="statement not covered" > this.value = (this.month + 1);</span> } <span class="cstat-no" title="statement not covered" > this.month = null;</span> } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (this.value != null &amp;&amp; this.month != null &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >this.year != null)</span> { <span class="cstat-no" title="statement not covered" > this.day = this.value * 1;</span> } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (this.month &amp;&amp; !this.day &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >this.value)</span> { <span class="cstat-no" title="statement not covered" > today.set({ day: this.value * 1 });</span> <span class="cstat-no" title="statement not covered" > if (!expression) {</span> <span class="cstat-no" title="statement not covered" > this.day = this.value * 1;</span> } } &nbsp; if (!this.month &amp;&amp; this.value &amp;&amp; this.unit === "month" &amp;&amp; !this.now) { this.month = this.value; expression = true; } &nbsp; if (expression &amp;&amp; (this.month || this.month === 0) &amp;&amp; this.unit !== "year") { finishUtils.setMonthsFromMonth.call(this, today, orient); } &nbsp; if (!this.unit) { this.unit = "day"; } &nbsp; finishUtils.setUnitValue.call(this, orient); parseMeridian.call(this); <span class="missing-if-branch" title="if path not taken" >I</span>if ((this.month || this.month === 0) &amp;&amp; !this.day) { <span class="cstat-no" title="statement not covered" > this.day = 1;</span> } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (!this.orient &amp;&amp; !this.operator &amp;&amp; this.unit === "week" &amp;&amp; <span class="branch-3 cbranch-no" title="branch not covered" >this.value </span>&amp;&amp; <span class="branch-4 cbranch-no" title="branch not covered" >!this.day </span>&amp;&amp; <span class="branch-5 cbranch-no" title="branch not covered" >!this.month)</span> { <span class="cstat-no" title="statement not covered" > return Date.today().setWeek(this.value);</span> } &nbsp; if (this.unit === "week" &amp;&amp; this.weeks &amp;&amp; !this.day &amp;&amp; !this.month) { return finishUtils.generateDateFromWeeks.call(this); } &nbsp; <span class="missing-if-branch" title="if path not taken" >I</span>if (expression &amp;&amp; this.timezone &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >this.day </span>&amp;&amp; <span class="branch-3 cbranch-no" title="branch not covered" >this.days)</span> { <span class="cstat-no" title="statement not covered" > this.day = this.days;</span> } &nbsp; if (expression){ today.add(this); } else { today.set(this); } if (this.timezone) { this.timezone = this.timezone.toUpperCase(); var offset = $D.getTimezoneOffset(this.timezone); var timezone; <span class="missing-if-branch" title="else path not taken" >E</span>if (today.hasDaylightSavingTime()) { // lets check that we're being sane with timezone setting timezone = $D.getTimezoneAbbreviation(offset, today.isDaylightSavingTime()); if (timezone !== this.timezone) { // bugger, we're in a place where things like EST vs EDT matters. <span class="missing-if-branch" title="if path not taken" >I</span>if (today.isDaylightSavingTime()) { <span class="cstat-no" title="statement not covered" > today.addHours(-1);</span> } else { today.addHours(1); } } } today.setTimezoneOffset(offset); } &nbsp; return today; } }; }());</pre></td></tr> </table></pre> </div> <div class="footer"> <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 16 2014 12:08:33 GMT-0800 (PST)</div> </div> <script src="../prettify.js"></script> <script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script> <script> YUI().use('datatable', function (Y) { var formatters = { pct: function (o) { o.className += o.record.get('classes')[o.column.key]; try { return o.value.toFixed(2) + '%'; } catch (ex) { return o.value + '%'; } }, html: function (o) { o.className += o.record.get('classes')[o.column.key]; return o.record.get(o.column.key + '_html'); } }, defaultFormatter = function (o) { o.className += o.record.get('classes')[o.column.key]; return o.value; }; function getColumns(theadNode) { var colNodes = theadNode.all('tr th'), cols = [], col; colNodes.each(function (colNode) { col = { key: colNode.getAttribute('data-col'), label: colNode.get('innerHTML') || ' ', sortable: !colNode.getAttribute('data-nosort'), className: colNode.getAttribute('class'), type: colNode.getAttribute('data-type'), allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html' }; col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter; cols.push(col); }); return cols; } function getRowData(trNode, cols) { var tdNodes = trNode.all('td'), i, row = { classes: {} }, node, name; for (i = 0; i < cols.length; i += 1) { name = cols[i].key; node = tdNodes.item(i); row[name] = node.getAttribute('data-value') || node.get('innerHTML'); row[name + '_html'] = node.get('innerHTML'); row.classes[name] = node.getAttribute('class'); //Y.log('Name: ' + name + '; Value: ' + row[name]); if (cols[i].type === 'number') { row[name] = row[name] * 1; } } //Y.log(row); return row; } function getData(tbodyNode, cols) { var data = []; tbodyNode.all('tr').each(function (trNode) { data.push(getRowData(trNode, cols)); }); return data; } function replaceTable(node) { if (!node) { return; } var cols = getColumns(node.one('thead')), data = getData(node.one('tbody'), cols), table, parent = node.get('parentNode'); table = new Y.DataTable({ columns: cols, data: data, sortBy: 'file' }); parent.set('innerHTML', ''); table.render(parent); } Y.on('domready', function () { replaceTable(Y.one('div.coverage-summary table')); if (typeof prettyPrint === 'function') { prettyPrint(); } }); }); </script> </body> </html>
{ "pile_set_name": "Github" }
<?php namespace Modules\Menu\Http\Controllers\Admin; use Modules\Core\Http\Controllers\Admin\AdminBaseController; use Modules\Menu\Entities\Menu; use Modules\Menu\Http\Requests\CreateMenuRequest; use Modules\Menu\Http\Requests\UpdateMenuRequest; use Modules\Menu\Repositories\MenuItemRepository; use Modules\Menu\Repositories\MenuRepository; use Modules\Menu\Services\MenuRenderer; class MenuController extends AdminBaseController { /** * @var MenuRepository */ private $menu; /** * @var MenuItemRepository */ private $menuItem; /** * @var MenuRenderer */ private $menuRenderer; public function __construct( MenuRepository $menu, MenuItemRepository $menuItem, MenuRenderer $menuRenderer ) { parent::__construct(); $this->menu = $menu; $this->menuItem = $menuItem; $this->menuRenderer = $menuRenderer; } public function index() { $menus = $this->menu->all(); return view('menu::admin.menus.index', compact('menus')); } public function create() { return view('menu::admin.menus.create'); } public function store(CreateMenuRequest $request) { $this->menu->create($request->all()); return redirect()->route('admin.menu.menu.index') ->withSuccess(trans('menu::messages.menu created')); } public function edit(Menu $menu) { $menuItems = $this->menuItem->allRootsForMenu($menu->id); $menuStructure = $this->menuRenderer->renderForMenu($menu->id, $menuItems->nest()); return view('menu::admin.menus.edit', compact('menu', 'menuStructure')); } public function update(Menu $menu, UpdateMenuRequest $request) { $this->menu->update($menu, $request->all()); return redirect()->route('admin.menu.menu.index') ->withSuccess(trans('menu::messages.menu updated')); } public function destroy(Menu $menu) { $this->menu->destroy($menu); return redirect()->route('admin.menu.menu.index') ->withSuccess(trans('menu::messages.menu deleted')); } }
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='UTF-8' standalone='no'?> <?xml-stylesheet href="dialog.xsl" type="text/xsl"?> <dialog defbtn='okay'> <button name='okay' type='regular' top='50' left='246'>OK</button> <pict type='dlog' num='16' top='8' left='8'/> <text top='3' left='50' width='254' height='45'> Some of your items are special, and can't be carried from scenario to scenario. These have been taken away. </text> </dialog>
{ "pile_set_name": "Github" }
{ "addons": { "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_soft1_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_soft3_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_soft5_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_soft4_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_soft2_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_regexp1_2.xpi" } ] }, "[email protected]": { "updates": [ { "applications": { "gecko": { "strict_min_version": "0", "advisory_max_version": "*" } }, "version": "2", "update_link": "http://example.com/addons/blocklist_hard1_2.xpi" } ] } } }
{ "pile_set_name": "Github" }
# 多协议 Dubbo 允许配置多协议,在不同服务上支持不同协议或者同一服务上同时支持多种协议。 ## 不同服务不同协议 不同服务在性能上适用不同协议进行传输,比如大数据用短连接协议,小数据大并发用长连接协议 ```xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> <dubbo:application name="world" /> <dubbo:registry id="registry" address="10.20.141.150:9090" username="admin" password="hello1234" /> <!-- 多协议配置 --> <dubbo:protocol name="dubbo" port="20880" /> <dubbo:protocol name="rmi" port="1099" /> <!-- 使用dubbo协议暴露服务 --> <dubbo:service interface="com.alibaba.hello.api.HelloService" version="1.0.0" ref="helloService" protocol="dubbo" /> <!-- 使用rmi协议暴露服务 --> <dubbo:service interface="com.alibaba.hello.api.DemoService" version="1.0.0" ref="demoService" protocol="rmi" /> </beans> ``` ## 多协议暴露服务 需要与 http 客户端互操作 ```xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> <dubbo:application name="world" /> <dubbo:registry id="registry" address="10.20.141.150:9090" username="admin" password="hello1234" /> <!-- 多协议配置 --> <dubbo:protocol name="dubbo" port="20880" /> <dubbo:protocol name="hessian" port="8080" /> <!-- 使用多个协议暴露服务 --> <dubbo:service id="helloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" protocol="dubbo,hessian" /> </beans> ``` [^1]: 可以自行扩展协议,参见:[协议扩展](http://dubbo.apache.org/books/dubbo-dev-book/impls/protocol.html)
{ "pile_set_name": "Github" }
package layout import ( "context" "encoding/json" "fmt" "os" "path/filepath" "strings" "github.com/containers/image/v5/directory/explicitfilepath" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/image" "github.com/containers/image/v5/oci/internal" "github.com/containers/image/v5/transports" "github.com/containers/image/v5/types" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) func init() { transports.Register(Transport) } var ( // Transport is an ImageTransport for OCI directories. Transport = ociTransport{} // ErrMoreThanOneImage is an error returned when the manifest includes // more than one image and the user should choose which one to use. ErrMoreThanOneImage = errors.New("more than one image in oci, choose an image") ) type ociTransport struct{} func (t ociTransport) Name() string { return "oci" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t ociTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t ociTransport) ValidatePolicyConfigurationScope(scope string) error { return internal.ValidateScope(scope) } // ociReference is an ImageReference for OCI directory paths. type ociReference struct { // Note that the interpretation of paths below depends on the underlying filesystem state, which may change under us at any time! // Either of the paths may point to a different, or no, inode over time. resolvedDir may contain symbolic links, and so on. // Generally we follow the intent of the user, and use the "dir" member for filesystem operations (e.g. the user can use a relative path to avoid // being exposed to symlinks and renames in the parent directories to the working directory). // (But in general, we make no attempt to be completely safe against concurrent hostile filesystem modifications.) dir string // As specified by the user. May be relative, contain symlinks, etc. resolvedDir string // Absolute path with no symlinks, at least at the time of its creation. Primarily used for policy namespaces. // If image=="", it means the "only image" in the index.json is used in the case it is a source // for destinations, the image name annotation "image.ref.name" is not added to the index.json image string } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an OCI ImageReference. func ParseReference(reference string) (types.ImageReference, error) { dir, image := internal.SplitPathAndImage(reference) return NewReference(dir, image) } // NewReference returns an OCI reference for a directory and a image. // // We do not expose an API supplying the resolvedDir; we could, but recomputing it // is generally cheap enough that we prefer being confident about the properties of resolvedDir. func NewReference(dir, image string) (types.ImageReference, error) { resolved, err := explicitfilepath.ResolvePathToFullyExplicit(dir) if err != nil { return nil, err } if err := internal.ValidateOCIPath(dir); err != nil { return nil, err } if err = internal.ValidateImageName(image); err != nil { return nil, err } return ociReference{dir: dir, resolvedDir: resolved, image: image}, nil } func (ref ociReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref ociReference) StringWithinTransport() string { return fmt.Sprintf("%s:%s", ref.dir, ref.image) } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref ociReference) DockerReference() reference.Named { return nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref ociReference) PolicyConfigurationIdentity() string { // NOTE: ref.image is not a part of the image identity, because "$dir:$someimage" and "$dir:" may mean the // same image and the two can’t be statically disambiguated. Using at least the repository directory is // less granular but hopefully still useful. return ref.resolvedDir } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref ociReference) PolicyConfigurationNamespaces() []string { res := []string{} path := ref.resolvedDir for { lastSlash := strings.LastIndex(path, "/") // Note that we do not include "/"; it is redundant with the default "" global default, // and rejected by ociTransport.ValidatePolicyConfigurationScope above. if lastSlash == -1 || path == "/" { break } res = append(res, path) path = path[:lastSlash] } return res } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref ociReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { src, err := newImageSource(sys, ref) if err != nil { return nil, err } return image.FromSource(ctx, sys, src) } // getIndex returns a pointer to the index references by this ociReference. If an error occurs opening an index nil is returned together // with an error. func (ref ociReference) getIndex() (*imgspecv1.Index, error) { indexJSON, err := os.Open(ref.indexPath()) if err != nil { return nil, err } defer indexJSON.Close() index := &imgspecv1.Index{} if err := json.NewDecoder(indexJSON).Decode(index); err != nil { return nil, err } return index, nil } func (ref ociReference) getManifestDescriptor() (imgspecv1.Descriptor, error) { index, err := ref.getIndex() if err != nil { return imgspecv1.Descriptor{}, err } var d *imgspecv1.Descriptor if ref.image == "" { // return manifest if only one image is in the oci directory if len(index.Manifests) == 1 { d = &index.Manifests[0] } else { // ask user to choose image when more than one image in the oci directory return imgspecv1.Descriptor{}, ErrMoreThanOneImage } } else { // if image specified, look through all manifests for a match for _, md := range index.Manifests { if md.MediaType != imgspecv1.MediaTypeImageManifest && md.MediaType != imgspecv1.MediaTypeImageIndex { continue } refName, ok := md.Annotations[imgspecv1.AnnotationRefName] if !ok { continue } if refName == ref.image { d = &md break } } } if d == nil { return imgspecv1.Descriptor{}, fmt.Errorf("no descriptor found for reference %q", ref.image) } return *d, nil } // LoadManifestDescriptor loads the manifest descriptor to be used to retrieve the image name // when pulling an image func LoadManifestDescriptor(imgRef types.ImageReference) (imgspecv1.Descriptor, error) { ociRef, ok := imgRef.(ociReference) if !ok { return imgspecv1.Descriptor{}, errors.Errorf("error typecasting, need type ociRef") } return ociRef.getManifestDescriptor() } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref ociReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref ociReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref ociReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return errors.Errorf("Deleting images not implemented for oci: images") } // ociLayoutPath returns a path for the oci-layout within a directory using OCI conventions. func (ref ociReference) ociLayoutPath() string { return filepath.Join(ref.dir, "oci-layout") } // indexPath returns a path for the index.json within a directory using OCI conventions. func (ref ociReference) indexPath() string { return filepath.Join(ref.dir, "index.json") } // blobPath returns a path for a blob within a directory using OCI image-layout conventions. func (ref ociReference) blobPath(digest digest.Digest, sharedBlobDir string) (string, error) { if err := digest.Validate(); err != nil { return "", errors.Wrapf(err, "unexpected digest reference %s", digest) } blobDir := filepath.Join(ref.dir, "blobs") if sharedBlobDir != "" { blobDir = sharedBlobDir } return filepath.Join(blobDir, digest.Algorithm().String(), digest.Hex()), nil }
{ "pile_set_name": "Github" }
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement # kindlekey.py # Copyright © 2008-2017 Apprentice Harper et al. __license__ = 'GPL v3' __version__ = '2.5' # Revision history: # 1.0 - Kindle info file decryption, extracted from k4mobidedrm, etc. # 1.1 - Added Tkinter to match adobekey.py # 1.2 - Fixed testing of successful retrieval on Mac # 1.3 - Added getkey interface for Windows DeDRM application # Simplified some of the Kindle for Mac code. # 1.4 - Remove dependency on alfcrypto # 1.5 - moved unicode_argv call inside main for Windows DeDRM compatibility # 1.6 - Fixed a problem getting the disk serial numbers # 1.7 - Work if TkInter is missing # 1.8 - Fixes for Kindle for Mac, and non-ascii in Windows user names # 1.9 - Fixes for Unicode in Windows user names # 2.0 - Added comments and extra fix for non-ascii Windows user names # 2.1 - Fixed Kindle for PC encryption changes March 2016 # 2.2 - Fixes for Macs with bonded ethernet ports # Also removed old .kinfo file support (pre-2011) # 2.3 - Added more field names thanks to concavegit's KFX code. # 2.4 - Fix for complex Mac disk setups, thanks to Tibs # 2.5 - Final Fix for Windows user names with non-ascii characters, thanks to oneofusoneofus """ Retrieve Kindle for PC/Mac user key. """ import sys, os, re from struct import pack, unpack, unpack_from import json import getopt # Routines common to Mac and PC # Wrap a stream so that output gets flushed immediately # and also make sure that any unicode strings get # encoded using "replace" before writing them. class SafeUnbuffered: def __init__(self, stream): self.stream = stream self.encoding = stream.encoding if self.encoding == None: self.encoding = "utf-8" def write(self, data): if isinstance(data,unicode): data = data.encode(self.encoding,"replace") self.stream.write(data) self.stream.flush() def __getattr__(self, attr): return getattr(self.stream, attr) try: from calibre.constants import iswindows, isosx except: iswindows = sys.platform.startswith('win') isosx = sys.platform.startswith('darwin') def unicode_argv(): if iswindows: # Uses shell32.GetCommandLineArgvW to get sys.argv as a list of Unicode # strings. # Versions 2.x of Python don't support Unicode in sys.argv on # Windows, with the underlying Windows API instead replacing multi-byte # characters with '?'. So use shell32.GetCommandLineArgvW to get sys.argv # as a list of Unicode strings and encode them as utf-8 from ctypes import POINTER, byref, cdll, c_int, windll from ctypes.wintypes import LPCWSTR, LPWSTR GetCommandLineW = cdll.kernel32.GetCommandLineW GetCommandLineW.argtypes = [] GetCommandLineW.restype = LPCWSTR CommandLineToArgvW = windll.shell32.CommandLineToArgvW CommandLineToArgvW.argtypes = [LPCWSTR, POINTER(c_int)] CommandLineToArgvW.restype = POINTER(LPWSTR) cmd = GetCommandLineW() argc = c_int(0) argv = CommandLineToArgvW(cmd, byref(argc)) if argc.value > 0: # Remove Python executable and commands if present start = argc.value - len(sys.argv) return [argv[i] for i in xrange(start, argc.value)] # if we don't have any arguments at all, just pass back script name # this should never happen return [u"kindlekey.py"] else: argvencoding = sys.stdin.encoding if argvencoding == None: argvencoding = "utf-8" return [arg if (type(arg) == unicode) else unicode(arg,argvencoding) for arg in sys.argv] class DrmException(Exception): pass # crypto digestroutines import hashlib def MD5(message): ctx = hashlib.md5() ctx.update(message) return ctx.digest() def SHA1(message): ctx = hashlib.sha1() ctx.update(message) return ctx.digest() def SHA256(message): ctx = hashlib.sha256() ctx.update(message) return ctx.digest() # For K4M/PC 1.6.X and later # generate table of prime number less than or equal to int n def primes(n): if n==2: return [2] elif n<2: return [] s=range(3,n+1,2) mroot = n ** 0.5 half=(n+1)/2-1 i=0 m=3 while m <= mroot: if s[i]: j=(m*m-3)/2 s[j]=0 while j<half: s[j]=0 j+=m i=i+1 m=2*i+3 return [2]+[x for x in s if x] # Encode the bytes in data with the characters in map def encode(data, map): result = '' for char in data: value = ord(char) Q = (value ^ 0x80) // len(map) R = value % len(map) result += map[Q] result += map[R] return result # Hash the bytes in data and then encode the digest with the characters in map def encodeHash(data,map): return encode(MD5(data),map) # Decode the string in data with the characters in map. Returns the decoded bytes def decode(data,map): result = '' for i in range (0,len(data)-1,2): high = map.find(data[i]) low = map.find(data[i+1]) if (high == -1) or (low == -1) : break value = (((high * len(map)) ^ 0x80) & 0xFF) + low result += pack('B',value) return result # Routines unique to Mac and PC if iswindows: from ctypes import windll, c_char_p, c_wchar_p, c_uint, POINTER, byref, \ create_unicode_buffer, create_string_buffer, CFUNCTYPE, addressof, \ string_at, Structure, c_void_p, cast import _winreg as winreg MAX_PATH = 255 kernel32 = windll.kernel32 advapi32 = windll.advapi32 crypt32 = windll.crypt32 try: # try to get fast routines from alfcrypto from alfcrypto import AES_CBC, KeyIVGen except: # alfcrypto not available, so use python implementations """ Routines for doing AES CBC in one file Modified by some_updates to extract and combine only those parts needed for AES CBC into one simple to add python file Original Version Copyright (c) 2002 by Paul A. Lambert Under: CryptoPy Artisitic License Version 1.0 See the wonderful pure python package cryptopy-1.2.5 and read its LICENSE.txt for complete license details. """ class CryptoError(Exception): """ Base class for crypto exceptions """ def __init__(self,errorMessage='Error!'): self.message = errorMessage def __str__(self): return self.message class InitCryptoError(CryptoError): """ Crypto errors during algorithm initialization """ class BadKeySizeError(InitCryptoError): """ Bad key size error """ class EncryptError(CryptoError): """ Error in encryption processing """ class DecryptError(CryptoError): """ Error in decryption processing """ class DecryptNotBlockAlignedError(DecryptError): """ Error in decryption processing """ def xorS(a,b): """ XOR two strings """ assert len(a)==len(b) x = [] for i in range(len(a)): x.append( chr(ord(a[i])^ord(b[i]))) return ''.join(x) def xor(a,b): """ XOR two strings """ x = [] for i in range(min(len(a),len(b))): x.append( chr(ord(a[i])^ord(b[i]))) return ''.join(x) """ Base 'BlockCipher' and Pad classes for cipher instances. BlockCipher supports automatic padding and type conversion. The BlockCipher class was written to make the actual algorithm code more readable and not for performance. """ class BlockCipher: """ Block ciphers """ def __init__(self): self.reset() def reset(self): self.resetEncrypt() self.resetDecrypt() def resetEncrypt(self): self.encryptBlockCount = 0 self.bytesToEncrypt = '' def resetDecrypt(self): self.decryptBlockCount = 0 self.bytesToDecrypt = '' def encrypt(self, plainText, more = None): """ Encrypt a string and return a binary string """ self.bytesToEncrypt += plainText # append plainText to any bytes from prior encrypt numBlocks, numExtraBytes = divmod(len(self.bytesToEncrypt), self.blockSize) cipherText = '' for i in range(numBlocks): bStart = i*self.blockSize ctBlock = self.encryptBlock(self.bytesToEncrypt[bStart:bStart+self.blockSize]) self.encryptBlockCount += 1 cipherText += ctBlock if numExtraBytes > 0: # save any bytes that are not block aligned self.bytesToEncrypt = self.bytesToEncrypt[-numExtraBytes:] else: self.bytesToEncrypt = '' if more == None: # no more data expected from caller finalBytes = self.padding.addPad(self.bytesToEncrypt,self.blockSize) if len(finalBytes) > 0: ctBlock = self.encryptBlock(finalBytes) self.encryptBlockCount += 1 cipherText += ctBlock self.resetEncrypt() return cipherText def decrypt(self, cipherText, more = None): """ Decrypt a string and return a string """ self.bytesToDecrypt += cipherText # append to any bytes from prior decrypt numBlocks, numExtraBytes = divmod(len(self.bytesToDecrypt), self.blockSize) if more == None: # no more calls to decrypt, should have all the data if numExtraBytes != 0: raise DecryptNotBlockAlignedError, 'Data not block aligned on decrypt' # hold back some bytes in case last decrypt has zero len if (more != None) and (numExtraBytes == 0) and (numBlocks >0) : numBlocks -= 1 numExtraBytes = self.blockSize plainText = '' for i in range(numBlocks): bStart = i*self.blockSize ptBlock = self.decryptBlock(self.bytesToDecrypt[bStart : bStart+self.blockSize]) self.decryptBlockCount += 1 plainText += ptBlock if numExtraBytes > 0: # save any bytes that are not block aligned self.bytesToEncrypt = self.bytesToEncrypt[-numExtraBytes:] else: self.bytesToEncrypt = '' if more == None: # last decrypt remove padding plainText = self.padding.removePad(plainText, self.blockSize) self.resetDecrypt() return plainText class Pad: def __init__(self): pass # eventually could put in calculation of min and max size extension class padWithPadLen(Pad): """ Pad a binary string with the length of the padding """ def addPad(self, extraBytes, blockSize): """ Add padding to a binary string to make it an even multiple of the block size """ blocks, numExtraBytes = divmod(len(extraBytes), blockSize) padLength = blockSize - numExtraBytes return extraBytes + padLength*chr(padLength) def removePad(self, paddedBinaryString, blockSize): """ Remove padding from a binary string """ if not(0<len(paddedBinaryString)): raise DecryptNotBlockAlignedError, 'Expected More Data' return paddedBinaryString[:-ord(paddedBinaryString[-1])] class noPadding(Pad): """ No padding. Use this to get ECB behavior from encrypt/decrypt """ def addPad(self, extraBytes, blockSize): """ Add no padding """ return extraBytes def removePad(self, paddedBinaryString, blockSize): """ Remove no padding """ return paddedBinaryString """ Rijndael encryption algorithm This byte oriented implementation is intended to closely match FIPS specification for readability. It is not implemented for performance. """ class Rijndael(BlockCipher): """ Rijndael encryption algorithm """ def __init__(self, key = None, padding = padWithPadLen(), keySize=16, blockSize=16 ): self.name = 'RIJNDAEL' self.keySize = keySize self.strength = keySize*8 self.blockSize = blockSize # blockSize is in bytes self.padding = padding # change default to noPadding() to get normal ECB behavior assert( keySize%4==0 and NrTable[4].has_key(keySize/4)),'key size must be 16,20,24,29 or 32 bytes' assert( blockSize%4==0 and NrTable.has_key(blockSize/4)), 'block size must be 16,20,24,29 or 32 bytes' self.Nb = self.blockSize/4 # Nb is number of columns of 32 bit words self.Nk = keySize/4 # Nk is the key length in 32-bit words self.Nr = NrTable[self.Nb][self.Nk] # The number of rounds (Nr) is a function of # the block (Nb) and key (Nk) sizes. if key != None: self.setKey(key) def setKey(self, key): """ Set a key and generate the expanded key """ assert( len(key) == (self.Nk*4) ), 'Key length must be same as keySize parameter' self.__expandedKey = keyExpansion(self, key) self.reset() # BlockCipher.reset() def encryptBlock(self, plainTextBlock): """ Encrypt a block, plainTextBlock must be a array of bytes [Nb by 4] """ self.state = self._toBlock(plainTextBlock) AddRoundKey(self, self.__expandedKey[0:self.Nb]) for round in range(1,self.Nr): #for round = 1 step 1 to Nr SubBytes(self) ShiftRows(self) MixColumns(self) AddRoundKey(self, self.__expandedKey[round*self.Nb:(round+1)*self.Nb]) SubBytes(self) ShiftRows(self) AddRoundKey(self, self.__expandedKey[self.Nr*self.Nb:(self.Nr+1)*self.Nb]) return self._toBString(self.state) def decryptBlock(self, encryptedBlock): """ decrypt a block (array of bytes) """ self.state = self._toBlock(encryptedBlock) AddRoundKey(self, self.__expandedKey[self.Nr*self.Nb:(self.Nr+1)*self.Nb]) for round in range(self.Nr-1,0,-1): InvShiftRows(self) InvSubBytes(self) AddRoundKey(self, self.__expandedKey[round*self.Nb:(round+1)*self.Nb]) InvMixColumns(self) InvShiftRows(self) InvSubBytes(self) AddRoundKey(self, self.__expandedKey[0:self.Nb]) return self._toBString(self.state) def _toBlock(self, bs): """ Convert binary string to array of bytes, state[col][row]""" assert ( len(bs) == 4*self.Nb ), 'Rijndarl blocks must be of size blockSize' return [[ord(bs[4*i]),ord(bs[4*i+1]),ord(bs[4*i+2]),ord(bs[4*i+3])] for i in range(self.Nb)] def _toBString(self, block): """ Convert block (array of bytes) to binary string """ l = [] for col in block: for rowElement in col: l.append(chr(rowElement)) return ''.join(l) #------------------------------------- """ Number of rounds Nr = NrTable[Nb][Nk] Nb Nk=4 Nk=5 Nk=6 Nk=7 Nk=8 ------------------------------------- """ NrTable = {4: {4:10, 5:11, 6:12, 7:13, 8:14}, 5: {4:11, 5:11, 6:12, 7:13, 8:14}, 6: {4:12, 5:12, 6:12, 7:13, 8:14}, 7: {4:13, 5:13, 6:13, 7:13, 8:14}, 8: {4:14, 5:14, 6:14, 7:14, 8:14}} #------------------------------------- def keyExpansion(algInstance, keyString): """ Expand a string of size keySize into a larger array """ Nk, Nb, Nr = algInstance.Nk, algInstance.Nb, algInstance.Nr # for readability key = [ord(byte) for byte in keyString] # convert string to list w = [[key[4*i],key[4*i+1],key[4*i+2],key[4*i+3]] for i in range(Nk)] for i in range(Nk,Nb*(Nr+1)): temp = w[i-1] # a four byte column if (i%Nk) == 0 : temp = temp[1:]+[temp[0]] # RotWord(temp) temp = [ Sbox[byte] for byte in temp ] temp[0] ^= Rcon[i/Nk] elif Nk > 6 and i%Nk == 4 : temp = [ Sbox[byte] for byte in temp ] # SubWord(temp) w.append( [ w[i-Nk][byte]^temp[byte] for byte in range(4) ] ) return w Rcon = (0,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36, # note extra '0' !!! 0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6, 0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91) #------------------------------------- def AddRoundKey(algInstance, keyBlock): """ XOR the algorithm state with a block of key material """ for column in range(algInstance.Nb): for row in range(4): algInstance.state[column][row] ^= keyBlock[column][row] #------------------------------------- def SubBytes(algInstance): for column in range(algInstance.Nb): for row in range(4): algInstance.state[column][row] = Sbox[algInstance.state[column][row]] def InvSubBytes(algInstance): for column in range(algInstance.Nb): for row in range(4): algInstance.state[column][row] = InvSbox[algInstance.state[column][row]] Sbox = (0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5, 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76, 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0, 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0, 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc, 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15, 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a, 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75, 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0, 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84, 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b, 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf, 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85, 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8, 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5, 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2, 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17, 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73, 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88, 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb, 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c, 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79, 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9, 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08, 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6, 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a, 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e, 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e, 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94, 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf, 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68, 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16) InvSbox = (0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38, 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb, 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87, 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb, 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d, 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e, 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2, 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25, 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16, 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92, 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda, 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84, 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a, 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06, 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02, 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b, 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea, 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73, 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85, 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e, 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89, 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b, 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20, 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4, 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31, 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f, 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d, 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef, 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0, 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61, 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26, 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d) #------------------------------------- """ For each block size (Nb), the ShiftRow operation shifts row i by the amount Ci. Note that row 0 is not shifted. Nb C1 C2 C3 ------------------- """ shiftOffset = { 4 : ( 0, 1, 2, 3), 5 : ( 0, 1, 2, 3), 6 : ( 0, 1, 2, 3), 7 : ( 0, 1, 2, 4), 8 : ( 0, 1, 3, 4) } def ShiftRows(algInstance): tmp = [0]*algInstance.Nb # list of size Nb for r in range(1,4): # row 0 reamains unchanged and can be skipped for c in range(algInstance.Nb): tmp[c] = algInstance.state[(c+shiftOffset[algInstance.Nb][r]) % algInstance.Nb][r] for c in range(algInstance.Nb): algInstance.state[c][r] = tmp[c] def InvShiftRows(algInstance): tmp = [0]*algInstance.Nb # list of size Nb for r in range(1,4): # row 0 reamains unchanged and can be skipped for c in range(algInstance.Nb): tmp[c] = algInstance.state[(c+algInstance.Nb-shiftOffset[algInstance.Nb][r]) % algInstance.Nb][r] for c in range(algInstance.Nb): algInstance.state[c][r] = tmp[c] #------------------------------------- def MixColumns(a): Sprime = [0,0,0,0] for j in range(a.Nb): # for each column Sprime[0] = mul(2,a.state[j][0])^mul(3,a.state[j][1])^mul(1,a.state[j][2])^mul(1,a.state[j][3]) Sprime[1] = mul(1,a.state[j][0])^mul(2,a.state[j][1])^mul(3,a.state[j][2])^mul(1,a.state[j][3]) Sprime[2] = mul(1,a.state[j][0])^mul(1,a.state[j][1])^mul(2,a.state[j][2])^mul(3,a.state[j][3]) Sprime[3] = mul(3,a.state[j][0])^mul(1,a.state[j][1])^mul(1,a.state[j][2])^mul(2,a.state[j][3]) for i in range(4): a.state[j][i] = Sprime[i] def InvMixColumns(a): """ Mix the four bytes of every column in a linear way This is the opposite operation of Mixcolumn """ Sprime = [0,0,0,0] for j in range(a.Nb): # for each column Sprime[0] = mul(0x0E,a.state[j][0])^mul(0x0B,a.state[j][1])^mul(0x0D,a.state[j][2])^mul(0x09,a.state[j][3]) Sprime[1] = mul(0x09,a.state[j][0])^mul(0x0E,a.state[j][1])^mul(0x0B,a.state[j][2])^mul(0x0D,a.state[j][3]) Sprime[2] = mul(0x0D,a.state[j][0])^mul(0x09,a.state[j][1])^mul(0x0E,a.state[j][2])^mul(0x0B,a.state[j][3]) Sprime[3] = mul(0x0B,a.state[j][0])^mul(0x0D,a.state[j][1])^mul(0x09,a.state[j][2])^mul(0x0E,a.state[j][3]) for i in range(4): a.state[j][i] = Sprime[i] #------------------------------------- def mul(a, b): """ Multiply two elements of GF(2^m) needed for MixColumn and InvMixColumn """ if (a !=0 and b!=0): return Alogtable[(Logtable[a] + Logtable[b])%255] else: return 0 Logtable = ( 0, 0, 25, 1, 50, 2, 26, 198, 75, 199, 27, 104, 51, 238, 223, 3, 100, 4, 224, 14, 52, 141, 129, 239, 76, 113, 8, 200, 248, 105, 28, 193, 125, 194, 29, 181, 249, 185, 39, 106, 77, 228, 166, 114, 154, 201, 9, 120, 101, 47, 138, 5, 33, 15, 225, 36, 18, 240, 130, 69, 53, 147, 218, 142, 150, 143, 219, 189, 54, 208, 206, 148, 19, 92, 210, 241, 64, 70, 131, 56, 102, 221, 253, 48, 191, 6, 139, 98, 179, 37, 226, 152, 34, 136, 145, 16, 126, 110, 72, 195, 163, 182, 30, 66, 58, 107, 40, 84, 250, 133, 61, 186, 43, 121, 10, 21, 155, 159, 94, 202, 78, 212, 172, 229, 243, 115, 167, 87, 175, 88, 168, 80, 244, 234, 214, 116, 79, 174, 233, 213, 231, 230, 173, 232, 44, 215, 117, 122, 235, 22, 11, 245, 89, 203, 95, 176, 156, 169, 81, 160, 127, 12, 246, 111, 23, 196, 73, 236, 216, 67, 31, 45, 164, 118, 123, 183, 204, 187, 62, 90, 251, 96, 177, 134, 59, 82, 161, 108, 170, 85, 41, 157, 151, 178, 135, 144, 97, 190, 220, 252, 188, 149, 207, 205, 55, 63, 91, 209, 83, 57, 132, 60, 65, 162, 109, 71, 20, 42, 158, 93, 86, 242, 211, 171, 68, 17, 146, 217, 35, 32, 46, 137, 180, 124, 184, 38, 119, 153, 227, 165, 103, 74, 237, 222, 197, 49, 254, 24, 13, 99, 140, 128, 192, 247, 112, 7) Alogtable= ( 1, 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246, 1) """ AES Encryption Algorithm The AES algorithm is just Rijndael algorithm restricted to the default blockSize of 128 bits. """ class AES(Rijndael): """ The AES algorithm is the Rijndael block cipher restricted to block sizes of 128 bits and key sizes of 128, 192 or 256 bits """ def __init__(self, key = None, padding = padWithPadLen(), keySize=16): """ Initialize AES, keySize is in bytes """ if not (keySize == 16 or keySize == 24 or keySize == 32) : raise BadKeySizeError, 'Illegal AES key size, must be 16, 24, or 32 bytes' Rijndael.__init__( self, key, padding=padding, keySize=keySize, blockSize=16 ) self.name = 'AES' """ CBC mode of encryption for block ciphers. This algorithm mode wraps any BlockCipher to make a Cipher Block Chaining mode. """ from random import Random # should change to crypto.random!!! class CBC(BlockCipher): """ The CBC class wraps block ciphers to make cipher block chaining (CBC) mode algorithms. The initialization (IV) is automatic if set to None. Padding is also automatic based on the Pad class used to initialize the algorithm """ def __init__(self, blockCipherInstance, padding = padWithPadLen()): """ CBC algorithms are created by initializing with a BlockCipher instance """ self.baseCipher = blockCipherInstance self.name = self.baseCipher.name + '_CBC' self.blockSize = self.baseCipher.blockSize self.keySize = self.baseCipher.keySize self.padding = padding self.baseCipher.padding = noPadding() # baseCipher should NOT pad!! self.r = Random() # for IV generation, currently uses # mediocre standard distro version <---------------- import time newSeed = time.ctime()+str(self.r) # seed with instance location self.r.seed(newSeed) # to make unique self.reset() def setKey(self, key): self.baseCipher.setKey(key) # Overload to reset both CBC state and the wrapped baseCipher def resetEncrypt(self): BlockCipher.resetEncrypt(self) # reset CBC encrypt state (super class) self.baseCipher.resetEncrypt() # reset base cipher encrypt state def resetDecrypt(self): BlockCipher.resetDecrypt(self) # reset CBC state (super class) self.baseCipher.resetDecrypt() # reset base cipher decrypt state def encrypt(self, plainText, iv=None, more=None): """ CBC encryption - overloads baseCipher to allow optional explicit IV when iv=None, iv is auto generated! """ if self.encryptBlockCount == 0: self.iv = iv else: assert(iv==None), 'IV used only on first call to encrypt' return BlockCipher.encrypt(self,plainText, more=more) def decrypt(self, cipherText, iv=None, more=None): """ CBC decryption - overloads baseCipher to allow optional explicit IV when iv=None, iv is auto generated! """ if self.decryptBlockCount == 0: self.iv = iv else: assert(iv==None), 'IV used only on first call to decrypt' return BlockCipher.decrypt(self, cipherText, more=more) def encryptBlock(self, plainTextBlock): """ CBC block encryption, IV is set with 'encrypt' """ auto_IV = '' if self.encryptBlockCount == 0: if self.iv == None: # generate IV and use self.iv = ''.join([chr(self.r.randrange(256)) for i in range(self.blockSize)]) self.prior_encr_CT_block = self.iv auto_IV = self.prior_encr_CT_block # prepend IV if it's automatic else: # application provided IV assert(len(self.iv) == self.blockSize ),'IV must be same length as block' self.prior_encr_CT_block = self.iv """ encrypt the prior CT XORed with the PT """ ct = self.baseCipher.encryptBlock( xor(self.prior_encr_CT_block, plainTextBlock) ) self.prior_encr_CT_block = ct return auto_IV+ct def decryptBlock(self, encryptedBlock): """ Decrypt a single block """ if self.decryptBlockCount == 0: # first call, process IV if self.iv == None: # auto decrypt IV? self.prior_CT_block = encryptedBlock return '' else: assert(len(self.iv)==self.blockSize),"Bad IV size on CBC decryption" self.prior_CT_block = self.iv dct = self.baseCipher.decryptBlock(encryptedBlock) """ XOR the prior decrypted CT with the prior CT """ dct_XOR_priorCT = xor( self.prior_CT_block, dct ) self.prior_CT_block = encryptedBlock return dct_XOR_priorCT """ AES_CBC Encryption Algorithm """ class aescbc_AES_CBC(CBC): """ AES encryption in CBC feedback mode """ def __init__(self, key=None, padding=padWithPadLen(), keySize=16): CBC.__init__( self, AES(key, noPadding(), keySize), padding) self.name = 'AES_CBC' class AES_CBC(object): def __init__(self): self._key = None self._iv = None self.aes = None def set_decrypt_key(self, userkey, iv): self._key = userkey self._iv = iv self.aes = aescbc_AES_CBC(userkey, noPadding(), len(userkey)) def decrypt(self, data): iv = self._iv cleartext = self.aes.decrypt(iv + data) return cleartext import hmac class KeyIVGen(object): # this only exists in openssl so we will use pure python implementation instead # PKCS5_PBKDF2_HMAC_SHA1 = F(c_int, 'PKCS5_PBKDF2_HMAC_SHA1', # [c_char_p, c_ulong, c_char_p, c_ulong, c_ulong, c_ulong, c_char_p]) def pbkdf2(self, passwd, salt, iter, keylen): def xorstr( a, b ): if len(a) != len(b): raise Exception("xorstr(): lengths differ") return ''.join((chr(ord(x)^ord(y)) for x, y in zip(a, b))) def prf( h, data ): hm = h.copy() hm.update( data ) return hm.digest() def pbkdf2_F( h, salt, itercount, blocknum ): U = prf( h, salt + pack('>i',blocknum ) ) T = U for i in range(2, itercount+1): U = prf( h, U ) T = xorstr( T, U ) return T sha = hashlib.sha1 digest_size = sha().digest_size # l - number of output blocks to produce l = keylen / digest_size if keylen % digest_size != 0: l += 1 h = hmac.new( passwd, None, sha ) T = "" for i in range(1, l+1): T += pbkdf2_F( h, salt, iter, i ) return T[0: keylen] def UnprotectHeaderData(encryptedData): passwdData = 'header_key_data' salt = 'HEADER.2011' iter = 0x80 keylen = 0x100 key_iv = KeyIVGen().pbkdf2(passwdData, salt, iter, keylen) key = key_iv[0:32] iv = key_iv[32:48] aes=AES_CBC() aes.set_decrypt_key(key, iv) cleartext = aes.decrypt(encryptedData) return cleartext # Various character maps used to decrypt kindle info values. # Probably supposed to act as obfuscation charMap2 = "AaZzB0bYyCc1XxDdW2wEeVv3FfUuG4g-TtHh5SsIiR6rJjQq7KkPpL8lOoMm9Nn_" charMap5 = "AzB0bYyCeVvaZ3FfUuG4g-TtHh5SsIiR6rJjQq7KkPpL8lOoMm9Nn_c1XxDdW2wE" # New maps in K4PC 1.9.0 testMap1 = "n5Pr6St7Uv8Wx9YzAb0Cd1Ef2Gh3Jk4M" testMap6 = "9YzAb0Cd1Ef2n5Pr6St7Uvh3Jk4M8WxG" testMap8 = "YvaZ3FfUm9Nn_c1XuG4yCAzB0beVg-TtHh5SsIiR6rJjQdW2wEq7KkPpL8lOoMxD" # interface with Windows OS Routines class DataBlob(Structure): _fields_ = [('cbData', c_uint), ('pbData', c_void_p)] DataBlob_p = POINTER(DataBlob) def GetSystemDirectory(): GetSystemDirectoryW = kernel32.GetSystemDirectoryW GetSystemDirectoryW.argtypes = [c_wchar_p, c_uint] GetSystemDirectoryW.restype = c_uint def GetSystemDirectory(): buffer = create_unicode_buffer(MAX_PATH + 1) GetSystemDirectoryW(buffer, len(buffer)) return buffer.value return GetSystemDirectory GetSystemDirectory = GetSystemDirectory() def GetVolumeSerialNumber(): GetVolumeInformationW = kernel32.GetVolumeInformationW GetVolumeInformationW.argtypes = [c_wchar_p, c_wchar_p, c_uint, POINTER(c_uint), POINTER(c_uint), POINTER(c_uint), c_wchar_p, c_uint] GetVolumeInformationW.restype = c_uint def GetVolumeSerialNumber(path = GetSystemDirectory().split('\\')[0] + '\\'): vsn = c_uint(0) GetVolumeInformationW(path, None, 0, byref(vsn), None, None, None, 0) return str(vsn.value) return GetVolumeSerialNumber GetVolumeSerialNumber = GetVolumeSerialNumber() def GetIDString(): vsn = GetVolumeSerialNumber() #print('Using Volume Serial Number for ID: '+vsn) return vsn def getLastError(): GetLastError = kernel32.GetLastError GetLastError.argtypes = None GetLastError.restype = c_uint def getLastError(): return GetLastError() return getLastError getLastError = getLastError() def GetUserName(): GetUserNameW = advapi32.GetUserNameW GetUserNameW.argtypes = [c_wchar_p, POINTER(c_uint)] GetUserNameW.restype = c_uint def GetUserName(): buffer = create_unicode_buffer(2) size = c_uint(len(buffer)) while not GetUserNameW(buffer, byref(size)): errcd = getLastError() if errcd == 234: # bad wine implementation up through wine 1.3.21 return "AlternateUserName" # double the buffer size buffer = create_unicode_buffer(len(buffer) * 2) size.value = len(buffer) # replace any non-ASCII values with 0xfffd for i in xrange(0,len(buffer)): if buffer[i]>u"\u007f": #print u"swapping char "+str(i)+" ("+buffer[i]+")" buffer[i] = u"\ufffd" # return utf-8 encoding of modified username #print u"modified username:"+buffer.value return buffer.value.encode('utf-8') return GetUserName GetUserName = GetUserName() def CryptUnprotectData(): _CryptUnprotectData = crypt32.CryptUnprotectData _CryptUnprotectData.argtypes = [DataBlob_p, c_wchar_p, DataBlob_p, c_void_p, c_void_p, c_uint, DataBlob_p] _CryptUnprotectData.restype = c_uint def CryptUnprotectData(indata, entropy, flags): indatab = create_string_buffer(indata) indata = DataBlob(len(indata), cast(indatab, c_void_p)) entropyb = create_string_buffer(entropy) entropy = DataBlob(len(entropy), cast(entropyb, c_void_p)) outdata = DataBlob() if not _CryptUnprotectData(byref(indata), None, byref(entropy), None, None, flags, byref(outdata)): # raise DrmException("Failed to Unprotect Data") return 'failed' return string_at(outdata.pbData, outdata.cbData) return CryptUnprotectData CryptUnprotectData = CryptUnprotectData() # Returns Environmental Variables that contain unicode def getEnvironmentVariable(name): import ctypes name = unicode(name) # make sure string argument is unicode n = ctypes.windll.kernel32.GetEnvironmentVariableW(name, None, 0) if n == 0: return None buf = ctypes.create_unicode_buffer(u'\0'*n) ctypes.windll.kernel32.GetEnvironmentVariableW(name, buf, n) return buf.value # Locate all of the kindle-info style files and return as list def getKindleInfoFiles(): kInfoFiles = [] # some 64 bit machines do not have the proper registry key for some reason # or the python interface to the 32 vs 64 bit registry is broken path = "" if 'LOCALAPPDATA' in os.environ.keys(): # Python 2.x does not return unicode env. Use Python 3.x path = winreg.ExpandEnvironmentStrings(u"%LOCALAPPDATA%") # this is just another alternative. # path = getEnvironmentVariable('LOCALAPPDATA') if not os.path.isdir(path): path = "" else: # User Shell Folders show take precedent over Shell Folders if present try: # this will still break regkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\") path = winreg.QueryValueEx(regkey, 'Local AppData')[0] if not os.path.isdir(path): path = "" try: regkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\") path = winreg.QueryValueEx(regkey, 'Local AppData')[0] if not os.path.isdir(path): path = "" except RegError: pass except RegError: pass found = False if path == "": print ('Could not find the folder in which to look for kinfoFiles.') else: # Probably not the best. To Fix (shouldn't ignore in encoding) or use utf-8 print(u'searching for kinfoFiles in ' + path.encode('ascii', 'ignore')) # look for (K4PC 1.9.0 and later) .kinf2011 file kinfopath = path +'\\Amazon\\Kindle\\storage\\.kinf2011' if os.path.isfile(kinfopath): found = True print('Found K4PC 1.9+ kinf2011 file: ' + kinfopath.encode('ascii','ignore')) kInfoFiles.append(kinfopath) # look for (K4PC 1.6.0 and later) rainier.2.1.1.kinf file kinfopath = path +'\\Amazon\\Kindle\\storage\\rainier.2.1.1.kinf' if os.path.isfile(kinfopath): found = True print('Found K4PC 1.6-1.8 kinf file: ' + kinfopath) kInfoFiles.append(kinfopath) # look for (K4PC 1.5.0 and later) rainier.2.1.1.kinf file kinfopath = path +'\\Amazon\\Kindle For PC\\storage\\rainier.2.1.1.kinf' if os.path.isfile(kinfopath): found = True print('Found K4PC 1.5 kinf file: ' + kinfopath) kInfoFiles.append(kinfopath) # look for original (earlier than K4PC 1.5.0) kindle-info files kinfopath = path +'\\Amazon\\Kindle For PC\\{AMAwzsaPaaZAzmZzZQzgZCAkZ3AjA_AY}\\kindle.info' if os.path.isfile(kinfopath): found = True print('Found K4PC kindle.info file: ' + kinfopath) kInfoFiles.append(kinfopath) if not found: print('No K4PC kindle.info/kinf/kinf2011 files have been found.') return kInfoFiles # determine type of kindle info provided and return a # database of keynames and values def getDBfromFile(kInfoFile): names = [\ 'kindle.account.tokens',\ 'kindle.cookie.item',\ 'eulaVersionAccepted',\ 'login_date',\ 'kindle.token.item',\ 'login',\ 'kindle.key.item',\ 'kindle.name.info',\ 'kindle.device.info',\ 'MazamaRandomNumber',\ 'max_date',\ 'SIGVERIF',\ 'build_version',\ 'SerialNumber',\ 'UsernameHash',\ 'kindle.directedid.info',\ 'DSN',\ 'kindle.accounttype.info',\ 'krx.flashcardsplugin.data.encryption_key',\ 'krx.notebookexportplugin.data.encryption_key',\ 'proxy.http.password',\ 'proxy.http.username' ] DB = {} with open(kInfoFile, 'rb') as infoReader: data = infoReader.read() # assume newest .kinf2011 style .kinf file # the .kinf file uses "/" to separate it into records # so remove the trailing "/" to make it easy to use split data = data[:-1] items = data.split('/') # starts with an encoded and encrypted header blob headerblob = items.pop(0) encryptedValue = decode(headerblob, testMap1) cleartext = UnprotectHeaderData(encryptedValue) #print "header cleartext:",cleartext # now extract the pieces that form the added entropy pattern = re.compile(r'''\[Version:(\d+)\]\[Build:(\d+)\]\[Cksum:([^\]]+)\]\[Guid:([\{\}a-z0-9\-]+)\]''', re.IGNORECASE) for m in re.finditer(pattern, cleartext): added_entropy = m.group(2) + m.group(4) # loop through the item records until all are processed while len(items) > 0: # get the first item record item = items.pop(0) # the first 32 chars of the first record of a group # is the MD5 hash of the key name encoded by charMap5 keyhash = item[0:32] # the sha1 of raw keyhash string is used to create entropy along # with the added entropy provided above from the headerblob entropy = SHA1(keyhash) + added_entropy # the remainder of the first record when decoded with charMap5 # has the ':' split char followed by the string representation # of the number of records that follow # and make up the contents srcnt = decode(item[34:],charMap5) rcnt = int(srcnt) # read and store in rcnt records of data # that make up the contents value edlst = [] for i in xrange(rcnt): item = items.pop(0) edlst.append(item) # key names now use the new testMap8 encoding keyname = "unknown" for name in names: if encodeHash(name,testMap8) == keyhash: keyname = name #print "keyname found from hash:",keyname break if keyname == "unknown": keyname = keyhash #print "keyname not found, hash is:",keyname # the testMap8 encoded contents data has had a length # of chars (always odd) cut off of the front and moved # to the end to prevent decoding using testMap8 from # working properly, and thereby preventing the ensuing # CryptUnprotectData call from succeeding. # The offset into the testMap8 encoded contents seems to be: # len(contents)-largest prime number <= int(len(content)/3) # (in other words split "about" 2/3rds of the way through) # move first offsets chars to end to align for decode by testMap8 # by moving noffset chars from the start of the # string to the end of the string encdata = "".join(edlst) #print "encrypted data:",encdata contlen = len(encdata) noffset = contlen - primes(int(contlen/3))[-1] pfx = encdata[0:noffset] encdata = encdata[noffset:] encdata = encdata + pfx #print "rearranged data:",encdata # decode using new testMap8 to get the original CryptProtect Data encryptedValue = decode(encdata,testMap8) #print "decoded data:",encryptedValue.encode('hex') cleartext = CryptUnprotectData(encryptedValue, entropy, 1) if len(cleartext)>0: #print "cleartext data:",cleartext,":end data" DB[keyname] = cleartext #print keyname, cleartext if len(DB)>6: # store values used in decryption DB['IDString'] = GetIDString() DB['UserName'] = GetUserName() print u"Decrypted key file using IDString '{0:s}' and UserName '{1:s}'".format(GetIDString(), GetUserName().encode('hex')) else: print u"Couldn't decrypt file." DB = {} return DB elif isosx: import copy import subprocess # interface to needed routines in openssl's libcrypto def _load_crypto_libcrypto(): from ctypes import CDLL, byref, POINTER, c_void_p, c_char_p, c_int, c_long, \ Structure, c_ulong, create_string_buffer, addressof, string_at, cast from ctypes.util import find_library libcrypto = find_library('crypto') if libcrypto is None: raise DrmException(u"libcrypto not found") libcrypto = CDLL(libcrypto) # From OpenSSL's crypto aes header # # AES_ENCRYPT 1 # AES_DECRYPT 0 # AES_MAXNR 14 (in bytes) # AES_BLOCK_SIZE 16 (in bytes) # # struct aes_key_st { # unsigned long rd_key[4 *(AES_MAXNR + 1)]; # int rounds; # }; # typedef struct aes_key_st AES_KEY; # # int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); # # note: the ivec string, and output buffer are both mutable # void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, # const unsigned long length, const AES_KEY *key, unsigned char *ivec, const int enc); AES_MAXNR = 14 c_char_pp = POINTER(c_char_p) c_int_p = POINTER(c_int) class AES_KEY(Structure): _fields_ = [('rd_key', c_long * (4 * (AES_MAXNR + 1))), ('rounds', c_int)] AES_KEY_p = POINTER(AES_KEY) def F(restype, name, argtypes): func = getattr(libcrypto, name) func.restype = restype func.argtypes = argtypes return func AES_cbc_encrypt = F(None, 'AES_cbc_encrypt',[c_char_p, c_char_p, c_ulong, AES_KEY_p, c_char_p,c_int]) AES_set_decrypt_key = F(c_int, 'AES_set_decrypt_key',[c_char_p, c_int, AES_KEY_p]) # From OpenSSL's Crypto evp/p5_crpt2.c # # int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, # const unsigned char *salt, int saltlen, int iter, # int keylen, unsigned char *out); PKCS5_PBKDF2_HMAC_SHA1 = F(c_int, 'PKCS5_PBKDF2_HMAC_SHA1', [c_char_p, c_ulong, c_char_p, c_ulong, c_ulong, c_ulong, c_char_p]) class LibCrypto(object): def __init__(self): self._blocksize = 0 self._keyctx = None self._iv = 0 def set_decrypt_key(self, userkey, iv): self._blocksize = len(userkey) if (self._blocksize != 16) and (self._blocksize != 24) and (self._blocksize != 32) : raise DrmException(u"AES improper key used") return keyctx = self._keyctx = AES_KEY() self._iv = iv self._userkey = userkey rv = AES_set_decrypt_key(userkey, len(userkey) * 8, keyctx) if rv < 0: raise DrmException(u"Failed to initialize AES key") def decrypt(self, data): out = create_string_buffer(len(data)) mutable_iv = create_string_buffer(self._iv, len(self._iv)) keyctx = self._keyctx rv = AES_cbc_encrypt(data, out, len(data), keyctx, mutable_iv, 0) if rv == 0: raise DrmException(u"AES decryption failed") return out.raw def keyivgen(self, passwd, salt, iter, keylen): saltlen = len(salt) passlen = len(passwd) out = create_string_buffer(keylen) rv = PKCS5_PBKDF2_HMAC_SHA1(passwd, passlen, salt, saltlen, iter, keylen, out) return out.raw return LibCrypto def _load_crypto(): LibCrypto = None try: LibCrypto = _load_crypto_libcrypto() except (ImportError, DrmException): pass return LibCrypto LibCrypto = _load_crypto() # Various character maps used to decrypt books. Probably supposed to act as obfuscation charMap1 = 'n5Pr6St7Uv8Wx9YzAb0Cd1Ef2Gh3Jk4M' charMap2 = 'ZB0bYyc1xDdW2wEV3Ff7KkPpL8UuGA4gz-Tme9Nn_tHh5SvXCsIiR6rJjQaqlOoM' # For kinf approach of K4Mac 1.6.X or later # On K4PC charMap5 = 'AzB0bYyCeVvaZ3FfUuG4g-TtHh5SsIiR6rJjQq7KkPpL8lOoMm9Nn_c1XxDdW2wE' # For Mac they seem to re-use charMap2 here charMap5 = charMap2 # new in K4M 1.9.X testMap8 = 'YvaZ3FfUm9Nn_c1XuG4yCAzB0beVg-TtHh5SsIiR6rJjQdW2wEq7KkPpL8lOoMxD' # uses a sub process to get the Hard Drive Serial Number using ioreg # returns serial numbers of all internal hard drive drives def GetVolumesSerialNumbers(): sernums = [] sernum = os.getenv('MYSERIALNUMBER') if sernum != None: sernums.append(sernum.strip()) cmdline = '/usr/sbin/ioreg -w 0 -r -c AppleAHCIDiskDriver' cmdline = cmdline.encode(sys.getfilesystemencoding()) p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False) out1, out2 = p.communicate() #print out1 reslst = out1.split('\n') cnt = len(reslst) for j in xrange(cnt): resline = reslst[j] pp = resline.find('\"Serial Number\" = \"') if pp >= 0: sernum = resline[pp+19:-1] sernums.append(sernum.strip()) return sernums def GetDiskPartitionNames(): names = [] cmdline = '/sbin/mount' cmdline = cmdline.encode(sys.getfilesystemencoding()) p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False) out1, out2 = p.communicate() reslst = out1.split('\n') cnt = len(reslst) for j in xrange(cnt): resline = reslst[j] if resline.startswith('/dev'): (devpart, mpath) = resline.split(' on ')[:2] dpart = devpart[5:] names.append(dpart) return names # uses a sub process to get the UUID of all disk partitions def GetDiskPartitionUUIDs(): uuids = [] uuidnum = os.getenv('MYUUIDNUMBER') if uuidnum != None: uuids.append(strip(uuidnum)) cmdline = '/usr/sbin/ioreg -l -S -w 0 -r -c AppleAHCIDiskDriver' cmdline = cmdline.encode(sys.getfilesystemencoding()) p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False) out1, out2 = p.communicate() #print out1 reslst = out1.split('\n') cnt = len(reslst) for j in xrange(cnt): resline = reslst[j] pp = resline.find('\"UUID\" = \"') if pp >= 0: uuidnum = resline[pp+10:-1] uuidnum = uuidnum.strip() uuids.append(uuidnum) return uuids def GetMACAddressesMunged(): macnums = [] macnum = os.getenv('MYMACNUM') if macnum != None: macnums.append(macnum) cmdline = 'networksetup -listallhardwareports' # en0' cmdline = cmdline.encode(sys.getfilesystemencoding()) p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False) out1, out2 = p.communicate() reslst = out1.split('\n') cnt = len(reslst) for j in xrange(cnt): resline = reslst[j] pp = resline.find('Ethernet Address: ') if pp >= 0: #print resline macnum = resline[pp+18:] macnum = macnum.strip() maclst = macnum.split(':') n = len(maclst) if n != 6: continue #print 'original mac', macnum # now munge it up the way Kindle app does # by xoring it with 0xa5 and swapping elements 3 and 4 for i in range(6): maclst[i] = int('0x' + maclst[i], 0) mlst = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00] mlst[5] = maclst[5] ^ 0xa5 mlst[4] = maclst[3] ^ 0xa5 mlst[3] = maclst[4] ^ 0xa5 mlst[2] = maclst[2] ^ 0xa5 mlst[1] = maclst[1] ^ 0xa5 mlst[0] = maclst[0] ^ 0xa5 macnum = '%0.2x%0.2x%0.2x%0.2x%0.2x%0.2x' % (mlst[0], mlst[1], mlst[2], mlst[3], mlst[4], mlst[5]) #print 'munged mac', macnum macnums.append(macnum) return macnums # uses unix env to get username instead of using sysctlbyname def GetUserName(): username = os.getenv('USER') #print "Username:",username return username def GetIDStrings(): # Return all possible ID Strings strings = [] strings.extend(GetMACAddressesMunged()) strings.extend(GetVolumesSerialNumbers()) strings.extend(GetDiskPartitionNames()) strings.extend(GetDiskPartitionUUIDs()) strings.append('9999999999') #print "ID Strings:\n",strings return strings # unprotect the new header blob in .kinf2011 # used in Kindle for Mac Version >= 1.9.0 def UnprotectHeaderData(encryptedData): passwdData = 'header_key_data' salt = 'HEADER.2011' iter = 0x80 keylen = 0x100 crp = LibCrypto() key_iv = crp.keyivgen(passwdData, salt, iter, keylen) key = key_iv[0:32] iv = key_iv[32:48] crp.set_decrypt_key(key,iv) cleartext = crp.decrypt(encryptedData) return cleartext # implements an Pseudo Mac Version of Windows built-in Crypto routine class CryptUnprotectData(object): def __init__(self, entropy, IDString): sp = GetUserName() + '+@#$%+' + IDString passwdData = encode(SHA256(sp),charMap2) salt = entropy self.crp = LibCrypto() iter = 0x800 keylen = 0x400 key_iv = self.crp.keyivgen(passwdData, salt, iter, keylen) self.key = key_iv[0:32] self.iv = key_iv[32:48] self.crp.set_decrypt_key(self.key, self.iv) def decrypt(self, encryptedData): cleartext = self.crp.decrypt(encryptedData) cleartext = decode(cleartext, charMap2) return cleartext # Locate the .kindle-info files def getKindleInfoFiles(): # file searches can take a long time on some systems, so just look in known specific places. kInfoFiles=[] found = False home = os.getenv('HOME') # check for .kinf2011 file in new location (App Store Kindle for Mac) testpath = home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac kinf2011 file: ' + testpath) found = True # check for .kinf2011 files from 1.10 testpath = home + '/Library/Application Support/Kindle/storage/.kinf2011' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac kinf2011 file: ' + testpath) found = True # check for .rainier-2.1.1-kinf files from 1.6 testpath = home + '/Library/Application Support/Kindle/storage/.rainier-2.1.1-kinf' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac rainier file: ' + testpath) found = True # check for .kindle-info files from 1.4 testpath = home + '/Library/Application Support/Kindle/storage/.kindle-info' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac kindle-info file: ' + testpath) found = True # check for .kindle-info file from 1.2.2 testpath = home + '/Library/Application Support/Amazon/Kindle/storage/.kindle-info' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac kindle-info file: ' + testpath) found = True # check for .kindle-info file from 1.0 beta 1 (27214) testpath = home + '/Library/Application Support/Amazon/Kindle for Mac/storage/.kindle-info' if os.path.isfile(testpath): kInfoFiles.append(testpath) print('Found k4Mac kindle-info file: ' + testpath) found = True if not found: print('No k4Mac kindle-info/rainier/kinf2011 files have been found.') return kInfoFiles # determine type of kindle info provided and return a # database of keynames and values def getDBfromFile(kInfoFile): names = [\ 'kindle.account.tokens',\ 'kindle.cookie.item',\ 'eulaVersionAccepted',\ 'login_date',\ 'kindle.token.item',\ 'login',\ 'kindle.key.item',\ 'kindle.name.info',\ 'kindle.device.info',\ 'MazamaRandomNumber',\ 'max_date',\ 'SIGVERIF',\ 'build_version',\ 'SerialNumber',\ 'UsernameHash',\ 'kindle.directedid.info',\ 'DSN' ] with open(kInfoFile, 'rb') as infoReader: filedata = infoReader.read() data = filedata[:-1] items = data.split('/') IDStrings = GetIDStrings() for IDString in IDStrings: #print "trying IDString:",IDString try: DB = {} items = data.split('/') # the headerblob is the encrypted information needed to build the entropy string headerblob = items.pop(0) encryptedValue = decode(headerblob, charMap1) cleartext = UnprotectHeaderData(encryptedValue) # now extract the pieces in the same way # this version is different from K4PC it scales the build number by multipying by 735 pattern = re.compile(r'''\[Version:(\d+)\]\[Build:(\d+)\]\[Cksum:([^\]]+)\]\[Guid:([\{\}a-z0-9\-]+)\]''', re.IGNORECASE) for m in re.finditer(pattern, cleartext): entropy = str(int(m.group(2)) * 0x2df) + m.group(4) cud = CryptUnprotectData(entropy,IDString) # loop through the item records until all are processed while len(items) > 0: # get the first item record item = items.pop(0) # the first 32 chars of the first record of a group # is the MD5 hash of the key name encoded by charMap5 keyhash = item[0:32] keyname = 'unknown' # unlike K4PC the keyhash is not used in generating entropy # entropy = SHA1(keyhash) + added_entropy # entropy = added_entropy # the remainder of the first record when decoded with charMap5 # has the ':' split char followed by the string representation # of the number of records that follow # and make up the contents srcnt = decode(item[34:],charMap5) rcnt = int(srcnt) # read and store in rcnt records of data # that make up the contents value edlst = [] for i in xrange(rcnt): item = items.pop(0) edlst.append(item) keyname = 'unknown' for name in names: if encodeHash(name,testMap8) == keyhash: keyname = name break if keyname == 'unknown': keyname = keyhash # the testMap8 encoded contents data has had a length # of chars (always odd) cut off of the front and moved # to the end to prevent decoding using testMap8 from # working properly, and thereby preventing the ensuing # CryptUnprotectData call from succeeding. # The offset into the testMap8 encoded contents seems to be: # len(contents) - largest prime number less than or equal to int(len(content)/3) # (in other words split 'about' 2/3rds of the way through) # move first offsets chars to end to align for decode by testMap8 encdata = ''.join(edlst) contlen = len(encdata) # now properly split and recombine # by moving noffset chars from the start of the # string to the end of the string noffset = contlen - primes(int(contlen/3))[-1] pfx = encdata[0:noffset] encdata = encdata[noffset:] encdata = encdata + pfx # decode using testMap8 to get the CryptProtect Data encryptedValue = decode(encdata,testMap8) cleartext = cud.decrypt(encryptedValue) # print keyname # print cleartext if len(cleartext) > 0: DB[keyname] = cleartext if len(DB)>6: break except: pass if len(DB)>6: # store values used in decryption print u"Decrypted key file using IDString '{0:s}' and UserName '{1:s}'".format(IDString, GetUserName()) DB['IDString'] = IDString DB['UserName'] = GetUserName() else: print u"Couldn't decrypt file." DB = {} return DB else: def getDBfromFile(kInfoFile): raise DrmException(u"This script only runs under Windows or Mac OS X.") return {} def kindlekeys(files = []): keys = [] if files == []: files = getKindleInfoFiles() for file in files: key = getDBfromFile(file) if key: # convert all values to hex, just in case. for keyname in key: key[keyname]=key[keyname].encode('hex') keys.append(key) return keys # interface for Python DeDRM # returns single key or multiple keys, depending on path or file passed in def getkey(outpath, files=[]): keys = kindlekeys(files) if len(keys) > 0: if not os.path.isdir(outpath): outfile = outpath with file(outfile, 'w') as keyfileout: keyfileout.write(json.dumps(keys[0])) print u"Saved a key to {0}".format(outfile) else: keycount = 0 for key in keys: while True: keycount += 1 outfile = os.path.join(outpath,u"kindlekey{0:d}.k4i".format(keycount)) if not os.path.exists(outfile): break with file(outfile, 'w') as keyfileout: keyfileout.write(json.dumps(key)) print u"Saved a key to {0}".format(outfile) return True return False def usage(progname): print u"Finds, decrypts and saves the default Kindle For Mac/PC encryption keys." print u"Keys are saved to the current directory, or a specified output directory." print u"If a file name is passed instead of a directory, only the first key is saved, in that file." print u"Usage:" print u" {0:s} [-h] [-k <kindle.info>] [<outpath>]".format(progname) def cli_main(): sys.stdout=SafeUnbuffered(sys.stdout) sys.stderr=SafeUnbuffered(sys.stderr) argv=unicode_argv() progname = os.path.basename(argv[0]) print u"{0} v{1}\nCopyright © 2010-2016 by some_updates, Apprentice Alf and Apprentice Harper".format(progname,__version__) try: opts, args = getopt.getopt(argv[1:], "hk:") except getopt.GetoptError, err: print u"Error in options or arguments: {0}".format(err.args[0]) usage(progname) sys.exit(2) files = [] for o, a in opts: if o == "-h": usage(progname) sys.exit(0) if o == "-k": files = [a] if len(args) > 1: usage(progname) sys.exit(2) if len(args) == 1: # save to the specified file or directory outpath = args[0] if not os.path.isabs(outpath): outpath = os.path.abspath(outpath) else: # save to the same directory as the script outpath = os.path.dirname(argv[0]) # make sure the outpath is canonical outpath = os.path.realpath(os.path.normpath(outpath)) if not getkey(outpath, files): print u"Could not retrieve Kindle for Mac/PC key." return 0 def gui_main(): try: import Tkinter import Tkconstants import tkMessageBox import traceback except: return cli_main() class ExceptionDialog(Tkinter.Frame): def __init__(self, root, text): Tkinter.Frame.__init__(self, root, border=5) label = Tkinter.Label(self, text=u"Unexpected error:", anchor=Tkconstants.W, justify=Tkconstants.LEFT) label.pack(fill=Tkconstants.X, expand=0) self.text = Tkinter.Text(self) self.text.pack(fill=Tkconstants.BOTH, expand=1) self.text.insert(Tkconstants.END, text) argv=unicode_argv() root = Tkinter.Tk() root.withdraw() progpath, progname = os.path.split(argv[0]) success = False try: keys = kindlekeys() keycount = 0 for key in keys: while True: keycount += 1 outfile = os.path.join(progpath,u"kindlekey{0:d}.k4i".format(keycount)) if not os.path.exists(outfile): break with file(outfile, 'w') as keyfileout: keyfileout.write(json.dumps(key)) success = True tkMessageBox.showinfo(progname, u"Key successfully retrieved to {0}".format(outfile)) except DrmException, e: tkMessageBox.showerror(progname, u"Error: {0}".format(str(e))) except Exception: root.wm_state('normal') root.title(progname) text = traceback.format_exc() ExceptionDialog(root, text).pack(fill=Tkconstants.BOTH, expand=1) root.mainloop() if not success: return 1 return 0 if __name__ == '__main__': if len(sys.argv) > 1: sys.exit(cli_main()) sys.exit(gui_main())
{ "pile_set_name": "Github" }
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/explain_dplyr.R \name{explain_line} \alias{explain_line} \title{explain a line of dplyr code} \usage{ explain_line(expr, value, ok, visible) } \arguments{ \item{expr}{expression performed} \item{value}{value returned} \item{ok}{ok} \item{visible}{visible} } \description{ explain a line of dplyr code }
{ "pile_set_name": "Github" }
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.stdout.threshold=DEBUG log4j.rootLogger=INFO, rolling log4j.appender.rolling=org.apache.log4j.DailyRollingFileAppender log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c{3}] (%t:%x) %m%n log4j.appender.rolling.file.threshold=DEBUG log4j.appender.rolling.File_testDashboard=./logs/testclient.log log4j.appender.rolling.DatePattern='.'yyy-MM-dd log4j.appender.rolling.file.append=false log4j.category.org.apache=DEBUG, rolling, stdout #log4j.category.com.cloud.utils.db.Transaction=ALL log4j.category.org.apache.cloudstack.network.contrail=ALL log4j.category.com.cloud.network=ALL
{ "pile_set_name": "Github" }
// markdown-it plugin for: // 1. adding target="_blank" to external links // 2. converting internal links to <router-link> const url = require('url') const indexRE = /(^|.*\/)(index|readme).md(#?.*)$/i module.exports = (md, externalAttrs) => { let hasOpenRouterLink = false let hasOpenExternalLink = false md.renderer.rules.link_open = (tokens, idx, options, env, self) => { const { relativePath } = env const token = tokens[idx] const hrefIndex = token.attrIndex('href') if (hrefIndex >= 0) { const link = token.attrs[hrefIndex] const href = link[1] const isExternal = /^https?:/.test(href) const isSourceLink = /(\/|\.md|\.html)(#.*)?$/.test(href) if (isExternal) { Object.entries(externalAttrs).forEach(([key, val]) => { token.attrSet(key, val) }) if (/_blank/i.test(externalAttrs['target'])) { hasOpenExternalLink = true } } else if (isSourceLink) { hasOpenRouterLink = true tokens[idx] = toRouterLink(token, link, relativePath) } } return self.renderToken(tokens, idx, options) } function toRouterLink (token, link, relativePath) { link[0] = 'to' let to = link[1] // convert link to filename and export it for existence check const links = md.$data.links || (md.$data.links = []) links.push(to) // relative path usage. if (!to.startsWith('/')) { to = relativePath ? url.resolve('/' + relativePath, to) : ensureBeginningDotSlash(to) } const indexMatch = to.match(indexRE) if (indexMatch) { const [, path, , hash] = indexMatch to = path + hash } else { to = to .replace(/\.md$/, '.html') .replace(/\.md(#.*)$/, '.html$1') } // markdown-it encodes the uri link[1] = decodeURI(to) // export the router links for testing const routerLinks = md.$data.routerLinks || (md.$data.routerLinks = []) routerLinks.push(to) return Object.create(token, { tag: { value: 'RouterLink' } }) } md.renderer.rules.link_close = (tokens, idx, options, env, self) => { const token = tokens[idx] if (hasOpenRouterLink) { token.tag = 'RouterLink' hasOpenRouterLink = false } if (hasOpenExternalLink) { hasOpenExternalLink = false // add OutBoundLink to the beforeend of this link if it opens in _blank. return '<OutboundLink/>' + self.renderToken(tokens, idx, options) } return self.renderToken(tokens, idx, options) } } const beginningSlashRE = /^\.\// function ensureBeginningDotSlash (path) { if (beginningSlashRE.test(path)) { return path } return './' + path }
{ "pile_set_name": "Github" }
#ifndef BOOST_MPL_MAP_AUX_ITERATOR_HPP_INCLUDED #define BOOST_MPL_MAP_AUX_ITERATOR_HPP_INCLUDED // Copyright Aleksey Gurtovoy 2003-2004 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ #include <boost/mpl/map/aux_/map0.hpp> #include <boost/mpl/map/aux_/at_impl.hpp> #include <boost/mpl/map/aux_/tag.hpp> #include <boost/mpl/iterator_tags.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/next.hpp> #include <boost/mpl/deref.hpp> #include <boost/mpl/long.hpp> #include <boost/mpl/void.hpp> #include <boost/mpl/aux_/nttp_decl.hpp> #include <boost/mpl/aux_/config/ctps.hpp> namespace boost { namespace mpl { #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template< typename Map , long order , long max_order > struct next_order : if_< is_void_< typename item_by_order<Map,order>::type > , next_order<Map,(order+1),max_order> , long_<order> >::type { }; template< typename Map , long max_order > struct next_order<Map,max_order,max_order> : long_<max_order> { }; template< typename Map, long order, long max_order > struct m_iter { typedef forward_iterator_tag category; typedef typename item_by_order<Map,order>::type type; }; template< typename Map, long max_order > struct m_iter<Map,max_order,max_order> { typedef forward_iterator_tag category; }; template< typename Map, long order, long max_order > struct next< m_iter<Map,order,max_order> > { typedef m_iter< Map , next_order<Map,order+1,max_order>::value , max_order > type; }; template< typename Map, long max_order > struct next< m_iter<Map,max_order,max_order> > { }; #else template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct next_order; template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct next_order_impl : if_< is_void_< typename item_by_order<Map,order>::type > , next_order<Map,(order+1),max_order> , long_<order> >::type { }; template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct next_order : if_c< (order != max_order) , next_order_impl<Map,order,max_order> , long_<order> >::type { }; template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct m_iter; struct m_iter_empty_base {}; template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct m_iter_base { typedef typename item_by_order<Map,order>::type type; typedef m_iter< Map , next_order<Map,order+1,max_order>::value , max_order > next; }; template< typename Map , BOOST_MPL_AUX_NTTP_DECL(long, order) , BOOST_MPL_AUX_NTTP_DECL(long, max_order) > struct m_iter : if_c< (order == max_order) , m_iter_empty_base , m_iter_base<Map,order,max_order> >::type { typedef forward_iterator_tag category; }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} #endif // BOOST_MPL_MAP_AUX_ITERATOR_HPP_INCLUDED
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>widget attribute unit test (in constructor and get()/set())</title> <script src="boilerplate.js"></script> <script type="text/javascript"> require([ "doh/runner", "dojo/_base/declare", "dojo/dom", "dojo/dom-attr", "dojo/dom-class", "dojo/dom-style", "dojo/sniff", "dijit/_WidgetBase", "dijit/_Widget", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dojo/domReady!" ], function(doh, declare, dom, domAttr, domClass, domStyle, has, _WidgetBase, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin){ doh.register("attributes", [ // Test attributes mapped to DOMNodes function domMapping(){ var IndividualMaps = declare([_WidgetBase, _TemplatedMixin], { // Mapping foo to this.domNode.foo foo:"", _setFooAttr: "", // Mapping bar to this.buttonNode.bar bar: "", _setBarAttr: "buttonNode", // Mapping plainText to this.plainTextNode.innerHTML plainText: "", _setPlainTextAttr: {node: "plainTextNode", type: "innerText"}, teeny: false, _setTeenyAttr: {node: "teenyNode", type: "toggleClass"}, templateString: "<div class='class1' style='border: 1px solid red; width: 456px'>" + "<button data-dojo-attach-point='buttonNode,focusNode'>hi</button>" + '<span><input data-dojo-attach-point="inputNode" value="input"></span>' + "<span data-dojo-attach-point='containerNode'></span>" + "<span data-dojo-attach-point='plainTextNode'>original plain text</span>" + "<span data-dojo-attach-point='teenyNode'>teeny text</span>" + "</div>" }); var widget = new IndividualMaps({ foo:"value1", bar:"value2", "class":"class2", style:"height: 123px", plainText: "hello world <>&;", teeny: true, "name-with-dashes": "name with dashes" }).placeAt(dom.byId("wrapper")); // test attributes specified to constructor were copied over to DOM doh.is("value1", widget.domNode.getAttribute("foo"), "widget.domNode.getAttribute('foo')"); doh.is("value2", widget.buttonNode.getAttribute("bar"), "widget.domNode.getAttribute('bar')"); doh.t(domClass.contains(widget.domNode, "class1"), "class1"); doh.t(domClass.contains(widget.domNode, "class2"), "class2"); doh.is("123px", widget.domNode.style.height, "height"); doh.is("456px", widget.domNode.style.width, "width"); doh.is("hello world &lt;&gt;&amp;;", widget.plainTextNode.innerHTML, "innerHTML"); doh.t(domClass.contains(widget.teenyNode, "teeny"), "teeny"); }, // Test attributes mapped to subwidgets function subwidgetMapping(){ declare("MySubWidget", [_WidgetBase], { _setFooAttr: function(val){ this.foo = val; this.gotValue = true; // set flag for testing purposes } }); var IndividualMaps = declare( [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { // Mapping foo to this.subwidget.foo foo:"", _setFooAttr: "subwidget", templateString: "<div class='class1' style='border: 1px solid red; width: 456px'>" + "<button data-dojo-type='MySubWidget' data-dojo-attach-point='subwidget'>hi</button>" + "</div>" }); var widget = new IndividualMaps({ foo: "value1" }).placeAt(dom.byId("wrapper")); // test attribute specified to constructor was copied over to subwidget doh.is("value1", widget.subwidget.get("foo"), "widget.subwidget.get('foo')"); doh.t(widget.subwidget.gotValue, "gotValue"); }, // Test that certain attributes are automatically applied to focusNode or domNode. // These are attributes that aren't mentioned at all in _WidgetBase. function autoDomMapping(){ // Mapping to this.domNode var w = new _WidgetBase({ title: "dom title", "aria-labelledby": "foo", role: "button" }); doh.is("dom title", domAttr.get(w.domNode, "title"), "domNode title"); doh.is("foo", w.domNode.getAttribute("aria-labelledby", "domNode labelledby")); doh.is("button", domAttr.get(w.domNode, "role"), "domNode role"); // Mapping to this.focusNode var fw = new (declare([_WidgetBase, _TemplatedMixin], { templateString: "<div><input data-dojo-attach-point='focusNode'/></div>" }))({ title: "my title", "aria-labelledby": "foo" }); doh.is("my title", domAttr.get(fw.focusNode, "title"), "focusNode title"); doh.is("foo", fw.focusNode.getAttribute("aria-labelledby"), "focusNode labelledby"); // Mapping attributes with dashes and mixed case var mc = new (declare([_WidgetBase, _TemplatedMixin], { templateString: "<form></form>" }))({ "accept-charset": "utf8", "novalidate": "true" // parser delivers as lowercase even though it's noValidate in JS obj }); doh.is("utf8", mc.domNode.getAttribute("accept-charset"), "accept-charset"); if(has("ff") >= 4 || has("ie") >= 10 || has("webkit")){ // only works for HTML5 compliant browsers where novalidate is understood // (also, hasAttribute() is not available on IE6/7) doh.t(mc.domNode.hasAttribute("novalidate"), "noValidate"); } }, // Test that creating a widget with type defined doesn't causes exceptions on IE6-8. // This is really trying to test that markup like <input dojoType=WidgetBase type=text> works. // (Todo: remove for 2.0) function typeException(){ var node = document.createElement("input"); document.body.appendChild(node); new _WidgetBase({ type: "text" }, node); }, // Test custom setters/getter methods function customSetters(){ var CustomSetters = declare([_WidgetBase], { foo: 0, _setFooAttr: function(val){ this._set("foo", val + 5); }, _getFooAttr: function(val){ return this._get("foo") - 10; } }); var widget = new CustomSetters({ foo: 100 }); doh.is(105, widget._get("foo"), "custom setter called at initialize time"); doh.is(95, widget.get("foo"), "custom getter called"); widget.set("foo", 50); doh.is(55, widget._get("foo"), "custom setter called dynamically"); doh.is(45, widget.get("foo"), "custom getter still called"); }, // Test setters for attribute names with dashes function settersForNamesWithDashes(){ var MyWidget = declare([_WidgetBase, _TemplatedMixin], { "name-with-dashes": "", _setNameWithDashesAttr: {node: "dashNode", type: "innerHTML"}, templateString: "<div>" + "<span data-dojo-attach-point='dashNode'></span>" + "</div>" }); var widget = new MyWidget({ "name-with-dashes": "name with dashes" }).placeAt(dom.byId("wrapper")); doh.is("name with dashes", widget.get("name-with-dashes"), "get()"); doh.is("name with dashes", widget.dashNode.innerHTML, "innerHTML"); widget.set("name-with-dashes", "hello"); doh.is("hello", widget.dashNode.innerHTML); }, // Test deprecated attr() method (remove for 2.0) function attr(){ var MyWidget = new declare([_Widget, _TemplatedMixin], { templateString: "<div><span data-dojo-attach-point=nameNode></span></div>", _setNameAttr: {node: "nameNode", type: "innerHTML"} }); var b = new MyWidget(); // simple setting b.attr("name", "thinger"); doh.is("thinger", b.attr("name"), "b.attr('name')"); doh.is("thinger", b.nameNode.innerHTML, "innerHTML"); // hash setting b.attr({ name: "bang", foo: "zap" }); doh.is("bang", b.attr("name"), "hash set of bang"); doh.is("zap", b.attr("foo"), "hash set of zap"); }, // Test deprecated attributeMap (remove for 2.0) function attributeMap(){ var AttrMap = declare([_WidgetBase, _TemplatedMixin], { attributeMap: {foo: "", bar: "buttonNode", plainText: {node: "plainTextNode", type: "innerText"}, teeny: {node: "teenyNode", type: "toggleClass"}}, templateString: "<div class='class1' style='border: 1px solid red; width: 456px'>" + "<button data-dojo-attach-point='buttonNode,focusNode'>hi</button>" + '<span><input data-dojo-attach-point="inputNode" value="input"></span>' + "<span data-dojo-attach-point='containerNode'></span>" + "<span data-dojo-attach-point='plainTextNode'>original plain text</span>" + "<span data-dojo-attach-point='teenyNode'>teeny text</span>" + "</div>" }); var widget = new AttrMap({ foo:"value1", bar:"value2", "class":"class2", style:"height: 123px", plainText: "hello world <>&;", teeny: true }).placeAt(dom.byId("wrapper")); // test that attributes specified to constructor were copied over to the DOM doh.is("value1", widget.domNode.getAttribute("foo"), "widget.domNode.getAttribute('foo')"); doh.is("value2", widget.buttonNode.getAttribute("bar"), "widget.domNode.getAttribute('bar')"); doh.t(domClass.contains(widget.domNode, "class1"), "class1"); doh.t(domClass.contains(widget.domNode, "class2"), "class2"); doh.is("123px", widget.domNode.style.height, "height"); doh.is("456px", widget.domNode.style.width, "width"); doh.is("hello world &lt;&gt;&amp;;", widget.plainTextNode.innerHTML, "innerHTML"); doh.t(domClass.contains(widget.teenyNode, "teeny"), "teeny"); }, // Test that attributes set in the ctor when side effects setter exist // are correctly applied function ctorDependentAttributes(){ var TestWidget = declare(_WidgetBase, { single: null, multiple: [], _setSingleAttr: function(value){ this._set("multiple", value != null ? [value] : null); this._set("single", value); }, _setMultipleAttr: function(value){ this._set("single", value ? (value.length > 0 ? value[0] : null) : null); this._set("multiple", value); } }); var w1 = new TestWidget({ single : 5 }); var w2 = new TestWidget({ multiple: [5] }); doh.is(5, w1.get("single"), "w1.single"); doh.is([5], w1.get("multiple"), "w1.multiple"); doh.is(5, w2.get("single"), "w2.single"); doh.is([5], w2.get("multiple"), "w2.multiple"); }, function moreCorrelatedProperties(){ var Widget = declare([_WidgetBase], { foo: 10, _setFooAttr: function(val){ this._set("foo", val); this._set("bar", val + 1); }, bar: 11, _setBarAttr: function(val){ this._set("bar", val); this._set("foo", val - 1); } }); var w1 = new Widget({foo: 30}); doh.is(30, w1.get("foo"), "w1.foo"); doh.is(31, w1.get("bar"), "w1.bar"); var w2 = new Widget({bar: 30}); doh.is(30, w2.get("bar"), "w2.bar"); doh.is(29, w2.get("foo"), "w2.foo"); var w3 = new Widget({}); doh.is(10, w3.get("foo"), "w3.foo"); doh.is(11, w3.get("bar"), "w3.bar"); }, function widgetWatch() { var widget = new _WidgetBase({}), expected = [ 'a', NaN ], actual = []; widget.watch('foo', function (key, oldValue, value) { actual.push(value); }); widget.set('foo', 'a'); widget.set('foo', 'a'); widget.set('foo', NaN); widget.set('foo', NaN); doh.is(expected, actual); widget.destroyRecursive(); } ]); // doh.register() doh.run(); }); // require() </script> </head> <body> <h1>Dijit widget.get()/set() Unit Test</h1> <div id="wrapper"></div> </body> </html>
{ "pile_set_name": "Github" }
acc-mobile.dell.com access.dell.com accessories.dell.com admin.dell.com ap.dell.com api.dell.com api2.dell.com app.dell.com apps.dell.com autodiscover.dell.com business.dell.com catalog.dell.com channel.dell.com community.dell.com confluence.dell.com content.dell.com contentdev.dell.com crypto.dell.com dc.dell.com dell.com demos.dell.com di.dell.com downloads-test.dell.com downloads.dell.com ecomm.dell.com ecomm.euro.dell.com ecomm2.dell.com email.dell.com emc.dell.com en.community.dell.com enterprise.dell.com eqlsupport.dell.com esp.dell.com euro.dell.com events.dell.com finance.dell.com ftp-test.dell.com ftp.dell.com ftp1.dell.com git.dell.com home.dell.com i.dell.com image.dell.com img.dell.com intranet.dell.com it.dell.com jobs.dell.com kb.dell.com linux.dell.com localhost.dell.com m-test.dell.com m.dell.com mail.dell.com marketing.dell.com mobile.dell.com mobileadmin.dell.com mobility.dell.com ns-1.dell.com ns.dell.com ns1.dell.com ns2.dell.com ns3.dell.com ns4.dell.com ns5.dell.com ntp.dell.com ntp1.dell.com ntp2.dell.com ocsp-1.dell.com ocsp-2.dell.com ocsp-3.dell.com ocsp.dell.com owa.dell.com partnerdirect.dell.com payment.dell.com payments.dell.com premier.dell.com premier2.dell.com premiertest.dell.com public.dell.com remote.dell.com sales.dell.com search.dell.com security.dell.com services.dell.com signin.dell.com smtp.dell.com social.dell.com social2.dell.com software.dell.com sso.dell.com support.dell.com techdirect.dell.com test.dell.com time-1.dell.com time.dell.com training.dell.com video.dell.com vip.dell.com webmail.dell.com win7.dell.com www-1.dell.com www-2.dell.com www-3.dell.com www1.ap.dell.com www1.dell.com www1.euro.dell.com www2.dell.com
{ "pile_set_name": "Github" }
// // XHHorizontalPageViewController.h // PinterestExample // // Created by dw_iOS on 14-7-21. // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. // #import <UIKit/UIKit.h> #import "XHBaseCollectionViewController.h" #import "XHTransitionProtocol.h" @interface XHHorizontalPageViewController : UIViewController <XHTransitionProtocol, XHHorizontalPageViewControllerProtocol, UICollectionViewDelegate, UICollectionViewDataSource> @property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) NSMutableArray *items; - (instancetype)initWithCollectionViewFlowLayout:(UICollectionViewFlowLayout *)collectionViewFlowLayout currentIndexPath:(NSIndexPath *)indexPath; @end
{ "pile_set_name": "Github" }
--- title: "npm" date: 2016-04-09 16:50 collection: "包管理" log: "增加npm源说明" --- [TOC] ## 基本使用 ## 对npm不熟, 记录一下. * npm help install * npm help 5 npm-folders * npm install [-g] <package> * npm list [-g] <package> 本地情况, `npm install <package>` 默认装到当前用户目录下的「node_modules」目录, 加上「-g」(global)则安装到`/usr/local/lib/node_modules/`下 `.npmrc`可以控制安装的prefix和路径等 原先`/usr/local/lib/node_modules/`的属主是nobody, 导致加上「-g」安装权限报错, 需要: $ sudo chown -R $USER /usr/local/lib/node_modules 查看包信息: npm install <package> ### NPM源 ### 本地访问官方npm源timeout,可以改为国内(如淘宝NPM)源。 查看当前的npm registry地址: $ npm config get registry 临时设置npm registry地址: $ npm config set registry https://registry.npm.taobao.org 或者只在install时指定: npm --registry https://registry.npm.taobao.org install <package> 永久则可以写入`.npmrc`: registry = https://registry.npm.taobao.org 或者使用`cnpm`: * [CNPMJS](http://cnpmjs.org/) * [淘宝NPM](http://npm.taobao.org/) 参考: [npm 换源 npm 国内镜像 cnpm](http://www.jianshu.com/p/ad29d97b0e9d) 参考: * [NPM throws error without sudo](http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo) * [How to run npm without sudo](http://www.competa.com/blog/2014/12/how-to-run-npm-without-sudo/) * [NODE.JS HOWTO: INSTALL NODE+NPM AS USER](http://tnovelli.net/blog/blog.2011-08-27.node-npm-user-install.html) * [A Beginner’s Guide to npm — the Node Package Manager](http://www.sitepoint.com/beginners-guide-node-package-manager/) * [Introduction to npm](http://howtonode.org/introduction-to-npm)
{ "pile_set_name": "Github" }
/* * (C) 1999-2003 Lars Knoll ([email protected]) * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef CSSInitialValue_h #define CSSInitialValue_h #include "CSSValue.h" #include <wtf/NeverDestroyed.h> namespace WebCore { class CSSInitialValue : public CSSValue { public: static Ref<CSSInitialValue> createExplicit() { return adoptRef(*new CSSInitialValue(/* implicit */ false)); } static Ref<CSSInitialValue> createImplicit() { return adoptRef(*new CSSInitialValue(/* implicit */ true)); } String customCSSText() const; bool isImplicit() const { return m_isImplicit; } bool equals(const CSSInitialValue&) const { return true; } #if COMPILER(MSVC) // FIXME: This should be private, but for some reason MSVC then fails to invoke it from LazyNeverDestroyed::construct. public: #else private: friend class LazyNeverDestroyed<CSSInitialValue>; #endif CSSInitialValue(bool implicit) : CSSValue(InitialClass) , m_isImplicit(implicit) { } private: bool m_isImplicit; }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSInitialValue, isInitialValue()) #endif // CSSInitialValue_h
{ "pile_set_name": "Github" }
package com.ing.baker.runtime.common import com.ing.baker.runtime.common.LanguageDataStructures.LanguageApi /** * This class holds some meta data of a baker process. */ trait RecipeInstanceMetadata extends LanguageApi { val recipeId: String val recipeInstanceId: String val createdTime: Long }
{ "pile_set_name": "Github" }
require('seneca')({tag:'d0'}) //.test('print') .add('d:0', function () { console.log('D0', this.did, this.fixedargs) throw new Error('d0') }) .use('..',{ pin:'d:*' })
{ "pile_set_name": "Github" }
#!/bin/sh # This file is a part of SEAPT, Samsung Extended Autotools Project Template # Copyright 2012,2013 Samsung R&D Institute Russia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. isubuntu="$(uname -v|grep Ubuntu)" mypath=$(pwd) cd .. if [ ! -e "$mypath/libarchive/Makefile.am" ]; then git submodule update --init libVeles/libarchive cd libVeles/libarchive git apply ../0001-Redirect-posix_spawnp-to-an-older-version-of-glibc.patch cd ../.. else git submodule update libVeles/libarchive fi if [ ! -e "$mypath/zlib/configure" ]; then git submodule update --init libVeles/zlib else git submodule update libVeles/zlib fi if [ ! -e "$mypath/simd/configure.ac" ]; then git submodule update --init libVeles/simd else git submodule update libVeles/simd fi if [ ! -e "$mypath/variant/variant.hpp" ]; then git submodule update --init libVeles/variant else git submodule update libVeles/variant fi if [ ! -e "$mypath/rapidjson/CMakeLists.txt" ]; then git submodule update --init libVeles/rapidjson else git submodule update libVeles/rapidjson fi cd $mypath echo "CFLAGS=\"-I$mypath/zlib -DHAVE_LIBZ=1\" \ \$(dirname \$0)/configure \$@ --disable-bsdcpio --without-bz2lib \ --without-lzmadec --without-iconv --without-lzma --without-nettle \ --without-openssl --without-xml2 --without-expat --disable-bsdtar \ --without-lzo2" > libarchive/configure.gnu chmod +x libarchive/configure.gnu check_prog() { printf "Checking for $1... " if [ -z "$($1 --version 2>/dev/null)" ]; then echo no if [ -n "$isubuntu" ]; then sudo apt-get -y install $2 printf "Checking for $1... " if [ -z "$($1 --version 2>/dev/null)" ]; then echo no echo "Error: $1 was not found, aborting" exit 1 fi else echo "Error: $1 was not found, aborting" exit 1 fi fi echo yes } check_prog aclocal automake check_prog autoheader autoconf check_prog autoconf autoconf check_prog libtoolize libtool check_prog automake automake rm -rf autom4te.cache m4 rm -f aclocal.m4 ltmain.sh config.log config.status configure libtool stamp-h1 config.h config.h.in find -name Makefile.in -a -not -path './zlib/*' -exec rm {} \; mkdir -p m4 echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || (rmdir --ignore-fail-on-non-empty m4; exit 1) rmdir --ignore-fail-on-non-empty m4 echo "Running autoheader..." ; autoheader || exit 1 echo "Running autoconf..." ; autoconf || exit 1 echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 echo "Running automake..." ; (automake --add-missing --copy --foreign ) || exit 1 W=0 rm -f config.cache-env.tmp echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp echo "OLD_CXXFLAGS=\"$CXXFLAGS\"" >> config.cache-env.tmp echo "OLD_CPPFLAGS=\"$CPPFLAGS\"" >> config.cache-env.tmp echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp cmp -s config.cache-env.tmp config.cache-env >> /dev/null if [ $? -ne 0 ]; then W=1; fi if [ $W -ne 0 ]; then echo "Cleaning configure cache..."; rm -f config.cache config.cache-env mv config.cache-env.tmp config.cache-env else rm -f config.cache-env.tmp fi cd libarchive build/autogen.sh cd ../simd ./autogen.sh echo "\$(dirname \$0)/configure \$@ --disable-simd-fftf --disable-tests --disable-doxygen" > configure.gnu chmod +x configure.gnu cd .. if [ -n "$1" ]; then path=$(pwd) mkdir -p "$1" cd "$1" shift $path/configure $@ cd $path fi
{ "pile_set_name": "Github" }
/* Copyright 2015 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package bandwidth provides utilities for bandwidth shaping package bandwidth
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "crypto/rand" "io" "time" ) // Config collects a number of parameters along with sensible defaults. // A nil *Config is valid and results in all default values. type Config struct { // Rand provides the source of entropy. // If nil, the crypto/rand Reader is used. Rand io.Reader // DefaultHash is the default hash function to be used. // If zero, SHA-256 is used. DefaultHash crypto.Hash // DefaultCipher is the cipher to be used. // If zero, AES-128 is used. DefaultCipher CipherFunction // Time returns the current time as the number of seconds since the // epoch. If Time is nil, time.Now is used. Time func() time.Time // DefaultCompressionAlgo is the compression algorithm to be // applied to the plaintext before encryption. If zero, no // compression is done. DefaultCompressionAlgo CompressionAlgo // CompressionConfig configures the compression settings. CompressionConfig *CompressionConfig // S2KCount is only used for symmetric encryption. It // determines the strength of the passphrase stretching when // the said passphrase is hashed to produce a key. S2KCount // should be between 1024 and 65011712, inclusive. If Config // is nil or S2KCount is 0, the value 65536 used. Not all // values in the above range can be represented. S2KCount will // be rounded up to the next representable value if it cannot // be encoded exactly. When set, it is strongly encrouraged to // use a value that is at least 65536. See RFC 4880 Section // 3.7.1.3. S2KCount int // RSABits is the number of bits in new RSA keys made with NewEntity. // If zero, then 2048 bit keys are created. RSABits int } func (c *Config) Random() io.Reader { if c == nil || c.Rand == nil { return rand.Reader } return c.Rand } func (c *Config) Hash() crypto.Hash { if c == nil || uint(c.DefaultHash) == 0 { return crypto.SHA256 } return c.DefaultHash } func (c *Config) Cipher() CipherFunction { if c == nil || uint8(c.DefaultCipher) == 0 { return CipherAES128 } return c.DefaultCipher } func (c *Config) Now() time.Time { if c == nil || c.Time == nil { return time.Now() } return c.Time() } func (c *Config) Compression() CompressionAlgo { if c == nil { return CompressionNone } return c.DefaultCompressionAlgo } func (c *Config) PasswordHashIterations() int { if c == nil || c.S2KCount == 0 { return 0 } return c.S2KCount }
{ "pile_set_name": "Github" }
Signature-Version: 1.0 SHA1-Digest-Manifest: AZiZSX9cdptNfbwWXnaFsp1mIqo= Created-By: 1.6.0 (IBM Corporation) SHA1-Digest-Manifest-Main-Attributes: 4gIfTP5y3EzwI5ecyebQLugBMgo= Name: epl-v10.html SHA1-Digest: 8gfeI4bHtcOQXC3dYfggxvsAyWc= Name: META-INF/eclipse.inf SHA1-Digest: QdryQvJlVywlE0MGLuwYCkmkyWk= Name: license.html SHA1-Digest: Rp9AnRyeUIxNWe10fjaMDkQB8rU= Name: feature.properties SHA1-Digest: PSUNP/Qfu2JvzTCSu/16RbvtrUA= Name: feature.xml SHA1-Digest: sj/JRirJsawqyWf0JB+BBMQGf1k=
{ "pile_set_name": "Github" }
# Generated by superflore -- DO NOT EDIT # # Copyright Open Source Robotics Foundation inherit ros_distro_melodic inherit ros_superflore_generated DESCRIPTION = "<p> ROS-Industrial support for the ABB IRB 2400 (and variants). </p> <p> This package contains configuration data, 3D models and launch files for ABB IRB 2400 manipulators. This currently includes the base model. </p> <p> Joint limits and max joint velocities are based on the information in the ABB data sheets. All URDFs / XACROs are based on the default motion and joint velocity limits, unless noted otherwise (ie: no support for high speed joints, extended / limited motion ranges or other options). </p> <p> Before using any of the configuration files and / or meshes included in this package, be sure to check they are correct for the particular robot model and configuration you intend to use them with. </p> <p> The unqualified IRB 2400 model will be removed in ROS-Lunar, please use the IRB 2400-12/1.55 as a replacement. </p>" AUTHOR = "Levi Armstrong (Southwest Research Institute) <[email protected]>" ROS_AUTHOR = "Dan Solomon (Southwest Research Institute) <[email protected]>" HOMEPAGE = "http://ros.org/wiki/abb_irb2400_support" SECTION = "devel" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://package.xml;beginline=32;endline=32;md5=c93e37fc0c6f510db5735eb91dcc1550" ROS_CN = "abb" ROS_BPN = "abb_irb2400_support" ROS_BUILD_DEPENDS = " \ roslaunch \ " ROS_BUILDTOOL_DEPENDS = " \ catkin-native \ " ROS_EXPORT_DEPENDS = "" ROS_BUILDTOOL_EXPORT_DEPENDS = "" ROS_EXEC_DEPENDS = " \ abb-driver \ abb-resources \ joint-state-publisher \ robot-state-publisher \ rviz \ " # Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. ROS_TEST_DEPENDS = "" DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" # Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually # don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}" # matches with: https://github.com/ros-industrial-release/abb-release/archive/release/melodic/abb_irb2400_support/1.3.1-1.tar.gz ROS_BRANCH ?= "branch=release/melodic/abb_irb2400_support" SRC_URI = "git://github.com/ros-industrial-release/abb-release;${ROS_BRANCH};protocol=https" SRCREV = "a87981a92eb972c4de19914bcc090da35c681d75" S = "${WORKDIR}/git" ROS_BUILD_TYPE = "catkin" inherit ros_${ROS_BUILD_TYPE}
{ "pile_set_name": "Github" }
/* * Gritter for jQuery * http://www.boedesign.com/ * * Copyright (c) 2012 Jordan Boesch * Dual licensed under the MIT and GPL licenses. * * Date: February 24, 2012 * Version: 1.7.4 */ (function($){ /** * Set it up as an object under the jQuery namespace */ $.gritter = {}; /** * Set up global options that the user can over-ride */ $.gritter.options = { position: '', class_name: '', // could be set to 'gritter-light' to use white notifications fade_in_speed: 'medium', // how fast notifications fade in fade_out_speed: 1000, // how fast the notices fade out time: 6000 // hang on the screen for... } /** * Add a gritter notification to the screen * @see Gritter#add(); */ $.gritter.add = function(params){ try { return Gritter.add(params || {}); } catch(e) { var err = 'Gritter Error: ' + e; (typeof(console) != 'undefined' && console.error) ? console.error(err, params) : alert(err); } } /** * Remove a gritter notification from the screen * @see Gritter#removeSpecific(); */ $.gritter.remove = function(id, params){ Gritter.removeSpecific(id, params || {}); } /** * Remove all notifications * @see Gritter#stop(); */ $.gritter.removeAll = function(params){ Gritter.stop(params || {}); } /** * Big fat Gritter object * @constructor (not really since its object literal) */ var Gritter = { // Public - options to over-ride with $.gritter.options in "add" position: '', fade_in_speed: '', fade_out_speed: '', time: '', // Private - no touchy the private parts _custom_timer: 0, _item_count: 0, _is_setup: 0, _tpl_close: '<div class="gritter-close"></div>', _tpl_title: '<span class="gritter-title">[[title]]</span>', _tpl_item: '<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>', _tpl_wrap: '<div id="gritter-notice-wrapper"></div>', /** * Add a gritter notification to the screen * @param {Object} params The object that contains all the options for drawing the notification * @return {Integer} The specific numeric id to that gritter notification */ add: function(params){ // Handle straight text if(typeof(params) == 'string'){ params = {text:params}; } // We might have some issues if we don't have a title or text! if(!params.text){ throw 'You must supply "text" parameter.'; } // Check the options and set them once if(!this._is_setup){ this._runSetup(); } // Basics var title = params.title, text = params.text, image = params.image || '', sticky = params.sticky || false, item_class = params.class_name || $.gritter.options.class_name, position = $.gritter.options.position, time_alive = params.time || ''; this._verifyWrapper(); this._item_count++; var number = this._item_count, tmp = this._tpl_item; // Assign callbacks $(['before_open', 'after_open', 'before_close', 'after_close']).each(function(i, val){ Gritter['_' + val + '_' + number] = ($.isFunction(params[val])) ? params[val] : function(){} }); // Reset this._custom_timer = 0; // A custom fade time set if(time_alive){ this._custom_timer = time_alive; } var image_str = (image != '') ? '<img src="' + image + '" class="gritter-image" />' : '', class_name = (image != '') ? 'gritter-with-image' : 'gritter-without-image'; // String replacements on the template if(title){ title = this._str_replace('[[title]]',title,this._tpl_title); }else{ title = ''; } tmp = this._str_replace( ['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]'], [title, text, this._tpl_close, image_str, this._item_count, class_name, item_class], tmp ); // If it's false, don't show another gritter message if(this['_before_open_' + number]() === false){ return false; } $('#gritter-notice-wrapper').addClass(position).append(tmp); var item = $('#gritter-item-' + this._item_count); item.fadeIn(this.fade_in_speed, function(){ Gritter['_after_open_' + number]($(this)); }); if(!sticky){ this._setFadeTimer(item, number); } // Bind the hover/unhover states $(item).bind('mouseenter mouseleave', function(event){ if(event.type == 'mouseenter'){ if(!sticky){ Gritter._restoreItemIfFading($(this), number); } } else { if(!sticky){ Gritter._setFadeTimer($(this), number); } } Gritter._hoverState($(this), event.type); }); // Clicking (X) makes the perdy thing close $(item).find('.gritter-close').click(function(){ Gritter.removeSpecific(number, {}, null, true); }); return number; }, /** * If we don't have any more gritter notifications, get rid of the wrapper using this check * @private * @param {Integer} unique_id The ID of the element that was just deleted, use it for a callback * @param {Object} e The jQuery element that we're going to perform the remove() action on * @param {Boolean} manual_close Did we close the gritter dialog with the (X) button */ _countRemoveWrapper: function(unique_id, e, manual_close){ // Remove it then run the callback function e.remove(); this['_after_close_' + unique_id](e, manual_close); // Check if the wrapper is empty, if it is.. remove the wrapper if($('.gritter-item-wrapper').length == 0){ $('#gritter-notice-wrapper').remove(); } }, /** * Fade out an element after it's been on the screen for x amount of time * @private * @param {Object} e The jQuery element to get rid of * @param {Integer} unique_id The id of the element to remove * @param {Object} params An optional list of params to set fade speeds etc. * @param {Boolean} unbind_events Unbind the mouseenter/mouseleave events if they click (X) */ _fade: function(e, unique_id, params, unbind_events){ var params = params || {}, fade = (typeof(params.fade) != 'undefined') ? params.fade : true, fade_out_speed = params.speed || this.fade_out_speed, manual_close = unbind_events; this['_before_close_' + unique_id](e, manual_close); // If this is true, then we are coming from clicking the (X) if(unbind_events){ e.unbind('mouseenter mouseleave'); } // Fade it out or remove it if(fade){ e.animate({ opacity: 0 }, fade_out_speed, function(){ e.animate({ height: 0 }, 300, function(){ Gritter._countRemoveWrapper(unique_id, e, manual_close); }) }) } else { this._countRemoveWrapper(unique_id, e); } }, /** * Perform actions based on the type of bind (mouseenter, mouseleave) * @private * @param {Object} e The jQuery element * @param {String} type The type of action we're performing: mouseenter or mouseleave */ _hoverState: function(e, type){ // Change the border styles and add the (X) close button when you hover if(type == 'mouseenter'){ e.addClass('hover'); // Show close button e.find('.gritter-close').show(); } // Remove the border styles and hide (X) close button when you mouse out else { e.removeClass('hover'); // Hide close button e.find('.gritter-close').hide(); } }, /** * Remove a specific notification based on an ID * @param {Integer} unique_id The ID used to delete a specific notification * @param {Object} params A set of options passed in to determine how to get rid of it * @param {Object} e The jQuery element that we're "fading" then removing * @param {Boolean} unbind_events If we clicked on the (X) we set this to true to unbind mouseenter/mouseleave */ removeSpecific: function(unique_id, params, e, unbind_events){ if(!e){ var e = $('#gritter-item-' + unique_id); } // We set the fourth param to let the _fade function know to // unbind the "mouseleave" event. Once you click (X) there's no going back! this._fade(e, unique_id, params || {}, unbind_events); }, /** * If the item is fading out and we hover over it, restore it! * @private * @param {Object} e The HTML element to remove * @param {Integer} unique_id The ID of the element */ _restoreItemIfFading: function(e, unique_id){ clearTimeout(this['_int_id_' + unique_id]); e.stop().css({ opacity: '', height: '' }); }, /** * Setup the global options - only once * @private */ _runSetup: function(){ for(opt in $.gritter.options){ this[opt] = $.gritter.options[opt]; } this._is_setup = 1; }, /** * Set the notification to fade out after a certain amount of time * @private * @param {Object} item The HTML element we're dealing with * @param {Integer} unique_id The ID of the element */ _setFadeTimer: function(e, unique_id){ var timer_str = (this._custom_timer) ? this._custom_timer : this.time; this['_int_id_' + unique_id] = setTimeout(function(){ Gritter._fade(e, unique_id); }, timer_str); }, /** * Bring everything to a halt * @param {Object} params A list of callback functions to pass when all notifications are removed */ stop: function(params){ // callbacks (if passed) var before_close = ($.isFunction(params.before_close)) ? params.before_close : function(){}; var after_close = ($.isFunction(params.after_close)) ? params.after_close : function(){}; var wrap = $('#gritter-notice-wrapper'); before_close(wrap); wrap.fadeOut(function(){ $(this).remove(); after_close(); }); }, /** * An extremely handy PHP function ported to JS, works well for templating * @private * @param {String/Array} search A list of things to search for * @param {String/Array} replace A list of things to replace the searches with * @return {String} sa The output */ _str_replace: function(search, replace, subject, count){ var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0, f = [].concat(search), r = [].concat(replace), s = subject, ra = r instanceof Array, sa = s instanceof Array; s = [].concat(s); if(count){ this.window[count] = 0; } for(i = 0, sl = s.length; i < sl; i++){ if(s[i] === ''){ continue; } for (j = 0, fl = f.length; j < fl; j++){ temp = s[i] + ''; repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]; s[i] = (temp).split(f[j]).join(repl); if(count && s[i] !== temp){ this.window[count] += (temp.length-s[i].length) / f[j].length; } } } return sa ? s : s[0]; }, /** * A check to make sure we have something to wrap our notices with * @private */ _verifyWrapper: function(){ if($('#gritter-notice-wrapper').length == 0){ $('body').append(this._tpl_wrap); } } } })(jQuery);
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <ContactsUI/NSObject-Protocol.h> @class CNContact, CNFamilyMemberWhitelistedContactViewCell, CNUICoreFamilyMemberContactItem, NSString; @protocol CNFamilyMemberWhitelistedContactViewCellDelegate <NSObject> - (void)cell:(CNFamilyMemberWhitelistedContactViewCell *)arg1 didDismissDetailsOfFamilyMemberContactItem:(CNUICoreFamilyMemberContactItem *)arg2 withResult:(CNContact *)arg3; - (void)cell:(CNFamilyMemberWhitelistedContactViewCell *)arg1 didRequestDetailsOfFamilyMemberContactItem:(CNUICoreFamilyMemberContactItem *)arg2; - (NSString *)warningMessageWhenDisplayingConact:(CNContact *)arg1 cell:(CNFamilyMemberWhitelistedContactViewCell *)arg2; @end
{ "pile_set_name": "Github" }