text
stringlengths 2
99.9k
| meta
dict |
|---|---|
import React from "react";
import Timer from "./timer";
/**
* The React context object consumers may use to access or override the global
* timer.
*/
const TimerContext = React.createContext({
transitionTimer: new Timer(),
animationTimer: new Timer()
});
TimerContext.displayName = "TimerContext";
export default TimerContext;
|
{
"pile_set_name": "Github"
}
|
class UpdateProductNaturesNomen < ActiveRecord::Migration
def replace_items_in_array(table, column, options = {})
conditions = '1=1'
if options[:reference_name]
conditions = "reference_name = '#{options[:reference_name]}'"
end
# ex of column = abilities_list
say "replace item in array #{table}##{column} #{options.inspect}"
if options[:old] && options[:new]
execute("UPDATE #{table} SET #{column} = REPLACE(#{column}, '#{options[:old]}', '#{options[:new]}') WHERE #{column} LIKE '%#{options[:old]}%' AND #{conditions}")
elsif options[:new]
execute("UPDATE #{table} SET #{column} = COALESCE(NULLIF(#{column}, '') || ', #{options[:new]}', '#{options[:new]}') WHERE #{conditions}")
elsif options[:old]
execute("UPDATE #{table} SET #{column} = REPLACE(REPLACE(REPLACE(#{column}, ', #{options[:old]}', ''), '#{options[:old]}', ''), '#{options[:old]},', '') WHERE #{conditions}")
else
raise StandardException
end
end
PRODUCT_NATURE_ITEMS = [
{ table: 'product_natures', column: 'abilities_list', old: 'spread(mineral_matter)', new: 'spread(preparation)' },
{ table: 'product_natures', column: 'abilities_list', old: 'spread(organic_matter)', new: 'spread(excrement)' },
{ table: 'product_natures', column: 'abilities_list', old: 'store(organic_matter)', new: 'store(excrement)' },
{ table: 'product_natures', column: 'variable_indicators_list', old: 'plants_density', new: 'plants_count' },
{ table: 'product_natures', column: 'frozen_indicators_list', old: 'sulfur_dioxyde_concentration', new: 'sulfur_dioxide_concentration' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'herbicide' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'fungicide' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'additive' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'insecticide' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'molluscicide' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'chemical_fertilizer' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'animal_medicine' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'disinfectant' },
{ table: 'product_natures', column: 'variety', new: 'equipment', old: 'bottling' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'fresh_mass', reference_name: 'grain_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'fresh_mass', reference_name: 'crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'fresh_mass', reference_name: 'cereal_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'rows_interval', reference_name: 'fruit_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'plants_interval', reference_name: 'fruit_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', old: 'net_surface_area', reference_name: 'fruit_crop' },
{ table: 'product_natures', column: 'frozen_indicators_list', new: 'net_surface_area', reference_name: 'fruit_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'rows_interval', reference_name: 'walnut_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'plants_interval', reference_name: 'walnut_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', old: 'net_surface_area', reference_name: 'walnut_crop' },
{ table: 'product_natures', column: 'frozen_indicators_list', new: 'net_surface_area', reference_name: 'walnut_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'rows_interval', reference_name: 'wine_crop' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'plants_interval', reference_name: 'wine_crop' },
{ table: 'product_natures', column: 'frozen_indicators_list', new: 'net_surface_area', reference_name: 'wine_crop' },
{ table: 'product_natures', column: 'derivative_of', new: 'plant', old: 'poaceae', reference_name: 'grass' },
{ table: 'product_natures', column: 'variety', new: 'preparation', old: 'matter', reference_name: 'clarification_solution' },
{ table: 'product_natures', column: 'abilities_list', old: 'kill(bacteria virus fungus)', new: 'kill(bacteria)', reference_name: 'animal_medicine' },
{ table: 'product_natures', column: 'abilities_list', new: 'kill(virus)', reference_name: 'animal_medicine' },
{ table: 'product_natures', column: 'abilities_list', new: 'kill(fungus)', reference_name: 'animal_medicine' },
{ table: 'product_natures', column: 'abilities_list', old: 'kill(plant)', new: 'kill(plant), care(plant)', reference_name: 'herbicide' },
{ table: 'product_natures', column: 'abilities_list', old: 'kill(fungus)', new: 'kill(fungus), care(plant)', reference_name: 'fungicide' },
{ table: 'product_natures', column: 'abilities_list', old: 'kill(insecta)', new: 'kill(insecta), care(plant)', reference_name: 'insecticide' },
{ table: 'product_natures', column: 'abilities_list', old: 'kill(mollusca)', new: 'kill(mollusca), care(plant)', reference_name: 'molluscicide' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'nitrogen_concentration', reference_name: 'running_water' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'potential_hydrogen', reference_name: 'running_water' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'nitrogen_concentration', reference_name: 'irrigation_water' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'potential_hydrogen', reference_name: 'irrigation_water' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'nitrogen_concentration', reference_name: 'natural_water' },
{ table: 'product_natures', column: 'variable_indicators_list', new: 'potential_hydrogen', reference_name: 'natural_water' }
].freeze
CHANGING_CATEGORIES = [
{ table: 'product_natures', column: 'category_id', linked_table: 'product_nature_categories', reference_name: 'animal_food_building_division', new_linked_reference_name: 'building_division', old_linked_reference_name: 'equipment' },
{ table: 'product_natures', column: 'category_id', linked_table: 'product_nature_categories', reference_name: 'silage_division', new_linked_reference_name: 'building_division', old_linked_reference_name: 'equipment' }
].freeze
PRODUCT_NATURE_VARIANT_ITEMS = [
{ table: 'product_nature_variants', column: 'reference_name', old: 'alfalfa_crop', new: 'lucerne_crop' },
{ table: 'product_nature_variants', column: 'derivative_of', old: 'organic_matter', new: 'raw_matter', reference_name: 'wine_vinasse' },
{ table: 'product_nature_variants', column: 'reference_name', old: 'coop:ammonitre_33,5%_vr', new: 'coop:ammonitre_33,5__vr' },
{ table: 'product_nature_variants', column: 'reference_name', old: 'coop:super_46%_gr._vr', new: 'coop:super_46__gr__vr' },
{ table: 'product_nature_variants', column: 'reference_name', old: 'coop:chlorure_60%_gr_vr', new: 'coop:chlorure_60__gr_vr' },
{ table: 'product_nature_variants', column: 'unit_name', old: 'bag', new: '20kg_bag', reference_name: 'coop:metarex_rg_tds_20kg' }
].freeze
PRODUCT_NATURE_VARIANT_READING_ITEMS = [
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'lucerne_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'apple_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'walnut_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'hazel_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'rose_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'raspberry_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'strawberry_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'gooseberry_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'blackcurrant_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'pear_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'peach_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'fig_crop' },
{ table: 'product_nature_variant_readings', new_frozen_indicator_name: 'net_surface_area', new_frozen_indicator_datatype: 'measure', new_value: '1.00', new_unit: 'hectare', new_absolute_value: '10000.00', new_absolute_unit: 'square_meter', reference_name: 'vine_grape_crop' }
].freeze
# INDICATOR_NAME_CHANGES = {
# sulfur_dioxyde_concentration: :sulfur_dioxide_concentration,
# plants_density: :plants_count
# }
# INDICATOR_TABLES = [:product_readings, :product_nature_variant_readings, :production_support_markers, :analysis_items]
INDICATOR_ITEMS = [
# for sulfur_dioxide_concentration
{ table: 'product_readings', column: 'indicator_name', old: 'sulfur_dioxyde_concentration', new: 'sulfur_dioxide_concentration' },
{ table: 'product_nature_variant_readings', column: 'indicator_name', new: 'sulfur_dioxide_concentration', old: 'sulfur_dioxyde_concentration' },
{ table: 'production_support_markers', column: 'indicator_name', new: 'sulfur_dioxide_concentration', old: 'sulfur_dioxyde_concentration' },
{ table: 'analysis_items', column: 'indicator_name', new: 'sulfur_dioxide_concentration', old: 'sulfur_dioxyde_concentration' },
# for plants_count
{ table: 'product_readings', column: 'indicator_name', old: 'plants_density', new: 'plants_count' },
{ table: 'product_nature_variant_readings', column: 'indicator_name', new: 'plants_count', old: 'plants_density' },
{ table: 'production_support_markers', column: 'indicator_name', new: 'plants_count', old: 'plants_density' },
{ table: 'analysis_items', column: 'indicator_name', new: 'plants_count', old: 'plants_density' }
].freeze
def up
# check if product_nature is present in DB and update it with new values
for item in PRODUCT_NATURE_ITEMS
replace_items_in_array(item[:table], item[:column], item)
end
for item in CHANGING_CATEGORIES
if connection.select_value("SELECT count(*) FROM #{item[:linked_table]} WHERE reference_name = '#{item[:new_linked_reference_name]}'").to_i > 0
execute("UPDATE #{item[:table]} SET #{item[:column]} = (SELECT min(id) FROM #{item[:linked_table]} WHERE reference_name = '#{item[:new_linked_reference_name]}')")
end
end
for item in PRODUCT_NATURE_VARIANT_ITEMS
replace_items_in_array(item[:table], item[:column], item)
end
for item in PRODUCT_NATURE_VARIANT_READING_ITEMS
next unless variant_id = connection.select_value("SELECT min(id) FROM product_nature_variants WHERE reference_name = '#{item[:reference_name]}'").to_i
if item[:old_frozen_indicator_name] && item[:new_frozen_indicator_name]
raise NotImplemented
elsif item[:new_frozen_indicator_name]
if item[:new_frozen_indicator_datatype] == 'measure'
execute("INSERT INTO #{item[:table]} (variant_id, indicator_name, indicator_datatype, measure_value_value, measure_value_unit, absolute_measure_value_value, absolute_measure_value_unit, created_at, updated_at) VALUES ('#{variant_id}', '#{item[:new_frozen_indicator_name]}', '#{item[:new_frozen_indicator_datatype]}', '#{item[:new_value]}', '#{item[:new_unit]}', '#{item[:new_absolute_value]}', '#{item[:new_absolute_unit]}', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)")
end
elsif item[:new_value] && item[:old_value]
execute("UPDATE #{item[:table]} SET #{item[:column]} = '#{item[:new_value]}' WHERE #{item[:column]} = '#{item[:old_value]}'")
end
end
for item in INDICATOR_ITEMS
replace_items_in_array(item[:table], item[:column], item)
end
################ END FOR NOMENCLATURES UPDATE ######################
# add column for maximum_nitrogen_input in mmp
add_column :manure_management_plan_zones, :maximum_nitrogen_input, :decimal, precision: 19, scale: 4
# add column for picking roles into nomenclatures
add_column :roles, :reference_name, :string
end
def down
# remove column for maximum_nitrogen_input in mmp
remove_column :manure_management_plan_zones, :maximum_nitrogen_input
remove_column :roles, :reference_name
for item in INDICATOR_ITEMS
replace_items_in_array(item[:table], item[:column], new: item[:old], old: item[:new])
end
for item in PRODUCT_NATURE_VARIANT_READING_ITEMS
next unless variant_id = connection.select_value("SELECT min(id) FROM product_nature_variants WHERE reference_name = '#{item[:reference_name]}'").to_i
if item[:old_frozen_indicator_name] && item[:new_frozen_indicator_name]
raise NotImplemented
elsif item[:new_frozen_indicator_name]
execute("DELETE FROM #{item[:table]} WHERE variant_id = '#{variant_id}' AND indicator_name = '#{item[:new_frozen_indicator_name]}'")
elsif item[:new_value] && item[:old_value]
execute("UPDATE #{item[:table]} SET #{item[:column]} = '#{item[:old_value]}' WHERE #{item[:column]} = '#{item[:new_value]}'")
end
end
for item in PRODUCT_NATURE_VARIANT_ITEMS
replace_items_in_array(item[:table], item[:column], new: item[:old], old: item[:new])
end
for item in CHANGING_CATEGORIES
if connection.select_value("SELECT count(*) FROM #{item[:linked_table]} WHERE reference_name = '#{item[:old_linked_reference_name]}'").to_i > 0
execute("UPDATE #{item[:table]} SET #{item[:column]} = (SELECT min(id) FROM #{item[:linked_table]} WHERE reference_name = '#{item[:old_linked_reference_name]}')")
end
end
# check if product_nature is present in DB and update it with old abilities
# check if product_nature is present in DB and update it with new abilities
for item in PRODUCT_NATURE_ITEMS
replace_items_in_array(item[:table], item[:column], new: item[:old], old: item[:new])
end
end
end
|
{
"pile_set_name": "Github"
}
|
module System.Console.Docopt.Types
where
import Data.Char (isUpper)
import Data.List (nub)
import Data.Map (Map)
import qualified Data.Map as M
-- * Usage expression Types
type Name = String
data Pattern a = Sequence [Pattern a]
| OneOf [Pattern a]
| Unordered [Pattern a]
| Optional (Pattern a)
| Repeated (Pattern a)
| Atom a
deriving (Show, Eq)
atoms :: Eq a => Pattern a -> [a]
atoms (Sequence ps) = concatMap atoms ps
atoms (OneOf ps) = concatMap atoms $ nub ps
atoms (Unordered ps) = concatMap atoms $ nub ps
atoms (Optional p) = atoms p
atoms (Repeated p) = atoms p
atoms (Atom a) = [a]
-- | A named leaf node of the usage pattern tree
data Option = LongOption Name
| ShortOption Char
| Command Name
| Argument Name
| AnyOption
deriving (Show, Eq, Ord)
type OptPattern = Pattern Option
humanize :: Option -> String
humanize opt = case opt of
Command name -> name
Argument name -> if all isUpper name
then name
else "<" ++ name ++ ">"
LongOption name -> "--"++name
ShortOption c -> ['-',c]
AnyOption -> "[options]"
-- | Used when parsing through the available option descriptions.
-- Holds a list of synonymous options, Maybe a default value (if specified),
-- an expectsVal :: Bool that indicates whether this option is a flag (--flag)
-- or an option that needs an argument (--opt=arg), and isRepeated :: Bool
-- that indicates whether this option is always single or needs to be accumulated
data OptionInfo = OptionInfo
{ synonyms :: [Option]
, defaultVal :: Maybe String
, expectsVal :: Bool
, isRepeated :: Bool
} deriving (Show, Eq)
fromSynList :: [Option] -> OptionInfo
fromSynList opts = OptionInfo { synonyms = opts
, defaultVal = Nothing
, expectsVal = False
, isRepeated = False }
-- | Maps each available option to a OptionInfo entry
-- (each synonymous option gets its own separate entry, for easy lookup)
type OptInfoMap = Map Option OptionInfo
-- | Contains all the relevant information parsed out of a usage string.
-- Used to build the actual command-line arg parser.
type OptFormat = (OptPattern, OptInfoMap)
-- |
data OptParserState = OptParserState
{ optInfoMap :: OptInfoMap
, parsedArgs :: Arguments
, inShortOptStack :: Bool
, inTopLevelSequence :: Bool
} deriving (Show)
fromOptInfoMap :: OptInfoMap -> OptParserState
fromOptInfoMap m = OptParserState { optInfoMap = m
, parsedArgs = M.empty
, inShortOptStack = False
, inTopLevelSequence = True }
data ArgValue = MultiValue [String]
| Value String
| NoValue
| Counted Int
| Present
| NotPresent
deriving (Show, Eq, Ord)
-- | Maps each Option to all of the valued parsed from the command line
-- (in order of last to first, if multiple values encountered)
type Arguments = Map Option ArgValue
-- | An abstract data type which represents Docopt usage patterns.
data Docopt = Docopt { optFormat :: OptFormat
-- | Retrieve the original usage string.
, usage :: String
}
|
{
"pile_set_name": "Github"
}
|
import UIKit
import RxSwift
import RxCocoa
extension UIColor {
convenience init(RGBred red: Int, green: Int, blue: Int, alpha: CGFloat = 1.0) {
self.init(red: CGFloat(red)/255, green: CGFloat(green)/255, blue: CGFloat(blue)/255, alpha: alpha)
}
}
struct HTTPImageServiceError: ErrorType {}
final class MessageCell: UITableViewCell {
let authorLabel = UILabel()
let timestampLabel = UILabel()
let photoView = UIImageView()
let smallDot = UIView()
let bigDot = UIView()
let bubbleView = UIView()
let messageLabel = UILabel()
let smallDotSize: CGFloat = 6
let bigDotSize: CGFloat = 12
let bigDotOverlap: CGFloat = 7
let verticalSpacing: CGFloat = 5
let verticalMargin: CGFloat = 10
let horizontalMargin: CGFloat = 16
let imageSize: CGFloat = 36
let messageFont = UIFont.systemFontOfSize(12)
let authorFont = UIFont.boldSystemFontOfSize(10)
let timestampFont = UIFont.systemFontOfSize(10)
let bubbleColor = UIColor(RGBred: 220, green: 220, blue: 220)
var disposeBag: DisposeBag! = nil
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupViews()
setupHierarchy()
setupLayout()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupViews() {
messageLabel.numberOfLines = 0
authorLabel.numberOfLines = 0
photoView.contentMode = .ScaleAspectFit
photoView.layer.cornerRadius = imageSize/2
photoView.layer.masksToBounds = true
authorLabel.font = authorFont
authorLabel.textColor = .darkGrayColor()
timestampLabel.font = timestampFont
timestampLabel.textColor = .darkGrayColor()
timestampLabel.textAlignment = .Left
messageLabel.font = messageFont
bubbleView.backgroundColor = bubbleColor
smallDot.backgroundColor = bubbleColor
bigDot.backgroundColor = bubbleColor
let cornerRadius: CGFloat = verticalSpacing * 2 + messageFont.lineHeight/2
bubbleView.layer.cornerRadius = cornerRadius
smallDot.layer.cornerRadius = smallDotSize/2
bigDot.layer.cornerRadius = bigDotSize/2
}
func setupHierarchy() {
addSubview(smallDot)
addSubview(bigDot)
addSubview(bubbleView)
addSubview(photoView)
addSubview(authorLabel)
addSubview(timestampLabel)
bubbleView.addSubview(messageLabel)
}
func setupLayout() {
smallDot.addHeightConstraint(withConstant: smallDotSize)
smallDot.addWidthConstraint(withConstant: smallDotSize)
smallDot.alignVerticalCenter(withView: photoView)
bigDot.addHeightConstraint(withConstant: bigDotSize)
bigDot.addWidthConstraint(withConstant: bigDotSize)
bigDot.alignVerticalCenter(withView: smallDot)
messageLabel.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Vertical)
authorLabel.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Vertical)
authorLabel.setContentHuggingPriority(UILayoutPriorityRequired, forAxis: .Horizontal)
timestampLabel.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Vertical)
timestampLabel.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Horizontal)
messageLabel.setContentHuggingPriority(UILayoutPriorityRequired, forAxis: .Horizontal)
messageLabel.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Vertical)
photoView.pinToSuperviewLeading(withConstant: horizontalMargin)
smallDot.attachToRightOf(photoView, withConstant: horizontalMargin/2)
bigDot.attachToRightOf(smallDot, withConstant: horizontalMargin/4)
bubbleView.attachToRightOf(bigDot, withConstant: -bigDotOverlap)
bubbleView.pinToSuperviewTrailing(withConstant: horizontalMargin, priority: UILayoutPriorityDefaultHigh)
authorLabel.pinToSuperviewTop(withConstant: verticalMargin)
authorLabel.alignLeading(withView: messageLabel)
photoView.attachToBottomOf(authorLabel, withConstant: verticalSpacing)
photoView.pinToSuperviewBottom(withConstant: verticalMargin, priority: UILayoutPriorityDefaultHigh)
timestampLabel.attachToRightOf(authorLabel, withConstant: horizontalMargin/2)
timestampLabel.pinToSuperviewTop(withConstant: verticalMargin)
timestampLabel.pinToSuperviewTrailing(withConstant: horizontalMargin)
bubbleView.attachToBottomOf(authorLabel, withConstant: verticalSpacing)
bubbleView.pinToSuperviewBottom(withConstant: verticalMargin)
photoView.addHeightConstraint(withConstant: imageSize)
photoView.addWidthConstraint(withConstant: imageSize)
messageLabel.pinToSuperviewEdges(withInsets: UIEdgeInsets(
top: verticalSpacing,
left: horizontalMargin - (bigDotSize - bigDotOverlap),
bottom: verticalSpacing,
right: horizontalMargin
)
)
}
override func prepareForReuse() {
disposeBag = nil
super.prepareForReuse()
}
func updateWithMessage(message: Message) {
let date = NSDate(timeIntervalSince1970: NSTimeInterval(message.timestamp / 1000))
let dateFormatter = NSDateFormatter()
dateFormatter.dateStyle = .MediumStyle
dateFormatter.timeStyle = .ShortStyle
authorLabel.text = message.author.name
messageLabel.text = message.body
timestampLabel.text = dateFormatter.stringFromDate(date)
if let url = message.author.photoURL {
setUserPhoto(url)
}
}
private func setUserPhoto(url: NSURL) {
disposeBag = DisposeBag()
photoView.image = UIImage(named: "ic_person")
imageForURL(url)
.observeOn(MainScheduler.instance)
.subscribeNext({ [weak self] image in
self?.photoView.image = image
}).addDisposableTo(disposeBag)
}
func imageForURL(url: NSURL) -> Observable<UIImage?> {
let request = NSURLRequest(URL: url)
return NSURLSession.sharedSession().rx_data(request).map { data in
guard let image = UIImage(data: data) else {
throw HTTPImageServiceError()
}
return image
}
}
}
|
{
"pile_set_name": "Github"
}
|
package queryutil
import (
"encoding/base64"
"fmt"
"net/url"
"reflect"
"sort"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/private/protocol"
)
// Parse parses an object i and fills a url.Values object. The isEC2 flag
// indicates if this is the EC2 Query sub-protocol.
func Parse(body url.Values, i interface{}, isEC2 bool) error {
q := queryParser{isEC2: isEC2}
return q.parseValue(body, reflect.ValueOf(i), "", "")
}
func elemOf(value reflect.Value) reflect.Value {
for value.Kind() == reflect.Ptr {
value = value.Elem()
}
return value
}
type queryParser struct {
isEC2 bool
}
func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
value = elemOf(value)
// no need to handle zero values
if !value.IsValid() {
return nil
}
t := tag.Get("type")
if t == "" {
switch value.Kind() {
case reflect.Struct:
t = "structure"
case reflect.Slice:
t = "list"
case reflect.Map:
t = "map"
}
}
switch t {
case "structure":
return q.parseStruct(v, value, prefix)
case "list":
return q.parseList(v, value, prefix, tag)
case "map":
return q.parseMap(v, value, prefix, tag)
default:
return q.parseScalar(v, value, prefix, tag)
}
}
func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error {
if !value.IsValid() {
return nil
}
t := value.Type()
for i := 0; i < value.NumField(); i++ {
elemValue := elemOf(value.Field(i))
field := t.Field(i)
if field.PkgPath != "" {
continue // ignore unexported fields
}
if field.Tag.Get("ignore") != "" {
continue
}
if protocol.CanSetIdempotencyToken(value.Field(i), field) {
token := protocol.GetIdempotencyToken()
elemValue = reflect.ValueOf(token)
}
var name string
if q.isEC2 {
name = field.Tag.Get("queryName")
}
if name == "" {
if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" {
name = field.Tag.Get("locationNameList")
} else if locName := field.Tag.Get("locationName"); locName != "" {
name = locName
}
if name != "" && q.isEC2 {
name = strings.ToUpper(name[0:1]) + name[1:]
}
}
if name == "" {
name = field.Name
}
if prefix != "" {
name = prefix + "." + name
}
if err := q.parseValue(v, elemValue, name, field.Tag); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value
if !value.IsNil() && value.Len() == 0 {
v.Set(prefix, "")
return nil
}
if _, ok := value.Interface().([]byte); ok {
return q.parseScalar(v, value, prefix, tag)
}
// check for unflattened list member
if !q.isEC2 && tag.Get("flattened") == "" {
if listName := tag.Get("locationNameList"); listName == "" {
prefix += ".member"
} else {
prefix += "." + listName
}
}
for i := 0; i < value.Len(); i++ {
slicePrefix := prefix
if slicePrefix == "" {
slicePrefix = strconv.Itoa(i + 1)
} else {
slicePrefix = slicePrefix + "." + strconv.Itoa(i+1)
}
if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value
if !value.IsNil() && value.Len() == 0 {
v.Set(prefix, "")
return nil
}
// check for unflattened list member
if !q.isEC2 && tag.Get("flattened") == "" {
prefix += ".entry"
}
// sort keys for improved serialization consistency.
// this is not strictly necessary for protocol support.
mapKeyValues := value.MapKeys()
mapKeys := map[string]reflect.Value{}
mapKeyNames := make([]string, len(mapKeyValues))
for i, mapKey := range mapKeyValues {
name := mapKey.String()
mapKeys[name] = mapKey
mapKeyNames[i] = name
}
sort.Strings(mapKeyNames)
for i, mapKeyName := range mapKeyNames {
mapKey := mapKeys[mapKeyName]
mapValue := value.MapIndex(mapKey)
kname := tag.Get("locationNameKey")
if kname == "" {
kname = "key"
}
vname := tag.Get("locationNameValue")
if vname == "" {
vname = "value"
}
// serialize key
var keyName string
if prefix == "" {
keyName = strconv.Itoa(i+1) + "." + kname
} else {
keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname
}
if err := q.parseValue(v, mapKey, keyName, ""); err != nil {
return err
}
// serialize value
var valueName string
if prefix == "" {
valueName = strconv.Itoa(i+1) + "." + vname
} else {
valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname
}
if err := q.parseValue(v, mapValue, valueName, ""); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error {
switch value := r.Interface().(type) {
case string:
v.Set(name, value)
case []byte:
if !r.IsNil() {
v.Set(name, base64.StdEncoding.EncodeToString(value))
}
case bool:
v.Set(name, strconv.FormatBool(value))
case int64:
v.Set(name, strconv.FormatInt(value, 10))
case int:
v.Set(name, strconv.Itoa(value))
case float64:
v.Set(name, strconv.FormatFloat(value, 'f', -1, 64))
case float32:
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.ISO8601TimeFormatName
}
v.Set(name, protocol.FormatTime(format, value))
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
}
return nil
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* 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.
*
* @providesModule copyProperties
*/
'use strict';
/**
* Copy properties from one or more objects (up to 5) into the first object.
* This is a shallow copy. It mutates the first object and also returns it.
*
* NOTE: `arguments` has a very significant performance penalty, which is why
* we don't support unlimited arguments.
*/
function copyProperties(obj, a, b, c, d, e, f) {
obj = obj || {};
if (process.env.NODE_ENV !== 'production') {
if (f) {
throw new Error('Too many arguments passed to copyProperties');
}
}
var args = [a, b, c, d, e];
var ii = 0, v;
while (args[ii]) {
v = args[ii++];
for (var k in v) {
obj[k] = v[k];
}
// IE ignores toString in object iteration.. See:
// webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html
if (v.hasOwnProperty && v.hasOwnProperty('toString') &&
(typeof v.toString !== 'undefined') && (obj.toString !== v.toString)) {
obj.toString = v.toString;
}
}
return obj;
}
module.exports = copyProperties;
|
{
"pile_set_name": "Github"
}
|
---
layout: base
title: 'Statistics of PRON in UD_Galician'
udver: '2'
---
## Treebank Statistics: UD_Galician: POS Tags: `PRON`
There are 35 `PRON` lemmas (0%), 47 `PRON` types (0%) and 5912 `PRON` tokens (4%).
Out of 16 observed tags, the rank of `PRON` is: 7 in number of lemmas, 8 in number of types and 7 in number of tokens.
The 10 most frequent `PRON` lemmas: <em>se, que, como, o, el, lle, cando, onde, me, nos</em>
The 10 most frequent `PRON` types: <em>se, que, como, cando, o, os, lle, onde, me, nos</em>
The 10 most frequent ambiguous lemmas: <em>se</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 2181, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 91), <em>que</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 1910, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 1194, <tt><a href="gl-pos-DET.html">DET</a></tt> 14), <em>como</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 496, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 113, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 16), <em>o</em> (<tt><a href="gl-pos-DET.html">DET</a></tt> 18187, <tt><a href="gl-pos-PRON.html">PRON</a></tt> 272), <em>cando</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 137, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 9, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 7), <em>onde</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 79, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 1), <em>cal</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 55, <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 4), <em>un</em> (<tt><a href="gl-pos-DET.html">DET</a></tt> 2077, <tt><a href="gl-pos-PRON.html">PRON</a></tt> 42), <em>canto</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 30, <tt><a href="gl-pos-DET.html">DET</a></tt> 11, <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 1), <em>algo</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 11, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 5)
The 10 most frequent ambiguous types: <em>se</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 2157, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 49), <em>que</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 1907, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 1187, <tt><a href="gl-pos-DET.html">DET</a></tt> 9), <em>como</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 462, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 107, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 13), <em>cando</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 104, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 7, <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 6), <em>o</em> (<tt><a href="gl-pos-DET.html">DET</a></tt> 6283, <tt><a href="gl-pos-PRON.html">PRON</a></tt> 98), <em>os</em> (<tt><a href="gl-pos-DET.html">DET</a></tt> 2686, <tt><a href="gl-pos-PRON.html">PRON</a></tt> 93), <em>onde</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 78, <tt><a href="gl-pos-ADV.html">ADV</a></tt> 1), <em>a</em> (<tt><a href="gl-pos-DET.html">DET</a></tt> 6114, <tt><a href="gl-pos-ADP.html">ADP</a></tt> 2083, <tt><a href="gl-pos-PRON.html">PRON</a></tt> 53), <em>cal</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 40, <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 4), <em>canto</em> (<tt><a href="gl-pos-PRON.html">PRON</a></tt> 28, <tt><a href="gl-pos-DET.html">DET</a></tt> 8, <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 1)
* <em>se</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 2157: <em>E a quen <b>se</b> lle pide a fe de bautismo ?</em>
* <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 49: <em>En función de a resposta procede se a extracción e desconectase o corpo de a máquina e <b>se</b> lle suprime a medicación .</em>
* <em>que</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 1907: <em>A diferenza máis inmediata entre a varicela en vacinados e non vacinados é o número de lesións <b>que</b> provocan .</em>
* <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 1187: <em>Para <b>que</b> tanto esforzo ?</em>
* <tt><a href="gl-pos-DET.html">DET</a></tt> 9: <em>Como saber <b>que</b> é o que realmente hai que manter , apoiar ou preservar de a propia diversidade cultural local ?</em>
* <em>como</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 462: <em>A faceta máis sinxela e artesanal ten <b>como</b> obxecto a captura de moluscos en os areais costeiros e fai se a pé .</em>
* <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 107: <em>A reserva total de auga obtería se <b>como</b> a suma de as reservas individuais de todos os horizontes ou capas que formen o solo .</em>
* <tt><a href="gl-pos-ADV.html">ADV</a></tt> 13: <em>Unha vez acabada a intervención suturan se os cortes realizados <b>como</b> en calquera outro tipo de intervención , lava se o corpo e envolve se en un sudario .</em>
* <em>cando</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 104: <em>O provedor realizará a reposición automática <b>cando</b> o nivel de gas se encontre por debaixo de o volume mínimo establecido .</em>
* <tt><a href="gl-pos-ADV.html">ADV</a></tt> 7: <em>A situación cambiará <b>cando</b> , como parece , a oferta de a Rede vaia asociada a a oferta televisiva e se utilice como pantalla de servicio a de o propio televisor .</em>
* <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> 6: <em>A transmisión de coñecemento tecnolóxico será maior <b>cando</b> os acordos de integración inclúen tamén a mobilidade de o capital .</em>
* <em>o</em>
* <tt><a href="gl-pos-DET.html">DET</a></tt> 6283: <em>Así mesmo , serán publicados en <b>o</b> " Boletín Oficial de el Estado " .</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 98: <em>Se a vítima presenta signos de obstrución lixeira de a vía aérea , debemos animar <b>o</b> a seguir tusindo e non facer nada máis .</em>
* <em>os</em>
* <tt><a href="gl-pos-DET.html">DET</a></tt> 2686: <em>Teñen moitas razóns históricas en común , pero <b>os</b> espazos de actuación non son necesariamente unívocos .</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 93: <em>En este plan os galegos en Cataluña abondaría me <b>os</b> para acabar nós soíños con o problema demográfico de Galicia .</em>
* <em>onde</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 78: <em>Para ela as mulleres son un dedo sinalando o nariz ( <b>onde</b> se leva o pendente ) e os homes un aceno de bigote .</em>
* <tt><a href="gl-pos-ADV.html">ADV</a></tt> 1: <em>Poden inducir cambios en o patrón de voo , sempre moito menores cós ocasionados por as paredes de selado , xa que las reixas ofrecen múltiples puntos por <b>onde</b> atravesar as .</em>
* <em>a</em>
* <tt><a href="gl-pos-DET.html">DET</a></tt> 6114: <em>E <b>a</b> quen se lle pide <b>a</b> fe de bautismo ?</em>
* <tt><a href="gl-pos-ADP.html">ADP</a></tt> 2083: <em>Ningunha de elas se chegou <b>a</b> instalar por a oposición directa de a poboación .</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 53: <em>Dende que o caso índice enfermou ata a chegada de a súa nai o día de o seu ingreso , a tía foi quen <b>a</b> coidou .</em>
* <em>cal</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 40: <em>Que é máis bonito vivir en USA , Suecia ou Inglaterra , <b>cal</b> destes se achega máis a o socialismo de o século XXI ?</em>
* <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 4: <em>Alegación : os datos de emisións correspondentes a a fabricación de o <b>cal</b> e á fabricación de ladrillos e tellas non responden a o mellor coñecemento dispoñible .</em>
* <em>canto</em>
* <tt><a href="gl-pos-PRON.html">PRON</a></tt> 28: <em>En <b>canto</b> a os estranxeiros , por países destacan Alemania , con algo máis de o 5 % , e Francia e Portugal con algo menos de ese 5 % .</em>
* <tt><a href="gl-pos-DET.html">DET</a></tt> 8: <em>Así , en <b>canto</b> ás temperaturas , observa se de xeito xeneralizado un aumento de as temperaturas medias a medida que avanzamos cara a o S e a o SE .</em>
* <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> 1: <em>Pero Touriño agradeceu o convite e negou se a facer o , por o que Zitarrosa tivo que tomar unhas clases de galego con o seu amigo antes de incluír a composición en o seu disco , convertendo a así en un clásico de o <b>canto</b> popular oriental .</em>
## Morphology
The form / lemma ratio of `PRON` is 1.342857 (the average of all parts of speech is 1.520215).
The 1st highest number of forms (4) was observed with the lemma “el”: <em>el, ela, elas, eles</em>.
The 2nd highest number of forms (4) was observed with the lemma “o”: <em>a, as, o, os</em>.
The 3rd highest number of forms (3) was observed with the lemma “cuxo”: <em>cuxa, cuxas, cuxo</em>.
`PRON` occurs with 1 features: <tt><a href="gl-feat-Foreign.html">Foreign</a></tt> (2; 0% instances)
`PRON` occurs with 1 feature-value pairs: `Foreign=Yes`
`PRON` occurs with 2 feature combinations.
The most frequent feature combination is `_` (5910 tokens).
Examples: <em>se, que, como, cando, o, os, lle, onde, me, nos</em>
## Relations
`PRON` nodes are attached to their parents using 16 different relations: <tt><a href="gl-dep-nsubj.html">nsubj</a></tt> (2002; 34% instances), <tt><a href="gl-dep-obj.html">obj</a></tt> (1611; 27% instances), <tt><a href="gl-dep-dep.html">dep</a></tt> (1192; 20% instances), <tt><a href="gl-dep-obl.html">obl</a></tt> (301; 5% instances), <tt><a href="gl-dep-iobj.html">iobj</a></tt> (287; 5% instances), <tt><a href="gl-dep-nmod.html">nmod</a></tt> (213; 4% instances), <tt><a href="gl-dep-case.html">case</a></tt> (119; 2% instances), <tt><a href="gl-dep-det.html">det</a></tt> (52; 1% instances), <tt><a href="gl-dep-ccomp.html">ccomp</a></tt> (44; 1% instances), <tt><a href="gl-dep-xcomp.html">xcomp</a></tt> (40; 1% instances), <tt><a href="gl-dep-cc.html">cc</a></tt> (15; 0% instances), <tt><a href="gl-dep-root.html">root</a></tt> (13; 0% instances), <tt><a href="gl-dep-aux.html">aux</a></tt> (10; 0% instances), <tt><a href="gl-dep-amod.html">amod</a></tt> (8; 0% instances), <tt><a href="gl-dep-flat.html">flat</a></tt> (3; 0% instances), <tt><a href="gl-dep-punct.html">punct</a></tt> (2; 0% instances)
Parents of `PRON` nodes belong to 13 different parts of speech: <tt><a href="gl-pos-VERB.html">VERB</a></tt> (5190; 88% instances), <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> (395; 7% instances), <tt><a href="gl-pos-ADJ.html">ADJ</a></tt> (133; 2% instances), <tt><a href="gl-pos-ADP.html">ADP</a></tt> (67; 1% instances), <tt><a href="gl-pos-PRON.html">PRON</a></tt> (50; 1% instances), <tt><a href="gl-pos-ADV.html">ADV</a></tt> (22; 0% instances), <tt><a href="gl-pos-PROPN.html">PROPN</a></tt> (20; 0% instances), (13; 0% instances), <tt><a href="gl-pos-DET.html">DET</a></tt> (11; 0% instances), <tt><a href="gl-pos-NUM.html">NUM</a></tt> (6; 0% instances), <tt><a href="gl-pos-CCONJ.html">CCONJ</a></tt> (2; 0% instances), <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> (2; 0% instances), <tt><a href="gl-pos-PART.html">PART</a></tt> (1; 0% instances)
5142 (87%) `PRON` nodes are leaves.
388 (7%) `PRON` nodes have one child.
252 (4%) `PRON` nodes have two children.
130 (2%) `PRON` nodes have three or more children.
The highest child degree of a `PRON` node is 7.
Children of `PRON` nodes are attached using 16 different relations: <tt><a href="gl-dep-case.html">case</a></tt> (467; 34% instances), <tt><a href="gl-dep-det.html">det</a></tt> (306; 23% instances), <tt><a href="gl-dep-nmod.html">nmod</a></tt> (221; 16% instances), <tt><a href="gl-dep-punct.html">punct</a></tt> (142; 10% instances), <tt><a href="gl-dep-ccomp.html">ccomp</a></tt> (50; 4% instances), <tt><a href="gl-dep-xcomp.html">xcomp</a></tt> (35; 3% instances), <tt><a href="gl-dep-iobj.html">iobj</a></tt> (28; 2% instances), <tt><a href="gl-dep-amod.html">amod</a></tt> (27; 2% instances), <tt><a href="gl-dep-nsubj.html">nsubj</a></tt> (18; 1% instances), <tt><a href="gl-dep-cop.html">cop</a></tt> (14; 1% instances), <tt><a href="gl-dep-cc.html">cc</a></tt> (13; 1% instances), <tt><a href="gl-dep-dep.html">dep</a></tt> (10; 1% instances), <tt><a href="gl-dep-advmod.html">advmod</a></tt> (9; 1% instances), <tt><a href="gl-dep-aux.html">aux</a></tt> (7; 1% instances), <tt><a href="gl-dep-mark.html">mark</a></tt> (7; 1% instances), <tt><a href="gl-dep-obj.html">obj</a></tt> (4; 0% instances)
Children of `PRON` nodes belong to 15 different parts of speech: <tt><a href="gl-pos-ADP.html">ADP</a></tt> (496; 37% instances), <tt><a href="gl-pos-DET.html">DET</a></tt> (316; 23% instances), <tt><a href="gl-pos-NOUN.html">NOUN</a></tt> (154; 11% instances), <tt><a href="gl-pos-PUNCT.html">PUNCT</a></tt> (141; 10% instances), <tt><a href="gl-pos-VERB.html">VERB</a></tt> (97; 7% instances), <tt><a href="gl-pos-PRON.html">PRON</a></tt> (50; 4% instances), <tt><a href="gl-pos-ADJ.html">ADJ</a></tt> (43; 3% instances), <tt><a href="gl-pos-AUX.html">AUX</a></tt> (14; 1% instances), <tt><a href="gl-pos-ADV.html">ADV</a></tt> (12; 1% instances), <tt><a href="gl-pos-CCONJ.html">CCONJ</a></tt> (11; 1% instances), <tt><a href="gl-pos-PROPN.html">PROPN</a></tt> (11; 1% instances), <tt><a href="gl-pos-SCONJ.html">SCONJ</a></tt> (7; 1% instances), <tt><a href="gl-pos-PART.html">PART</a></tt> (3; 0% instances), <tt><a href="gl-pos-SYM.html">SYM</a></tt> (2; 0% instances), <tt><a href="gl-pos-NUM.html">NUM</a></tt> (1; 0% instances)
|
{
"pile_set_name": "Github"
}
|
package command
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/signal"
"strings"
"text/tabwriter"
"time"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/fatih/color"
"github.com/itsdalmo/ssm-sh/manager"
)
// Create a new AWS session
func newSession() (*session.Session, error) {
opts := session.Options{
SharedConfigState: session.SharedConfigEnable,
}
if Command.AwsOpts.Profile != "" {
opts.Profile = Command.AwsOpts.Profile
}
sess, err := session.NewSessionWithOptions(opts)
if err != nil {
return nil, err
}
return sess, nil
}
// Set targets
func setTargets(options TargetOptions) ([]string, error) {
var instances []manager.Instance
var targets []string
if options.TargetFile != "" {
content, err := ioutil.ReadFile(options.TargetFile)
if err != nil {
return nil, err
}
if err := json.Unmarshal(content, &instances); err != nil {
return nil, err
}
for _, instance := range instances {
targets = append(targets, instance.ID())
}
}
for _, target := range options.Targets {
targets = append(targets, target)
}
if len(targets) == 0 {
return nil, errors.New("no targets set")
}
fmt.Printf("Initialized with targets: %s\n", targets)
return targets, nil
}
func interruptHandler() <-chan bool {
abort := make(chan bool)
sigterm := make(chan os.Signal)
signal.Notify(sigterm, os.Interrupt)
go func() {
defer signal.Stop(sigterm)
defer close(sigterm)
defer close(abort)
// Use a threshold for time since last signal
// to avoid multiple SIGTERM when pressing ctrl+c
// on a keyboard.
var last time.Time
threshold := 50 * time.Millisecond
for range sigterm {
if time.Since(last) < threshold {
continue
}
abort <- true
last = time.Now()
}
}()
return abort
}
// PrintCommandOutput writes the output from command invocations.
func PrintCommandOutput(wrt io.Writer, output *manager.CommandOutput) error {
header := color.New(color.Bold)
if _, err := header.Fprintf(wrt, "\n%s - %s:\n", output.InstanceID, output.Status); err != nil {
return err
}
if output.Error != nil {
if _, err := fmt.Fprintf(wrt, "%s\n", output.Error); err != nil {
return err
}
}
if _, err := fmt.Fprintf(wrt, "%s\n", output.Output); err != nil {
return err
}
if output.OutputUrl != "" {
if _, err := fmt.Fprintf(wrt, "(Output URL: %s)\n", output.OutputUrl); err != nil {
return err
}
}
return nil
}
// PrintInstances writes the output from ListInstances.
func PrintInstances(wrt io.Writer, instances []*manager.Instance) error {
w := tabwriter.NewWriter(wrt, 0, 8, 1, ' ', 0)
header := []string{
"Instance ID",
"Name",
"State",
"Image ID",
"Platform",
"Version",
"IP",
"Status",
"Last pinged",
}
if _, err := fmt.Fprintln(w, strings.Join(header, "\t|\t")); err != nil {
return err
}
for _, instance := range instances {
if _, err := fmt.Fprintln(w, instance.TabString()); err != nil {
return err
}
}
err := w.Flush()
return err
}
// PrintDocuments writes the output from ListDocuments.
func PrintDocuments(wrt io.Writer, documents []*manager.DocumentIdentifier) error {
w := tabwriter.NewWriter(wrt, 0, 8, 1, ' ', 0)
header := []string{
"Name",
"Owner",
"Document Version",
"Document Format",
"Document Type",
"Schema Version",
"Target Type",
}
if _, err := fmt.Fprintln(w, strings.Join(header, "\t|\t")); err != nil {
return err
}
for _, document := range documents {
if _, err := fmt.Fprintln(w, document.TabString()); err != nil {
return err
}
}
err := w.Flush()
return err
}
// PrintDocumentDescription writes the output from DescribeDocument.
func PrintDocumentDescription(wrt io.Writer, document *manager.DocumentDescription) error {
w := tabwriter.NewWriter(wrt, 0, 8, 1, ' ', 0)
header := []string{
"Name",
"Description",
"Owner",
"Document Version",
"Document Format",
"Document Type",
"Schema Version",
"Target Type",
}
if _, err := fmt.Fprintln(w, strings.Join(header, "\t|\t")); err != nil {
return err
}
if _, err := fmt.Fprintln(w, document.TabString()); err != nil {
return err
}
if len(document.Parameters) > 0 {
if err := w.Flush(); err != nil {
return err
}
fmt.Fprintf(wrt, "\nParameters:\n")
parameterHeader := []string{
"Name",
"Type",
"DefaultValue",
"Description",
}
if _, err := fmt.Fprintln(w, strings.Join(parameterHeader, "\t|\t")); err != nil {
return err
}
if _, err := fmt.Fprintln(w, document.ParametersTabString()); err != nil {
return err
}
}
err := w.Flush()
return err
}
// WriteInstances writes the output of ListInstances to a file as JSON.
func WriteInstances(wrt io.Writer, instances []*manager.Instance) error {
w := json.NewEncoder(wrt)
err := w.Encode(instances)
return err
}
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* linux/fs/nfs/nfs4_fs.h
*
* Copyright (C) 2005 Trond Myklebust
*
* NFSv4-specific filesystem definitions and declarations
*/
#ifndef __LINUX_FS_NFS_NFS4_FS_H
#define __LINUX_FS_NFS_NFS4_FS_H
#if defined(CONFIG_NFS_V4_2)
#define NFS4_MAX_MINOR_VERSION 2
#elif defined(CONFIG_NFS_V4_1)
#define NFS4_MAX_MINOR_VERSION 1
#else
#define NFS4_MAX_MINOR_VERSION 0
#endif
#if IS_ENABLED(CONFIG_NFS_V4)
#define NFS4_MAX_LOOP_ON_RECOVER (10)
#include <linux/seqlock.h>
struct idmap;
enum nfs4_client_state {
NFS4CLNT_MANAGER_RUNNING = 0,
NFS4CLNT_CHECK_LEASE,
NFS4CLNT_LEASE_EXPIRED,
NFS4CLNT_RECLAIM_REBOOT,
NFS4CLNT_RECLAIM_NOGRACE,
NFS4CLNT_DELEGRETURN,
NFS4CLNT_SESSION_RESET,
NFS4CLNT_LEASE_CONFIRM,
NFS4CLNT_SERVER_SCOPE_MISMATCH,
NFS4CLNT_PURGE_STATE,
NFS4CLNT_BIND_CONN_TO_SESSION,
NFS4CLNT_MOVED,
NFS4CLNT_LEASE_MOVED,
NFS4CLNT_DELEGATION_EXPIRED,
NFS4CLNT_RUN_MANAGER,
NFS4CLNT_RECALL_RUNNING,
NFS4CLNT_RECALL_ANY_LAYOUT_READ,
NFS4CLNT_RECALL_ANY_LAYOUT_RW,
};
#define NFS4_RENEW_TIMEOUT 0x01
#define NFS4_RENEW_DELEGATION_CB 0x02
struct nfs_seqid_counter;
struct nfs4_minor_version_ops {
u32 minor_version;
unsigned init_caps;
int (*init_client)(struct nfs_client *);
void (*shutdown_client)(struct nfs_client *);
bool (*match_stateid)(const nfs4_stateid *,
const nfs4_stateid *);
int (*find_root_sec)(struct nfs_server *, struct nfs_fh *,
struct nfs_fsinfo *);
void (*free_lock_state)(struct nfs_server *,
struct nfs4_lock_state *);
int (*test_and_free_expired)(struct nfs_server *,
nfs4_stateid *, const struct cred *);
struct nfs_seqid *
(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
void (*session_trunk)(struct rpc_clnt *clnt,
struct rpc_xprt *xprt, void *data);
const struct rpc_call_ops *call_sync_ops;
const struct nfs4_state_recovery_ops *reboot_recovery_ops;
const struct nfs4_state_recovery_ops *nograce_recovery_ops;
const struct nfs4_state_maintenance_ops *state_renewal_ops;
const struct nfs4_mig_recovery_ops *mig_recovery_ops;
};
#define NFS_SEQID_CONFIRMED 1
struct nfs_seqid_counter {
ktime_t create_time;
int owner_id;
int flags;
u32 counter;
spinlock_t lock; /* Protects the list */
struct list_head list; /* Defines sequence of RPC calls */
struct rpc_wait_queue wait; /* RPC call delay queue */
};
struct nfs_seqid {
struct nfs_seqid_counter *sequence;
struct list_head list;
struct rpc_task *task;
};
static inline void nfs_confirm_seqid(struct nfs_seqid_counter *seqid, int status)
{
if (seqid_mutating_err(-status))
seqid->flags |= NFS_SEQID_CONFIRMED;
}
/*
* NFS4 state_owners and lock_owners are simply labels for ordered
* sequences of RPC calls. Their sole purpose is to provide once-only
* semantics by allowing the server to identify replayed requests.
*/
struct nfs4_state_owner {
struct nfs_server *so_server;
struct list_head so_lru;
unsigned long so_expires;
struct rb_node so_server_node;
const struct cred *so_cred; /* Associated cred */
spinlock_t so_lock;
atomic_t so_count;
unsigned long so_flags;
struct list_head so_states;
struct nfs_seqid_counter so_seqid;
seqcount_spinlock_t so_reclaim_seqcount;
struct mutex so_delegreturn_mutex;
};
enum {
NFS_OWNER_RECLAIM_REBOOT,
NFS_OWNER_RECLAIM_NOGRACE
};
#define NFS_LOCK_NEW 0
#define NFS_LOCK_RECLAIM 1
#define NFS_LOCK_EXPIRED 2
/*
* struct nfs4_state maintains the client-side state for a given
* (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
*
* OPEN:
* In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server,
* we need to know how many files are open for reading or writing on a
* given inode. This information too is stored here.
*
* LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN)
*/
struct nfs4_lock_state {
struct list_head ls_locks; /* Other lock stateids */
struct nfs4_state * ls_state; /* Pointer to open state */
#define NFS_LOCK_INITIALIZED 0
#define NFS_LOCK_LOST 1
unsigned long ls_flags;
struct nfs_seqid_counter ls_seqid;
nfs4_stateid ls_stateid;
refcount_t ls_count;
fl_owner_t ls_owner;
};
/* bits for nfs4_state->flags */
enum {
LK_STATE_IN_USE,
NFS_DELEGATED_STATE, /* Current stateid is delegation */
NFS_OPEN_STATE, /* OPEN stateid is set */
NFS_O_RDONLY_STATE, /* OPEN stateid has read-only state */
NFS_O_WRONLY_STATE, /* OPEN stateid has write-only state */
NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */
NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */
NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */
NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */
NFS_STATE_RECOVERY_FAILED, /* OPEN stateid state recovery failed */
NFS_STATE_MAY_NOTIFY_LOCK, /* server may CB_NOTIFY_LOCK */
NFS_STATE_CHANGE_WAIT, /* A state changing operation is outstanding */
NFS_CLNT_DST_SSC_COPY_STATE, /* dst server open state on client*/
NFS_CLNT_SRC_SSC_COPY_STATE, /* src server open state on client*/
NFS_SRV_SSC_COPY_STATE, /* ssc state on the dst server */
};
struct nfs4_state {
struct list_head open_states; /* List of states for the same state_owner */
struct list_head inode_states; /* List of states for the same inode */
struct list_head lock_states; /* List of subservient lock stateids */
struct nfs4_state_owner *owner; /* Pointer to the open owner */
struct inode *inode; /* Pointer to the inode */
unsigned long flags; /* Do we hold any locks? */
spinlock_t state_lock; /* Protects the lock_states list */
seqlock_t seqlock; /* Protects the stateid/open_stateid */
nfs4_stateid stateid; /* Current stateid: may be delegation */
nfs4_stateid open_stateid; /* OPEN stateid */
/* The following 3 fields are protected by owner->so_lock */
unsigned int n_rdonly; /* Number of read-only references */
unsigned int n_wronly; /* Number of write-only references */
unsigned int n_rdwr; /* Number of read/write references */
fmode_t state; /* State on the server (R,W, or RW) */
refcount_t count;
wait_queue_head_t waitq;
struct rcu_head rcu_head;
};
struct nfs4_exception {
struct nfs4_state *state;
struct inode *inode;
nfs4_stateid *stateid;
long timeout;
unsigned char delay : 1,
recovering : 1,
retry : 1;
bool interruptible;
};
struct nfs4_state_recovery_ops {
int owner_flag_bit;
int state_flag_bit;
int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *);
int (*recover_lock)(struct nfs4_state *, struct file_lock *);
int (*establish_clid)(struct nfs_client *, const struct cred *);
int (*reclaim_complete)(struct nfs_client *, const struct cred *);
int (*detect_trunking)(struct nfs_client *, struct nfs_client **,
const struct cred *);
};
struct nfs4_opendata {
struct kref kref;
struct nfs_openargs o_arg;
struct nfs_openres o_res;
struct nfs_open_confirmargs c_arg;
struct nfs_open_confirmres c_res;
struct nfs4_string owner_name;
struct nfs4_string group_name;
struct nfs4_label *a_label;
struct nfs_fattr f_attr;
struct nfs4_label *f_label;
struct dentry *dir;
struct dentry *dentry;
struct nfs4_state_owner *owner;
struct nfs4_state *state;
struct iattr attrs;
struct nfs4_layoutget *lgp;
unsigned long timestamp;
bool rpc_done;
bool file_created;
bool is_recover;
bool cancelled;
int rpc_status;
};
struct nfs4_add_xprt_data {
struct nfs_client *clp;
const struct cred *cred;
};
struct nfs4_state_maintenance_ops {
int (*sched_state_renewal)(struct nfs_client *, const struct cred *, unsigned);
const struct cred * (*get_state_renewal_cred)(struct nfs_client *);
int (*renew_lease)(struct nfs_client *, const struct cred *);
};
struct nfs4_mig_recovery_ops {
int (*get_locations)(struct inode *, struct nfs4_fs_locations *,
struct page *, const struct cred *);
int (*fsid_present)(struct inode *, const struct cred *);
};
extern const struct dentry_operations nfs4_dentry_operations;
/* dir.c */
int nfs_atomic_open(struct inode *, struct dentry *, struct file *,
unsigned, umode_t);
/* fs_context.c */
extern struct file_system_type nfs4_fs_type;
/* nfs4namespace.c */
struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
const struct qstr *);
int nfs4_submount(struct fs_context *, struct nfs_server *);
int nfs4_replace_transport(struct nfs_server *server,
const struct nfs4_fs_locations *locations);
/* nfs4proc.c */
extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
extern int nfs4_async_handle_error(struct rpc_task *task,
struct nfs_server *server,
struct nfs4_state *state, long *timeout);
extern int nfs4_call_sync(struct rpc_clnt *, struct nfs_server *,
struct rpc_message *, struct nfs4_sequence_args *,
struct nfs4_sequence_res *, int);
extern void nfs4_init_sequence(struct nfs4_sequence_args *, struct nfs4_sequence_res *, int, int);
extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, const struct cred *, struct nfs4_setclientid_res *);
extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct nfs4_setclientid_res *arg, const struct cred *);
extern int nfs4_proc_get_rootfh(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *, bool);
extern int nfs4_proc_bind_conn_to_session(struct nfs_client *, const struct cred *cred);
extern int nfs4_proc_exchange_id(struct nfs_client *clp, const struct cred *cred);
extern int nfs4_destroy_clientid(struct nfs_client *clp);
extern int nfs4_init_clientid(struct nfs_client *, const struct cred *);
extern int nfs41_init_clientid(struct nfs_client *, const struct cred *);
extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait);
extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *,
struct nfs4_fs_locations *, struct page *);
extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *,
struct page *page, const struct cred *);
extern int nfs4_proc_fsid_present(struct inode *, const struct cred *);
extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *,
struct dentry *,
struct nfs_fh *,
struct nfs_fattr *);
extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
extern const struct xattr_handler *nfs4_xattr_handlers[];
extern int nfs4_set_rw_stateid(nfs4_stateid *stateid,
const struct nfs_open_context *ctx,
const struct nfs_lock_context *l_ctx,
fmode_t fmode);
extern int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
struct nfs_fattr *fattr, struct nfs4_label *label,
struct inode *inode);
extern int update_open_stateid(struct nfs4_state *state,
const nfs4_stateid *open_stateid,
const nfs4_stateid *deleg_stateid,
fmode_t fmode);
extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
struct nfs_fsinfo *fsinfo);
extern void nfs4_update_changeattr(struct inode *dir,
struct nfs4_change_info *cinfo,
unsigned long timestamp,
unsigned long cache_validity);
extern int nfs4_buf_to_pages_noslab(const void *buf, size_t buflen,
struct page **pages);
#if defined(CONFIG_NFS_V4_1)
extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *);
extern int nfs4_proc_create_session(struct nfs_client *, const struct cred *);
extern int nfs4_proc_destroy_session(struct nfs4_session *, const struct cred *);
extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
bool sync);
extern int nfs4_detect_session_trunking(struct nfs_client *clp,
struct nfs41_exchange_id_res *res, struct rpc_xprt *xprt);
static inline bool
is_ds_only_client(struct nfs_client *clp)
{
return (clp->cl_exchange_flags & EXCHGID4_FLAG_MASK_PNFS) ==
EXCHGID4_FLAG_USE_PNFS_DS;
}
static inline bool
is_ds_client(struct nfs_client *clp)
{
return clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_DS;
}
static inline bool
_nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
struct rpc_clnt **clntp, struct rpc_message *msg)
{
rpc_authflavor_t flavor;
if (sp4_mode == NFS_SP4_MACH_CRED_CLEANUP ||
sp4_mode == NFS_SP4_MACH_CRED_PNFS_CLEANUP) {
/* Using machine creds for cleanup operations
* is only relevent if the client credentials
* might expire. So don't bother for
* RPC_AUTH_UNIX. If file was only exported to
* sec=sys, the PUTFH would fail anyway.
*/
if ((*clntp)->cl_auth->au_flavor == RPC_AUTH_UNIX)
return false;
}
if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {
msg->rpc_cred = rpc_machine_cred();
flavor = clp->cl_rpcclient->cl_auth->au_flavor;
WARN_ON_ONCE(flavor != RPC_AUTH_GSS_KRB5I &&
flavor != RPC_AUTH_GSS_KRB5P);
*clntp = clp->cl_rpcclient;
return true;
}
return false;
}
/*
* Function responsible for determining if an rpc_message should use the
* machine cred under SP4_MACH_CRED and if so switching the credential and
* authflavor (using the nfs_client's rpc_clnt which will be krb5i/p).
* Should be called before rpc_call_sync/rpc_call_async.
*/
static inline void
nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
struct rpc_clnt **clntp, struct rpc_message *msg)
{
_nfs4_state_protect(clp, sp4_mode, clntp, msg);
}
/*
* Special wrapper to nfs4_state_protect for write.
* If WRITE can use machine cred but COMMIT cannot, make sure all writes
* that use machine cred use NFS_FILE_SYNC.
*/
static inline void
nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp,
struct rpc_message *msg, struct nfs_pgio_header *hdr)
{
if (_nfs4_state_protect(clp, NFS_SP4_MACH_CRED_WRITE, clntp, msg) &&
!test_bit(NFS_SP4_MACH_CRED_COMMIT, &clp->cl_sp4_flags))
hdr->args.stable = NFS_FILE_SYNC;
}
#else /* CONFIG_NFS_v4_1 */
static inline bool
is_ds_only_client(struct nfs_client *clp)
{
return false;
}
static inline bool
is_ds_client(struct nfs_client *clp)
{
return false;
}
static inline void
nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_flags,
struct rpc_clnt **clntp, struct rpc_message *msg)
{
}
static inline void
nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp,
struct rpc_message *msg, struct nfs_pgio_header *hdr)
{
}
#endif /* CONFIG_NFS_V4_1 */
extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[];
extern const u32 nfs4_fattr_bitmap[3];
extern const u32 nfs4_statfs_bitmap[3];
extern const u32 nfs4_pathconf_bitmap[3];
extern const u32 nfs4_fsinfo_bitmap[3];
extern const u32 nfs4_fs_locations_bitmap[3];
void nfs40_shutdown_client(struct nfs_client *);
void nfs41_shutdown_client(struct nfs_client *);
int nfs40_init_client(struct nfs_client *);
int nfs41_init_client(struct nfs_client *);
void nfs4_free_client(struct nfs_client *);
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *);
/* nfs4renewd.c */
extern void nfs4_schedule_state_renewal(struct nfs_client *);
extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
extern void nfs4_kill_renewd(struct nfs_client *);
extern void nfs4_renew_state(struct work_struct *);
extern void nfs4_set_lease_period(struct nfs_client *clp, unsigned long lease);
/* nfs4state.c */
extern const nfs4_stateid current_stateid;
const struct cred *nfs4_get_clid_cred(struct nfs_client *clp);
const struct cred *nfs4_get_machine_cred(struct nfs_client *clp);
const struct cred *nfs4_get_renew_cred(struct nfs_client *clp);
int nfs4_discover_server_trunking(struct nfs_client *clp,
struct nfs_client **);
int nfs40_discover_server_trunking(struct nfs_client *clp,
struct nfs_client **, const struct cred *);
#if defined(CONFIG_NFS_V4_1)
int nfs41_discover_server_trunking(struct nfs_client *clp,
struct nfs_client **, const struct cred *);
extern void nfs4_schedule_session_recovery(struct nfs4_session *, int);
extern void nfs41_notify_server(struct nfs_client *);
bool nfs4_check_serverowner_major_id(struct nfs41_server_owner *o1,
struct nfs41_server_owner *o2);
#else
static inline void nfs4_schedule_session_recovery(struct nfs4_session *session, int err)
{
}
#endif /* CONFIG_NFS_V4_1 */
extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t);
extern void nfs4_put_state_owner(struct nfs4_state_owner *);
extern void nfs4_purge_state_owners(struct nfs_server *, struct list_head *);
extern void nfs4_free_state_owners(struct list_head *head);
extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
extern void nfs4_put_open_state(struct nfs4_state *);
extern void nfs4_close_state(struct nfs4_state *, fmode_t);
extern void nfs4_close_sync(struct nfs4_state *, fmode_t);
extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t);
extern void nfs_inode_find_state_and_recover(struct inode *inode,
const nfs4_stateid *stateid);
extern int nfs4_state_mark_reclaim_nograce(struct nfs_client *, struct nfs4_state *);
extern void nfs4_schedule_lease_recovery(struct nfs_client *);
extern int nfs4_wait_clnt_recover(struct nfs_client *clp);
extern int nfs4_client_recover_expired_lease(struct nfs_client *clp);
extern void nfs4_schedule_state_manager(struct nfs_client *);
extern void nfs4_schedule_path_down_recovery(struct nfs_client *clp);
extern int nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs4_state *);
extern int nfs4_schedule_migration_recovery(const struct nfs_server *);
extern void nfs4_schedule_lease_moved_recovery(struct nfs_client *);
extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags, bool);
extern void nfs41_handle_server_scope(struct nfs_client *,
struct nfs41_server_scope **);
extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp);
extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl);
extern int nfs4_select_rw_stateid(struct nfs4_state *, fmode_t,
const struct nfs_lock_context *, nfs4_stateid *,
const struct cred **);
extern bool nfs4_copy_open_stateid(nfs4_stateid *dst,
struct nfs4_state *state);
extern struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_mask);
extern int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task);
extern void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid);
extern void nfs_increment_lock_seqid(int status, struct nfs_seqid *seqid);
extern void nfs_release_seqid(struct nfs_seqid *seqid);
extern void nfs_free_seqid(struct nfs_seqid *seqid);
extern int nfs4_setup_sequence(struct nfs_client *client,
struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res,
struct rpc_task *task);
extern int nfs4_sequence_done(struct rpc_task *task,
struct nfs4_sequence_res *res);
extern void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp);
extern int nfs4_proc_commit(struct file *dst, __u64 offset, __u32 count, struct nfs_commitres *res);
extern const nfs4_stateid zero_stateid;
extern const nfs4_stateid invalid_stateid;
/* nfs4super.c */
struct nfs_mount_info;
extern struct nfs_subversion nfs_v4;
extern bool nfs4_disable_idmapping;
extern unsigned short max_session_slots;
extern unsigned short max_session_cb_slots;
extern unsigned short send_implementation_id;
extern bool recover_lost_locks;
#define NFS4_CLIENT_ID_UNIQ_LEN (64)
extern char nfs4_client_id_uniquifier[NFS4_CLIENT_ID_UNIQ_LEN];
extern int nfs4_try_get_tree(struct fs_context *);
extern int nfs4_get_referral_tree(struct fs_context *);
/* nfs4sysctl.c */
#ifdef CONFIG_SYSCTL
int nfs4_register_sysctl(void);
void nfs4_unregister_sysctl(void);
#else
static inline int nfs4_register_sysctl(void)
{
return 0;
}
static inline void nfs4_unregister_sysctl(void)
{
}
#endif
/* nfs4xdr.c */
extern const struct rpc_procinfo nfs4_procedures[];
#ifdef CONFIG_NFS_V4_2
extern const u32 nfs42_maxsetxattr_overhead;
extern const u32 nfs42_maxgetxattr_overhead;
extern const u32 nfs42_maxlistxattrs_overhead;
#endif
struct nfs4_mount_data;
/* callback_xdr.c */
extern const struct svc_version nfs4_callback_version1;
extern const struct svc_version nfs4_callback_version4;
static inline void nfs4_stateid_copy(nfs4_stateid *dst, const nfs4_stateid *src)
{
memcpy(dst->data, src->data, sizeof(dst->data));
dst->type = src->type;
}
static inline bool nfs4_stateid_match(const nfs4_stateid *dst, const nfs4_stateid *src)
{
if (dst->type != src->type)
return false;
return memcmp(dst->data, src->data, sizeof(dst->data)) == 0;
}
static inline bool nfs4_stateid_match_other(const nfs4_stateid *dst, const nfs4_stateid *src)
{
return memcmp(dst->other, src->other, NFS4_STATEID_OTHER_SIZE) == 0;
}
static inline bool nfs4_stateid_is_newer(const nfs4_stateid *s1, const nfs4_stateid *s2)
{
return (s32)(be32_to_cpu(s1->seqid) - be32_to_cpu(s2->seqid)) > 0;
}
static inline bool nfs4_stateid_match_or_older(const nfs4_stateid *dst, const nfs4_stateid *src)
{
return nfs4_stateid_match_other(dst, src) &&
!(src->seqid && nfs4_stateid_is_newer(dst, src));
}
static inline void nfs4_stateid_seqid_inc(nfs4_stateid *s1)
{
u32 seqid = be32_to_cpu(s1->seqid);
if (++seqid == 0)
++seqid;
s1->seqid = cpu_to_be32(seqid);
}
static inline bool nfs4_valid_open_stateid(const struct nfs4_state *state)
{
return test_bit(NFS_STATE_RECOVERY_FAILED, &state->flags) == 0;
}
static inline bool nfs4_state_match_open_stateid_other(const struct nfs4_state *state,
const nfs4_stateid *stateid)
{
return test_bit(NFS_OPEN_STATE, &state->flags) &&
nfs4_stateid_match_other(&state->open_stateid, stateid);
}
/* nfs42xattr.c */
#ifdef CONFIG_NFS_V4_2
extern int __init nfs4_xattr_cache_init(void);
extern void nfs4_xattr_cache_exit(void);
extern void nfs4_xattr_cache_add(struct inode *inode, const char *name,
const char *buf, struct page **pages,
ssize_t buflen);
extern void nfs4_xattr_cache_remove(struct inode *inode, const char *name);
extern ssize_t nfs4_xattr_cache_get(struct inode *inode, const char *name,
char *buf, ssize_t buflen);
extern void nfs4_xattr_cache_set_list(struct inode *inode, const char *buf,
ssize_t buflen);
extern ssize_t nfs4_xattr_cache_list(struct inode *inode, char *buf,
ssize_t buflen);
extern void nfs4_xattr_cache_zap(struct inode *inode);
#else
static inline void nfs4_xattr_cache_zap(struct inode *inode)
{
}
#endif /* CONFIG_NFS_V4_2 */
#else /* CONFIG_NFS_V4 */
#define nfs4_close_state(a, b) do { } while (0)
#define nfs4_close_sync(a, b) do { } while (0)
#define nfs4_state_protect(a, b, c, d) do { } while (0)
#define nfs4_state_protect_write(a, b, c, d) do { } while (0)
#endif /* CONFIG_NFS_V4 */
#endif /* __LINUX_FS_NFS_NFS4_FS.H */
|
{
"pile_set_name": "Github"
}
|
# PUPPI DEPLOY INSTRUCTIONS
Documentation and examples related to the puppi actions: deploy, rollback and init
## SYNOPSIS (COMMAND LINE)
Shell command to launch a deploy:
puppi deploy <project_name>
puppi deploy <project_name> [-f] [-i] [-t] [-d yes|full] [-r yes|no|fail] [-p "parameter=value parameter2=value2"]
Shell command to launch a rollback:
puppi rollback <project_name>
Shell command to launch the first deploy:
puppi init <project_name>
## EXAMPLES (cli)
Deploy myapp with the standard logic/parameters defined in Puppet:
puppi deploy myapp
Deploy myapp and doesn't stop in case of Critical errors:
puppi deploy myapp -f
Deploy myapp in interactive mode. Confirmation is asked for each step
puppi deploy myapp -i
Test mode. Just show the commands that would be executed
puppi deploy myapp -t
Deploy myapp with full debugging output
puppi deploy myapp -d full
Deploy myapp in interactive mode and sets some custom options that override the standard Puppet params.
Note that these parameters change according to the script you use (and the scripts must honour this override in order to make this option work).
puppi deploy myapp -i -o "version=1.1 source_url=http://dev.example42.com/code/my_app/"
Make the first deploy of "myapp". Can be optional and may require a subsequent puppi deploy myapp
puppi init myapp
Rollback myapp to a previous archived state. User is asked to choose which deploy to override. Note that by default you have 5 backups to rollback from. Older backups are automatically removed.
puppi rollback myapp
Automatically rollback to the latest saved state (unattended).
puppi rollback myapp latest
## EXAMPLES (puppet)
Here follow some sample defines you can use out of the box in your manifests once you include puppi.
Get a war from $source and deploy it in $deploy_root:
puppi::project::war { 'myapp':
source => 'http://repo.example42.com/deploy/prod/myapp.war',
deploy_root => '/store/tomcat/myapp/webapps',
}
Get a tarball from $source, unpack it in $deploy_root, restart service called apache and send a mail
to $report_mail (you can have a comma separated list of destination addresses):
puppi::project::tar { 'mysite':
source => 'rsync://repo.example42.com/deploy/prod/release.tgz',
init_script => 'apache',
deploy_root => '/var/www/html/',
report_email => 'sysadmins@example42.com',
enable => 'true', # Redundant
}
Get a tarfile with a .sql query file and apply to to you local Mysql with the credentials provided:
puppi::project::mysql { 'myweb_sql':
source => 'http://repo.example42.com/deploy/prod/database.sql.gz',
mysql_user => 'myweb',
mysql_password => $secret::mysql_myweb_pw,
mysql_host => 'localhost',
mysql_database => 'myweb',
report_email => 'sysadmins@example42.com,dbadmins@example42.com',
enable => 'true',
}
Get a list of files from $source, retrieve the actual files from $source_baseurl and place them
in $deploy_root
puppi::project::files { 'gfxupdates':
source => 'http://deploy.example42.com/prod/website2/list.txt',
source_baseurl => 'http://design.example42.com/website2/gfx/',
deploy_root => '/var/www/html/gfx',
report_email => 'sysadmins@example42.com,designers@example42.com',
enable => 'true',
}
Deploy from a Nexus repository (retrieve maven-metadata.xml from dir specified in $source), get the war
(version is achieved from the "release" tag in the xml) and deploy it in $deploy_root and then restart tomcat.
puppi::project::maven { 'supersite':
source => 'http://nexus.example42.com/nexus/content/repositories/releases/it/example42/supersite/',
deploy_root => '/usr/local/tomcat/supersite/webapps',
init_script => 'tomcat',
report_email => 'sysadmins@example42.com',
enable => 'true',
}
Get the maven-metadata.xml from a Nexus repository and deploy:
- The release war in $deploy_root
- A configurations tarball tagged with the Maven qualifier $config_suffix in $config_root
- A static files tarball tagged with the Maven qualifier $document_suffix in $document_root
puppi::project::maven { 'supersite':
source => 'http://nexus.example42.com/nexus/content/repositories/releases/it/example42/supersite/',
deploy_root => '/usr/local/tomcat/supersite/webapps',
config_suffix => 'cfg',
config_root => '/srv/htdocs/supersite',
document_suffix => 'css',
document_root => '/srv/htdocs/supersite',
init_script => 'tomcat',
report_email => 'sysadmins@example42.com',
enable => 'true',
}
The same deploy Nexus repository with some more options:
- A Source dir to be used to deploy static files when issuing "puppi init supersite"
- A block from a loadbalancer IP (managing different sites addresess)
- Some more elaborate rsync exclusion rules
- A backup retention of 3 archives (instead of the default 5)
puppi::project::maven { 'supersite':
source => 'http://nexus.example42.com/nexus/content/repositories/releases/it/example42/supersite/',
deploy_root => '/usr/local/tomcat/supersite/webapps',
config_suffix => 'cfg',
config_root => '/srv/htdocs/supersite',
document_suffix => 'css',
document_root => '/srv/htdocs/supersite',
document_init_source => 'rsync://backup.example42.com/initdir/supersite/',
firewall_src_ip => $site ? {
dr => '192.168.101.1/30',
main => '192.168.1.1/30',
},
backup_rsync_options => '--exclude .snapshot --exclude /doc_root/autojs/*** --exclude /doc_root/autocss/*** --exclude /doc_root/xsl',
backup_retention => '3',
init_script => 'tomcat',
report_email => 'sysadmins@example42.com',
enable => 'true',
}
An elaborated war deploy:
- get from $source,
- execute /usr/local/bin/mychecks.sh as root before the deploy
(or better with sequence number 39)
- deploy to /data/tomcat/myapp/webapps as user pippo
- stop and start tomcat-myapp but also monit and puppet
- backup passing $backup_rsync_options to rsync:
puppi::project::war { 'myapp':
source => 'http://repo.example42.com/deploy/prod/myapp.war',
deploy_root => '/store/tomcat/myapp/webapps',
predeploy_customcommand => '/usr/local/bin/mychecks.sh',
predeploy_priority => '39',
predeploy_user => 'root',
backup_rsync_options => '--exclude logs/',
user => 'pippo',
init_script => 'tomcat-myapp',
deploy_root => '/data/tomcat/myapp/webapps',
report_email => 'sysadmins@example42.com',
disable_services => 'monit puppet',
}
An example of usage of the generic builder define to deploy a zip file, with an example custom
post deploy command executed as root (as all puppi commands, if not specified otherwise)
puppi::project::builder { 'cms':
source => 'http://repo.example42.com/deploy/cms/cms.zip',
source_type => 'zip',
user => 'root',
deploy_root => '/var/www',
postdeploy_customcommand => 'chown -R www-data /var/www/files',
postdeploy_user => 'root',
postdeploy_priority => '41',
report_email => 'sysadmins@example42.com',
enable => 'true',
}
These are just examples, possibilities are many, refer to the docs in puppi/manifests/project/*.pp
to have a full list of the available options.
## BASIC PUPPI DEFINES
The above puppi::projects defines manage more or less complex deployments procedures for different kind of projects. They are just samples of possible procedures and you may create your one ones, if the ones provided there don't fit your needs.
They will have to contain one or more of these basic puppi defines.
Create the main project structure. One or more different deployment projects can exist on a node.
puppi::project
Create a single command to be placed in the init sequence. It's not required for every project.
puppi::initialize
Create a single command to be placed in the deploy sequence. More than one is generally needed for each project.
puppi::deploy
Create a single command to be placed in the rollback sequence. More than one is generally needed for each project.
puppi::rollback
These defines have generally a standard structure and similar arguments.
Every one is reversable (enable => false) but you can wipe out the whole /etc/puppi directory
to have it rebuilt from scratch. Here is an example for a single deploy command:
puppi::deploy { 'Retrieve files': # The $name of the define is used in the file name
command => 'get_curl.sh', # The name of the general-use script to use
argument => 'file:///storage/file', # The argument(s) passed to the above script
priority => '10', # Lower priority scripts are executed first
user => 'root', # As what user we run the script
project => 'my-web.app', # The name of the project to use
}
This define creates a file named:
/etc/puppi/projects/${project}/deploy/${priority}-${name}
Its content is, simply:
su - ${user} -c "export project=${project} && /etc/puppi/scripts/${command} ${arguments}"
## DEPLOY PROCEDURES DEFINES
The puppi module provides some examples of deploy workflows they are in the puppi/manifests/project
directory and contain simple to use defines that contain one puppi::project and several puppi::deploy and
puppi::rollback defines to design a specific workflow using the builtin commands present in
puppi/files/scripts.
Note that if you need to design your own deploy procedure you have different options:
- Verify if you can reuse the existing ones, using optional arguments as pre/postdeploy_commands
- Use the existing ones as a base to make you own custom defines, reusing parts of their logic
and the builtin commands (puppi/files/scripts/*) they use
- Write your own commands (in whatever language) and integrate them in your own procedure.
Here follow the main and most reusable deploy workflows defines available in puppi/manifests/project/.
The have generally a set of common arguments that make you manage if to stop and restart specific
services, if you want to isolate your server from a loadbalancer during the deploy procedure, what to backup,
how many backup copies to mantain, if to send a report mail to specific addresses and if you need
to run custom commands during the standard procedure.
For all of the you have to specify a source from where to get the source files (http/ftp/rsync/file..)
a directory where to place them and the user that has to own the deploy files.
Full documentation is available in the relevant .pp files
- puppi::project::tar - Use this to retrieve and deploy a simple tar file
- puppi::project::war - Use this to retrieve and deploy a war
- puppi::project::files - Use this to deploy one or more files based on a provided list
- puppi::project::dir - Use this to syncronize a remote directory to a local deploy one
- puppi::project::mysql - Use this to retrive and apply a .sql file for mysql schema updates
- puppi::project::maven - Use this to deploy war and tar files generated via Maven released on Nexus or similar. A good source of Open Source Java artifacts is http://www.artifact-repository.org/
- puppi::project::builder - This is a general purpose define that incorporates most the of cases provided by the above procedures
## BUILTIN COMMANDS
The puppi/files/scripts directory in the module contains some general usage "native" bash scripts
that can be used in custom deployments. They are generally made to work together according to a
specific logic, which is at the base of the deploy procedures defines in puppi/manifests/project/
but you're free to write your own scripts, in whatever language, according to your needs.
The default scripts are engineered to follow these steps for a deployment:
- Remote files are downloaded in /tmp/puppi/$project/store or directly in the predeploy
directory: /tmp/puppi/$project/deploy
- If necessary the downloaded files are expanded in one or more predeploy directories
(default:/tmp/puppi/$project/deploy).
- Runtime configuration entries might be saved in /tmp/puppi/$project/config
- Files are eventually backed from the deploy directory (Apache' docroot, Tomcat webapps or whatever)
to the archive directory (/var/lib/puppi/archive/$project). Older backups are deleted (by default
there's a retention of 5 backups).
- Files are copied from the predeploy directory to the deploy dir.
- Relevant services are eventually stopped and started
The most used common scripts are (they might have different arguments, some of them are quite simple):
- get_file.sh - Retrieves a file via ssh/http/rsync/svn and places it in a temp dir (store or predeploy)
- deploy.sh - Copies the files in the predeploy dir to deploy dir
- archive.sh - Backups and restores files in deploy dir
- service.sh - Stops or starts one or more services
- wait.sh - Waits for the presence or absence of a file, for the presence of a string in a file or a defined number or seconds.
- get_metadata.sh - Extracts metadata from various sources in order to provide info to other scripts. These info are save in the Runtime configuration file (/tmp/puppi/$project/config)
- report_mail.sh - Sends a mail with the report of the operations done
General functions, used by both the puppi command and these scripts, are in puppi/files/scripts/functions
|
{
"pile_set_name": "Github"
}
|
#include <SPI.h>
#include <Ethernet.h>
#include <Client.h>
#define PORT 40101
byte buf[10];
word chksum = 0;
word rxchksum;
byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x44, 0xF0 };
byte ip[] = {192,168,0,150};
byte gateway[] = {192,168,0,1};
byte server[] = {192,168,0,157}; //{78,109,85,94};
byte subnet[] = { 255, 255, 255, 0 };
Client client(server, PORT);
char buffer[50];
long debounceDelay = 2000;
long lastDebounceTime = 0;
int SwitchPrevious = 9;
int sentPacket = 0;
void setup()
{
pinMode(9, INPUT);
digitalWrite(9, HIGH); // turns on pull-up resistor after input
pinMode(10, INPUT);
digitalWrite(10, HIGH); // turns on pull-up resistor after input
pinMode(11, INPUT);
digitalWrite(11, HIGH); // turns on pull-up resistor after input
Serial.begin(9600);
Ethernet.begin(mac, ip); //, gateway,subnet);
}
void loop()
{
if (SwitchPrevious!=9) {
if (digitalRead(9) == LOW ) {
SwitchPrevious = 9;
Serial.println("Sending packet OFF ...");
joshPost("off",10);
}
}
if (SwitchPrevious!=10) {
if (digitalRead(10) == LOW) {
SwitchPrevious = 10;
Serial.println("Sending packet ON ...");
joshPost("on",10);
}
}
if (lastDebounceTime+debounceDelay<millis()) {
if (digitalRead(11) == LOW) {
lastDebounceTime = millis();
Serial.println("Sending packet NEXT ...");
joshPost("next",10);
}
}
}
int joshPost(String cmd, int retries)
{
Serial.println("retry");
Serial.println(retries);
if (client.connect())
{
//sprintf(buffer,"{\"event\" : \"%x\"}",1);
//buffer =
client.print("POST /message");
client.print(" HTTP/1.1\nHost: ");
client.println("joshfire.com"); //change
client.println("Content-Type:application/json");
client.print("Content-Length: ");
client.println(cmd.length(),DEC); //buffer),DEC);
client.println();
client.println(cmd); //buffer);
client.println();
sentPacket=1;
long timeRef = millis();
while(client.available()<1)
{
if ((millis() - timeRef) > 5000)
{
client.stop();
return -1;
}
}
while(client.available()>0)
{
Serial.print(client.read(),BYTE);
}
client.stop();
return 1;
}
else
{
if (retries>0) {
delay(200);
joshPost(cmd,retries-1);
} else {
return -1;
}
}
}
|
{
"pile_set_name": "Github"
}
|
crlf
crlf
lf
crlf
crlf
|
{
"pile_set_name": "Github"
}
|
BlueWallet - ארנק ביטקוין
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SemVerInfo - FAKE - F# Make</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull">
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" />
<script type="text/javascript" src="http://fsharp.github.io/FAKE/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="http://fsharp.org">fsharp.org</a></li>
<li><a href="http://github.com/fsharp/fake">github page</a></li>
</ul>
<h3 class="muted"><a href="http://fsharp.github.io/FAKE/index.html">FAKE - F# Make</a></h3>
</div>
<hr />
<div class="row">
<div class="span9" id="main">
<h1>SemVerInfo</h1>
<div class="xmldoc">
<p>Contains the version information.</p>
</div>
<h3>Record Fields</h3>
<table class="table table-bordered member-list">
<thead>
<tr><td>Record Field</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1467', 1467)" onmouseover="showTip(event, '1467', 1467)">
Build
</code>
<div class="tip" id="1467">
<strong>Signature:</strong> string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L43-43" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>The optional build no.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1468', 1468)" onmouseover="showTip(event, '1468', 1468)">
Major
</code>
<div class="tip" id="1468">
<strong>Signature:</strong> int<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L35-35" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>MAJOR version when you make incompatible API changes.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1469', 1469)" onmouseover="showTip(event, '1469', 1469)">
Minor
</code>
<div class="tip" id="1469">
<strong>Signature:</strong> int<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L37-37" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>MINOR version when you add functionality in a backwards-compatible manner.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1470', 1470)" onmouseover="showTip(event, '1470', 1470)">
Patch
</code>
<div class="tip" id="1470">
<strong>Signature:</strong> int<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L39-39" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>PATCH version when you make backwards-compatible bug fixes.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1471', 1471)" onmouseover="showTip(event, '1471', 1471)">
PreRelease
</code>
<div class="tip" id="1471">
<strong>Signature:</strong> PreRelease option<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L41-41" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>The optional PreRelease version</p>
</td>
</tr>
</tbody>
</table>
<h3>Instance members</h3>
<table class="table table-bordered member-list">
<thead>
<tr><td>Instance member</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1472', 1472)" onmouseover="showTip(event, '1472', 1472)">
Equals(yobj)
</code>
<div class="tip" id="1472">
<strong>Signature:</strong> yobj:obj -> bool<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L52-52" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1473', 1473)" onmouseover="showTip(event, '1473', 1473)">
GetHashCode()
</code>
<div class="tip" id="1473">
<strong>Signature:</strong> unit -> int<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L59-59" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1474', 1474)" onmouseover="showTip(event, '1474', 1474)">
ToString()
</code>
<div class="tip" id="1474">
<strong>Signature:</strong> unit -> string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/SemVerHelper.fs#L44-44" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="span3">
<a href="http://fsharp.github.io/FAKE/index.html">
<img src="http://fsharp.github.io/FAKE/pics/logo.png" style="width:140px;height:140px;margin:10px 0px 0px 35px;border-style:none;" />
</a>
<ul class="nav nav-list" id="menu">
<li class="nav-header">FAKE - F# Make</li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/index.html">Home page</a></li>
<li class="divider"></li>
<li><a href="https://www.nuget.org/packages/FAKE">Get FAKE - F# Make via NuGet</a></li>
<li><a href="http://github.com/fsharp/fake">Source Code on GitHub</a></li>
<li><a href="http://github.com/fsharp/fake/blob/master/License.txt">License (Apache 2)</a></li>
<li><a href="http://fsharp.github.io/FAKE/RELEASE_NOTES.html">Release Notes</a></li>
<li><a href="http://fsharp.github.io/FAKE//contributing.html">Contributing to FAKE - F# Make</a></li>
<li><a href="http://fsharp.github.io/FAKE/users.html">Who is using FAKE?</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/f%23-fake">Ask a question</a></li>
<li class="nav-header">Tutorials</li>
<li><a href="http://fsharp.github.io/FAKE/gettingstarted.html">Getting started</a></li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/nuget.html">NuGet package restore</a></li>
<li><a href="http://fsharp.github.io/FAKE/fxcop.html">Using FxCop in a build</a></li>
<li><a href="http://fsharp.github.io/FAKE/assemblyinfo.html">Generating AssemblyInfo</a></li>
<li><a href="http://fsharp.github.io/FAKE/create-nuget-package.html">Create NuGet packages</a></li>
<li><a href="http://fsharp.github.io/FAKE/specifictargets.html">Running specific targets</a></li>
<li><a href="http://fsharp.github.io/FAKE/commandline.html">Running FAKE from command line</a></li>
<li><a href="http://fsharp.github.io/FAKE/fsc.html">Using the F# compiler from FAKE</a></li>
<li><a href="http://fsharp.github.io/FAKE/customtasks.html">Creating custom tasks</a></li>
<li><a href="http://fsharp.github.io/FAKE/teamcity.html">TeamCity integration</a></li>
<li><a href="http://fsharp.github.io/FAKE/canopy.html">Running canopy tests</a></li>
<li><a href="http://fsharp.github.io/FAKE/octopusdeploy.html">Octopus Deploy</a></li>
<li><a href="http://fsharp.github.io/FAKE/typescript.html">TypeScript support</a></li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/deploy.html">Fake.Deploy</a></li>
<li class="nav-header">Reference</li>
<li><a href="http://fsharp.github.io/FAKE/apidocs/index.html">API Reference</a></li>
</ul>
</div>
</div>
</div>
<a href="http://github.com/fsharp/fake"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
-- 2,$<awk -f gensources.awk src/ncurses/modules
return {
base={
'ncurses/tty/hardscroll.c',
'ncurses/tty/hashmap.c',
'ncurses/base/lib_addch.c',
'ncurses/base/lib_addstr.c',
'ncurses/base/lib_beep.c',
'ncurses/base/lib_bkgd.c',
'ncurses/base/lib_box.c',
'ncurses/base/lib_chgat.c',
'ncurses/base/lib_clear.c',
'ncurses/base/lib_clearok.c',
'ncurses/base/lib_clrbot.c',
'ncurses/base/lib_clreol.c',
'ncurses/base/lib_color.c',
'ncurses/base/lib_colorset.c',
'ncurses/base/lib_delch.c',
'ncurses/base/lib_delwin.c',
'ncurses/base/lib_echo.c',
'ncurses/base/lib_endwin.c',
'ncurses/base/lib_erase.c',
'ncurses/base/lib_flash.c',
'ncurses/base/lib_getch.c',
'ncurses/base/lib_getstr.c',
'ncurses/base/lib_hline.c',
'ncurses/base/lib_immedok.c',
'ncurses/base/lib_inchstr.c',
'ncurses/base/lib_initscr.c',
'ncurses/base/lib_insch.c',
'ncurses/base/lib_insdel.c',
'ncurses/base/lib_insnstr.c',
'ncurses/base/lib_instr.c',
'ncurses/base/lib_isendwin.c',
'ncurses/base/lib_leaveok.c',
'ncurses/base/lib_mouse.c',
'ncurses/base/lib_move.c',
'ncurses/tty/lib_mvcur.c',
'ncurses/base/lib_mvwin.c',
'ncurses/base/lib_newterm.c',
'ncurses/base/lib_newwin.c',
'ncurses/base/lib_nl.c',
'ncurses/base/lib_overlay.c',
'ncurses/base/lib_pad.c',
'ncurses/base/lib_printw.c',
'ncurses/base/lib_redrawln.c',
'ncurses/base/lib_refresh.c',
'ncurses/base/lib_restart.c',
'ncurses/base/lib_scanw.c',
'ncurses/base/lib_screen.c',
'ncurses/base/lib_scroll.c',
'ncurses/base/lib_scrollok.c',
'ncurses/base/lib_scrreg.c',
'ncurses/base/lib_set_term.c',
'ncurses/base/lib_slk.c',
'ncurses/base/lib_slkatr_set.c',
'ncurses/base/lib_slkatrof.c',
'ncurses/base/lib_slkatron.c',
'ncurses/base/lib_slkatrset.c',
'ncurses/base/lib_slkattr.c',
'ncurses/base/lib_slkclear.c',
'ncurses/base/lib_slkcolor.c',
'ncurses/base/lib_slkinit.c',
'ncurses/base/lib_slklab.c',
'ncurses/base/lib_slkrefr.c',
'ncurses/base/lib_slkset.c',
'ncurses/base/lib_slktouch.c',
'ncurses/base/lib_touch.c',
'ncurses/trace/lib_tracedmp.c',
'ncurses/trace/lib_tracemse.c',
'ncurses/tty/lib_tstp.c',
'ncurses/base/lib_ungetch.c',
'ncurses/tty/lib_vidattr.c',
'ncurses/base/lib_vline.c',
'ncurses/base/lib_wattroff.c',
'ncurses/base/lib_wattron.c',
'ncurses/base/lib_winch.c',
'ncurses/base/lib_window.c',
'ncurses/base/nc_panel.c',
'ncurses/base/safe_sprintf.c',
'ncurses/tty/tty_update.c',
'ncurses/trace/varargs.c',
'ncurses/base/vsscanf.c',
'ncurses/base/lib_freeall.c',
},
widechar={
'ncurses/widechar/charable.c',
'ncurses/widechar/lib_add_wch.c',
'ncurses/widechar/lib_box_set.c',
'ncurses/widechar/lib_cchar.c',
'ncurses/widechar/lib_erasewchar.c',
'ncurses/widechar/lib_get_wch.c',
'ncurses/widechar/lib_get_wstr.c',
'ncurses/widechar/lib_hline_set.c',
'ncurses/widechar/lib_in_wch.c',
'ncurses/widechar/lib_in_wchnstr.c',
'ncurses/widechar/lib_ins_wch.c',
'ncurses/widechar/lib_inwstr.c',
'ncurses/widechar/lib_key_name.c',
'ncurses/widechar/lib_pecho_wchar.c',
'ncurses/widechar/lib_slk_wset.c',
'ncurses/widechar/lib_unget_wch.c',
'ncurses/widechar/lib_vid_attr.c',
'ncurses/widechar/lib_vline_set.c',
'ncurses/widechar/lib_wacs.c',
'ncurses/widechar/lib_wunctrl.c',
},
ext_funcs={
'ncurses/base/legacy_coding.c',
'ncurses/base/lib_dft_fgbg.c',
'ncurses/tinfo/lib_print.c',
'ncurses/base/new_pair.c',
'ncurses/base/resizeterm.c',
'ncurses/trace/trace_xnames.c',
'ncurses/tinfo/use_screen.c',
'ncurses/base/use_window.c',
'ncurses/base/wresize.c',
},
termlib={
'ncurses/tinfo/access.c',
'ncurses/tinfo/add_tries.c',
'ncurses/tinfo/alloc_ttype.c',
'$outdir/codes.c',
'$outdir/comp_captab.c',
'ncurses/tinfo/comp_error.c',
'ncurses/tinfo/comp_hash.c',
'$outdir/comp_userdefs.c',
'ncurses/tinfo/db_iterator.c',
'ncurses/tinfo/doalloc.c',
'ncurses/tinfo/entries.c',
'$outdir/fallback.c',
'ncurses/tinfo/free_ttype.c',
'ncurses/tinfo/getenv_num.c',
'ncurses/tinfo/home_terminfo.c',
'ncurses/tinfo/init_keytry.c',
'ncurses/tinfo/lib_acs.c',
'ncurses/tinfo/lib_baudrate.c',
'ncurses/tinfo/lib_cur_term.c',
'ncurses/tinfo/lib_data.c',
'ncurses/tinfo/lib_has_cap.c',
'ncurses/tinfo/lib_kernel.c',
'$outdir/lib_keyname.c',
'ncurses/tinfo/lib_longname.c',
'ncurses/tinfo/lib_napms.c',
'ncurses/tinfo/lib_options.c',
'ncurses/tinfo/lib_raw.c',
'ncurses/tinfo/lib_setup.c',
'ncurses/tinfo/lib_termcap.c',
'ncurses/tinfo/lib_termname.c',
'ncurses/tinfo/lib_tgoto.c',
'ncurses/tinfo/lib_ti.c',
'ncurses/tinfo/lib_tparm.c',
'ncurses/tinfo/lib_tputs.c',
'ncurses/trace/lib_trace.c',
'ncurses/trace/lib_traceatr.c',
'ncurses/trace/lib_tracebits.c',
'ncurses/trace/lib_tracechr.c',
'ncurses/tinfo/lib_ttyflags.c',
'ncurses/tty/lib_twait.c',
'ncurses/tinfo/name_match.c',
'$outdir/names.c',
'ncurses/tinfo/obsolete.c',
'ncurses/tinfo/read_entry.c',
'ncurses/tinfo/read_termcap.c',
'ncurses/tinfo/strings.c',
'ncurses/trace/trace_buf.c',
'ncurses/trace/trace_tries.c',
'ncurses/base/tries.c',
'ncurses/tinfo/trim_sgr0.c',
'$outdir/unctrl.c',
'ncurses/trace/visbuf.c',
},
ticlib={
'ncurses/tinfo/alloc_entry.c',
'ncurses/tinfo/captoinfo.c',
'ncurses/tinfo/comp_expand.c',
'ncurses/tinfo/comp_parse.c',
'ncurses/tinfo/comp_scan.c',
'ncurses/tinfo/parse_entry.c',
'ncurses/tinfo/write_entry.c',
},
ext_tinfo={
'ncurses/base/define_key.c',
'ncurses/tinfo/hashed_db.c',
'ncurses/base/key_defined.c',
'ncurses/base/keybound.c',
'ncurses/base/keyok.c',
'ncurses/base/version.c',
},
port_drivers={
'ncurses/base/lib_driver.c',
},
port_win32con={
'ncurses/win32con/gettimeofday.c',
'ncurses/win32con/wcwidth.c',
'ncurses/widechar/widechars.c',
'ncurses/win32con/win_driver.c',
},
port_tinfo={
'ncurses/tinfo/tinfo_driver.c',
},
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.MainActivity"
android:fitsSystemWindows="true"
>
<android.support.v7.widget.Toolbar
xmlns:toolbar="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
toolbar:titleTextAppearance="@style/MP.Theme.TextAppearance.Light.Toolbar.Title"
toolbar:title="@string/mp.app.name"
>
<include layout="@layout/layout_main_custom_toolbar"/>
</android.support.v7.widget.Toolbar>
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_below="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
|
{
"pile_set_name": "Github"
}
|
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Information about GXF files
// SMPTE 360M - General Exchange Format
// SMPTE RDD 14-2007 - General Exchange Format-2
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//---------------------------------------------------------------------------
#ifndef MediaInfo_File_Gxf_TimeCodeH
#define MediaInfo_File_Gxf_TimeCodeH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
#if defined(MEDIAINFO_ANCILLARY_YES)
#include <MediaInfo/Multiple/File_Ancillary.h>
#endif //defined(MEDIAINFO_ANCILLARY_YES)
#include "MediaInfo/TimeCode.h"
//---------------------------------------------------------------------------
namespace MediaInfoLib
{
//***************************************************************************
// Class File_Gxf_TimeCode
//***************************************************************************
class File_Gxf_TimeCode : public File__Analyze
{
public :
//In
int32u FrameRate_Code;
int32u FieldsPerFrame_Code;
bool IsAtc; // SMPTE ST 12-2
//Out
int64u TimeCode_FirstFrame_ms;
string TimeCode_FirstFrame;
string Settings;
//Constructor/Destructor
File_Gxf_TimeCode();
~File_Gxf_TimeCode();
private :
//Streams management
void Streams_Fill();
//Buffer - Global
void Read_Buffer_Continue ();
};
} //NameSpace
#endif
|
{
"pile_set_name": "Github"
}
|
Job dvb_ir started on silenziosa at Wed Apr 9 22:30:57 2014
jobid: silenziosa-0-53460261
+--------------------------------------------------------------------+
| Jaguar version 8.3, release 13 |
| |
| Copyright Schrodinger, Inc. |
| All Rights Reserved. |
| |
| The following have contributed to Jaguar (listed alphabetically): |
| Mike Beachy, Art Bochevarov, Dale Braden, Yixiang Cao, |
| Chris Cortis, Rich Friesner, Bill Goddard, Hod Greeley, |
| Tom Hughes, Jean-Marc Langlois, Daniel Mainz, Rob Murphy, |
| Dean Philipp, Tom Pollard, Murco Ringnalda. |
| |
| Use of this program should be acknowledged in publications as: |
| |
| Jaguar, version 8.3, Schrodinger, Inc., New York, NY, 2014. |
| |
| A. D. Bochevarov, E. Harder, T. F. Hughes, J. R. Greenwood, |
| D. A. Braden, D. M. Philipp, D. Rinaldo, M. D. Halls, |
| J. Zhang, R. A. Friesner, "Jaguar: A High-Performance Quantum |
| Chemistry Software Program with Strengths in Life and Materials |
| Sciences", Int. J. Quantum Chem., 2013, 113(18), 2110-2142. |
+--------------------------------------------------------------------+
start of program pre
Job name: dvb_ir
Executables used: /usr/local/lib/schrodinger2014-1/jaguar-v83013/bin/Linux-x86_64
Temporary files : /home/kml/dvb_ir
Maestro file (input): dvb_ir.mae
Maestro file (output): dvb_ir.01.mae
basis set: sto-3g
net molecular charge: 0
multiplicity: 1
number of basis functions.... 60
no dealiasing set available for atom 1
switch to all-analytic calculation
Input geometry:
angstroms
atom x y z
C1 -0.0758150000 0.0000000000 0.0269380000
C2 -0.0045600000 0.0000000000 1.4463040000
C3 1.2336810000 0.0000000000 2.1042190000
C4 2.4572420000 0.0000000000 1.3787840000
C5 2.3859860000 0.0000000000 -0.0405820000
H6 -0.9288540000 0.0000000000 2.0382910000
H7 1.2652340000 0.0000000000 3.2024280000
H8 3.3102810000 0.0000000000 -0.6325690000
C9 3.7520430000 0.0000000000 2.1313240000
C10 4.9872240000 0.0000000000 1.6008690000
H11 5.1663340000 0.0000000000 0.5196130000
H12 3.6421500000 0.0000000000 3.2262300000
H13 5.8793430000 0.0000000000 2.2379240000
C14 -1.3706160000 0.0000000000 -0.7256020000
H15 -1.2607230000 0.0000000000 -1.8205080000
C16 -2.6057970000 0.0000000000 -0.1951460000
H17 -2.7849070000 0.0000000000 0.8861090000
H18 -3.4979160000 0.0000000000 -0.8322020000
C19 1.1477460000 0.0000000000 -0.6984970000
H20 1.1161930000 0.0000000000 -1.7967060000
principal moments of inertia:
amu*angstrom^2: 109.23592 737.84463 847.08055
g*cm^2: 1.81390497E-38 1.22521968E-37 1.40661017E-37
rotational constants:
cm^(-1): 0.15432312 0.02284713 0.01990086
GHz: 4.62649088 0.68493960 0.59661269
Molecular weight: 130.08 amu
Stoichiometry: C10H10
Molecular Point Group: C2h
Molecule translated to center of mass
Molecule reoriented along symmetry axes
Point Group used: C2h
Symmetrized geometry:
angstroms
atom x y z
C1 1.2665285000 0.6759230000 0.0000000000
C2 1.1952730000 -0.7434430000 0.0000000000
C3 -0.0429675000 -1.4013580000 0.0000000000
C4 -1.2665285000 -0.6759230000 0.0000000000
C5 -1.1952730000 0.7434430000 0.0000000000
H6 2.1195675000 -1.3354300000 0.0000000000
H7 -0.0745205000 -2.4995670000 0.0000000000
H8 -2.1195675000 1.3354300000 0.0000000000
C9 -2.5613295000 -1.4284630000 0.0000000000
C10 -3.7965105000 -0.8980075000 0.0000000000
H11 -3.9756205000 0.1832480000 0.0000000000
H12 -2.4514365000 -2.5233690000 0.0000000000
H13 -4.6886295000 -1.5350630000 0.0000000000
C14 2.5613295000 1.4284630000 0.0000000000
H15 2.4514365000 2.5233690000 0.0000000000
C16 3.7965105000 0.8980075000 0.0000000000
H17 3.9756205000 -0.1832480000 0.0000000000
H18 4.6886295000 1.5350630000 0.0000000000
C19 0.0429675000 1.4013580000 0.0000000000
H20 0.0745205000 2.4995670000 0.0000000000
nuclear repulsion energy....... 445.899321568 hartrees
Non-default options chosen:
SCF calculation type: DFT(b3lyp)
DFT=Becke_3_Parameter/HF+Slater+Becke88+VWN+LYP (B3LYP)
Vibrational frequencies and related properties will be computed
from analytic second derivatives
IR intensities will be computed
Temporary integer options set:
73= 2
Peak memory usage: 479 Mb
end of program pre
Time(pre) user: 0.0 user+sys: 0.0 wallclock: 0.1
start of program onee
smallest eigenvalue of S: 1.814E-01
number of canonical orbitals..... 60
Peak memory usage: 621 Mb
end of program onee
Time(onee) user: 0.0 user+sys: 0.0 wallclock: 0.1
start of program hfig
initial wavefunction generated automatically from atomic wavefunctions
Irreducible Total no No of occupied orbitals
representation orbitals Shell_1 Shell_2 ...
Ag 25 15
Bg 5 3
Au 5 2
Bu 25 15
------------------------
Orbital occupation/shell 1.000
Peak memory usage: 561 Mb
end of program hfig
Time(hfig) user: 0.0 user+sys: 0.0 wallclock: 0.3
start of program probe
Peak memory usage: 560 Mb
end of program probe
Time(probe) user: 0.0 user+sys: 0.0 wallclock: 0.1
start of program grid
grid grid set grid # grid sym
------ -------- ------ --------
coarse 0 0 1
medium 0 0 1
fine 0 0 1
ultrafine 0 0 1
charge 0 0 1
gradient 0 0 1
density 0 0 1
DFT-fine -11 1 4
DFT-med. -10 2 4
DFT-grad -12 3 4
DFT-der2 -8 4 4
DFT-cphf -9 5 4
LMP2-enrg 0 0 1
LMP2-grad 0 0 1
DFT-cphf2 -15 6 4
PBF-dens 0 0 1
plotting 0 0 1
number of gridpoints:
atom C1 C2 C3 C4 C5 H6 H7
grid # 1 2430 2430 0 0 0 2430 0
grid # 2 756 756 0 0 0 756 0
grid # 3 3001 3001 0 0 0 3001 0
grid # 4 6859 6859 0 0 0 7413 0
grid # 5 426 426 0 0 0 464 0
grid # 6 229 229 0 0 0 245 0
number of gridpoints:
atom H8 C9 C10 H11 H12 H13 C14
grid # 1 0 0 0 0 0 0 2430
grid # 2 0 0 0 0 0 0 756
grid # 3 0 0 0 0 0 0 3001
grid # 4 0 0 0 0 0 0 6859
grid # 5 0 0 0 0 0 0 426
grid # 6 0 0 0 0 0 0 229
number of gridpoints:
atom H15 C16 H17 H18 C19 H20 total
grid # 1 2430 2430 2430 2430 2430 2430 24300
grid # 2 756 756 756 756 756 756 7560
grid # 3 3001 3001 3001 3001 3001 3001 30010
grid # 4 7413 6859 7413 7413 6859 7413 71360
grid # 5 464 426 464 464 426 464 4450
grid # 6 245 229 245 245 229 245 2370
Peak memory usage: 602 Mb
end of program grid
Time(grid) user: 1.0 user+sys: 1.0 wallclock: 1.1
start of program scf
number of electrons.......... 70
number of alpha electrons.... 35
number of beta electrons..... 35
number of orbitals, total.... 60
number of doubly-occ'd orbs.. 35
number of open shell orbs.... 0
number of occupied orbitals.. 35
number of virtual orbitals... 25
number of hamiltonians....... 1
number of shells............. 1
SCF type: DFT=Becke_3_Parameter/HF+Slater+Becke88+VWN+LYP (B3LYP)
i u d i g
t p i c r RMS maximum
e d i u i energy density DIIS
r t s t d total energy change change error
etot 1 N N 0 N -382.08746979809 2.3E-03 1.4E-01
etot 2 Y Y 0 N -382.27478842121 1.9E-01 1.4E-03 5.7E-02
etot 3 N Y 0 N -382.30452299795 3.0E-02 4.8E-04 1.1E-02
etot 4 Y Y 0 N -382.30785277442 3.3E-03 1.3E-04 5.1E-03
etot 5 Y Y 0 N -382.30826743146 4.1E-04 1.2E-05 2.3E-04
etot 6 N Y 0 N -382.30825840661 -9.0E-06 3.6E-06 1.6E-04
etot 7 N N 0 N -382.30825874596 3.4E-07 0.0E+00 0.0E+00
Energy components, in hartrees:
(A) Nuclear repulsion............ 445.89932156785
(E) Total one-electron terms..... -1400.56642382519
(I) Total two-electron terms..... 572.35884351138
(J) Coulomb.................... 630.20249050268
(K) Exchange+Correlation....... -57.84364699130
(L) Electronic energy............ -828.20758031381 (E+I)
(N) Total energy................. -382.30825874596 (A+L)
SCFE: SCF energy: DFT(b3lyp) -382.30825874596 hartrees iterations: 7
HOMO energy: -0.15309
LUMO energy: 0.03742
Orbital energies (hartrees)/symmetry label:
-10.02029 Bu -10.02024 Ag -10.00820 Bu -10.00820 Ag
-10.00679 Bu -10.00679 Ag -10.00610 Bu -10.00595 Ag
-9.99219 Bu -9.99219 Ag -0.80955 Ag -0.75400 Bu
-0.71796 Ag -0.69981 Bu -0.66751 Bu -0.58871 Ag
-0.55895 Ag -0.53167 Bu -0.51018 Ag -0.45746 Ag
-0.43937 Bu -0.41061 Bu -0.39796 Bu -0.39605 Ag
-0.37399 Bu -0.35116 Bu -0.34729 Ag -0.32455 Au
-0.31126 Bu -0.29281 Ag -0.28749 Ag -0.26357 Bg
-0.21244 Au -0.19508 Bg -0.15309 Bg 0.03742 Au
0.09034 Au 0.11062 Bg 0.18218 Au 0.27249 Bg
0.33221 Ag 0.34072 Bu 0.37934 Bu 0.38145 Ag
0.41098 Ag
Peak memory usage: 654 Mb
end of program scf
Time(scf) user: 3.0 user+sys: 3.0 wallclock: 3.9
start of program cutabab2
Peak memory usage: 577 Mb
end of program cutabab2
Time(cutabab2) user: 0.0 user+sys: 0.0 wallclock: 0.1
start of program der2a
Peak memory usage: 621 Mb
end of program der2a
Time(der2a) user: 0.0 user+sys: 0.0 wallclock: 0.3
start of program grid
Turning symmetry off because some of the
following programs cannot use it.
grid grid set grid # grid sym
------ -------- ------ --------
coarse 0 0 1
medium 0 0 1
fine 0 0 1
ultrafine 0 0 1
charge 0 0 1
gradient 0 0 1
density 0 0 1
DFT-fine -11 1 4
DFT-med. -10 2 4
DFT-grad -12 3 4
DFT-der2 -8 4 4
DFT-cphf -9 5 4
LMP2-enrg 0 0 1
LMP2-grad 0 0 1
DFT-cphf2 -15 6 4
PBF-dens 0 0 1
plotting 0 0 1
number of gridpoints:
atom C1 C2 C3 C4 C5 H6 H7
grid # 1 4304 4304 4304 4304 4304 4304 4304
grid # 2 1192 1192 1192 1192 1192 1192 1192
grid # 3 5226 5226 5226 5226 5226 5226 5226
grid # 4 12650 12650 12650 12650 12650 13718 13718
grid # 5 688 688 688 688 688 744 744
grid # 6 358 358 358 358 358 382 382
number of gridpoints:
atom H8 C9 C10 H11 H12 H13 C14
grid # 1 4304 4304 4304 4304 4304 4304 4304
grid # 2 1192 1192 1192 1192 1192 1192 1192
grid # 3 5226 5226 5226 5226 5226 5226 5226
grid # 4 13718 12650 12650 13718 13718 13718 12650
grid # 5 744 688 688 744 744 744 688
grid # 6 382 358 358 382 382 382 358
number of gridpoints:
atom H15 C16 H17 H18 C19 H20 total
grid # 1 4304 4304 4304 4304 4304 4304 86080
grid # 2 1192 1192 1192 1192 1192 1192 23840
grid # 3 5226 5226 5226 5226 5226 5226 104520
grid # 4 13718 12650 13718 13718 12650 13718 263680
grid # 5 744 688 744 744 688 744 14320
grid # 6 382 358 382 382 358 382 7400
Peak memory usage: 602 Mb
end of program grid
Time(grid) user: 3.0 user+sys: 3.0 wallclock: 3.6
start of program der2b
Peak memory usage: 778 Mb
end of program der2b
Time(der2b) user: 18.0 user+sys: 18.0 wallclock: 19.0
start of program der2nda
Peak memory usage: 621 Mb
end of program der2nda
Time(der2nda) user: 0.0 user+sys: 0.0 wallclock: 0.2
start of program der2ndb
Peak memory usage: 593 Mb
end of program der2ndb
Time(der2ndb) user: 45.0 user+sys: 45.0 wallclock: 46.1
start of program cphfa
1 vectors produced in CPHF
v i j k i g
e t c c c r
c e o o u i
t r r r t d RMS
1 1 5 2 0 N 2.5E-02
1 2 5 2 0 N 1.2E-03
1 3 5 2 0 N 3.8E-04
1 4 5 2 0 N 1.6E-04
1 5 5 2 0 N 3.3E-05
Atomic Polar Tensors (au): Total
=========================
APT for atom C1
--------------------------------------
0.1742 0.1088 0.0000
0.0367 -0.1377 0.0000
0.0000 0.0000 0.0275
--------------------------------------
APT for atom C2
--------------------------------------
-0.0440 -0.1000 0.0000
-0.1109 -0.1117 0.0000
0.0000 0.0000 -0.0831
--------------------------------------
APT for atom C3
--------------------------------------
-0.2114 0.0014 0.0000
-0.0059 0.0534 0.0000
0.0000 0.0000 -0.0908
--------------------------------------
APT for atom C4
--------------------------------------
0.1742 0.1088 0.0000
0.0367 -0.1377 0.0000
0.0000 0.0000 0.0275
--------------------------------------
APT for atom C5
--------------------------------------
-0.0440 -0.1000 0.0000
-0.1109 -0.1117 0.0000
0.0000 0.0000 -0.0831
--------------------------------------
APT for atom H6
--------------------------------------
0.0318 0.0009 0.0000
-0.0004 0.0658 0.0000
0.0000 0.0000 0.0792
--------------------------------------
APT for atom H7
--------------------------------------
0.0482 -0.0162 0.0000
-0.0230 0.0477 0.0000
0.0000 0.0000 0.0776
--------------------------------------
APT for atom H8
--------------------------------------
0.0318 0.0009 0.0000
-0.0004 0.0658 0.0000
0.0000 0.0000 0.0792
--------------------------------------
APT for atom C9
--------------------------------------
0.0702 0.0438 0.0000
0.3621 0.1238 0.0000
0.0000 0.0000 -0.0786
--------------------------------------
APT for atom C10
--------------------------------------
-0.2320 -0.0204 0.0000
-0.1207 -0.0646 0.0000
0.0000 0.0000 -0.2049
--------------------------------------
APT for atom H11
--------------------------------------
0.0716 -0.0090 0.0000
-0.1442 -0.0179 0.0000
0.0000 0.0000 0.0986
--------------------------------------
APT for atom H12
--------------------------------------
-0.0113 0.0086 0.0000
-0.0757 0.0015 0.0000
0.0000 0.0000 0.0803
--------------------------------------
APT for atom H13
--------------------------------------
0.1027 -0.0178 0.0000
0.0820 0.0399 0.0000
0.0000 0.0000 0.0943
--------------------------------------
APT for atom C14
--------------------------------------
0.0702 0.0438 0.0000
0.3621 0.1238 0.0000
0.0000 0.0000 -0.0786
--------------------------------------
APT for atom H15
--------------------------------------
-0.0113 0.0086 0.0000
-0.0757 0.0015 0.0000
0.0000 0.0000 0.0803
--------------------------------------
APT for atom C16
--------------------------------------
-0.2320 -0.0204 0.0000
-0.1207 -0.0646 0.0000
0.0000 0.0000 -0.2049
--------------------------------------
APT for atom H17
--------------------------------------
0.0716 -0.0090 0.0000
-0.1442 -0.0179 0.0000
0.0000 0.0000 0.0986
--------------------------------------
APT for atom H18
--------------------------------------
0.1027 -0.0178 0.0000
0.0820 0.0399 0.0000
0.0000 0.0000 0.0943
--------------------------------------
APT for atom C19
--------------------------------------
-0.2114 0.0014 0.0000
-0.0059 0.0534 0.0000
0.0000 0.0000 -0.0908
--------------------------------------
APT for atom H20
--------------------------------------
0.0482 -0.0162 0.0000
-0.0230 0.0477 0.0000
0.0000 0.0000 0.0776
--------------------------------------
Peak memory usage: 729 Mb
end of program cphfa
Time(cphfa) user: 236.0 user+sys: 236.0 wallclock: 240.8
start of program freq
harmonic frequencies in cm**-1, reduced masses in amu,
force constants in mDyne/A, and
normal modes in cartesian coordinates:
IR intensities in km/mol
frequencies 53.46 85.47 149.83 179.44 263.51 298.87
symmetries Au Bg Au Bu Ag Bg
intensities 0.03 0.00 0.37 0.27 0.00 0.00
reduc. mass 1.90 0.69 1.00 1.42 1.20 0.90
force const 0.00 0.00 0.01 0.03 0.05 0.05
C1 X 0.00000 0.00000 0.00000 -0.00811 0.04434 0.00000
C1 Y 0.00000 0.00000 0.00000 0.05716 -0.05601 0.00000
C1 Z -0.04488 -0.05386 -0.02061 0.00000 0.00000 -0.11874
C2 X 0.00000 0.00000 0.00000 -0.01321 -0.02113 0.00000
C2 Y 0.00000 0.00000 0.00000 0.05982 -0.05469 0.00000
C2 Z -0.05404 -0.08368 -0.06476 0.00000 0.00000 -0.06433
C3 X 0.00000 0.00000 0.00000 -0.00678 -0.06376 0.00000
C3 Y 0.00000 0.00000 0.00000 0.06303 0.01603 0.00000
C3 Z -0.05810 -0.02661 -0.05561 0.00000 0.00000 0.07795
C4 X 0.00000 0.00000 0.00000 -0.00811 -0.04434 0.00000
C4 Y 0.00000 0.00000 0.00000 0.05716 0.05601 0.00000
C4 Z -0.04489 0.05386 -0.02061 0.00000 0.00000 0.11874
C5 X 0.00000 0.00000 0.00000 -0.01321 0.02113 0.00000
C5 Y 0.00000 0.00000 0.00000 0.05982 0.05469 0.00000
C5 Z -0.05405 0.08367 -0.06476 0.00000 0.00000 0.06433
H6 X 0.00000 0.00000 0.00000 -0.01627 -0.05100 0.00000
H6 Y 0.00000 0.00000 0.00000 0.05727 -0.10439 0.00000
H6 Z -0.05799 -0.15720 -0.05645 0.00000 0.00000 -0.08356
H7 X 0.00000 0.00000 0.00000 -0.00673 -0.11567 0.00000
H7 Y 0.00000 0.00000 0.00000 0.06351 0.01737 0.00000
H7 Z -0.06267 -0.05299 -0.04228 0.00000 0.00000 0.11883
H8 X 0.00000 0.00000 0.00000 -0.01627 0.05100 0.00000
H8 Y 0.00000 0.00000 0.00000 0.05727 0.10439 0.00000
H8 Z -0.05800 0.15720 -0.05646 0.00000 0.00000 0.08356
C9 X 0.00000 0.00000 0.00000 0.03693 -0.03208 0.00000
C9 Y 0.00000 0.00000 0.00000 -0.01961 0.02137 0.00000
C9 Z -0.01159 0.08804 0.12558 0.00000 0.00000 -0.03488
C10 X 0.00000 0.00000 0.00000 -0.01222 -0.08458 0.00000
C10 Y 0.00000 0.00000 0.00000 -0.13764 -0.09886 0.00000
C10 Z 0.15105 -0.09299 0.00224 0.00000 0.00000 -0.02109
H11 X 0.00000 0.00000 0.00000 -0.11626 -0.20098 0.00000
H11 Y 0.00000 0.00000 0.00000 -0.15440 -0.11710 0.00000
H11 Z 0.27199 -0.28286 -0.24799 0.00000 0.00000 0.20755
H12 X 0.00000 0.00000 0.00000 0.12839 0.04171 0.00000
H12 Y 0.00000 0.00000 0.00000 -0.01052 0.02822 0.00000
H12 Z -0.11423 0.25127 0.35963 0.00000 0.00000 -0.25901
H13 X 0.00000 0.00000 0.00000 0.05133 -0.01367 0.00000
H13 Y 0.00000 0.00000 0.00000 -0.22692 -0.19929 0.00000
H13 Z 0.17210 -0.06204 0.14377 0.00000 0.00000 -0.23573
C14 X 0.00000 0.00000 0.00000 0.03693 0.03208 0.00000
C14 Y 0.00000 0.00000 0.00000 -0.01961 -0.02137 0.00000
C14 Z -0.01158 -0.08804 0.12558 0.00000 0.00000 0.03488
H15 X 0.00000 0.00000 0.00000 0.12839 -0.04172 0.00000
H15 Y 0.00000 0.00000 0.00000 -0.01052 -0.02822 0.00000
H15 Z -0.11421 -0.25127 0.35963 0.00000 0.00000 0.25901
C16 X 0.00000 0.00000 0.00000 -0.01222 0.08458 0.00000
C16 Y 0.00000 0.00000 0.00000 -0.13764 0.09886 0.00000
C16 Z 0.15104 0.09301 0.00224 0.00000 0.00000 0.02109
H17 X 0.00000 0.00000 0.00000 -0.11626 0.20098 0.00000
H17 Y 0.00000 0.00000 0.00000 -0.15439 0.11710 0.00000
H17 Z 0.27197 0.28288 -0.24799 0.00000 0.00000 -0.20755
H18 X 0.00000 0.00000 0.00000 0.05133 0.01367 0.00000
H18 Y 0.00000 0.00000 0.00000 -0.22692 0.19929 0.00000
H18 Z 0.17210 0.06206 0.14377 0.00000 0.00000 0.23573
C19 X 0.00000 0.00000 0.00000 -0.00678 0.06376 0.00000
C19 Y 0.00000 0.00000 0.00000 0.06303 -0.01603 0.00000
C19 Z -0.05810 0.02661 -0.05561 0.00000 0.00000 -0.07795
H20 X 0.00000 0.00000 0.00000 -0.00673 0.11567 0.00000
H20 Y 0.00000 0.00000 0.00000 0.06351 -0.01737 0.00000
H20 Z -0.06268 0.05299 -0.04228 0.00000 0.00000 -0.11883
frequencies 407.65 424.37 468.00 486.78 578.54 656.39
symmetries Ag Au Au Bu Ag Bg
intensities 0.00 0.10 5.80 1.90 0.00 0.00
reduc. mass 1.16 1.60 1.13 0.90 1.00 0.64
force const 0.11 0.17 0.15 0.13 0.20 0.16
C1 X -0.03779 0.00000 0.00000 -0.03887 0.07774 0.00000
C1 Y -0.07849 0.00000 0.00000 0.01132 -0.01380 0.00000
C1 Z 0.00000 0.01056 -0.13158 0.00000 0.00000 -0.02609
C2 X -0.00525 0.00000 0.00000 -0.06773 -0.00801 0.00000
C2 Y -0.07595 0.00000 0.00000 0.02248 -0.01730 0.00000
C2 Z 0.00000 -0.12503 0.04083 0.00000 0.00000 0.07891
C3 X -0.02345 0.00000 0.00000 -0.05866 -0.06163 0.00000
C3 Y -0.00509 0.00000 0.00000 0.02440 0.06277 0.00000
C3 Z 0.00000 0.12098 0.06200 0.00000 0.00000 -0.08224
C4 X 0.03779 0.00000 0.00000 -0.03887 -0.07774 0.00000
C4 Y 0.07849 0.00000 0.00000 0.01132 0.01380 0.00000
C4 Z 0.00000 0.01056 -0.13158 0.00000 0.00000 0.02609
C5 X 0.00525 0.00000 0.00000 -0.06773 0.00801 0.00000
C5 Y 0.07595 0.00000 0.00000 0.02248 0.01730 0.00000
C5 Z 0.00000 -0.12503 0.04083 0.00000 0.00000 -0.07891
H6 X -0.00843 0.00000 0.00000 -0.06704 -0.07502 0.00000
H6 Y -0.07957 0.00000 0.00000 0.02391 -0.12349 0.00000
H6 Z 0.00000 -0.28009 0.18977 0.00000 0.00000 0.13351
H7 X -0.12132 0.00000 0.00000 -0.06609 -0.07583 0.00000
H7 Y -0.00088 0.00000 0.00000 0.02626 0.06383 0.00000
H7 Z 0.00000 0.23278 0.22560 0.00000 0.00000 -0.11254
H8 X 0.00843 0.00000 0.00000 -0.06704 0.07502 0.00000
H8 Y 0.07957 0.00000 0.00000 0.02391 0.12349 0.00000
H8 Z 0.00000 -0.28009 0.18977 0.00000 0.00000 -0.13351
C9 X 0.10546 0.00000 0.00000 0.04461 -0.02023 0.00000
C9 Y 0.03282 0.00000 0.00000 -0.08780 -0.11467 0.00000
C9 Z 0.00000 -0.00264 -0.04409 0.00000 0.00000 0.09718
C10 X 0.09854 0.00000 0.00000 0.10308 0.03695 0.00000
C10 Y -0.00806 0.00000 0.00000 0.01583 -0.00133 0.00000
C10 Z 0.00000 0.00096 0.01869 0.00000 0.00000 -0.01616
H11 X 0.07496 0.00000 0.00000 0.27581 0.25591 0.00000
H11 Y -0.01285 0.00000 0.00000 0.04281 0.03438 0.00000
H11 Z 0.00000 0.02881 -0.16228 0.00000 0.00000 0.20695
H12 X 0.15825 0.00000 0.00000 0.06048 0.00695 0.00000
H12 Y 0.04004 0.00000 0.00000 -0.08431 -0.11179 0.00000
H12 Z 0.00000 -0.01399 0.13607 0.00000 0.00000 -0.12951
H13 X 0.11710 0.00000 0.00000 0.00607 -0.08676 0.00000
H13 Y -0.03191 0.00000 0.00000 0.15518 0.17396 0.00000
H13 Z 0.00000 -0.02497 0.25554 0.00000 0.00000 -0.35734
C14 X -0.10546 0.00000 0.00000 0.04461 0.02023 0.00000
C14 Y -0.03282 0.00000 0.00000 -0.08780 0.11467 0.00000
C14 Z 0.00000 -0.00264 -0.04409 0.00000 0.00000 -0.09718
H15 X -0.15825 0.00000 0.00000 0.06048 -0.00695 0.00000
H15 Y -0.04004 0.00000 0.00000 -0.08431 0.11179 0.00000
H15 Z 0.00000 -0.01399 0.13607 0.00000 0.00000 0.12951
C16 X -0.09854 0.00000 0.00000 0.10308 -0.03695 0.00000
C16 Y 0.00806 0.00000 0.00000 0.01583 0.00133 0.00000
C16 Z 0.00000 0.00096 0.01869 0.00000 0.00000 0.01616
H17 X -0.07496 0.00000 0.00000 0.27581 -0.25591 0.00000
H17 Y 0.01285 0.00000 0.00000 0.04281 -0.03438 0.00000
H17 Z 0.00000 0.02881 -0.16228 0.00000 0.00000 -0.20695
H18 X -0.11710 0.00000 0.00000 0.00607 0.08676 0.00000
H18 Y 0.03191 0.00000 0.00000 0.15518 -0.17396 0.00000
H18 Z 0.00000 -0.02497 0.25554 0.00000 0.00000 0.35734
C19 X 0.02345 0.00000 0.00000 -0.05866 0.06163 0.00000
C19 Y 0.00509 0.00000 0.00000 0.02440 -0.06277 0.00000
C19 Z 0.00000 0.12098 0.06200 0.00000 0.00000 0.08224
H20 X 0.12132 0.00000 0.00000 -0.06609 0.07583 0.00000
H20 Y 0.00088 0.00000 0.00000 0.02626 -0.06383 0.00000
H20 Z 0.00000 0.23278 0.22560 0.00000 0.00000 0.11254
frequencies 673.71 706.50 735.18 810.36 862.76 895.38
symmetries Ag Au Bu Bg Ag Bg
intensities 0.00 0.44 4.35 0.00 0.00 0.00
reduc. mass 2.31 0.43 1.16 1.60 1.48 0.29
force const 0.62 0.13 0.37 0.62 0.65 0.14
C1 X -0.01278 0.00000 0.00907 0.00000 -0.03208 0.00000
C1 Y 0.03825 0.00000 0.00454 0.00000 -0.01872 0.00000
C1 Z 0.00000 -0.07027 0.00000 0.14294 0.00000 0.00067
C2 X -0.13606 0.00000 -0.06530 0.00000 0.06970 0.00000
C2 Y 0.01961 0.00000 -0.03676 0.00000 -0.10044 0.00000
C2 Z 0.00000 -0.01628 0.00000 -0.05778 0.00000 -0.06924
C3 X -0.06501 0.00000 -0.05906 0.00000 0.03528 0.00000
C3 Y -0.11557 0.00000 -0.06024 0.00000 -0.11085 0.00000
C3 Z 0.00000 -0.01285 0.00000 0.05822 0.00000 -0.06480
C4 X 0.01278 0.00000 0.00907 0.00000 0.03208 0.00000
C4 Y -0.03825 0.00000 0.00454 0.00000 0.01872 0.00000
C4 Z 0.00000 -0.07027 0.00000 -0.14294 0.00000 -0.00068
C5 X 0.13606 0.00000 -0.06530 0.00000 -0.06970 0.00000
C5 Y -0.01961 0.00000 -0.03676 0.00000 0.10044 0.00000
C5 Z 0.00000 -0.01628 0.00000 0.05778 0.00000 0.06924
H6 X -0.11707 0.00000 -0.09091 0.00000 0.11834 0.00000
H6 Y 0.04985 0.00000 -0.08082 0.00000 -0.03749 0.00000
H6 Z 0.00000 0.25127 0.00000 -0.15132 0.00000 0.44570
H7 X -0.02034 0.00000 -0.11277 0.00000 -0.06510 0.00000
H7 Y -0.11740 0.00000 -0.05849 0.00000 -0.11490 0.00000
H7 Z 0.00000 0.25643 0.00000 0.15813 0.00000 0.43573
H8 X 0.11707 0.00000 -0.09091 0.00000 -0.11834 0.00000
H8 Y -0.04985 0.00000 -0.08082 0.00000 0.03749 0.00000
H8 Z 0.00000 0.25127 0.00000 0.15132 0.00000 -0.44574
C9 X 0.00270 0.00000 0.07404 0.00000 -0.03726 0.00000
C9 Y -0.02097 0.00000 0.10088 0.00000 -0.05150 0.00000
C9 Z 0.00000 0.09561 0.00000 0.06736 0.00000 -0.00001
C10 X 0.01285 0.00000 0.04993 0.00000 -0.03408 0.00000
C10 Y -0.01167 0.00000 0.00995 0.00000 -0.01034 0.00000
C10 Z 0.00000 -0.01385 0.00000 -0.00609 0.00000 -0.00158
H11 X 0.04901 0.00000 -0.14821 0.00000 0.10088 0.00000
H11 Y -0.00565 0.00000 -0.02445 0.00000 0.01281 0.00000
H11 Z 0.00000 0.20718 0.00000 0.11371 0.00000 -0.01142
H12 X 0.00689 0.00000 0.07506 0.00000 -0.03792 0.00000
H12 Y -0.02055 0.00000 0.10522 0.00000 -0.05514 0.00000
H12 Z 0.00000 -0.14788 0.00000 -0.08715 0.00000 0.00092
H13 X -0.00438 0.00000 0.17344 0.00000 -0.12650 0.00000
H13 Y 0.01299 0.00000 -0.16031 0.00000 0.11705 0.00000
H13 Z 0.00000 -0.35692 0.00000 -0.22324 0.00000 0.01810
C14 X -0.00270 0.00000 0.07404 0.00000 0.03726 0.00000
C14 Y 0.02097 0.00000 0.10088 0.00000 0.05150 0.00000
C14 Z 0.00000 0.09561 0.00000 -0.06736 0.00000 0.00001
H15 X -0.00689 0.00000 0.07506 0.00000 0.03792 0.00000
H15 Y 0.02055 0.00000 0.10522 0.00000 0.05514 0.00000
H15 Z 0.00000 -0.14788 0.00000 0.08715 0.00000 -0.00092
C16 X -0.01285 0.00000 0.04993 0.00000 0.03408 0.00000
C16 Y 0.01167 0.00000 0.00995 0.00000 0.01034 0.00000
C16 Z 0.00000 -0.01385 0.00000 0.00609 0.00000 0.00158
H17 X -0.04900 0.00000 -0.14821 0.00000 -0.10088 0.00000
H17 Y 0.00565 0.00000 -0.02445 0.00000 -0.01281 0.00000
H17 Z 0.00000 0.20718 0.00000 -0.11371 0.00000 0.01143
H18 X 0.00438 0.00000 0.17344 0.00000 0.12650 0.00000
H18 Y -0.01299 0.00000 -0.16031 0.00000 -0.11705 0.00000
H18 Z 0.00000 -0.35692 0.00000 0.22324 0.00000 -0.01812
C19 X 0.06501 0.00000 -0.05906 0.00000 -0.03528 0.00000
C19 Y 0.11557 0.00000 -0.06024 0.00000 0.11085 0.00000
C19 Z 0.00000 -0.01285 0.00000 -0.05822 0.00000 0.06481
H20 X 0.02034 0.00000 -0.11277 0.00000 0.06510 0.00000
H20 Y 0.11740 0.00000 -0.05849 0.00000 0.11490 0.00000
H20 Z 0.00000 0.25643 0.00000 -0.15813 0.00000 -0.43577
frequencies 897.42 980.12 980.23 1019.68 1038.22 1073.61
symmetries Au Bg Au Bg Au Bu
intensities 26.34 0.00 36.29 0.00 0.02 0.59
reduc. mass 0.46 0.52 0.52 0.28 0.35 1.44
force const 0.22 0.30 0.30 0.17 0.22 0.98
C1 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.02183
C1 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.01738
C1 Z -0.09567 -0.00359 0.00484 0.01770 -0.00036 0.00000
C2 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.06795
C2 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.09218
C2 Z 0.06175 -0.00095 -0.00347 -0.06532 -0.07392 0.00000
C3 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.03875
C3 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.11812
C3 Z 0.05686 0.00010 0.00016 0.06627 0.07499 0.00000
C4 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.02183
C4 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.01738
C4 Z -0.09567 0.00360 0.00483 -0.01770 -0.00036 0.00000
C5 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.06795
C5 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.09218
C5 Z 0.06175 0.00094 -0.00347 0.06532 -0.07392 0.00000
H6 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.03496
H6 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.26247
H6 Z -0.35741 0.01108 0.01857 0.43203 0.41977 0.00000
H7 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.20437
H7 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.12868
H7 Z -0.35273 -0.00224 -0.00461 -0.44679 -0.43293 0.00000
H8 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.03496
H8 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.26247
H8 Z -0.35736 -0.01103 0.01860 -0.43203 0.41977 0.00000
C9 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00045
C9 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00443
C9 Z 0.04751 -0.03587 -0.03637 0.00968 0.00040 0.00000
C10 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.01528
C10 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.01276
C10 Z -0.00124 0.10305 0.10278 -0.00165 -0.00231 0.00000
H11 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.06598
H11 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00130
H11 Z 0.05615 -0.42458 -0.42348 0.02644 0.01876 0.00000
H12 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.02694
H12 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00647
H12 Z -0.02752 0.01618 0.01632 0.02130 0.00376 0.00000
H13 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.06803
H13 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.05964
H13 Z -0.14253 -0.41816 -0.41579 -0.02678 0.00500 0.00000
C14 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00045
C14 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00443
C14 Z 0.04751 0.03577 -0.03646 -0.00968 0.00040 0.00000
H15 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.02694
H15 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00647
H15 Z -0.02752 -0.01613 0.01636 -0.02130 0.00376 0.00000
C16 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.01528
C16 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.01276
C16 Z -0.00124 -0.10278 0.10305 0.00165 -0.00231 0.00000
H17 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.06598
H17 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.00130
H17 Z 0.05615 0.42344 -0.42462 -0.02644 0.01876 0.00000
H18 X 0.00000 0.00000 0.00000 0.00000 0.00000 0.06804
H18 Y 0.00000 0.00000 0.00000 0.00000 0.00000 -0.05964
H18 Z -0.14253 0.41704 -0.41691 0.02678 0.00500 0.00000
C19 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.03875
C19 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.11812
C19 Z 0.05685 -0.00010 0.00016 -0.06627 0.07499 0.00000
H20 X 0.00000 0.00000 0.00000 0.00000 0.00000 -0.20437
H20 Y 0.00000 0.00000 0.00000 0.00000 0.00000 0.12868
H20 Z -0.35268 0.00223 -0.00462 0.44679 -0.43293 0.00000
frequencies 1101.57 1106.08 1106.24 1109.93 1204.95 1262.91
symmetries Bu Au Bg Ag Bu Ag
intensities 8.96 13.29 0.00 0.00 1.47 0.00
reduc. mass 0.23 0.26 0.26 0.28 0.29 0.24
force const 0.16 0.18 0.18 0.20 0.25 0.22
C1 X -0.00831 0.00000 0.00000 0.04418 -0.05029 -0.06219
C1 Y -0.05171 0.00000 0.00000 0.03475 0.01447 -0.02461
C1 Z 0.00000 0.00082 0.00183 0.00000 0.00000 0.00000
C2 X -0.02214 0.00000 0.00000 0.02990 0.07304 -0.00278
C2 Y 0.04599 0.00000 0.00000 -0.03210 0.00610 0.03196
C2 Z 0.00000 -0.00317 -0.00213 0.00000 0.00000 0.00000
C3 X 0.01246 0.00000 0.00000 -0.01961 -0.03558 -0.03386
C3 Y 0.02307 0.00000 0.00000 -0.02766 -0.04045 0.02783
C3 Z 0.00000 0.00306 -0.00264 0.00000 0.00000 0.00000
C4 X -0.00831 0.00000 0.00000 -0.04418 -0.05029 0.06219
C4 Y -0.05171 0.00000 0.00000 -0.03475 0.01447 0.02461
C4 Z 0.00000 0.00082 -0.00183 0.00000 0.00000 0.00000
C5 X -0.02214 0.00000 0.00000 -0.02990 0.07304 0.00278
C5 Y 0.04599 0.00000 0.00000 0.03210 0.00610 -0.03196
C5 Z 0.00000 -0.00317 0.00213 0.00000 0.00000 0.00000
H6 X -0.01980 0.00000 0.00000 0.00084 0.30715 0.19570
H6 Y 0.06008 0.00000 0.00000 -0.08859 0.36166 0.34968
H6 Z 0.00000 -0.00306 -0.01761 0.00000 0.00000 0.00000
H7 X 0.18111 0.00000 0.00000 -0.04959 -0.33967 -0.46360
H7 Y 0.02081 0.00000 0.00000 -0.03091 -0.04012 0.04440
H7 Z 0.00000 -0.00515 0.02589 0.00000 0.00000 0.00000
H8 X -0.01980 0.00000 0.00000 -0.00084 0.30715 -0.19570
H8 Y 0.06009 0.00000 0.00000 0.08859 0.36166 -0.34968
H8 Z 0.00000 -0.00307 0.01761 0.00000 0.00000 0.00000
C9 X -0.01158 0.00000 0.00000 -0.00866 -0.00554 -0.01266
C9 Y -0.05202 0.00000 0.00000 -0.04912 -0.00967 -0.03087
C9 Z 0.00000 0.05833 -0.05879 0.00000 0.00000 0.00000
C10 X 0.04380 0.00000 0.00000 0.05654 0.01932 -0.00410
C10 Y 0.05479 0.00000 0.00000 0.05593 0.01015 0.00727
C10 Z 0.00000 -0.00449 0.00458 0.00000 0.00000 0.00000
H11 X -0.30258 0.00000 0.00000 -0.29902 -0.03955 -0.05779
H11 Y -0.00481 0.00000 0.00000 -0.00617 -0.00097 -0.00042
H11 Z 0.00001 -0.31561 0.31439 -0.00001 0.00000 0.00000
H12 X -0.27956 0.00000 0.00000 -0.26168 -0.02411 -0.10399
H12 Y -0.08054 0.00000 0.00000 -0.07480 -0.01047 -0.04437
H12 Z 0.00001 -0.55194 0.55109 -0.00002 0.00000 0.00000
H13 X 0.25140 0.00000 0.00000 0.27947 0.08480 -0.00471
H13 Y -0.23495 0.00000 0.00000 -0.25311 -0.07924 0.00545
H13 Z -0.00001 0.22621 -0.22516 0.00001 0.00000 0.00000
C14 X -0.01158 0.00000 0.00000 0.00866 -0.00554 0.01266
C14 Y -0.05202 0.00000 0.00000 0.04912 -0.00967 0.03087
C14 Z 0.00000 0.05829 0.05883 0.00000 0.00000 0.00000
H15 X -0.27956 -0.00001 0.00001 0.26169 -0.02411 0.10399
H15 Y -0.08054 0.00000 0.00000 0.07480 -0.01047 0.04437
H15 Z 0.00000 -0.55158 -0.55145 0.00000 0.00000 0.00000
C16 X 0.04380 0.00000 0.00000 -0.05654 0.01932 0.00410
C16 Y 0.05479 0.00000 0.00000 -0.05593 0.01015 -0.00727
C16 Z 0.00000 -0.00448 -0.00458 0.00000 0.00000 0.00000
H17 X -0.30257 -0.00001 0.00001 0.29903 -0.03955 0.05779
H17 Y -0.00481 0.00000 0.00000 0.00617 -0.00097 0.00042
H17 Z 0.00000 -0.31541 -0.31459 0.00000 0.00000 0.00000
H18 X 0.25139 0.00001 -0.00001 -0.27947 0.08480 0.00472
H18 Y -0.23495 -0.00001 0.00001 0.25312 -0.07924 -0.00545
H18 Z 0.00000 0.22606 0.22530 0.00000 0.00000 0.00000
C19 X 0.01246 0.00000 0.00000 0.01961 -0.03558 0.03386
C19 Y 0.02307 0.00000 0.00000 0.02766 -0.04045 -0.02783
C19 Z 0.00000 0.00306 0.00264 0.00000 0.00000 0.00000
H20 X 0.18111 0.00000 0.00000 0.04958 -0.33967 0.46360
H20 Y 0.02081 0.00000 0.00000 0.03091 -0.04012 -0.04440
H20 Z 0.00000 -0.00513 -0.02589 0.00000 0.00000 0.00000
frequencies 1284.91 1296.29 1351.26 1398.64 1420.76 1426.93
symmetries Bu Ag Bu Ag Bu Ag
intensities 0.08 0.00 9.51 0.00 8.24 0.00
reduc. mass 1.28 1.12 1.45 0.26 0.32 0.19
force const 1.25 1.11 1.56 0.30 0.38 0.23
C1 X 0.13609 0.12155 0.00528 -0.01331 0.01687 -0.01636
C1 Y 0.00138 0.03862 -0.12874 0.07561 -0.01669 0.04596
C1 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C2 X 0.00008 0.06525 0.04782 0.02820 0.01690 0.01071
C2 Y 0.05839 0.02572 0.06428 0.02058 0.02335 0.01753
C2 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C3 X -0.04698 -0.04210 -0.09446 0.01213 -0.02808 0.02121
C3 Y -0.01468 -0.05369 0.02471 -0.00186 -0.00927 -0.00407
C3 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C4 X 0.13609 -0.12155 0.00528 0.01331 0.01687 0.01636
C4 Y 0.00138 -0.03862 -0.12874 -0.07561 -0.01669 -0.04596
C4 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C5 X 0.00008 -0.06525 0.04782 -0.02820 0.01690 -0.01071
C5 Y 0.05839 -0.02572 0.06428 -0.02058 0.02335 -0.01753
C5 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H6 X -0.09793 0.18557 0.04160 -0.16492 -0.01712 -0.13024
H6 Y -0.09667 0.19737 0.05817 -0.28977 -0.03174 -0.20645
H6 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H7 X -0.34315 -0.09988 0.16961 -0.34251 0.01292 -0.25432
H7 Y -0.00299 -0.06488 0.01821 0.00839 -0.01228 0.00335
H7 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H8 X -0.09793 -0.18557 0.04160 0.16492 -0.01712 0.13024
H8 Y -0.09667 -0.19737 0.05817 0.28977 -0.03173 0.20645
H8 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C9 X -0.00673 0.01427 0.01674 0.00936 0.00947 0.01484
C9 Y -0.03230 0.05219 0.05498 0.06074 -0.06130 -0.04080
C9 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C10 X -0.01984 0.01970 -0.00259 0.00788 -0.03273 -0.03341
C10 Y -0.00265 -0.01093 -0.02887 -0.04605 0.06355 0.05130
C10 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H11 X -0.04491 0.09571 0.13149 0.20293 -0.28814 -0.22702
H11 Y -0.00456 -0.00142 -0.00896 -0.01936 0.03232 0.02882
H11 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H12 X -0.20259 0.20988 0.02632 -0.25758 0.52416 0.46001
H12 Y -0.05939 0.08030 0.06090 0.03952 -0.01843 -0.00348
H12 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H13 X -0.05707 0.01783 -0.04508 -0.02479 -0.02257 -0.02904
H13 Y 0.04294 -0.00043 0.03399 0.00632 0.03447 0.03189
H13 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C14 X -0.00673 -0.01427 0.01674 -0.00936 0.00947 -0.01484
C14 Y -0.03230 -0.05219 0.05498 -0.06074 -0.06130 0.04080
C14 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H15 X -0.20259 -0.20987 0.02632 0.25758 0.52415 -0.46002
H15 Y -0.05939 -0.08030 0.06090 -0.03952 -0.01843 0.00348
H15 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C16 X -0.01984 -0.01970 -0.00259 -0.00788 -0.03273 0.03342
C16 Y -0.00265 0.01093 -0.02887 0.04605 0.06355 -0.05130
C16 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H17 X -0.04492 -0.09571 0.13149 -0.20292 -0.28814 0.22702
H17 Y -0.00456 0.00142 -0.00896 0.01936 0.03232 -0.02882
H17 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H18 X -0.05707 -0.01782 -0.04508 0.02479 -0.02257 0.02904
H18 Y 0.04294 0.00043 0.03399 -0.00632 0.03447 -0.03190
H18 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C19 X -0.04698 0.04210 -0.09446 -0.01213 -0.02808 -0.02121
C19 Y -0.01468 0.05369 0.02471 0.00186 -0.00927 0.00407
C19 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H20 X -0.34315 0.09988 0.16961 0.34251 0.01293 0.25432
H20 Y -0.00298 0.06488 0.01821 -0.00839 -0.01228 -0.00335
H20 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
frequencies 1515.02 1565.43 1575.12 1641.37 1691.40 1740.01
symmetries Bu Ag Bu Bu Ag Ag
intensities 18.85 0.00 0.55 15.07 0.00 0.00
reduc. mass 0.78 0.34 0.23 0.85 1.65 1.71
force const 1.05 0.49 0.34 1.35 2.78 3.05
C1 X -0.03043 0.01974 -0.03026 0.08813 -0.05702 -0.07382
C1 Y 0.07877 0.02635 0.03121 0.05743 0.12179 -0.03281
C1 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C2 X 0.09041 0.00809 0.02832 -0.01721 0.00358 0.09041
C2 Y 0.04176 -0.01263 -0.01194 -0.08293 -0.09296 0.07950
C2 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C3 X -0.06037 -0.02673 -0.03280 -0.08611 -0.07626 -0.12176
C3 Y -0.06646 0.00247 -0.01186 0.02327 0.05257 -0.02641
C3 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C4 X -0.03043 -0.01974 -0.03026 0.08813 0.05702 0.07382
C4 Y 0.07877 -0.02635 0.03121 0.05743 -0.12179 0.03281
C4 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C5 X 0.09041 -0.00809 0.02832 -0.01721 -0.00358 -0.09041
C5 Y 0.04176 0.01263 -0.01194 -0.08293 0.09296 -0.07950
C5 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H6 X -0.10703 0.02728 0.03746 0.17969 0.12410 -0.04685
H6 Y -0.29304 0.01195 -0.00983 0.20876 0.07694 -0.14912
H6 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H7 X 0.17629 0.04502 0.13010 0.29361 0.12073 0.15429
H7 Y -0.08846 0.00024 -0.02042 0.02012 0.05672 -0.04062
H7 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H8 X -0.10703 -0.02728 0.03746 0.17969 -0.12410 0.04685
H8 Y -0.29304 -0.01195 -0.00983 0.20876 -0.07694 0.14912
H8 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C9 X -0.04167 0.08829 0.07361 -0.01609 0.01297 -0.02454
C9 Y -0.01359 0.00421 -0.00477 -0.01943 0.00771 -0.00257
C9 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C10 X 0.02202 0.00595 0.01599 -0.01508 -0.02977 0.01251
C10 Y 0.00079 -0.01907 -0.01950 0.00863 0.00890 -0.00362
C10 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H11 X 0.09193 -0.35867 -0.35500 0.05221 0.09719 -0.02754
H11 Y 0.00705 -0.06883 -0.07173 0.02029 0.03139 -0.01213
H11 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H12 X -0.02883 -0.18073 -0.21512 -0.01388 0.07407 0.02426
H12 Y -0.00970 -0.02609 -0.03648 -0.02270 0.01148 0.00302
H12 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H13 X 0.10624 -0.27595 -0.25066 0.04041 0.02677 -0.00155
H13 Y -0.10731 0.35831 0.33923 -0.07138 -0.07399 0.01839
H13 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C14 X -0.04167 -0.08829 0.07361 -0.01609 -0.01297 0.02454
C14 Y -0.01359 -0.00421 -0.00477 -0.01943 -0.00771 0.00257
C14 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H15 X -0.02883 0.18073 -0.21512 -0.01388 -0.07408 -0.02426
H15 Y -0.00970 0.02609 -0.03648 -0.02270 -0.01148 -0.00302
H15 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C16 X 0.02202 -0.00595 0.01599 -0.01508 0.02977 -0.01251
C16 Y 0.00079 0.01907 -0.01950 0.00863 -0.00890 0.00362
C16 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H17 X 0.09193 0.35867 -0.35499 0.05221 -0.09719 0.02754
H17 Y 0.00705 0.06883 -0.07173 0.02029 -0.03139 0.01213
H17 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H18 X 0.10624 0.27595 -0.25066 0.04041 -0.02677 0.00155
H18 Y -0.10731 -0.35831 0.33922 -0.07138 0.07399 -0.01839
H18 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C19 X -0.06037 0.02673 -0.03280 -0.08611 0.07626 0.12176
C19 Y -0.06646 -0.00247 -0.01186 0.02327 -0.05257 0.02641
C19 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H20 X 0.17629 -0.04502 0.13010 0.29361 -0.12073 -0.15429
H20 Y -0.08846 -0.00024 -0.02042 0.02012 -0.05672 0.04062
H20 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
frequencies 1814.43 1815.31 3396.42 3397.14 3437.91 3437.95
symmetries Ag Bu Bu Ag Bu Ag
intensities 0.00 1.50 98.39 0.00 4.45 0.00
reduc. mass 1.73 1.89 0.22 0.22 0.41 0.41
force const 3.35 3.68 1.47 1.48 2.84 2.85
C1 X 0.01894 0.02819 -0.00001 0.00003 -0.00134 0.00134
C1 Y -0.02691 -0.00569 0.00019 0.00018 -0.00085 0.00083
C1 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C2 X 0.01401 -0.00968 0.00117 0.00085 0.00036 0.00096
C2 Y 0.02910 -0.00325 -0.00086 -0.00079 -0.00073 -0.00046
C2 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C3 X -0.01394 0.00361 -0.00017 0.00019 0.00004 0.00009
C3 Y -0.01601 0.00620 0.00079 -0.00022 0.00261 0.00300
C3 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C4 X -0.01894 0.02819 -0.00001 -0.00003 -0.00134 -0.00134
C4 Y 0.02691 -0.00569 0.00019 -0.00018 -0.00085 -0.00083
C4 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C5 X -0.01401 -0.00968 0.00117 -0.00085 0.00036 -0.00096
C5 Y -0.02909 -0.00325 -0.00086 0.00079 -0.00073 0.00046
C5 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H6 X -0.01398 0.00959 -0.01151 -0.00782 -0.00756 -0.00881
H6 Y -0.01250 0.03207 0.00792 0.00557 0.00507 0.00590
H6 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H7 X 0.01050 -0.00929 0.00005 -0.00008 0.00023 -0.00006
H7 Y -0.02031 0.00873 -0.00967 0.00192 -0.02982 -0.03472
H7 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H8 X 0.01398 0.00959 -0.01151 0.00782 -0.00757 0.00880
H8 Y 0.01250 0.03207 0.00792 -0.00557 0.00508 -0.00589
H8 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C9 X 0.12603 -0.13053 0.00411 -0.00410 -0.00959 -0.00958
C9 Y -0.03323 0.03111 0.01181 -0.01169 0.05785 0.05798
C9 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C10 X -0.11200 0.11395 -0.04362 0.04364 0.01326 0.01308
C10 Y 0.04321 -0.04343 0.01729 -0.01726 -0.00986 -0.00984
C10 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H11 X 0.16529 -0.16936 0.07078 -0.07086 -0.01937 -0.01912
H11 Y 0.10776 -0.10937 -0.45973 0.46015 0.13981 0.13824
H11 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H12 X -0.12487 0.12150 0.01768 -0.01738 0.06545 0.06558
H12 Y -0.07500 0.07297 -0.16569 0.16363 -0.64659 -0.64792
H12 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H13 X 0.01988 -0.01843 0.38174 -0.38187 -0.07143 -0.06985
H13 Y -0.17384 0.17482 0.27931 -0.27953 -0.05218 -0.05101
H13 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C14 X -0.12602 -0.13054 0.00411 0.00410 -0.00960 0.00957
C14 Y 0.03322 0.03112 0.01180 0.01170 0.05794 -0.05789
C14 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H15 X 0.12486 0.12151 0.01767 0.01738 0.06554 -0.06549
H15 Y 0.07500 0.07298 -0.16563 -0.16368 -0.64753 0.64699
H15 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C16 X 0.11199 0.11396 -0.04361 -0.04366 0.01328 -0.01307
C16 Y -0.04320 -0.04344 0.01729 0.01727 -0.00988 0.00983
C16 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H17 X -0.16528 -0.16938 0.07076 0.07088 -0.01939 0.01909
H17 Y -0.10775 -0.10938 -0.45959 -0.46029 0.14000 -0.13804
H17 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H18 X -0.01988 -0.01843 0.38162 0.38199 -0.07153 0.06975
H18 Y 0.17383 0.17483 0.27922 0.27962 -0.05225 0.05094
H18 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C19 X 0.01394 0.00362 -0.00017 -0.00019 0.00005 -0.00009
C19 Y 0.01601 0.00620 0.00079 0.00022 0.00262 -0.00300
C19 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H20 X -0.01050 -0.00930 0.00005 0.00008 0.00023 0.00006
H20 Y 0.02031 0.00873 -0.00967 -0.00192 -0.02988 0.03468
H20 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
frequencies 3446.99 3450.51 3466.82 3469.76 3548.27 3548.28
symmetries Bu Ag Bu Ag Bu Ag
intensities 0.78 0.00 5.90 0.00 0.00 0.00
reduc. mass 0.30 0.30 0.30 0.30 0.27 0.27
force const 2.07 2.08 2.10 2.12 1.99 1.99
C1 X -0.00230 0.00218 0.00143 -0.00170 -0.00035 -0.00036
C1 Y 0.00000 -0.00213 -0.00358 -0.00188 0.00003 0.00004
C1 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C2 X -0.02220 -0.02211 -0.04559 -0.04580 -0.00029 -0.00041
C2 Y 0.01730 0.01671 0.02711 0.02749 0.00019 0.00024
C2 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C3 X -0.00012 -0.00052 0.00364 0.00320 0.00003 0.00003
C3 Y -0.05184 -0.05198 0.03027 0.03037 -0.00003 0.00011
C3 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C4 X -0.00230 -0.00218 0.00143 0.00170 -0.00035 0.00036
C4 Y 0.00000 0.00213 -0.00358 0.00188 0.00003 -0.00004
C4 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C5 X -0.02220 0.02211 -0.04559 0.04580 -0.00030 0.00041
C5 Y 0.01730 -0.01671 0.02711 -0.02749 0.00019 -0.00024
C5 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H6 X 0.27630 0.27468 0.49603 0.49694 0.00430 0.00549
H6 Y -0.17738 -0.17540 -0.31444 -0.31539 -0.00314 -0.00385
H6 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H7 X 0.01613 0.01664 -0.01064 -0.00995 0.00010 -0.00004
H7 Y 0.58761 0.58891 -0.32588 -0.32286 -0.00008 -0.00070
H7 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H8 X 0.27631 -0.27468 0.49603 -0.49694 0.00433 -0.00547
H8 Y -0.17738 0.17540 -0.31444 0.31539 -0.00315 0.00384
H8 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C9 X -0.00054 -0.00042 -0.00011 0.00023 -0.00045 0.00045
C9 Y 0.00301 0.00294 -0.00022 -0.00098 0.00336 -0.00335
C9 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C10 X -0.00039 0.00103 -0.00080 0.00066 0.02616 -0.02605
C10 Y -0.00038 -0.00019 -0.00038 0.00060 0.06177 -0.06149
C10 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H11 X 0.00020 -0.00098 0.00028 0.00015 0.07637 -0.07603
H11 Y -0.00258 0.00784 -0.00386 0.00111 -0.46204 0.45998
H11 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H12 X 0.00457 0.00389 -0.00009 -0.00223 0.00576 -0.00574
H12 Y -0.03253 -0.03357 0.00510 0.00857 -0.03814 0.03807
H12 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H13 X 0.00705 -0.00669 0.00760 -0.00831 -0.38539 0.38367
H13 Y 0.00485 -0.00496 0.00552 -0.00571 -0.27432 0.27308
H13 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C14 X -0.00054 0.00042 -0.00011 -0.00023 -0.00045 -0.00045
C14 Y 0.00301 -0.00294 -0.00022 0.00098 0.00334 0.00337
C14 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H15 X 0.00458 -0.00389 -0.00009 0.00223 0.00573 0.00577
H15 Y -0.03253 0.03357 0.00510 -0.00857 -0.03797 -0.03823
H15 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C16 X -0.00039 -0.00103 -0.00080 -0.00066 0.02605 0.02616
C16 Y -0.00038 0.00019 -0.00038 -0.00060 0.06149 0.06176
C16 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H17 X 0.00020 0.00098 0.00028 -0.00015 0.07603 0.07637
H17 Y -0.00258 -0.00784 -0.00386 -0.00111 -0.45999 -0.46203
H17 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H18 X 0.00705 0.00669 0.00760 0.00831 -0.38368 -0.38538
H18 Y 0.00485 0.00496 0.00552 0.00571 -0.27310 -0.27430
H18 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
C19 X -0.00012 0.00052 0.00364 -0.00320 0.00003 -0.00003
C19 Y -0.05184 0.05198 0.03027 -0.03037 -0.00003 -0.00011
C19 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
H20 X 0.01613 -0.01664 -0.01064 0.00995 0.00010 0.00004
H20 Y 0.58761 -0.58890 -0.32588 0.32286 -0.00008 0.00070
H20 Z 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
Number of imaginary frequencies: 0
Writing vibrational animation data to dvb_ir.vib
Writing vibrational spectrum data to dvb_ir_vib.spm
Thermochemical properties at 1.0000 atm
rotational symmetry number: 2
rotational temperatures (K): 0.222036 0.032872 0.028633
vibrational temperatures:
mode: 1 2 3 4 5 6
temp. (K): 76.91 122.98 215.57 258.18 379.13 430.00
mode: 7 8 9 10 11 12
temp. (K): 586.51 610.57 673.34 700.36 832.39 944.40
mode: 13 14 15 16 17 18
temp. (K): 969.31 1016.49 1057.76 1165.93 1241.32 1288.24
mode: 19 20 21 22 23 24
temp. (K): 1291.18 1410.18 1410.33 1467.09 1493.76 1544.68
mode: 25 26 27 28 29 30
temp. (K): 1584.91 1591.40 1591.63 1596.93 1733.66 1817.05
mode: 31 32 33 34 35 36
temp. (K): 1848.70 1865.07 1944.16 2012.33 2044.15 2053.03
mode: 37 38 39 40 41 42
temp. (K): 2179.77 2252.30 2266.25 2361.56 2433.54 2503.48
mode: 43 44 45 46 47 48
temp. (K): 2610.55 2611.83 4886.69 4887.72 4946.38 4946.44
mode: 49 50 51 52 53 54
temp. (K): 4959.44 4964.51 4987.97 4992.21 5105.17 5105.18
Thermodynamic properties calculated assuming an ideal gas
In the table below, the units for temperature
are kelvins, the units for U, H, and G are
kcal/mol and the units for Cv and S are cal/(mol K)
The zero point energy (ZPE): 111.155 kcal/mol
is not included in U, H, or G in the table below
T = 298.15 K
U Cv S H G ln(Q)
--------- --------- --------- --------- --------- ---------
trans. 0.889 2.981 40.502 1.481 -10.594 17.88133
rot. 0.889 2.981 28.143 0.889 -7.502 12.66224
vib. 3.794 27.589 23.097 3.794 -3.092 5.21876
elec. 0.000 0.000 0.000 0.000 0.000 0.00000
total 5.572 33.551 91.742 6.164 -21.189 35.76232
Total internal energy, Utot (SCFE + ZPE + U): -382.122243 hartrees
Total enthalpy, Htot (Utot + pV): -382.121299 hartrees
Total Gibbs free energy, Gtot (Htot - T*S): -382.164888 hartrees
Peak memory usage: 480 Mb
end of program freq
Time(freq) user: 0.0 user+sys: 0.0 wallclock: 0.2
Total cpu seconds user: 25.000 user+sys: 25.000
Total elapsed time: 317 seconds
Job dvb_ir completed on silenziosa at Wed Apr 9 22:36:14 2014
|
{
"pile_set_name": "Github"
}
|
--TEST--
Exception for multile function with undefined variable
--TEMPLATE--
{{ include('foo',
with_context=with_context
) }}
--TEMPLATE(foo)--
Foo
--DATA--
return array()
--EXCEPTION--
Twig_Error_Runtime: Variable "with_context" does not exist in "index.twig" at line 3.
|
{
"pile_set_name": "Github"
}
|
namespace Windows.UI.Xaml.Controls
{
public partial class AutoSuggestBoxSuggestionChosenEventArgs
{
public object SelectedItem { get; }
public AutoSuggestBoxSuggestionChosenEventArgs() : base()
{
}
internal AutoSuggestBoxSuggestionChosenEventArgs(object selectedItem)
{
SelectedItem = selectedItem;
}
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env julia
using Luxor
import Cairo.CAIRO_PATH_MOVE_TO
import Cairo.CAIRO_PATH_LINE_TO
import Cairo.CAIRO_PATH_CURVE_TO
import Cairo.CAIRO_PATH_CLOSE_PATH
using Test
using Random
Random.seed!(42)
function get_path(str)
sethue("blue")
setopacity(.7)
setline(0.5)
p = textpath(str)
o = getpath()
strokepath()
sethue("red")
x, y = 0, 0
for e in o
if e.element_type == CAIRO_PATH_MOVE_TO
(x, y) = e.points
move(x, y)
elseif e.element_type == CAIRO_PATH_LINE_TO
(x, y) = e.points
# straight lines
line(x, y)
strokepath()
circle(x, y, 1, :stroke)
elseif e.element_type == CAIRO_PATH_CURVE_TO
(x1, y1, x2, y2, x3, y3) = e.points
# show bezier control lines
circle(x1, y1, 1, :stroke)
circle(x2, y2, 1, :stroke)
circle(x3, y3, 1, :stroke)
move(x, y)
# Use point interface, to make sure that is also tested
curve(Point(x1, y1), Point(x2, y2), Point(x3, y3))
strokepath()
(x, y) = (x3, y3) # update current point
elseif e.element_type == CAIRO_PATH_CLOSE_PATH
closepath()
else
error("unknown CairoPathEntry " * repr(e.element_type))
error("unknown CairoPathEntry " * repr(e.points))
end
end
end
function get_path_test(fname)
Drawing(500, 500, fname)
origin()
@layer begin
fontsize(24)
fontface("Times-Italic")
setline(0.5)
translate(-100, -100)
for theta in range(0, length=20, stop=2π)
@layer begin
rotate(theta)
translate(30, 0)
sethue("red")
textoutlines("Luxor", O, :fill, halign=:left, valign=:baseline)
sethue("blue")
textoutlines("Luxor", O, :stroke, halign=:left, valign=:baseline)
end
end
end
fontsize(80)
get_path("Luxor")
sethue("magenta")
@test finish() == true
println("...finished test: output in $(fname)")
end
get_path_test("get-path-test.pdf")
|
{
"pile_set_name": "Github"
}
|
{
"name": "@isaacs/prod-dep-enotarget",
"version": "1.0.0",
"description": "a production dep that is not satisfiable",
"dependencies": {
"tap": "9999.0000.9999"
}
}
|
{
"pile_set_name": "Github"
}
|
<Canvas>
<Kind>42</Kind>
<Name>Jellyus Oneus</Name>
<IsMinified>1</IsMinified>
<XPosition>1.000000000</XPosition>
<YPosition>1.000000000</YPosition>
</Canvas>
<Widget>
<Kind>6</Kind>
<Name>body h range</Name>
<HighValue>0.522167504</HighValue>
<LowValue>0.423645318</LowValue>
</Widget>
<Widget>
<Kind>25</Kind>
<Name>body s</Name>
<Value>0.719211817</Value>
</Widget>
<Widget>
<Kind>25</Kind>
<Name>body b</Name>
<Value>1.000000000</Value>
</Widget>
<Widget>
<Kind>25</Kind>
<Name>body alpha</Name>
<Value>0.113300495</Value>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>tentacles h range</Name>
<HighValue>0.507389188</HighValue>
<LowValue>0.438423634</LowValue>
</Widget>
<Widget>
<Kind>25</Kind>
<Name>tentacles s</Name>
<Value>0.684729040</Value>
</Widget>
<Widget>
<Kind>25</Kind>
<Name>tentacles b</Name>
<Value>1.000000000</Value>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>pulse amt (range)</Name>
<HighValue>0.364532053</HighValue>
<LowValue>0.230541989</LowValue>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>width range</Name>
<HighValue>50.246303558</HighValue>
<LowValue>34.334976196</LowValue>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>length range</Name>
<HighValue>127.931037903</HighValue>
<LowValue>112.019706726</LowValue>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>spherical segment (range)</Name>
<HighValue>2.143399715</HighValue>
<LowValue>1.586270094</LowValue>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>superformula m1 (range)</Name>
<HighValue>15.832513809</HighValue>
<LowValue>12.463053703</LowValue>
</Widget>
<Widget>
<Kind>6</Kind>
<Name>superformula m2 (range)</Name>
<HighValue>9.359607697</HighValue>
<LowValue>5.990146637</LowValue>
</Widget>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Routing.Patterns;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Routing.Matching
{
public class DefaultEndpointSelectorTest
{
[Fact]
public async Task SelectAsync_NoCandidates_DoesNothing()
{
// Arrange
var endpoints = new RouteEndpoint[] { };
var scores = new int[] { };
var candidateSet = CreateCandidateSet(endpoints, scores);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Null(context.Endpoint);
}
[Fact]
public async Task SelectAsync_NoValidCandidates_DoesNothing()
{
// Arrange
var endpoints = new RouteEndpoint[] { CreateEndpoint("/test"), };
var scores = new int[] { 0, };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet[0].Values = new RouteValueDictionary();
candidateSet.SetValidity(0, false);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Null(context.Endpoint);
}
[Fact]
public async Task SelectAsync_SingleCandidate_ChoosesCandidate()
{
// Arrange
var endpoints = new RouteEndpoint[] { CreateEndpoint("/test"), };
var scores = new int[] { 0, };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet[0].Values = new RouteValueDictionary();
candidateSet.SetValidity(0, true);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Same(endpoints[0], context.Endpoint);
}
[Fact]
public async Task SelectAsync_SingleValidCandidate_ChoosesCandidate()
{
// Arrange
var endpoints = new RouteEndpoint[] { CreateEndpoint("/test1"), CreateEndpoint("/test2"), };
var scores = new int[] { 0, 0 };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet.SetValidity(0, false);
candidateSet.SetValidity(1, true);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Same(endpoints[1], context.Endpoint);
}
[Fact]
public async Task SelectAsync_SingleValidCandidateInGroup_ChoosesCandidate()
{
// Arrange
var endpoints = new RouteEndpoint[] { CreateEndpoint("/test1"), CreateEndpoint("/test2"), CreateEndpoint("/test3"), };
var scores = new int[] { 0, 0, 1 };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet.SetValidity(0, false);
candidateSet.SetValidity(1, true);
candidateSet.SetValidity(2, true);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Same(endpoints[1], context.Endpoint);
}
[Fact]
public async Task SelectAsync_ManyGroupsLastCandidate_ChoosesCandidate()
{
// Arrange
var endpoints = new RouteEndpoint[]
{
CreateEndpoint("/test1"),
CreateEndpoint("/test2"),
CreateEndpoint("/test3"),
CreateEndpoint("/test4"),
CreateEndpoint("/test5"),
};
var scores = new int[] { 0, 1, 2, 3, 4 };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet.SetValidity(0, false);
candidateSet.SetValidity(1, false);
candidateSet.SetValidity(2, false);
candidateSet.SetValidity(3, false);
candidateSet.SetValidity(4, true);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
await selector.SelectAsync(httpContext, context, candidateSet);
// Assert
Assert.Same(endpoints[4], context.Endpoint);
}
[Fact]
public async Task SelectAsync_MultipleValidCandidatesInGroup_ReportsAmbiguity()
{
// Arrange
var endpoints = new RouteEndpoint[] { CreateEndpoint("/test1"), CreateEndpoint("/test2"), CreateEndpoint("/test3"), };
var scores = new int[] { 0, 1, 1 };
var candidateSet = CreateCandidateSet(endpoints, scores);
candidateSet.SetValidity(0, false);
candidateSet.SetValidity(1, true);
candidateSet.SetValidity(2, true);
var (httpContext, context) = CreateContext();
var selector = CreateSelector();
// Act
var ex = await Assert.ThrowsAsync<AmbiguousMatchException>(() => selector.SelectAsync(httpContext, context, candidateSet));
// Assert
Assert.Equal(
@"The request matched multiple endpoints. Matches:
test: /test2
test: /test3", ex.Message);
Assert.Null(context.Endpoint);
}
private static (HttpContext httpContext, EndpointSelectorContext context) CreateContext()
{
var context = new EndpointSelectorContext();
var httpContext = new DefaultHttpContext();
httpContext.Features.Set<IEndpointFeature>(context);
httpContext.Features.Set<IRouteValuesFeature>(context);
return (httpContext, context);
}
private static RouteEndpoint CreateEndpoint(string template)
{
return new RouteEndpoint(
TestConstants.EmptyRequestDelegate,
RoutePatternFactory.Parse(template),
0,
EndpointMetadataCollection.Empty,
$"test: {template}");
}
private static CandidateSet CreateCandidateSet(RouteEndpoint[] endpoints, int[] scores)
{
return new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], scores);
}
private static DefaultEndpointSelector CreateSelector()
{
return new DefaultEndpointSelector();
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
|
{
"pile_set_name": "Github"
}
|
/*
Language: SQL
Contributors: Nikolay Lisienko <info@neor.ru>, Heiko August <post@auge8472.de>, Travis Odom <travis.a.odom@gmail.com>
*/
function(hljs) {
var COMMENT_MODE = {
className: 'comment',
begin: '--', end: '$'
};
return {
case_insensitive: true,
illegal: /[<>]/,
contains: [
{
className: 'operator',
beginKeywords:
'begin end start commit rollback savepoint lock alter create drop rename call '+
'delete do handler insert load replace select truncate update set show pragma grant '+
'merge describe use explain help declare prepare execute deallocate savepoint release '+
'unlock purge reset change stop analyze cache flush optimize repair kill '+
'install uninstall checksum restore check backup',
end: /;/, endsWithParent: true,
keywords: {
keyword:
'abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter ' +
'analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup ' +
'before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by ' +
'cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length ' +
'character_length charindex charset check checksum checksum_agg choose close coalesce ' +
'coercibility collate collation collationproperty column columns columns_updated commit compress concat ' +
'concat_ws concurrent connect connection connection_id consistent constraint constraints continue ' +
'contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist ' +
'curdate current current_date current_time current_timestamp current_user cursor curtime data database ' +
'databases datalength date_add date_format date_sub dateadd datediff datefromparts datename ' +
'datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear ' +
'deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt ' +
'des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct ' +
'distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec ' +
'engine engines eomonth errors escape escaped event eventdata events except exception exec execute ' +
'exists exp explain export_set extended external extract fast fetch field fields find_in_set ' +
'first first_value floor flush for force foreign format found found_rows from from_base64 ' +
'from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant ' +
'grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help ' +
'hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore ' +
'iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner ' +
'innodb input insert install instr intersect into is is_free_lock is_ipv4 ' +
'is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill ' +
'language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level ' +
'like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile ' +
'logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max ' +
'md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names ' +
'national natural nchar next no no_write_to_binlog not now nullif nvarchar oct ' +
'octet_length of old_password on only open optimize option optionally or ord order outer outfile output ' +
'pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add ' +
'period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges ' +
'procedure procedure_analyze processlist profile profiles public publishingservername purge quarter ' +
'query quick quote quotename radians rand read references regexp relative relaylog release ' +
'release_lock rename repair repeat replace replicate reset restore restrict return returns reverse ' +
'revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll ' +
'sec_to_time second section select serializable server session session_user set sha sha1 sha2 share ' +
'show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex ' +
'sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache ' +
'sql_small_result sql_variant_property sqlstate sqrt square start starting status std ' +
'stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff ' +
'subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset ' +
'system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time ' +
'time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour ' +
'timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation ' +
'trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress ' +
'uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade ' +
'upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short ' +
'validate_password_strength value values var var_pop var_samp variables variance varp ' +
'version view warnings week weekday weekofyear weight_string when whenever where with work write xml ' +
'xor year yearweek zon',
literal:
'true false null',
built_in:
'array bigint binary bit blob boolean char character date dec decimal float int integer interval number ' +
'numeric real serial smallint varchar varying int8 serial8 text'
},
contains: [
{
className: 'string',
begin: '\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
},
{
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}]
},
{
className: 'string',
begin: '`', end: '`',
contains: [hljs.BACKSLASH_ESCAPE]
},
hljs.C_NUMBER_MODE,
hljs.C_BLOCK_COMMENT_MODE,
COMMENT_MODE
]
},
hljs.C_BLOCK_COMMENT_MODE,
COMMENT_MODE
]
};
}
|
{
"pile_set_name": "Github"
}
|
/*
* Intel Core SoC Power Management Controller Driver
*
* Copyright (c) 2016, Intel Corporation.
* All Rights Reserved.
*
* Authors: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
* Vishwanath Somayaji <vishwanath.somayaji@intel.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/acpi.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/uaccess.h>
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include "intel_pmc_core.h"
#define ICPU(model, data) \
{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (kernel_ulong_t)data }
static struct pmc_dev pmc;
static const struct pmc_bit_map spt_pll_map[] = {
{"MIPI PLL", SPT_PMC_BIT_MPHY_CMN_LANE0},
{"GEN2 USB2PCIE2 PLL", SPT_PMC_BIT_MPHY_CMN_LANE1},
{"DMIPCIE3 PLL", SPT_PMC_BIT_MPHY_CMN_LANE2},
{"SATA PLL", SPT_PMC_BIT_MPHY_CMN_LANE3},
{},
};
static const struct pmc_bit_map spt_mphy_map[] = {
{"MPHY CORE LANE 0", SPT_PMC_BIT_MPHY_LANE0},
{"MPHY CORE LANE 1", SPT_PMC_BIT_MPHY_LANE1},
{"MPHY CORE LANE 2", SPT_PMC_BIT_MPHY_LANE2},
{"MPHY CORE LANE 3", SPT_PMC_BIT_MPHY_LANE3},
{"MPHY CORE LANE 4", SPT_PMC_BIT_MPHY_LANE4},
{"MPHY CORE LANE 5", SPT_PMC_BIT_MPHY_LANE5},
{"MPHY CORE LANE 6", SPT_PMC_BIT_MPHY_LANE6},
{"MPHY CORE LANE 7", SPT_PMC_BIT_MPHY_LANE7},
{"MPHY CORE LANE 8", SPT_PMC_BIT_MPHY_LANE8},
{"MPHY CORE LANE 9", SPT_PMC_BIT_MPHY_LANE9},
{"MPHY CORE LANE 10", SPT_PMC_BIT_MPHY_LANE10},
{"MPHY CORE LANE 11", SPT_PMC_BIT_MPHY_LANE11},
{"MPHY CORE LANE 12", SPT_PMC_BIT_MPHY_LANE12},
{"MPHY CORE LANE 13", SPT_PMC_BIT_MPHY_LANE13},
{"MPHY CORE LANE 14", SPT_PMC_BIT_MPHY_LANE14},
{"MPHY CORE LANE 15", SPT_PMC_BIT_MPHY_LANE15},
{},
};
static const struct pmc_bit_map spt_pfear_map[] = {
{"PMC", SPT_PMC_BIT_PMC},
{"OPI-DMI", SPT_PMC_BIT_OPI},
{"SPI / eSPI", SPT_PMC_BIT_SPI},
{"XHCI", SPT_PMC_BIT_XHCI},
{"SPA", SPT_PMC_BIT_SPA},
{"SPB", SPT_PMC_BIT_SPB},
{"SPC", SPT_PMC_BIT_SPC},
{"GBE", SPT_PMC_BIT_GBE},
{"SATA", SPT_PMC_BIT_SATA},
{"HDA-PGD0", SPT_PMC_BIT_HDA_PGD0},
{"HDA-PGD1", SPT_PMC_BIT_HDA_PGD1},
{"HDA-PGD2", SPT_PMC_BIT_HDA_PGD2},
{"HDA-PGD3", SPT_PMC_BIT_HDA_PGD3},
{"RSVD", SPT_PMC_BIT_RSVD_0B},
{"LPSS", SPT_PMC_BIT_LPSS},
{"LPC", SPT_PMC_BIT_LPC},
{"SMB", SPT_PMC_BIT_SMB},
{"ISH", SPT_PMC_BIT_ISH},
{"P2SB", SPT_PMC_BIT_P2SB},
{"DFX", SPT_PMC_BIT_DFX},
{"SCC", SPT_PMC_BIT_SCC},
{"RSVD", SPT_PMC_BIT_RSVD_0C},
{"FUSE", SPT_PMC_BIT_FUSE},
{"CAMERA", SPT_PMC_BIT_CAMREA},
{"RSVD", SPT_PMC_BIT_RSVD_0D},
{"USB3-OTG", SPT_PMC_BIT_USB3_OTG},
{"EXI", SPT_PMC_BIT_EXI},
{"CSE", SPT_PMC_BIT_CSE},
{"CSME_KVM", SPT_PMC_BIT_CSME_KVM},
{"CSME_PMT", SPT_PMC_BIT_CSME_PMT},
{"CSME_CLINK", SPT_PMC_BIT_CSME_CLINK},
{"CSME_PTIO", SPT_PMC_BIT_CSME_PTIO},
{"CSME_USBR", SPT_PMC_BIT_CSME_USBR},
{"CSME_SUSRAM", SPT_PMC_BIT_CSME_SUSRAM},
{"CSME_SMT", SPT_PMC_BIT_CSME_SMT},
{"RSVD", SPT_PMC_BIT_RSVD_1A},
{"CSME_SMS2", SPT_PMC_BIT_CSME_SMS2},
{"CSME_SMS1", SPT_PMC_BIT_CSME_SMS1},
{"CSME_RTC", SPT_PMC_BIT_CSME_RTC},
{"CSME_PSF", SPT_PMC_BIT_CSME_PSF},
{},
};
static const struct pmc_reg_map spt_reg_map = {
.pfear_sts = spt_pfear_map,
.mphy_sts = spt_mphy_map,
.pll_sts = spt_pll_map,
.slp_s0_offset = SPT_PMC_SLP_S0_RES_COUNTER_OFFSET,
.ltr_ignore_offset = SPT_PMC_LTR_IGNORE_OFFSET,
.regmap_length = SPT_PMC_MMIO_REG_LEN,
.ppfear0_offset = SPT_PMC_XRAM_PPFEAR0A,
.ppfear_buckets = SPT_PPFEAR_NUM_ENTRIES,
.pm_cfg_offset = SPT_PMC_PM_CFG_OFFSET,
.pm_read_disable_bit = SPT_PMC_READ_DISABLE_BIT,
};
/* Cannonlake: PGD PFET Enable Ack Status Register(s) bitmap */
static const struct pmc_bit_map cnp_pfear_map[] = {
{"PMC", BIT(0)},
{"OPI-DMI", BIT(1)},
{"SPI/eSPI", BIT(2)},
{"XHCI", BIT(3)},
{"SPA", BIT(4)},
{"SPB", BIT(5)},
{"SPC", BIT(6)},
{"GBE", BIT(7)},
{"SATA", BIT(0)},
{"HDA_PGD0", BIT(1)},
{"HDA_PGD1", BIT(2)},
{"HDA_PGD2", BIT(3)},
{"HDA_PGD3", BIT(4)},
{"SPD", BIT(5)},
{"LPSS", BIT(6)},
{"LPC", BIT(7)},
{"SMB", BIT(0)},
{"ISH", BIT(1)},
{"P2SB", BIT(2)},
{"NPK_VNN", BIT(3)},
{"SDX", BIT(4)},
{"SPE", BIT(5)},
{"Fuse", BIT(6)},
{"Res_23", BIT(7)},
{"CSME_FSC", BIT(0)},
{"USB3_OTG", BIT(1)},
{"EXI", BIT(2)},
{"CSE", BIT(3)},
{"csme_kvm", BIT(4)},
{"csme_pmt", BIT(5)},
{"csme_clink", BIT(6)},
{"csme_ptio", BIT(7)},
{"csme_usbr", BIT(0)},
{"csme_susram", BIT(1)},
{"csme_smt1", BIT(2)},
{"CSME_SMT4", BIT(3)},
{"csme_sms2", BIT(4)},
{"csme_sms1", BIT(5)},
{"csme_rtc", BIT(6)},
{"csme_psf", BIT(7)},
{"SBR0", BIT(0)},
{"SBR1", BIT(1)},
{"SBR2", BIT(2)},
{"SBR3", BIT(3)},
{"SBR4", BIT(4)},
{"SBR5", BIT(5)},
{"CSME_PECI", BIT(6)},
{"PSF1", BIT(7)},
{"PSF2", BIT(0)},
{"PSF3", BIT(1)},
{"PSF4", BIT(2)},
{"CNVI", BIT(3)},
{"UFS0", BIT(4)},
{"EMMC", BIT(5)},
{"SPF", BIT(6)},
{"SBR6", BIT(7)},
{"SBR7", BIT(0)},
{"NPK_AON", BIT(1)},
{"HDA_PGD4", BIT(2)},
{"HDA_PGD5", BIT(3)},
{"HDA_PGD6", BIT(4)},
{}
};
static const struct pmc_bit_map cnp_slps0_dbg0_map[] = {
{"AUDIO_D3", BIT(0)},
{"OTG_D3", BIT(1)},
{"XHCI_D3", BIT(2)},
{"LPIO_D3", BIT(3)},
{"SDX_D3", BIT(4)},
{"SATA_D3", BIT(5)},
{"UFS0_D3", BIT(6)},
{"UFS1_D3", BIT(7)},
{"EMMC_D3", BIT(8)},
{}
};
static const struct pmc_bit_map cnp_slps0_dbg1_map[] = {
{"SDIO_PLL_OFF", BIT(0)},
{"USB2_PLL_OFF", BIT(1)},
{"AUDIO_PLL_OFF", BIT(2)},
{"OC_PLL_OFF", BIT(3)},
{"MAIN_PLL_OFF", BIT(4)},
{"XOSC_OFF", BIT(5)},
{"LPC_CLKS_GATED", BIT(6)},
{"PCIE_CLKREQS_IDLE", BIT(7)},
{"AUDIO_ROSC_OFF", BIT(8)},
{"HPET_XOSC_CLK_REQ", BIT(9)},
{"PMC_ROSC_SLOW_CLK", BIT(10)},
{"AON2_ROSC_GATED", BIT(11)},
{"CLKACKS_DEASSERTED", BIT(12)},
{}
};
static const struct pmc_bit_map cnp_slps0_dbg2_map[] = {
{"MPHY_CORE_GATED", BIT(0)},
{"CSME_GATED", BIT(1)},
{"USB2_SUS_GATED", BIT(2)},
{"DYN_FLEX_IO_IDLE", BIT(3)},
{"GBE_NO_LINK", BIT(4)},
{"THERM_SEN_DISABLED", BIT(5)},
{"PCIE_LOW_POWER", BIT(6)},
{"ISH_VNNAON_REQ_ACT", BIT(7)},
{"ISH_VNN_REQ_ACT", BIT(8)},
{"CNV_VNNAON_REQ_ACT", BIT(9)},
{"CNV_VNN_REQ_ACT", BIT(10)},
{"NPK_VNNON_REQ_ACT", BIT(11)},
{"PMSYNC_STATE_IDLE", BIT(12)},
{"ALST_GT_THRES", BIT(13)},
{"PMC_ARC_PG_READY", BIT(14)},
{}
};
static const struct pmc_bit_map *cnp_slps0_dbg_maps[] = {
cnp_slps0_dbg0_map,
cnp_slps0_dbg1_map,
cnp_slps0_dbg2_map,
NULL,
};
static const struct pmc_reg_map cnp_reg_map = {
.pfear_sts = cnp_pfear_map,
.slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET,
.slps0_dbg_maps = cnp_slps0_dbg_maps,
.slps0_dbg_offset = CNP_PMC_SLPS0_DBG_OFFSET,
.ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET,
.regmap_length = CNP_PMC_MMIO_REG_LEN,
.ppfear0_offset = CNP_PMC_HOST_PPFEAR0A,
.ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES,
.pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
.pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
};
static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset)
{
return readb(pmcdev->regbase + offset);
}
static inline u32 pmc_core_reg_read(struct pmc_dev *pmcdev, int reg_offset)
{
return readl(pmcdev->regbase + reg_offset);
}
static inline void pmc_core_reg_write(struct pmc_dev *pmcdev, int
reg_offset, u32 val)
{
writel(val, pmcdev->regbase + reg_offset);
}
static inline u32 pmc_core_adjust_slp_s0_step(u32 value)
{
return value * SPT_PMC_SLP_S0_RES_COUNTER_STEP;
}
static int pmc_core_dev_state_get(void *data, u64 *val)
{
struct pmc_dev *pmcdev = data;
const struct pmc_reg_map *map = pmcdev->map;
u32 value;
value = pmc_core_reg_read(pmcdev, map->slp_s0_offset);
*val = pmc_core_adjust_slp_s0_step(value);
return 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(pmc_core_dev_state, pmc_core_dev_state_get, NULL, "%llu\n");
static int pmc_core_check_read_lock_bit(void)
{
struct pmc_dev *pmcdev = &pmc;
u32 value;
value = pmc_core_reg_read(pmcdev, pmcdev->map->pm_cfg_offset);
return value & BIT(pmcdev->map->pm_read_disable_bit);
}
#if IS_ENABLED(CONFIG_DEBUG_FS)
static bool slps0_dbg_latch;
static void pmc_core_display_map(struct seq_file *s, int index,
u8 pf_reg, const struct pmc_bit_map *pf_map)
{
seq_printf(s, "PCH IP: %-2d - %-32s\tState: %s\n",
index, pf_map[index].name,
pf_map[index].bit_mask & pf_reg ? "Off" : "On");
}
static int pmc_core_ppfear_sts_show(struct seq_file *s, void *unused)
{
struct pmc_dev *pmcdev = s->private;
const struct pmc_bit_map *map = pmcdev->map->pfear_sts;
u8 pf_regs[PPFEAR_MAX_NUM_ENTRIES];
int index, iter;
iter = pmcdev->map->ppfear0_offset;
for (index = 0; index < pmcdev->map->ppfear_buckets &&
index < PPFEAR_MAX_NUM_ENTRIES; index++, iter++)
pf_regs[index] = pmc_core_reg_read_byte(pmcdev, iter);
for (index = 0; map[index].name &&
index < pmcdev->map->ppfear_buckets * 8; index++)
pmc_core_display_map(s, index, pf_regs[index / 8], map);
return 0;
}
static int pmc_core_ppfear_sts_open(struct inode *inode, struct file *file)
{
return single_open(file, pmc_core_ppfear_sts_show, inode->i_private);
}
static const struct file_operations pmc_core_ppfear_ops = {
.open = pmc_core_ppfear_sts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* This function should return link status, 0 means ready */
static int pmc_core_mtpmc_link_status(void)
{
struct pmc_dev *pmcdev = &pmc;
u32 value;
value = pmc_core_reg_read(pmcdev, SPT_PMC_PM_STS_OFFSET);
return value & BIT(SPT_PMC_MSG_FULL_STS_BIT);
}
static int pmc_core_send_msg(u32 *addr_xram)
{
struct pmc_dev *pmcdev = &pmc;
u32 dest;
int timeout;
for (timeout = NUM_RETRIES; timeout > 0; timeout--) {
if (pmc_core_mtpmc_link_status() == 0)
break;
msleep(5);
}
if (timeout <= 0 && pmc_core_mtpmc_link_status())
return -EBUSY;
dest = (*addr_xram & MTPMC_MASK) | (1U << 1);
pmc_core_reg_write(pmcdev, SPT_PMC_MTPMC_OFFSET, dest);
return 0;
}
static int pmc_core_mphy_pg_sts_show(struct seq_file *s, void *unused)
{
struct pmc_dev *pmcdev = s->private;
const struct pmc_bit_map *map = pmcdev->map->mphy_sts;
u32 mphy_core_reg_low, mphy_core_reg_high;
u32 val_low, val_high;
int index, err = 0;
if (pmcdev->pmc_xram_read_bit) {
seq_puts(s, "Access denied: please disable PMC_READ_DISABLE setting in BIOS.");
return 0;
}
mphy_core_reg_low = (SPT_PMC_MPHY_CORE_STS_0 << 16);
mphy_core_reg_high = (SPT_PMC_MPHY_CORE_STS_1 << 16);
mutex_lock(&pmcdev->lock);
if (pmc_core_send_msg(&mphy_core_reg_low) != 0) {
err = -EBUSY;
goto out_unlock;
}
msleep(10);
val_low = pmc_core_reg_read(pmcdev, SPT_PMC_MFPMC_OFFSET);
if (pmc_core_send_msg(&mphy_core_reg_high) != 0) {
err = -EBUSY;
goto out_unlock;
}
msleep(10);
val_high = pmc_core_reg_read(pmcdev, SPT_PMC_MFPMC_OFFSET);
for (index = 0; map[index].name && index < 8; index++) {
seq_printf(s, "%-32s\tState: %s\n",
map[index].name,
map[index].bit_mask & val_low ? "Not power gated" :
"Power gated");
}
for (index = 8; map[index].name; index++) {
seq_printf(s, "%-32s\tState: %s\n",
map[index].name,
map[index].bit_mask & val_high ? "Not power gated" :
"Power gated");
}
out_unlock:
mutex_unlock(&pmcdev->lock);
return err;
}
static int pmc_core_mphy_pg_sts_open(struct inode *inode, struct file *file)
{
return single_open(file, pmc_core_mphy_pg_sts_show, inode->i_private);
}
static const struct file_operations pmc_core_mphy_pg_ops = {
.open = pmc_core_mphy_pg_sts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int pmc_core_pll_show(struct seq_file *s, void *unused)
{
struct pmc_dev *pmcdev = s->private;
const struct pmc_bit_map *map = pmcdev->map->pll_sts;
u32 mphy_common_reg, val;
int index, err = 0;
if (pmcdev->pmc_xram_read_bit) {
seq_puts(s, "Access denied: please disable PMC_READ_DISABLE setting in BIOS.");
return 0;
}
mphy_common_reg = (SPT_PMC_MPHY_COM_STS_0 << 16);
mutex_lock(&pmcdev->lock);
if (pmc_core_send_msg(&mphy_common_reg) != 0) {
err = -EBUSY;
goto out_unlock;
}
/* Observed PMC HW response latency for MTPMC-MFPMC is ~10 ms */
msleep(10);
val = pmc_core_reg_read(pmcdev, SPT_PMC_MFPMC_OFFSET);
for (index = 0; map[index].name ; index++) {
seq_printf(s, "%-32s\tState: %s\n",
map[index].name,
map[index].bit_mask & val ? "Active" : "Idle");
}
out_unlock:
mutex_unlock(&pmcdev->lock);
return err;
}
static int pmc_core_pll_open(struct inode *inode, struct file *file)
{
return single_open(file, pmc_core_pll_show, inode->i_private);
}
static const struct file_operations pmc_core_pll_ops = {
.open = pmc_core_pll_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static ssize_t pmc_core_ltr_ignore_write(struct file *file, const char __user
*userbuf, size_t count, loff_t *ppos)
{
struct pmc_dev *pmcdev = &pmc;
const struct pmc_reg_map *map = pmcdev->map;
u32 val, buf_size, fd;
int err = 0;
buf_size = count < 64 ? count : 64;
mutex_lock(&pmcdev->lock);
if (kstrtou32_from_user(userbuf, buf_size, 10, &val)) {
err = -EFAULT;
goto out_unlock;
}
if (val > NUM_IP_IGN_ALLOWED) {
err = -EINVAL;
goto out_unlock;
}
fd = pmc_core_reg_read(pmcdev, map->ltr_ignore_offset);
fd |= (1U << val);
pmc_core_reg_write(pmcdev, map->ltr_ignore_offset, fd);
out_unlock:
mutex_unlock(&pmcdev->lock);
return err == 0 ? count : err;
}
static int pmc_core_ltr_ignore_show(struct seq_file *s, void *unused)
{
return 0;
}
static int pmc_core_ltr_ignore_open(struct inode *inode, struct file *file)
{
return single_open(file, pmc_core_ltr_ignore_show, inode->i_private);
}
static const struct file_operations pmc_core_ltr_ignore_ops = {
.open = pmc_core_ltr_ignore_open,
.read = seq_read,
.write = pmc_core_ltr_ignore_write,
.llseek = seq_lseek,
.release = single_release,
};
static void pmc_core_slps0_dbg_latch(struct pmc_dev *pmcdev, bool reset)
{
const struct pmc_reg_map *map = pmcdev->map;
u32 fd;
mutex_lock(&pmcdev->lock);
if (!reset && !slps0_dbg_latch)
goto out_unlock;
fd = pmc_core_reg_read(pmcdev, map->slps0_dbg_offset);
if (reset)
fd &= ~CNP_PMC_LATCH_SLPS0_EVENTS;
else
fd |= CNP_PMC_LATCH_SLPS0_EVENTS;
pmc_core_reg_write(pmcdev, map->slps0_dbg_offset, fd);
slps0_dbg_latch = 0;
out_unlock:
mutex_unlock(&pmcdev->lock);
}
static int pmc_core_slps0_dbg_show(struct seq_file *s, void *unused)
{
struct pmc_dev *pmcdev = s->private;
const struct pmc_bit_map **maps = pmcdev->map->slps0_dbg_maps;
const struct pmc_bit_map *map;
int offset;
u32 data;
pmc_core_slps0_dbg_latch(pmcdev, false);
offset = pmcdev->map->slps0_dbg_offset;
while (*maps) {
map = *maps;
data = pmc_core_reg_read(pmcdev, offset);
offset += 4;
while (map->name) {
seq_printf(s, "SLP_S0_DBG: %-32s\tState: %s\n",
map->name,
data & map->bit_mask ?
"Yes" : "No");
++map;
}
++maps;
}
pmc_core_slps0_dbg_latch(pmcdev, true);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(pmc_core_slps0_dbg);
static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
{
debugfs_remove_recursive(pmcdev->dbgfs_dir);
}
static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
{
struct dentry *dir;
dir = debugfs_create_dir("pmc_core", NULL);
if (!dir)
return -ENOMEM;
pmcdev->dbgfs_dir = dir;
debugfs_create_file("slp_s0_residency_usec", 0444, dir, pmcdev,
&pmc_core_dev_state);
debugfs_create_file("pch_ip_power_gating_status", 0444, dir, pmcdev,
&pmc_core_ppfear_ops);
debugfs_create_file("ltr_ignore", 0644, dir, pmcdev,
&pmc_core_ltr_ignore_ops);
if (pmcdev->map->pll_sts)
debugfs_create_file("pll_status", 0444, dir, pmcdev,
&pmc_core_pll_ops);
if (pmcdev->map->mphy_sts)
debugfs_create_file("mphy_core_lanes_power_gating_status",
0444, dir, pmcdev,
&pmc_core_mphy_pg_ops);
if (pmcdev->map->slps0_dbg_maps) {
debugfs_create_file("slp_s0_debug_status", 0444,
dir, pmcdev,
&pmc_core_slps0_dbg_fops);
debugfs_create_bool("slp_s0_dbg_latch", 0644,
dir, &slps0_dbg_latch);
}
return 0;
}
#else
static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
{
return 0;
}
static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
{
}
#endif /* CONFIG_DEBUG_FS */
static const struct x86_cpu_id intel_pmc_core_ids[] = {
ICPU(INTEL_FAM6_SKYLAKE_MOBILE, &spt_reg_map),
ICPU(INTEL_FAM6_SKYLAKE_DESKTOP, &spt_reg_map),
ICPU(INTEL_FAM6_KABYLAKE_MOBILE, &spt_reg_map),
ICPU(INTEL_FAM6_KABYLAKE_DESKTOP, &spt_reg_map),
ICPU(INTEL_FAM6_CANNONLAKE_MOBILE, &cnp_reg_map),
{}
};
MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_ids);
static const struct pci_device_id pmc_pci_ids[] = {
{ PCI_VDEVICE(INTEL, SPT_PMC_PCI_DEVICE_ID), 0},
{ 0, },
};
static int __init pmc_core_probe(void)
{
struct pmc_dev *pmcdev = &pmc;
const struct x86_cpu_id *cpu_id;
u64 slp_s0_addr;
int err;
cpu_id = x86_match_cpu(intel_pmc_core_ids);
if (!cpu_id)
return -ENODEV;
pmcdev->map = (struct pmc_reg_map *)cpu_id->driver_data;
/*
* Coffeelake has CPU ID of Kabylake and Cannonlake PCH. So here
* Sunrisepoint PCH regmap can't be used. Use Cannonlake PCH regmap
* in this case.
*/
if (pmcdev->map == &spt_reg_map && !pci_dev_present(pmc_pci_ids))
pmcdev->map = &cnp_reg_map;
if (lpit_read_residency_count_address(&slp_s0_addr))
pmcdev->base_addr = PMC_BASE_ADDR_DEFAULT;
else
pmcdev->base_addr = slp_s0_addr - pmcdev->map->slp_s0_offset;
pmcdev->regbase = ioremap(pmcdev->base_addr,
pmcdev->map->regmap_length);
if (!pmcdev->regbase)
return -ENOMEM;
mutex_init(&pmcdev->lock);
pmcdev->pmc_xram_read_bit = pmc_core_check_read_lock_bit();
err = pmc_core_dbgfs_register(pmcdev);
if (err < 0) {
pr_warn(" debugfs register failed.\n");
iounmap(pmcdev->regbase);
return err;
}
pr_info(" initialized\n");
return 0;
}
module_init(pmc_core_probe)
static void __exit pmc_core_remove(void)
{
struct pmc_dev *pmcdev = &pmc;
pmc_core_dbgfs_unregister(pmcdev);
mutex_destroy(&pmcdev->lock);
iounmap(pmcdev->regbase);
}
module_exit(pmc_core_remove)
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Intel PMC Core Driver");
|
{
"pile_set_name": "Github"
}
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &386378731
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 386378732}
- component: {fileID: 386378733}
m_Layer: 0
m_Name: BattleField
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &386378732
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 386378731}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 592914184}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &386378733
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 386378731}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7f29a42b85d63d849bd066801f298574, type: 3}
m_Name:
m_EditorClassIdentifier:
gridUnitModel: {fileID: 114773941963292382, guid: b3f2aa9ec305bfe48bc93d89877b8566,
type: 2}
gridUnitsRoot: {fileID: 592914184}
--- !u!1 &486187354
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 486187356}
- component: {fileID: 486187355}
m_Layer: 0
m_Name: Main
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &486187355
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 486187354}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bec9030348a25ff478bd67336abefbfe, type: 3}
m_Name:
m_EditorClassIdentifier:
idx: 0
--- !u!4 &486187356
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 486187354}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &592914183
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 592914184}
m_Layer: 0
m_Name: GridUnits
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &592914184
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 592914183}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 386378732}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1788131204
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1788131208}
- component: {fileID: 1788131207}
- component: {fileID: 1788131206}
- component: {fileID: 1788131205}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1788131205
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1788131204}
m_Enabled: 1
--- !u!124 &1788131206
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1788131204}
m_Enabled: 1
--- !u!20 &1788131207
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1788131204}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 10
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1788131208
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1788131204}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 12.5, y: -9.2, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
{
"pile_set_name": "Github"
}
|
/**
* OWASP Benchmark Project v1.2
*
* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
*
* The OWASP Benchmark 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, version 2.
*
* The OWASP Benchmark 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.
*
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
* @created 2015
*/
package org.owasp.benchmark.testcode;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(value="/sqli-03/BenchmarkTest01474")
public class BenchmarkTest01474 extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String param = "";
boolean flag = true;
java.util.Enumeration<String> names = request.getParameterNames();
while (names.hasMoreElements() && flag) {
String name = (String) names.nextElement();
String[] values = request.getParameterValues(name);
if (values != null) {
for(int i=0;i<values.length && flag; i++){
String value = values[i];
if (value.equals("BenchmarkTest01474")) {
param = name;
flag = false;
}
}
}
}
String bar = new Test().doSomething(request, param);
String sql = "INSERT INTO users (username, password) VALUES ('foo','"+ bar + "')";
try {
java.sql.Statement statement = org.owasp.benchmark.helpers.DatabaseHelper.getSqlStatement();
int count = statement.executeUpdate( sql, java.sql.Statement.RETURN_GENERATED_KEYS );
org.owasp.benchmark.helpers.DatabaseHelper.outputUpdateComplete(sql, response);
} catch (java.sql.SQLException e) {
if (org.owasp.benchmark.helpers.DatabaseHelper.hideSQLErrors) {
response.getWriter().println(
"Error processing request."
);
return;
}
else throw new ServletException(e);
}
} // end doPost
private class Test {
public String doSomething(HttpServletRequest request, String param) throws ServletException, IOException {
String bar = "";
if (param != null) {
bar = new String( org.apache.commons.codec.binary.Base64.decodeBase64(
org.apache.commons.codec.binary.Base64.encodeBase64( param.getBytes() ) ));
}
return bar;
}
} // end innerclass Test
} // end DataflowThruInnerClass
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/dk_color_ffffff" />
<corners android:radius="10dp" />
</shape>
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
# frozen_string_literal: true
#--
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
#++
##
#--
# struct tarfile_entry_posix {
# char name[100]; # ASCII + (Z unless filled)
# char mode[8]; # 0 padded, octal, null
# char uid[8]; # ditto
# char gid[8]; # ditto
# char size[12]; # 0 padded, octal, null
# char mtime[12]; # 0 padded, octal, null
# char checksum[8]; # 0 padded, octal, null, space
# char typeflag[1]; # file: "0" dir: "5"
# char linkname[100]; # ASCII + (Z unless filled)
# char magic[6]; # "ustar\0"
# char version[2]; # "00"
# char uname[32]; # ASCIIZ
# char gname[32]; # ASCIIZ
# char devmajor[8]; # 0 padded, octal, null
# char devminor[8]; # o padded, octal, null
# char prefix[155]; # ASCII + (Z unless filled)
# };
#++
# A header for a tar file
class Gem::Package::TarHeader
##
# Fields in the tar header
FIELDS = [
:checksum,
:devmajor,
:devminor,
:gid,
:gname,
:linkname,
:magic,
:mode,
:mtime,
:name,
:prefix,
:size,
:typeflag,
:uid,
:uname,
:version,
].freeze
##
# Pack format for a tar header
PACK_FORMAT = 'a100' + # name
'a8' + # mode
'a8' + # uid
'a8' + # gid
'a12' + # size
'a12' + # mtime
'a7a' + # chksum
'a' + # typeflag
'a100' + # linkname
'a6' + # magic
'a2' + # version
'a32' + # uname
'a32' + # gname
'a8' + # devmajor
'a8' + # devminor
'a155' # prefix
##
# Unpack format for a tar header
UNPACK_FORMAT = 'A100' + # name
'A8' + # mode
'A8' + # uid
'A8' + # gid
'A12' + # size
'A12' + # mtime
'A8' + # checksum
'A' + # typeflag
'A100' + # linkname
'A6' + # magic
'A2' + # version
'A32' + # uname
'A32' + # gname
'A8' + # devmajor
'A8' + # devminor
'A155' # prefix
attr_reader(*FIELDS)
EMPTY_HEADER = ("\0" * 512).freeze # :nodoc:
##
# Creates a tar header from IO +stream+
def self.from(stream)
header = stream.read 512
empty = (EMPTY_HEADER == header)
fields = header.unpack UNPACK_FORMAT
new :name => fields.shift,
:mode => strict_oct(fields.shift),
:uid => oct_or_256based(fields.shift),
:gid => oct_or_256based(fields.shift),
:size => strict_oct(fields.shift),
:mtime => strict_oct(fields.shift),
:checksum => strict_oct(fields.shift),
:typeflag => fields.shift,
:linkname => fields.shift,
:magic => fields.shift,
:version => strict_oct(fields.shift),
:uname => fields.shift,
:gname => fields.shift,
:devmajor => strict_oct(fields.shift),
:devminor => strict_oct(fields.shift),
:prefix => fields.shift,
:empty => empty
end
def self.strict_oct(str)
return str.oct if str =~ /\A[0-7]*\z/
raise ArgumentError, "#{str.inspect} is not an octal string"
end
def self.oct_or_256based(str)
# \x80 flags a positive 256-based number
# \ff flags a negative 256-based number
# In case we have a match, parse it as a signed binary value
# in big-endian order, except that the high-order bit is ignored.
return str.unpack('N2').last if str =~ /\A[\x80\xff]/n
strict_oct(str)
end
##
# Creates a new TarHeader using +vals+
def initialize(vals)
unless vals[:name] && vals[:size] && vals[:prefix] && vals[:mode]
raise ArgumentError, ":name, :size, :prefix and :mode required"
end
vals[:uid] ||= 0
vals[:gid] ||= 0
vals[:mtime] ||= 0
vals[:checksum] ||= ""
vals[:typeflag] = "0" if vals[:typeflag].nil? || vals[:typeflag].empty?
vals[:magic] ||= "ustar"
vals[:version] ||= "00"
vals[:uname] ||= "wheel"
vals[:gname] ||= "wheel"
vals[:devmajor] ||= 0
vals[:devminor] ||= 0
FIELDS.each do |name|
instance_variable_set "@#{name}", vals[name]
end
@empty = vals[:empty]
end
##
# Is the tar entry empty?
def empty?
@empty
end
def ==(other) # :nodoc:
self.class === other and
@checksum == other.checksum and
@devmajor == other.devmajor and
@devminor == other.devminor and
@gid == other.gid and
@gname == other.gname and
@linkname == other.linkname and
@magic == other.magic and
@mode == other.mode and
@mtime == other.mtime and
@name == other.name and
@prefix == other.prefix and
@size == other.size and
@typeflag == other.typeflag and
@uid == other.uid and
@uname == other.uname and
@version == other.version
end
def to_s # :nodoc:
update_checksum
header
end
##
# Updates the TarHeader's checksum
def update_checksum
header = header " " * 8
@checksum = oct calculate_checksum(header), 6
end
private
def calculate_checksum(header)
header.unpack("C*").inject { |a, b| a + b }
end
def header(checksum = @checksum)
header = [
name,
oct(mode, 7),
oct(uid, 7),
oct(gid, 7),
oct(size, 11),
oct(mtime, 11),
checksum,
" ",
typeflag,
linkname,
magic,
oct(version, 2),
uname,
gname,
oct(devmajor, 7),
oct(devminor, 7),
prefix
]
header = header.pack PACK_FORMAT
header << ("\0" * ((512 - header.size) % 512))
end
def oct(num, len)
"%0#{len}o" % num
end
end
|
{
"pile_set_name": "Github"
}
|
/*
* ==========================================================
* Grid
* ==========================================================
*/
.grid-1, .grid-2, .grid-3, .grid-4, .grid-5, .grid-6, .grid-7, .grid-8, .grid-9, .grid-10,
.grid-11, .grid-12, .grid-13, .grid-14, .grid-15, .grid-16 {
float: right;
}
/*
* ==========================================================
* Alpha - Omega
* ==========================================================
*/
.omega {
margin-right: 10px;
margin-left: 0 !important;
}
.alpha {
margin-left: 10px;
margin-right: 0 !important;
}
/*
* ==========================================================
* Prefix
* ==========================================================
*/
.container-16 .prefix-1 {
padding-left: 0;
padding-right: 75px;
}
.container-16 .prefix-2 {
padding-left: 0;
padding-right: 150px;
}
.container-16 .prefix-3 {
padding-left: 0;
padding-right: 225px;
}
.container-16 .prefix-4 {
padding-left: 0;
padding-right: 300px;
}
.container-16 .prefix-5 {
padding-left: 0;
padding-right: 375px;
}
.container-16 .prefix-6 {
padding-left: 0;
padding-right: 450px;
}
.container-16 .prefix-7 {
padding-left: 0;
padding-right: 525px;
}
.container-16 .prefix-8 {
padding-left: 0;
padding-right: 600px;
}
.container-16 .prefix-9 {
padding-left: 0;
padding-right: 675px;
}
.container-16 .prefix-10 {
padding-left: 0;
padding-right: 750px;
}
.container-16 .prefix-11 {
padding-left: 0;
padding-right: 825px;
}
.container-16 .prefix-12 {
padding-left: 0;
padding-right: 900px;
}
.container-16 .prefix-13 {
padding-left: 0;
padding-right: 975px;
}
.container-16 .prefix-14 {
padding-left: 0;
padding-right: 1050px;
}
.container-16 .prefix-15 {
padding-left: 0;
padding-right: 1125px;
}
/*
* ==========================================================
* Suffix
* ==========================================================
*/
.container-16 .suffix-1 {
padding-right: 0;
padding-left: 75px;
}
.container-16 .suffix-2 {
padding-right: 0;
padding-left: 150px;
}
.container-16 .suffix-3 {
padding-right: 0;
padding-left: 225px;
}
.container-16 .suffix-4 {
padding-right: 0;
padding-left: 300px;
}
.container-16 .suffix-5 {
padding-right: 0;
padding-left: 375px;
}
.container-16 .suffix-6 {
padding-right: 0;
padding-left: 450px;
}
.container-16 .suffix-7 {
padding-right: 0;
padding-left: 525px;
}
.container-16 .suffix-8 {
padding-right: 0;
padding-left: 600px;
}
.container-16 .suffix-9 {
padding-right: 0;
padding-left: 675px;
}
.container-16 .suffix-10 {
padding-right: 0;
padding-left: 750px;
}
.container-16 .suffix-11 {
padding-right: 0;
padding-left: 825px;
}
.container-16 .suffix-12 {
padding-right: 0;
padding-left: 900px;
}
.container-16 .suffix-13 {
padding-right: 0;
padding-left: 975px;
}
.container-16 .suffix-14 {
padding-right: 0;
padding-left: 1050px;
}
.container-16 .suffix-15 {
padding-right: 0;
padding-left: 1125px;
}
/*
* ==========================================================
* Push
* ==========================================================
*/
.container-16 .push-1 {
right: 75px;
}
.container-16 .push-2 {
right: 150px;
}
.container-16 .push-3 {
right: 225px;
}
.container-16 .push-4 {
right: 300px;
}
.container-16 .push-5 {
right: 375px;
}
.container-16 .push-6 {
right: 450px;
}
.container-16 .push-7 {
right: 525px;
}
.container-16 .push-8 {
right: 600px;
}
.container-16 .push-9 {
right: 675px;
}
.container-16 .push-10 {
right: 750px;
}
.container-16 .push-11 {
right: 825px;
}
.container-16 .push-12 {
right: 900px;
}
.container-16 .push-13 {
right: 975px;
}
.container-16 .push-14 {
right: 1050px;
}
.container-16 .push-15 {
right: 1125px;
}
/*
* ==========================================================
* Pull
* ==========================================================
*/
.container-16 .pull-1 {
right: -75px;
}
.container-16 .pull-2 {
right: -150px;
}
.container-16 .pull-3 {
right: -225px;
}
.container-16 .pull-4 {
right: -300px;
}
.container-16 .pull-5 {
right: -375px;
}
.container-16 .pull-6 {
right: -450px;
}
.container-16 .pull-7 {
right: -525px;
}
.container-16 .pull-8 {
right: -600px;
}
.container-16 .pull-9 {
right: -675px;
}
.container-16 .pull-10 {
right: -750px;
}
.container-16 .pull-11 {
right: -825px;
}
.container-16 .pull-12 {
right: -900px;
}
.container-16 .pull-13 {
right: -975px;
}
.container-16 .pull-14 {
right: -1050px;
}
.container-16 .pull-15 {
right: -1125px;
}
|
{
"pile_set_name": "Github"
}
|
---
title: Jest 11.0
author: Christoph Nakazawa
authorURL: http://twitter.com/cpojer
authorFBID: 100000023028168
---
Today we're announcing a switch to major revisions for Jest with Jest 11.0 being the first major release. Jest has been used by Facebook engineers and on our continuous integration systems for years and we believe Jest has been way beyond a “1.0 release” for a long time. This is similar to a change [the React team has made](http://facebook.github.io/react/blog/2016/02/19/new-versioning-scheme.html).
If you are using Jest 0.9 or Jest 0.10 the upgrade should be seamless. All changes from the last few months were rolled into Jest 11.0.
### New in Jest 11.0.
#### Babel Integration and Simplified Setup
`babel-jest` was adopted within the newly modularized Jest [repository](https://github.com/facebook/jest/tree/master/packages) and it is now seamlessly integrated into Jest. If you are upgrading from an older version of Jest or are looking to adopt Jest, we recommend reading the [Getting Started guide](https://jestjs.io/docs/getting-started.html).
<!--truncate-->
Previously Jest provided APIs such as `jest.dontMock` which unmocks a module that is subsequently being required using the `require` function. Testing code usually looked like this:
```javascript
jest.dontMock('LikeButton');
const LikeButton = require('LikeButton'); // LikeButton is unmocked
```
However, together with ES2015 import statements this will no longer work. Per the specification `import`s are hoisted to the top of their code block. Code written like this:
```javascript
jest.dontMock('LikeButton');
import LikeButton from 'LikeButton';
```
when executed, would actually be run in this order:
```javascript
import LikeButton from 'LikeButton'; // This happens before the dontMock call.
jest.dontMock('LikeButton');
```
The LikeButton module would therefore be mocked even though we explicitly call `dontMock`.
When the latest versions of Jest and babel-jest are used together, calls to the new APIs `jest.unmock`, `jest.mock`, `jest.disableAutomock` and `jest.enableAutomock` are hoisted to the top of their block, before ES2015 import statements.
```javascript
jest.unmock('LikeButton');
import LikeButton from 'LikeButton'; // LikeButton is properly unmocked!
```
#### (Auto)Mocking Improvements
We have made numerous improvements and bug fixes to Jest's automocking feature, improved npm3 support and added new manual mocking APIs. Many people have expressed a desire use Jest with the automocking feature disabled. A global configuration option [`automock`](https://jestjs.io/docs/api.html#automock-boolean), which can be set to `false`, was added.
We have also added two new APIs to simplify manual mocks. `jest.mock` specifies a manual mock factory for a specific test:
```
// Implement a mock for a hypothetical "sum" module.
jest.mock('sum', () => {
return (a, b) => a + b;
});
const sum = require('sum');
sum(1, 4); // 5
```
And `jest.fn` was added to make it easier to create mock functions:
```
// Create a mock function
const mockFn = jest.fn(() => 42);
mockFn(); // 42
expect(mockFn.calls.length).toEqual(1);
```
#### Performance
We recently wrote about some [performance improvements](https://jestjs.io/blog/2016/03/11/javascript-unit-testing-performance.html) we've made in Jest. Most notably, startup time has been improved and we are now in a comfortable place with regards to performance.
#### Jasmine and Test Assertion Improvements
When Jest was open sourced it shipped with Jasmine 1. Jest was designed to work with any test assertion library and optional Jasmine 2 support was added through an [external contribution](https://github.com/facebook/jest/pull/330) at the end of last year. This change delivers better performance and provides a better APIs over the previous version of Jasmine. As such, we have converted all our JavaScript tests at Facebook to Jasmine 2. With Jest 11 we are making Jasmine 2 the new default. Jasmine 1 can be enabled through the [`testRunner`](https://jestjs.io/docs/api.html#testrunner-string) configuration option.
We have also made many updates around Jasmine. The failure messages for custom matchers provided for Jest's mock functions were improved and will now also work for Jasmine spies. Skipped tests, when using `fit` or `fdescribe,` are now properly reported at the end of a test run.
#### Other Changes
The `jest --watch` command has been rewritten and improved. By default it now only runs tests related to changed files. If you want to run all tests on every change, you can run `jest --watch=all`. The verbose logger output has also been improved and we've added more helpful warnings and error messages. We added a [`testEnvironment`](https://jestjs.io/docs/api.html#testenvironment-string) configuration option to customize the test environment. For example, when building a node service, a special `node` environment instead of `jsdom` can be used. Finally, the website and all documentation have been completely rewritten.
All changes from the past few months can be found in the [CHANGELOG](https://github.com/facebook/jest/blob/master/CHANGELOG.md).
### Contributions And Jest's future
Over the last six months, Jest has received significant changes from a huge number of new contributors. I'd like to thank all the open source contributors and Facebook employees for their help in making Jest better for everyone. New contributors: Alexander Juarez, Christian Lentfort, Cristian Carlesso, Dan Abramov, Dmitrii Abramov, Evan Jacobs, James Friend, James Ide, Jeff Carpenter, Joe Lencioni, Michael Diolosa, Nik Graf, Pavel Prokopenko, Pavel Volokitin, Sebastian Mayr and ShihChi Huang.
With your support we are looking forward to making Jest even better in the coming months. We are currently working on improved React (Native) testing, enhanced code coverage support and are planning to open source our internal test runner that allows multiple Jest projects to be run with a single run-command.
|
{
"pile_set_name": "Github"
}
|
var convert = require('./convert'),
func = convert('isNative', require('../isNative'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
|
{
"pile_set_name": "Github"
}
|
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2018 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// 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.
syntax = "proto3";
package test.b.part2;
option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1;beta";
message M2 {}
|
{
"pile_set_name": "Github"
}
|
SUBROUTINE ccsdt_lambda1_16_4(d_a,k_a_offset,d_b,k_b_offset,d_c,k_
&c_offset)
C $Id$
C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0
C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002)
C i1 ( h2 p11 h10 p12 )_ytt + = 1/2 * Sum ( h5 h6 p3 ) * t ( p3 p11 h5 h6 )_t * i2 ( h2 h5 h6 h10 p3 p12 )_yt
IMPLICIT NONE
#include "global.fh"
#include "mafdecls.fh"
#include "sym.fh"
#include "errquit.fh"
#include "tce.fh"
INTEGER d_a
INTEGER k_a_offset
INTEGER d_b
INTEGER k_b_offset
INTEGER d_c
INTEGER k_c_offset
INTEGER NXTASK
INTEGER next
INTEGER nprocs
INTEGER count
INTEGER h2b
INTEGER p11b
INTEGER h10b
INTEGER p12b
INTEGER dimc
INTEGER l_c_sort
INTEGER k_c_sort
INTEGER p3b
INTEGER h5b
INTEGER h6b
INTEGER p11b_1
INTEGER p3b_1
INTEGER h5b_1
INTEGER h6b_1
INTEGER h2b_2
INTEGER h5b_2
INTEGER h6b_2
INTEGER h10b_2
INTEGER p12b_2
INTEGER p3b_2
INTEGER dim_common
INTEGER dima_sort
INTEGER dima
INTEGER dimb_sort
INTEGER dimb
INTEGER l_a_sort
INTEGER k_a_sort
INTEGER l_a
INTEGER k_a
INTEGER l_b_sort
INTEGER k_b_sort
INTEGER l_b
INTEGER k_b
INTEGER nsubh(2)
INTEGER isubh
INTEGER l_c
INTEGER k_c
DOUBLE PRECISION FACTORIAL
EXTERNAL NXTASK
EXTERNAL FACTORIAL
nprocs = GA_NNODES()
count = 0
next = NXTASK(nprocs,1)
DO h2b = 1,noab
DO p11b = noab+1,noab+nvab
DO h10b = 1,noab
DO p12b = noab+1,noab+nvab
IF (next.eq.count) THEN
IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-
&1)+int_mb(k_spin+h10b-1)+int_mb(k_spin+p12b-1).ne.8)) THEN
IF (int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+
&h10b-1)+int_mb(k_spin+p12b-1)) THEN
IF (ieor(int_mb(k_sym+h2b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_mb
&(k_sym+h10b-1),int_mb(k_sym+p12b-1)))) .eq. ieor(irrep_y,ieor(irre
&p_t,irrep_t))) THEN
dimc = int_mb(k_range+h2b-1) * int_mb(k_range+p11b-1) * int_mb(k_r
&ange+h10b-1) * int_mb(k_range+p12b-1)
IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL
& ERRQUIT('ccsdt_lambda1_16_4',0,MA_ERR)
CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1)
DO p3b = noab+1,noab+nvab
DO h5b = 1,noab
DO h6b = h5b,noab
IF (int_mb(k_spin+p11b-1)+int_mb(k_spin+p3b-1) .eq. int_mb(k_spin+
&h5b-1)+int_mb(k_spin+h6b-1)) THEN
IF (ieor(int_mb(k_sym+p11b-1),ieor(int_mb(k_sym+p3b-1),ieor(int_mb
&(k_sym+h5b-1),int_mb(k_sym+h6b-1)))) .eq. irrep_t) THEN
CALL TCE_RESTRICTED_4(p11b,p3b,h5b,h6b,p11b_1,p3b_1,h5b_1,h6b_1)
CALL TCE_RESTRICTED_6(h2b,h5b,h6b,h10b,p12b,p3b,h2b_2,h5b_2,h6b_2,
&h10b_2,p12b_2,p3b_2)
dim_common = int_mb(k_range+p3b-1) * int_mb(k_range+h5b-1) * int_m
&b(k_range+h6b-1)
dima_sort = int_mb(k_range+p11b-1)
dima = dim_common * dima_sort
dimb_sort = int_mb(k_range+h2b-1) * int_mb(k_range+h10b-1) * int_m
&b(k_range+p12b-1)
dimb = dim_common * dimb_sort
IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN
IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL
& ERRQUIT('ccsdt_lambda1_16_4',1,MA_ERR)
IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT('
&ccsdt_lambda1_16_4',2,MA_ERR)
IF ((p3b .le. p11b)) THEN
CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h6b_1
& - 1 + noab * (h5b_1 - 1 + noab * (p11b_1 - noab - 1 + nvab * (p3b
&_1 - noab - 1)))))
CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p3b-1)
&,int_mb(k_range+p11b-1),int_mb(k_range+h5b-1),int_mb(k_range+h6b-1
&),2,4,3,1,1.0d0)
END IF
IF ((p11b .lt. p3b)) THEN
CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h6b_1
& - 1 + noab * (h5b_1 - 1 + noab * (p3b_1 - noab - 1 + nvab * (p11b
&_1 - noab - 1)))))
CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p11b-1
&),int_mb(k_range+p3b-1),int_mb(k_range+h5b-1),int_mb(k_range+h6b-1
&),1,4,3,2,-1.0d0)
END IF
IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('ccsdt_lambda1_16_4',3,MA
&_ERR)
IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL
& ERRQUIT('ccsdt_lambda1_16_4',4,MA_ERR)
IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT('
&ccsdt_lambda1_16_4',5,MA_ERR)
IF ((h10b .le. p3b) .and. (p3b .le. p12b)) THEN
CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p12b_
&2 - noab - 1 + nvab * (p3b_2 - noab - 1 + nvab * (h10b_2 - 1 + noa
&b * (h6b_2 - 1 + noab * (h5b_2 - 1 + noab * (h2b_2 - 1)))))))
CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1)
&,int_mb(k_range+h5b-1),int_mb(k_range+h6b-1),int_mb(k_range+h10b-1
&),int_mb(k_range+p3b-1),int_mb(k_range+p12b-1),6,4,1,3,2,5,1.0d0)
END IF
IF ((p12b .lt. p3b)) THEN
CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p3b_2
& - noab - 1 + nvab * (p12b_2 - noab - 1 + nvab * (h10b_2 - 1 + noa
&b * (h6b_2 - 1 + noab * (h5b_2 - 1 + noab * (h2b_2 - 1)))))))
CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1)
&,int_mb(k_range+h5b-1),int_mb(k_range+h6b-1),int_mb(k_range+h10b-1
&),int_mb(k_range+p12b-1),int_mb(k_range+p3b-1),5,4,1,3,2,6,-1.0d0)
END IF
IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('ccsdt_lambda1_16_4',6,MA
&_ERR)
nsubh(1) = 1
nsubh(2) = 1
isubh = 1
IF (h5b .eq. h6b) THEN
nsubh(isubh) = nsubh(isubh) + 1
ELSE
isubh = isubh + 1
END IF
CALL DGEMM('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL(
&nsubh(1))/FACTORIAL(nsubh(2)),dbl_mb(k_a_sort),dim_common,dbl_mb(k
&_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort)
IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('ccsdt_lambda1_16_4'
&,7,MA_ERR)
IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('ccsdt_lambda1_16_4'
&,8,MA_ERR)
END IF
END IF
END IF
END DO
END DO
END DO
IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT('
&ccsdt_lambda1_16_4',9,MA_ERR)
CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p12b-1
&),int_mb(k_range+h10b-1),int_mb(k_range+h2b-1),int_mb(k_range+p11b
&-1),3,4,2,1,1.0d0/2.0d0)
CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p12b
&- noab - 1 + nvab * (h10b - 1 + noab * (p11b - noab - 1 + nvab * (
&h2b - 1)))))
IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('ccsdt_lambda1_16_4',10,M
&A_ERR)
IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('ccsdt_lambda1_16_4'
&,11,MA_ERR)
END IF
END IF
END IF
next = NXTASK(nprocs,1)
END IF
count = count + 1
END DO
END DO
END DO
END DO
next = NXTASK(-nprocs,1)
call GA_SYNC()
RETURN
END
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the repository root.
package com.microsoft.tfs.client.common.ui.controls.vc.checkin;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import com.microsoft.tfs.client.common.ui.controls.vc.changes.ChangeItem;
import com.microsoft.tfs.client.common.ui.controls.vc.checkin.NotesCheckinControl.CheckinNoteEvent;
import com.microsoft.tfs.client.common.ui.controls.vc.checkin.NotesCheckinControl.CheckinNoteListener;
import com.microsoft.tfs.client.common.ui.framework.viewer.CheckboxEvent;
import com.microsoft.tfs.client.common.ui.framework.viewer.CheckboxListener;
import com.microsoft.tfs.client.common.ui.framework.viewer.ElementEvent;
import com.microsoft.tfs.client.common.ui.framework.viewer.ElementListener;
import com.microsoft.tfs.core.clients.versioncontrol.soapextensions.PendingChange;
import com.microsoft.tfs.core.pendingcheckin.PendingCheckin;
import com.microsoft.tfs.util.Check;
/**
* <p>
* Implements all the event listener interfaces needed to handle the events from
* {@link CheckinControl}'s subcontrols that would require a
* {@link PendingCheckin} to be updated with new control data. For example, when
* a user types text in the comment field in the source files subcontrol, an
* instance of this class gets the event and updates a {@link PendingCheckin}.
* </p>
* <p>
* An alternative to this design would be to have the controls directly
* implement the {@link PendingCheckin} interface (and subcontrols would
* implement sub-interfaces). One drawback to that alternative is thread-safety:
* a {@link PendingCheckin} needs to be safe to use from any thread, and UI
* controls aren't, so they need to marshall all their data when queried.
* </p>
* <p>
* This class is meant to be used exclusively from the UI thread.
* </p>
*
* @threadsafety thread-compatible
*/
class PendingCheckinUpdater {
private final static Log log = LogFactory.getLog(PendingCheckinUpdater.class);
private final PendingCheckin pendingCheckin;
private final CheckinControl checkinControl;
/**
* Implements {@link CheckboxListener} and {@link ElementListener} so it can
* be attached to the source files table and do the same thing for both type
* of events.
*
* @threadsafety thread-compatible
*/
private class SourceFilesCheckboxAndElementListener implements CheckboxListener, ElementListener {
@Override
public void checkedElementsChanged(final CheckboxEvent event) {
log.trace("updating pending checkin checked source control items"); //$NON-NLS-1$
updatePendingCheckin();
}
@Override
public void elementsChanged(final ElementEvent event) {
log.trace("updating pending checkin all source control items"); //$NON-NLS-1$
updatePendingCheckin();
}
private void updatePendingCheckin() {
/*
* Update all pending changes first, because updating selected
* pending changes fires the event and we want the up-to-date info
* in the pending checkin.
*/
final PendingChange[] allPendingChanges = ChangeItem.getPendingChanges(
checkinControl.getSourceFilesSubControl().getChangesTable().getChangeItems());
pendingCheckin.getPendingChanges().setAllPendingChanges(allPendingChanges);
final PendingChange[] checkedPendingChanges = ChangeItem.getPendingChanges(
checkinControl.getSourceFilesSubControl().getChangesTable().getCheckedChangeItems());
pendingCheckin.getPendingChanges().setCheckedPendingChanges(checkedPendingChanges);
}
};
/**
* Implements {@link CheckboxListener} and {@link ElementListener} so it can
* be attached to the work item table and do the same thing for both type of
* events.
*
* @threadsafety thread-compatible
*/
private class WorkItemCheckboxAndElementListener implements CheckboxListener, ElementListener {
@Override
public void checkedElementsChanged(final CheckboxEvent event) {
updatePendingCheckin();
}
@Override
public void elementsChanged(final ElementEvent event) {
updatePendingCheckin();
}
private void updatePendingCheckin() {
log.trace("updating pending checkin checked work items"); //$NON-NLS-1$
pendingCheckin.getWorkItems().setCheckedWorkItems(
checkinControl.getWorkItemSubControl().getWorkItemTable().getCheckedWorkItems());
}
};
private class CheckinNoteChangedListener implements CheckinNoteListener {
@Override
public void onCheckinNoteChanged(final CheckinNoteEvent e) {
log.trace("updating pending checkin notes"); //$NON-NLS-1$
pendingCheckin.getCheckinNotes().setCheckinNotes(checkinControl.getNotesSubControl().getCheckinNote());
}
}
/*
* Named instances of listeners so they can be hooked and unhooked easily.
*/
private final ModifyListener sourceFilesCommentModifyListener = new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
log.trace("updating pending checkin comment text"); //$NON-NLS-1$
pendingCheckin.getPendingChanges().setComment(checkinControl.getSourceFilesSubControl().getComment());
}
};
private final SourceFilesCheckboxAndElementListener sourceFilesCheckboxAndElementListener =
new SourceFilesCheckboxAndElementListener();
private final WorkItemCheckboxAndElementListener workItemsCheckboxAndElementListener =
new WorkItemCheckboxAndElementListener();
private final CheckinNoteChangedListener checkinNoteListener = new CheckinNoteChangedListener();
/**
* Creates a {@link PendingCheckinUpdater} which updates the given
* {@link PendingCheckin} when events from the given {@link CheckinControl}
* happen.
*
* @param pendingCheckin
* the {@link PendingCheckin} to update (must not be
* <code>null</code>)
* @param checkinControl
* the {@link CheckinControl} to watch (must not be <code>null</code>
* )
*/
public PendingCheckinUpdater(final PendingCheckin pendingCheckin, final CheckinControl checkinControl) {
Check.notNull(pendingCheckin, "pendingCheckin"); //$NON-NLS-1$
Check.notNull(checkinControl, "checkinControl"); //$NON-NLS-1$
this.pendingCheckin = pendingCheckin;
this.checkinControl = checkinControl;
this.checkinControl.getSourceFilesSubControl().getCommentText().addModifyListener(
sourceFilesCommentModifyListener);
/*
* A quirk of SWT is that the check box events are only fired for
* certain user interface actions (mouse clicks and such), and they are
* not fired when a list/table element is removed. So this class must
* hook up both checkbox listeners, and element listeners, and always
* update both the "all" and "checked" pending changes in the pending
* checkin when either event is fired.
*/
this.checkinControl.getSourceFilesSubControl().getChangesTable().addCheckboxListener(
sourceFilesCheckboxAndElementListener);
this.checkinControl.getSourceFilesSubControl().getChangesTable().addElementListener(
sourceFilesCheckboxAndElementListener);
this.checkinControl.getWorkItemSubControl().getWorkItemTable().addElementListener(
workItemsCheckboxAndElementListener);
this.checkinControl.getWorkItemSubControl().getWorkItemTable().addCheckboxListener(
workItemsCheckboxAndElementListener);
this.checkinControl.getNotesSubControl().addCheckinNoteChangedListener(checkinNoteListener);
}
/**
* Unhooks this object as a listener from all the event sources it
* originally subscribed to. The instance will not update the
* {@link PendingCheckin} after this method is called.
*/
public void unhookListeners() {
if (!checkinControl.getSourceFilesSubControl().getCommentText().isDisposed()) {
checkinControl.getSourceFilesSubControl().getCommentText().removeModifyListener(
sourceFilesCommentModifyListener);
}
if (!checkinControl.getSourceFilesSubControl().getChangesTable().isDisposed()) {
checkinControl.getSourceFilesSubControl().getChangesTable().removeCheckboxListener(
sourceFilesCheckboxAndElementListener);
checkinControl.getSourceFilesSubControl().getChangesTable().removeElementListener(
sourceFilesCheckboxAndElementListener);
}
if (!checkinControl.getWorkItemSubControl().getWorkItemTable().isDisposed()) {
checkinControl.getWorkItemSubControl().getWorkItemTable().removeElementListener(
workItemsCheckboxAndElementListener);
checkinControl.getWorkItemSubControl().getWorkItemTable().removeCheckboxListener(
workItemsCheckboxAndElementListener);
}
checkinControl.getNotesSubControl().removeCheckinNoteChangedListener(checkinNoteListener);
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10J3250</string>
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">1306</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSTextField</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>NSBox</string>
<string>NSTextFieldCell</string>
<string>NSCustomView</string>
<string>NSButtonCell</string>
<string>NSButton</string>
<string>NSCustomObject</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="96709467">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="222197082">
<string key="NSClassName">PassphrasePickerController</string>
</object>
<object class="NSCustomObject" id="1054553613">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="88155353">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="376337973">
<string key="NSClassName">SFPasswordAssistantInspectorController</string>
</object>
<object class="NSWindowTemplate" id="468933596">
<int key="NSWindowStyleMask">3</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{378, 572}, {474, 243}}</string>
<int key="NSWTFlags">1886912512</int>
<string key="NSWindowTitle">选择一个口令</string>
<string key="NSWindowClass">NSPanel</string>
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
<string key="NSWindowContentMinSize">{214.545, 107}</string>
<object class="NSView" key="NSWindowView" id="648414315">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomView" id="91828191">
<reference key="NSNextResponder" ref="648414315"/>
<int key="NSvFlags">264</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTextField" id="1067502238">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{17, 247}, {440, 41}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="496682251"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="667183415">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
<string key="NSContents">请选择一个用于保护笔记的口令,如果您忘记了这个口令,将无法再次恢复,所以请牢记该口令。</string>
<object class="NSFont" key="NSSupport" id="732648916">
<string key="NSName">STHeitiTC-Light</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
<reference key="NSControlView" ref="1067502238"/>
<object class="NSColor" key="NSBackgroundColor" id="159317177">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="189274282">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor" id="73915910">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSTextField" id="961376500">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{17, 207}, {440, 23}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="368735885"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="110691569">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
<string key="NSContents">您的口令可以包含任意字符,长度不限。</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="961376500"/>
<reference key="NSBackgroundColor" ref="159317177"/>
<reference key="NSTextColor" ref="189274282"/>
</object>
</object>
<object class="NSBox" id="496682251">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 236}, {434, 5}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="961376500"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Box</string>
<object class="NSFont" key="NSSupport" id="79827597">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<object class="NSColor" key="NSBackgroundColor" id="588133882">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
</object>
</object>
<int key="NSBorderType">3</int>
<int key="NSBoxType">2</int>
<int key="NSTitlePosition">0</int>
<bool key="NSTransparent">NO</bool>
</object>
<object class="NSTextField" id="368735885">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{17, 174}, {79, 22}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="659283120"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="747008014">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">71303168</int>
<string key="NSContents">口令:</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="368735885"/>
<reference key="NSBackgroundColor" ref="159317177"/>
<reference key="NSTextColor" ref="189274282"/>
</object>
</object>
<object class="NSTextField" id="997750274">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{17, 132}, {79, 34}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="90479301"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1072067069">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">71303168</int>
<string key="NSContents">重新输入:</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="997750274"/>
<reference key="NSBackgroundColor" ref="159317177"/>
<reference key="NSTextColor" ref="189274282"/>
</object>
</object>
<object class="NSButton" id="47213238">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{431, 177}, {23, 22}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="997750274"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="649756844">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">10</double>
<int key="NSfFlags">16</int>
</object>
<reference key="NSControlView" ref="47213238"/>
<int key="NSButtonFlags">-2042347265</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">PasswordAssistantButton</string>
</object>
<object class="NSCustomResource" key="NSAlternateImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">PasswordAssistantButtonPressed</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSTextField" id="659283120">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{101, 177}, {326, 22}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="47213238"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="936281296">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="79827597"/>
<reference key="NSControlView" ref="659283120"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="588133882"/>
<object class="NSColor" key="NSTextColor" id="188566081">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
<reference key="NSColor" ref="73915910"/>
</object>
</object>
</object>
<object class="NSTextField" id="90479301">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{101, 147}, {353, 22}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1049807428"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="367061129">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="79827597"/>
<reference key="NSControlView" ref="90479301"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="588133882"/>
<reference key="NSTextColor" ref="188566081"/>
</object>
</object>
<object class="NSButton" id="1049807428">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{99, 123}, {265, 18}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="704497703"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="573763295">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">在钥匙串中记住该口令</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="1049807428"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
<object class="NSButtonImageSource" key="NSAlternateImage">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSButton" id="704497703">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 85}, {13, 13}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="938966227"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="983493534">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="79827597"/>
<reference key="NSControlView" ref="704497703"/>
<int key="NSButtonFlags">-1198636801</int>
<int key="NSButtonFlags2">5</int>
<reference key="NSAlternateImage" ref="79827597"/>
<string key="NSAlternateContents"/>
<object class="NSMutableString" key="NSKeyEquivalent">
<characters key="NS.bytes"/>
</object>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSTextField" id="938966227">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{38, 82}, {128, 17}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="982020265"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1026343250">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
<string key="NSContents">更多安全选项</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">STHeitiTC-Light</string>
<double key="NSSize">11</double>
<int key="NSfFlags">16</int>
</object>
<reference key="NSControlView" ref="938966227"/>
<reference key="NSBackgroundColor" ref="159317177"/>
<reference key="NSTextColor" ref="189274282"/>
</object>
</object>
<object class="NSCustomView" id="982020265">
<reference key="NSNextResponder" ref="91828191"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{41, 0}, {413, 74}}</string>
<reference key="NSSuperview" ref="91828191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="512873390"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrame">{{0, -65}, {474, 308}}</string>
<reference key="NSSuperview" ref="648414315"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1067502238"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="512873390">
<reference key="NSNextResponder" ref="648414315"/>
<int key="NSvFlags">289</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="975300229">
<reference key="NSNextResponder" ref="512873390"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{96, 12}, {82, 32}}</string>
<reference key="NSSuperview" ref="512873390"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="18770099">
<int key="NSCellFlags">604110336</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">确认</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="975300229"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">1</int>
<reference key="NSAlternateImage" ref="79827597"/>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSButton" id="1032505420">
<reference key="NSNextResponder" ref="512873390"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{14, 12}, {82, 32}}</string>
<reference key="NSSuperview" ref="512873390"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="975300229"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="18866375">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">取消</string>
<reference key="NSSupport" ref="732648916"/>
<reference key="NSControlView" ref="1032505420"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">1</int>
<reference key="NSAlternateImage" ref="79827597"/>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
</object>
<string key="NSFrame">{{282, 0}, {192, 60}}</string>
<reference key="NSSuperview" ref="648414315"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1032505420"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrame">{{7, 11}, {474, 243}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="91828191"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{214.545, 129}</string>
<string key="NSMaxSize">{1e+13, 1e+13}</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showPasswordAssistantPanel:</string>
<reference key="source" ref="376337973"/>
<reference key="destination" ref="47213238"/>
</object>
<int key="connectionID">361</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">okNewPassword:</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="975300229"/>
</object>
<int key="connectionID">362</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cancelNewPassword:</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="1032505420"/>
</object>
<int key="connectionID">363</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">rememberNewButton</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="1049807428"/>
</object>
<int key="connectionID">364</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">cancelNewButton</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="1032505420"/>
</object>
<int key="connectionID">365</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">okNewButton</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="975300229"/>
</object>
<int key="connectionID">366</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">verifyNewPasswordField</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="90479301"/>
</object>
<int key="connectionID">367</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">newPasswordField</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="659283120"/>
</object>
<int key="connectionID">368</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">newPassphraseWindow</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="468933596"/>
</object>
<int key="connectionID">369</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_newPassword</string>
<reference key="source" ref="376337973"/>
<reference key="destination" ref="659283120"/>
</object>
<int key="connectionID">370</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_verifyPassword</string>
<reference key="source" ref="376337973"/>
<reference key="destination" ref="90479301"/>
</object>
<int key="connectionID">371</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_baseWindow</string>
<reference key="source" ref="376337973"/>
<reference key="destination" ref="468933596"/>
</object>
<int key="connectionID">372</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">discloseAdvancedSettings:</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="704497703"/>
</object>
<int key="connectionID">386</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">disclosureButton</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="704497703"/>
</object>
<int key="connectionID">387</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dismissalButtonsView</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="512873390"/>
</object>
<int key="connectionID">388</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">upperButtonsView</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="91828191"/>
</object>
<int key="connectionID">390</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="468933596"/>
</object>
<int key="connectionID">391</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="659283120"/>
<reference key="destination" ref="90479301"/>
</object>
<int key="connectionID">392</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="90479301"/>
<reference key="destination" ref="659283120"/>
</object>
<int key="connectionID">393</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">initialFirstResponder</string>
<reference key="source" ref="468933596"/>
<reference key="destination" ref="659283120"/>
</object>
<int key="connectionID">394</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">advancedView</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="982020265"/>
</object>
<int key="connectionID">395</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">advancedHelpField</string>
<reference key="source" ref="222197082"/>
<reference key="destination" ref="938966227"/>
</object>
<int key="connectionID">396</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="96709467"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="222197082"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1054553613"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">342</int>
<reference key="object" ref="376337973"/>
<reference key="parent" ref="0"/>
<string key="objectName">SFPasswordAssistantInspectorController</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">343</int>
<reference key="object" ref="468933596"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="648414315"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">Select a passphrase</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">344</int>
<reference key="object" ref="648414315"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="512873390"/>
<reference ref="91828191"/>
</object>
<reference key="parent" ref="468933596"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">376</int>
<reference key="object" ref="512873390"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="975300229"/>
<reference ref="1032505420"/>
</object>
<reference key="parent" ref="648414315"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">354</int>
<reference key="object" ref="975300229"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="18770099"/>
</object>
<reference key="parent" ref="512873390"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">355</int>
<reference key="object" ref="1032505420"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="18866375"/>
</object>
<reference key="parent" ref="512873390"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">389</int>
<reference key="object" ref="91828191"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1067502238"/>
<reference ref="961376500"/>
<reference ref="496682251"/>
<reference ref="368735885"/>
<reference ref="997750274"/>
<reference ref="47213238"/>
<reference ref="659283120"/>
<reference ref="90479301"/>
<reference ref="1049807428"/>
<reference ref="704497703"/>
<reference ref="938966227"/>
<reference ref="982020265"/>
</object>
<reference key="parent" ref="648414315"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">346</int>
<reference key="object" ref="1067502238"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="667183415"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">347</int>
<reference key="object" ref="961376500"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="110691569"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">348</int>
<reference key="object" ref="496682251"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSView" id="490440667">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{2, 2}, {125, 1}}</string>
</object>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">349</int>
<reference key="object" ref="490440667"/>
<reference key="parent" ref="496682251"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">351</int>
<reference key="object" ref="368735885"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="747008014"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">353</int>
<reference key="object" ref="997750274"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1072067069"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">356</int>
<reference key="object" ref="47213238"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="649756844"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">357</int>
<reference key="object" ref="659283120"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="936281296"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">358</int>
<reference key="object" ref="90479301"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="367061129"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">360</int>
<reference key="object" ref="1049807428"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="573763295"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">374</int>
<reference key="object" ref="704497703"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="983493534"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">375</int>
<reference key="object" ref="938966227"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1026343250"/>
</object>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">385</int>
<reference key="object" ref="982020265"/>
<reference key="parent" ref="91828191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">398</int>
<reference key="object" ref="18770099"/>
<reference key="parent" ref="975300229"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">399</int>
<reference key="object" ref="18866375"/>
<reference key="parent" ref="1032505420"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">400</int>
<reference key="object" ref="667183415"/>
<reference key="parent" ref="1067502238"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">401</int>
<reference key="object" ref="110691569"/>
<reference key="parent" ref="961376500"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">402</int>
<reference key="object" ref="747008014"/>
<reference key="parent" ref="368735885"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">403</int>
<reference key="object" ref="1072067069"/>
<reference key="parent" ref="997750274"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">404</int>
<reference key="object" ref="649756844"/>
<reference key="parent" ref="47213238"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">405</int>
<reference key="object" ref="936281296"/>
<reference key="parent" ref="659283120"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">406</int>
<reference key="object" ref="367061129"/>
<reference key="parent" ref="90479301"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">407</int>
<reference key="object" ref="573763295"/>
<reference key="parent" ref="1049807428"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">408</int>
<reference key="object" ref="983493534"/>
<reference key="parent" ref="704497703"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">409</int>
<reference key="object" ref="1026343250"/>
<reference key="parent" ref="938966227"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="88155353"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-3.IBPluginDependency</string>
<string>342.ImportedFromIB2</string>
<string>343.IBEditorWindowLastContentRect</string>
<string>343.IBPluginDependency</string>
<string>343.IBPropertyAccessControl</string>
<string>343.IBWindowTemplateEditedContentRect</string>
<string>343.ImportedFromIB2</string>
<string>344.IBPluginDependency</string>
<string>344.ImportedFromIB2</string>
<string>346.IBPluginDependency</string>
<string>346.IBPropertyAccessControl</string>
<string>346.ImportedFromIB2</string>
<string>347.IBPluginDependency</string>
<string>347.IBPropertyAccessControl</string>
<string>347.ImportedFromIB2</string>
<string>348.IBPluginDependency</string>
<string>348.IBPropertyAccessControl</string>
<string>348.ImportedFromIB2</string>
<string>349.IBPluginDependency</string>
<string>349.ImportedFromIB2</string>
<string>351.IBPluginDependency</string>
<string>351.IBPropertyAccessControl</string>
<string>351.ImportedFromIB2</string>
<string>353.IBPluginDependency</string>
<string>353.IBPropertyAccessControl</string>
<string>353.ImportedFromIB2</string>
<string>354.IBPluginDependency</string>
<string>354.IBPropertyAccessControl</string>
<string>354.ImportedFromIB2</string>
<string>355.IBPluginDependency</string>
<string>355.IBPropertyAccessControl</string>
<string>355.ImportedFromIB2</string>
<string>356.IBPluginDependency</string>
<string>356.ImportedFromIB2</string>
<string>357.CustomClassName</string>
<string>357.IBPluginDependency</string>
<string>357.ImportedFromIB2</string>
<string>358.CustomClassName</string>
<string>358.IBPluginDependency</string>
<string>358.ImportedFromIB2</string>
<string>360.IBPluginDependency</string>
<string>360.IBPropertyAccessControl</string>
<string>360.ImportedFromIB2</string>
<string>374.IBPluginDependency</string>
<string>374.ImportedFromIB2</string>
<string>375.IBPluginDependency</string>
<string>375.IBPropertyAccessControl</string>
<string>375.ImportedFromIB2</string>
<string>376.IBPluginDependency</string>
<string>376.IBPropertyAccessControl</string>
<string>376.ImportedFromIB2</string>
<string>385.IBPluginDependency</string>
<string>385.ImportedFromIB2</string>
<string>389.IBPluginDependency</string>
<string>389.ImportedFromIB2</string>
<string>398.IBPluginDependency</string>
<string>399.IBPluginDependency</string>
<string>400.IBPluginDependency</string>
<string>401.IBPluginDependency</string>
<string>402.IBPluginDependency</string>
<string>403.IBPluginDependency</string>
<string>403.IBPropertyAccessControl</string>
<string>404.IBPluginDependency</string>
<string>405.IBPluginDependency</string>
<string>406.IBPluginDependency</string>
<string>407.IBPluginDependency</string>
<string>408.IBPluginDependency</string>
<string>409.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{774, 194}, {474, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<string>{{774, 194}, {474, 243}}</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="4"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="4"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>NSSecureTextField</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>NSSecureTextField</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="3"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">409</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FirstResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>didAdjustSubviews:</string>
<string>willAdjustSubviews:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>RBSplitView</string>
<string>RBSplitView</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>didAdjustSubviews:</string>
<string>willAdjustSubviews:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">didAdjustSubviews:</string>
<string key="candidateClassName">RBSplitView</string>
</object>
<object class="IBActionInfo">
<string key="name">willAdjustSubviews:</string>
<string key="candidateClassName">RBSplitView</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PassphrasePickerController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>cancelNewPassword:</string>
<string>discloseAdvancedSettings:</string>
<string>okNewPassword:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>cancelNewPassword:</string>
<string>discloseAdvancedSettings:</string>
<string>okNewPassword:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">cancelNewPassword:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">discloseAdvancedSettings:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">okNewPassword:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>advancedHelpField</string>
<string>advancedView</string>
<string>cancelNewButton</string>
<string>disclosureButton</string>
<string>dismissalButtonsView</string>
<string>newPassphraseWindow</string>
<string>newPasswordField</string>
<string>okNewButton</string>
<string>rememberNewButton</string>
<string>upperButtonsView</string>
<string>verifyNewPasswordField</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSTextField</string>
<string>NSView</string>
<string>NSButton</string>
<string>NSButton</string>
<string>NSView</string>
<string>NSPanel</string>
<string>NSSecureTextField</string>
<string>NSButton</string>
<string>NSButton</string>
<string>NSView</string>
<string>NSSecureTextField</string>
<string>NSPanel</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>advancedHelpField</string>
<string>advancedView</string>
<string>cancelNewButton</string>
<string>disclosureButton</string>
<string>dismissalButtonsView</string>
<string>newPassphraseWindow</string>
<string>newPasswordField</string>
<string>okNewButton</string>
<string>rememberNewButton</string>
<string>upperButtonsView</string>
<string>verifyNewPasswordField</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">advancedHelpField</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">advancedView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">cancelNewButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">disclosureButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">dismissalButtonsView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">newPassphraseWindow</string>
<string key="candidateClassName">NSPanel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">newPasswordField</string>
<string key="candidateClassName">NSSecureTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">okNewButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">rememberNewButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">upperButtonsView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">verifyNewPasswordField</string>
<string key="candidateClassName">NSSecureTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">window</string>
<string key="candidateClassName">NSPanel</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PassphrasePickerController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">RBSplitSubview</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/RBSplitSubview.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">RBSplitView</string>
<string key="superclassName">RBSplitSubview</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">delegate</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">delegate</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">delegate</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/RBSplitView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">SFPasswordAssistantInspectorController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showPasswordAssistantPanel:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showPasswordAssistantPanel:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showPasswordAssistantPanel:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>_baseWindow</string>
<string>_newPassword</string>
<string>_originalPassword</string>
<string>_verifyPassword</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSWindow</string>
<string>NSTextField</string>
<string>NSTextField</string>
<string>NSTextField</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>_baseWindow</string>
<string>_newPassword</string>
<string>_originalPassword</string>
<string>_verifyPassword</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">_baseWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">_newPassword</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">_originalPassword</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">_verifyPassword</string>
<string key="candidateClassName">NSTextField</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/SFPasswordAssistantInspectorController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1060" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1040" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSSwitch</string>
<string>PasswordAssistantButton</string>
<string>PasswordAssistantButtonPressed</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>{15, 15}</string>
<string>{128, 128}</string>
<string>{128, 128}</string>
</object>
</object>
</data>
</archive>
|
{
"pile_set_name": "Github"
}
|
from ... import base
from pulp.plugins.loader import api as plugin_api
from pulp.plugins.types.model import TypeDefinition
import pulp.plugins.types.database as types_db
import pulp.server.managers.plugin as plugin_manager
class MockImporter:
@classmethod
def metadata(cls):
return {'types': ['mock_type']}
class MockDistributor:
@classmethod
def metadata(cls):
return {'types': ['mock_type']}
class MockProfiler:
@classmethod
def metadata(cls):
return {'types': ['mock_type']}
class MockCataloger:
@classmethod
def metadata(cls):
return {'types': ['mock_type']}
class PluginManagerTests(base.PulpServerTests):
def setUp(self):
super(PluginManagerTests, self).setUp()
plugin_api._create_manager()
# Configure content manager
plugin_api._MANAGER.importers.add_plugin('MockImporter', MockImporter, {})
plugin_api._MANAGER.distributors.add_plugin('MockDistributor', MockDistributor, {})
plugin_api._MANAGER.profilers.add_plugin('MockProfiler', MockProfiler, {})
plugin_api._MANAGER.catalogers.add_plugin('MockCataloger', MockCataloger, {})
# Create the manager instance to test
self.manager = plugin_manager.PluginManager()
def tearDown(self):
super(PluginManagerTests, self).tearDown()
# Reset content manager
plugin_api._MANAGER.importers.remove_plugin('MockImporter')
plugin_api._MANAGER.distributors.remove_plugin('MockDistributor')
plugin_api._MANAGER.profilers.remove_plugin('MockDistributor')
def test_types(self):
"""
Tests retrieving all types in the database.
"""
# Setup
types_db.clean()
type_def_1 = TypeDefinition('type-1', 'Type 1', 'Type 1', [], [], [])
type_def_2 = TypeDefinition('type-2', 'Type 2', 'Type 2', [], [], [])
types_db._create_or_update_type(type_def_1)
types_db._create_or_update_type(type_def_2)
# Test
found_defs = self.manager.types()
# Verify
self.assertEqual(2, len(found_defs))
for type_def in [type_def_1, type_def_2]:
found_def = [t for t in found_defs if t['id'] == type_def.id][0]
self.assertEqual(found_def['id'], type_def.id)
self.assertEqual(found_def['display_name'], type_def.display_name)
self.assertEqual(found_def['description'], type_def.description)
self.assertEqual(found_def['unit_key'], type_def.unit_key)
self.assertEqual(found_def['search_indexes'], type_def.search_indexes)
self.assertEqual(found_def['referenced_types'], type_def.referenced_types)
def test_types_no_types(self):
"""
Tests an empty list is returned when no types are loaded.
"""
# Setup
types_db.clean()
# Test
found_defs = self.manager.types()
# Verify
self.assertTrue(isinstance(found_defs, list))
self.assertEqual(0, len(found_defs))
def test_importers(self):
"""
Tests retieving all importers.
"""
# Test
found = self.manager.importers()
# Verify
self.assertEqual(1, len(found))
self.assertEqual('MockImporter', found[0]['id'])
def test_importers_no_importers(self):
"""
Tests an empty list is returned when no importers are present.
"""
# Setup
plugin_api._MANAGER.importers.remove_plugin('MockImporter')
# Test
found = self.manager.importers()
# Verify
self.assertTrue(isinstance(found, list))
self.assertEqual(0, len(found))
def test_distributors(self):
"""
Tests retrieving all distributors.
"""
# Test
found = self.manager.distributors()
# Verify
self.assertEqual(1, len(found))
self.assertEqual('MockDistributor', found[0]['id'])
def test_distributors_no_distributors(self):
"""
Tests an empty list is returned when no distributors are present.
"""
# Setup
plugin_api._MANAGER.distributors.remove_plugin('MockDistributor')
# Test
found = self.manager.distributors()
# Verify
self.assertTrue(isinstance(found, list))
self.assertEqual(0, len(found))
def test_profilers(self):
"""
Tests retrieving all profilers.
"""
# Test
found = self.manager.profilers()
# Verify
self.assertEqual(1, len(found))
self.assertEqual('MockProfiler', found[0]['id'])
def test_profilers_no_profilers(self):
"""
Tests an empty list is returned when no profilers are present.
"""
# Setup
plugin_api._MANAGER.profilers.remove_plugin('MockProfiler')
# Test
found = self.manager.profilers()
# Verify
self.assertTrue(isinstance(found, list))
self.assertEqual(0, len(found))
def test_catalogers(self):
"""
Tests retrieving all catalogers.
"""
# Test
found = self.manager.catalogers()
# Verify
self.assertEqual(1, len(found))
self.assertEqual('MockCataloger', found[0]['id'])
def test_catalogers_no_catalogers(self):
"""
Tests an empty list is returned when no catalogers are present.
"""
# Setup
plugin_api._MANAGER.catalogers.remove_plugin('MockCataloger')
# Test
found = self.manager.catalogers()
# Verify
self.assertTrue(isinstance(found, list))
self.assertEqual(0, len(found))
|
{
"pile_set_name": "Github"
}
|
#include "gif.hpp"
#include "common/tonccpy.h"
#include "lzw.hpp"
#include <stdio.h>
std::vector<Gif *> Gif::_animating;
void Gif::timerHandler(void) {
for (auto gif : _animating) {
gif->displayFrame();
}
}
void Gif::displayFrame(void) {
if (_paused || ++_currentDelayProgress < _currentDelay)
return;
_currentDelayProgress = 0;
_waitingForInput = false;
if (_currentFrame >= _frames.size()) {
_currentFrame = 0;
_currentLoop++;
}
if (_currentLoop > _loopCount) {
_finished = true;
_paused = true;
_currentLoop = 0;
return;
}
Frame &frame = _frames[_currentFrame++];
if (frame.hasGCE) {
_currentDelay = frame.gce.delay;
if (frame.gce.delay == 0) {
_finished = true;
_paused = true;
} else if (frame.gce.userInputFlag) {
_waitingForInput = true;
}
}
std::vector<u16> &colorTable = frame.descriptor.lctFlag ? frame.lct : _gct;
tonccpy(_top ? BG_PALETTE : BG_PALETTE_SUB, colorTable.data(), colorTable.size() * 2);
tonccpy(_top ? BG_PALETTE : BG_PALETTE_SUB, colorTable.data(), colorTable.size() * 2);
// Disposal method 2 = fill with bg color
if (frame.gce.disposalMethod == 2)
toncset(_top ? BG_GFX : BG_GFX_SUB, header.bgColor, 256 * 192);
if(_compressed) { // Was left compressed to be able to fit
int x = 0, y = 0;
u8 *dst = (u8*)(_top ? BG_GFX : BG_GFX_SUB) + (frame.descriptor.y + y + (192 - header.height) / 2) * 256 + frame.descriptor.x + (256 - header.width) / 2;
u8 row[frame.descriptor.w];
auto flush_fn = [&dst, &row, &x, &y, &frame](std::vector<u8>::const_iterator begin, std::vector<u8>::const_iterator end) {
for (; begin != end; ++begin) {
if (!frame.gce.transparentColorFlag || *begin != frame.gce.transparentColor)
row[x] = *begin;
else
row[x] = *(dst + x);
x++;
if (x >= frame.descriptor.w) {
tonccpy(dst, row, frame.descriptor.w);
y++;
x = 0;
dst += 256;
}
}
};
LZWReader reader(frame.image.lzwMinimumCodeSize, flush_fn);
reader.decode(frame.image.imageData.begin(), frame.image.imageData.end());
} else { // Already decompressed, just copy
auto it = frame.image.imageData.begin();
for(int y = 0; y < frame.descriptor.h; y++) {
u8 *dst = (u8*)(_top ? BG_GFX : BG_GFX_SUB) + (frame.descriptor.y + y + (192 - header.height) / 2) * 256 + frame.descriptor.x + (256 - header.width) / 2;
u8 row[frame.descriptor.w];
for(int x = 0; x < frame.descriptor.w; x++, it++) {
if (!frame.gce.transparentColorFlag || *it != frame.gce.transparentColor)
row[x] = *it;
else
row[x] = *(dst + x);
}
tonccpy(dst, row, frame.descriptor.w);
}
}
}
bool Gif::load(const char *path, bool top, bool animate) {
_top = top;
FILE *file = fopen(path, "rb");
if (!file)
return false;
fseek(file, 0, SEEK_END);
_compressed = ftell(file) > ((isDSiMode() || REG_SCFG_EXT != 0) ? 1 << 20 : 1 << 18); // Decompress files bigger than 1MiB (256KiB in DS Mode) while drawing
fseek(file, 0, SEEK_SET);
// Reserve space for 2,000 frames
_frames.reserve(2000);
// Read header
fread(&header, 1, sizeof(header), file);
// Check that this is a GIF
if (memcmp(header.signature, "GIF89a", sizeof(header.signature)) != 0) {
fclose(file);
return false;
}
// Load global color table
if (header.gctFlag) {
int numColors = (2 << header.gctSize);
_gct = std::vector<u16>(numColors);
for (int i = 0; i < numColors; i++) {
_gct[i] = fgetc(file) >> 3 | (fgetc(file) >> 3) << 5 | (fgetc(file) >> 3) << 10 | BIT(15);
}
}
Frame frame;
while (1) {
switch (fgetc(file)) {
case 0x21: { // Extension
switch (fgetc(file)) {
case 0xF9: { // Graphics Control
frame.hasGCE = true;
fread(&frame.gce, 1, fgetc(file), file);
fgetc(file); // Terminator
break;
} case 0x01: { // Plain text
// Unsupported for now, I can't even find a text GIF to test with
// frame.hasText = true;
// fread(&frame.textDescriptor, 1, sizeof(frame.textDescriptor), file);
fseek(file, 12, SEEK_CUR);
while (u8 size = fgetc(file)) {
// char temp[size + 1];
// fread(temp, 1, size, file);
// frame.text += temp;
fseek(file, size, SEEK_CUR);
}
// _frames.push_back(frame);
// frame = Frame();
break;
} case 0xFF: { // Application extension
if (fgetc(file) == 0xB) {
char buffer[0xC] = {0};
fread(buffer, 1, 0xB, file);
if (strcmp(buffer, "NETSCAPE2.0") == 0) { // Check for Netscape loop count
// ptr += 0xB + 2;
fseek(file, 2, SEEK_CUR);
fread(&_loopCount, 1, sizeof(_loopCount), file);
fgetc(file); //terminator
break;
}
}
} case 0xFE: { // Comment
// Skip comments and unsupported application extionsions
while (u8 size = fgetc(file)) {
fseek(file, size, SEEK_CUR);
}
break;
}
}
break;
} case 0x2C: { // Image desriptor
frame.hasImage = true;
fread(&frame.descriptor, 1, sizeof(frame.descriptor), file);
if (frame.descriptor.lctFlag) {
int numColors = 2 << frame.descriptor.lctSize;
frame.lct = std::vector<u16>(numColors);
for (int i = 0; i < numColors; i++) {
frame.lct[i] = fgetc(file) >> 3 | (fgetc(file) >> 3) << 5 | (fgetc(file) >> 3) << 10 | BIT(15);
}
}
frame.image.lzwMinimumCodeSize = fgetc(file);
if(_compressed) { // Leave compressed to fit more in RAM
while (u8 size = fgetc(file)) {
size_t end = frame.image.imageData.size();
frame.image.imageData.resize(end + size);
fread(frame.image.imageData.data() + end, 1, size, file);
}
} else { // Decompress now for faster draw
frame.image.imageData = std::vector<u8>(frame.descriptor.w * frame.descriptor.h);
auto it = frame.image.imageData.begin();
auto flush_fn = [&it, &frame](std::vector<u8>::const_iterator begin, std::vector<u8>::const_iterator end) {
std::copy(begin, end, it);
it += std::distance(begin, end);
};
LZWReader reader(frame.image.lzwMinimumCodeSize, flush_fn);
while (u8 size = fgetc(file)) {
std::vector<u8> buffer(size);
fread(buffer.data(), 1, size, file);
reader.decode(buffer.begin(), buffer.end());
}
}
_frames.push_back(frame);
frame = Frame();
break;
} case 0x3B: { // Trailer
goto breakWhile;
}
}
}
breakWhile:
fclose(file);
_paused = false;
_finished = loopForever();
_frames.shrink_to_fit();
if(animate)
_animating.push_back(this);
return true;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/audio_codecs/isac/audio_decoder_isac_fix.h"
#include "absl/memory/memory.h"
#include "absl/strings/match.h"
#include "modules/audio_coding/codecs/isac/fix/include/audio_decoder_isacfix.h"
namespace webrtc {
absl::optional<AudioDecoderIsacFix::Config> AudioDecoderIsacFix::SdpToConfig(
const SdpAudioFormat& format) {
return absl::EqualsIgnoreCase(format.name, "ISAC") &&
format.clockrate_hz == 16000 && format.num_channels == 1
? absl::optional<Config>(Config())
: absl::nullopt;
}
void AudioDecoderIsacFix::AppendSupportedDecoders(
std::vector<AudioCodecSpec>* specs) {
specs->push_back({{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}});
}
std::unique_ptr<AudioDecoder> AudioDecoderIsacFix::MakeAudioDecoder(
Config config,
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
return absl::make_unique<AudioDecoderIsacFixImpl>(16000);
}
} // namespace webrtc
|
{
"pile_set_name": "Github"
}
|
File: kt1639-JFrame.kt - 72a054fd9fa4972f0bca12f2081e3e1e
NL("\n")
NL("\n")
NL("\n")
packageHeader
PACKAGE("package")
identifier
simpleIdentifier
Identifier("test")
semi
NL("\n")
NL("\n")
importList
importHeader
IMPORT("import")
identifier
simpleIdentifier
Identifier("javax")
DOT(".")
simpleIdentifier
Identifier("swing")
DOT(".")
simpleIdentifier
Identifier("JFrame")
semi
NL("\n")
NL("\n")
topLevelObject
declaration
classDeclaration
CLASS("class")
simpleIdentifier
Identifier("KFrame")
primaryConstructor
classParameters
LPAREN("(")
RPAREN(")")
COLON(":")
delegationSpecifiers
annotatedDelegationSpecifier
delegationSpecifier
constructorInvocation
userType
simpleUserType
simpleIdentifier
Identifier("JFrame")
valueArguments
LPAREN("(")
RPAREN(")")
classBody
LCURL("{")
NL("\n")
classMemberDeclarations
classMemberDeclaration
anonymousInitializer
INIT("init")
block
LCURL("{")
NL("\n")
statements
statement
declaration
propertyDeclaration
VAL("val")
variableDeclaration
simpleIdentifier
Identifier("x")
ASSIGNMENT("=")
expression
disjunction
conjunction
equality
comparison
genericCallLikeComparison
infixOperation
elvisExpression
infixFunctionCall
rangeExpression
additiveExpression
multiplicativeExpression
asExpression
prefixUnaryExpression
postfixUnaryExpression
primaryExpression
thisExpression
THIS("this")
postfixUnarySuffix
navigationSuffix
memberAccessOperator
DOT(".")
simpleIdentifier
Identifier("rootPaneCheckingEnabled")
NL("\n")
RCURL("}")
semis
NL("\n")
RCURL("}")
semis
NL("\n")
EOF("<EOF>")
|
{
"pile_set_name": "Github"
}
|
{
"license": "MIT",
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"fix-unbroken": "node fix-unbroken.js"
},
"devDependencies": {
"docusaurus": "^1.14.0"
},
"dependencies": {
"docusaurus-init": "^1.14.1"
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2013 BashoTechnologies Inc
*
* 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 com.basho.riak.client.core;
import com.basho.riak.client.core.fixture.NetworkTestFixture;
import java.io.IOException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
/**
*
* @author Brian Roach <roach at basho dot com>
*/
public class FixtureTest
{
static NetworkTestFixture fixture;
static int startingPort = 5000;
@BeforeClass
public static void installFixture() throws IOException
{
fixture = new NetworkTestFixture(startingPort);
new Thread(fixture).start();
}
@AfterClass
public static void teardownFixture() throws IOException
{
fixture.shutdown();
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009 the V8 project authors. 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.
/**
* Creates a profile object for processing profiling-related events
* and calculating function execution times.
*
* @constructor
*/
function Profile() {
this.codeMap_ = new CodeMap();
this.topDownTree_ = new CallTree();
this.bottomUpTree_ = new CallTree();
};
/**
* Returns whether a function with the specified name must be skipped.
* Should be overriden by subclasses.
*
* @param {string} name Function name.
*/
Profile.prototype.skipThisFunction = function(name) {
return false;
};
/**
* Enum for profiler operations that involve looking up existing
* code entries.
*
* @enum {number}
*/
Profile.Operation = {
MOVE: 0,
DELETE: 1,
TICK: 2
};
/**
* Enum for code state regarding its dynamic optimization.
*
* @enum {number}
*/
Profile.CodeState = {
COMPILED: 0,
OPTIMIZABLE: 1,
OPTIMIZED: 2
};
/**
* Called whenever the specified operation has failed finding a function
* containing the specified address. Should be overriden by subclasses.
* See the Profile.Operation enum for the list of
* possible operations.
*
* @param {number} operation Operation.
* @param {number} addr Address of the unknown code.
* @param {number} opt_stackPos If an unknown address is encountered
* during stack strace processing, specifies a position of the frame
* containing the address.
*/
Profile.prototype.handleUnknownCode = function(
operation, addr, opt_stackPos) {
};
/**
* Registers a library.
*
* @param {string} name Code entry name.
* @param {number} startAddr Starting address.
* @param {number} endAddr Ending address.
*/
Profile.prototype.addLibrary = function(
name, startAddr, endAddr) {
var entry = new CodeMap.CodeEntry(
endAddr - startAddr, name);
this.codeMap_.addLibrary(startAddr, entry);
return entry;
};
/**
* Registers statically compiled code entry.
*
* @param {string} name Code entry name.
* @param {number} startAddr Starting address.
* @param {number} endAddr Ending address.
*/
Profile.prototype.addStaticCode = function(
name, startAddr, endAddr) {
var entry = new CodeMap.CodeEntry(
endAddr - startAddr, name);
this.codeMap_.addStaticCode(startAddr, entry);
return entry;
};
/**
* Registers dynamic (JIT-compiled) code entry.
*
* @param {string} type Code entry type.
* @param {string} name Code entry name.
* @param {number} start Starting address.
* @param {number} size Code entry size.
*/
Profile.prototype.addCode = function(
type, name, start, size) {
var entry = new Profile.DynamicCodeEntry(size, type, name);
this.codeMap_.addCode(start, entry);
return entry;
};
/**
* Registers dynamic (JIT-compiled) code entry.
*
* @param {string} type Code entry type.
* @param {string} name Code entry name.
* @param {number} start Starting address.
* @param {number} size Code entry size.
* @param {number} funcAddr Shared function object address.
* @param {Profile.CodeState} state Optimization state.
*/
Profile.prototype.addFuncCode = function(
type, name, start, size, funcAddr, state) {
// As code and functions are in the same address space,
// it is safe to put them in a single code map.
var func = this.codeMap_.findDynamicEntryByStartAddress(funcAddr);
if (!func) {
func = new Profile.FunctionEntry(name);
this.codeMap_.addCode(funcAddr, func);
} else if (func.name !== name) {
// Function object has been overwritten with a new one.
func.name = name;
}
var entry = new Profile.DynamicFuncCodeEntry(size, type, func, state);
this.codeMap_.addCode(start, entry);
return entry;
};
/**
* Reports about moving of a dynamic code entry.
*
* @param {number} from Current code entry address.
* @param {number} to New code entry address.
*/
Profile.prototype.moveCode = function(from, to) {
try {
this.codeMap_.moveCode(from, to);
} catch (e) {
this.handleUnknownCode(Profile.Operation.MOVE, from);
}
};
/**
* Reports about deletion of a dynamic code entry.
*
* @param {number} start Starting address.
*/
Profile.prototype.deleteCode = function(start) {
try {
this.codeMap_.deleteCode(start);
} catch (e) {
this.handleUnknownCode(Profile.Operation.DELETE, start);
}
};
/**
* Reports about moving of a dynamic code entry.
*
* @param {number} from Current code entry address.
* @param {number} to New code entry address.
*/
Profile.prototype.moveFunc = function(from, to) {
if (this.codeMap_.findDynamicEntryByStartAddress(from)) {
this.codeMap_.moveCode(from, to);
}
};
/**
* Retrieves a code entry by an address.
*
* @param {number} addr Entry address.
*/
Profile.prototype.findEntry = function(addr) {
return this.codeMap_.findEntry(addr);
};
/**
* Records a tick event. Stack must contain a sequence of
* addresses starting with the program counter value.
*
* @param {Array<number>} stack Stack sample.
*/
Profile.prototype.recordTick = function(stack) {
var processedStack = this.resolveAndFilterFuncs_(stack);
this.bottomUpTree_.addPath(processedStack);
processedStack.reverse();
this.topDownTree_.addPath(processedStack);
};
/**
* Translates addresses into function names and filters unneeded
* functions.
*
* @param {Array<number>} stack Stack sample.
*/
Profile.prototype.resolveAndFilterFuncs_ = function(stack) {
var result = [];
for (var i = 0; i < stack.length; ++i) {
var entry = this.codeMap_.findEntry(stack[i]);
if (entry) {
var name = entry.getName();
if (!this.skipThisFunction(name)) {
result.push(name);
}
} else {
this.handleUnknownCode(
Profile.Operation.TICK, stack[i], i);
}
}
return result;
};
/**
* Performs a BF traversal of the top down call graph.
*
* @param {function(CallTree.Node)} f Visitor function.
*/
Profile.prototype.traverseTopDownTree = function(f) {
this.topDownTree_.traverse(f);
};
/**
* Performs a BF traversal of the bottom up call graph.
*
* @param {function(CallTree.Node)} f Visitor function.
*/
Profile.prototype.traverseBottomUpTree = function(f) {
this.bottomUpTree_.traverse(f);
};
/**
* Calculates a top down profile for a node with the specified label.
* If no name specified, returns the whole top down calls tree.
*
* @param {string} opt_label Node label.
*/
Profile.prototype.getTopDownProfile = function(opt_label) {
return this.getTreeProfile_(this.topDownTree_, opt_label);
};
/**
* Calculates a bottom up profile for a node with the specified label.
* If no name specified, returns the whole bottom up calls tree.
*
* @param {string} opt_label Node label.
*/
Profile.prototype.getBottomUpProfile = function(opt_label) {
return this.getTreeProfile_(this.bottomUpTree_, opt_label);
};
/**
* Helper function for calculating a tree profile.
*
* @param {Profile.CallTree} tree Call tree.
* @param {string} opt_label Node label.
*/
Profile.prototype.getTreeProfile_ = function(tree, opt_label) {
if (!opt_label) {
tree.computeTotalWeights();
return tree;
} else {
var subTree = tree.cloneSubtree(opt_label);
subTree.computeTotalWeights();
return subTree;
}
};
/**
* Calculates a flat profile of callees starting from a node with
* the specified label. If no name specified, starts from the root.
*
* @param {string} opt_label Starting node label.
*/
Profile.prototype.getFlatProfile = function(opt_label) {
var counters = new CallTree();
var rootLabel = opt_label || CallTree.ROOT_NODE_LABEL;
var precs = {};
precs[rootLabel] = 0;
var root = counters.findOrAddChild(rootLabel);
this.topDownTree_.computeTotalWeights();
this.topDownTree_.traverseInDepth(
function onEnter(node) {
if (!(node.label in precs)) {
precs[node.label] = 0;
}
var nodeLabelIsRootLabel = node.label == rootLabel;
if (nodeLabelIsRootLabel || precs[rootLabel] > 0) {
if (precs[rootLabel] == 0) {
root.selfWeight += node.selfWeight;
root.totalWeight += node.totalWeight;
} else {
var rec = root.findOrAddChild(node.label);
rec.selfWeight += node.selfWeight;
if (nodeLabelIsRootLabel || precs[node.label] == 0) {
rec.totalWeight += node.totalWeight;
}
}
precs[node.label]++;
}
},
function onExit(node) {
if (node.label == rootLabel || precs[rootLabel] > 0) {
precs[node.label]--;
}
},
null);
if (!opt_label) {
// If we have created a flat profile for the whole program, we don't
// need an explicit root in it. Thus, replace the counters tree
// root with the node corresponding to the whole program.
counters.root_ = root;
} else {
// Propagate weights so percents can be calculated correctly.
counters.getRoot().selfWeight = root.selfWeight;
counters.getRoot().totalWeight = root.totalWeight;
}
return counters;
};
/**
* Creates a dynamic code entry.
*
* @param {number} size Code size.
* @param {string} type Code type.
* @param {string} name Function name.
* @constructor
*/
Profile.DynamicCodeEntry = function(size, type, name) {
CodeMap.CodeEntry.call(this, size, name);
this.type = type;
};
/**
* Returns node name.
*/
Profile.DynamicCodeEntry.prototype.getName = function() {
return this.type + ': ' + this.name;
};
/**
* Returns raw node name (without type decoration).
*/
Profile.DynamicCodeEntry.prototype.getRawName = function() {
return this.name;
};
Profile.DynamicCodeEntry.prototype.isJSFunction = function() {
return false;
};
/**
* Creates a dynamic code entry.
*
* @param {number} size Code size.
* @param {string} type Code type.
* @param {Profile.FunctionEntry} func Shared function entry.
* @param {Profile.CodeState} state Code optimization state.
* @constructor
*/
Profile.DynamicFuncCodeEntry = function(size, type, func, state) {
CodeMap.CodeEntry.call(this, size);
this.type = type;
this.func = func;
this.state = state;
};
Profile.DynamicFuncCodeEntry.STATE_PREFIX = ["", "~", "*"];
/**
* Returns node name.
*/
Profile.DynamicFuncCodeEntry.prototype.getName = function() {
var name = this.func.getName();
return this.type + ': ' + Profile.DynamicFuncCodeEntry.STATE_PREFIX[this.state] + name;
};
/**
* Returns raw node name (without type decoration).
*/
Profile.DynamicFuncCodeEntry.prototype.getRawName = function() {
return this.func.getName();
};
Profile.DynamicFuncCodeEntry.prototype.isJSFunction = function() {
return true;
};
/**
* Creates a shared function object entry.
*
* @param {string} name Function name.
* @constructor
*/
Profile.FunctionEntry = function(name) {
CodeMap.CodeEntry.call(this, 0, name);
};
/**
* Returns node name.
*/
Profile.FunctionEntry.prototype.getName = function() {
var name = this.name;
if (name.length == 0) {
name = '<anonymous>';
} else if (name.charAt(0) == ' ') {
// An anonymous function with location: " aaa.js:10".
name = '<anonymous>' + name;
}
return name;
};
/**
* Constructs a call graph.
*
* @constructor
*/
function CallTree() {
this.root_ = new CallTree.Node(
CallTree.ROOT_NODE_LABEL);
};
/**
* The label of the root node.
*/
CallTree.ROOT_NODE_LABEL = '';
/**
* @private
*/
CallTree.prototype.totalsComputed_ = false;
/**
* Returns the tree root.
*/
CallTree.prototype.getRoot = function() {
return this.root_;
};
/**
* Adds the specified call path, constructing nodes as necessary.
*
* @param {Array<string>} path Call path.
*/
CallTree.prototype.addPath = function(path) {
if (path.length == 0) {
return;
}
var curr = this.root_;
for (var i = 0; i < path.length; ++i) {
curr = curr.findOrAddChild(path[i]);
}
curr.selfWeight++;
this.totalsComputed_ = false;
};
/**
* Finds an immediate child of the specified parent with the specified
* label, creates a child node if necessary. If a parent node isn't
* specified, uses tree root.
*
* @param {string} label Child node label.
*/
CallTree.prototype.findOrAddChild = function(label) {
return this.root_.findOrAddChild(label);
};
/**
* Creates a subtree by cloning and merging all subtrees rooted at nodes
* with a given label. E.g. cloning the following call tree on label 'A'
* will give the following result:
*
* <A>--<B> <B>
* / /
* <root> == clone on 'A' ==> <root>--<A>
* \ \
* <C>--<A>--<D> <D>
*
* And <A>'s selfWeight will be the sum of selfWeights of <A>'s from the
* source call tree.
*
* @param {string} label The label of the new root node.
*/
CallTree.prototype.cloneSubtree = function(label) {
var subTree = new CallTree();
this.traverse(function(node, parent) {
if (!parent && node.label != label) {
return null;
}
var child = (parent ? parent : subTree).findOrAddChild(node.label);
child.selfWeight += node.selfWeight;
return child;
});
return subTree;
};
/**
* Computes total weights in the call graph.
*/
CallTree.prototype.computeTotalWeights = function() {
if (this.totalsComputed_) {
return;
}
this.root_.computeTotalWeight();
this.totalsComputed_ = true;
};
/**
* Traverses the call graph in preorder. This function can be used for
* building optionally modified tree clones. This is the boilerplate code
* for this scenario:
*
* callTree.traverse(function(node, parentClone) {
* var nodeClone = cloneNode(node);
* if (parentClone)
* parentClone.addChild(nodeClone);
* return nodeClone;
* });
*
* @param {function(CallTree.Node, *)} f Visitor function.
* The second parameter is the result of calling 'f' on the parent node.
*/
CallTree.prototype.traverse = function(f) {
var pairsToProcess = new ConsArray();
pairsToProcess.concat([{node: this.root_, param: null}]);
while (!pairsToProcess.atEnd()) {
var pair = pairsToProcess.next();
var node = pair.node;
var newParam = f(node, pair.param);
var morePairsToProcess = [];
node.forEachChild(function (child) {
morePairsToProcess.push({node: child, param: newParam}); });
pairsToProcess.concat(morePairsToProcess);
}
};
/**
* Performs an indepth call graph traversal.
*
* @param {function(CallTree.Node)} enter A function called
* prior to visiting node's children.
* @param {function(CallTree.Node)} exit A function called
* after visiting node's children.
*/
CallTree.prototype.traverseInDepth = function(enter, exit) {
function traverse(node) {
enter(node);
node.forEachChild(traverse);
exit(node);
}
traverse(this.root_);
};
/**
* Constructs a call graph node.
*
* @param {string} label Node label.
* @param {CallTree.Node} opt_parent Node parent.
*/
CallTree.Node = function(label, opt_parent) {
this.label = label;
this.parent = opt_parent;
this.children = {};
};
/**
* Node self weight (how many times this node was the last node in
* a call path).
* @type {number}
*/
CallTree.Node.prototype.selfWeight = 0;
/**
* Node total weight (includes weights of all children).
* @type {number}
*/
CallTree.Node.prototype.totalWeight = 0;
/**
* Adds a child node.
*
* @param {string} label Child node label.
*/
CallTree.Node.prototype.addChild = function(label) {
var child = new CallTree.Node(label, this);
this.children[label] = child;
return child;
};
/**
* Computes node's total weight.
*/
CallTree.Node.prototype.computeTotalWeight =
function() {
var totalWeight = this.selfWeight;
this.forEachChild(function(child) {
totalWeight += child.computeTotalWeight(); });
return this.totalWeight = totalWeight;
};
/**
* Returns all node's children as an array.
*/
CallTree.Node.prototype.exportChildren = function() {
var result = [];
this.forEachChild(function (node) { result.push(node); });
return result;
};
/**
* Finds an immediate child with the specified label.
*
* @param {string} label Child node label.
*/
CallTree.Node.prototype.findChild = function(label) {
return this.children[label] || null;
};
/**
* Finds an immediate child with the specified label, creates a child
* node if necessary.
*
* @param {string} label Child node label.
*/
CallTree.Node.prototype.findOrAddChild = function(label) {
return this.findChild(label) || this.addChild(label);
};
/**
* Calls the specified function for every child.
*
* @param {function(CallTree.Node)} f Visitor function.
*/
CallTree.Node.prototype.forEachChild = function(f) {
for (var c in this.children) {
f(this.children[c]);
}
};
/**
* Walks up from the current node up to the call tree root.
*
* @param {function(CallTree.Node)} f Visitor function.
*/
CallTree.Node.prototype.walkUpToRoot = function(f) {
for (var curr = this; curr != null; curr = curr.parent) {
f(curr);
}
};
/**
* Tries to find a node with the specified path.
*
* @param {Array<string>} labels The path.
* @param {function(CallTree.Node)} opt_f Visitor function.
*/
CallTree.Node.prototype.descendToChild = function(
labels, opt_f) {
for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) {
var child = curr.findChild(labels[pos]);
if (opt_f) {
opt_f(child, pos);
}
curr = child;
}
return curr;
};
|
{
"pile_set_name": "Github"
}
|
import { stream } from '../../stream/Stream';
import { Shrinkable } from '../arbitrary/definition/Shrinkable';
import { PreconditionFailure } from '../precondition/PreconditionFailure';
import { IRawProperty } from '../property/IRawProperty';
import { readConfigureGlobal } from './configuration/GlobalParameters';
import { Parameters } from './configuration/Parameters';
import { QualifiedParameters } from './configuration/QualifiedParameters';
import { VerbosityLevel } from './configuration/VerbosityLevel';
import { decorateProperty } from './DecorateProperty';
import { RunDetails } from './reporter/RunDetails';
import { RunExecution } from './reporter/RunExecution';
import { RunnerIterator } from './RunnerIterator';
import { SourceValuesIterator } from './SourceValuesIterator';
import { toss } from './Tosser';
import { pathWalk } from './utils/PathWalker';
import { reportRunDetails } from './utils/RunDetailsFormatter';
import { IAsyncProperty } from '../property/AsyncProperty';
import { IProperty } from '../property/Property';
/** @internal */
function runIt<Ts>(
property: IRawProperty<Ts>,
sourceValues: SourceValuesIterator<Shrinkable<Ts>>,
verbose: VerbosityLevel,
interruptedAsFailure: boolean
): RunExecution<Ts> {
const runner = new RunnerIterator(sourceValues, verbose, interruptedAsFailure);
for (const v of runner) {
const out = property.run(v) as PreconditionFailure | string | null;
runner.handleResult(out);
}
return runner.runExecution;
}
/** @internal */
async function asyncRunIt<Ts>(
property: IRawProperty<Ts>,
sourceValues: SourceValuesIterator<Shrinkable<Ts>>,
verbose: VerbosityLevel,
interruptedAsFailure: boolean
): Promise<RunExecution<Ts>> {
const runner = new RunnerIterator(sourceValues, verbose, interruptedAsFailure);
for (const v of runner) {
const out = await property.run(v);
runner.handleResult(out);
}
return runner.runExecution;
}
/** @internal */
function runnerPathWalker<Ts>(valueProducers: IterableIterator<() => Shrinkable<Ts>>, path: string) {
const pathPoints = path.split(':');
const pathStream = stream(valueProducers)
.drop(pathPoints.length > 0 ? +pathPoints[0] : 0)
.map((producer) => producer());
const adaptedPath = ['0', ...pathPoints.slice(1)].join(':');
return stream(pathWalk(adaptedPath, pathStream)).map((v) => () => v);
}
/** @internal */
function buildInitialValues<Ts>(
valueProducers: IterableIterator<() => Shrinkable<Ts>>,
qParams: QualifiedParameters<Ts>
) {
const rawValues = qParams.path.length === 0 ? stream(valueProducers) : runnerPathWalker(valueProducers, qParams.path);
if (!qParams.endOnFailure) return rawValues;
// Disable shrinking capabilities
return rawValues.map((shrinkableGen) => {
return () => {
const s = shrinkableGen();
return new Shrinkable(s.value_);
};
});
}
/**
* Run the property, do not throw contrary to {@link assert}
*
* WARNING: Has to be awaited
*
* @param property - Asynchronous property to be checked
* @param params - Optional parameters to customize the execution
*
* @returns Test status and other useful details
*
* @public
*/
function check<Ts>(property: IAsyncProperty<Ts>, params?: Parameters<Ts>): Promise<RunDetails<Ts>>;
/**
* Run the property, do not throw contrary to {@link assert}
*
* @param property - Synchronous property to be checked
* @param params - Optional parameters to customize the execution
*
* @returns Test status and other useful details
*
* @public
*/
function check<Ts>(property: IProperty<Ts>, params?: Parameters<Ts>): RunDetails<Ts>;
/**
* Run the property, do not throw contrary to {@link assert}
*
* WARNING: Has to be awaited if the property is asynchronous
*
* @param property - Property to be checked
* @param params - Optional parameters to customize the execution
*
* @returns Test status and other useful details
*
* @public
*/
function check<Ts>(property: IRawProperty<Ts>, params?: Parameters<Ts>): Promise<RunDetails<Ts>> | RunDetails<Ts>;
function check<Ts>(rawProperty: IRawProperty<Ts>, params?: Parameters<Ts>) {
if (rawProperty == null || rawProperty.generate == null)
throw new Error('Invalid property encountered, please use a valid property');
if (rawProperty.run == null)
throw new Error('Invalid property encountered, please use a valid property not an arbitrary');
const qParams: QualifiedParameters<Ts> = QualifiedParameters.read<Ts>({
...readConfigureGlobal(),
...params,
});
if (qParams.reporter !== null && qParams.asyncReporter !== null)
throw new Error('Invalid parameters encountered, reporter and asyncReporter cannot be specified together');
if (qParams.asyncReporter !== null && !rawProperty.isAsync())
throw new Error('Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified');
const property = decorateProperty(rawProperty, qParams);
const generator = toss(property, qParams.seed, qParams.randomType, qParams.examples);
const maxInitialIterations = qParams.path.indexOf(':') === -1 ? qParams.numRuns : -1;
const maxSkips = qParams.numRuns * qParams.maxSkipsPerRun;
const initialValues = buildInitialValues(generator, qParams);
const sourceValues = new SourceValuesIterator(initialValues, maxInitialIterations, maxSkips);
return property.isAsync()
? asyncRunIt(property, sourceValues, qParams.verbose, qParams.markInterruptAsFailure).then((e) =>
e.toRunDetails(qParams.seed, qParams.path, qParams.numRuns, maxSkips, qParams)
)
: runIt(property, sourceValues, qParams.verbose, qParams.markInterruptAsFailure).toRunDetails(
qParams.seed,
qParams.path,
qParams.numRuns,
maxSkips,
qParams
);
}
/**
* Run the property, throw in case of failure
*
* It can be called directly from describe/it blocks of Mocha.
* It does not return anything in case of success.
*
* WARNING: Has to be awaited
*
* @param property - Asynchronous property to be checked
* @param params - Optional parameters to customize the execution
*
* @public
*/
function assert<Ts>(property: IAsyncProperty<Ts>, params?: Parameters<Ts>): Promise<void>;
/**
* Run the property, throw in case of failure
*
* It can be called directly from describe/it blocks of Mocha.
* It does not return anything in case of success.
*
* @param property - Synchronous property to be checked
* @param params - Optional parameters to customize the execution
*
* @public
*/
function assert<Ts>(property: IProperty<Ts>, params?: Parameters<Ts>): void;
/**
* Run the property, throw in case of failure
*
* It can be called directly from describe/it blocks of Mocha.
* It does not return anything in case of success.
*
* WARNING: Has to be awaited if the property is asynchronous
*
* @param property - Property to be checked
* @param params - Optional parameters to customize the execution
*
* @public
*/
function assert<Ts>(property: IRawProperty<Ts>, params?: Parameters<Ts>): Promise<void> | void;
function assert<Ts>(property: IRawProperty<Ts>, params?: Parameters<Ts>) {
const out = check(property, params);
if (property.isAsync()) return (out as Promise<RunDetails<Ts>>).then(reportRunDetails);
else reportRunDetails(out as RunDetails<Ts>);
}
export { check, assert };
|
{
"pile_set_name": "Github"
}
|
}))}(document, Math));
|
{
"pile_set_name": "Github"
}
|
from typing import Any, Callable, Dict, List, Optional
from django.template.exceptions import TemplateSyntaxError
from .base import BaseEngine
class Jinja2(BaseEngine):
context_processors: List[str] = ...
def __init__(self, params: Dict[str, Any]) -> None: ...
@property
def template_context_processors(self) -> List[Callable]: ...
class Origin:
name: str = ...
template_name: Optional[str] = ...
def __init__(self, name: str, template_name: Optional[str]) -> None: ...
def get_exception_info(exception: TemplateSyntaxError) -> Dict[str, Any]: ...
|
{
"pile_set_name": "Github"
}
|
// Copyright 2006-2008 the V8 project authors. 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.
#ifndef V8_CHECKS_H_
#define V8_CHECKS_H_
#include <string.h>
#include "flags.h"
extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
void API_Fatal(const char* location, const char* format, ...);
// The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
// development, but they should not be relied on in the final product.
#ifdef DEBUG
#define FATAL(msg) \
V8_Fatal(__FILE__, __LINE__, "%s", (msg))
#define UNIMPLEMENTED() \
V8_Fatal(__FILE__, __LINE__, "unimplemented code")
#define UNREACHABLE() \
V8_Fatal(__FILE__, __LINE__, "unreachable code")
#else
#define FATAL(msg) \
V8_Fatal("", 0, "%s", (msg))
#define UNIMPLEMENTED() \
V8_Fatal("", 0, "unimplemented code")
#define UNREACHABLE() ((void) 0)
#endif
// Used by the CHECK macro -- should not be called directly.
static inline void CheckHelper(const char* file,
int line,
const char* source,
bool condition) {
if (!condition)
V8_Fatal(file, line, "CHECK(%s) failed", source);
}
// The CHECK macro checks that the given condition is true; if not, it
// prints a message to stderr and aborts.
#define CHECK(condition) CheckHelper(__FILE__, __LINE__, #condition, condition)
// Helper function used by the CHECK_EQ function when given int
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file, int line,
const char* expected_source, int expected,
const char* value_source, int value) {
if (expected != value) {
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i",
expected_source, value_source, expected, value);
}
}
// Helper function used by the CHECK_EQ function when given int64_t
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file, int line,
const char* expected_source,
int64_t expected,
const char* value_source,
int64_t value) {
if (expected != value) {
// Print int64_t values in hex, as two int32s,
// to avoid platform-dependencies.
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n#"
" Expected: 0x%08x%08x\n# Found: 0x%08x%08x",
expected_source, value_source,
static_cast<uint32_t>(expected >> 32),
static_cast<uint32_t>(expected),
static_cast<uint32_t>(value >> 32),
static_cast<uint32_t>(value));
}
}
// Helper function used by the CHECK_NE function when given int
// arguments. Should not be called directly.
static inline void CheckNonEqualsHelper(const char* file,
int line,
const char* unexpected_source,
int unexpected,
const char* value_source,
int value) {
if (unexpected == value) {
V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i",
unexpected_source, value_source, value);
}
}
// Helper function used by the CHECK function when given string
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file,
int line,
const char* expected_source,
const char* expected,
const char* value_source,
const char* value) {
if ((expected == NULL && value != NULL) ||
(expected != NULL && value == NULL) ||
(expected != NULL && value != NULL && strcmp(expected, value) != 0)) {
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s",
expected_source, value_source, expected, value);
}
}
static inline void CheckNonEqualsHelper(const char* file,
int line,
const char* expected_source,
const char* expected,
const char* value_source,
const char* value) {
if (expected == value ||
(expected != NULL && value != NULL && strcmp(expected, value) == 0)) {
V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %s",
expected_source, value_source, value);
}
}
// Helper function used by the CHECK function when given pointer
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file,
int line,
const char* expected_source,
const void* expected,
const char* value_source,
const void* value) {
if (expected != value) {
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n# Expected: %p\n# Found: %p",
expected_source, value_source,
expected, value);
}
}
static inline void CheckNonEqualsHelper(const char* file,
int line,
const char* expected_source,
const void* expected,
const char* value_source,
const void* value) {
if (expected == value) {
V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %p",
expected_source, value_source, value);
}
}
// Helper function used by the CHECK function when given floating
// point arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file,
int line,
const char* expected_source,
double expected,
const char* value_source,
double value) {
// Force values to 64 bit memory to truncate 80 bit precision on IA32.
volatile double* exp = new double[1];
*exp = expected;
volatile double* val = new double[1];
*val = value;
if (*exp != *val) {
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f",
expected_source, value_source, *exp, *val);
}
delete[] exp;
delete[] val;
}
static inline void CheckNonEqualsHelper(const char* file,
int line,
const char* expected_source,
double expected,
const char* value_source,
double value) {
// Force values to 64 bit memory to truncate 80 bit precision on IA32.
volatile double* exp = new double[1];
*exp = expected;
volatile double* val = new double[1];
*val = value;
if (*exp == *val) {
V8_Fatal(file, line,
"CHECK_NE(%s, %s) failed\n# Value: %f",
expected_source, value_source, *val);
}
delete[] exp;
delete[] val;
}
namespace v8 {
class Value;
template <class T> class Handle;
}
void CheckNonEqualsHelper(const char* file,
int line,
const char* unexpected_source,
v8::Handle<v8::Value> unexpected,
const char* value_source,
v8::Handle<v8::Value> value);
void CheckEqualsHelper(const char* file,
int line,
const char* expected_source,
v8::Handle<v8::Value> expected,
const char* value_source,
v8::Handle<v8::Value> value);
#define CHECK_EQ(expected, value) CheckEqualsHelper(__FILE__, __LINE__, \
#expected, expected, #value, value)
#define CHECK_NE(unexpected, value) CheckNonEqualsHelper(__FILE__, __LINE__, \
#unexpected, unexpected, #value, value)
#define CHECK_GT(a, b) CHECK((a) > (b))
#define CHECK_GE(a, b) CHECK((a) >= (b))
// This is inspired by the static assertion facility in boost. This
// is pretty magical. If it causes you trouble on a platform you may
// find a fix in the boost code.
template <bool> class StaticAssertion;
template <> class StaticAssertion<true> { };
// This macro joins two tokens. If one of the tokens is a macro the
// helper call causes it to be resolved before joining.
#define SEMI_STATIC_JOIN(a, b) SEMI_STATIC_JOIN_HELPER(a, b)
#define SEMI_STATIC_JOIN_HELPER(a, b) a##b
// Causes an error during compilation of the condition is not
// statically known to be true. It is formulated as a typedef so that
// it can be used wherever a typedef can be used. Beware that this
// actually causes each use to introduce a new defined type with a
// name depending on the source line.
template <int> class StaticAssertionHelper { };
#define STATIC_CHECK(test) \
typedef \
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>(test)>)> \
SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
// The ASSERT macro is equivalent to CHECK except that it only
// generates code in debug builds.
#ifdef DEBUG
#define ASSERT_RESULT(expr) CHECK(expr)
#define ASSERT(condition) CHECK(condition)
#define ASSERT_EQ(v1, v2) CHECK_EQ(v1, v2)
#define ASSERT_NE(v1, v2) CHECK_NE(v1, v2)
#define ASSERT_GE(v1, v2) CHECK_GE(v1, v2)
#define SLOW_ASSERT(condition) if (FLAG_enable_slow_asserts) CHECK(condition)
#else
#define ASSERT_RESULT(expr) (expr)
#define ASSERT(condition) ((void) 0)
#define ASSERT_EQ(v1, v2) ((void) 0)
#define ASSERT_NE(v1, v2) ((void) 0)
#define ASSERT_GE(v1, v2) ((void) 0)
#define SLOW_ASSERT(condition) ((void) 0)
#endif
// Static asserts has no impact on runtime performance, so they can be
// safely enabled in release mode. Moreover, the ((void) 0) expression
// obeys different syntax rules than typedef's, e.g. it can't appear
// inside class declaration, this leads to inconsistency between debug
// and release compilation modes behaviour.
#define STATIC_ASSERT(test) STATIC_CHECK(test)
#define ASSERT_TAG_ALIGNED(address) \
ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0)
#define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0)
#define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p)
#endif // V8_CHECKS_H_
|
{
"pile_set_name": "Github"
}
|
<?php
defined('IN_YZMPHP') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$parentid = $menu->insert(array('name'=>'广告管理', 'parentid'=>3, 'm'=>'adver', 'c'=>'adver', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'));
$menu->insert(array('name'=>'添加广告', 'parentid'=>$parentid, 'm'=>'adver', 'c'=>'adver', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu->insert(array('name'=>'修改广告', 'parentid'=>$parentid, 'm'=>'adver', 'c'=>'adver', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu->insert(array('name'=>'删除广告', 'parentid'=>$parentid, 'm'=>'adver', 'c'=>'adver', 'a'=>'del', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
|
{
"pile_set_name": "Github"
}
|
//
// PINRemoteImageDownloadQueue.m
// PINRemoteImage
//
// Created by Garrett Moon on 3/1/17.
// Copyright © 2017 Pinterest. All rights reserved.
//
#import "PINRemoteImageDownloadQueue.h"
#import "PINURLSessionManager.h"
#import "PINRemoteLock.h"
@interface PINRemoteImageDownloadQueue ()
{
PINRemoteLock *_lock;
NSMutableOrderedSet <NSURLSessionDataTask *> *_highPriorityQueuedOperations;
NSMutableOrderedSet <NSURLSessionDataTask *> *_defaultPriorityQueuedOperations;
NSMutableOrderedSet <NSURLSessionDataTask *> *_lowPriorityQueuedOperations;
NSMutableSet <NSURLSessionTask *> *_runningTasks;
}
@end
@implementation PINRemoteImageDownloadQueue
@synthesize maxNumberOfConcurrentDownloads = _maxNumberOfConcurrentDownloads;
+ (PINRemoteImageDownloadQueue *)queueWithMaxConcurrentDownloads:(NSUInteger)maxNumberOfConcurrentDownloads
{
return [[PINRemoteImageDownloadQueue alloc] initWithMaxConcurrentDownloads:maxNumberOfConcurrentDownloads];
}
- (PINRemoteImageDownloadQueue *)initWithMaxConcurrentDownloads:(NSUInteger)maxNumberOfConcurrentDownloads
{
if (self = [super init]) {
_maxNumberOfConcurrentDownloads = maxNumberOfConcurrentDownloads;
_lock = [[PINRemoteLock alloc] initWithName:@"PINRemoteImageDownloadQueue Lock"];
_highPriorityQueuedOperations = [[NSMutableOrderedSet alloc] init];
_defaultPriorityQueuedOperations = [[NSMutableOrderedSet alloc] init];
_lowPriorityQueuedOperations = [[NSMutableOrderedSet alloc] init];
_runningTasks = [[NSMutableSet alloc] init];
}
return self;
}
- (NSUInteger)maxNumberOfConcurrentDownloads
{
[self lock];
NSUInteger maxNumberOfConcurrentDownloads = _maxNumberOfConcurrentDownloads;
[self unlock];
return maxNumberOfConcurrentDownloads;
}
- (void)setMaxNumberOfConcurrentDownloads:(NSUInteger)maxNumberOfConcurrentDownloads
{
[self lock];
_maxNumberOfConcurrentDownloads = maxNumberOfConcurrentDownloads;
[self unlock];
[self scheduleDownloadsIfNeeded];
}
- (NSURLSessionDataTask *)addDownloadWithSessionManager:(PINURLSessionManager *)sessionManager
request:(NSURLRequest *)request
priority:(PINRemoteImageManagerPriority)priority
completionHandler:(PINRemoteImageDownloadCompletion)completionHandler
{
NSURLSessionDataTask *dataTask = [sessionManager dataTaskWithRequest:request
priority:priority
completionHandler:^(NSURLSessionTask *task, NSError *error) {
completionHandler(task.response, error);
[self lock];
[self->_runningTasks removeObject:task];
[self unlock];
[self scheduleDownloadsIfNeeded];
}];
[self setQueuePriority:priority forTask:dataTask addIfNecessary:YES];
[self scheduleDownloadsIfNeeded];
return dataTask;
}
- (void)scheduleDownloadsIfNeeded
{
[self lock];
while (_runningTasks.count < _maxNumberOfConcurrentDownloads) {
NSMutableOrderedSet <NSURLSessionDataTask *> *queue = nil;
if (_highPriorityQueuedOperations.count > 0) {
queue = _highPriorityQueuedOperations;
} else if (_defaultPriorityQueuedOperations.count > 0) {
queue = _defaultPriorityQueuedOperations;
} else if (_lowPriorityQueuedOperations.count > 0) {
queue = _lowPriorityQueuedOperations;
}
if (!queue) {
break;
}
NSURLSessionDataTask *task = [queue firstObject];
[queue removeObjectAtIndex:0];
[task resume];
[_runningTasks addObject:task];
}
[self unlock];
}
- (BOOL)removeDownloadTaskFromQueue:(NSURLSessionDataTask *)downloadTask
{
BOOL containsTask = NO;
[self lock];
if ([_highPriorityQueuedOperations containsObject:downloadTask]) {
containsTask = YES;
[_highPriorityQueuedOperations removeObject:downloadTask];
} else if ([_defaultPriorityQueuedOperations containsObject:downloadTask]) {
containsTask = YES;
[_defaultPriorityQueuedOperations removeObject:downloadTask];
} else if ([_lowPriorityQueuedOperations containsObject:downloadTask]) {
containsTask = YES;
[_lowPriorityQueuedOperations removeObject:downloadTask];
}
[self unlock];
return containsTask;
}
- (void)setQueuePriority:(PINRemoteImageManagerPriority)priority forTask:(NSURLSessionDataTask *)downloadTask
{
[self setQueuePriority:priority forTask:downloadTask addIfNecessary:NO];
}
- (void)setQueuePriority:(PINRemoteImageManagerPriority)priority forTask:(NSURLSessionDataTask *)downloadTask addIfNecessary:(BOOL)addIfNecessary
{
BOOL containsTask = [self removeDownloadTaskFromQueue:downloadTask];
if (containsTask || addIfNecessary) {
NSMutableOrderedSet <NSURLSessionDataTask *> *queue = nil;
[self lock];
switch (priority) {
case PINRemoteImageManagerPriorityLow:
queue = _lowPriorityQueuedOperations;
break;
case PINRemoteImageManagerPriorityDefault:
queue = _defaultPriorityQueuedOperations;
break;
case PINRemoteImageManagerPriorityHigh:
queue = _highPriorityQueuedOperations;
break;
default:
NSAssert(NO, @"invalid priority: %tu", priority);
break;
}
[queue addObject:downloadTask];
[self unlock];
}
}
- (void)lock
{
[_lock lock];
}
- (void)unlock
{
[_lock unlock];
}
@end
|
{
"pile_set_name": "Github"
}
|
{% import 'appbuilder/general/lib.html' as lib %}
{% if form_action is defined %}
<form action="{{form_action}}" method="post" enctype="multipart/form-data">
{% endif %}
<form class="form-vertical" role="form" id="model_form" action="" method="post" enctype="multipart/form-data">
{{form.hidden_tag()}}
{% if fieldsets %}
{% for fieldset_item in fieldsets %}
{% if fieldset_item[1].get('expanded') == None %}
{% set expanded = True %}
{% else %}
{% set expanded = fieldset_item[1].get('expanded') %}
{% endif %}
{% call lib.accordion_tag(loop.index,fieldset_item[0], expanded) %}
{% for item in fieldset_item[1].get('fields') %}
{% if item not in exclude_cols %}
{{ lib.render_field(form[item]) }}
{% endif %}
{% endfor %}
{% endcall %}
{% endfor %}
{% else %}
<div class="well-sm">
{% for col in include_cols %}
{% set field = form[col] %}
{% if field.name not in exclude_cols %}
{{ lib.render_field(field) }}
{% endif %}
{% endfor %}
{% endif %}
</div>
{{ lib.render_form_controls() }}
</form>
|
{
"pile_set_name": "Github"
}
|
//! Disassembles machine code
use std::fmt::Display;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::process::exit;
use std::str::FromStr;
use capstone::{self, prelude::*, Arch, Endian, EnumList, ExtraMode, Mode};
use clap::{App, Arg, ArgGroup};
use log::{debug, info};
use stderrlog;
const DEFAULT_CAPACITY: usize = 1024;
trait ExpectExit<T> {
fn expect_exit(self) -> T;
}
impl<T, E> ExpectExit<T> for Result<T, E>
where
E: Display,
{
fn expect_exit(self) -> T {
match self {
Ok(t) => t,
Err(e) => {
eprintln!("error: {}", e);
exit(1);
}
}
}
}
/// Print register names
fn reg_names<T, I>(cs: &Capstone, regs: T) -> String
where
T: Iterator<Item = I>,
I: Into<RegId>,
{
let names: Vec<String> = regs.map(|x| cs.reg_name(x.into()).unwrap()).collect();
names.join(", ")
}
/// Print instruction group names
fn group_names<T, I>(cs: &Capstone, regs: T) -> String
where
T: Iterator<Item = I>,
I: Into<InsnGroupId>,
{
let names: Vec<String> = regs.map(|x| cs.group_name(x.into()).unwrap()).collect();
names.join(", ")
}
/// Select only hex bytes from input
fn unhexed_bytes(input: Vec<u8>) -> Vec<u8> {
let mut output: Vec<u8> = Vec::new();
let mut curr_byte_str = String::with_capacity(2);
for b_u8 in input {
let b = char::from(b_u8);
if ('0' <= b && b <= '9') || ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') {
curr_byte_str.push(b);
}
if curr_byte_str.len() == 2 {
debug!(" curr_byte_str={:?}", curr_byte_str);
let byte = u8::from_str_radix(&curr_byte_str, 16).expect("Unexpect hex parse error");
output.push(byte);
curr_byte_str.clear();
}
}
if log::max_level() >= log::LevelFilter::Info {
let output_hex: Vec<String> = output.iter().map(|x| format!("{:02x}", x)).collect();
info!("unhexed_output = {:?}", output_hex);
}
output
}
fn disasm<T: Iterator<Item = ExtraMode>>(
arch: Arch,
mode: Mode,
extra_mode: T,
endian: Option<Endian>,
code: &[u8],
addr: u64,
show_detail: bool,
) {
info!("Got {} bytes", code.len());
let mut cs = Capstone::new_raw(arch, mode, extra_mode, endian).expect_exit();
if show_detail {
cs.set_detail(true).expect("Failed to set detail");
}
let stdout = io::stdout();
let mut handle = stdout.lock();
for i in cs.disasm_all(code, addr).expect_exit().iter() {
let bytes: Vec<_> = i.bytes().iter().map(|x| format!("{:02x}", x)).collect();
let bytes = bytes.join(" ");
let _ = writeln!(
&mut handle,
"{:-10x}: {:35} {:7} {}",
i.address(),
bytes,
i.mnemonic().unwrap(),
i.op_str().unwrap_or("")
)
.is_ok();
if show_detail {
let detail = cs.insn_detail(&i).expect("Failed to get insn detail");
let output: &[(&str, String)] = &[
("insn id:", format!("{:?}", i.id().0)),
("read regs:", reg_names(&cs, detail.regs_read())),
("write regs:", reg_names(&cs, detail.regs_write())),
("insn groups:", group_names(&cs, detail.groups())),
];
for &(ref name, ref message) in output.iter() {
let _ = writeln!(&mut handle, "{:13}{:12} {}", "", name, message).is_ok();
}
}
}
}
const FILE_ARG: &str = "file";
const STDIN_ARG: &str = "stdin";
const CODE_ARG: &str = "code";
const ADDRESS_ARG: &str = "address";
const VERBOSE_ARG: &str = "verbose";
const HEX_ARG: &str = "hex";
const DETAIL_ARG: &str = "detail";
const ARCH_ARG: &str = "arch";
const MODE_ARG: &str = "mode";
const EXTRA_MODE_ARG: &str = "extra";
const ENDIAN_ARG: &str = "endian";
const AFTER_HELP: &str = r#"
Example:
# Disassemble 32-bit X86 (non-hex characters are ignored)
cstool --arch x86 --mode mode32 --code "90 42 e812345678"
1000: 90 nop
1001: 42 inc edx
1002: e8 12 34 56 78 call 0x78564419
"#;
fn main() {
// Lowercase arches
let _arches: Vec<String> = Arch::variants()
.iter()
.map(|x| format!("{}", x).to_lowercase())
.collect();
let arches: Vec<&str> = _arches.iter().map(|x| x.as_str()).collect();
// Lowercase modes
let _modes: Vec<String> = Mode::variants()
.iter()
.map(|x| format!("{}", x).to_lowercase())
.collect();
let modes: Vec<&str> = _modes.iter().map(|x| x.as_str()).collect();
// Lowercase extra modes
let _extra_modes: Vec<String> = ExtraMode::variants()
.iter()
.map(|x| format!("{}", x).to_lowercase())
.collect();
let extra_modes: Vec<&str> = _extra_modes.iter().map(|x| x.as_str()).collect();
let matches = App::new("capstone-rs disassembler tool")
.about("Disassembles binary file")
.after_help(AFTER_HELP)
.arg(
Arg::with_name(FILE_ARG)
.short("f")
.long(FILE_ARG)
.help("input file with binary instructions")
.takes_value(true),
)
.arg(
Arg::with_name(STDIN_ARG)
.short("s")
.long(STDIN_ARG)
.help("read binary instructions from stdin")
.takes_value(false),
)
.arg(
Arg::with_name(CODE_ARG)
.short("c")
.long(CODE_ARG)
.help("instruction bytes (implies --hex)")
.takes_value(true),
)
.arg(
Arg::with_name(ADDRESS_ARG)
.short("r")
.long("addr")
.help("address of code")
.takes_value(true),
)
.arg(
Arg::with_name(VERBOSE_ARG)
.short("v")
.multiple(true)
.help("Sets the level of verbosity"),
)
.arg(
Arg::with_name(HEX_ARG)
.short("x")
.long(HEX_ARG)
.help("Treat input has hex; only select characters that are [a-fA-F0-9]")
.takes_value(false),
)
.arg(
Arg::with_name(DETAIL_ARG)
.short("d")
.long(DETAIL_ARG)
.help("Print details about instructions")
.takes_value(false),
)
.arg(
Arg::with_name(ARCH_ARG)
.short("a")
.long(ARCH_ARG)
.help("Architecture")
.takes_value(true)
.required(true)
.possible_values(arches.as_slice())
.case_insensitive(true),
)
.arg(
Arg::with_name(MODE_ARG)
.short("m")
.long(MODE_ARG)
.help(MODE_ARG)
.takes_value(true)
.required(true)
.possible_values(modes.as_slice())
.case_insensitive(true),
)
.arg(
Arg::with_name(EXTRA_MODE_ARG)
.short("e")
.long(EXTRA_MODE_ARG)
.help("Extra Mode")
.takes_value(true)
.required(false)
.possible_values(extra_modes.as_slice())
.case_insensitive(true)
.multiple(true),
)
.arg(
Arg::with_name(ENDIAN_ARG)
.short("n")
.long(ENDIAN_ARG)
.help("Endianness")
.takes_value(true)
.required(false)
.possible_values(&["little", "big"])
.case_insensitive(true),
)
.group(
ArgGroup::with_name("input")
.arg(FILE_ARG)
.arg(STDIN_ARG)
.arg(CODE_ARG)
.required(true),
)
.get_matches();
let direct_input_bytes: Vec<u8> = if let Some(file_path) = matches.value_of(FILE_ARG) {
let mut file = File::open(file_path).expect_exit();
let capacity = match file.metadata() {
Err(_) => DEFAULT_CAPACITY,
Ok(metadata) => metadata.len() as usize,
};
let mut buf = Vec::with_capacity(capacity as usize);
file.read_to_end(&mut buf).expect_exit();
buf
} else if let Some(code) = matches.value_of(CODE_ARG) {
code.as_bytes().iter().map(|x| *x).collect()
} else {
let mut buf = Vec::with_capacity(DEFAULT_CAPACITY);
let stdin = std::io::stdin();
stdin.lock().read_to_end(&mut buf).expect_exit();
buf
};
stderrlog::new()
.verbosity(matches.occurrences_of(VERBOSE_ARG) as usize)
.init()
.unwrap();
let is_hex = matches.is_present(HEX_ARG) || matches.is_present(CODE_ARG);
info!("is_hex = {:?}", is_hex);
let show_detail = matches.is_present(DETAIL_ARG);
info!("show_detail = {:?}", show_detail);
let arch: Arch = Arch::from_str(matches.value_of(ARCH_ARG).unwrap())
.unwrap()
.into();
info!("Arch = {:?}", arch);
let mode: Mode = Mode::from_str(matches.value_of(MODE_ARG).unwrap())
.unwrap()
.into();
info!("Mode = {:?}", mode);
let extra_mode: Vec<_> = match matches.values_of(EXTRA_MODE_ARG) {
None => Vec::with_capacity(0),
Some(x) => x
.map(|x| ExtraMode::from(ExtraMode::from_str(x).unwrap()))
.collect(),
};
info!("ExtraMode = {:?}", extra_mode);
let endian: Option<Endian> = matches
.value_of(ENDIAN_ARG)
.map(|x| Endian::from_str(x).expect_exit());
info!("Endian = {:?}", endian);
let address =
u64::from_str_radix(matches.value_of(ADDRESS_ARG).unwrap_or("1000"), 16).expect_exit();
info!("Address = 0x{:x}", address);
let input_bytes = if is_hex {
unhexed_bytes(direct_input_bytes)
} else {
direct_input_bytes
};
disasm(
arch,
mode,
extra_mode.iter().map(|x| *x),
endian,
input_bytes.as_slice(),
address,
show_detail,
);
}
|
{
"pile_set_name": "Github"
}
|
# -------------------------------------------------
# Project created by QtCreator 2009-10-05T18:53:58
# -------------------------------------------------
QT += network
QT -= gui
TARGET = ChatSystem
TEMPLATE = lib
include(../../Common/common.pri)
include(../../Libs/protobuf.pri)
CONFIG += staticlib \
link_prl \
create_prl
INCLUDEPATH += . \
../..
DEFINES += CHATSYSTEM_LIBRARY
SOURCES += Builder.cpp \
priv/Log.cpp \
priv/ChatSystem.cpp \
priv/ChatMessage.cpp \
priv/ChatMessages.cpp
HEADERS += IChatSystem.h \
priv/ChatSystem.h \
Builder.h \
priv/Log.h \
priv/ChatMessage.h \
priv/ChatMessages.h
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
|
{
"pile_set_name": "Github"
}
|
[database]
driver = mysql
host = 127.0.0.1
username = root
port = 3306
password = root
database = goadmin
[database.business]
driver = mysql
host = 127.0.0.1
username = root
port = 3306
password = root
database = business
tables = users,clothes
[model]
package = main
connection = default
output = ./
generate_permission_flag = Y
[user]
name = tester
nickname = tester
password = 123456
[permission]
tables = user,clothes
[language]
language = cn
|
{
"pile_set_name": "Github"
}
|
adjusting ipsec.d to OUTPUT
Starting Pluto (Openswan Version VERSION
LEAK_DETECTIVE support [disabled]
OCF support for IKE [disabled]
SAref support [disabled]: Protocol not available
SAbind support [disabled]: Protocol not available
HAVE_STATSD notification support not compiled in
Setting NAT-Traversal port-4500 floating to off
port floating activation criteria nat_t=0/port_float=1
NAT-Traversal support [disabled]
ike_alg_register_enc(): Activating OAKLEY_AES_CBC: Ok (ret=0)
ike_alg_register_hash(): Activating OAKLEY_SHA2_512: Ok (ret=0)
ike_alg_register_hash(): Activating OAKLEY_SHA2_256: Ok (ret=0)
starting up X cryptographic helpers
Using 'no_kernel' interface code on
|
{
"pile_set_name": "Github"
}
|
<resources>
<declare-styleable name="LinearGaugeView">
</declare-styleable>
</resources>
|
{
"pile_set_name": "Github"
}
|
import check {...}
void testIntegerOperators() {
variable Integer i1 = -4;
i1 = -i1;
check(i1==4, "negation");
i1 = + (-987654);
check(i1==-987654, "positive");
i1 = +0;
check(i1==0, "+0=0");
i1 = -0;
check(i1==0, "+0=0");
variable Integer i2 = 123 + 456;
check(i2==579, "addition");
i1 = i2 - 16;
check(i1==563, "subtraction");
i2 = -i1 + i2 - 1;
check(i2==15, "-i1+i2-1");
i1 = 3 * 7;
check(i1==21, "multiplication");
i2 = i1 * 2;
check(i2==42, "multiplication");
i2 = 17 / 4;
check(i2==4, "integer division");
i1 = i2 * 516 / -i1;
check(i1==-98, "i2*516/-i1");
i1 = 15 % 4;
check(i1==3, "modulo");
i2 = 312 % 12;
check(i2==0, "modulo");
i1 = 2 ^ 10;
check(i1==1024, "power");
i2 = 10 ^ 6;
check(i2==1000000, "power");
}
void testFloatOperators() {
variable Float f1 = -4.2;
f1 = -f1;
check(f1==4.2, "negation");
f1 = + (-987654.9925567);
check(f1==-987654.9925567, "positive");
f1 = +0.0;
check(f1==0.0, "+0.0=0.0");
f1 = -0.0;
check(f1==0.0, "-0.0=0.0");
variable Float f2 = 3.14159265 + 456.0;
check(f2==459.14159265, "addition");
f1 = f2 - 0.0016;
check(f1==459.13999265, "subtraction");
f2 = -f1 + f2 - 1.2;
check(f2==-1.1984000000000037, "-f1+f2-1.2");
f1 = 3.0 * 0.79;
check(f1==2.37, "multiplication");
f2 = f1 * 2.0e13;
check(f2==47400000000000.0, "multiplication");
f2 = 17.1 / 4.0E-18;
check(f2==4275000000000000000.0, "division");
f1 = f2 * 51.6e2 / -f1;
check(f2==4275000000000000000.0, "f2*51.6e2/-f1");
f1 = 150.0 ^ 0.5;
check(f1==12.24744871391589, "power");
}
class OpTest1() {}
void testBooleanOperators() {
value o1 = OpTest1();
value o2 = OpTest1();
variable Boolean b1 = o1 === o2;
check(!b1, "identity");
variable Boolean b2 = o1 === o1;
check(b2, "identity");
b1 = o1 == o2;
check(!b1, "equals");
b2 = o1 == o1;
check(b2, "equals");
b1 = 1 == 2;
check(!b1, "equals");
b2 = 1 != 2;
check(b2, "not equal");
variable Boolean b3 = !b2;
check(!b3, "not");
b1 = true && false;
check(!b1, "and");
b2 = b1 && true;
check(!b2, "and");
b3 = true && true;
check(b3, "and");
b1 = true || false;
check(b1, "or");
b2 = false || b1;
check(b2, "or");
b3 = false || false;
check(!b3, "or");
b1=true;
check(b1&&=true, "&&=");
check(b1||=false, "||=");
}
void testComparisonOperators() {
Comparison c1 = "str1" <=> "str2";
check(c1==smaller, "compare");
Comparison c2 = "str2" <=> "str1";
check(c2==larger, "compare");
Comparison c3 = "str1" <=> "str1";
check(c3==equal, "compare");
Comparison c4 = "" <=> "";
check(c4==equal, "compare");
Comparison c5 = "str1" <=> "";
check(c5==larger, "compare");
Comparison c6 = "" <=> "str2";
check(c6==smaller, "compare");
variable Boolean b1 = "str1" < "str2";
check(b1, "smaller");
variable Boolean b2 = "str1" > "str2";
check(!b2, "larger");
variable Boolean b3 = "str1" <= "str2";
check(b3, "small as");
variable Boolean b4 = "str1" >= "str2";
check(!b4, "large as");
b1 = "str1" < "str1";
check(!b1, "smaller");
b2 = "str1" > "str1";
check(!b2, "larger");
b3 = "str1" <= "str1";
check(b3, "small as");
b4 = "str1" >= "str1";
check(b4, "large as");
//within
value a = 0;
value c = 10;
check(a < 5 < c, "``a``<5<``c``");
check(a <= 0 < c, "``a``<=0<``c``");
check(a < 10 <= c, "``a``<10<=``c``");
check(a <= 0 <= c, "``a``<=0<=``c``");
check(a <= 10 <= c, "``a``<=10<=``c``");
check(!(a < 15 < c), "``a``<15<``c`` WTF");
check(!(a <= 10 < c), "``a``<=10<``c`` WTF");
check(!(a < 0 <= c), "``a``<0<=``c`` WTF");
check(!(a <= 11 <= c), "``a``<=11<=``c`` WTF");
check(!(a <= -1 <= c), "``a``<=-1<=``c`` WTF");
}
void testOtherOperators() {
Integer->String entry = 47->"hi there";
check(entry.key==47, "entry key");
check(entry.item=="hi there", "entry item");
value entry2 = true->entry;
check(entry2.key==true, "entry key");
check(entry2.item==47->"hi there", "entry item");
String s1 = true then "ok" else "noo";
check(s1=="ok", "then/else 1");
String s2 = false then "what?" else "great";
check(s2=="great", "then/else 2");
}
void testCollectionOperators() {
value seq1 = [ "one", "two" ];
String s1 = seq1[0]; //not optional anymore!
check(s1=="one", "lookup 1");
String|Null s2 = seq1[2]; //not optional anymore!
check(!s2 exists, "lookup 2");
String|Null s3 = seq1[-1]; //not optional anymore!
check(!s3 exists, "lookup 3");
//variable Sequence<String>? unsafe = seq1;
//check(unsafe?[0] exists, "safe index");
//unsafe = null;
//check(!unsafe?[0] exists, "safe index");
}
class NullsafeTest() {
shared Integer f() {return 1;}
shared Integer? f2(Integer? x()) {
return x();
}
}
Integer? nullsafeTest(Integer? f()) {
return f();
}
void testNullsafeOperators() {
String[] seq = [ "hi" ];
String s1 = seq[0] else "nuLl";
check(s1=="hi", "default 1");
String s2 = seq[1] else "nuLl";
check(s2=="nuLl", "default 2");
String? s3 = null;
String? s4 = "test";
String s5 = s3?.uppercased else "nuLl";
String s6 = s4?.uppercased else "null";
check(s5=="nuLl", "nullsafe member 1");
check(s6=="TEST", "nullsafe member 2");
NullsafeTest? obj = null;
Integer? i = obj?.f();
check(!i exists, "nullsafe invoke");
Callable<Integer?,[]> f2 = obj?.f;
check(!nullsafeTest(f2) exists, "nullsafe method ref");
Callable<Integer?,[]>? f3 = obj?.f;
check(f3 exists, "nullsafe method ref 2");
obj?.f();
check(!obj?.f() exists, "nullsafe simple call");
NullsafeTest? getNullsafe() { return obj; }
function f4() => getNullsafe()?.f();
Integer? result_f4 = f4();
check(!result_f4 exists, "nullsafe invoke 2");
Integer? i2 = getNullsafe()?.f();
check(!i2 exists, "nullsafe invoke 3");
check(!NullsafeTest().f2(getNullsafe()?.f) exists, "nullsafe method ref 3");
NullsafeTest? obj2 = NullsafeTest();
if (exists i3 = obj2?.f()) {
check(i3==1, "nullsafe invoke 4 (result)");
} else {
fail("nullsafe invoke 4 (null)");
}
Integer? obj2_f() => obj2?.f();
if (exists i3 = obj2_f()) {
check(i3==1, "nullsafe method ref 4 (result)");
} else {
fail("nullsafe method ref 4 (null)");
}
}
void testIncDecOperators() {
variable Integer x0 = 1;
Integer x { return x0; } assign x { x0 = x; }
variable Integer i1 = 1;
void f1() {
Integer i2 = ++i1;
Integer x2 = ++x;
check(i1==2, "prefix increment 1");
check(i2==2, "prefix increment 2");
check(x==2, "prefix increment 3");
check(x2==2, "prefix increment 4");
}
f1();
class C1() {
shared variable Integer i = 1;
variable Integer x0 = 1;
shared Integer x { return x0; } assign x { x0 = x; }
}
C1 c1 = C1();
variable Integer i3 = 0;
C1 f2() {
++i3;
return c1;
}
Integer i4 = ++f2().i;
Integer x4 = ++f2().x;
check(i4==2, "prefix increment 5");
check(c1.i==2, "prefix increment 6");
check(x4==2, "prefix increment 7");
check(c1.x==2, "prefix increment 8");
check(i3==2, "prefix increment 9");
void f3() {
Integer i2 = --i1;
check(i1==1, "prefix decrement");
check(i2==1, "prefix decrement");
}
f3();
Integer i5 = --f2().i;
check(i5==1, "prefix decrement");
check(c1.i==1, "prefix decrement");
check(i3==3, "prefix decrement");
void f4() {
Integer i2 = i1++;
Integer x2 = x++;
check(i1==2, "postfix increment 1");
check(i2==1, "postfix increment 2");
check(x==3, "postfix increment 3");
check(x2==2, "postfix increment 4");
}
f4();
Integer i6 = f2().i++;
Integer x6 = f2().x++;
check(i6==1, "postfix increment 5");
check(c1.i==2, "postfix increment 6");
check(x6==2, "postfix increment 7 ");
check(c1.x==3, "postfix increment 8 ");
check(i3==5, "postfix increment 9");
void f5() {
Integer i2 = i1--;
check(i1==1, "postfix decrement");
check(i2==2, "postfix decrement");
}
f5();
Integer i7 = f2().i--;
check(i7==2, "postfix decrement");
check(c1.i==1, "postfix decrement");
check(i3==6, "postfix decrement");
}
void testArithmeticAssignOperators() {
variable Integer i1 = 1;
variable Integer x0 = 1;
Integer x { return x0; } assign x { x0=x; }
i1 += 10;
x += 10;
check(i1==11, "+= operator 1");
check(x==11, "+= operator 2");
variable Integer i2 = (i1 += -5);
variable Integer x2 = (x += -5);
check(i2==6, "+= operator 3");
check(i1==6, "+= operator 4");
check(x2==6, "+= operator 5");
check(x==6, "+= operator 6");
class C1() {
shared variable Integer i = 1;
variable Integer x0 = 1;
shared Integer x { return x0; } assign x { x0=x; }
}
C1 c1 = C1();
variable Integer i3 = 0;
C1 f() {
++i3;
return c1;
}
i2 = (f().i += 11);
x2 = (f().x += 11);
check(i2==12, "+= operator 7");
check(c1.i==12, "+= operator 8");
check(x2==12, "+= operator 9");
check(c1.x==12, "+= operator 10");
check(i3==2, "+= operator 11");
i2 = (i1 -= 14);
check(i1==-8, "-= operator");
check(i2==-8, "-= operator");
i2 = (i1 *= -3);
check(i1==24, "*= operator");
check(i2==24, "*= operator");
i2 = (i1 /= 5);
check(i1==4, "/= operator");
check(i2==4, "/= operator");
i2 = (i1 %= 3);
check(i1==1, "%= operator");
check(i2==1, "%= operator");
}
void testAssignmentOperator() {
variable Integer i1 = 1;
variable Integer i2 = 2;
variable Integer i3 = 3;
check((i1=i2=i3)==3, "assignment 1");
check(i1==3, "assignment 2");
check(i2==3, "assignment 3");
Integer x1 { return i1; } assign x1 { i1 = x1; }
Integer x2 { return i2; } assign x2 { i2 = x2; }
Integer x3 { return i3; } assign x3 { i3 = x3; }
i1 = 1;
i2 = 2;
check((x1=x2=x3)==3, "assignment 4");
check(x1==3, "assignment 5");
check(x2==3, "assignment 6");
class C() {
shared variable Integer i = 1;
variable Integer x0 = 1;
shared Integer x { return x0; } assign x { x0=x; }
}
C o1 = C();
C o2 = C();
check((o1.i=o2.i=3)==3, "assignment 7");
check(o1.i==3, "assignment 8");
check(o2.i==3, "assignment 9");
check((o1.x=o2.x=3)==3, "assignment 10");
check(o1.x==3, "assignment 11");
check(o2.x==3, "assignment 12");
}
void testRangeOps() {
value seq = [ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" ];
check(seq[1..2] == ["two", "three" ], "seq[1:2] ``seq[1..2]``");
check(seq[3..5] == ["four", "five", "six"], "seq[3..5] ``seq[3..5]``");
check("test"[1..2] == "es", "test[1..2] ``("test"[1..2])``");
check("hello"[2..2] == "l", "hello[2..2] ``("hello"[2..2])``");
value s2 = 0..3;
value s3 = 2..5;
check(s2.size == 4, "0..3 [1]");
check(s2[0] == 0, "0..3 [2.1]");
check(s2.first == 0, "0..3 [2.2]");
if (exists x=s2[2]) {
check(x == 2, "0..3 [3]");
} else { fail("0..3 [3]"); }
check(s3.size == 4, "2..5 [1]");
check(s3[0] == 2, "2..5 [1]");
if (exists x=s3[2]) {
check(x == 4, "2..5 [2]");
} else { fail("2..5 [2]"); }
if (exists x=s3[3]) {
check(x == 5, "2..5 [3]");
} else { fail("2..5 [3]"); }
if (exists x=s3[4]) {
fail("2..5 [3]");
}
check((1..-1).decreasing, "1..-1 decreasing");
check((1..-1).size==3, "1..-1 size");
variable value rounds=0;
for (i in 0..10) { rounds++; }
check(rounds==11, "for(range) 1");
rounds=0;
variable value testChar='.';
for (i in 'a'..'e') {
rounds++;
testChar=i;
}
check(rounds==5, "for(range) 2");
check(testChar=='e', "for(range) 2");
rounds=-1;
variable value testInt=0;
for (i in 1..rounds) {
testInt++;
}
check(testInt==3, "for(range) 3");
rounds=0;
for (i in testInt..5) {
rounds++;
}
check(rounds==3, "for(range) 4");
rounds=0;
for (i in testInt..0) {
rounds++;
}
check(rounds==4, "for(range) 5");
}
void testSegments() {
value seq = [ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" ];
check(seq[1:2] == ["two", "three" ], "seq[1:2] ``seq[1:2]``");
check(seq[3:5] == ["four", "five", "six", "seven", "eight"], "seq[3:5] ``seq[3:5]``");
check("test"[1:2] == "es", "test[1:2] ``("test"[1:2])``");
check("hello"[2:2] == "ll", "hello[2:2] ``("hello"[2:2])``");
check(seq*.uppercased == [ "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN"], "spread op");
value iter = { for (c in "hola") c };
check(iter*.uppercased == [ 'H', 'O', 'L', 'A' ], "spread iterable");
value s2 = 0:3;
value s3 = 2:5;
check(s2.size == 3, "0:3 [1]");
if (exists x=s2[0]) {
check(x == 0, "0:3 [2]");
} else { fail("0:3 [2]"); }
if (exists x=s2[2]) {
check(x == 2, "0:3 [3]");
} else { fail("0:3 [3]"); }
check(s3.size == 5, "2:5 [1]");
if (exists x=s3[0]) {
check(x == 2, "2:5 [1]");
} else { fail("2:5 [1]"); }
if (exists x=s3[2]) {
check(x == 4, "2:5 [2]");
} else { fail("2:5 [2]"); }
if (exists x=s3[4]) {
check(x == 6, "2:5 [3]");
} else { fail("2:5 [3]"); }
check(!1:0 nonempty, "1:0 empty");
check(!1:-1 nonempty, "1:-1 empty");
variable value rounds=0;
for (i in 0:10) { rounds++; }
check(rounds==10, "for(segment) 1");
rounds=0;
variable value testChar='.';
for (i in 'a':5) {
rounds++;
testChar=i;
}
check(rounds==5, "for(segment) 2");
check(testChar=='e', "for(segment) 2");
rounds=-1;
for (i in 'a':rounds) {
testChar=i;
}
check(testChar=='e', "for(segment) 3");
rounds=2;
for (i in 'a':rounds) {
testChar=i;
}
check(testChar=='b', "for(segment) 4");
//#434
{Anything*} i434a = [[null]]*.first;
{Anything*} i434b = [[null]]*.get(0);
check(!i434a.first exists, "#434.1");
check(!i434b.first exists, "#434.2");
}
void compareStringNumber() {
//This is pretty fucking basic and I just found out it's broken in js
Object n1 = 1;
Object s1 = "1";
Object n2 = 1.0;
Object s2 = "1.0";
check(n1 != s1, "Integer and String should NOT be equal!");
check(s1 != n1, "String and Integer should NOT be equal!");
check(n2 != s2, "Float and String sould NOT be equal");
check(s2 != n2, "String and Float should NOT be equal");
}
class TestSet<out Element>({Element*} e) satisfies Set<Element>
given Element satisfies Object {
hash = e.hash;
shared actual TestSet<Element> clone() => this;
shared actual Iterator<Element> iterator() => e.iterator();
shared actual Set<Element|Other> union<Other>(Set<Other> other)
given Other satisfies Object {
value others = [for (o in e) if (is Other o, !o in other) o];
return TestSet(other.chain(others));
}
shared actual Set<Element&Other> intersection<Other>(Set<Other> set)
given Other satisfies Object {
return TestSet{for (elem in e) if (is Other elem, elem in set) elem };
}
shared actual Set<Element|Other> exclusiveUnion<Other>(Set<Other> set)
given Other satisfies Object {
return set;
}
shared actual Set<Element> complement<Other>(Set<Other> set)
given Other satisfies Object {
return TestSet{for (o in e) if (!o in set) o};
}
shared actual Boolean equals(Object other) {
if (is TestSet<Element> other) {
return size==other.size && every((Object o) => o in other) && other.every((Object o) => o in this);
}
return false;
}
}
void testSetOperators() {
variable Set<Integer> s1 = TestSet{1,2,3,4};
Set<Integer> s2 = TestSet{4,5,6};
check((s1|s2).size == 6, "Set |");
check((s1~s2).size == 3, "Set ~");
check((s1&s2).size == 1, "Set &");
check((s1|=s2).size == 6, "Set |=");
check((s1&=s2) == s2, "Set &=");
check((s1~=s2).size == 0, "Set ~=");
}
void testIssues() {
//315
String? s=null;
check((s else "1") == "1", "Issue 315 [1]");
dynamic {
dynamic z=dynamic[a=1;];
check((z.b else "2") == "2", "Issue 315 [2]");
}
//c.l 624
Object t1 = [1, "hello", true, 1, 0, 1, 2, 3];
Object t2 = [1, "hello", true];
Object t3 = [1, "hello", true, 1, "no"];
check(t1 is [Integer, String, Boolean, Integer,Integer,Integer,Integer,Integer], "c.l 624.1");
check(t1 is [Integer, String, Boolean, Integer*], "c.l 624.2");
check(t1 is [Integer, String, Boolean, Integer+], "c.l 624.3");
check(t2 is [Integer, String, Boolean, Integer*], "c.l 624.4");
check(t2 is [Integer, String, Boolean, String*], "c.l 624.5");
check(!t2 is [Integer, String, Boolean, Integer+], "c.l 624.6");
check(!t3 is [Integer, String, Boolean, Integer*], "c.l 624.7");
check(!t3 is [Integer, String, Boolean, Integer+], "c.l 624.8");
value big=#100000000;
check(big.clear(-1)==0, "#5799.1"); // 4294967296
check(big.clear(0) ==0, "#5799.2"); // 0
check(big.clear(31)==0, "#5799.3"); // 0
check(big.clear(32)==0, "#5799.4");
}
shared void test() {
testIntegerOperators();
testFloatOperators();
testBooleanOperators();
testComparisonOperators();
testOtherOperators();
testCollectionOperators();
testNullsafeOperators();
testIncDecOperators();
testArithmeticAssignOperators();
testAssignmentOperator();
testSetOperators();
testRangeOps();
testSegments();
testEnumerations();
compareStringNumber();
testIssues();
results();
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2016 - 2019 Benjamin Vedder benjamin@vedder.se
This file is part of VESC Tool.
VESC Tool 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 3 of the License, or
(at your option) any later version.
VESC Tool 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef TCPSERVERSIMPLE_H
#define TCPSERVERSIMPLE_H
#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include "packet.h"
class TcpServerSimple : public QObject
{
Q_OBJECT
public:
explicit TcpServerSimple(QObject *parent = nullptr);
bool startServer(int port, QHostAddress addr = QHostAddress::Any);
void stopServer();
bool sendData(const QByteArray &data);
QString errorString();
Packet *packet();
bool usePacket() const;
void setUsePacket(bool usePacket);
bool isClientConnected();
QString getConnectedClientIp();
bool isServerRunning();
signals:
void dataRx(const QByteArray &data);
void connectionChanged(bool connected, QString address);
public slots:
void newTcpConnection();
void tcpInputDisconnected();
void tcpInputDataAvailable();
void tcpInputError(QAbstractSocket::SocketError socketError);
void dataToSend(QByteArray &data);
private:
QTcpServer *mTcpServer;
QTcpSocket *mTcpSocket;
Packet *mPacket;
bool mUsePacket;
};
#endif // TCPSERVERSIMPLE_H
|
{
"pile_set_name": "Github"
}
|
<resources>
<string name="app_name">android-pdf</string>
</resources>
|
{
"pile_set_name": "Github"
}
|
# Overview
JTar is a simple Java Tar library, that provides an easy way to create and read tar files using IO streams. The API is very simple to use and similar to the _java.util.zip_ package and also __supports UStar format__.
[](https://travis-ci.org/kamranzafar/jtar)
## Usage
JTar is available in maven central and can be added as a dependency in the maven project.
<pre><code> <dependency>
<groupId>org.kamranzafar</groupId>
<artifactId>jtar</artifactId>
<version>2.3</version>
</dependency>
</code></pre>
Below are some examples of using jtar in applications
### Tar example - using TarOutputStream
<pre><code> // Output file stream
FileOutputStream dest = new FileOutputStream( "c:/test/test.tar" );
// Create a TarOutputStream
TarOutputStream out = new TarOutputStream( new BufferedOutputStream( dest ) );
// Files to tar
File[] filesToTar=new File[2];
filesToTar[0]=new File("c:/test/myfile1.txt");
filesToTar[1]=new File("c:/test/myfile2.txt");
for(File f:filesToTar){
out.putNextEntry(new TarEntry(f, f.getName()));
BufferedInputStream origin = new BufferedInputStream(new FileInputStream( f ));
int count;
byte data[] = new byte[2048];
while((count = origin.read(data)) != -1) {
out.write(data, 0, count);
}
out.flush();
origin.close();
}
out.close();
</code></pre>
### Untar example - using TarInputStream
<pre><code> String tarFile = "c:/test/test.tar";
String destFolder = "c:/test/myfiles";
// Create a TarInputStream
TarInputStream tis = new TarInputStream(new BufferedInputStream(new FileInputStream(tarFile)));
TarEntry entry;
while((entry = tis.getNextEntry()) != null) {
int count;
byte data[] = new byte[2048];
FileOutputStream fos = new FileOutputStream(destFolder + "/" + entry.getName());
BufferedOutputStream dest = new BufferedOutputStream(fos);
while((count = tis.read(data)) != -1) {
dest.write(data, 0, count);
}
dest.flush();
dest.close();
}
tis.close();
</code></pre>
___Tip: Always use buffered streams with jtar to speed up IO.___
## Examples and resources
* See [JTarTest](https://github.com/kamranzafar/jtar/blob/master/src/test/java/org/kamranzafar/jtar/JTarTest.java) class, provided with the source, for more detailed examples.
* Visit the wiki page for more details on [Tar format](http://en.wikipedia.org/wiki/Tar_%28file_format%29)
__JTar is available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kamranzafar%22%20a%3A%22jtar%22)__
|
{
"pile_set_name": "Github"
}
|
using System.Windows;
using Forge.Forms.DynamicExpressions;
using MaterialDesignThemes.Wpf;
namespace Forge.Forms.FormBuilding
{
public abstract class ContentElement : FormElement
{
public IValueProvider Content { get; set; }
public IValueProvider Icon { get; set; }
public IValueProvider IconPadding { get; set; }
protected internal override void Freeze()
{
const string iconVisibility = "IconVisibility";
base.Freeze();
Resources.Add(nameof(Content), Content ?? LiteralValue.Null);
Resources.Add(nameof(IconPadding), IconPadding ?? LiteralValue.False);
if (Icon != null && !(Icon is LiteralValue v && v.Value == null))
{
Resources.Add(iconVisibility, Icon.Wrap("ToVisibility"));
Resources.Add(nameof(Icon), Icon);
}
else
{
Resources.Add(iconVisibility, new LiteralValue(Visibility.Collapsed));
Resources.Add(nameof(Icon), new LiteralValue((PackIconKind)(-2)));
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2019 Gravitational, Inc.
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.
*/
import AdvancedOptions from './AdvancedOptions';
import Subnets from './Subnets';
export default AdvancedOptions;
export {
Subnets
}
|
{
"pile_set_name": "Github"
}
|
//=======================================================================
// Copyright Baptiste Wicht 2013-2018.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://www.opensource.org/licenses/MIT)
//=======================================================================
#include <string.hpp>
#include <tlib/print.hpp>
#include <tlib/system.hpp>
namespace {
inline void native_cpuid(uint32_t key, uint32_t& eax, uint32_t& ebx, uint32_t& ecx, uint32_t& edx){
eax = key;
/* ecx is often an input as well as an output. */
asm volatile("cpuid"
: "=a" (eax),
"=b" (ebx),
"=c" (ecx),
"=d" (edx)
: "a" (eax), "c" (ecx));
}
void get_base_info(){
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
native_cpuid(1, eax, ebx, ecx, edx);
tlib::printf("Stepping: %u\n", eax & 0xF);
tlib::printf("Model: %u\n", (eax >> 4) & 0xF);
tlib::printf("Family: %u\n", (eax >> 8) & 0xF);
tlib::printf("Processor Type: %u\n", (eax >> 12) & 0x3);
tlib::printf("Extended Model: %u\n", (eax >> 16) & 0xF);
tlib::printf("Extended Family: %u\n", (eax >> 20) & 0xFF);
}
void get_vendor_id(){
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
native_cpuid(0, eax, ebx, ecx, edx);
uint32_t vendor_id[3];
vendor_id[0] = ebx;
vendor_id[1] = edx;
vendor_id[2] = ecx;
tlib::printf("Vendor ID: %s\n", reinterpret_cast<const char*>(vendor_id));
}
void get_brand_string(){
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
uint32_t brand_string[12];
native_cpuid(0x80000002, eax, ebx, ecx, edx);
brand_string[0] = eax;
brand_string[1] = ebx;
brand_string[2] = ecx;
brand_string[3] = edx;
native_cpuid(0x80000003, eax, ebx, ecx, edx);
brand_string[4] = eax;
brand_string[5] = ebx;
brand_string[6] = ecx;
brand_string[7] = edx;
native_cpuid(0x80000004, eax, ebx, ecx, edx);
brand_string[8] = eax;
brand_string[9] = ebx;
brand_string[10] = ecx;
brand_string[11] = edx;
tlib::printf("Brand String: %s\n", reinterpret_cast<const char*>(brand_string));
}
// EDX Features
const int FPU = 1 << 0;
const int APIC = 1 << 9;
const int MMX = 1 << 23;
const int SSE = 1 << 25;
const int SSE2 = 1 << 26;
const int HT = 1 << 28;
//EAX Features
const int SSE3 = 1 << 9;
const int SSE41 = 1 << 19;
const int SSE42 = 1 << 20;
const int AES = 1 << 25;
const int AVX = 1 << 28;
void test_feature(uint32_t reg, int mask, const char* s){
if(reg & mask){
tlib::print(' ');
tlib::print(s);
}
}
void get_features(){
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
native_cpuid(1, eax, ebx, ecx, edx);
tlib::print("Features:");
test_feature(edx, FPU, "fpu");
test_feature(edx, APIC, "apic");
test_feature(edx, MMX, "mmx");
test_feature(edx, SSE, "sse");
test_feature(edx, SSE2, "sse2");
test_feature(edx, HT, "ht");
test_feature(ecx, SSE3, "sse3");
test_feature(ecx, SSE41, "sse4_1");
test_feature(ecx, SSE42, "sse4_2");
test_feature(ecx, AES, "aes");
test_feature(ecx, AVX, "avx");
tlib::print_line();
}
void decode_bytes (int data, int descriptor[16], int *next){
int i;
i = *next;
if (!(data & 0x80000000)) {
descriptor[i++] = data & 0x000000FF;
descriptor[i++] = (data & 0x0000FF00) / 256; // 1 bytes R
descriptor[i++] = (data & 0x00FF0000) / 65536; // 2 bytes R
descriptor[i++] = (data & 0xFF000000) / 16777216; // 3 bytes R
*next = i;
}
}
void get_cache_info() {
int next = 0, i = 0;
int descriptor[256];
int mem_count;
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
tlib::print_line("Cache and TLB:");
native_cpuid(0, eax, ebx, ecx, edx);
if (eax < 2){
tlib::print_line(" CPUID(2) not supported");
return;
}
native_cpuid(2, eax, ebx, ecx, edx);
mem_count = eax & 0x000000FF; // 1st byte is the count
eax &= 0xFFFFFF00; // mask off the count
int* desc = descriptor;
while ( i < mem_count) {
decode_bytes(eax, desc, &next);
decode_bytes(ebx, desc, &next);
decode_bytes(ecx, desc, &next);
decode_bytes(edx, desc, &next);
++i;
ecx = i;
native_cpuid(2, eax, ebx, ecx, edx);
desc += 16;
}
for (i=0; i< next; i++) {
if ( descriptor[i] == 0x00){
// NULL descriptor, legal value but no info
continue;
}
if ( descriptor[i] == 0x01){
tlib::print_line(" Instruction TLB ... 4 kb pages, 4-way associative, 32 entries");
}
if ( descriptor[i] == 0x02){
tlib::print_line(" Instruction TLB ... 4 Mb pages, 4-way associative, 2 entries");
}
if ( descriptor[i] == 0x03){
tlib::print_line(" Data TLB .......... 4 kb pages, 4-way associative, 64 entries");
}
if ( descriptor[i] == 0x04){
tlib::print_line(" Data TLB .......... 4 Mb pages, 4-way associative, 8 entries");
}
if ( descriptor[i] == 0x06){
tlib::print_line(" L1 instruction cache 8 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x08){
tlib::print_line(" L1 instruction cache 16 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x0A){
tlib::print_line(" L1 data cache ..... 8 kb, 2-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x0B){
tlib::print_line(" Instruction TLB ... 4 Mb pages, 4-way associative, 4 entries");
}
if ( descriptor[i] == 0x0C){
tlib::print_line(" L1 data cache ..... 16 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x22){
tlib::print_line(" L3 cache: 512K Bytes, 4-way associative, 64 byte line size, ");
tlib::print_line(" 128 byte sector size" );
}
if ( descriptor[i] == 0x23){
tlib::print_line(" L3 cache: 1M Bytes, 8-way associative, 64 byte line size, ");
tlib::print_line(" 128 byte sector size" );
}
if ( descriptor[i] == 0x25){
tlib::print_line(" L3 cache: 2M Bytes, 8-way associative, 64 byte line size, ");
tlib::print_line(" 128 byte sector size" );
}
if ( descriptor[i] == 0x29){
tlib::print_line(" L3 cache: 4M Bytes, 8-way associative, 64 byte line size, ");
tlib::print_line(" 128 byte sector size" );
}
if ( descriptor[i] == 0x2C){
tlib::print_line(" 1st-level D-cache: 32K Bytes, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x30){
tlib::print_line(" 1st-level I-cache: 32K Bytes, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x40){
tlib::print_line(" No L2 cache OR if there is an L2 cache, then no L3 cache");
}
if ( descriptor[i] == 0x41){
tlib::print_line(" L2 cache .......... 128 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x42){
tlib::print_line(" L2 cache .......... 256 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x43){
tlib::print_line(" L2 cache .......... 512 kb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x44){
tlib::print_line(" L2 cache .......... 1 Mb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x45){
tlib::print_line(" L2 cache .......... 2 Mb, 4-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x46){
tlib::print_line(" L3 cache .......... 4 Mb, 4-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x47){
tlib::print_line(" L3 cache .......... 8 Mb, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x49){
tlib::print_line(" L2 cache .......... 4 Mb, 16-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x50){
tlib::print_line(" Instruction TLB ... 4 kb and 2 Mb or 4 Mb pages, 64 entries");
}
if ( descriptor[i] == 0x51){
tlib::print_line(" Instruction TLB ... 4 kb and 2 Mb or 4 Mb pages, 128 entries");
}
if ( descriptor[i] == 0x52){
tlib::print_line(" Instruction TLB ... 4 kb and 2 Mb or 4 Mb pages, 256 entries");
}
if ( descriptor[i] == 0x56){
tlib::print_line(" Data TLB .......... 4 Mb pages, 4-way associative, 16 entries");
}
if ( descriptor[i] == 0x57){
tlib::print_line(" Data TLB .......... 4 Kb pages, 4-way associative, 16 entries");
}
if ( descriptor[i] == 0x5B){
tlib::print_line(" Data TLB .......... 4 kb and 4 Mb pages, 64 entries");
}
if ( descriptor[i] == 0x5C){
tlib::print_line(" Data TLB .......... 4 kb and 4 Mb pages, 128 entries");
}
if ( descriptor[i] == 0x5D){
tlib::print_line(" Data TLB .......... 4 kb and 4 Mb pages, 256 entries");
}
if ( descriptor[i] == 0x60){
tlib::print_line(" L1 data cache ..... 16 kb, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x66){
tlib::print_line(" L1 data cache ..... 8 kb, 4-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x67){
tlib::print_line(" L1 data cache ..... 16 kb, 4-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x68){
tlib::print_line(" L1 data cache ..... 32 kb, 4-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x70){
tlib::print_line(" Trace cache ...... 12k uop, 8-way associative");
}
if ( descriptor[i] == 0x71){
tlib::print_line(" Trace cache ...... 16k uop, 8-way associative");
}
if ( descriptor[i] == 0x72){
tlib::print_line(" Trace cache ...... 32k uop, 8-way associative");
}
if ( descriptor[i] == 0x78){
tlib::print_line(" L2 cache .......... 1 MB , 8-way associative, 64byte line size");
}
if ( descriptor[i] == 0x79){
tlib::print_line(" L2 cache .......... 128 kb, 8-way associative, sectored, 64 byte line size");
}
if ( descriptor[i] == 0x7A){
tlib::print_line(" L2 cache .......... 256 kb, 8-way associative, sectored, 64 byte line size");
}
if ( descriptor[i] == 0x7B){
tlib::print_line(" L2 cache .......... 512 kb, 8-way associative, sectored, 64 byte line size");
}
if ( descriptor[i] == 0x7C){
tlib::print_line(" L2 cache .......... 1M Byte, 8-way associative, sectored, 64 byte line size");
}
if ( descriptor[i] == 0x7D){
tlib::print_line(" L2 cache .......... 2M Byte, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x7F){
tlib::print_line(" L2 cache .........512K Byte, 2-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x82){
tlib::print_line(" L2 cache .......... 256 kb, 8-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x83){
tlib::print_line(" L2 cache .......... 512K Byte, 8-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x84){
tlib::print_line(" L2 cache .......... 1 Mb, 8-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x85){
tlib::print_line(" L2 cache .......... 2 Mb, 8-way associative, 32 byte line size");
}
if ( descriptor[i] == 0x86){
tlib::print_line(" L2 cache .......... 512K Byte, 4-way associative, 64 byte line size");
}
if ( descriptor[i] == 0x87){
tlib::print_line(" L2 cache .......... 1M Byte, 8-way associative, 64 byte line size");
}
if ( descriptor[i] == 0xB0){
tlib::print_line(" Instruction TLB 4K-Byte Pages, 4-way associative, 128 entries");
}
if ( descriptor[i] == 0xB3){
tlib::print_line(" Data TLB 4K-Byte Pages, 4-way associative, 128 entries");
}
if ( descriptor[i] == 0xB4){
tlib::print_line(" Data TLB 4K-Byte Pages, 4-way associative, 256 entries");
}
if ( descriptor[i] == 0xF0){
tlib::print_line(" 64-byte prefetching");
}
if ( descriptor[i] == 0xF1){
tlib::print_line(" 128-byte prefetching");
}
}
}
void get_deterministic_cache_parameters(){
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
native_cpuid(0, eax, ebx, ecx, edx);
if(eax < 4){
//Not supported on this processor
return;
}
size_t caches = 0;
while(caches < 1000){
native_cpuid(4, eax, ebx, ecx, edx);
if ( (eax & 0x1F) == 0 ) {
// No more caches
break;
}
if ((eax & 0x1F) == 1){
tlib::print("Data Cache: ");
}
if ((eax & 0x1F) == 2){
tlib::print("Instruction Cache: ");
}
if ((eax & 0x1F) == 3){
tlib::print("Unified Cache: ");
}
tlib::printf( "Level %u: ", static_cast<size_t>((eax & 0xE0)/32));
tlib::printf( "Max Threads %u: ", static_cast<size_t>(((eax & 0x03FFC000)/(8192))+1));
tlib::printf( "Max Procs. %u: " , static_cast<size_t>(((eax & 0xFC000000)/(4*256*65536))+1));
tlib::printf( "Line Size = %u: ", static_cast<size_t>((ebx & 0xFFF ) + 1));
tlib::printf( "Associativity = %u: ", (static_cast<size_t>((ebx & 0xFFC00000)/4*16*65536) + 1));
tlib::printf( "Sets = %u:\n", static_cast<size_t>(ecx + 1));
++caches;
}
}
} //end of anonymous namespace
int main(){
get_base_info();
get_vendor_id();
get_brand_string();
get_features();
get_cache_info();
get_deterministic_cache_parameters();
return 0;
}
|
{
"pile_set_name": "Github"
}
|
import numpy as np
import mxnet as mx
import cv2
class HeadPoseEstimator(object):
'''
This is a CNN based head pose estimator in mxnet version
CNN model:
conv1 3*3*32,(2,2),relu
conv2 3*3*32,(2,2),relu
conv3 3*3*64,(2,2),relu
conv4 3*3*64,(2,2),relu
fc1 128,relu
fc2 2,tanh
'''
def __init__(self,model_prefix='./model/cpt',ctx=mx.cpu()):
'''
Initialize the estimator
Parameters:
----------
model_prefix: string
path for the pretrained mxnet models
ctx: context
the context where CNN running on
'''
self.model = mx.model.FeedForward.load(model_prefix, 1, ctx=ctx)
def predict(self,img):
'''
Predict the pose on the cropped image
Parameters:
----------
img:a 64*64*3 numpy array,bgr order,range [0,255]
Returns:
-------
[[pitch,yaw]] numpy array,range [-90,90]
'''
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)[None,:,:,:]
return self.model.predict(img.transpose([0, 3, 1, 2]))[0]
def list2colmatrix(self, pts_list):
"""
convert list to column matrix
Parameters:
----------
pts_list:
input list
Retures:
-------
colMat:
"""
assert len(pts_list) > 0
colMat = []
for i in range(len(pts_list)):
colMat.append(pts_list[i][0])
colMat.append(pts_list[i][1])
colMat = np.matrix(colMat).transpose()
return colMat
def find_tfrom_between_shapes(self, from_shape, to_shape):
"""
find transform between shapes
Parameters:
----------
from_shape:
to_shape:
Retures:
-------
tran_m:
tran_b:
"""
assert from_shape.shape[0] == to_shape.shape[0] and from_shape.shape[0] % 2 == 0
sigma_from = 0.0
sigma_to = 0.0
cov = np.matrix([[0.0, 0.0], [0.0, 0.0]])
# compute the mean and cov
from_shape_points = from_shape.reshape(from_shape.shape[0] / 2, 2)
to_shape_points = to_shape.reshape(to_shape.shape[0] / 2, 2)
mean_from = from_shape_points.mean(axis=0)
mean_to = to_shape_points.mean(axis=0)
for i in range(from_shape_points.shape[0]):
temp_dis = np.linalg.norm(from_shape_points[i] - mean_from)
sigma_from += temp_dis * temp_dis
temp_dis = np.linalg.norm(to_shape_points[i] - mean_to)
sigma_to += temp_dis * temp_dis
cov += (to_shape_points[i].transpose() - mean_to.transpose()) * (from_shape_points[i] - mean_from)
sigma_from = sigma_from / to_shape_points.shape[0]
sigma_to = sigma_to / to_shape_points.shape[0]
cov = cov / to_shape_points.shape[0]
# compute the affine matrix
s = np.matrix([[1.0, 0.0], [0.0, 1.0]])
u, d, vt = np.linalg.svd(cov)
if np.linalg.det(cov) < 0:
if d[1] < d[0]:
s[1, 1] = -1
else:
s[0, 0] = -1
r = u * s * vt
c = 1.0
if sigma_from != 0:
c = 1.0 / sigma_from * np.trace(np.diag(d) * s)
tran_b = mean_to.transpose() - c * r * mean_from.transpose()
tran_m = c * r
return tran_m, tran_b
def extract_image_chips(self,img,points,desired_size=64,padding=0.27):
"""
crop and align face without rotation
Parameters:
----------
img: numpy array, bgr order of shape (1, 3, n, m)
input image
points: numpy array, n x 10 (x1, x2 ... x5, y1, y2 ..y5)
desired_size: default 64
padding: default 0.27
Returns:
-------
crop_imgs: n*64*64*3 numpy array,rgb order
cropped and aligned faces without rotation
"""
crop_imgs = []
for p in points:
shape = []
for k in range(len(p) / 2):
shape.append(p[k])
shape.append(p[k + 5])
if padding > 0:
padding = padding
else:
padding = 0
# average positions of face points
mean_face_shape_x = [0.224152, 0.75610125, 0.490127, 0.254149, 0.726104]
mean_face_shape_y = [0.2119465, 0.2119465, 0.628106, 0.780233, 0.780233]
from_points = []
to_points = []
for i in range(len(shape) / 2):
x = (padding + mean_face_shape_x[i]) / (2 * padding + 1) * desired_size
y = (padding + mean_face_shape_y[i]) / (2 * padding + 1) * desired_size
to_points.append([x, y])
from_points.append([shape[2 * i], shape[2 * i + 1]])
# convert the points to Mat
from_mat = self.list2colmatrix(from_points)
to_mat = self.list2colmatrix(to_points)
# compute the similar transfrom
tran_m, tran_b = self.find_tfrom_between_shapes(from_mat, to_mat)
probe_vec = np.matrix([1.0, 0.0]).transpose()
probe_vec = tran_m * probe_vec
scale = np.linalg.norm(probe_vec)
#angle = 180.0 / math.pi * math.atan2(probe_vec[1, 0], probe_vec[0, 0])
from_center = [(shape[0] + shape[2]) / 2.0, (shape[1] + shape[3]) / 2.0]
to_center = [0, 0]
to_center[1] = desired_size * 0.4
to_center[0] = desired_size * 0.5
ex = to_center[0] - from_center[0]
ey = to_center[1] - from_center[1]
rot_mat = cv2.getRotationMatrix2D((from_center[0], from_center[1]), 0.0, scale)
rot_mat[0][2] += ex
rot_mat[1][2] += ey
chips = cv2.warpAffine(img, rot_mat, (desired_size, desired_size))
crop_imgs.append(cv2.cvtColor(chips,cv2.COLOR_BGR2RGB))
return np.stack(crop_imgs)
def crop_and_predict(self,img,points):
'''
Crop the detected faces in the image and predict the poses of them
Parameters:
----------
img:numpy array,a bgr order image containing faces
points:numpy array, n x 10 (x1, x2 ... x5, y1, y2 ..y5)
n 5-points of face detected by mtcnn
https://github.com/pangyupo/mxnet_mtcnn_face_detection
Returns:
-------
n*2 (pitch,yaw) numpy array,range [-90,90]
'''
imgs = self.extract_image_chips(img,points)
return self.model.predict(imgs.transpose([0, 3, 1, 2]))[0]
|
{
"pile_set_name": "Github"
}
|
(*
*
* Copyright (c) 2001-2002,
* George C. Necula <necula@cs.berkeley.edu>
* Scott McPeak <smcpeak@cs.berkeley.edu>
* Wes Weimer <weimer@cs.berkeley.edu>
* 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.
*
* 3. The names of the contributors may not 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.
*
*)
(** Set this to true to ignore the merge conflicts *)
val ignore_merge_conflicts: bool ref
(** Merge a number of CIL files *)
val merge: Cil.file list -> string -> Cil.file
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
/* crypto/sha/sha256t.c */
/* ====================================================================
* Copyright (c) 2004 The OpenSSL Project. All rights reserved.
* ====================================================================
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/sha.h>
#include <openssl/evp.h>
#if defined(OPENSSL_NO_SHA) || defined(OPENSSL_NO_SHA256)
int main(int argc, char *argv[])
{
printf("No SHA256 support\n");
return(0);
}
#else
unsigned char app_b1[SHA256_DIGEST_LENGTH] = {
0xba,0x78,0x16,0xbf,0x8f,0x01,0xcf,0xea,
0x41,0x41,0x40,0xde,0x5d,0xae,0x22,0x23,
0xb0,0x03,0x61,0xa3,0x96,0x17,0x7a,0x9c,
0xb4,0x10,0xff,0x61,0xf2,0x00,0x15,0xad };
unsigned char app_b2[SHA256_DIGEST_LENGTH] = {
0x24,0x8d,0x6a,0x61,0xd2,0x06,0x38,0xb8,
0xe5,0xc0,0x26,0x93,0x0c,0x3e,0x60,0x39,
0xa3,0x3c,0xe4,0x59,0x64,0xff,0x21,0x67,
0xf6,0xec,0xed,0xd4,0x19,0xdb,0x06,0xc1 };
unsigned char app_b3[SHA256_DIGEST_LENGTH] = {
0xcd,0xc7,0x6e,0x5c,0x99,0x14,0xfb,0x92,
0x81,0xa1,0xc7,0xe2,0x84,0xd7,0x3e,0x67,
0xf1,0x80,0x9a,0x48,0xa4,0x97,0x20,0x0e,
0x04,0x6d,0x39,0xcc,0xc7,0x11,0x2c,0xd0 };
unsigned char addenum_1[SHA224_DIGEST_LENGTH] = {
0x23,0x09,0x7d,0x22,0x34,0x05,0xd8,0x22,
0x86,0x42,0xa4,0x77,0xbd,0xa2,0x55,0xb3,
0x2a,0xad,0xbc,0xe4,0xbd,0xa0,0xb3,0xf7,
0xe3,0x6c,0x9d,0xa7 };
unsigned char addenum_2[SHA224_DIGEST_LENGTH] = {
0x75,0x38,0x8b,0x16,0x51,0x27,0x76,0xcc,
0x5d,0xba,0x5d,0xa1,0xfd,0x89,0x01,0x50,
0xb0,0xc6,0x45,0x5c,0xb4,0xf5,0x8b,0x19,
0x52,0x52,0x25,0x25 };
unsigned char addenum_3[SHA224_DIGEST_LENGTH] = {
0x20,0x79,0x46,0x55,0x98,0x0c,0x91,0xd8,
0xbb,0xb4,0xc1,0xea,0x97,0x61,0x8a,0x4b,
0xf0,0x3f,0x42,0x58,0x19,0x48,0xb2,0xee,
0x4e,0xe7,0xad,0x67 };
int main (int argc,char **argv)
{ unsigned char md[SHA256_DIGEST_LENGTH];
int i;
EVP_MD_CTX evp;
fprintf(stdout,"Testing SHA-256 ");
EVP_Digest ("abc",3,md,NULL,EVP_sha256(),NULL);
if (memcmp(md,app_b1,sizeof(app_b1)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 1 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
EVP_Digest ("abcdbcde""cdefdefg""efghfghi""ghijhijk"
"ijkljklm""klmnlmno""mnopnopq",56,md,NULL,EVP_sha256(),NULL);
if (memcmp(md,app_b2,sizeof(app_b2)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 2 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
EVP_MD_CTX_init (&evp);
EVP_DigestInit_ex (&evp,EVP_sha256(),NULL);
for (i=0;i<1000000;i+=160)
EVP_DigestUpdate (&evp, "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa",
(1000000-i)<160?1000000-i:160);
EVP_DigestFinal_ex (&evp,md,NULL);
EVP_MD_CTX_cleanup (&evp);
if (memcmp(md,app_b3,sizeof(app_b3)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 3 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
fprintf(stdout," passed.\n"); fflush(stdout);
fprintf(stdout,"Testing SHA-224 ");
EVP_Digest ("abc",3,md,NULL,EVP_sha224(),NULL);
if (memcmp(md,addenum_1,sizeof(addenum_1)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 1 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
EVP_Digest ("abcdbcde""cdefdefg""efghfghi""ghijhijk"
"ijkljklm""klmnlmno""mnopnopq",56,md,NULL,EVP_sha224(),NULL);
if (memcmp(md,addenum_2,sizeof(addenum_2)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 2 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
EVP_MD_CTX_init (&evp);
EVP_DigestInit_ex (&evp,EVP_sha224(),NULL);
for (i=0;i<1000000;i+=64)
EVP_DigestUpdate (&evp, "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa",
(1000000-i)<64?1000000-i:64);
EVP_DigestFinal_ex (&evp,md,NULL);
EVP_MD_CTX_cleanup (&evp);
if (memcmp(md,addenum_3,sizeof(addenum_3)))
{ fflush(stdout);
fprintf(stderr,"\nTEST 3 of 3 failed.\n");
return 1;
}
else
fprintf(stdout,"."); fflush(stdout);
fprintf(stdout," passed.\n"); fflush(stdout);
return 0;
}
#endif
|
{
"pile_set_name": "Github"
}
|
package org.simpleflatmapper.test.map;
import org.junit.Test;
import org.simpleflatmapper.map.CaseInsensitiveEndsWithPredicate;
import org.simpleflatmapper.map.FieldKey;
import org.simpleflatmapper.util.Predicate;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class CaseInsensitiveEndsWithPredicateTest {
@Test
public void testOne() {
CaseInsensitiveEndsWithPredicate end = CaseInsensitiveEndsWithPredicate.of("end");
assertFalse(end.test(SampleFieldKey.KEY_FACTORY.newKey("a", 0)));
assertFalse(end.test(SampleFieldKey.KEY_FACTORY.newKey("aaa", 0)));
assertTrue(end.test(SampleFieldKey.KEY_FACTORY.newKey("end", 0)));
assertTrue(end.test(SampleFieldKey.KEY_FACTORY.newKey("a_end", 0)));
}
@Test
public void testMany() {
Predicate<FieldKey<?>> any = CaseInsensitiveEndsWithPredicate.any("end", "fin");
assertFalse(any.test(SampleFieldKey.KEY_FACTORY.newKey("a", 0)));
assertFalse(any.test(SampleFieldKey.KEY_FACTORY.newKey("aaa", 0)));
assertTrue(any.test(SampleFieldKey.KEY_FACTORY.newKey("end", 0)));
assertTrue(any.test(SampleFieldKey.KEY_FACTORY.newKey("a_end", 0)));
assertTrue(any.test(SampleFieldKey.KEY_FACTORY.newKey("fin", 0)));
assertTrue(any.test(SampleFieldKey.KEY_FACTORY.newKey("a_fin", 0)));
}
}
|
{
"pile_set_name": "Github"
}
|
JASC-PAL
0100
16
180 180 180
49 49 49
238 246 255
222 180 197
246 213 222
255 255 255
172 115 148
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Tue Jan 23 20:22:17 PST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NumberSerializers.Base (jackson-databind 2.9.0 API)</title>
<meta name="date" content="2018-01-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NumberSerializers.Base (jackson-databind 2.9.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NumberSerializers.Base.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.html" title="class in com.fasterxml.jackson.databind.ser.std"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.DoubleSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html" target="_top">Frames</a></li>
<li><a href="NumberSerializers.Base.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.classes.inherited.from.class.com.fasterxml.jackson.databind.JsonSerializer">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.fasterxml.jackson.databind.ser.std</div>
<h2 title="Class NumberSerializers.Base" class="title">Class NumberSerializers.Base<T></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">com.fasterxml.jackson.databind.JsonSerializer</a><T></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">com.fasterxml.jackson.databind.ser.std.StdSerializer</a><T></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">com.fasterxml.jackson.databind.ser.std.StdScalarSerializer</a><T></li>
<li>
<ul class="inheritance">
<li>com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base<T></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</a>, <a href="../../../../../../com/fasterxml/jackson/databind/jsonschema/SchemaAware.html" title="interface in com.fasterxml.jackson.databind.jsonschema">SchemaAware</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser">ContextualSerializer</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.DoubleSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.DoubleSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.FloatSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.FloatSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.IntegerSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.IntegerSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.IntLikeSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.IntLikeSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.LongSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.LongSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.ShortSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers.ShortSerializer</a></dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.html" title="class in com.fasterxml.jackson.databind.ser.std">NumberSerializers</a></dd>
</dl>
<hr>
<br>
<pre>protected abstract static class <span class="typeNameLabel">NumberSerializers.Base<T></span>
extends <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdScalarSerializer</a><T>
implements <a href="../../../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser">ContextualSerializer</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../serialized-form.html#com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.com.fasterxml.jackson.databind.JsonSerializer">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.<a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a></h3>
<code><a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind">JsonSerializer.None</a></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#Z:Z_isInt">_isInt</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="http://fasterxml.github.com/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonParser.NumberType.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonParser.NumberType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#Z:Z_numberType">_numberType</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#Z:Z_schemaType">_schemaType</a></span></code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.com.fasterxml.jackson.databind.ser.std.StdSerializer">
<!-- -->
</a>
<h3>Fields inherited from class com.fasterxml.jackson.databind.ser.std.<a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdSerializer</a></h3>
<code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#Z:Z_handledType">_handledType</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#Base-java.lang.Class-com.fasterxml.jackson.core.JsonParser.NumberType-java.lang.String-">Base</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> cls,
<a href="http://fasterxml.github.com/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonParser.NumberType.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonParser.NumberType</a> numberType,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> schemaType)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#acceptJsonFormatVisitor-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">acceptJsonFormatVisitor</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</a> visitor,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> typeHint)</code>
<div class="block">Default implementation specifies no format.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a><?></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#createContextual-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-">createContextual</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a> prov,
<a href="../../../../../../com/fasterxml/jackson/databind/BeanProperty.html" title="interface in com.fasterxml.jackson.databind">BeanProperty</a> property)</code>
<div class="block">Method called to see if a different (or differently configured) serializer
is needed to serialize values of specified property.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/JsonNode.html" title="class in com.fasterxml.jackson.databind">JsonNode</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html#getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-">getSchema</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a> provider,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a> typeHint)</code>
<div class="block">Default implementation simply claims type is "string"; usually
overriden by custom serializers.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.fasterxml.jackson.databind.ser.std.StdScalarSerializer">
<!-- -->
</a>
<h3>Methods inherited from class com.fasterxml.jackson.databind.ser.std.<a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdScalarSerializer</a></h3>
<code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html#serializeWithType-T-com.fasterxml.jackson.core.JsonGenerator-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.jsontype.TypeSerializer-">serializeWithType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.fasterxml.jackson.databind.ser.std.StdSerializer">
<!-- -->
</a>
<h3>Methods inherited from class com.fasterxml.jackson.databind.ser.std.<a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdSerializer</a></h3>
<code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#Z:Z_neitherNull-java.lang.Object-java.lang.Object-">_neitherNull</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#Z:Z_nonEmpty-java.util.Collection-">_nonEmpty</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#createSchemaNode-java.lang.String-">createSchemaNode</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#createSchemaNode-java.lang.String-boolean-">createSchemaNode</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findAnnotatedContentSerializer-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-">findAnnotatedContentSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findContextualConvertingSerializer-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-com.fasterxml.jackson.databind.JsonSerializer-">findContextualConvertingSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findConvertingContentSerializer-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-com.fasterxml.jackson.databind.JsonSerializer-">findConvertingContentSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findFormatFeature-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-java.lang.Class-com.fasterxml.jackson.annotation.JsonFormat.Feature-">findFormatFeature</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findFormatOverrides-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-java.lang.Class-">findFormatOverrides</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findIncludeOverrides-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-java.lang.Class-">findIncludeOverrides</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#findPropertyFilter-com.fasterxml.jackson.databind.SerializerProvider-java.lang.Object-java.lang.Object-">findPropertyFilter</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-boolean-">getSchema</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#handledType--">handledType</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#isDefaultSerializer-com.fasterxml.jackson.databind.JsonSerializer-">isDefaultSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#serialize-T-com.fasterxml.jackson.core.JsonGenerator-com.fasterxml.jackson.databind.SerializerProvider-">serialize</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitArrayFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes-">visitArrayFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitArrayFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JsonSerializer-com.fasterxml.jackson.databind.JavaType-">visitArrayFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitFloatFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.core.JsonParser.NumberType-">visitFloatFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitIntFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.core.JsonParser.NumberType-">visitIntFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitIntFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.core.JsonParser.NumberType-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat-">visitIntFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitStringFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">visitStringFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#visitStringFormat-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat-">visitStringFormat</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#wrapAndThrow-com.fasterxml.jackson.databind.SerializerProvider-java.lang.Throwable-java.lang.Object-int-">wrapAndThrow</a>, <a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#wrapAndThrow-com.fasterxml.jackson.databind.SerializerProvider-java.lang.Throwable-java.lang.Object-java.lang.String-">wrapAndThrow</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.fasterxml.jackson.databind.JsonSerializer">
<!-- -->
</a>
<h3>Methods inherited from class com.fasterxml.jackson.databind.<a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a></h3>
<code><a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#getDelegatee--">getDelegatee</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty-com.fasterxml.jackson.databind.SerializerProvider-T-">isEmpty</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty-T-">isEmpty</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isUnwrappingSerializer--">isUnwrappingSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#properties--">properties</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#replaceDelegatee-com.fasterxml.jackson.databind.JsonSerializer-">replaceDelegatee</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#unwrappingSerializer-com.fasterxml.jackson.databind.util.NameTransformer-">unwrappingSerializer</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#usesObjectId--">usesObjectId</a>, <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html#withFilterId-java.lang.Object-">withFilterId</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="Z:Z_numberType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>_numberType</h4>
<pre>protected final <a href="http://fasterxml.github.com/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonParser.NumberType.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonParser.NumberType</a> _numberType</pre>
</li>
</ul>
<a name="Z:Z_schemaType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>_schemaType</h4>
<pre>protected final <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> _schemaType</pre>
</li>
</ul>
<a name="Z:Z_isInt">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>_isInt</h4>
<pre>protected final boolean _isInt</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Base-java.lang.Class-com.fasterxml.jackson.core.JsonParser.NumberType-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Base</h4>
<pre>protected Base(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> cls,
<a href="http://fasterxml.github.com/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonParser.NumberType.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonParser.NumberType</a> numberType,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> schemaType)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSchema</h4>
<pre>public <a href="../../../../../../com/fasterxml/jackson/databind/JsonNode.html" title="class in com.fasterxml.jackson.databind">JsonNode</a> getSchema(<a href="../../../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a> provider,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a> typeHint)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-">StdSerializer</a></code></span></div>
<div class="block">Default implementation simply claims type is "string"; usually
overriden by custom serializers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/jsonschema/SchemaAware.html#getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-">getSchema</a></code> in interface <code><a href="../../../../../../com/fasterxml/jackson/databind/jsonschema/SchemaAware.html" title="interface in com.fasterxml.jackson.databind.jsonschema">SchemaAware</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html#getSchema-com.fasterxml.jackson.databind.SerializerProvider-java.lang.reflect.Type-">getSchema</a></code> in class <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdScalarSerializer</a><<a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html" title="type parameter in NumberSerializers.Base">T</a>></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>provider</code> - The serializer provider.</dd>
<dd><code>typeHint</code> - A hint about the type.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="http://json-schema.org/">Json-schema</a> for this serializer.</dd>
</dl>
</li>
</ul>
<a name="acceptJsonFormatVisitor-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>acceptJsonFormatVisitor</h4>
<pre>public void acceptJsonFormatVisitor(<a href="../../../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</a> visitor,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> typeHint)
throws <a href="../../../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html#acceptJsonFormatVisitor-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">StdSerializer</a></code></span></div>
<div class="block">Default implementation specifies no format. This behavior is usually
overriden by custom serializers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html#acceptJsonFormatVisitor-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">acceptJsonFormatVisitor</a></code> in interface <code><a href="../../../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html#acceptJsonFormatVisitor-com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper-com.fasterxml.jackson.databind.JavaType-">acceptJsonFormatVisitor</a></code> in class <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/StdScalarSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdScalarSerializer</a><<a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html" title="type parameter in NumberSerializers.Base">T</a>></code></dd>
<dd><code>typeHint</code> - Type of element (entity like property) being visited</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></code></dd>
</dl>
</li>
</ul>
<a name="createContextual-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>createContextual</h4>
<pre>public <a href="../../../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a><?> createContextual(<a href="../../../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a> prov,
<a href="../../../../../../com/fasterxml/jackson/databind/BeanProperty.html" title="interface in com.fasterxml.jackson.databind">BeanProperty</a> property)
throws <a href="../../../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html#createContextual-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-">ContextualSerializer</a></code></span></div>
<div class="block">Method called to see if a different (or differently configured) serializer
is needed to serialize values of specified property.
Note that instance that this method is called on is typically shared one and
as a result method should <b>NOT</b> modify this instance but rather construct
and return a new instance. This instance should only be returned as-is, in case
it is already suitable for use.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html#createContextual-com.fasterxml.jackson.databind.SerializerProvider-com.fasterxml.jackson.databind.BeanProperty-">createContextual</a></code> in interface <code><a href="../../../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser">ContextualSerializer</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>prov</code> - Serializer provider to use for accessing config, other serializers</dd>
<dd><code>property</code> - Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Serializer to use for serializing values of specified property;
may be this instance or a new instance.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NumberSerializers.Base.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.html" title="class in com.fasterxml.jackson.databind.ser.std"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../com/fasterxml/jackson/databind/ser/std/NumberSerializers.DoubleSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/fasterxml/jackson/databind/ser/std/NumberSerializers.Base.html" target="_top">Frames</a></li>
<li><a href="NumberSerializers.Base.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.classes.inherited.from.class.com.fasterxml.jackson.databind.JsonSerializer">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2008–2018 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import { Switch, Route } from 'react-router';
import { ConnectedRouter } from 'connected-react-router';
import { history } from 'store/index';
import Layout from 'containers/layout';
import App from 'containers/app';
const routes = (
<ConnectedRouter history={history}>
<Layout>
<Switch>
<Route exact path="/" component={App} />
</Switch>
</Layout>
</ConnectedRouter>
);
export default routes;
|
{
"pile_set_name": "Github"
}
|
/*
* SonarQube
* Copyright (C) 2009-2020 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program 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 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
package org.sonar.server.issue.ws;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.search.SearchHit;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.RuleType;
import org.sonar.api.server.ws.Change;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.Paging;
import org.sonar.api.utils.System2;
import org.sonar.core.util.stream.MoreCollectors;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.rule.RuleDefinitionDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.es.Facets;
import org.sonar.server.es.SearchOptions;
import org.sonar.server.issue.SearchRequest;
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.issue.index.IssueIndexSyncProgressChecker;
import org.sonar.server.issue.index.IssueQuery;
import org.sonar.server.issue.index.IssueQueryFactory;
import org.sonar.server.issue.index.IssueScope;
import org.sonar.server.security.SecurityStandards.SQCategory;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Issues.SearchWsResponse;
import static com.google.common.base.MoreObjects.firstNonNull;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Iterables.concat;
import static com.google.common.collect.Sets.newHashSet;
import static java.lang.String.format;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static java.util.Optional.ofNullable;
import static java.util.stream.Collectors.toList;
import static org.sonar.api.issue.Issue.RESOLUTIONS;
import static org.sonar.api.issue.Issue.RESOLUTION_FIXED;
import static org.sonar.api.issue.Issue.RESOLUTION_REMOVED;
import static org.sonar.api.issue.Issue.STATUS_IN_REVIEW;
import static org.sonar.api.issue.Issue.STATUS_OPEN;
import static org.sonar.api.issue.Issue.STATUS_REOPENED;
import static org.sonar.api.issue.Issue.STATUS_REVIEWED;
import static org.sonar.api.issue.Issue.STATUS_TO_REVIEW;
import static org.sonar.api.server.ws.WebService.Param.FACETS;
import static org.sonar.api.utils.Paging.forPageIndex;
import static org.sonar.core.util.stream.MoreCollectors.toSet;
import static org.sonar.server.es.SearchOptions.MAX_PAGE_SIZE;
import static org.sonar.server.issue.index.IssueIndex.FACET_ASSIGNED_TO_ME;
import static org.sonar.server.issue.index.IssueIndex.FACET_PROJECTS;
import static org.sonar.server.issue.index.IssueQuery.SORT_BY_ASSIGNEE;
import static org.sonar.server.issue.index.IssueQueryFactory.ISSUE_STATUSES;
import static org.sonar.server.issue.index.IssueQueryFactory.UNKNOWN;
import static org.sonar.server.security.SecurityStandards.SANS_TOP_25_INSECURE_INTERACTION;
import static org.sonar.server.security.SecurityStandards.SANS_TOP_25_POROUS_DEFENSES;
import static org.sonar.server.security.SecurityStandards.SANS_TOP_25_RISKY_RESOURCE;
import static org.sonar.server.security.SecurityStandards.UNKNOWN_STANDARD;
import static org.sonar.server.ws.KeyExamples.KEY_BRANCH_EXAMPLE_001;
import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
import static org.sonar.server.ws.KeyExamples.KEY_PULL_REQUEST_EXAMPLE_001;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.ACTION_SEARCH;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_PARAM_AUTHORS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_COUNT;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ADDITIONAL_FIELDS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASC;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGNED;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGNEES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_AUTHOR;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_BRANCH;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AT;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_BEFORE;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_IN_LAST;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CWE;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_DIRECTORIES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_FILE_UUIDS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ISSUES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_LANGUAGES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_MODULE_UUIDS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ON_COMPONENT_ONLY;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_OWASP_TOP_10;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PROJECTS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PULL_REQUEST;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RESOLUTIONS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RESOLVED;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RULES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SANS_TOP_25;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SCOPES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SEVERITIES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_PERIOD;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SONARSOURCE_SECURITY;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_STATUSES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_TAGS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_TYPES;
public class SearchAction implements IssuesWsAction {
private static final String LOGIN_MYSELF = "__me__";
private static final Set<String> ISSUE_SCOPES = Arrays.stream(IssueScope.values()).map(Enum::name).collect(Collectors.toSet());
private static final EnumSet<RuleType> ALL_RULE_TYPES_EXCEPT_SECURITY_HOTSPOTS = EnumSet.complementOf(EnumSet.of(RuleType.SECURITY_HOTSPOT));
static final List<String> SUPPORTED_FACETS = ImmutableList.of(
FACET_PROJECTS,
PARAM_MODULE_UUIDS,
PARAM_FILE_UUIDS,
FACET_ASSIGNED_TO_ME,
PARAM_SEVERITIES,
PARAM_STATUSES,
PARAM_RESOLUTIONS,
PARAM_RULES,
PARAM_ASSIGNEES,
DEPRECATED_PARAM_AUTHORS,
PARAM_AUTHOR,
PARAM_DIRECTORIES,
PARAM_SCOPES,
PARAM_LANGUAGES,
PARAM_TAGS,
PARAM_TYPES,
PARAM_OWASP_TOP_10,
PARAM_SANS_TOP_25,
PARAM_CWE,
PARAM_CREATED_AT,
PARAM_SONARSOURCE_SECURITY);
private static final String INTERNAL_PARAMETER_DISCLAIMER = "This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. ";
private static final Set<String> FACETS_REQUIRING_PROJECT_OR_ORGANIZATION = newHashSet(PARAM_MODULE_UUIDS, PARAM_FILE_UUIDS, PARAM_DIRECTORIES);
private final UserSession userSession;
private final IssueIndex issueIndex;
private final IssueQueryFactory issueQueryFactory;
private final IssueIndexSyncProgressChecker issueIndexSyncProgressChecker;
private final SearchResponseLoader searchResponseLoader;
private final SearchResponseFormat searchResponseFormat;
private final System2 system2;
private final DbClient dbClient;
public SearchAction(UserSession userSession, IssueIndex issueIndex, IssueQueryFactory issueQueryFactory, IssueIndexSyncProgressChecker issueIndexSyncProgressChecker,
SearchResponseLoader searchResponseLoader, SearchResponseFormat searchResponseFormat, System2 system2, DbClient dbClient) {
this.userSession = userSession;
this.issueIndex = issueIndex;
this.issueQueryFactory = issueQueryFactory;
this.issueIndexSyncProgressChecker = issueIndexSyncProgressChecker;
this.searchResponseLoader = searchResponseLoader;
this.searchResponseFormat = searchResponseFormat;
this.system2 = system2;
this.dbClient = dbClient;
}
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller
.createAction(ACTION_SEARCH)
.setHandler(this)
.setDescription("Search for issues.<br>Requires the 'Browse' permission on the specified project(s)."
+ "<br/>When issue indexation is in progress returns 503 service unavailable HTTP code.")
.setSince("3.6")
.setChangelog(
new Change("8.4", "parameters 'componentUuids', 'projectKeys' has been dropped."),
new Change("8.2", "'REVIEWED', 'TO_REVIEW' status param values are no longer supported"),
new Change("8.2", "Security hotspots are no longer returned as type 'SECURITY_HOTSPOT' is not supported anymore, use dedicated api/hotspots"),
new Change("8.2", "response field 'fromHotspot' has been deprecated and is no more populated"),
new Change("8.2", "Status 'IN_REVIEW' for Security Hotspots has been deprecated"),
new Change("7.8", format("added new Security Hotspots statuses : %s, %s and %s", STATUS_TO_REVIEW, STATUS_IN_REVIEW, STATUS_REVIEWED)),
new Change("7.8", "Security hotspots are returned by default"),
new Change("7.7", format("Value '%s' in parameter '%s' is deprecated, please use '%s' instead", DEPRECATED_PARAM_AUTHORS, FACETS, PARAM_AUTHOR)),
new Change("7.6", format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT_KEYS)),
new Change("7.4", "The facet 'projectUuids' is dropped in favour of the new facet 'projects'. " +
"Note that they are not strictly identical, the latter returns the project keys."),
new Change("7.4", format("Parameter '%s' does not accept anymore deprecated value 'debt'", FACET_MODE)),
new Change("7.3", "response field 'fromHotspot' added to issues that are security hotspots"),
new Change("7.3", "added facets 'sansTop25', 'owaspTop10' and 'cwe'"),
new Change("7.2", "response field 'externalRuleEngine' added to issues that have been imported from an external rule engine"),
new Change("7.2", format("value '%s' in parameter '%s' is deprecated, it won't have any effect", SORT_BY_ASSIGNEE, Param.SORT)),
new Change("6.5", "parameters 'projects', 'projectUuids', 'moduleUuids', 'directories', 'fileUuids' are marked as internal"),
new Change("6.3", "response field 'email' is renamed 'avatar'"),
new Change("5.5", "response fields 'reporter' and 'actionPlan' are removed (drop of action plan and manual issue features)"),
new Change("5.5", "parameters 'reporters', 'actionPlans' and 'planned' are dropped and therefore ignored (drop of action plan and manual issue features)"),
new Change("5.5", "response field 'debt' is renamed 'effort'"))
.setResponseExample(getClass().getResource("search-example.json"));
action.addPagingParams(100, MAX_PAGE_SIZE);
action.createParam(FACETS)
.setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.")
.setPossibleValues(SUPPORTED_FACETS);
action.createParam(FACET_MODE)
.setDefaultValue(FACET_MODE_COUNT)
.setDeprecatedSince("7.9")
.setDescription("Choose the returned value for facet items, either count of issues or sum of remediation effort.")
.setPossibleValues(FACET_MODE_COUNT, FACET_MODE_EFFORT);
action.addSortParams(IssueQuery.SORTS, null, true);
action.createParam(PARAM_ADDITIONAL_FIELDS)
.setSince("5.2")
.setDescription("Comma-separated list of the optional fields to be returned in response. Action plans are dropped in 5.5, it is not returned in the response.")
.setPossibleValues(SearchAdditionalField.possibleValues());
addComponentRelatedParams(action);
action.createParam(PARAM_ISSUES)
.setDescription("Comma-separated list of issue keys")
.setExampleValue("5bccd6e8-f525-43a2-8d76-fcb13dde79ef");
action.createParam(PARAM_SEVERITIES)
.setDescription("Comma-separated list of severities")
.setExampleValue(Severity.BLOCKER + "," + Severity.CRITICAL)
.setPossibleValues(Severity.ALL);
action.createParam(PARAM_STATUSES)
.setDescription("Comma-separated list of statuses")
.setExampleValue(STATUS_OPEN + "," + STATUS_REOPENED)
.setPossibleValues(ISSUE_STATUSES);
action.createParam(PARAM_RESOLUTIONS)
.setDescription("Comma-separated list of resolutions")
.setExampleValue(RESOLUTION_FIXED + "," + RESOLUTION_REMOVED)
.setPossibleValues(RESOLUTIONS);
action.createParam(PARAM_RESOLVED)
.setDescription("To match resolved or unresolved issues")
.setBooleanPossibleValues();
action.createParam(PARAM_RULES)
.setDescription("Comma-separated list of coding rule keys. Format is <repository>:<rule>")
.setExampleValue("squid:AvoidCycles");
action.createParam(PARAM_TAGS)
.setDescription("Comma-separated list of tags.")
.setExampleValue("security,convention");
action.createParam(PARAM_TYPES)
.setDescription("Comma-separated list of types.")
.setSince("5.5")
.setPossibleValues(ALL_RULE_TYPES_EXCEPT_SECURITY_HOTSPOTS)
.setExampleValue(format("%s,%s", RuleType.CODE_SMELL, RuleType.BUG));
action.createParam(PARAM_OWASP_TOP_10)
.setDescription("Comma-separated list of OWASP Top 10 lowercase categories.")
.setSince("7.3")
.setPossibleValues("a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10");
action.createParam(PARAM_SANS_TOP_25)
.setDescription("Comma-separated list of SANS Top 25 categories.")
.setSince("7.3")
.setPossibleValues(SANS_TOP_25_INSECURE_INTERACTION, SANS_TOP_25_RISKY_RESOURCE, SANS_TOP_25_POROUS_DEFENSES);
action.createParam(PARAM_CWE)
.setDescription("Comma-separated list of CWE identifiers. Use '" + UNKNOWN_STANDARD + "' to select issues not associated to any CWE.")
.setExampleValue("12,125," + UNKNOWN_STANDARD);
action.createParam(PARAM_SONARSOURCE_SECURITY)
.setDescription("Comma-separated list of SonarSource security categories. Use '" + SQCategory.OTHERS.getKey() + "' to select issues not associated" +
" with any category")
.setSince("7.8")
.setPossibleValues(Arrays.stream(SQCategory.values()).map(SQCategory::getKey).collect(Collectors.toList()));
action.createParam(DEPRECATED_PARAM_AUTHORS)
.setDeprecatedSince("7.7")
.setDescription("This parameter is deprecated, please use '%s' instead", PARAM_AUTHOR)
.setExampleValue("torvalds@linux-foundation.org");
action.createParam(PARAM_AUTHOR)
.setDescription("SCM accounts. To set several values, the parameter must be called once for each value.")
.setExampleValue("author=torvalds@linux-foundation.org&author=linux@fondation.org");
action.createParam(PARAM_ASSIGNEES)
.setDescription("Comma-separated list of assignee logins. The value '__me__' can be used as a placeholder for user who performs the request")
.setExampleValue("admin,usera,__me__");
action.createParam(PARAM_ASSIGNED)
.setDescription("To retrieve assigned or unassigned issues")
.setBooleanPossibleValues();
action.createParam(PARAM_SCOPES)
.setDescription("Comma-separated list of scopes. Available since 8.5")
.setPossibleValues(IssueScope.MAIN.name(), IssueScope.TEST.name())
.setExampleValue(format("%s,%s", IssueScope.MAIN.name(), IssueScope.TEST.name()));
action.createParam(PARAM_LANGUAGES)
.setDescription("Comma-separated list of languages. Available since 4.4")
.setExampleValue("java,js");
action.createParam(PARAM_CREATED_AT)
.setDescription("Datetime to retrieve issues created during a specific analysis")
.setExampleValue("2017-10-19T13:00:00+0200");
action.createParam(PARAM_CREATED_AFTER)
.setDescription("To retrieve issues created after the given date (inclusive). <br>" +
"Either a date (server timezone) or datetime can be provided. <br>" +
"If this parameter is set, createdSince must not be set")
.setExampleValue("2017-10-19 or 2017-10-19T13:00:00+0200");
action.createParam(PARAM_CREATED_BEFORE)
.setDescription("To retrieve issues created before the given date (exclusive). <br>" +
"Either a date (server timezone) or datetime can be provided.")
.setExampleValue("2017-10-19 or 2017-10-19T13:00:00+0200");
action.createParam(PARAM_CREATED_IN_LAST)
.setDescription("To retrieve issues created during a time span before the current time (exclusive). " +
"Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. " +
"If this parameter is set, createdAfter must not be set")
.setExampleValue("1m2w (1 month 2 weeks)");
action.createParam(PARAM_SINCE_LEAK_PERIOD)
.setDescription("To retrieve issues created since the leak period.<br>" +
"If this parameter is set to a truthy value, createdAfter must not be set and one component uuid or key must be provided.")
.setBooleanPossibleValues()
.setDefaultValue("false");
}
private static void addComponentRelatedParams(WebService.NewAction action) {
action.createParam(PARAM_ON_COMPONENT_ONLY)
.setDescription("Return only issues at a component's level, not on its descendants (modules, directories, files, etc). " +
"This parameter is only considered when componentKeys or componentUuids is set.")
.setBooleanPossibleValues()
.setDefaultValue("false");
action.createParam(PARAM_COMPONENT_KEYS)
.setDescription("Comma-separated list of component keys. Retrieve issues associated to a specific list of components (and all its descendants). " +
"A component can be a portfolio, project, module, directory or file.")
.setExampleValue(KEY_PROJECT_EXAMPLE_001);
action.createParam(PARAM_PROJECTS)
.setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project keys). " +
INTERNAL_PARAMETER_DISCLAIMER +
"If this parameter is set, projectUuids must not be set.")
.setInternal(true)
.setExampleValue(KEY_PROJECT_EXAMPLE_001);
action.createParam(PARAM_MODULE_UUIDS)
.setDescription("To retrieve issues associated to a specific list of modules (comma-separated list of module IDs). " +
INTERNAL_PARAMETER_DISCLAIMER)
.setInternal(true)
.setDeprecatedSince("7.6")
.setExampleValue("7d8749e8-3070-4903-9188-bdd82933bb92");
action.createParam(PARAM_DIRECTORIES)
.setDescription("To retrieve issues associated to a specific list of directories (comma-separated list of directory paths). " +
"This parameter is only meaningful when a module is selected. " +
INTERNAL_PARAMETER_DISCLAIMER)
.setInternal(true)
.setSince("5.1")
.setExampleValue("src/main/java/org/sonar/server/");
action.createParam(PARAM_FILE_UUIDS)
.setDescription("To retrieve issues associated to a specific list of files (comma-separated list of file IDs). " +
INTERNAL_PARAMETER_DISCLAIMER)
.setInternal(true)
.setExampleValue("bdd82933-3070-4903-9188-7d8749e8bb92");
action.createParam(PARAM_BRANCH)
.setDescription("Branch key. Not available in the community edition.")
.setExampleValue(KEY_BRANCH_EXAMPLE_001)
.setSince("6.6");
action.createParam(PARAM_PULL_REQUEST)
.setDescription("Pull request id. Not available in the community edition.")
.setExampleValue(KEY_PULL_REQUEST_EXAMPLE_001)
.setSince("7.1");
action.createParam(PARAM_ORGANIZATION)
.setDescription("Organization key")
.setRequired(false)
.setInternal(true)
.setExampleValue("my-org")
.setSince("6.4");
}
@Override
public final void handle(Request request, Response response) {
try (DbSession dbSession = dbClient.openSession(false)) {
SearchRequest searchRequest = toSearchWsRequest(dbSession, request);
checkIfNeedIssueSync(dbSession, searchRequest);
SearchWsResponse searchWsResponse = doHandle(searchRequest);
writeProtobuf(searchWsResponse, request, response);
}
}
private SearchWsResponse doHandle(SearchRequest request) {
// prepare the Elasticsearch request
SearchOptions options = createSearchOptionsFromRequest(request);
EnumSet<SearchAdditionalField> additionalFields = SearchAdditionalField.getFromRequest(request);
IssueQuery query = issueQueryFactory.create(request);
Set<String> facetsRequiringProjectOrOrganizationParameter = options.getFacets().stream()
.filter(FACETS_REQUIRING_PROJECT_OR_ORGANIZATION::contains)
.collect(toSet());
checkArgument(facetsRequiringProjectOrOrganizationParameter.isEmpty() ||
(!query.projectUuids().isEmpty()) || query.organizationUuid() != null, "Facet(s) '%s' require to also filter by project or organization",
String.join(",", facetsRequiringProjectOrOrganizationParameter));
// execute request
SearchResponse result = issueIndex.search(query, options);
List<String> issueKeys = Arrays.stream(result.getHits().getHits())
.map(SearchHit::getId)
.collect(MoreCollectors.toList(result.getHits().getHits().length));
// load the additional information to be returned in response
SearchResponseLoader.Collector collector = new SearchResponseLoader.Collector(issueKeys);
collectLoggedInUser(collector);
collectRequestParams(collector, request);
Facets facets = new Facets(result, system2.getDefaultTimeZone());
if (!options.getFacets().isEmpty()) {
// add missing values to facets. For example if assignee "john" and facet on "assignees" are requested, then
// "john" should always be listed in the facet. If it is not present, then it is added with value zero.
// This is a constraint from webapp UX.
completeFacets(facets, request, query);
collectFacets(collector, facets);
}
SearchResponseData preloadedData = new SearchResponseData(emptyList());
preloadedData.addRules(ImmutableList.copyOf(query.rules()));
SearchResponseData data = searchResponseLoader.load(preloadedData, collector, additionalFields, facets);
// FIXME allow long in Paging
Paging paging = forPageIndex(options.getPage()).withPageSize(options.getLimit()).andTotal((int) result.getHits().getTotalHits());
return searchResponseFormat.formatSearch(additionalFields, data, paging, facets);
}
private static SearchOptions createSearchOptionsFromRequest(SearchRequest request) {
SearchOptions options = new SearchOptions();
options.setPage(request.getPage(), request.getPageSize());
List<String> facets = request.getFacets();
if (facets == null || facets.isEmpty()) {
return options;
}
options.addFacets(facets);
return options;
}
private void completeFacets(Facets facets, SearchRequest request, IssueQuery query) {
addMandatoryValuesToFacet(facets, PARAM_SEVERITIES, Severity.ALL);
addMandatoryValuesToFacet(facets, PARAM_STATUSES, ISSUE_STATUSES);
addMandatoryValuesToFacet(facets, PARAM_RESOLUTIONS, concat(singletonList(""), RESOLUTIONS));
addMandatoryValuesToFacet(facets, FACET_PROJECTS, query.projectUuids());
addMandatoryValuesToFacet(facets, PARAM_MODULE_UUIDS, query.moduleUuids());
addMandatoryValuesToFacet(facets, PARAM_FILE_UUIDS, query.fileUuids());
List<String> assignees = Lists.newArrayList("");
List<String> assigneesFromRequest = request.getAssigneeUuids();
if (assigneesFromRequest != null) {
assignees.addAll(assigneesFromRequest);
assignees.remove(LOGIN_MYSELF);
}
addMandatoryValuesToFacet(facets, PARAM_ASSIGNEES, assignees);
addMandatoryValuesToFacet(facets, FACET_ASSIGNED_TO_ME, singletonList(userSession.getUuid()));
addMandatoryValuesToFacet(facets, PARAM_RULES, query.rules().stream().map(RuleDefinitionDto::getUuid).collect(toList()));
addMandatoryValuesToFacet(facets, PARAM_SCOPES, ISSUE_SCOPES);
addMandatoryValuesToFacet(facets, PARAM_LANGUAGES, request.getLanguages());
addMandatoryValuesToFacet(facets, PARAM_TAGS, request.getTags());
setTypesFacet(facets);
addMandatoryValuesToFacet(facets, PARAM_OWASP_TOP_10, request.getOwaspTop10());
addMandatoryValuesToFacet(facets, PARAM_SANS_TOP_25, request.getSansTop25());
addMandatoryValuesToFacet(facets, PARAM_CWE, request.getCwe());
addMandatoryValuesToFacet(facets, PARAM_SONARSOURCE_SECURITY, request.getSonarsourceSecurity());
}
private static void setTypesFacet(Facets facets) {
Map<String, Long> typeFacet = facets.get(PARAM_TYPES);
if (typeFacet != null) {
typeFacet.remove(RuleType.SECURITY_HOTSPOT.name());
}
addMandatoryValuesToFacet(facets, PARAM_TYPES, ALL_RULE_TYPES_EXCEPT_SECURITY_HOTSPOTS.stream().map(Enum::name).collect(Collectors.toList()));
}
private static void addMandatoryValuesToFacet(Facets facets, String facetName, @Nullable Iterable<String> mandatoryValues) {
Map<String, Long> buckets = facets.get(facetName);
if (buckets != null && mandatoryValues != null) {
for (String mandatoryValue : mandatoryValues) {
if (!buckets.containsKey(mandatoryValue)) {
buckets.put(mandatoryValue, 0L);
}
}
}
}
private void collectLoggedInUser(SearchResponseLoader.Collector collector) {
if (userSession.isLoggedIn()) {
collector.addUserUuids(singletonList(userSession.getUuid()));
}
}
private static void collectFacets(SearchResponseLoader.Collector collector, Facets facets) {
collector.addProjectUuids(facets.getBucketKeys(FACET_PROJECTS));
collector.addComponentUuids(facets.getBucketKeys(PARAM_MODULE_UUIDS));
collector.addComponentUuids(facets.getBucketKeys(PARAM_FILE_UUIDS));
collector.addRuleIds(facets.getBucketKeys(PARAM_RULES));
collector.addUserUuids(facets.getBucketKeys(PARAM_ASSIGNEES));
}
private static void collectRequestParams(SearchResponseLoader.Collector collector, SearchRequest request) {
collector.addComponentUuids(request.getFileUuids());
collector.addComponentUuids(request.getModuleUuids());
collector.addUserUuids(request.getAssigneeUuids());
}
private SearchRequest toSearchWsRequest(DbSession dbSession, Request request) {
return new SearchRequest()
.setAdditionalFields(request.paramAsStrings(PARAM_ADDITIONAL_FIELDS))
.setAsc(request.mandatoryParamAsBoolean(PARAM_ASC))
.setAssigned(request.paramAsBoolean(PARAM_ASSIGNED))
.setAssigneesUuid(getLogins(dbSession, request.paramAsStrings(PARAM_ASSIGNEES)))
.setAuthors(request.hasParam(PARAM_AUTHOR) ? request.multiParam(PARAM_AUTHOR) : request.paramAsStrings(DEPRECATED_PARAM_AUTHORS))
.setComponents(request.paramAsStrings(PARAM_COMPONENT_KEYS))
.setCreatedAfter(request.param(PARAM_CREATED_AFTER))
.setCreatedAt(request.param(PARAM_CREATED_AT))
.setCreatedBefore(request.param(PARAM_CREATED_BEFORE))
.setCreatedInLast(request.param(PARAM_CREATED_IN_LAST))
.setDirectories(request.paramAsStrings(PARAM_DIRECTORIES))
.setFacetMode(request.mandatoryParam(FACET_MODE))
.setFacets(request.paramAsStrings(FACETS))
.setFileUuids(request.paramAsStrings(PARAM_FILE_UUIDS))
.setIssues(request.paramAsStrings(PARAM_ISSUES))
.setScopes(request.paramAsStrings(PARAM_SCOPES))
.setLanguages(request.paramAsStrings(PARAM_LANGUAGES))
.setModuleUuids(request.paramAsStrings(PARAM_MODULE_UUIDS))
.setOnComponentOnly(request.paramAsBoolean(PARAM_ON_COMPONENT_ONLY))
.setBranch(request.param(PARAM_BRANCH))
.setPullRequest(request.param(PARAM_PULL_REQUEST))
.setOrganization(request.param(PARAM_ORGANIZATION))
.setPage(request.mandatoryParamAsInt(Param.PAGE))
.setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE))
.setProjects(request.paramAsStrings(PARAM_PROJECTS))
.setResolutions(request.paramAsStrings(PARAM_RESOLUTIONS))
.setResolved(request.paramAsBoolean(PARAM_RESOLVED))
.setRules(request.paramAsStrings(PARAM_RULES))
.setSinceLeakPeriod(request.mandatoryParamAsBoolean(PARAM_SINCE_LEAK_PERIOD))
.setSort(request.param(Param.SORT))
.setSeverities(request.paramAsStrings(PARAM_SEVERITIES))
.setStatuses(request.paramAsStrings(PARAM_STATUSES))
.setTags(request.paramAsStrings(PARAM_TAGS))
.setTypes(allRuleTypesExceptHotspotsIfEmpty(request.paramAsStrings(PARAM_TYPES)))
.setOwaspTop10(request.paramAsStrings(PARAM_OWASP_TOP_10))
.setSansTop25(request.paramAsStrings(PARAM_SANS_TOP_25))
.setCwe(request.paramAsStrings(PARAM_CWE))
.setSonarsourceSecurity(request.paramAsStrings(PARAM_SONARSOURCE_SECURITY));
}
private void checkIfNeedIssueSync(DbSession dbSession, SearchRequest searchRequest) {
List<String> components = searchRequest.getComponents();
if (components != null && !components.isEmpty()) {
issueIndexSyncProgressChecker.checkIfAnyComponentsNeedIssueSync(dbSession, components);
} else {
// component keys not provided - asking for global
issueIndexSyncProgressChecker.checkIfIssueSyncInProgress(dbSession);
}
}
private static List<String> allRuleTypesExceptHotspotsIfEmpty(@Nullable List<String> types) {
if (types == null || types.isEmpty()) {
return ALL_RULE_TYPES_EXCEPT_SECURITY_HOTSPOTS.stream().map(Enum::name).collect(toList());
}
return types;
}
private List<String> getLogins(DbSession dbSession, @Nullable List<String> assigneeLogins) {
List<String> userLogins = new ArrayList<>();
for (String login : ofNullable(assigneeLogins).orElse(emptyList())) {
if (LOGIN_MYSELF.equals(login)) {
if (userSession.getLogin() == null) {
userLogins.add(UNKNOWN);
} else {
userLogins.add(userSession.getLogin());
}
} else {
userLogins.add(login);
}
}
List<UserDto> userDtos = dbClient.userDao().selectByLogins(dbSession, userLogins);
List<String> assigneeUuid = userDtos.stream().map(UserDto::getUuid).collect(toList());
if ((assigneeLogins != null) && firstNonNull(assigneeUuid, emptyList()).isEmpty()) {
assigneeUuid = ImmutableList.of("non-existent-uuid");
}
return assigneeUuid;
}
}
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
import copy
import datetime
import glob
import inspect
import itertools
import json
import logging
import numbers
import os
import re
import site
import string
import subprocess
import sys
import threading
import time
import warnings
import click
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from google.protobuf import json_format
from google.protobuf.struct_pb2 import Value, ListValue, Struct, NULL_VALUE
from ..external import six
from ..external.six.moves.urllib.parse import urljoin # pylint: disable=import-error, no-name-in-module
from .._protos.public.common import CommonService_pb2 as _CommonCommonService
from . import importer
logger = logging.getLogger(__name__)
_GRPC_PREFIX = "Grpc-Metadata-"
_VALID_HTTP_METHODS = {'GET', 'POST', 'PUT', 'DELETE', 'PATCH'}
_VALID_FLAT_KEY_CHARS = set(string.ascii_letters + string.digits + '_-/')
THREAD_LOCALS = threading.local()
THREAD_LOCALS.active_experiment_run = None
# TODO: remove this in favor of _config_utils when #635 is merged
HOME_VERTA_DIR = os.path.expanduser(os.path.join('~', ".verta"))
class Connection:
def __init__(self, scheme=None, socket=None, auth=None, max_retries=0, ignore_conn_err=False):
"""
HTTP connection configuration utility struct.
Parameters
----------
scheme : {'http', 'https'}, optional
HTTP authentication scheme.
socket : str, optional
Hostname and port.
auth : dict, optional
Verta authentication headers.
max_retries : int, default 0
Maximum number of times to retry a request on a connection failure. This only attempts retries
on HTTP codes {502, 503, 504} which commonly occur during back end connection lapses.
ignore_conn_err : bool, default False
Whether to ignore connection errors and instead return successes with empty contents.
"""
self.scheme = scheme
self.socket = socket
self.auth = auth
# TODO: retry on 404s, but only if we're sure it's not legitimate e.g. from a GET
self.retry = Retry(total=max_retries,
backoff_factor=1, # each retry waits (2**retry_num) seconds
method_whitelist=False, # retry on all HTTP methods
status_forcelist=(502, 503, 504), # only retry on these status codes
raise_on_redirect=False, # return Response instead of raising after max retries
raise_on_status=False) # return Response instead of raising after max retries
self.ignore_conn_err = ignore_conn_err
def make_proto_request(self, method, path, params=None, body=None, include_default=True):
if params is not None:
params = proto_to_json(params)
if body is not None:
body = proto_to_json(body, include_default)
response = make_request(method,
"{}://{}{}".format(self.scheme, self.socket, path),
self, params=params, json=body)
return response
@staticmethod
def maybe_proto_response(response, response_type):
if response.ok:
response_msg = json_to_proto(body_to_json(response), response_type)
return response_msg
else:
if ((response.status_code == 403 and body_to_json(response)['code'] == 7)
or (response.status_code == 404 and body_to_json(response)['code'] == 5)):
return NoneProtoResponse()
else:
raise_for_http_error(response)
@staticmethod
def must_proto_response(response, response_type):
if response.ok:
response_msg = json_to_proto(body_to_json(response), response_type)
return response_msg
else:
raise_for_http_error(response)
@staticmethod
def must_response(response):
raise_for_http_error(response)
@staticmethod
def _request_to_curl(request):
"""
Prints a cURL to reproduce `request`.
Parameters
----------
request : :class:`requests.PreparedRequest`
Examples
--------
From a :class:`~requests.Response`:
.. code-block:: python
response = _utils.make_request("GET", "https://www.google.com/", conn)
conn._request_to_curl(response.request)
From a :class:`~requests.HTTPError`:
.. code-block:: python
try:
pass # insert bad call here
except Exception as e:
client._conn._request_to_curl(e.request)
raise
"""
curl = "curl -X"
curl += ' ' + request.method
curl += ' ' + '"{}"'.format(request.url)
if request.headers:
curl += ' ' + ' '.join('-H "{}: {}"'.format(key, val) for key, val in request.headers.items())
if request.body:
curl += ' ' + "-d '{}'".format(request.body.decode())
print(curl)
class NoneProtoResponse(object):
def __init__(self):
pass
def __getattr__(self, item):
return None
def HasField(self, name):
return False
class Configuration:
def __init__(self, use_git=True, debug=False):
"""
Client behavior configuration utility struct.
Parameters
----------
use_git : bool, default True
Whether to use a local Git repository for certain operations.
"""
self.use_git = use_git
self.debug = debug
class LazyList(object):
# number of items to fetch per back end call in __iter__()
_ITER_PAGE_LIMIT = 100
_OP_MAP = {'~=': _CommonCommonService.OperatorEnum.CONTAIN,
'==': _CommonCommonService.OperatorEnum.EQ,
'!=': _CommonCommonService.OperatorEnum.NE,
'>': _CommonCommonService.OperatorEnum.GT,
'>=': _CommonCommonService.OperatorEnum.GTE,
'<': _CommonCommonService.OperatorEnum.LT,
'<=': _CommonCommonService.OperatorEnum.LTE}
_OP_PATTERN = re.compile(r" ({}) ".format('|'.join(sorted(six.viewkeys(_OP_MAP), key=lambda s: len(s), reverse=True))))
# keys that yield predictable, sensible results
# TODO: make LazyList an abstract base class; make this attr an abstract property
_VALID_QUERY_KEYS = None # NOTE: must be overridden by subclasses
def __init__(self, conn, conf, msg):
self._conn = conn
self._conf = conf
self._msg = msg # protobuf msg used to make back end calls
def __getitem__(self, index):
if isinstance(index, int):
# copy msg to avoid mutating `self`'s state
msg = self._msg.__class__()
msg.CopyFrom(self._msg)
msg = self.set_page_limit(msg, 1)
if index >= 0:
# convert zero-based indexing into page number
msg = self.set_page_number(msg, index + 1)
else:
# reverse page order to index from end
msg.ascending = not msg.ascending # pylint: disable=no-member
msg = self.set_page_number(msg, abs(index))
records, total_records = self._call_back_end(msg)
if (not records
and self.page_number(msg) > total_records): # pylint: disable=no-member
raise IndexError("index out of range")
return self._create_element(records[0])
else:
raise TypeError("index must be integer, not {}".format(type(index)))
def __iter__(self):
# copy msg to avoid mutating `self`'s state
msg = self._msg.__class__()
msg.CopyFrom(self._msg)
self.set_page_limit(msg, self._ITER_PAGE_LIMIT)
self.set_page_number(msg, 0) # this will be incremented as soon as we enter the loop
seen_ids = set()
total_records = float('inf')
page_number = self.page_number(msg)
while self.page_limit(msg) * page_number < total_records: # pylint: disable=no-member
page_number += 1 # pylint: disable=no-member
records, total_records = self._call_back_end(msg)
for rec in records:
# skip if we've seen the ID before
if rec.id in seen_ids:
continue
else:
seen_ids.add(rec.id)
yield self._create_element(rec)
def __len__(self):
# copy msg to avoid mutating `self`'s state
msg = self._msg.__class__()
msg.CopyFrom(self._msg)
# minimal request just to get total_records
self.set_page_limit(msg, 1)
self.set_page_number(msg, 1)
_, total_records = self._call_back_end(msg)
return total_records
def find(self, where):
"""
Gets the results from this collection that match predicates `where`.
A predicate in `where` is a string containing a simple boolean expression consisting of:
- a dot-delimited property such as ``metrics.accuracy``
- a Python boolean operator such as ``>=``
- a literal value such as ``.8``
Parameters
----------
where : str or list of str
Predicates specifying results to get.
Returns
-------
The same type of object given in the input.
Examples
--------
.. code-block:: python
runs.find(["hyperparameters.hidden_size == 256",
"metrics.accuracy >= .8"])
# <ExperimentRuns containing 3 runs>
"""
new_list = copy.deepcopy(self)
if isinstance(where, six.string_types):
where = [where]
for predicate in where:
# split predicate
try:
key, operator, value = map(lambda token: token.strip(), self._OP_PATTERN.split(predicate, maxsplit=1))
except ValueError:
six.raise_from(ValueError("predicate `{}` must be a two-operand comparison".format(predicate)),
None)
if key.split('.')[0] not in self._VALID_QUERY_KEYS:
raise ValueError("key `{}` is not a valid key for querying;"
" currently supported keys are: {}".format(key, self._VALID_QUERY_KEYS))
# cast operator into protobuf enum variant
operator = self._OP_MAP[operator]
try:
value = float(value)
except ValueError: # not a number, so process as string
# maintain old behavior where input would be wrapped in quotes
if ((value.startswith('\'') and value.endswith('\''))
or (value.startswith('"') and value.endswith('"'))):
value = value[1:-1]
new_list._msg.predicates.append( # pylint: disable=no-member
_CommonCommonService.KeyValueQuery(
key=key, value=python_to_val_proto(value),
operator=operator,
)
)
return new_list
def sort(self, key, descending=False):
"""
Sorts the results from this collection by `key`.
A `key` is a string containing a dot-delimited property such as
``metrics.accuracy``.
Parameters
----------
key : str
Dot-delimited property.
descending : bool, default False
Order in which to return sorted results.
Returns
-------
The same type of object given in the input.
Examples
--------
.. code-block:: python
runs.sort("metrics.accuracy")
# <ExperimentRuns containing 3 runs>
"""
if key.split('.')[0] not in self._VALID_QUERY_KEYS:
raise ValueError("key `{}` is not a valid key for querying;"
" currently supported keys are: {}".format(key, self._VALID_QUERY_KEYS))
new_list = copy.deepcopy(self)
new_list._msg.sort_key = key
new_list._msg.ascending = not descending
return new_list
def _call_back_end(self, msg):
"""Find the request in the backend and returns (elements, total count)."""
raise NotImplementedError
def _create_element(self, msg):
"""Instantiate element to return to user."""
raise NotImplementedError
def set_page_limit(self, msg, param):
msg.page_limit = param
return msg
def set_page_number(self, msg, param):
msg.page_number = param
return msg
def page_limit(self, msg):
return msg.page_limit
def page_number(self, msg):
return msg.page_number
def make_request(method, url, conn, stream=False, **kwargs):
"""
Makes a REST request.
Parameters
----------
method : {'GET', 'POST', 'PUT', 'DELETE'}
HTTP method.
url : str
URL.
conn : :class:`Connection`
Connection authentication and configuration.
stream : bool, default False
Whether to stream the response contents.
**kwargs
Initialization arguments to :class:`requests.Request`.
Returns
-------
:class:`requests.Response`
"""
if method.upper() not in _VALID_HTTP_METHODS:
raise ValueError("`method` must be one of {}".format(_VALID_HTTP_METHODS))
# add auth to headers
kwargs.setdefault('headers', {}).update(conn.auth)
with requests.Session() as session:
session.mount(url, HTTPAdapter(max_retries=conn.retry))
try:
request = requests.Request(method, url, **kwargs).prepare()
# retry loop for broken connections
MAX_RETRIES = conn.retry.total
for retry_num in range(MAX_RETRIES+1):
logger.debug("Making request ({} retries)".format(retry_num))
try:
response = _make_request(session, request, conn.ignore_conn_err, stream=stream)
except requests.ConnectionError as e:
if ((retry_num == MAX_RETRIES)
or ("BrokenPipeError" not in str(e))):
if not conn.ignore_conn_err:
raise e
else:
return fabricate_200()
time.sleep(1)
else:
break
except (requests.exceptions.BaseHTTPError,
requests.exceptions.RequestException) as e:
if not conn.ignore_conn_err:
raise e
# else fall through to fabricate 200 response
else:
if response.ok or not conn.ignore_conn_err:
return response
# else fall through to fabricate 200 response
return fabricate_200()
def _make_request(session, request, ignore_conn_err=False, **kwargs):
"""
Actually sends the request across the wire, and resolves non-302 redirects.
Parameters
----------
session : :class:`requests.Session`
Connection-pooled session for making requests.
request : :class:`requests.PreparedRequest`
Request to make.
ignore_conn_err : bool, default False
Whether to ignore connection errors and instead return a success with empty contents.
**kwargs
Arguments to :meth:`requests.Session.send`
Returns
-------
:class:`requests.Response`
"""
response = session.send(request, allow_redirects=False, **kwargs)
# manually inspect initial response and subsequent redirects to stop on 302s
history = [] # track history because `requests` doesn't since we're redirecting manually
responses = itertools.chain([response], session.resolve_redirects(response, request))
for response in responses:
if response.status_code == 302:
if not ignore_conn_err:
raise RuntimeError(
"received status 302 from {},"
" which is not supported by the Client".format(response.url)
)
else:
return fabricate_200()
history.append(response)
# set full history
response.history = history[:-1] # last element is this response, so drop it
return response
def fabricate_200():
"""
Returns an HTTP response with ``status_code`` 200 and empty JSON contents.
This is used when the Client has ``ignore_conn_err=True``, so that backend responses can be
spoofed to minimize execution-halting errors.
Returns
-------
:class:`requests.Response`
"""
response = requests.Response()
response.status_code = 200 # success
response._content = six.ensure_binary("{}") # empty contents
return response
def raise_for_http_error(response):
"""
Raises a potential HTTP error with a back end message if provided, or a default error message otherwise.
Parameters
----------
response : :class:`requests.Response`
Response object returned from a `requests`-module HTTP request.
Raises
------
:class:`requests.HTTPError`
If an HTTP error occured.
"""
try:
response.raise_for_status()
except requests.HTTPError as e:
# get current time in UTC to display alongside exception
curr_time = timestamp_to_str(now(), utc=True)
time_str = " at {} UTC".format(curr_time)
reason = six.ensure_str(response.text.strip())
if not reason:
e.args = (e.args[0] + time_str,) + e.args[1:] # attach time to error message
six.raise_from(e, None) # use default reason
else:
# replicate https://github.com/psf/requests/blob/428f7a/requests/models.py#L954
if 400 <= response.status_code < 500:
cause = "Client"
elif 500 <= response.status_code < 600:
cause = "Server"
else: # should be impossible here, but sure okay
cause = "Unexpected"
message = "{} {} Error: {} for url: {}".format(response.status_code, cause, reason, response.url)
message += time_str # attach time to error message
six.raise_from(requests.HTTPError(message, response=response), None)
def body_to_json(response):
"""
Returns the JSON-encoded contents of `response`, raising a detailed error on failure.
Parameters
----------
response : :class:`requests.Response`
HTTP response.
Returns
-------
contents : dict
JSON-encoded contents of `response`.
Raises
------
ValueError
If `response`'s contents are not JSON-encoded.
"""
try:
return response.json()
except ValueError: # not JSON response
msg = '\n'.join([
"expected JSON response from {}, but instead got:".format(response.url),
response.text or "<empty response>",
"",
"Please notify the Verta development team.",
])
msg = six.ensure_str(msg)
six.raise_from(ValueError(msg), None)
def is_in_venv(path):
# Roughly checks for:
# /
# |_ lib/
# | |_ python*/ <- directory with Python packages, containing `path`
# |
# |_ bin/
# |_ python* <- Python executable
lib_python_str = os.path.join(os.sep, "lib", "python")
i = path.find(lib_python_str)
if i != -1 and glob.glob(os.path.join(path[:i], "bin", "python*")):
return True
# Debian's system-level packages from apt
# https://wiki.debian.org/Python#Deviations_from_upstream
dist_pkg_pattern = re.compile(r"/usr(/local)?/lib/python[0-9.]+/dist-packages")
if dist_pkg_pattern.match(path):
return True
# packages installed via --user
if path.startswith(site.USER_SITE):
return True
return False
def is_hidden(path): # to avoid "./".startswith('.')
return os.path.basename(path.rstrip('/')).startswith('.') and path != "."
def find_filepaths(paths, extensions=None, include_hidden=False, include_venv=False):
"""
Unravels a list of file and directory paths into a list of only filepaths by walking through the
directories.
Parameters
----------
paths : str or list of str
File and directory paths.
extensions : str or list of str, optional
What files to include while walking through directories. If not provided, all files will be
included.
include_hidden : bool, default False
Whether to include hidden files and subdirectories found while walking through directories.
include_venv : bool, default False
Whether to include Python virtual environment directories.
Returns
-------
filepaths : set
"""
if isinstance(paths, six.string_types):
paths = [paths]
paths = list(map(os.path.expanduser, paths))
if isinstance(extensions, six.string_types):
extensions = [extensions]
if extensions is not None:
# prepend period to file extensions where missing
extensions = map(lambda ext: ext if ext.startswith('.') else ('.' + ext), extensions)
extensions = set(extensions)
filepaths = set()
for path in paths:
if os.path.isdir(path):
for parent_dir, dirnames, filenames in os.walk(path):
if not include_hidden:
# skip hidden directories
dirnames[:] = [dirname for dirname in dirnames if not is_hidden(dirname)]
# skip hidden files
filenames[:] = [filename for filename in filenames if not is_hidden(filename)]
for filename in filenames:
if extensions is None or os.path.splitext(filename)[1] in extensions:
filepaths.add(os.path.join(parent_dir, filename))
else:
filepaths.add(path)
if not include_venv:
filepaths = list(filter(lambda path: not is_in_venv(path), filepaths))
return filepaths
def proto_to_json(msg, include_default=True):
"""
Converts a `protobuf` `Message` object into a JSON-compliant dictionary.
The output preserves snake_case field names and integer representaions of enum variants.
Parameters
----------
msg : google.protobuf.message.Message
`protobuf` `Message` object.
Returns
-------
dict
JSON object representing `msg`.
"""
return json.loads(json_format.MessageToJson(msg,
including_default_value_fields=include_default,
preserving_proto_field_name=True,
use_integers_for_enums=True))
def json_to_proto(response_json, response_cls, ignore_unknown_fields=True):
"""
Converts a JSON-compliant dictionary into a `protobuf` `Message` object.
Parameters
----------
response_json : dict
JSON object representing a Protocol Buffer message.
response_cls : type
`protobuf` `Message` subclass, e.g. ``CreateProject.Response``.
ignore_unknown_fields : bool, default True
Whether to allow (and ignore) fields in `response_json` that are not defined in
`response_cls`. This is for forward compatibility with the back end; if the Client protos
are outdated and we get a response with new fields, ``True`` prevents an error.
Returns
-------
google.protobuf.message.Message
`protobuf` `Message` object represented by `response_json`.
"""
return json_format.Parse(json.dumps(response_json),
response_cls(),
ignore_unknown_fields=ignore_unknown_fields)
def get_bool_types():
"""
Determines available bool types (including NumPy's ``bool_`` if importable) for typechecks.
Returns
-------
tuple
Available bool types.
"""
np = importer.maybe_dependency("numpy")
if np is None:
return (bool,)
else:
return (bool, np.bool_)
def to_builtin(obj):
"""
Tries to coerce `obj` into a built-in type, for JSON serialization.
Parameters
----------
obj
Returns
-------
object
A built-in equivalent of `obj`, or `obj` unchanged if it could not be handled by this function.
"""
# jump through ludicrous hoops to avoid having hard dependencies in the Client
cls_ = obj.__class__
obj_class = getattr(cls_, '__name__', None)
obj_module = getattr(cls_, '__module__', None)
# booleans
if isinstance(obj, get_bool_types()):
return True if obj else False
# NumPy scalars
if obj_module == "numpy" and obj_class.startswith(('int', 'uint', 'float', 'str')):
return obj.item()
# scientific library collections
if obj_class == "ndarray":
return obj.tolist()
if obj_class == "Series":
return obj.values.tolist()
if obj_class == "DataFrame":
return obj.values.tolist()
if obj_class == "Tensor" and obj_module == "torch":
return obj.detach().numpy().tolist()
tf = importer.maybe_dependency("tensorflow")
if tf is not None and isinstance(obj, tf.Tensor): # if TensorFlow
try:
return obj.numpy().tolist()
except: # TF 1.X or not-eager execution
pass
# strings
if isinstance(obj, six.string_types): # prevent infinite loop with iter
return obj
if isinstance(obj, six.binary_type):
return six.ensure_str(obj)
# dicts and lists
if isinstance(obj, dict):
return {to_builtin(key): to_builtin(val) for key, val in six.viewitems(obj)}
try:
iter(obj)
except TypeError:
pass
else:
return [to_builtin(val) for val in obj]
return obj
def python_to_val_proto(raw_val, allow_collection=False):
"""
Converts a Python variable into a `protobuf` `Value` `Message` object.
Parameters
----------
raw_val
Python variable.
allow_collection : bool, default False
Whether to allow ``list``s and ``dict``s as `val`. This flag exists because some callers
ought to not support logging collections, so this function will perform the typecheck on `val`.
Returns
-------
google.protobuf.struct_pb2.Value
`protobuf` `Value` `Message` representing `val`.
"""
# TODO: check `allow_collection` before `to_builtin()` to avoid unnecessary processing
val = to_builtin(raw_val)
if val is None:
return Value(null_value=NULL_VALUE)
elif isinstance(val, bool): # did you know that `bool` is a subclass of `int`?
return Value(bool_value=val)
elif isinstance(val, numbers.Real):
return Value(number_value=val)
elif isinstance(val, six.string_types):
return Value(string_value=val)
elif isinstance(val, (list, dict)):
if allow_collection:
if isinstance(val, list):
list_value = ListValue()
list_value.extend(val) # pylint: disable=no-member
return Value(list_value=list_value)
else: # isinstance(val, dict)
if all([isinstance(key, six.string_types) for key in val.keys()]):
struct_value = Struct()
struct_value.update(val) # pylint: disable=no-member
return Value(struct_value=struct_value)
else: # protobuf's fault
raise TypeError("struct keys must be strings; consider using log_artifact() instead")
else:
raise TypeError("unsupported type {}; consider using log_attribute() instead".format(type(raw_val)))
else:
raise TypeError("unsupported type {}; consider using log_artifact() instead".format(type(raw_val)))
def val_proto_to_python(msg):
"""
Converts a `protobuf` `Value` `Message` object into a Python variable.
Parameters
----------
msg : google.protobuf.struct_pb2.Value
`protobuf` `Value` `Message` representing a variable.
Returns
-------
one of {None, bool, float, int, str}
Python variable represented by `msg`.
"""
value_kind = msg.WhichOneof("kind")
if value_kind == "null_value":
return None
elif value_kind == "bool_value":
return msg.bool_value
elif value_kind == "number_value":
return int(msg.number_value) if msg.number_value.is_integer() else msg.number_value
elif value_kind == "string_value":
return msg.string_value
elif value_kind == "list_value":
return [val_proto_to_python(val_msg)
for val_msg
in msg.list_value.values]
elif value_kind == "struct_value":
return {key: val_proto_to_python(val_msg)
for key, val_msg
in msg.struct_value.fields.items()}
else:
raise NotImplementedError("retrieved value type is not supported")
def unravel_key_values(rpt_key_value_msg):
"""
Converts a repeated KeyValue field of a protobuf message into a dictionary.
Parameters
----------
rpt_key_value_msg : google.protobuf.pyext._message.RepeatedCompositeContainer
Repeated KeyValue field of a protobuf message.
Returns
-------
dict of str to {None, bool, float, int, str}
Names and values.
"""
return {key_value.key: val_proto_to_python(key_value.value)
for key_value
in rpt_key_value_msg}
def unravel_artifacts(rpt_artifact_msg):
"""
Converts a repeated Artifact field of a protobuf message into a list of names.
Parameters
----------
rpt_artifact_msg : google.protobuf.pyext._message.RepeatedCompositeContainer
Repeated Artifact field of a protobuf message.
Returns
-------
list of str
Names of artifacts.
"""
return [artifact.key
for artifact
in rpt_artifact_msg]
def unravel_observation(obs_msg):
"""
Converts an Observation protobuf message into a more straightforward Python tuple.
This is useful because an Observation message has a oneof that's finicky to handle.
Returns
-------
str
Name of observation.
{None, bool, float, int, str}
Value of observation.
str
Human-readable timestamp.
"""
if obs_msg.WhichOneof("oneOf") == "attribute":
key = obs_msg.attribute.key
value = obs_msg.attribute.value
elif obs_msg.WhichOneof("oneOf") == "artifact":
key = obs_msg.artifact.key
value = "{} artifact".format(_CommonCommonService.ArtifactTypeEnum.ArtifactType.Name(obs_msg.artifact.artifact_type))
return (
key,
val_proto_to_python(value),
timestamp_to_str(obs_msg.timestamp),
int(obs_msg.epoch_number.number_value),
)
def unravel_observations(rpt_obs_msg):
"""
Converts a repeated Observation field of a protobuf message into a dictionary.
Parameters
----------
rpt_obs_msg : google.protobuf.pyext._message.RepeatedCompositeContainer
Repeated Observation field of a protobuf message.
Returns
-------
dict of str to list of tuples ({None, bool, float, int, str}, str)
Names and observation sequences.
"""
observations = {}
for obs_msg in rpt_obs_msg:
obs_tuple = unravel_observation(obs_msg)
key = obs_tuple[0]
observations.setdefault(key, []).append(obs_tuple[1:])
return observations
def validate_flat_key(key):
"""
Checks whether `key` contains invalid characters.
To prevent bugs with querying (which allow dot-delimited nested keys), flat keys (such as those
used for individual metrics) must not contain periods.
Furthermore, to prevent potential bugs with the back end down the line, keys should be restricted
to alphanumeric characters, underscores, and dashes until we can verify robustness.
Parameters
----------
key : str
Name of metadatum.
Raises
------
ValueError
If `key` contains invalid characters.
"""
for c in key:
if c not in _VALID_FLAT_KEY_CHARS:
raise ValueError("`key` may only contain alphanumeric characters, underscores, dashes,"
" and forward slashes")
def generate_default_name():
"""
Generates a string that can be used as a default entity name while avoiding collisions.
The generated string is a concatenation of the current process ID and the current Unix timestamp,
such that a collision should only occur if a single process produces two of an entity at the same
nanosecond.
Returns
-------
name : str
String generated from the current process ID and Unix timestamp.
"""
return "{}{}".format(os.getpid(), str(time.time()).replace('.', ''))
class UTC(datetime.tzinfo):
"""UTC timezone class for Python 2 timestamp calculations"""
def utcoffset(self, dt):
return datetime.timedelta(0)
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return datetime.timedelta(0)
def timestamp_to_ms(timestamp):
"""
Converts a Unix timestamp into one with millisecond resolution.
Parameters
----------
timestamp : float or int
Unix timestamp.
Returns
-------
int
`timestamp` with millisecond resolution (13 integer digits).
"""
num_integer_digits = len(str(timestamp).split('.')[0])
return int(timestamp*10**(13 - num_integer_digits))
def ensure_timestamp(timestamp):
"""
Converts a representation of a datetime into a Unix timestamp with millisecond resolution.
If `timestamp` is provided as a string, this function attempts to use pandas (if installed) to
parse it into a Unix timestamp, since pandas can interally handle many different human-readable
datetime string representations. If pandas is not installed, this function will only handle an
ISO 8601 representation.
Parameters
----------
timestamp : str or float or int
String representation of a datetime or numerical Unix timestamp.
Returns
-------
int
`timestamp` with millisecond resolution (13 integer digits).
"""
if isinstance(timestamp, six.string_types):
pd = importer.maybe_dependency("pandas")
if pd is not None:
try: # attempt with pandas, which can parse many time string formats
return timestamp_to_ms(pd.Timestamp(timestamp).timestamp())
except ValueError: # can't be handled by pandas
six.raise_from(ValueError("unable to parse datetime string \"{}\"".format(timestamp)),
None)
else:
six.raise_from(ValueError("pandas must be installed to parse datetime strings"),
None)
elif isinstance(timestamp, numbers.Real):
return timestamp_to_ms(timestamp)
elif isinstance(timestamp, datetime.datetime):
if six.PY2:
# replicate https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp
seconds = (timestamp - datetime.datetime(1970, 1, 1, tzinfo=UTC())).total_seconds()
else: # Python 3
seconds = timestamp.timestamp()
return timestamp_to_ms(seconds)
else:
raise TypeError("unable to parse timestamp of type {}".format(type(timestamp)))
def timestamp_to_str(timestamp, utc=False):
"""
Converts a Unix timestamp into a human-readable string representation.
Parameters
----------
timestamp : int
Numerical Unix timestamp.
Returns
-------
str
Human-readable string representation of `timestamp`.
"""
num_digits = len(str(timestamp))
ts_as_sec = timestamp*10**(10 - num_digits)
if utc:
datetime_obj = datetime.datetime.utcfromtimestamp(ts_as_sec)
else:
datetime_obj = datetime.datetime.fromtimestamp(ts_as_sec)
return str(datetime_obj)
def now():
"""
Returns the current Unix timestamp with millisecond resolution.
Returns
-------
now : int
Current Unix timestamp in milliseconds.
"""
return timestamp_to_ms(time.time())
def get_python_version():
"""
Returns the version number of the locally-installed Python interpreter.
Returns
-------
str
Python version number in the form "{major}.{minor}.{patch}".
"""
return '.'.join(map(str, sys.version_info[:3]))
def save_notebook(notebook_path=None, timeout=5):
"""
Saves the current notebook on disk and returns its contents after the file has been rewritten.
Parameters
----------
notebook_path : str, optional
Filepath of the Jupyter Notebook.
timeout : float, default 5
Maximum number of seconds to wait for the notebook to save.
Returns
-------
notebook_contents : file-like
An in-memory copy of the notebook's contents at the time this function returns. This can
be ignored, but is nonetheless available to minimize the risk of a race condition caused by
delaying the read until a later time.
Raises
------
OSError
If the notebook is not saved within `timeout` seconds.
"""
IPython_display = importer.maybe_dependency("IPython.display")
if IPython_display is None:
raise ImportError("unable to import libraries necessary for saving notebook")
if notebook_path is None:
notebook_path = get_notebook_filepath()
modtime = os.path.getmtime(notebook_path)
IPython_display.display(IPython_display.Javascript('''
require(["base/js/namespace"],function(Jupyter) {
Jupyter.notebook.save_checkpoint();
});
'''))
# wait for file to be modified
start_time = time.time()
while time.time() - start_time < timeout:
new_modtime = os.path.getmtime(notebook_path)
if new_modtime > modtime:
break
time.sleep(0.01)
else:
raise OSError("unable to save notebook")
# wait for file to be rewritten
timeout -= (time.time() - start_time) # remaining time
start_time = time.time()
while time.time() - start_time < timeout:
with open(notebook_path, 'r') as f:
contents = f.read()
if contents:
return six.StringIO(contents)
time.sleep(0.01)
else:
raise OSError("unable to read saved notebook")
def get_notebook_filepath():
"""
Returns the filesystem path of the Jupyter notebook running the Client.
This implementation is from https://github.com/jupyter/notebook/issues/1000#issuecomment-359875246.
Returns
-------
str
Raises
------
OSError
If one of the following is true:
- Jupyter is not installed
- Client is not being called from a notebook
- the calling notebook cannot be identified
"""
ipykernel = importer.maybe_dependency("ipykernel")
if ipykernel is None:
raise ImportError("unable to import libraries necessary for locating notebook")
notebookapp = importer.maybe_dependency("notebook.notebookapp")
if notebookapp is None:
# Python 2, util we need is in different module
with warnings.catch_warnings():
warnings.simplefilter("ignore")
notebookapp = importer.maybe_dependency("IPython.html.notebookapp")
if notebookapp is None: # abnormally nonstandard installation of Jupyter
raise ImportError("unable to import libraries necessary for locating notebook")
try:
connection_file = ipykernel.connect.get_connection_file()
except (NameError, # Jupyter not installed
RuntimeError): # not in a Notebook
pass
else:
kernel_id = re.search('kernel-(.*).json', connection_file).group(1)
for server in notebookapp.list_running_servers():
response = requests.get(urljoin(server['url'], 'api/sessions'),
params={'token': server.get('token', '')})
if response.ok:
for session in body_to_json(response):
if session['kernel']['id'] == kernel_id:
relative_path = session['notebook']['path']
return os.path.join(server['notebook_dir'], relative_path)
raise OSError("unable to find notebook file")
def get_script_filepath():
"""
Returns the filesystem path of the Python script running the Client.
This function iterates back through the call stack until it finds a non-Verta stack frame and
returns its filepath.
Returns
-------
str
Raises
------
OSError
If the calling script cannot be identified.
"""
for frame_info in inspect.stack():
module = inspect.getmodule(frame_info[0])
if module is None or module.__name__.split('.', 1)[0] != "verta":
filepath = frame_info[1]
if os.path.exists(filepath): # e.g. Jupyter fakes the filename for cells
return filepath
else:
break # continuing might end up returning a built-in
raise OSError("unable to find script file")
def is_org(workspace_name, conn):
response = make_request(
"GET",
"{}://{}/api/v1/uac-proxy/organization/getOrganizationByName".format(conn.scheme, conn.socket),
conn, params={'org_name': workspace_name},
)
return response.status_code != 404
def as_list_of_str(tags):
"""
Ensures that `tags` is a list of str.
Parameters
----------
tags : str or list of str
If list of str, return unchanged. If str, return wrapped in a list.
Returns
-------
tags : list of str
Tags.
Raises
------
TypeError
If `tags` is neither str nor list of str.
"""
# TODO: make error messages more general so this can be used for any similar var
if isinstance(tags, six.string_types):
tags = [tags]
else:
if not isinstance(tags, (list, tuple, set)):
raise TypeError("`tags` should be list of str, not {}".format(type(tags)))
for tag in tags:
if not isinstance(tag, six.string_types):
raise TypeError("`tags` must be list of str, but found {}".format(type(tag)))
return tags
def _multiple_arguments_for_each(argument, name, action, get_keys, overwrite):
name = name
argument = list(map(lambda s: s.split('='), argument))
if argument and len(argument) > len(
set(map(lambda pair: pair[0], argument))):
raise click.BadParameter("cannot have duplicate {} keys".format(name))
if argument:
argument_keys = set(get_keys())
for pair in argument:
if len(pair) != 2:
raise click.BadParameter("key and path for {}s must be separated by a '='".format(name))
(key, _) = pair
if key == "model":
raise click.BadParameter("the key \"model\" is reserved for model")
if not overwrite and key in argument_keys:
raise click.BadParameter(
"key \"{}\" already exists; consider using --overwrite flag".format(key))
for (key, path) in argument:
action(key, path)
|
{
"pile_set_name": "Github"
}
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: Templates\CSharp\Requests\MethodCollectionResponse.cs.tt
namespace Microsoft.Graph
{
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
/// <summary>
/// The type NotebookGetRecentNotebooksCollectionResponse.
/// </summary>
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class NotebookGetRecentNotebooksCollectionResponse
{
/// <summary>
/// Gets or sets the <see cref="INotebookGetRecentNotebooksCollectionPage"/> value.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName ="value", Required = Required.Default)]
public INotebookGetRecentNotebooksCollectionPage Value { get; set; }
/// <summary>
/// Gets or sets additional data.
/// </summary>
[JsonExtensionData(ReadData = true)]
public IDictionary<string, object> AdditionalData { get; set; }
}
}
|
{
"pile_set_name": "Github"
}
|
Description:
Conversion UTF-16 to UCS-4.
Files:
Depends-on:
unistr/u16-mbtouc-unsafe
configure.ac:
Makefile.am:
Include:
"unistr.h"
License:
LGPL
Maintainer:
all
|
{
"pile_set_name": "Github"
}
|
/*!
@file
Defines `boost::hana::negate`.
@copyright Louis Dionne 2013-2016
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_NEGATE_HPP
#define BOOST_HANA_NEGATE_HPP
#include <boost/hana/fwd/negate.hpp>
#include <boost/hana/concept/group.hpp>
#include <boost/hana/config.hpp>
#include <boost/hana/core/dispatch.hpp>
#include <boost/hana/fwd/minus.hpp>
#include <boost/hana/zero.hpp>
#include <type_traits>
BOOST_HANA_NAMESPACE_BEGIN
//! @cond
template <typename X>
constexpr decltype(auto) negate_t::operator()(X&& x) const {
using G = typename hana::tag_of<X>::type;
using Negate = BOOST_HANA_DISPATCH_IF(negate_impl<G>,
hana::Group<G>::value
);
#ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS
static_assert(hana::Group<G>::value,
"hana::negate(x) requires 'x' to be in a Group");
#endif
return Negate::apply(static_cast<X&&>(x));
}
//! @endcond
template <typename T, bool condition>
struct negate_impl<T, when<condition>> : default_ {
template <typename X>
static constexpr decltype(auto) apply(X&& x)
{ return hana::minus(hana::zero<T>(), static_cast<X&&>(x)); }
};
//////////////////////////////////////////////////////////////////////////
// Model for arithmetic data types
//////////////////////////////////////////////////////////////////////////
template <typename T>
struct negate_impl<T, when<std::is_arithmetic<T>::value &&
!std::is_same<bool, T>::value>> {
template <typename X>
static constexpr decltype(auto) apply(X&& x)
{ return -static_cast<X&&>(x); }
};
BOOST_HANA_NAMESPACE_END
#endif // !BOOST_HANA_NEGATE_HPP
|
{
"pile_set_name": "Github"
}
|
import java.util.Arrays;
import java.util.List;
import java.util.LinkedList;
/**
* This program demonstrates the use of Java Thread.join() as a simple
* barrier synchronizer to implement an "embarrassingly parallel"
* application that concurrently searches for words in a List of
* Strings.
*/
public class ThreadJoinTest {
/**
* If this is set to true then lots of debugging output will be
* generated.
*/
public static boolean diagnosticsEnabled = true;
/**
* This input array is used by the ThreadJoinTest to search for
* the words concurrently in multiple threads.
*/
private final static String[] mOneShotInputStrings = {
"xreo", "xfao", "xmiomio", "xlao", "xtiotio", "xsoosoo", "xdoo", "xdoodoo"
};
// List of words to search for.
private static String[] mWordList = {
"do", "re", "mi", "fa", "so", "la", "ti", "do"
};
/**
* This is the entry point into the test program.
*/
static public void main(String[] args) {
printDebugging("Starting ThreadJoinTest");
// Create/run an object to search for words concurrently.
new SearchOneShotThreadJoin(mWordList,
mOneShotInputStrings);
printDebugging("Ending ThreadJoinTest");
}
/**
* Starts a Thread for each element in the List of input Strings
* and uses Thread.join() to wait for all the Threads to finish.
* This implementation doesn't require any Java synchronization
* mechanisms other than what's provided by Thread.
*/
static public class SearchOneShotThreadJoin {
/**
* The input List that's processed.
*/
private volatile List<String> mInput = null;
/**
* The array of words to find.
*/
final String[] mWordsToFind;
/**
* Constructor initializes the fields and runs the program.
*/
public SearchOneShotThreadJoin(String[] wordsToFind,
String[] inputStrings) {
// Initialize the data members.
mWordsToFind = wordsToFind;
mInput = Arrays.asList(inputStrings);
// This List holds Threads so they can be joined when
// their processing is done.
List<Thread> workerThreads = new LinkedList<>();
// Create and start a Thread for each element in the
// mInput.
for (int i = 0; i < mInput.size(); ++i) {
// Each Thread performs the processing designated by
// the processInput() method of the worker Runnable.
Thread t = new Thread(makeTask(i));
// Add to the List of Threads to join.
workerThreads.add(t);
}
// Start all threads to process input in the background.
for (Thread thread : workerThreads)
thread.start();
// Barrier synchronization to wait for threads to finish.
for (Thread thread : workerThreads) {
try {
thread.join();
} catch (InterruptedException e) {
printDebugging("join() interrupted");
}
}
}
/**
* Factory method that creates a Runnable task that will
* process one node of the input List (at location @code
* index) in a background Thread .
*/
private Runnable makeTask(final int index) {
return new Runnable() {
// This method runs in background Thread.
public void run() {
// Get the input data element associated with
// this index.
String element = mInput.get(index);
// Process input data element.
processInput(element);
}
};
}
/**
* Run in a background Thread and search the inputData for
* all occurrences of the words to find. Each time a match is
* found the processResults() hook method is called to handle
* the results.
*/
private void processInput (String inputData) {
// Iterate through each word we're searching for.
for (String word : mWordsToFind)
// Check to see how many times (if any) the word
// appears in the input data.
for (int i = inputData.indexOf(word, 0);
i != -1;
i = inputData.indexOf(word, i + word.length()))
// Each time a match is found the processResults()
// hook method is called to handle the results.
processResults("in thread "
+ Thread.currentThread().getId()
+ " "
+ word
+ " was found at offset "
+ i
+ " in string "
+ inputData);
}
/**
* Hook method that processes the results.
*/
private void processResults(String results) {
printDebugging(results);
}
}
/**
* Print debugging output if @code diagnosticsEnabled is true.
*/
static void printDebugging(String output) {
if (diagnosticsEnabled)
System.out.println(output);
}
}
|
{
"pile_set_name": "Github"
}
|
{
"name": "DVWA",
"author": "fofa",
"version": "0.1.0",
"matches": [
{
"search": "title",
"regexp": "Damn Vulnerable Web App (DVWA) - Login"
},
{
"search": "body",
"text": "dvwa/css/login.css"
},
{
"search": "body",
"text": "dvwa/images/login_logo.png"
}
]
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "varint.h"
uintmax_t git_decode_varint(const unsigned char *bufp, size_t *varint_len)
{
const unsigned char *buf = bufp;
unsigned char c = *buf++;
uintmax_t val = c & 127;
while (c & 128) {
val += 1;
if (!val || MSB(val, 7)) {
/* This is not a valid varint_len, so it signals
the error */
*varint_len = 0;
return 0; /* overflow */
}
c = *buf++;
val = (val << 7) + (c & 127);
}
*varint_len = buf - bufp;
return val;
}
int git_encode_varint(unsigned char *buf, size_t bufsize, uintmax_t value)
{
unsigned char varint[16];
unsigned pos = sizeof(varint) - 1;
varint[pos] = value & 127;
while (value >>= 7)
varint[--pos] = 128 | (--value & 127);
if (buf) {
if (bufsize < (sizeof(varint) - pos))
return -1;
memcpy(buf, varint + pos, sizeof(varint) - pos);
}
return sizeof(varint) - pos;
}
|
{
"pile_set_name": "Github"
}
|
VirtualKeyboard.addLayout({code:'RU',name:'Russian (Typewriter)',normal:'|№-/":,._?%!;)йцукенгшщзхъфывапролджэячсмитьбюё',shift:{0:'+1234567890=\\('}});
|
{
"pile_set_name": "Github"
}
|
import QtQuick 2.12
import App 1.0
// For access to Theme Singleton
import "."
ImageCanvas {
id: imageCanvas
objectName: "imageCanvas"
focus: true
project: args.project
backgroundColour: Theme.canvasBackgroundColour
checkerColour1: settings.checkerColour1
checkerColour2: settings.checkerColour2
gridColour: "#55000000"
splitColour: Theme.splitColour
splitter.width: 32
rulerForegroundColour: Theme.rulerForegroundColour
rulerBackgroundColour: Theme.rulerBackgroundColour
scrollZoom: settings.scrollZoom
gesturesEnabled: settings.gesturesEnabled
penToolRightClickBehaviour: settings.penToolRightClickBehaviour
anchors.fill: parent
readonly property int currentPaneZoomLevel: imageCanvas.currentPane ? imageCanvas.currentPane.integerZoomLevel : 1
readonly property point currentPaneOffset: imageCanvas.currentPane ? imageCanvas.currentPane.integerOffset : Qt.point(0, 0)
readonly property bool useCrosshairCursor: imageCanvas.tool === ImageCanvas.SelectionTool || imageCanvas.tool === ImageCanvas.NoteTool
|| (imageCanvas.toolSize < 4 && imageCanvas.currentPaneZoomLevel <= 3)
readonly property bool useIconCursor: imageCanvas.tool === ImageCanvas.EyeDropperTool
onErrorOccurred: errorPopup.showError(errorMessage)
CanvasPaneRepeater {
canvas: imageCanvas
}
SplitterBar {
canvas: imageCanvas
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/perl
$file = $ARGV[0];
open(IN,$file) || die print "Failed to open file: $file : $!";
read(IN,$buffer,1);
read(IN,$buffer2,1);
if (ord($buffer) != 0x41 && ord($buffer2) != 0x50) {
print "bad header ". $buffer ." ".$buffer2. "\n";
exit;
}
read(IN,$buffer,1);
if (ord($buffer) != 2) {
print "bad version";
exit;
}
# spare
read(IN,$buffer,1);
$a = 0;
while (read(IN,$buffer,1)) {
$pos = (tell(IN) - 1);
$size = ((ord($buffer) & 63));
read(IN,$buffer,1);
if (ord($buffer) == 0xff) {
printf("end sentinel at %u\n", $pos);
last;
}
printf("%04x: key %u size %d\n ", $pos, ord($buffer), $size + 1);
for ($i = 0; $i <= ($size); $i++) {
read(IN,$buffer,1);
printf(" %02x", ord($buffer));
}
print "\n";
}
close IN;
|
{
"pile_set_name": "Github"
}
|
; Auto-generated. Do not edit!
(cl:in-package ros_arduino_msgs-msg)
;//! \htmlinclude Analog.msg.html
(cl:defclass <Analog> (roslisp-msg-protocol:ros-message)
((header
:reader header
:initarg :header
:type std_msgs-msg:Header
:initform (cl:make-instance 'std_msgs-msg:Header))
(value
:reader value
:initarg :value
:type cl:fixnum
:initform 0))
)
(cl:defclass Analog (<Analog>)
())
(cl:defmethod cl:initialize-instance :after ((m <Analog>) cl:&rest args)
(cl:declare (cl:ignorable args))
(cl:unless (cl:typep m 'Analog)
(roslisp-msg-protocol:msg-deprecation-warning "using old message class name ros_arduino_msgs-msg:<Analog> is deprecated: use ros_arduino_msgs-msg:Analog instead.")))
(cl:ensure-generic-function 'header-val :lambda-list '(m))
(cl:defmethod header-val ((m <Analog>))
(roslisp-msg-protocol:msg-deprecation-warning "Using old-style slot reader ros_arduino_msgs-msg:header-val is deprecated. Use ros_arduino_msgs-msg:header instead.")
(header m))
(cl:ensure-generic-function 'value-val :lambda-list '(m))
(cl:defmethod value-val ((m <Analog>))
(roslisp-msg-protocol:msg-deprecation-warning "Using old-style slot reader ros_arduino_msgs-msg:value-val is deprecated. Use ros_arduino_msgs-msg:value instead.")
(value m))
(cl:defmethod roslisp-msg-protocol:serialize ((msg <Analog>) ostream)
"Serializes a message object of type '<Analog>"
(roslisp-msg-protocol:serialize (cl:slot-value msg 'header) ostream)
(cl:write-byte (cl:ldb (cl:byte 8 0) (cl:slot-value msg 'value)) ostream)
(cl:write-byte (cl:ldb (cl:byte 8 8) (cl:slot-value msg 'value)) ostream)
)
(cl:defmethod roslisp-msg-protocol:deserialize ((msg <Analog>) istream)
"Deserializes a message object of type '<Analog>"
(roslisp-msg-protocol:deserialize (cl:slot-value msg 'header) istream)
(cl:setf (cl:ldb (cl:byte 8 0) (cl:slot-value msg 'value)) (cl:read-byte istream))
(cl:setf (cl:ldb (cl:byte 8 8) (cl:slot-value msg 'value)) (cl:read-byte istream))
msg
)
(cl:defmethod roslisp-msg-protocol:ros-datatype ((msg (cl:eql '<Analog>)))
"Returns string type for a message object of type '<Analog>"
"ros_arduino_msgs/Analog")
(cl:defmethod roslisp-msg-protocol:ros-datatype ((msg (cl:eql 'Analog)))
"Returns string type for a message object of type 'Analog"
"ros_arduino_msgs/Analog")
(cl:defmethod roslisp-msg-protocol:md5sum ((type (cl:eql '<Analog>)))
"Returns md5sum for a message object of type '<Analog>"
"5760aa9c40c2caa52a04d293094e679d")
(cl:defmethod roslisp-msg-protocol:md5sum ((type (cl:eql 'Analog)))
"Returns md5sum for a message object of type 'Analog"
"5760aa9c40c2caa52a04d293094e679d")
(cl:defmethod roslisp-msg-protocol:message-definition ((type (cl:eql '<Analog>)))
"Returns full string definition for message of type '<Analog>"
(cl:format cl:nil "# Reading from a single analog IO pin.~%Header header~%uint16 value~%~%================================================================================~%MSG: std_msgs/Header~%# Standard metadata for higher-level stamped data types.~%# This is generally used to communicate timestamped data ~%# in a particular coordinate frame.~%# ~%# sequence ID: consecutively increasing ID ~%uint32 seq~%#Two-integer timestamp that is expressed as:~%# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')~%# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')~%# time-handling sugar is provided by the client library~%time stamp~%#Frame this data is associated with~%# 0: no frame~%# 1: global frame~%string frame_id~%~%~%"))
(cl:defmethod roslisp-msg-protocol:message-definition ((type (cl:eql 'Analog)))
"Returns full string definition for message of type 'Analog"
(cl:format cl:nil "# Reading from a single analog IO pin.~%Header header~%uint16 value~%~%================================================================================~%MSG: std_msgs/Header~%# Standard metadata for higher-level stamped data types.~%# This is generally used to communicate timestamped data ~%# in a particular coordinate frame.~%# ~%# sequence ID: consecutively increasing ID ~%uint32 seq~%#Two-integer timestamp that is expressed as:~%# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')~%# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')~%# time-handling sugar is provided by the client library~%time stamp~%#Frame this data is associated with~%# 0: no frame~%# 1: global frame~%string frame_id~%~%~%"))
(cl:defmethod roslisp-msg-protocol:serialization-length ((msg <Analog>))
(cl:+ 0
(roslisp-msg-protocol:serialization-length (cl:slot-value msg 'header))
2
))
(cl:defmethod roslisp-msg-protocol:ros-message-to-list ((msg <Analog>))
"Converts a ROS message object to a list"
(cl:list 'Analog
(cl:cons ':header (header msg))
(cl:cons ':value (value msg))
))
|
{
"pile_set_name": "Github"
}
|
(module BUZZER-12MM-KIT (layer F.Cu) (tedit 200000)
(descr "12MM BUZZER - PTH (KIT VARIANT)")
(tags "12MM BUZZER - PTH (KIT VARIANT)")
(attr virtual)
(fp_text reference >NAME (at 0 -6.477) (layer F.SilkS)
(effects (font (size 0.6096 0.6096) (thickness 0.127)))
)
(fp_text value >VALUE (at 0 6.604) (layer F.SilkS)
(effects (font (size 0.6096 0.6096) (thickness 0.127)))
)
(fp_line (start 3.2512 0.9525) (end 3.06832 0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start 3.06832 0.93472) (end 2.89052 0.88392) (layer F.SilkS) (width 0.127))
(fp_line (start 2.89052 0.88392) (end 2.72796 0.8001) (layer F.SilkS) (width 0.127))
(fp_line (start 2.72796 0.8001) (end 2.58318 0.68326) (layer F.SilkS) (width 0.127))
(fp_line (start 2.58318 0.68326) (end 2.4638 0.54356) (layer F.SilkS) (width 0.127))
(fp_line (start 2.4638 0.54356) (end 2.3749 0.381) (layer F.SilkS) (width 0.127))
(fp_line (start 2.3749 0.381) (end 2.31902 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start 2.31902 0.20574) (end 2.2987 0.02032) (layer F.SilkS) (width 0.127))
(fp_line (start 2.2987 0.02032) (end 2.3114 -0.14224) (layer F.SilkS) (width 0.127))
(fp_line (start 2.3114 -0.14224) (end 2.35204 -0.30734) (layer F.SilkS) (width 0.127))
(fp_line (start 2.35204 -0.30734) (end 2.42062 -0.45974) (layer F.SilkS) (width 0.127))
(fp_line (start 2.42062 -0.45974) (end 2.5146 -0.59944) (layer F.SilkS) (width 0.127))
(fp_line (start 2.5146 -0.59944) (end 2.63398 -0.71882) (layer F.SilkS) (width 0.127))
(fp_line (start 2.63398 -0.71882) (end 2.7686 -0.81534) (layer F.SilkS) (width 0.127))
(fp_line (start 2.7686 -0.81534) (end 2.921 -0.889) (layer F.SilkS) (width 0.127))
(fp_line (start 2.921 -0.889) (end 3.08356 -0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start 3.08356 -0.93472) (end 3.2512 -0.9525) (layer F.SilkS) (width 0.127))
(fp_line (start 3.2512 -0.9525) (end 3.4163 -0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start 3.4163 -0.93472) (end 3.57886 -0.889) (layer F.SilkS) (width 0.127))
(fp_line (start 3.57886 -0.889) (end 3.73126 -0.81534) (layer F.SilkS) (width 0.127))
(fp_line (start 3.73126 -0.81534) (end 3.86588 -0.71628) (layer F.SilkS) (width 0.127))
(fp_line (start 3.86588 -0.71628) (end 3.98272 -0.5969) (layer F.SilkS) (width 0.127))
(fp_line (start 3.98272 -0.5969) (end 4.0767 -0.4572) (layer F.SilkS) (width 0.127))
(fp_line (start 4.0767 -0.4572) (end 4.14782 -0.3048) (layer F.SilkS) (width 0.127))
(fp_line (start 4.14782 -0.3048) (end 4.18846 -0.1397) (layer F.SilkS) (width 0.127))
(fp_line (start 4.18846 -0.1397) (end 4.20116 0.0254) (layer F.SilkS) (width 0.127))
(fp_line (start 4.20116 0.0254) (end 4.18084 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start 4.18084 0.20574) (end 4.12496 0.381) (layer F.SilkS) (width 0.127))
(fp_line (start 4.12496 0.381) (end 4.03606 0.54356) (layer F.SilkS) (width 0.127))
(fp_line (start 4.03606 0.54356) (end 3.91922 0.68326) (layer F.SilkS) (width 0.127))
(fp_line (start 3.91922 0.68326) (end 3.77444 0.8001) (layer F.SilkS) (width 0.127))
(fp_line (start 3.77444 0.8001) (end 3.61188 0.88392) (layer F.SilkS) (width 0.127))
(fp_line (start 3.61188 0.88392) (end 3.43662 0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start 3.43662 0.93472) (end 3.2512 0.9525) (layer F.SilkS) (width 0.127))
(fp_line (start 3.2512 0.4445) (end 3.15214 0.43434) (layer F.SilkS) (width 0.127))
(fp_line (start 3.15214 0.43434) (end 3.0607 0.40386) (layer F.SilkS) (width 0.127))
(fp_line (start 3.0607 0.40386) (end 2.97688 0.3556) (layer F.SilkS) (width 0.127))
(fp_line (start 2.97688 0.3556) (end 2.90576 0.28702) (layer F.SilkS) (width 0.127))
(fp_line (start 2.90576 0.28702) (end 2.85242 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start 2.85242 0.20574) (end 2.8194 0.1143) (layer F.SilkS) (width 0.127))
(fp_line (start 2.8194 0.1143) (end 2.8067 0.01778) (layer F.SilkS) (width 0.127))
(fp_line (start 2.8067 0.01778) (end 2.81432 -0.08128) (layer F.SilkS) (width 0.127))
(fp_line (start 2.81432 -0.08128) (end 2.8448 -0.1778) (layer F.SilkS) (width 0.127))
(fp_line (start 2.8448 -0.1778) (end 2.89814 -0.26416) (layer F.SilkS) (width 0.127))
(fp_line (start 2.89814 -0.26416) (end 2.96926 -0.34036) (layer F.SilkS) (width 0.127))
(fp_line (start 2.96926 -0.34036) (end 3.05308 -0.39624) (layer F.SilkS) (width 0.127))
(fp_line (start 3.05308 -0.39624) (end 3.1496 -0.4318) (layer F.SilkS) (width 0.127))
(fp_line (start 3.1496 -0.4318) (end 3.2512 -0.4445) (layer F.SilkS) (width 0.127))
(fp_line (start 3.2512 -0.4445) (end 3.35026 -0.4318) (layer F.SilkS) (width 0.127))
(fp_line (start 3.35026 -0.4318) (end 3.44424 -0.39878) (layer F.SilkS) (width 0.127))
(fp_line (start 3.44424 -0.39878) (end 3.52806 -0.3429) (layer F.SilkS) (width 0.127))
(fp_line (start 3.52806 -0.3429) (end 3.59918 -0.27178) (layer F.SilkS) (width 0.127))
(fp_line (start 3.59918 -0.27178) (end 3.64998 -0.18542) (layer F.SilkS) (width 0.127))
(fp_line (start 3.64998 -0.18542) (end 3.683 -0.0889) (layer F.SilkS) (width 0.127))
(fp_line (start 3.683 -0.0889) (end 3.69062 0.00762) (layer F.SilkS) (width 0.127))
(fp_line (start 3.69062 0.00762) (end 3.68046 0.10668) (layer F.SilkS) (width 0.127))
(fp_line (start 3.68046 0.10668) (end 3.64744 0.19812) (layer F.SilkS) (width 0.127))
(fp_line (start 3.64744 0.19812) (end 3.5941 0.28194) (layer F.SilkS) (width 0.127))
(fp_line (start 3.5941 0.28194) (end 3.52298 0.35052) (layer F.SilkS) (width 0.127))
(fp_line (start 3.52298 0.35052) (end 3.43916 0.40132) (layer F.SilkS) (width 0.127))
(fp_line (start 3.43916 0.40132) (end 3.34772 0.43434) (layer F.SilkS) (width 0.127))
(fp_line (start 3.34772 0.43434) (end 3.2512 0.4445) (layer F.SilkS) (width 0.127))
(fp_line (start -3.24866 0.9525) (end -3.43154 0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start -3.43154 0.93472) (end -3.60934 0.88392) (layer F.SilkS) (width 0.127))
(fp_line (start -3.60934 0.88392) (end -3.7719 0.8001) (layer F.SilkS) (width 0.127))
(fp_line (start -3.7719 0.8001) (end -3.91668 0.68326) (layer F.SilkS) (width 0.127))
(fp_line (start -3.91668 0.68326) (end -4.03606 0.54356) (layer F.SilkS) (width 0.127))
(fp_line (start -4.03606 0.54356) (end -4.12496 0.381) (layer F.SilkS) (width 0.127))
(fp_line (start -4.12496 0.381) (end -4.18084 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start -4.18084 0.20574) (end -4.20116 0.02032) (layer F.SilkS) (width 0.127))
(fp_line (start -4.20116 0.02032) (end -4.18846 -0.14224) (layer F.SilkS) (width 0.127))
(fp_line (start -4.18846 -0.14224) (end -4.14782 -0.30734) (layer F.SilkS) (width 0.127))
(fp_line (start -4.14782 -0.30734) (end -4.07924 -0.45974) (layer F.SilkS) (width 0.127))
(fp_line (start -4.07924 -0.45974) (end -3.98526 -0.59944) (layer F.SilkS) (width 0.127))
(fp_line (start -3.98526 -0.59944) (end -3.86588 -0.71882) (layer F.SilkS) (width 0.127))
(fp_line (start -3.86588 -0.71882) (end -3.73126 -0.81534) (layer F.SilkS) (width 0.127))
(fp_line (start -3.73126 -0.81534) (end -3.57886 -0.889) (layer F.SilkS) (width 0.127))
(fp_line (start -3.57886 -0.889) (end -3.4163 -0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start -3.4163 -0.93472) (end -3.2512 -0.9525) (layer F.SilkS) (width 0.127))
(fp_line (start -3.2512 -0.9525) (end -3.08356 -0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start -3.08356 -0.93472) (end -2.921 -0.889) (layer F.SilkS) (width 0.127))
(fp_line (start -2.921 -0.889) (end -2.7686 -0.81534) (layer F.SilkS) (width 0.127))
(fp_line (start -2.7686 -0.81534) (end -2.63398 -0.71628) (layer F.SilkS) (width 0.127))
(fp_line (start -2.63398 -0.71628) (end -2.51714 -0.5969) (layer F.SilkS) (width 0.127))
(fp_line (start -2.51714 -0.5969) (end -2.42316 -0.4572) (layer F.SilkS) (width 0.127))
(fp_line (start -2.42316 -0.4572) (end -2.35204 -0.3048) (layer F.SilkS) (width 0.127))
(fp_line (start -2.35204 -0.3048) (end -2.3114 -0.1397) (layer F.SilkS) (width 0.127))
(fp_line (start -2.3114 -0.1397) (end -2.2987 0.0254) (layer F.SilkS) (width 0.127))
(fp_line (start -2.2987 0.0254) (end -2.31902 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start -2.31902 0.20574) (end -2.3749 0.381) (layer F.SilkS) (width 0.127))
(fp_line (start -2.3749 0.381) (end -2.4638 0.54356) (layer F.SilkS) (width 0.127))
(fp_line (start -2.4638 0.54356) (end -2.58064 0.68326) (layer F.SilkS) (width 0.127))
(fp_line (start -2.58064 0.68326) (end -2.72542 0.8001) (layer F.SilkS) (width 0.127))
(fp_line (start -2.72542 0.8001) (end -2.88798 0.88392) (layer F.SilkS) (width 0.127))
(fp_line (start -2.88798 0.88392) (end -3.06324 0.93472) (layer F.SilkS) (width 0.127))
(fp_line (start -3.06324 0.93472) (end -3.24866 0.9525) (layer F.SilkS) (width 0.127))
(fp_line (start -3.2512 0.4445) (end -3.34772 0.43434) (layer F.SilkS) (width 0.127))
(fp_line (start -3.34772 0.43434) (end -3.43916 0.40386) (layer F.SilkS) (width 0.127))
(fp_line (start -3.43916 0.40386) (end -3.52298 0.3556) (layer F.SilkS) (width 0.127))
(fp_line (start -3.52298 0.3556) (end -3.5941 0.28702) (layer F.SilkS) (width 0.127))
(fp_line (start -3.5941 0.28702) (end -3.64744 0.20574) (layer F.SilkS) (width 0.127))
(fp_line (start -3.64744 0.20574) (end -3.68046 0.1143) (layer F.SilkS) (width 0.127))
(fp_line (start -3.68046 0.1143) (end -3.6957 0.01778) (layer F.SilkS) (width 0.127))
(fp_line (start -3.6957 0.01778) (end -3.68554 -0.08128) (layer F.SilkS) (width 0.127))
(fp_line (start -3.68554 -0.08128) (end -3.65506 -0.1778) (layer F.SilkS) (width 0.127))
(fp_line (start -3.65506 -0.1778) (end -3.60172 -0.26416) (layer F.SilkS) (width 0.127))
(fp_line (start -3.60172 -0.26416) (end -3.5306 -0.34036) (layer F.SilkS) (width 0.127))
(fp_line (start -3.5306 -0.34036) (end -3.44678 -0.39624) (layer F.SilkS) (width 0.127))
(fp_line (start -3.44678 -0.39624) (end -3.35026 -0.4318) (layer F.SilkS) (width 0.127))
(fp_line (start -3.35026 -0.4318) (end -3.2512 -0.4445) (layer F.SilkS) (width 0.127))
(fp_line (start -3.2512 -0.4445) (end -3.1496 -0.4318) (layer F.SilkS) (width 0.127))
(fp_line (start -3.1496 -0.4318) (end -3.05562 -0.39878) (layer F.SilkS) (width 0.127))
(fp_line (start -3.05562 -0.39878) (end -2.9718 -0.3429) (layer F.SilkS) (width 0.127))
(fp_line (start -2.9718 -0.3429) (end -2.90068 -0.27178) (layer F.SilkS) (width 0.127))
(fp_line (start -2.90068 -0.27178) (end -2.84988 -0.18542) (layer F.SilkS) (width 0.127))
(fp_line (start -2.84988 -0.18542) (end -2.81686 -0.0889) (layer F.SilkS) (width 0.127))
(fp_line (start -2.81686 -0.0889) (end -2.80924 0.00762) (layer F.SilkS) (width 0.127))
(fp_line (start -2.80924 0.00762) (end -2.8194 0.10668) (layer F.SilkS) (width 0.127))
(fp_line (start -2.8194 0.10668) (end -2.85242 0.19812) (layer F.SilkS) (width 0.127))
(fp_line (start -2.85242 0.19812) (end -2.90576 0.28194) (layer F.SilkS) (width 0.127))
(fp_line (start -2.90576 0.28194) (end -2.97688 0.35052) (layer F.SilkS) (width 0.127))
(fp_line (start -2.97688 0.35052) (end -3.0607 0.40132) (layer F.SilkS) (width 0.127))
(fp_line (start -3.0607 0.40132) (end -3.15214 0.43434) (layer F.SilkS) (width 0.127))
(fp_line (start -3.15214 0.43434) (end -3.2512 0.4445) (layer F.SilkS) (width 0.127))
(fp_circle (center 0 0) (end 0 -5.89788) (layer F.SilkS) (width 0.2032))
(fp_circle (center 0 0) (end 0 -1.27) (layer Dwgs.User) (width 0.2032))
(fp_text user + (at 3.556 -2.032) (layer Dwgs.User)
(effects (font (size 1.778 1.778) (thickness 0.1524)))
)
(pad + thru_hole circle (at 3.24866 0) (size 1.8796 1.8796) (drill 0.89916) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad - thru_hole circle (at -3.24866 0) (size 1.8796 1.8796) (drill 0.89916) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
)
|
{
"pile_set_name": "Github"
}
|
--------------------------------
cerebro |
--------------------------------
# Github
https://github.com/lmenezes/cerebro
|
{
"pile_set_name": "Github"
}
|
%w(core images resources pages).each do |extension|
require "refinerycms-#{extension}"
end
|
{
"pile_set_name": "Github"
}
|
# frozen_string_literal: true
module Clusters
module Cleanup
class ProjectNamespaceWorker # rubocop:disable Scalability/IdempotentWorker
include ClusterCleanupMethods
def perform(cluster_id, execution_count = 0)
Clusters::Cluster.find_by_id(cluster_id).try do |cluster|
break unless cluster.cleanup_removing_project_namespaces?
break exceeded_execution_limit(cluster) if exceeded_execution_limit?(execution_count)
Clusters::Cleanup::ProjectNamespaceService.new(cluster, execution_count).execute
end
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
using Lib.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityBase;
namespace Behaviours.Views
{
public abstract class Reactor : InjectBehaviour, IReactor
{
public abstract void ActivateDestructionIn(float time);
}
}
|
{
"pile_set_name": "Github"
}
|
package android.hardware.camera2.params;
import android.hardware.camera2.utils.HashCodeHelpers;
public final class RecommendedStreamConfiguration extends StreamConfiguration {
private final int mUsecaseBitmap;
public RecommendedStreamConfiguration(int format, int width, int height, boolean input, int usecaseBitmap) {
super(format, width, height, input);
this.mUsecaseBitmap = usecaseBitmap;
}
public int getUsecaseBitmap() {
return this.mUsecaseBitmap;
}
@Override // android.hardware.camera2.params.StreamConfiguration
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (!(obj instanceof RecommendedStreamConfiguration)) {
return false;
}
RecommendedStreamConfiguration other = (RecommendedStreamConfiguration) obj;
if (this.mFormat == other.mFormat && this.mWidth == other.mWidth && this.mHeight == other.mHeight && this.mUsecaseBitmap == other.mUsecaseBitmap && this.mInput == other.mInput) {
return true;
}
return false;
}
@Override // android.hardware.camera2.params.StreamConfiguration
public int hashCode() {
return HashCodeHelpers.hashCode(this.mFormat, this.mWidth, this.mHeight, this.mInput ? 1 : 0, this.mUsecaseBitmap);
}
}
|
{
"pile_set_name": "Github"
}
|
Casbin
====
[](https://goreportcard.com/report/github.com/casbin/casbin)
[](https://travis-ci.org/casbin/casbin)
[](https://coveralls.io/github/casbin/casbin?branch=master)
[](https://godoc.org/github.com/casbin/casbin)
[](https://github.com/casbin/casbin/releases/latest)
[](https://gitter.im/casbin/lobby)
[](http://www.patreon.com/yangluo)
**News**: still worry about how to write the correct Casbin policy? ``Casbin online editor`` is coming to help! Try it at: http://casbin.org/editor/

Casbin is a powerful and efficient open-source access control library for Golang projects. It provides support for enforcing authorization based on various [access control models](https://en.wikipedia.org/wiki/Computer_security_model).
## All the languages supported by Casbin:
[](https://github.com/casbin/casbin) | [](https://github.com/casbin/jcasbin) | [](https://github.com/casbin/node-casbin) | [](https://github.com/php-casbin/php-casbin)
----|----|----|----
[Casbin](https://github.com/casbin/casbin) | [jCasbin](https://github.com/casbin/jcasbin) | [node-Casbin](https://github.com/casbin/node-casbin) | [PHP-Casbin](https://github.com/php-casbin/php-casbin)
production-ready | production-ready | production-ready | production-ready
[](https://github.com/casbin/pycasbin) | [](https://github.com/casbin4d/Casbin4D) | [](https://github.com/Devolutions/casbin-net) | [](https://github.com/Devolutions/casbin-rs)
----|----|----|----
[PyCasbin](https://github.com/casbin/pycasbin) | [Casbin4D](https://github.com/casbin4d/Casbin4D) | [Casbin-Net](https://github.com/Devolutions/casbin-net) | [Casbin-RS](https://github.com/Devolutions/casbin-rs)
production-ready | experimental | WIP | WIP
## Table of contents
- [Supported models](#supported-models)
- [How it works?](#how-it-works)
- [Features](#features)
- [Installation](#installation)
- [Documentation](#documentation)
- [Online editor](#online-editor)
- [Tutorials](#tutorials)
- [Get started](#get-started)
- [Policy management](#policy-management)
- [Policy persistence](#policy-persistence)
- [Policy consistence between multiple nodes](#policy-consistence-between-multiple-nodes)
- [Role manager](#role-manager)
- [Benchmarks](#benchmarks)
- [Examples](#examples)
- [Middlewares](#middlewares)
- [Our adopters](#our-adopters)
## Supported models
1. [**ACL (Access Control List)**](https://en.wikipedia.org/wiki/Access_control_list)
2. **ACL with [superuser](https://en.wikipedia.org/wiki/Superuser)**
3. **ACL without users**: especially useful for systems that don't have authentication or user log-ins.
3. **ACL without resources**: some scenarios may target for a type of resources instead of an individual resource by using permissions like ``write-article``, ``read-log``. It doesn't control the access to a specific article or log.
4. **[RBAC (Role-Based Access Control)](https://en.wikipedia.org/wiki/Role-based_access_control)**
5. **RBAC with resource roles**: both users and resources can have roles (or groups) at the same time.
6. **RBAC with domains/tenants**: users can have different role sets for different domains/tenants.
7. **[ABAC (Attribute-Based Access Control)](https://en.wikipedia.org/wiki/Attribute-Based_Access_Control)**: syntax sugar like ``resource.Owner`` can be used to get the attribute for a resource.
8. **[RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer)**: supports paths like ``/res/*``, ``/res/:id`` and HTTP methods like ``GET``, ``POST``, ``PUT``, ``DELETE``.
9. **Deny-override**: both allow and deny authorizations are supported, deny overrides the allow.
10. **Priority**: the policy rules can be prioritized like firewall rules.
## How it works?
In Casbin, an access control model is abstracted into a CONF file based on the **PERM metamodel (Policy, Effect, Request, Matchers)**. So switching or upgrading the authorization mechanism for a project is just as simple as modifying a configuration. You can customize your own access control model by combining the available models. For example, you can get RBAC roles and ABAC attributes together inside one model and share one set of policy rules.
The most basic and simplest model in Casbin is ACL. ACL's model CONF is:
```ini
# Request definition
[request_definition]
r = sub, obj, act
# Policy definition
[policy_definition]
p = sub, obj, act
# Policy effect
[policy_effect]
e = some(where (p.eft == allow))
# Matchers
[matchers]
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act
```
An example policy for ACL model is like:
```
p, alice, data1, read
p, bob, data2, write
```
It means:
- alice can read data1
- bob can write data2
We also support multi-line mode by appending '\\' in the end:
```ini
# Matchers
[matchers]
m = r.sub == p.sub && r.obj == p.obj \
&& r.act == p.act
```
Further more, if you are using ABAC, you can try operator `in` like following in Casbin **golang** edition (jCasbin and Node-Casbin are not supported yet):
```ini
# Matchers
[matchers]
m = r.obj == p.obj && r.act == p.act || r.obj in ('data2', 'data3')
```
But you **SHOULD** make sure that the length of the array is **MORE** than **1**, otherwise there will cause it to panic.
For more operators, you may take a look at [govaluate](https://github.com/Knetic/govaluate)
## Features
What Casbin does:
1. enforce the policy in the classic ``{subject, object, action}`` form or a customized form as you defined, both allow and deny authorizations are supported.
2. handle the storage of the access control model and its policy.
3. manage the role-user mappings and role-role mappings (aka role hierarchy in RBAC).
4. support built-in superuser like ``root`` or ``administrator``. A superuser can do anything without explict permissions.
5. multiple built-in operators to support the rule matching. For example, ``keyMatch`` can map a resource key ``/foo/bar`` to the pattern ``/foo*``.
What Casbin does NOT do:
1. authentication (aka verify ``username`` and ``password`` when a user logs in)
2. manage the list of users or roles. I believe it's more convenient for the project itself to manage these entities. Users usually have their passwords, and Casbin is not designed as a password container. However, Casbin stores the user-role mapping for the RBAC scenario.
## Installation
```
go get github.com/casbin/casbin
```
## Documentation
https://casbin.org/docs/en/overview
## Online editor
You can also use the online editor (http://casbin.org/editor/) to write your Casbin model and policy in your web browser. It provides functionality such as ``syntax highlighting`` and ``code completion``, just like an IDE for a programming language.
## Tutorials
https://casbin.org/docs/en/tutorials
## Get started
1. New a Casbin enforcer with a model file and a policy file:
```go
e := casbin.NewEnforcer("path/to/model.conf", "path/to/policy.csv")
```
Note: you can also initialize an enforcer with policy in DB instead of file, see [Persistence](#persistence) section for details.
2. Add an enforcement hook into your code right before the access happens:
```go
sub := "alice" // the user that wants to access a resource.
obj := "data1" // the resource that is going to be accessed.
act := "read" // the operation that the user performs on the resource.
if e.Enforce(sub, obj, act) == true {
// permit alice to read data1
} else {
// deny the request, show an error
}
```
3. Besides the static policy file, Casbin also provides API for permission management at run-time. For example, You can get all the roles assigned to a user as below:
```go
roles := e.GetRoles("alice")
```
See [Policy management APIs](#policy-management) for more usage.
4. Please refer to the ``_test.go`` files for more usage.
## Policy management
Casbin provides two sets of APIs to manage permissions:
- [Management API](https://github.com/casbin/casbin/blob/master/management_api.go): the primitive API that provides full support for Casbin policy management. See [here](https://github.com/casbin/casbin/blob/master/management_api_test.go) for examples.
- [RBAC API](https://github.com/casbin/casbin/blob/master/rbac_api.go): a more friendly API for RBAC. This API is a subset of Management API. The RBAC users could use this API to simplify the code. See [here](https://github.com/casbin/casbin/blob/master/rbac_api_test.go) for examples.
We also provide a web-based UI for model management and policy management:


## Policy persistence
https://casbin.org/docs/en/adapters
## Policy consistence between multiple nodes
https://casbin.org/docs/en/watchers
## Role manager
https://casbin.org/docs/en/role-managers
## Benchmarks
https://casbin.org/docs/en/benchmark
## Examples
Model | Model file | Policy file
----|------|----
ACL | [basic_model.conf](https://github.com/casbin/casbin/blob/master/examples/basic_model.conf) | [basic_policy.csv](https://github.com/casbin/casbin/blob/master/examples/basic_policy.csv)
ACL with superuser | [basic_model_with_root.conf](https://github.com/casbin/casbin/blob/master/examples/basic_with_root_model.conf) | [basic_policy.csv](https://github.com/casbin/casbin/blob/master/examples/basic_policy.csv)
ACL without users | [basic_model_without_users.conf](https://github.com/casbin/casbin/blob/master/examples/basic_without_users_model.conf) | [basic_policy_without_users.csv](https://github.com/casbin/casbin/blob/master/examples/basic_without_users_policy.csv)
ACL without resources | [basic_model_without_resources.conf](https://github.com/casbin/casbin/blob/master/examples/basic_without_resources_model.conf) | [basic_policy_without_resources.csv](https://github.com/casbin/casbin/blob/master/examples/basic_without_resources_policy.csv)
RBAC | [rbac_model.conf](https://github.com/casbin/casbin/blob/master/examples/rbac_model.conf) | [rbac_policy.csv](https://github.com/casbin/casbin/blob/master/examples/rbac_policy.csv)
RBAC with resource roles | [rbac_model_with_resource_roles.conf](https://github.com/casbin/casbin/blob/master/examples/rbac_with_resource_roles_model.conf) | [rbac_policy_with_resource_roles.csv](https://github.com/casbin/casbin/blob/master/examples/rbac_with_resource_roles_policy.csv)
RBAC with domains/tenants | [rbac_model_with_domains.conf](https://github.com/casbin/casbin/blob/master/examples/rbac_with_domains_model.conf) | [rbac_policy_with_domains.csv](https://github.com/casbin/casbin/blob/master/examples/rbac_with_domains_policy.csv)
ABAC | [abac_model.conf](https://github.com/casbin/casbin/blob/master/examples/abac_model.conf) | N/A
RESTful | [keymatch_model.conf](https://github.com/casbin/casbin/blob/master/examples/keymatch_model.conf) | [keymatch_policy.csv](https://github.com/casbin/casbin/blob/master/examples/keymatch_policy.csv)
Deny-override | [rbac_model_with_deny.conf](https://github.com/casbin/casbin/blob/master/examples/rbac_with_deny_model.conf) | [rbac_policy_with_deny.csv](https://github.com/casbin/casbin/blob/master/examples/rbac_with_deny_policy.csv)
Priority | [priority_model.conf](https://github.com/casbin/casbin/blob/master/examples/priority_model.conf) | [priority_policy.csv](https://github.com/casbin/casbin/blob/master/examples/priority_policy.csv)
## Middlewares
Authz middlewares for web frameworks: https://casbin.org/docs/en/middlewares
## Our adopters
https://casbin.org/docs/en/adopters
## License
This project is licensed under the [Apache 2.0 license](LICENSE).
## Contact
If you have any issues or feature requests, please contact us. PR is welcomed.
- https://github.com/casbin/casbin/issues
- hsluoyz@gmail.com
- Tencent QQ group: [546057381](//shang.qq.com/wpa/qunwpa?idkey=8ac8b91fc97ace3d383d0035f7aa06f7d670fd8e8d4837347354a31c18fac885)
|
{
"pile_set_name": "Github"
}
|
## Explanation of Build Files
| | UMD | CommonJS | ES Module |
| --- | --- | --- | --- |
| **Full** | vue.js | vue.common.js | vue.esm.js |
| **Runtime-only** | vue.runtime.js | vue.runtime.common.js | vue.runtime.esm.js |
| **Full (production)** | vue.min.js | | |
| **Runtime-only (production)** | vue.runtime.min.js | | |
### Terms
- **Full**: builds that contains both the compiler and the runtime.
- **Compiler**: code that is responsible for compiling template strings into JavaScript render functions.
- **Runtime**: code that is responsible for creating Vue instances, rendering and patching virtual DOM, etc. Basically everything minus the compiler.
- **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a `<script>` tag. The default file from Unpkg CDN at [https://unpkg.com/vue](https://unpkg.com/vue) is the Runtime + Compiler UMD build (`vue.js`).
- **[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: CommonJS builds are intended for use with older bundlers like [browserify](http://browserify.org/) or [webpack 1](https://webpack.github.io). The default file for these bundlers (`pkg.main`) is the Runtime only CommonJS build (`vue.runtime.common.js`).
- **[ES Module](http://exploringjs.com/es6/ch_modules.html)**: ES module builds are intended for use with modern bundlers like [webpack 2](https://webpack.js.org) or [rollup](http://rollupjs.org/). The default file for these bundlers (`pkg.module`) is the Runtime only ES Module build (`vue.runtime.esm.js`).
### Runtime + Compiler vs. Runtime-only
If you need to compile templates on the fly (e.g. passing a string to the `template` option, or mounting to an element using its in-DOM HTML as the template), you will need the compiler and thus the full build.
When using `vue-loader` or `vueify`, templates inside `*.vue` files are compiled into JavaScript at build time. You don't really need the compiler in the final bundle, and can therefore use the runtime-only build.
Since the runtime-only builds are roughly 30% lighter-weight than their full-build counterparts, you should use it whenever you can. If you wish to use the full build instead, you need to configure an alias in your bundler.
#### Webpack
``` js
module.exports = {
// ...
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
}
}
}
````
#### Rollup
``` js
const alias = require('rollup-plugin-alias')
rollup({
// ...
plugins: [
alias({
'vue': 'vue/dist/vue.esm.js'
})
]
})
```
#### Browserify
Add to your project's `package.json`:
``` js
{
// ...
"browser": {
"vue": "vue/dist/vue.common.js"
}
}
```
### Development vs. Production Mode
Development/production modes are hard-coded for the UMD builds: the un-minified files are for development, and the minified files are for production.
CommonJS and ES Module builds are intended for bundlers, therefore we don't provide minified versions for them. You will be responsible for minifying the final bundle yourself.
CommonJS and ES Module builds also preserve raw checks for `process.env.NODE_ENV` to determine the mode they should run in. You should use appropriate bundler configurations to replace these environment variables in order to control which mode Vue will run in. Replacing `process.env.NODE_ENV` with string literals also allows minifiers like UglifyJS to completely drop the development-only code blocks, reducing final file size.
#### Webpack
Use Webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
``` js
var webpack = require('webpack')
module.exports = {
// ...
plugins: [
// ...
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
]
}
```
#### Rollup
Use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace):
``` js
const replace = require('rollup-plugin-replace')
rollup({
// ...
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
}).then(...)
```
#### Browserify
Apply a global [envify](https://github.com/hughsk/envify) transform to your bundle.
``` bash
NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
```
|
{
"pile_set_name": "Github"
}
|
package com.jthink.skyeye.alarm.configuration.wechat;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Copyright (C), 2016, 银联智惠信息服务(上海)有限公司
*
* @author qianjc
* @version 0.0.1
* @desc
* @date 2016-09-29 17:40:53
*/
@ConfigurationProperties(prefix = "spring.alert.wechat")
public class WechatProperties {
private String url;
private boolean switchFlag;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public boolean isSwitchFlag() {
return switchFlag;
}
public void setSwitchFlag(boolean switchFlag) {
this.switchFlag = switchFlag;
}
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash -e
# Copyright 2017 Google LLC. 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.
tag="us.gcr.io/trillian-test/galera:experimental"
usage=$(cat <<EOF
Usage: $(basename $0) [-t tag]
Builds and pushes the image in this directory to a container repository.
By default, the image will be tagged with ${tag} and
pushed to the Google Cloud container repository.
EOF
)
while getopts "ht:" opt; do
case $opt in
h)
echo "$usage"; exit 0
;;
t)
tag=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >/dev/stderr; exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >/dev/stderr; exit 1
;;
esac
done
gcloud auth configure-docker
docker build -t ${tag} .
docker push ${tag}
|
{
"pile_set_name": "Github"
}
|
- title: Getting Started
items:
- text: Introduction
url: /getting-started/introduction
- text: Five-minute quickstart
url: /getting-started/quickstart
- text: Adding your API
url: /getting-started/adding-your-api
- text: Enabling Plugins
url: /getting-started/enabling-plugins
- text: Adding Consumers
url: /getting-started/adding-consumers
- text: Licensing
url: /getting-started/licensing
- text: Accessing Your License
url: /getting-started/accessing-your-license
- title: Installation
items:
- text: Docker
url: /installation/docker
- text: CentOS
url: /installation/centos
- text: Amazon Linux
url: /installation/amazon-linux
- text: Ubuntu
url: /installation/ubuntu
- title: APIs and Plugins
items:
- text: Canary Release
url: /plugins/canary-release
- text: Rate Limiting Advanced
url: /plugins/rate-limiting
- text: Request Transformer Advanced
url: /plugins/request-transformer
- text: OAuth2 Introspection
url: /plugins/oauth2-introspection
- text: OpenID Connect Plugin
url: /plugins/openid-connect
- text: HTTP Proxy Caching
url: /plugins/http-proxy-caching
- text: Forward Proxy
url: /plugins/forward-proxy
- text: RBAC API
url: /plugins/rbac-api
- title: Kong Developer Portal
items:
- text: Introduction
url: /developer-portal/introduction
- text: Getting Started
url: /developer-portal/getting-started
- text: Understanding
url: /developer-portal/understanding
- text: Customization
url: /developer-portal/customization
- text: Authentication
url: /developer-portal/authentication
- text: FAQ
url: /developer-portal/faq
- text: Known Limitations
url: /developer-portal/known-limitations
- title: Guides & References
items:
- text: Kong Enterprise Changelog
url: /enterprise/changelog
absolute_url: true
- text: Architecture Overview
url: /kong-architecture-overview
- text: Architecture Patterns
url: /kong-architecture-patterns
- text: Implementation Checklist
url: /kong-implementation-checklist
- text: Accessing Admin GUI
url: /admin-gui
- text: Kong Vitals
url: /vitals
- text: Rate Limiting Library
url: /rate-limiting
- text: Setting Up Admin API RBAC
url: /setting-up-admin-api-rbac
- text: Kong Enterprise Edition Versioning
url: /edition-versioning
- text: Multiple Authentication Methods
url: /allowing-multiple-authentication-methods
- text: PostgreSQL on RedHat
url: /postgresql-redhat
- text: OpenID Connect with Google
url: /oidc-google
- text: OpenID Connect with Auth0
url: /oidc-auth0
|
{
"pile_set_name": "Github"
}
|
/*******************************
Transition
*******************************/
@transitionDefaultEasing: @defaultEasing;
@transitionDefaultFill: both;
@transitionDefaultDuration: 300ms;
@use3DAcceleration: translateZ(0);
@backfaceVisibility: hidden;
|
{
"pile_set_name": "Github"
}
|
; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
section .text code align=64
EXTERN OPENSSL_ia32cap_P
global bn_mul_mont_gather5
ALIGN 64
bn_mul_mont_gather5:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_mul_mont_gather5:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
mov r9d,r9d
mov rax,rsp
test r9d,7
jnz NEAR $L$mul_enter
lea r11,[OPENSSL_ia32cap_P]
mov r11d,DWORD[8+r11]
jmp NEAR $L$mul4x_enter
ALIGN 16
$L$mul_enter:
movd xmm5,DWORD[56+rsp]
push rbx
push rbp
push r12
push r13
push r14
push r15
neg r9
mov r11,rsp
lea r10,[((-280))+r9*8+rsp]
neg r9
and r10,-1024
sub r11,r10
and r11,-4096
lea rsp,[r11*1+r10]
mov r11,QWORD[rsp]
cmp rsp,r10
ja NEAR $L$mul_page_walk
jmp NEAR $L$mul_page_walk_done
$L$mul_page_walk:
lea rsp,[((-4096))+rsp]
mov r11,QWORD[rsp]
cmp rsp,r10
ja NEAR $L$mul_page_walk
$L$mul_page_walk_done:
lea r10,[$L$inc]
mov QWORD[8+r9*8+rsp],rax
$L$mul_body:
lea r12,[128+rdx]
movdqa xmm0,XMMWORD[r10]
movdqa xmm1,XMMWORD[16+r10]
lea r10,[((24-112))+r9*8+rsp]
and r10,-16
pshufd xmm5,xmm5,0
movdqa xmm4,xmm1
movdqa xmm2,xmm1
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
DB 0x67
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[112+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[128+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[144+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[160+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[176+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[192+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[208+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[224+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[240+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[256+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[272+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[288+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[304+r10],xmm0
paddd xmm3,xmm2
DB 0x67
pcmpeqd xmm2,xmm5
movdqa XMMWORD[320+r10],xmm1
pcmpeqd xmm3,xmm5
movdqa XMMWORD[336+r10],xmm2
pand xmm0,XMMWORD[64+r12]
pand xmm1,XMMWORD[80+r12]
pand xmm2,XMMWORD[96+r12]
movdqa XMMWORD[352+r10],xmm3
pand xmm3,XMMWORD[112+r12]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-128))+r12]
movdqa xmm5,XMMWORD[((-112))+r12]
movdqa xmm2,XMMWORD[((-96))+r12]
pand xmm4,XMMWORD[112+r10]
movdqa xmm3,XMMWORD[((-80))+r12]
pand xmm5,XMMWORD[128+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[144+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[160+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-64))+r12]
movdqa xmm5,XMMWORD[((-48))+r12]
movdqa xmm2,XMMWORD[((-32))+r12]
pand xmm4,XMMWORD[176+r10]
movdqa xmm3,XMMWORD[((-16))+r12]
pand xmm5,XMMWORD[192+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[208+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[224+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[r12]
movdqa xmm5,XMMWORD[16+r12]
movdqa xmm2,XMMWORD[32+r12]
pand xmm4,XMMWORD[240+r10]
movdqa xmm3,XMMWORD[48+r12]
pand xmm5,XMMWORD[256+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[272+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[288+r10]
por xmm0,xmm2
por xmm1,xmm3
por xmm0,xmm1
pshufd xmm1,xmm0,0x4e
por xmm0,xmm1
lea r12,[256+r12]
DB 102,72,15,126,195
mov r8,QWORD[r8]
mov rax,QWORD[rsi]
xor r14,r14
xor r15,r15
mov rbp,r8
mul rbx
mov r10,rax
mov rax,QWORD[rcx]
imul rbp,r10
mov r11,rdx
mul rbp
add r10,rax
mov rax,QWORD[8+rsi]
adc rdx,0
mov r13,rdx
lea r15,[1+r15]
jmp NEAR $L$1st_enter
ALIGN 16
$L$1st:
add r13,rax
mov rax,QWORD[r15*8+rsi]
adc rdx,0
add r13,r11
mov r11,r10
adc rdx,0
mov QWORD[((-16))+r15*8+rsp],r13
mov r13,rdx
$L$1st_enter:
mul rbx
add r11,rax
mov rax,QWORD[r15*8+rcx]
adc rdx,0
lea r15,[1+r15]
mov r10,rdx
mul rbp
cmp r15,r9
jne NEAR $L$1st
add r13,rax
adc rdx,0
add r13,r11
adc rdx,0
mov QWORD[((-16))+r9*8+rsp],r13
mov r13,rdx
mov r11,r10
xor rdx,rdx
add r13,r11
adc rdx,0
mov QWORD[((-8))+r9*8+rsp],r13
mov QWORD[r9*8+rsp],rdx
lea r14,[1+r14]
jmp NEAR $L$outer
ALIGN 16
$L$outer:
lea rdx,[((24+128))+r9*8+rsp]
and rdx,-16
pxor xmm4,xmm4
pxor xmm5,xmm5
movdqa xmm0,XMMWORD[((-128))+r12]
movdqa xmm1,XMMWORD[((-112))+r12]
movdqa xmm2,XMMWORD[((-96))+r12]
movdqa xmm3,XMMWORD[((-80))+r12]
pand xmm0,XMMWORD[((-128))+rdx]
pand xmm1,XMMWORD[((-112))+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[((-96))+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[((-80))+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[((-64))+r12]
movdqa xmm1,XMMWORD[((-48))+r12]
movdqa xmm2,XMMWORD[((-32))+r12]
movdqa xmm3,XMMWORD[((-16))+r12]
pand xmm0,XMMWORD[((-64))+rdx]
pand xmm1,XMMWORD[((-48))+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[((-32))+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[((-16))+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[r12]
movdqa xmm1,XMMWORD[16+r12]
movdqa xmm2,XMMWORD[32+r12]
movdqa xmm3,XMMWORD[48+r12]
pand xmm0,XMMWORD[rdx]
pand xmm1,XMMWORD[16+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[32+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[48+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[64+r12]
movdqa xmm1,XMMWORD[80+r12]
movdqa xmm2,XMMWORD[96+r12]
movdqa xmm3,XMMWORD[112+r12]
pand xmm0,XMMWORD[64+rdx]
pand xmm1,XMMWORD[80+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[96+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[112+rdx]
por xmm4,xmm2
por xmm5,xmm3
por xmm4,xmm5
pshufd xmm0,xmm4,0x4e
por xmm0,xmm4
lea r12,[256+r12]
mov rax,QWORD[rsi]
DB 102,72,15,126,195
xor r15,r15
mov rbp,r8
mov r10,QWORD[rsp]
mul rbx
add r10,rax
mov rax,QWORD[rcx]
adc rdx,0
imul rbp,r10
mov r11,rdx
mul rbp
add r10,rax
mov rax,QWORD[8+rsi]
adc rdx,0
mov r10,QWORD[8+rsp]
mov r13,rdx
lea r15,[1+r15]
jmp NEAR $L$inner_enter
ALIGN 16
$L$inner:
add r13,rax
mov rax,QWORD[r15*8+rsi]
adc rdx,0
add r13,r10
mov r10,QWORD[r15*8+rsp]
adc rdx,0
mov QWORD[((-16))+r15*8+rsp],r13
mov r13,rdx
$L$inner_enter:
mul rbx
add r11,rax
mov rax,QWORD[r15*8+rcx]
adc rdx,0
add r10,r11
mov r11,rdx
adc r11,0
lea r15,[1+r15]
mul rbp
cmp r15,r9
jne NEAR $L$inner
add r13,rax
adc rdx,0
add r13,r10
mov r10,QWORD[r9*8+rsp]
adc rdx,0
mov QWORD[((-16))+r9*8+rsp],r13
mov r13,rdx
xor rdx,rdx
add r13,r11
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-8))+r9*8+rsp],r13
mov QWORD[r9*8+rsp],rdx
lea r14,[1+r14]
cmp r14,r9
jb NEAR $L$outer
xor r14,r14
mov rax,QWORD[rsp]
lea rsi,[rsp]
mov r15,r9
jmp NEAR $L$sub
ALIGN 16
$L$sub: sbb rax,QWORD[r14*8+rcx]
mov QWORD[r14*8+rdi],rax
mov rax,QWORD[8+r14*8+rsi]
lea r14,[1+r14]
dec r15
jnz NEAR $L$sub
sbb rax,0
mov rbx,-1
xor rbx,rax
xor r14,r14
mov r15,r9
$L$copy:
mov rcx,QWORD[r14*8+rdi]
mov rdx,QWORD[r14*8+rsp]
and rcx,rbx
and rdx,rax
mov QWORD[r14*8+rsp],r14
or rdx,rcx
mov QWORD[r14*8+rdi],rdx
lea r14,[1+r14]
sub r15,1
jnz NEAR $L$copy
mov rsi,QWORD[8+r9*8+rsp]
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$mul_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_mul_mont_gather5:
ALIGN 32
bn_mul4x_mont_gather5:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_mul4x_mont_gather5:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
DB 0x67
mov rax,rsp
$L$mul4x_enter:
and r11d,0x80108
cmp r11d,0x80108
je NEAR $L$mulx4x_enter
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$mul4x_prologue:
DB 0x67
shl r9d,3
lea r10,[r9*2+r9]
neg r9
lea r11,[((-320))+r9*2+rsp]
mov rbp,rsp
sub r11,rdi
and r11,4095
cmp r10,r11
jb NEAR $L$mul4xsp_alt
sub rbp,r11
lea rbp,[((-320))+r9*2+rbp]
jmp NEAR $L$mul4xsp_done
ALIGN 32
$L$mul4xsp_alt:
lea r10,[((4096-320))+r9*2]
lea rbp,[((-320))+r9*2+rbp]
sub r11,r10
mov r10,0
cmovc r11,r10
sub rbp,r11
$L$mul4xsp_done:
and rbp,-64
mov r11,rsp
sub r11,rbp
and r11,-4096
lea rsp,[rbp*1+r11]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$mul4x_page_walk
jmp NEAR $L$mul4x_page_walk_done
$L$mul4x_page_walk:
lea rsp,[((-4096))+rsp]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$mul4x_page_walk
$L$mul4x_page_walk_done:
neg r9
mov QWORD[40+rsp],rax
$L$mul4x_body:
call mul4x_internal
mov rsi,QWORD[40+rsp]
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$mul4x_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_mul4x_mont_gather5:
ALIGN 32
mul4x_internal:
shl r9,5
movd xmm5,DWORD[56+rax]
lea rax,[$L$inc]
lea r13,[128+r9*1+rdx]
shr r9,5
movdqa xmm0,XMMWORD[rax]
movdqa xmm1,XMMWORD[16+rax]
lea r10,[((88-112))+r9*1+rsp]
lea r12,[128+rdx]
pshufd xmm5,xmm5,0
movdqa xmm4,xmm1
DB 0x67,0x67
movdqa xmm2,xmm1
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
DB 0x67
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[112+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[128+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[144+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[160+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[176+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[192+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[208+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[224+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[240+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[256+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[272+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[288+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[304+r10],xmm0
paddd xmm3,xmm2
DB 0x67
pcmpeqd xmm2,xmm5
movdqa XMMWORD[320+r10],xmm1
pcmpeqd xmm3,xmm5
movdqa XMMWORD[336+r10],xmm2
pand xmm0,XMMWORD[64+r12]
pand xmm1,XMMWORD[80+r12]
pand xmm2,XMMWORD[96+r12]
movdqa XMMWORD[352+r10],xmm3
pand xmm3,XMMWORD[112+r12]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-128))+r12]
movdqa xmm5,XMMWORD[((-112))+r12]
movdqa xmm2,XMMWORD[((-96))+r12]
pand xmm4,XMMWORD[112+r10]
movdqa xmm3,XMMWORD[((-80))+r12]
pand xmm5,XMMWORD[128+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[144+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[160+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-64))+r12]
movdqa xmm5,XMMWORD[((-48))+r12]
movdqa xmm2,XMMWORD[((-32))+r12]
pand xmm4,XMMWORD[176+r10]
movdqa xmm3,XMMWORD[((-16))+r12]
pand xmm5,XMMWORD[192+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[208+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[224+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[r12]
movdqa xmm5,XMMWORD[16+r12]
movdqa xmm2,XMMWORD[32+r12]
pand xmm4,XMMWORD[240+r10]
movdqa xmm3,XMMWORD[48+r12]
pand xmm5,XMMWORD[256+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[272+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[288+r10]
por xmm0,xmm2
por xmm1,xmm3
por xmm0,xmm1
pshufd xmm1,xmm0,0x4e
por xmm0,xmm1
lea r12,[256+r12]
DB 102,72,15,126,195
mov QWORD[((16+8))+rsp],r13
mov QWORD[((56+8))+rsp],rdi
mov r8,QWORD[r8]
mov rax,QWORD[rsi]
lea rsi,[r9*1+rsi]
neg r9
mov rbp,r8
mul rbx
mov r10,rax
mov rax,QWORD[rcx]
imul rbp,r10
lea r14,[((64+8))+rsp]
mov r11,rdx
mul rbp
add r10,rax
mov rax,QWORD[8+r9*1+rsi]
adc rdx,0
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[8+rcx]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[16+r9*1+rsi]
adc rdx,0
add rdi,r11
lea r15,[32+r9]
lea rcx,[32+rcx]
adc rdx,0
mov QWORD[r14],rdi
mov r13,rdx
jmp NEAR $L$1st4x
ALIGN 32
$L$1st4x:
mul rbx
add r10,rax
mov rax,QWORD[((-16))+rcx]
lea r14,[32+r14]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[((-8))+r15*1+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-24))+r14],r13
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[((-8))+rcx]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[r15*1+rsi]
adc rdx,0
add rdi,r11
adc rdx,0
mov QWORD[((-16))+r14],rdi
mov r13,rdx
mul rbx
add r10,rax
mov rax,QWORD[rcx]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[8+r15*1+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-8))+r14],r13
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[8+rcx]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[16+r15*1+rsi]
adc rdx,0
add rdi,r11
lea rcx,[32+rcx]
adc rdx,0
mov QWORD[r14],rdi
mov r13,rdx
add r15,32
jnz NEAR $L$1st4x
mul rbx
add r10,rax
mov rax,QWORD[((-16))+rcx]
lea r14,[32+r14]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[((-8))+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-24))+r14],r13
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[((-8))+rcx]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[r9*1+rsi]
adc rdx,0
add rdi,r11
adc rdx,0
mov QWORD[((-16))+r14],rdi
mov r13,rdx
lea rcx,[r9*1+rcx]
xor rdi,rdi
add r13,r10
adc rdi,0
mov QWORD[((-8))+r14],r13
jmp NEAR $L$outer4x
ALIGN 32
$L$outer4x:
lea rdx,[((16+128))+r14]
pxor xmm4,xmm4
pxor xmm5,xmm5
movdqa xmm0,XMMWORD[((-128))+r12]
movdqa xmm1,XMMWORD[((-112))+r12]
movdqa xmm2,XMMWORD[((-96))+r12]
movdqa xmm3,XMMWORD[((-80))+r12]
pand xmm0,XMMWORD[((-128))+rdx]
pand xmm1,XMMWORD[((-112))+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[((-96))+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[((-80))+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[((-64))+r12]
movdqa xmm1,XMMWORD[((-48))+r12]
movdqa xmm2,XMMWORD[((-32))+r12]
movdqa xmm3,XMMWORD[((-16))+r12]
pand xmm0,XMMWORD[((-64))+rdx]
pand xmm1,XMMWORD[((-48))+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[((-32))+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[((-16))+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[r12]
movdqa xmm1,XMMWORD[16+r12]
movdqa xmm2,XMMWORD[32+r12]
movdqa xmm3,XMMWORD[48+r12]
pand xmm0,XMMWORD[rdx]
pand xmm1,XMMWORD[16+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[32+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[48+rdx]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[64+r12]
movdqa xmm1,XMMWORD[80+r12]
movdqa xmm2,XMMWORD[96+r12]
movdqa xmm3,XMMWORD[112+r12]
pand xmm0,XMMWORD[64+rdx]
pand xmm1,XMMWORD[80+rdx]
por xmm4,xmm0
pand xmm2,XMMWORD[96+rdx]
por xmm5,xmm1
pand xmm3,XMMWORD[112+rdx]
por xmm4,xmm2
por xmm5,xmm3
por xmm4,xmm5
pshufd xmm0,xmm4,0x4e
por xmm0,xmm4
lea r12,[256+r12]
DB 102,72,15,126,195
mov r10,QWORD[r9*1+r14]
mov rbp,r8
mul rbx
add r10,rax
mov rax,QWORD[rcx]
adc rdx,0
imul rbp,r10
mov r11,rdx
mov QWORD[r14],rdi
lea r14,[r9*1+r14]
mul rbp
add r10,rax
mov rax,QWORD[8+r9*1+rsi]
adc rdx,0
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[8+rcx]
adc rdx,0
add r11,QWORD[8+r14]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[16+r9*1+rsi]
adc rdx,0
add rdi,r11
lea r15,[32+r9]
lea rcx,[32+rcx]
adc rdx,0
mov r13,rdx
jmp NEAR $L$inner4x
ALIGN 32
$L$inner4x:
mul rbx
add r10,rax
mov rax,QWORD[((-16))+rcx]
adc rdx,0
add r10,QWORD[16+r14]
lea r14,[32+r14]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[((-8))+r15*1+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-32))+r14],rdi
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[((-8))+rcx]
adc rdx,0
add r11,QWORD[((-8))+r14]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[r15*1+rsi]
adc rdx,0
add rdi,r11
adc rdx,0
mov QWORD[((-24))+r14],r13
mov r13,rdx
mul rbx
add r10,rax
mov rax,QWORD[rcx]
adc rdx,0
add r10,QWORD[r14]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[8+r15*1+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-16))+r14],rdi
mov rdi,rdx
mul rbx
add r11,rax
mov rax,QWORD[8+rcx]
adc rdx,0
add r11,QWORD[8+r14]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[16+r15*1+rsi]
adc rdx,0
add rdi,r11
lea rcx,[32+rcx]
adc rdx,0
mov QWORD[((-8))+r14],r13
mov r13,rdx
add r15,32
jnz NEAR $L$inner4x
mul rbx
add r10,rax
mov rax,QWORD[((-16))+rcx]
adc rdx,0
add r10,QWORD[16+r14]
lea r14,[32+r14]
adc rdx,0
mov r11,rdx
mul rbp
add r13,rax
mov rax,QWORD[((-8))+rsi]
adc rdx,0
add r13,r10
adc rdx,0
mov QWORD[((-32))+r14],rdi
mov rdi,rdx
mul rbx
add r11,rax
mov rax,rbp
mov rbp,QWORD[((-8))+rcx]
adc rdx,0
add r11,QWORD[((-8))+r14]
adc rdx,0
mov r10,rdx
mul rbp
add rdi,rax
mov rax,QWORD[r9*1+rsi]
adc rdx,0
add rdi,r11
adc rdx,0
mov QWORD[((-24))+r14],r13
mov r13,rdx
mov QWORD[((-16))+r14],rdi
lea rcx,[r9*1+rcx]
xor rdi,rdi
add r13,r10
adc rdi,0
add r13,QWORD[r14]
adc rdi,0
mov QWORD[((-8))+r14],r13
cmp r12,QWORD[((16+8))+rsp]
jb NEAR $L$outer4x
xor rax,rax
sub rbp,r13
adc r15,r15
or rdi,r15
sub rax,rdi
lea rbx,[r9*1+r14]
mov r12,QWORD[rcx]
lea rbp,[rcx]
mov rcx,r9
sar rcx,3+2
mov rdi,QWORD[((56+8))+rsp]
dec r12
xor r10,r10
mov r13,QWORD[8+rbp]
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
jmp NEAR $L$sqr4x_sub_entry
global bn_power5
ALIGN 32
bn_power5:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_power5:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
mov rax,rsp
lea r11,[OPENSSL_ia32cap_P]
mov r11d,DWORD[8+r11]
and r11d,0x80108
cmp r11d,0x80108
je NEAR $L$powerx5_enter
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$power5_prologue:
shl r9d,3
lea r10d,[r9*2+r9]
neg r9
mov r8,QWORD[r8]
lea r11,[((-320))+r9*2+rsp]
mov rbp,rsp
sub r11,rdi
and r11,4095
cmp r10,r11
jb NEAR $L$pwr_sp_alt
sub rbp,r11
lea rbp,[((-320))+r9*2+rbp]
jmp NEAR $L$pwr_sp_done
ALIGN 32
$L$pwr_sp_alt:
lea r10,[((4096-320))+r9*2]
lea rbp,[((-320))+r9*2+rbp]
sub r11,r10
mov r10,0
cmovc r11,r10
sub rbp,r11
$L$pwr_sp_done:
and rbp,-64
mov r11,rsp
sub r11,rbp
and r11,-4096
lea rsp,[rbp*1+r11]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$pwr_page_walk
jmp NEAR $L$pwr_page_walk_done
$L$pwr_page_walk:
lea rsp,[((-4096))+rsp]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$pwr_page_walk
$L$pwr_page_walk_done:
mov r10,r9
neg r9
mov QWORD[32+rsp],r8
mov QWORD[40+rsp],rax
$L$power5_body:
DB 102,72,15,110,207
DB 102,72,15,110,209
DB 102,73,15,110,218
DB 102,72,15,110,226
call __bn_sqr8x_internal
call __bn_post4x_internal
call __bn_sqr8x_internal
call __bn_post4x_internal
call __bn_sqr8x_internal
call __bn_post4x_internal
call __bn_sqr8x_internal
call __bn_post4x_internal
call __bn_sqr8x_internal
call __bn_post4x_internal
DB 102,72,15,126,209
DB 102,72,15,126,226
mov rdi,rsi
mov rax,QWORD[40+rsp]
lea r8,[32+rsp]
call mul4x_internal
mov rsi,QWORD[40+rsp]
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$power5_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_power5:
global bn_sqr8x_internal
ALIGN 32
bn_sqr8x_internal:
__bn_sqr8x_internal:
lea rbp,[32+r10]
lea rsi,[r9*1+rsi]
mov rcx,r9
mov r14,QWORD[((-32))+rbp*1+rsi]
lea rdi,[((48+8))+r9*2+rsp]
mov rax,QWORD[((-24))+rbp*1+rsi]
lea rdi,[((-32))+rbp*1+rdi]
mov rbx,QWORD[((-16))+rbp*1+rsi]
mov r15,rax
mul r14
mov r10,rax
mov rax,rbx
mov r11,rdx
mov QWORD[((-24))+rbp*1+rdi],r10
mul r14
add r11,rax
mov rax,rbx
adc rdx,0
mov QWORD[((-16))+rbp*1+rdi],r11
mov r10,rdx
mov rbx,QWORD[((-8))+rbp*1+rsi]
mul r15
mov r12,rax
mov rax,rbx
mov r13,rdx
lea rcx,[rbp]
mul r14
add r10,rax
mov rax,rbx
mov r11,rdx
adc r11,0
add r10,r12
adc r11,0
mov QWORD[((-8))+rcx*1+rdi],r10
jmp NEAR $L$sqr4x_1st
ALIGN 32
$L$sqr4x_1st:
mov rbx,QWORD[rcx*1+rsi]
mul r15
add r13,rax
mov rax,rbx
mov r12,rdx
adc r12,0
mul r14
add r11,rax
mov rax,rbx
mov rbx,QWORD[8+rcx*1+rsi]
mov r10,rdx
adc r10,0
add r11,r13
adc r10,0
mul r15
add r12,rax
mov rax,rbx
mov QWORD[rcx*1+rdi],r11
mov r13,rdx
adc r13,0
mul r14
add r10,rax
mov rax,rbx
mov rbx,QWORD[16+rcx*1+rsi]
mov r11,rdx
adc r11,0
add r10,r12
adc r11,0
mul r15
add r13,rax
mov rax,rbx
mov QWORD[8+rcx*1+rdi],r10
mov r12,rdx
adc r12,0
mul r14
add r11,rax
mov rax,rbx
mov rbx,QWORD[24+rcx*1+rsi]
mov r10,rdx
adc r10,0
add r11,r13
adc r10,0
mul r15
add r12,rax
mov rax,rbx
mov QWORD[16+rcx*1+rdi],r11
mov r13,rdx
adc r13,0
lea rcx,[32+rcx]
mul r14
add r10,rax
mov rax,rbx
mov r11,rdx
adc r11,0
add r10,r12
adc r11,0
mov QWORD[((-8))+rcx*1+rdi],r10
cmp rcx,0
jne NEAR $L$sqr4x_1st
mul r15
add r13,rax
lea rbp,[16+rbp]
adc rdx,0
add r13,r11
adc rdx,0
mov QWORD[rdi],r13
mov r12,rdx
mov QWORD[8+rdi],rdx
jmp NEAR $L$sqr4x_outer
ALIGN 32
$L$sqr4x_outer:
mov r14,QWORD[((-32))+rbp*1+rsi]
lea rdi,[((48+8))+r9*2+rsp]
mov rax,QWORD[((-24))+rbp*1+rsi]
lea rdi,[((-32))+rbp*1+rdi]
mov rbx,QWORD[((-16))+rbp*1+rsi]
mov r15,rax
mul r14
mov r10,QWORD[((-24))+rbp*1+rdi]
add r10,rax
mov rax,rbx
adc rdx,0
mov QWORD[((-24))+rbp*1+rdi],r10
mov r11,rdx
mul r14
add r11,rax
mov rax,rbx
adc rdx,0
add r11,QWORD[((-16))+rbp*1+rdi]
mov r10,rdx
adc r10,0
mov QWORD[((-16))+rbp*1+rdi],r11
xor r12,r12
mov rbx,QWORD[((-8))+rbp*1+rsi]
mul r15
add r12,rax
mov rax,rbx
adc rdx,0
add r12,QWORD[((-8))+rbp*1+rdi]
mov r13,rdx
adc r13,0
mul r14
add r10,rax
mov rax,rbx
adc rdx,0
add r10,r12
mov r11,rdx
adc r11,0
mov QWORD[((-8))+rbp*1+rdi],r10
lea rcx,[rbp]
jmp NEAR $L$sqr4x_inner
ALIGN 32
$L$sqr4x_inner:
mov rbx,QWORD[rcx*1+rsi]
mul r15
add r13,rax
mov rax,rbx
mov r12,rdx
adc r12,0
add r13,QWORD[rcx*1+rdi]
adc r12,0
DB 0x67
mul r14
add r11,rax
mov rax,rbx
mov rbx,QWORD[8+rcx*1+rsi]
mov r10,rdx
adc r10,0
add r11,r13
adc r10,0
mul r15
add r12,rax
mov QWORD[rcx*1+rdi],r11
mov rax,rbx
mov r13,rdx
adc r13,0
add r12,QWORD[8+rcx*1+rdi]
lea rcx,[16+rcx]
adc r13,0
mul r14
add r10,rax
mov rax,rbx
adc rdx,0
add r10,r12
mov r11,rdx
adc r11,0
mov QWORD[((-8))+rcx*1+rdi],r10
cmp rcx,0
jne NEAR $L$sqr4x_inner
DB 0x67
mul r15
add r13,rax
adc rdx,0
add r13,r11
adc rdx,0
mov QWORD[rdi],r13
mov r12,rdx
mov QWORD[8+rdi],rdx
add rbp,16
jnz NEAR $L$sqr4x_outer
mov r14,QWORD[((-32))+rsi]
lea rdi,[((48+8))+r9*2+rsp]
mov rax,QWORD[((-24))+rsi]
lea rdi,[((-32))+rbp*1+rdi]
mov rbx,QWORD[((-16))+rsi]
mov r15,rax
mul r14
add r10,rax
mov rax,rbx
mov r11,rdx
adc r11,0
mul r14
add r11,rax
mov rax,rbx
mov QWORD[((-24))+rdi],r10
mov r10,rdx
adc r10,0
add r11,r13
mov rbx,QWORD[((-8))+rsi]
adc r10,0
mul r15
add r12,rax
mov rax,rbx
mov QWORD[((-16))+rdi],r11
mov r13,rdx
adc r13,0
mul r14
add r10,rax
mov rax,rbx
mov r11,rdx
adc r11,0
add r10,r12
adc r11,0
mov QWORD[((-8))+rdi],r10
mul r15
add r13,rax
mov rax,QWORD[((-16))+rsi]
adc rdx,0
add r13,r11
adc rdx,0
mov QWORD[rdi],r13
mov r12,rdx
mov QWORD[8+rdi],rdx
mul rbx
add rbp,16
xor r14,r14
sub rbp,r9
xor r15,r15
add rax,r12
adc rdx,0
mov QWORD[8+rdi],rax
mov QWORD[16+rdi],rdx
mov QWORD[24+rdi],r15
mov rax,QWORD[((-16))+rbp*1+rsi]
lea rdi,[((48+8))+rsp]
xor r10,r10
mov r11,QWORD[8+rdi]
lea r12,[r10*2+r14]
shr r10,63
lea r13,[r11*2+rcx]
shr r11,63
or r13,r10
mov r10,QWORD[16+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[24+rdi]
adc r12,rax
mov rax,QWORD[((-8))+rbp*1+rsi]
mov QWORD[rdi],r12
adc r13,rdx
lea rbx,[r10*2+r14]
mov QWORD[8+rdi],r13
sbb r15,r15
shr r10,63
lea r8,[r11*2+rcx]
shr r11,63
or r8,r10
mov r10,QWORD[32+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[40+rdi]
adc rbx,rax
mov rax,QWORD[rbp*1+rsi]
mov QWORD[16+rdi],rbx
adc r8,rdx
lea rbp,[16+rbp]
mov QWORD[24+rdi],r8
sbb r15,r15
lea rdi,[64+rdi]
jmp NEAR $L$sqr4x_shift_n_add
ALIGN 32
$L$sqr4x_shift_n_add:
lea r12,[r10*2+r14]
shr r10,63
lea r13,[r11*2+rcx]
shr r11,63
or r13,r10
mov r10,QWORD[((-16))+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[((-8))+rdi]
adc r12,rax
mov rax,QWORD[((-8))+rbp*1+rsi]
mov QWORD[((-32))+rdi],r12
adc r13,rdx
lea rbx,[r10*2+r14]
mov QWORD[((-24))+rdi],r13
sbb r15,r15
shr r10,63
lea r8,[r11*2+rcx]
shr r11,63
or r8,r10
mov r10,QWORD[rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[8+rdi]
adc rbx,rax
mov rax,QWORD[rbp*1+rsi]
mov QWORD[((-16))+rdi],rbx
adc r8,rdx
lea r12,[r10*2+r14]
mov QWORD[((-8))+rdi],r8
sbb r15,r15
shr r10,63
lea r13,[r11*2+rcx]
shr r11,63
or r13,r10
mov r10,QWORD[16+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[24+rdi]
adc r12,rax
mov rax,QWORD[8+rbp*1+rsi]
mov QWORD[rdi],r12
adc r13,rdx
lea rbx,[r10*2+r14]
mov QWORD[8+rdi],r13
sbb r15,r15
shr r10,63
lea r8,[r11*2+rcx]
shr r11,63
or r8,r10
mov r10,QWORD[32+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[40+rdi]
adc rbx,rax
mov rax,QWORD[16+rbp*1+rsi]
mov QWORD[16+rdi],rbx
adc r8,rdx
mov QWORD[24+rdi],r8
sbb r15,r15
lea rdi,[64+rdi]
add rbp,32
jnz NEAR $L$sqr4x_shift_n_add
lea r12,[r10*2+r14]
DB 0x67
shr r10,63
lea r13,[r11*2+rcx]
shr r11,63
or r13,r10
mov r10,QWORD[((-16))+rdi]
mov r14,r11
mul rax
neg r15
mov r11,QWORD[((-8))+rdi]
adc r12,rax
mov rax,QWORD[((-8))+rsi]
mov QWORD[((-32))+rdi],r12
adc r13,rdx
lea rbx,[r10*2+r14]
mov QWORD[((-24))+rdi],r13
sbb r15,r15
shr r10,63
lea r8,[r11*2+rcx]
shr r11,63
or r8,r10
mul rax
neg r15
adc rbx,rax
adc r8,rdx
mov QWORD[((-16))+rdi],rbx
mov QWORD[((-8))+rdi],r8
DB 102,72,15,126,213
__bn_sqr8x_reduction:
xor rax,rax
lea rcx,[rbp*1+r9]
lea rdx,[((48+8))+r9*2+rsp]
mov QWORD[((0+8))+rsp],rcx
lea rdi,[((48+8))+r9*1+rsp]
mov QWORD[((8+8))+rsp],rdx
neg r9
jmp NEAR $L$8x_reduction_loop
ALIGN 32
$L$8x_reduction_loop:
lea rdi,[r9*1+rdi]
DB 0x66
mov rbx,QWORD[rdi]
mov r9,QWORD[8+rdi]
mov r10,QWORD[16+rdi]
mov r11,QWORD[24+rdi]
mov r12,QWORD[32+rdi]
mov r13,QWORD[40+rdi]
mov r14,QWORD[48+rdi]
mov r15,QWORD[56+rdi]
mov QWORD[rdx],rax
lea rdi,[64+rdi]
DB 0x67
mov r8,rbx
imul rbx,QWORD[((32+8))+rsp]
mov rax,QWORD[rbp]
mov ecx,8
jmp NEAR $L$8x_reduce
ALIGN 32
$L$8x_reduce:
mul rbx
mov rax,QWORD[8+rbp]
neg r8
mov r8,rdx
adc r8,0
mul rbx
add r9,rax
mov rax,QWORD[16+rbp]
adc rdx,0
add r8,r9
mov QWORD[((48-8+8))+rcx*8+rsp],rbx
mov r9,rdx
adc r9,0
mul rbx
add r10,rax
mov rax,QWORD[24+rbp]
adc rdx,0
add r9,r10
mov rsi,QWORD[((32+8))+rsp]
mov r10,rdx
adc r10,0
mul rbx
add r11,rax
mov rax,QWORD[32+rbp]
adc rdx,0
imul rsi,r8
add r10,r11
mov r11,rdx
adc r11,0
mul rbx
add r12,rax
mov rax,QWORD[40+rbp]
adc rdx,0
add r11,r12
mov r12,rdx
adc r12,0
mul rbx
add r13,rax
mov rax,QWORD[48+rbp]
adc rdx,0
add r12,r13
mov r13,rdx
adc r13,0
mul rbx
add r14,rax
mov rax,QWORD[56+rbp]
adc rdx,0
add r13,r14
mov r14,rdx
adc r14,0
mul rbx
mov rbx,rsi
add r15,rax
mov rax,QWORD[rbp]
adc rdx,0
add r14,r15
mov r15,rdx
adc r15,0
dec ecx
jnz NEAR $L$8x_reduce
lea rbp,[64+rbp]
xor rax,rax
mov rdx,QWORD[((8+8))+rsp]
cmp rbp,QWORD[((0+8))+rsp]
jae NEAR $L$8x_no_tail
DB 0x66
add r8,QWORD[rdi]
adc r9,QWORD[8+rdi]
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
sbb rsi,rsi
mov rbx,QWORD[((48+56+8))+rsp]
mov ecx,8
mov rax,QWORD[rbp]
jmp NEAR $L$8x_tail
ALIGN 32
$L$8x_tail:
mul rbx
add r8,rax
mov rax,QWORD[8+rbp]
mov QWORD[rdi],r8
mov r8,rdx
adc r8,0
mul rbx
add r9,rax
mov rax,QWORD[16+rbp]
adc rdx,0
add r8,r9
lea rdi,[8+rdi]
mov r9,rdx
adc r9,0
mul rbx
add r10,rax
mov rax,QWORD[24+rbp]
adc rdx,0
add r9,r10
mov r10,rdx
adc r10,0
mul rbx
add r11,rax
mov rax,QWORD[32+rbp]
adc rdx,0
add r10,r11
mov r11,rdx
adc r11,0
mul rbx
add r12,rax
mov rax,QWORD[40+rbp]
adc rdx,0
add r11,r12
mov r12,rdx
adc r12,0
mul rbx
add r13,rax
mov rax,QWORD[48+rbp]
adc rdx,0
add r12,r13
mov r13,rdx
adc r13,0
mul rbx
add r14,rax
mov rax,QWORD[56+rbp]
adc rdx,0
add r13,r14
mov r14,rdx
adc r14,0
mul rbx
mov rbx,QWORD[((48-16+8))+rcx*8+rsp]
add r15,rax
adc rdx,0
add r14,r15
mov rax,QWORD[rbp]
mov r15,rdx
adc r15,0
dec ecx
jnz NEAR $L$8x_tail
lea rbp,[64+rbp]
mov rdx,QWORD[((8+8))+rsp]
cmp rbp,QWORD[((0+8))+rsp]
jae NEAR $L$8x_tail_done
mov rbx,QWORD[((48+56+8))+rsp]
neg rsi
mov rax,QWORD[rbp]
adc r8,QWORD[rdi]
adc r9,QWORD[8+rdi]
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
sbb rsi,rsi
mov ecx,8
jmp NEAR $L$8x_tail
ALIGN 32
$L$8x_tail_done:
xor rax,rax
add r8,QWORD[rdx]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
adc rax,0
neg rsi
$L$8x_no_tail:
adc r8,QWORD[rdi]
adc r9,QWORD[8+rdi]
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
adc rax,0
mov rcx,QWORD[((-8))+rbp]
xor rsi,rsi
DB 102,72,15,126,213
mov QWORD[rdi],r8
mov QWORD[8+rdi],r9
DB 102,73,15,126,217
mov QWORD[16+rdi],r10
mov QWORD[24+rdi],r11
mov QWORD[32+rdi],r12
mov QWORD[40+rdi],r13
mov QWORD[48+rdi],r14
mov QWORD[56+rdi],r15
lea rdi,[64+rdi]
cmp rdi,rdx
jb NEAR $L$8x_reduction_loop
DB 0F3h,0C3h ;repret
ALIGN 32
__bn_post4x_internal:
mov r12,QWORD[rbp]
lea rbx,[r9*1+rdi]
mov rcx,r9
DB 102,72,15,126,207
neg rax
DB 102,72,15,126,206
sar rcx,3+2
dec r12
xor r10,r10
mov r13,QWORD[8+rbp]
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
jmp NEAR $L$sqr4x_sub_entry
ALIGN 16
$L$sqr4x_sub:
mov r12,QWORD[rbp]
mov r13,QWORD[8+rbp]
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
$L$sqr4x_sub_entry:
lea rbp,[32+rbp]
not r12
not r13
not r14
not r15
and r12,rax
and r13,rax
and r14,rax
and r15,rax
neg r10
adc r12,QWORD[rbx]
adc r13,QWORD[8+rbx]
adc r14,QWORD[16+rbx]
adc r15,QWORD[24+rbx]
mov QWORD[rdi],r12
lea rbx,[32+rbx]
mov QWORD[8+rdi],r13
sbb r10,r10
mov QWORD[16+rdi],r14
mov QWORD[24+rdi],r15
lea rdi,[32+rdi]
inc rcx
jnz NEAR $L$sqr4x_sub
mov r10,r9
neg r9
DB 0F3h,0C3h ;repret
global bn_from_montgomery
ALIGN 32
bn_from_montgomery:
test DWORD[48+rsp],7
jz NEAR bn_from_mont8x
xor eax,eax
DB 0F3h,0C3h ;repret
ALIGN 32
bn_from_mont8x:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_from_mont8x:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
DB 0x67
mov rax,rsp
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$from_prologue:
shl r9d,3
lea r10,[r9*2+r9]
neg r9
mov r8,QWORD[r8]
lea r11,[((-320))+r9*2+rsp]
mov rbp,rsp
sub r11,rdi
and r11,4095
cmp r10,r11
jb NEAR $L$from_sp_alt
sub rbp,r11
lea rbp,[((-320))+r9*2+rbp]
jmp NEAR $L$from_sp_done
ALIGN 32
$L$from_sp_alt:
lea r10,[((4096-320))+r9*2]
lea rbp,[((-320))+r9*2+rbp]
sub r11,r10
mov r10,0
cmovc r11,r10
sub rbp,r11
$L$from_sp_done:
and rbp,-64
mov r11,rsp
sub r11,rbp
and r11,-4096
lea rsp,[rbp*1+r11]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$from_page_walk
jmp NEAR $L$from_page_walk_done
$L$from_page_walk:
lea rsp,[((-4096))+rsp]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$from_page_walk
$L$from_page_walk_done:
mov r10,r9
neg r9
mov QWORD[32+rsp],r8
mov QWORD[40+rsp],rax
$L$from_body:
mov r11,r9
lea rax,[48+rsp]
pxor xmm0,xmm0
jmp NEAR $L$mul_by_1
ALIGN 32
$L$mul_by_1:
movdqu xmm1,XMMWORD[rsi]
movdqu xmm2,XMMWORD[16+rsi]
movdqu xmm3,XMMWORD[32+rsi]
movdqa XMMWORD[r9*1+rax],xmm0
movdqu xmm4,XMMWORD[48+rsi]
movdqa XMMWORD[16+r9*1+rax],xmm0
DB 0x48,0x8d,0xb6,0x40,0x00,0x00,0x00
movdqa XMMWORD[rax],xmm1
movdqa XMMWORD[32+r9*1+rax],xmm0
movdqa XMMWORD[16+rax],xmm2
movdqa XMMWORD[48+r9*1+rax],xmm0
movdqa XMMWORD[32+rax],xmm3
movdqa XMMWORD[48+rax],xmm4
lea rax,[64+rax]
sub r11,64
jnz NEAR $L$mul_by_1
DB 102,72,15,110,207
DB 102,72,15,110,209
DB 0x67
mov rbp,rcx
DB 102,73,15,110,218
lea r11,[OPENSSL_ia32cap_P]
mov r11d,DWORD[8+r11]
and r11d,0x80108
cmp r11d,0x80108
jne NEAR $L$from_mont_nox
lea rdi,[r9*1+rax]
call __bn_sqrx8x_reduction
call __bn_postx4x_internal
pxor xmm0,xmm0
lea rax,[48+rsp]
jmp NEAR $L$from_mont_zero
ALIGN 32
$L$from_mont_nox:
call __bn_sqr8x_reduction
call __bn_post4x_internal
pxor xmm0,xmm0
lea rax,[48+rsp]
jmp NEAR $L$from_mont_zero
ALIGN 32
$L$from_mont_zero:
mov rsi,QWORD[40+rsp]
movdqa XMMWORD[rax],xmm0
movdqa XMMWORD[16+rax],xmm0
movdqa XMMWORD[32+rax],xmm0
movdqa XMMWORD[48+rax],xmm0
lea rax,[64+rax]
sub r9,32
jnz NEAR $L$from_mont_zero
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$from_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_from_mont8x:
ALIGN 32
bn_mulx4x_mont_gather5:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_mulx4x_mont_gather5:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
mov rax,rsp
$L$mulx4x_enter:
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$mulx4x_prologue:
shl r9d,3
lea r10,[r9*2+r9]
neg r9
mov r8,QWORD[r8]
lea r11,[((-320))+r9*2+rsp]
mov rbp,rsp
sub r11,rdi
and r11,4095
cmp r10,r11
jb NEAR $L$mulx4xsp_alt
sub rbp,r11
lea rbp,[((-320))+r9*2+rbp]
jmp NEAR $L$mulx4xsp_done
$L$mulx4xsp_alt:
lea r10,[((4096-320))+r9*2]
lea rbp,[((-320))+r9*2+rbp]
sub r11,r10
mov r10,0
cmovc r11,r10
sub rbp,r11
$L$mulx4xsp_done:
and rbp,-64
mov r11,rsp
sub r11,rbp
and r11,-4096
lea rsp,[rbp*1+r11]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$mulx4x_page_walk
jmp NEAR $L$mulx4x_page_walk_done
$L$mulx4x_page_walk:
lea rsp,[((-4096))+rsp]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$mulx4x_page_walk
$L$mulx4x_page_walk_done:
mov QWORD[32+rsp],r8
mov QWORD[40+rsp],rax
$L$mulx4x_body:
call mulx4x_internal
mov rsi,QWORD[40+rsp]
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$mulx4x_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_mulx4x_mont_gather5:
ALIGN 32
mulx4x_internal:
mov QWORD[8+rsp],r9
mov r10,r9
neg r9
shl r9,5
neg r10
lea r13,[128+r9*1+rdx]
shr r9,5+5
movd xmm5,DWORD[56+rax]
sub r9,1
lea rax,[$L$inc]
mov QWORD[((16+8))+rsp],r13
mov QWORD[((24+8))+rsp],r9
mov QWORD[((56+8))+rsp],rdi
movdqa xmm0,XMMWORD[rax]
movdqa xmm1,XMMWORD[16+rax]
lea r10,[((88-112))+r10*1+rsp]
lea rdi,[128+rdx]
pshufd xmm5,xmm5,0
movdqa xmm4,xmm1
DB 0x67
movdqa xmm2,xmm1
DB 0x67
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[112+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[128+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[144+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[160+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[176+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[192+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[208+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[224+r10],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[240+r10],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[256+r10],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[272+r10],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[288+r10],xmm3
movdqa xmm3,xmm4
DB 0x67
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[304+r10],xmm0
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[320+r10],xmm1
pcmpeqd xmm3,xmm5
movdqa XMMWORD[336+r10],xmm2
pand xmm0,XMMWORD[64+rdi]
pand xmm1,XMMWORD[80+rdi]
pand xmm2,XMMWORD[96+rdi]
movdqa XMMWORD[352+r10],xmm3
pand xmm3,XMMWORD[112+rdi]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-128))+rdi]
movdqa xmm5,XMMWORD[((-112))+rdi]
movdqa xmm2,XMMWORD[((-96))+rdi]
pand xmm4,XMMWORD[112+r10]
movdqa xmm3,XMMWORD[((-80))+rdi]
pand xmm5,XMMWORD[128+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[144+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[160+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[((-64))+rdi]
movdqa xmm5,XMMWORD[((-48))+rdi]
movdqa xmm2,XMMWORD[((-32))+rdi]
pand xmm4,XMMWORD[176+r10]
movdqa xmm3,XMMWORD[((-16))+rdi]
pand xmm5,XMMWORD[192+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[208+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[224+r10]
por xmm0,xmm2
por xmm1,xmm3
movdqa xmm4,XMMWORD[rdi]
movdqa xmm5,XMMWORD[16+rdi]
movdqa xmm2,XMMWORD[32+rdi]
pand xmm4,XMMWORD[240+r10]
movdqa xmm3,XMMWORD[48+rdi]
pand xmm5,XMMWORD[256+r10]
por xmm0,xmm4
pand xmm2,XMMWORD[272+r10]
por xmm1,xmm5
pand xmm3,XMMWORD[288+r10]
por xmm0,xmm2
por xmm1,xmm3
pxor xmm0,xmm1
pshufd xmm1,xmm0,0x4e
por xmm0,xmm1
lea rdi,[256+rdi]
DB 102,72,15,126,194
lea rbx,[((64+32+8))+rsp]
mov r9,rdx
mulx rax,r8,QWORD[rsi]
mulx r12,r11,QWORD[8+rsi]
add r11,rax
mulx r13,rax,QWORD[16+rsi]
adc r12,rax
adc r13,0
mulx r14,rax,QWORD[24+rsi]
mov r15,r8
imul r8,QWORD[((32+8))+rsp]
xor rbp,rbp
mov rdx,r8
mov QWORD[((8+8))+rsp],rdi
lea rsi,[32+rsi]
adcx r13,rax
adcx r14,rbp
mulx r10,rax,QWORD[rcx]
adcx r15,rax
adox r10,r11
mulx r11,rax,QWORD[8+rcx]
adcx r10,rax
adox r11,r12
mulx r12,rax,QWORD[16+rcx]
mov rdi,QWORD[((24+8))+rsp]
mov QWORD[((-32))+rbx],r10
adcx r11,rax
adox r12,r13
mulx r15,rax,QWORD[24+rcx]
mov rdx,r9
mov QWORD[((-24))+rbx],r11
adcx r12,rax
adox r15,rbp
lea rcx,[32+rcx]
mov QWORD[((-16))+rbx],r12
jmp NEAR $L$mulx4x_1st
ALIGN 32
$L$mulx4x_1st:
adcx r15,rbp
mulx rax,r10,QWORD[rsi]
adcx r10,r14
mulx r14,r11,QWORD[8+rsi]
adcx r11,rax
mulx rax,r12,QWORD[16+rsi]
adcx r12,r14
mulx r14,r13,QWORD[24+rsi]
DB 0x67,0x67
mov rdx,r8
adcx r13,rax
adcx r14,rbp
lea rsi,[32+rsi]
lea rbx,[32+rbx]
adox r10,r15
mulx r15,rax,QWORD[rcx]
adcx r10,rax
adox r11,r15
mulx r15,rax,QWORD[8+rcx]
adcx r11,rax
adox r12,r15
mulx r15,rax,QWORD[16+rcx]
mov QWORD[((-40))+rbx],r10
adcx r12,rax
mov QWORD[((-32))+rbx],r11
adox r13,r15
mulx r15,rax,QWORD[24+rcx]
mov rdx,r9
mov QWORD[((-24))+rbx],r12
adcx r13,rax
adox r15,rbp
lea rcx,[32+rcx]
mov QWORD[((-16))+rbx],r13
dec rdi
jnz NEAR $L$mulx4x_1st
mov rax,QWORD[8+rsp]
adc r15,rbp
lea rsi,[rax*1+rsi]
add r14,r15
mov rdi,QWORD[((8+8))+rsp]
adc rbp,rbp
mov QWORD[((-8))+rbx],r14
jmp NEAR $L$mulx4x_outer
ALIGN 32
$L$mulx4x_outer:
lea r10,[((16-256))+rbx]
pxor xmm4,xmm4
DB 0x67,0x67
pxor xmm5,xmm5
movdqa xmm0,XMMWORD[((-128))+rdi]
movdqa xmm1,XMMWORD[((-112))+rdi]
movdqa xmm2,XMMWORD[((-96))+rdi]
pand xmm0,XMMWORD[256+r10]
movdqa xmm3,XMMWORD[((-80))+rdi]
pand xmm1,XMMWORD[272+r10]
por xmm4,xmm0
pand xmm2,XMMWORD[288+r10]
por xmm5,xmm1
pand xmm3,XMMWORD[304+r10]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[((-64))+rdi]
movdqa xmm1,XMMWORD[((-48))+rdi]
movdqa xmm2,XMMWORD[((-32))+rdi]
pand xmm0,XMMWORD[320+r10]
movdqa xmm3,XMMWORD[((-16))+rdi]
pand xmm1,XMMWORD[336+r10]
por xmm4,xmm0
pand xmm2,XMMWORD[352+r10]
por xmm5,xmm1
pand xmm3,XMMWORD[368+r10]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[rdi]
movdqa xmm1,XMMWORD[16+rdi]
movdqa xmm2,XMMWORD[32+rdi]
pand xmm0,XMMWORD[384+r10]
movdqa xmm3,XMMWORD[48+rdi]
pand xmm1,XMMWORD[400+r10]
por xmm4,xmm0
pand xmm2,XMMWORD[416+r10]
por xmm5,xmm1
pand xmm3,XMMWORD[432+r10]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[64+rdi]
movdqa xmm1,XMMWORD[80+rdi]
movdqa xmm2,XMMWORD[96+rdi]
pand xmm0,XMMWORD[448+r10]
movdqa xmm3,XMMWORD[112+rdi]
pand xmm1,XMMWORD[464+r10]
por xmm4,xmm0
pand xmm2,XMMWORD[480+r10]
por xmm5,xmm1
pand xmm3,XMMWORD[496+r10]
por xmm4,xmm2
por xmm5,xmm3
por xmm4,xmm5
pshufd xmm0,xmm4,0x4e
por xmm0,xmm4
lea rdi,[256+rdi]
DB 102,72,15,126,194
mov QWORD[rbx],rbp
lea rbx,[32+rax*1+rbx]
mulx r11,r8,QWORD[rsi]
xor rbp,rbp
mov r9,rdx
mulx r12,r14,QWORD[8+rsi]
adox r8,QWORD[((-32))+rbx]
adcx r11,r14
mulx r13,r15,QWORD[16+rsi]
adox r11,QWORD[((-24))+rbx]
adcx r12,r15
mulx r14,rdx,QWORD[24+rsi]
adox r12,QWORD[((-16))+rbx]
adcx r13,rdx
lea rcx,[rax*1+rcx]
lea rsi,[32+rsi]
adox r13,QWORD[((-8))+rbx]
adcx r14,rbp
adox r14,rbp
mov r15,r8
imul r8,QWORD[((32+8))+rsp]
mov rdx,r8
xor rbp,rbp
mov QWORD[((8+8))+rsp],rdi
mulx r10,rax,QWORD[rcx]
adcx r15,rax
adox r10,r11
mulx r11,rax,QWORD[8+rcx]
adcx r10,rax
adox r11,r12
mulx r12,rax,QWORD[16+rcx]
adcx r11,rax
adox r12,r13
mulx r15,rax,QWORD[24+rcx]
mov rdx,r9
mov rdi,QWORD[((24+8))+rsp]
mov QWORD[((-32))+rbx],r10
adcx r12,rax
mov QWORD[((-24))+rbx],r11
adox r15,rbp
mov QWORD[((-16))+rbx],r12
lea rcx,[32+rcx]
jmp NEAR $L$mulx4x_inner
ALIGN 32
$L$mulx4x_inner:
mulx rax,r10,QWORD[rsi]
adcx r15,rbp
adox r10,r14
mulx r14,r11,QWORD[8+rsi]
adcx r10,QWORD[rbx]
adox r11,rax
mulx rax,r12,QWORD[16+rsi]
adcx r11,QWORD[8+rbx]
adox r12,r14
mulx r14,r13,QWORD[24+rsi]
mov rdx,r8
adcx r12,QWORD[16+rbx]
adox r13,rax
adcx r13,QWORD[24+rbx]
adox r14,rbp
lea rsi,[32+rsi]
lea rbx,[32+rbx]
adcx r14,rbp
adox r10,r15
mulx r15,rax,QWORD[rcx]
adcx r10,rax
adox r11,r15
mulx r15,rax,QWORD[8+rcx]
adcx r11,rax
adox r12,r15
mulx r15,rax,QWORD[16+rcx]
mov QWORD[((-40))+rbx],r10
adcx r12,rax
adox r13,r15
mov QWORD[((-32))+rbx],r11
mulx r15,rax,QWORD[24+rcx]
mov rdx,r9
lea rcx,[32+rcx]
mov QWORD[((-24))+rbx],r12
adcx r13,rax
adox r15,rbp
mov QWORD[((-16))+rbx],r13
dec rdi
jnz NEAR $L$mulx4x_inner
mov rax,QWORD[((0+8))+rsp]
adc r15,rbp
sub rdi,QWORD[rbx]
mov rdi,QWORD[((8+8))+rsp]
mov r10,QWORD[((16+8))+rsp]
adc r14,r15
lea rsi,[rax*1+rsi]
adc rbp,rbp
mov QWORD[((-8))+rbx],r14
cmp rdi,r10
jb NEAR $L$mulx4x_outer
mov r10,QWORD[((-8))+rcx]
mov r8,rbp
mov r12,QWORD[rax*1+rcx]
lea rbp,[rax*1+rcx]
mov rcx,rax
lea rdi,[rax*1+rbx]
xor eax,eax
xor r15,r15
sub r10,r14
adc r15,r15
or r8,r15
sar rcx,3+2
sub rax,r8
mov rdx,QWORD[((56+8))+rsp]
dec r12
mov r13,QWORD[8+rbp]
xor r8,r8
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
jmp NEAR $L$sqrx4x_sub_entry
ALIGN 32
bn_powerx5:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_bn_powerx5:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
mov rax,rsp
$L$powerx5_enter:
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$powerx5_prologue:
shl r9d,3
lea r10,[r9*2+r9]
neg r9
mov r8,QWORD[r8]
lea r11,[((-320))+r9*2+rsp]
mov rbp,rsp
sub r11,rdi
and r11,4095
cmp r10,r11
jb NEAR $L$pwrx_sp_alt
sub rbp,r11
lea rbp,[((-320))+r9*2+rbp]
jmp NEAR $L$pwrx_sp_done
ALIGN 32
$L$pwrx_sp_alt:
lea r10,[((4096-320))+r9*2]
lea rbp,[((-320))+r9*2+rbp]
sub r11,r10
mov r10,0
cmovc r11,r10
sub rbp,r11
$L$pwrx_sp_done:
and rbp,-64
mov r11,rsp
sub r11,rbp
and r11,-4096
lea rsp,[rbp*1+r11]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$pwrx_page_walk
jmp NEAR $L$pwrx_page_walk_done
$L$pwrx_page_walk:
lea rsp,[((-4096))+rsp]
mov r10,QWORD[rsp]
cmp rsp,rbp
ja NEAR $L$pwrx_page_walk
$L$pwrx_page_walk_done:
mov r10,r9
neg r9
pxor xmm0,xmm0
DB 102,72,15,110,207
DB 102,72,15,110,209
DB 102,73,15,110,218
DB 102,72,15,110,226
mov QWORD[32+rsp],r8
mov QWORD[40+rsp],rax
$L$powerx5_body:
call __bn_sqrx8x_internal
call __bn_postx4x_internal
call __bn_sqrx8x_internal
call __bn_postx4x_internal
call __bn_sqrx8x_internal
call __bn_postx4x_internal
call __bn_sqrx8x_internal
call __bn_postx4x_internal
call __bn_sqrx8x_internal
call __bn_postx4x_internal
mov r9,r10
mov rdi,rsi
DB 102,72,15,126,209
DB 102,72,15,126,226
mov rax,QWORD[40+rsp]
call mulx4x_internal
mov rsi,QWORD[40+rsp]
mov rax,1
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$powerx5_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_powerx5:
global bn_sqrx8x_internal
ALIGN 32
bn_sqrx8x_internal:
__bn_sqrx8x_internal:
lea rdi,[((48+8))+rsp]
lea rbp,[r9*1+rsi]
mov QWORD[((0+8))+rsp],r9
mov QWORD[((8+8))+rsp],rbp
jmp NEAR $L$sqr8x_zero_start
ALIGN 32
DB 0x66,0x66,0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00
$L$sqrx8x_zero:
DB 0x3e
movdqa XMMWORD[rdi],xmm0
movdqa XMMWORD[16+rdi],xmm0
movdqa XMMWORD[32+rdi],xmm0
movdqa XMMWORD[48+rdi],xmm0
$L$sqr8x_zero_start:
movdqa XMMWORD[64+rdi],xmm0
movdqa XMMWORD[80+rdi],xmm0
movdqa XMMWORD[96+rdi],xmm0
movdqa XMMWORD[112+rdi],xmm0
lea rdi,[128+rdi]
sub r9,64
jnz NEAR $L$sqrx8x_zero
mov rdx,QWORD[rsi]
xor r10,r10
xor r11,r11
xor r12,r12
xor r13,r13
xor r14,r14
xor r15,r15
lea rdi,[((48+8))+rsp]
xor rbp,rbp
jmp NEAR $L$sqrx8x_outer_loop
ALIGN 32
$L$sqrx8x_outer_loop:
mulx rax,r8,QWORD[8+rsi]
adcx r8,r9
adox r10,rax
mulx rax,r9,QWORD[16+rsi]
adcx r9,r10
adox r11,rax
DB 0xc4,0xe2,0xab,0xf6,0x86,0x18,0x00,0x00,0x00
adcx r10,r11
adox r12,rax
DB 0xc4,0xe2,0xa3,0xf6,0x86,0x20,0x00,0x00,0x00
adcx r11,r12
adox r13,rax
mulx rax,r12,QWORD[40+rsi]
adcx r12,r13
adox r14,rax
mulx rax,r13,QWORD[48+rsi]
adcx r13,r14
adox rax,r15
mulx r15,r14,QWORD[56+rsi]
mov rdx,QWORD[8+rsi]
adcx r14,rax
adox r15,rbp
adc r15,QWORD[64+rdi]
mov QWORD[8+rdi],r8
mov QWORD[16+rdi],r9
sbb rcx,rcx
xor rbp,rbp
mulx rbx,r8,QWORD[16+rsi]
mulx rax,r9,QWORD[24+rsi]
adcx r8,r10
adox r9,rbx
mulx rbx,r10,QWORD[32+rsi]
adcx r9,r11
adox r10,rax
DB 0xc4,0xe2,0xa3,0xf6,0x86,0x28,0x00,0x00,0x00
adcx r10,r12
adox r11,rbx
DB 0xc4,0xe2,0x9b,0xf6,0x9e,0x30,0x00,0x00,0x00
adcx r11,r13
adox r12,r14
DB 0xc4,0x62,0x93,0xf6,0xb6,0x38,0x00,0x00,0x00
mov rdx,QWORD[16+rsi]
adcx r12,rax
adox r13,rbx
adcx r13,r15
adox r14,rbp
adcx r14,rbp
mov QWORD[24+rdi],r8
mov QWORD[32+rdi],r9
mulx rbx,r8,QWORD[24+rsi]
mulx rax,r9,QWORD[32+rsi]
adcx r8,r10
adox r9,rbx
mulx rbx,r10,QWORD[40+rsi]
adcx r9,r11
adox r10,rax
DB 0xc4,0xe2,0xa3,0xf6,0x86,0x30,0x00,0x00,0x00
adcx r10,r12
adox r11,r13
DB 0xc4,0x62,0x9b,0xf6,0xae,0x38,0x00,0x00,0x00
DB 0x3e
mov rdx,QWORD[24+rsi]
adcx r11,rbx
adox r12,rax
adcx r12,r14
mov QWORD[40+rdi],r8
mov QWORD[48+rdi],r9
mulx rax,r8,QWORD[32+rsi]
adox r13,rbp
adcx r13,rbp
mulx rbx,r9,QWORD[40+rsi]
adcx r8,r10
adox r9,rax
mulx rax,r10,QWORD[48+rsi]
adcx r9,r11
adox r10,r12
mulx r12,r11,QWORD[56+rsi]
mov rdx,QWORD[32+rsi]
mov r14,QWORD[40+rsi]
adcx r10,rbx
adox r11,rax
mov r15,QWORD[48+rsi]
adcx r11,r13
adox r12,rbp
adcx r12,rbp
mov QWORD[56+rdi],r8
mov QWORD[64+rdi],r9
mulx rax,r9,r14
mov r8,QWORD[56+rsi]
adcx r9,r10
mulx rbx,r10,r15
adox r10,rax
adcx r10,r11
mulx rax,r11,r8
mov rdx,r14
adox r11,rbx
adcx r11,r12
adcx rax,rbp
mulx rbx,r14,r15
mulx r13,r12,r8
mov rdx,r15
lea rsi,[64+rsi]
adcx r11,r14
adox r12,rbx
adcx r12,rax
adox r13,rbp
DB 0x67,0x67
mulx r14,r8,r8
adcx r13,r8
adcx r14,rbp
cmp rsi,QWORD[((8+8))+rsp]
je NEAR $L$sqrx8x_outer_break
neg rcx
mov rcx,-8
mov r15,rbp
mov r8,QWORD[64+rdi]
adcx r9,QWORD[72+rdi]
adcx r10,QWORD[80+rdi]
adcx r11,QWORD[88+rdi]
adc r12,QWORD[96+rdi]
adc r13,QWORD[104+rdi]
adc r14,QWORD[112+rdi]
adc r15,QWORD[120+rdi]
lea rbp,[rsi]
lea rdi,[128+rdi]
sbb rax,rax
mov rdx,QWORD[((-64))+rsi]
mov QWORD[((16+8))+rsp],rax
mov QWORD[((24+8))+rsp],rdi
xor eax,eax
jmp NEAR $L$sqrx8x_loop
ALIGN 32
$L$sqrx8x_loop:
mov rbx,r8
mulx r8,rax,QWORD[rbp]
adcx rbx,rax
adox r8,r9
mulx r9,rax,QWORD[8+rbp]
adcx r8,rax
adox r9,r10
mulx r10,rax,QWORD[16+rbp]
adcx r9,rax
adox r10,r11
mulx r11,rax,QWORD[24+rbp]
adcx r10,rax
adox r11,r12
DB 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00
adcx r11,rax
adox r12,r13
mulx r13,rax,QWORD[40+rbp]
adcx r12,rax
adox r13,r14
mulx r14,rax,QWORD[48+rbp]
mov QWORD[rcx*8+rdi],rbx
mov ebx,0
adcx r13,rax
adox r14,r15
DB 0xc4,0x62,0xfb,0xf6,0xbd,0x38,0x00,0x00,0x00
mov rdx,QWORD[8+rcx*8+rsi]
adcx r14,rax
adox r15,rbx
adcx r15,rbx
DB 0x67
inc rcx
jnz NEAR $L$sqrx8x_loop
lea rbp,[64+rbp]
mov rcx,-8
cmp rbp,QWORD[((8+8))+rsp]
je NEAR $L$sqrx8x_break
sub rbx,QWORD[((16+8))+rsp]
DB 0x66
mov rdx,QWORD[((-64))+rsi]
adcx r8,QWORD[rdi]
adcx r9,QWORD[8+rdi]
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
lea rdi,[64+rdi]
DB 0x67
sbb rax,rax
xor ebx,ebx
mov QWORD[((16+8))+rsp],rax
jmp NEAR $L$sqrx8x_loop
ALIGN 32
$L$sqrx8x_break:
xor rbp,rbp
sub rbx,QWORD[((16+8))+rsp]
adcx r8,rbp
mov rcx,QWORD[((24+8))+rsp]
adcx r9,rbp
mov rdx,QWORD[rsi]
adc r10,0
mov QWORD[rdi],r8
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
cmp rdi,rcx
je NEAR $L$sqrx8x_outer_loop
mov QWORD[8+rdi],r9
mov r9,QWORD[8+rcx]
mov QWORD[16+rdi],r10
mov r10,QWORD[16+rcx]
mov QWORD[24+rdi],r11
mov r11,QWORD[24+rcx]
mov QWORD[32+rdi],r12
mov r12,QWORD[32+rcx]
mov QWORD[40+rdi],r13
mov r13,QWORD[40+rcx]
mov QWORD[48+rdi],r14
mov r14,QWORD[48+rcx]
mov QWORD[56+rdi],r15
mov r15,QWORD[56+rcx]
mov rdi,rcx
jmp NEAR $L$sqrx8x_outer_loop
ALIGN 32
$L$sqrx8x_outer_break:
mov QWORD[72+rdi],r9
DB 102,72,15,126,217
mov QWORD[80+rdi],r10
mov QWORD[88+rdi],r11
mov QWORD[96+rdi],r12
mov QWORD[104+rdi],r13
mov QWORD[112+rdi],r14
lea rdi,[((48+8))+rsp]
mov rdx,QWORD[rcx*1+rsi]
mov r11,QWORD[8+rdi]
xor r10,r10
mov r9,QWORD[((0+8))+rsp]
adox r11,r11
mov r12,QWORD[16+rdi]
mov r13,QWORD[24+rdi]
ALIGN 32
$L$sqrx4x_shift_n_add:
mulx rbx,rax,rdx
adox r12,r12
adcx rax,r10
DB 0x48,0x8b,0x94,0x0e,0x08,0x00,0x00,0x00
DB 0x4c,0x8b,0x97,0x20,0x00,0x00,0x00
adox r13,r13
adcx rbx,r11
mov r11,QWORD[40+rdi]
mov QWORD[rdi],rax
mov QWORD[8+rdi],rbx
mulx rbx,rax,rdx
adox r10,r10
adcx rax,r12
mov rdx,QWORD[16+rcx*1+rsi]
mov r12,QWORD[48+rdi]
adox r11,r11
adcx rbx,r13
mov r13,QWORD[56+rdi]
mov QWORD[16+rdi],rax
mov QWORD[24+rdi],rbx
mulx rbx,rax,rdx
adox r12,r12
adcx rax,r10
mov rdx,QWORD[24+rcx*1+rsi]
lea rcx,[32+rcx]
mov r10,QWORD[64+rdi]
adox r13,r13
adcx rbx,r11
mov r11,QWORD[72+rdi]
mov QWORD[32+rdi],rax
mov QWORD[40+rdi],rbx
mulx rbx,rax,rdx
adox r10,r10
adcx rax,r12
jrcxz $L$sqrx4x_shift_n_add_break
DB 0x48,0x8b,0x94,0x0e,0x00,0x00,0x00,0x00
adox r11,r11
adcx rbx,r13
mov r12,QWORD[80+rdi]
mov r13,QWORD[88+rdi]
mov QWORD[48+rdi],rax
mov QWORD[56+rdi],rbx
lea rdi,[64+rdi]
nop
jmp NEAR $L$sqrx4x_shift_n_add
ALIGN 32
$L$sqrx4x_shift_n_add_break:
adcx rbx,r13
mov QWORD[48+rdi],rax
mov QWORD[56+rdi],rbx
lea rdi,[64+rdi]
DB 102,72,15,126,213
__bn_sqrx8x_reduction:
xor eax,eax
mov rbx,QWORD[((32+8))+rsp]
mov rdx,QWORD[((48+8))+rsp]
lea rcx,[((-64))+r9*1+rbp]
mov QWORD[((0+8))+rsp],rcx
mov QWORD[((8+8))+rsp],rdi
lea rdi,[((48+8))+rsp]
jmp NEAR $L$sqrx8x_reduction_loop
ALIGN 32
$L$sqrx8x_reduction_loop:
mov r9,QWORD[8+rdi]
mov r10,QWORD[16+rdi]
mov r11,QWORD[24+rdi]
mov r12,QWORD[32+rdi]
mov r8,rdx
imul rdx,rbx
mov r13,QWORD[40+rdi]
mov r14,QWORD[48+rdi]
mov r15,QWORD[56+rdi]
mov QWORD[((24+8))+rsp],rax
lea rdi,[64+rdi]
xor rsi,rsi
mov rcx,-8
jmp NEAR $L$sqrx8x_reduce
ALIGN 32
$L$sqrx8x_reduce:
mov rbx,r8
mulx r8,rax,QWORD[rbp]
adcx rax,rbx
adox r8,r9
mulx r9,rbx,QWORD[8+rbp]
adcx r8,rbx
adox r9,r10
mulx r10,rbx,QWORD[16+rbp]
adcx r9,rbx
adox r10,r11
mulx r11,rbx,QWORD[24+rbp]
adcx r10,rbx
adox r11,r12
DB 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00
mov rax,rdx
mov rdx,r8
adcx r11,rbx
adox r12,r13
mulx rdx,rbx,QWORD[((32+8))+rsp]
mov rdx,rax
mov QWORD[((64+48+8))+rcx*8+rsp],rax
mulx r13,rax,QWORD[40+rbp]
adcx r12,rax
adox r13,r14
mulx r14,rax,QWORD[48+rbp]
adcx r13,rax
adox r14,r15
mulx r15,rax,QWORD[56+rbp]
mov rdx,rbx
adcx r14,rax
adox r15,rsi
adcx r15,rsi
DB 0x67,0x67,0x67
inc rcx
jnz NEAR $L$sqrx8x_reduce
mov rax,rsi
cmp rbp,QWORD[((0+8))+rsp]
jae NEAR $L$sqrx8x_no_tail
mov rdx,QWORD[((48+8))+rsp]
add r8,QWORD[rdi]
lea rbp,[64+rbp]
mov rcx,-8
adcx r9,QWORD[8+rdi]
adcx r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
lea rdi,[64+rdi]
sbb rax,rax
xor rsi,rsi
mov QWORD[((16+8))+rsp],rax
jmp NEAR $L$sqrx8x_tail
ALIGN 32
$L$sqrx8x_tail:
mov rbx,r8
mulx r8,rax,QWORD[rbp]
adcx rbx,rax
adox r8,r9
mulx r9,rax,QWORD[8+rbp]
adcx r8,rax
adox r9,r10
mulx r10,rax,QWORD[16+rbp]
adcx r9,rax
adox r10,r11
mulx r11,rax,QWORD[24+rbp]
adcx r10,rax
adox r11,r12
DB 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00
adcx r11,rax
adox r12,r13
mulx r13,rax,QWORD[40+rbp]
adcx r12,rax
adox r13,r14
mulx r14,rax,QWORD[48+rbp]
adcx r13,rax
adox r14,r15
mulx r15,rax,QWORD[56+rbp]
mov rdx,QWORD[((72+48+8))+rcx*8+rsp]
adcx r14,rax
adox r15,rsi
mov QWORD[rcx*8+rdi],rbx
mov rbx,r8
adcx r15,rsi
inc rcx
jnz NEAR $L$sqrx8x_tail
cmp rbp,QWORD[((0+8))+rsp]
jae NEAR $L$sqrx8x_tail_done
sub rsi,QWORD[((16+8))+rsp]
mov rdx,QWORD[((48+8))+rsp]
lea rbp,[64+rbp]
adc r8,QWORD[rdi]
adc r9,QWORD[8+rdi]
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
lea rdi,[64+rdi]
sbb rax,rax
sub rcx,8
xor rsi,rsi
mov QWORD[((16+8))+rsp],rax
jmp NEAR $L$sqrx8x_tail
ALIGN 32
$L$sqrx8x_tail_done:
xor rax,rax
add r8,QWORD[((24+8))+rsp]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
adc rax,0
sub rsi,QWORD[((16+8))+rsp]
$L$sqrx8x_no_tail:
adc r8,QWORD[rdi]
DB 102,72,15,126,217
adc r9,QWORD[8+rdi]
mov rsi,QWORD[56+rbp]
DB 102,72,15,126,213
adc r10,QWORD[16+rdi]
adc r11,QWORD[24+rdi]
adc r12,QWORD[32+rdi]
adc r13,QWORD[40+rdi]
adc r14,QWORD[48+rdi]
adc r15,QWORD[56+rdi]
adc rax,0
mov rbx,QWORD[((32+8))+rsp]
mov rdx,QWORD[64+rcx*1+rdi]
mov QWORD[rdi],r8
lea r8,[64+rdi]
mov QWORD[8+rdi],r9
mov QWORD[16+rdi],r10
mov QWORD[24+rdi],r11
mov QWORD[32+rdi],r12
mov QWORD[40+rdi],r13
mov QWORD[48+rdi],r14
mov QWORD[56+rdi],r15
lea rdi,[64+rcx*1+rdi]
cmp r8,QWORD[((8+8))+rsp]
jb NEAR $L$sqrx8x_reduction_loop
DB 0F3h,0C3h ;repret
ALIGN 32
__bn_postx4x_internal:
mov r12,QWORD[rbp]
mov r10,rcx
mov r9,rcx
neg rax
sar rcx,3+2
DB 102,72,15,126,202
DB 102,72,15,126,206
dec r12
mov r13,QWORD[8+rbp]
xor r8,r8
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
jmp NEAR $L$sqrx4x_sub_entry
ALIGN 16
$L$sqrx4x_sub:
mov r12,QWORD[rbp]
mov r13,QWORD[8+rbp]
mov r14,QWORD[16+rbp]
mov r15,QWORD[24+rbp]
$L$sqrx4x_sub_entry:
andn r12,r12,rax
lea rbp,[32+rbp]
andn r13,r13,rax
andn r14,r14,rax
andn r15,r15,rax
neg r8
adc r12,QWORD[rdi]
adc r13,QWORD[8+rdi]
adc r14,QWORD[16+rdi]
adc r15,QWORD[24+rdi]
mov QWORD[rdx],r12
lea rdi,[32+rdi]
mov QWORD[8+rdx],r13
sbb r8,r8
mov QWORD[16+rdx],r14
mov QWORD[24+rdx],r15
lea rdx,[32+rdx]
inc rcx
jnz NEAR $L$sqrx4x_sub
neg r9
DB 0F3h,0C3h ;repret
global bn_scatter5
ALIGN 16
bn_scatter5:
cmp edx,0
jz NEAR $L$scatter_epilogue
lea r8,[r9*8+r8]
$L$scatter:
mov rax,QWORD[rcx]
lea rcx,[8+rcx]
mov QWORD[r8],rax
lea r8,[256+r8]
sub edx,1
jnz NEAR $L$scatter
$L$scatter_epilogue:
DB 0F3h,0C3h ;repret
global bn_gather5
ALIGN 32
bn_gather5:
$L$SEH_begin_bn_gather5:
DB 0x4c,0x8d,0x14,0x24
DB 0x48,0x81,0xec,0x08,0x01,0x00,0x00
lea rax,[$L$inc]
and rsp,-16
movd xmm5,r9d
movdqa xmm0,XMMWORD[rax]
movdqa xmm1,XMMWORD[16+rax]
lea r11,[128+r8]
lea rax,[128+rsp]
pshufd xmm5,xmm5,0
movdqa xmm4,xmm1
movdqa xmm2,xmm1
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[(-128)+rax],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[(-112)+rax],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[(-96)+rax],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[(-80)+rax],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[(-64)+rax],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[(-48)+rax],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[(-32)+rax],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[(-16)+rax],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[rax],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[16+rax],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[32+rax],xmm2
movdqa xmm2,xmm4
paddd xmm1,xmm0
pcmpeqd xmm0,xmm5
movdqa XMMWORD[48+rax],xmm3
movdqa xmm3,xmm4
paddd xmm2,xmm1
pcmpeqd xmm1,xmm5
movdqa XMMWORD[64+rax],xmm0
movdqa xmm0,xmm4
paddd xmm3,xmm2
pcmpeqd xmm2,xmm5
movdqa XMMWORD[80+rax],xmm1
movdqa xmm1,xmm4
paddd xmm0,xmm3
pcmpeqd xmm3,xmm5
movdqa XMMWORD[96+rax],xmm2
movdqa xmm2,xmm4
movdqa XMMWORD[112+rax],xmm3
jmp NEAR $L$gather
ALIGN 32
$L$gather:
pxor xmm4,xmm4
pxor xmm5,xmm5
movdqa xmm0,XMMWORD[((-128))+r11]
movdqa xmm1,XMMWORD[((-112))+r11]
movdqa xmm2,XMMWORD[((-96))+r11]
pand xmm0,XMMWORD[((-128))+rax]
movdqa xmm3,XMMWORD[((-80))+r11]
pand xmm1,XMMWORD[((-112))+rax]
por xmm4,xmm0
pand xmm2,XMMWORD[((-96))+rax]
por xmm5,xmm1
pand xmm3,XMMWORD[((-80))+rax]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[((-64))+r11]
movdqa xmm1,XMMWORD[((-48))+r11]
movdqa xmm2,XMMWORD[((-32))+r11]
pand xmm0,XMMWORD[((-64))+rax]
movdqa xmm3,XMMWORD[((-16))+r11]
pand xmm1,XMMWORD[((-48))+rax]
por xmm4,xmm0
pand xmm2,XMMWORD[((-32))+rax]
por xmm5,xmm1
pand xmm3,XMMWORD[((-16))+rax]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[r11]
movdqa xmm1,XMMWORD[16+r11]
movdqa xmm2,XMMWORD[32+r11]
pand xmm0,XMMWORD[rax]
movdqa xmm3,XMMWORD[48+r11]
pand xmm1,XMMWORD[16+rax]
por xmm4,xmm0
pand xmm2,XMMWORD[32+rax]
por xmm5,xmm1
pand xmm3,XMMWORD[48+rax]
por xmm4,xmm2
por xmm5,xmm3
movdqa xmm0,XMMWORD[64+r11]
movdqa xmm1,XMMWORD[80+r11]
movdqa xmm2,XMMWORD[96+r11]
pand xmm0,XMMWORD[64+rax]
movdqa xmm3,XMMWORD[112+r11]
pand xmm1,XMMWORD[80+rax]
por xmm4,xmm0
pand xmm2,XMMWORD[96+rax]
por xmm5,xmm1
pand xmm3,XMMWORD[112+rax]
por xmm4,xmm2
por xmm5,xmm3
por xmm4,xmm5
lea r11,[256+r11]
pshufd xmm0,xmm4,0x4e
por xmm0,xmm4
movq QWORD[rcx],xmm0
lea rcx,[8+rcx]
sub edx,1
jnz NEAR $L$gather
lea rsp,[r10]
DB 0F3h,0C3h ;repret
$L$SEH_end_bn_gather5:
ALIGN 64
$L$inc:
DD 0,0,1,1
DD 2,2,2,2
DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
DB 112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115
DB 99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111
DB 114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79
DB 71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111
DB 112,101,110,115,115,108,46,111,114,103,62,0
EXTERN __imp_RtlVirtualUnwind
ALIGN 16
mul_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
mov rsi,QWORD[8+r9]
mov r11,QWORD[56+r9]
mov r10d,DWORD[r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jb NEAR $L$common_seh_tail
mov r10d,DWORD[4+r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jb NEAR $L$common_pop_regs
mov rax,QWORD[152+r8]
mov r10d,DWORD[8+r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jae NEAR $L$common_seh_tail
lea r10,[$L$mul_epilogue]
cmp rbx,r10
ja NEAR $L$body_40
mov r10,QWORD[192+r8]
mov rax,QWORD[8+r10*8+rax]
jmp NEAR $L$common_pop_regs
$L$body_40:
mov rax,QWORD[40+rax]
$L$common_pop_regs:
mov rbx,QWORD[((-8))+rax]
mov rbp,QWORD[((-16))+rax]
mov r12,QWORD[((-24))+rax]
mov r13,QWORD[((-32))+rax]
mov r14,QWORD[((-40))+rax]
mov r15,QWORD[((-48))+rax]
mov QWORD[144+r8],rbx
mov QWORD[160+r8],rbp
mov QWORD[216+r8],r12
mov QWORD[224+r8],r13
mov QWORD[232+r8],r14
mov QWORD[240+r8],r15
$L$common_seh_tail:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
mov rdi,QWORD[40+r9]
mov rsi,r8
mov ecx,154
DD 0xa548f3fc
mov rsi,r9
xor rcx,rcx
mov rdx,QWORD[8+rsi]
mov r8,QWORD[rsi]
mov r9,QWORD[16+rsi]
mov r10,QWORD[40+rsi]
lea r11,[56+rsi]
lea r12,[24+rsi]
mov QWORD[32+rsp],r10
mov QWORD[40+rsp],r11
mov QWORD[48+rsp],r12
mov QWORD[56+rsp],rcx
call QWORD[__imp_RtlVirtualUnwind]
mov eax,1
add rsp,64
popfq
pop r15
pop r14
pop r13
pop r12
pop rbp
pop rbx
pop rdi
pop rsi
DB 0F3h,0C3h ;repret
section .pdata rdata align=4
ALIGN 4
DD $L$SEH_begin_bn_mul_mont_gather5 wrt ..imagebase
DD $L$SEH_end_bn_mul_mont_gather5 wrt ..imagebase
DD $L$SEH_info_bn_mul_mont_gather5 wrt ..imagebase
DD $L$SEH_begin_bn_mul4x_mont_gather5 wrt ..imagebase
DD $L$SEH_end_bn_mul4x_mont_gather5 wrt ..imagebase
DD $L$SEH_info_bn_mul4x_mont_gather5 wrt ..imagebase
DD $L$SEH_begin_bn_power5 wrt ..imagebase
DD $L$SEH_end_bn_power5 wrt ..imagebase
DD $L$SEH_info_bn_power5 wrt ..imagebase
DD $L$SEH_begin_bn_from_mont8x wrt ..imagebase
DD $L$SEH_end_bn_from_mont8x wrt ..imagebase
DD $L$SEH_info_bn_from_mont8x wrt ..imagebase
DD $L$SEH_begin_bn_mulx4x_mont_gather5 wrt ..imagebase
DD $L$SEH_end_bn_mulx4x_mont_gather5 wrt ..imagebase
DD $L$SEH_info_bn_mulx4x_mont_gather5 wrt ..imagebase
DD $L$SEH_begin_bn_powerx5 wrt ..imagebase
DD $L$SEH_end_bn_powerx5 wrt ..imagebase
DD $L$SEH_info_bn_powerx5 wrt ..imagebase
DD $L$SEH_begin_bn_gather5 wrt ..imagebase
DD $L$SEH_end_bn_gather5 wrt ..imagebase
DD $L$SEH_info_bn_gather5 wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$SEH_info_bn_mul_mont_gather5:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$mul_body wrt ..imagebase,$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_mul4x_mont_gather5:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$mul4x_prologue wrt ..imagebase,$L$mul4x_body wrt ..imagebase,$L$mul4x_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_power5:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$power5_prologue wrt ..imagebase,$L$power5_body wrt ..imagebase,$L$power5_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_from_mont8x:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$from_prologue wrt ..imagebase,$L$from_body wrt ..imagebase,$L$from_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_mulx4x_mont_gather5:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$mulx4x_prologue wrt ..imagebase,$L$mulx4x_body wrt ..imagebase,$L$mulx4x_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_powerx5:
DB 9,0,0,0
DD mul_handler wrt ..imagebase
DD $L$powerx5_prologue wrt ..imagebase,$L$powerx5_body wrt ..imagebase,$L$powerx5_epilogue wrt ..imagebase
ALIGN 8
$L$SEH_info_bn_gather5:
DB 0x01,0x0b,0x03,0x0a
DB 0x0b,0x01,0x21,0x00
DB 0x04,0xa3,0x00,0x00
ALIGN 8
|
{
"pile_set_name": "Github"
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <cmath> // For std::modf.
#include <map>
#include <string>
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "content/browser/net/network_quality_observer_impl.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_change_notifier_factory.h"
#include "net/dns/mock_host_resolver.h"
#include "net/log/test_net_log.h"
#include "net/nqe/effective_connection_type.h"
#include "services/network/test/test_network_quality_tracker.h"
namespace {
// Returns the total count of samples in |histogram|.
int GetTotalSampleCount(base::HistogramTester* tester,
const std::string& histogram) {
int count = 0;
std::vector<base::Bucket> buckets = tester->GetAllSamples(histogram);
for (const auto& bucket : buckets)
count += bucket.count;
return count;
}
void VerifyRtt(base::TimeDelta expected_rtt, int32_t got_rtt_milliseconds) {
EXPECT_EQ(0, got_rtt_milliseconds % 50)
<< " got_rtt_milliseconds=" << got_rtt_milliseconds;
if (expected_rtt > base::TimeDelta::FromMilliseconds(3000))
expected_rtt = base::TimeDelta::FromMilliseconds(3000);
// The difference between the actual and the estimate value should be within
// 10%. Add 50 (bucket size used in Blink) to account for the cases when the
// sample may spill over to the next bucket due to the added noise of 10%.
// For example, if sample is 300 msec, after adding noise, it may become 330,
// and after rounding off, it would spill over to the next bucket of 350 msec.
EXPECT_GE((expected_rtt.InMilliseconds() * 0.1) + 50,
std::abs(expected_rtt.InMilliseconds() - got_rtt_milliseconds))
<< " expected_rtt=" << expected_rtt
<< " got_rtt_milliseconds=" << got_rtt_milliseconds;
}
void VerifyDownlinkKbps(double expected_kbps, double got_kbps) {
// First verify that |got_kbps| is a multiple of 50.
int quotient = static_cast<int>(got_kbps / 50);
// |mod| is the remainder left after dividing |got_kbps| by 50 while
// restricting the quotient to integer. For example, if |got_kbps| is
// 1050, then mod will be 0. If |got_kbps| is 1030, mod will be 30.
double mod = got_kbps - 50 * quotient;
EXPECT_LE(0.0, mod);
EXPECT_GT(50.0, mod);
// It is possible that |mod| is not exactly 0 because of floating point
// computations. e.g., |got_kbps| may be 99.999999, in which case |mod|
// will be 49.999999.
EXPECT_TRUE(mod < (1e-5) || (50 - mod) < 1e-5) << " got_kbps=" << got_kbps;
if (expected_kbps > 10000)
expected_kbps = 10000;
// The difference between the actual and the estimate value should be within
// 10%. Add 50 (bucket size used in Blink) to account for the cases when the
// sample may spill over to the next bucket due to the added noise of 10%.
// For example, if sample is 300 kbps, after adding noise, it may become 330,
// and after rounding off, it would spill over to the next bucket of 350 kbps.
EXPECT_GE((expected_kbps * 0.1) + 50, std::abs(expected_kbps - got_kbps))
<< " expected_kbps=" << expected_kbps << " got_kbps=" << got_kbps;
}
class MockNetworkChangeNotifierWifi : public net::NetworkChangeNotifier {
public:
void GetCurrentMaxBandwidthAndConnectionType(
double* max_bandwidth_mbps,
ConnectionType* connection_type) const override {
*connection_type = NetworkChangeNotifier::CONNECTION_WIFI;
*max_bandwidth_mbps =
net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
net::NetworkChangeNotifier::SUBTYPE_WIFI_N);
}
ConnectionType GetCurrentConnectionType() const override {
return NetworkChangeNotifier::CONNECTION_WIFI;
}
};
} // namespace
namespace content {
class NetInfoBrowserTest : public content::ContentBrowserTest {
public:
NetInfoBrowserTest()
: test_network_quality_tracker_(
std::make_unique<network::TestNetworkQualityTracker>()) {}
network::NetworkQualityTracker* GetNetworkQualityTracker() const {
return test_network_quality_tracker_.get();
}
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
// TODO(jkarlin): Once NetInfo is enabled on all platforms remove this
// switch.
command_line->AppendSwitch(switches::kEnableNetworkInformationDownlinkMax);
// TODO(jkarlin): Remove this once downlinkMax is no longer
// experimental.
command_line->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
}
void SetUp() override {
net::NetworkChangeNotifier::SetTestNotificationsOnly(true);
content::ContentBrowserTest::SetUp();
}
void SetUpOnMainThread() override {
host_resolver()->AddRule("*", "127.0.0.1");
base::RunLoop().RunUntilIdle();
}
static void SetConnectionType(
net::NetworkChangeNotifier::ConnectionType type,
net::NetworkChangeNotifier::ConnectionSubtype subtype) {
net::NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests(
net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
subtype),
type);
base::RunLoop().RunUntilIdle();
}
std::string RunScriptExtractString(const std::string& script) {
std::string data;
EXPECT_TRUE(ExecuteScriptAndExtractString(shell(), script, &data));
return data;
}
bool RunScriptExtractBool(const std::string& script) {
bool data;
EXPECT_TRUE(ExecuteScriptAndExtractBool(shell(), script, &data));
return data;
}
double RunScriptExtractDouble(const std::string& script) {
double data = 0.0;
EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), script, &data));
return data;
}
int RunScriptExtractInt(const std::string& script) {
int data = 0;
EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), script, &data));
return data;
}
private:
std::unique_ptr<network::TestNetworkQualityTracker>
test_network_quality_tracker_;
};
// Make sure the type is correct when the page is first opened.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, VerifyNetworkStateInitialized) {
// Mock out the NCN.
net::NetworkChangeNotifier::DisableForTest disable_for_test;
MockNetworkChangeNotifierWifi mock_notifier;
EXPECT_TRUE(NavigateToURL(shell(), content::GetTestUrl("", "net_info.html")));
EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
EXPECT_EQ("wifi", RunScriptExtractString("getType()"));
EXPECT_EQ(net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
net::NetworkChangeNotifier::SUBTYPE_WIFI_N),
RunScriptExtractDouble("getDownlinkMax()"));
}
// Make sure that type changes in the browser make their way to
// navigator.connection.type.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkChangePlumbsToNavigator) {
EXPECT_TRUE(NavigateToURL(shell(), content::GetTestUrl("", "net_info.html")));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_WIFI,
net::NetworkChangeNotifier::SUBTYPE_WIFI_N);
EXPECT_EQ("wifi", RunScriptExtractString("getType()"));
EXPECT_EQ(net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
net::NetworkChangeNotifier::SUBTYPE_WIFI_N),
RunScriptExtractDouble("getDownlinkMax()"));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_ETHERNET,
net::NetworkChangeNotifier::SUBTYPE_GIGABIT_ETHERNET);
EXPECT_EQ("ethernet", RunScriptExtractString("getType()"));
EXPECT_EQ(net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
net::NetworkChangeNotifier::SUBTYPE_GIGABIT_ETHERNET),
RunScriptExtractDouble("getDownlinkMax()"));
}
// Make sure that type changes in the browser make their way to
// navigator.isOnline.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, IsOnline) {
EXPECT_TRUE(NavigateToURL(shell(), content::GetTestUrl("", "net_info.html")));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_ETHERNET,
net::NetworkChangeNotifier::SUBTYPE_GIGABIT_ETHERNET);
EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_NONE,
net::NetworkChangeNotifier::SUBTYPE_NONE);
EXPECT_FALSE(RunScriptExtractBool("getOnLine()"));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_WIFI,
net::NetworkChangeNotifier::SUBTYPE_WIFI_N);
EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
}
// Creating a new render view shouldn't reinitialize Blink's
// NetworkStateNotifier. See https://crbug.com/535081.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, TwoRenderViewsInOneProcess) {
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_ETHERNET,
net::NetworkChangeNotifier::SUBTYPE_GIGABIT_ETHERNET);
EXPECT_TRUE(NavigateToURL(shell(), content::GetTestUrl("", "net_info.html")));
EXPECT_TRUE(RunScriptExtractBool("getOnLine()"));
SetConnectionType(net::NetworkChangeNotifier::CONNECTION_NONE,
net::NetworkChangeNotifier::SUBTYPE_NONE);
EXPECT_FALSE(RunScriptExtractBool("getOnLine()"));
// Open the same page in a new window on the same process.
EXPECT_TRUE(ExecuteScript(shell(), "window.open(\"net_info.html\")"));
// The network state should not have reinitialized to what it was when opening
// the first window (online).
EXPECT_FALSE(RunScriptExtractBool("getOnLine()"));
}
// Verify that when the network quality notifications are not sent, the
// Javascript API returns a valid estimate that is multiple of 50 msec and 50
// kbps.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest,
NetworkQualityEstimatorNotInitialized) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
// When NQE is not initialized, the javascript calls should return default
// values.
EXPECT_EQ(0, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(10000, RunScriptExtractDouble("getDownlink()") * 1000);
}
// Make sure the changes in the effective connection type are notified to the
// render thread.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest,
EffectiveConnectionTypeChangeNotified) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(1000));
int32_t downstream_throughput_kbps = 300;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
FetchHistogramsFromChildProcesses();
int samples =
GetTotalSampleCount(&histogram_tester, "NQE.RenderThreadNotified");
EXPECT_LT(0, samples);
// Change effective connection type so that the renderer process is notified.
// Changing the effective connection type from 2G to 3G is guaranteed to
// generate the notification to the renderers, irrespective of the current
// effective connection type.
GetNetworkQualityTracker()->ReportEffectiveConnectionTypeForTesting(
net::EFFECTIVE_CONNECTION_TYPE_2G);
EXPECT_EQ("2g", RunScriptExtractString("getEffectiveType()"));
GetNetworkQualityTracker()->ReportEffectiveConnectionTypeForTesting(
net::EFFECTIVE_CONNECTION_TYPE_3G);
EXPECT_EQ("3g", RunScriptExtractString("getEffectiveType()"));
FetchHistogramsFromChildProcesses();
EXPECT_GT(GetTotalSampleCount(&histogram_tester, "NQE.RenderThreadNotified"),
samples);
}
// Make sure the changes in the network quality are notified to the render
// thread, and the changed network quality is accessible via Javascript API.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkQualityChangeNotified) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(1000));
int32_t downstream_throughput_kbps = 300;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
FetchHistogramsFromChildProcesses();
EXPECT_FALSE(
histogram_tester.GetAllSamples("NQE.RenderThreadNotified").empty());
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
// Verify that the network quality change is accessible via Javascript API.
http_rtt = base::TimeDelta::FromSeconds(10);
downstream_throughput_kbps = 3000;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
base::RunLoop().RunUntilIdle();
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
}
// Make sure the changes in the network quality are rounded to the nearest
// 50 milliseconds or 50 kbps.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkQualityChangeRounded) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
// Verify that the network quality is rounded properly.
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(103));
int32_t downstream_throughput_kbps = 8303;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
http_rtt = base::TimeDelta::FromMilliseconds(1103);
downstream_throughput_kbps = 1307;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
base::RunLoop().RunUntilIdle();
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
http_rtt = base::TimeDelta::FromMilliseconds(2112);
downstream_throughput_kbps = 2112;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
base::RunLoop().RunUntilIdle();
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
}
// Make sure the network quality are rounded down when it exceeds the upper
// limit.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkQualityChangeUpperLimit) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(12003));
int32_t downstream_throughput_kbps = 30300;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
}
// Make sure the noise added to the network quality varies with the hostname.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkQualityRandomized) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(2000));
int32_t downstream_throughput_kbps = 3000;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
const int32_t rtt_noise_milliseconds = RunScriptExtractInt("getRtt()") - 2000;
const int32_t downlink_noise_kbps =
RunScriptExtractDouble("getDownlink()") * 1000 - 3000;
// When the hostname is not changed, the noise should not change.
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
EXPECT_EQ(rtt_noise_milliseconds, RunScriptExtractInt("getRtt()") - 2000);
EXPECT_EQ(downlink_noise_kbps,
RunScriptExtractDouble("getDownlink()") * 1000 - 3000);
// Verify that changing the hostname changes the noise. It is possible that
// the hash of a different host also maps to the same bucket among 20 buckets.
// Try 10 different hosts. This reduces the probability of failure of this
// test to (1/20)^10 = 9,7 * 10^-14.
for (size_t i = 0; i < 10; ++i) {
// The noise added is a function of the hostname. Varying the hostname
// should vary the noise.
std::string fake_hostname = "example" + base::NumberToString(i) + ".com";
EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL(
fake_hostname, "/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
int32_t new_rtt_noise_milliseconds = RunScriptExtractInt("getRtt()") - 2000;
int32_t new_downlink_noise_kbps =
RunScriptExtractDouble("getDownlink()") * 1000 - 3000;
if (rtt_noise_milliseconds != new_rtt_noise_milliseconds &&
downlink_noise_kbps != new_downlink_noise_kbps) {
return;
}
}
NOTREACHED() << "Noise not added to the network quality estimates";
}
// Make sure the minor changes (<10%) in the network quality are not notified.
IN_PROC_BROWSER_TEST_F(NetInfoBrowserTest, NetworkQualityChangeNotNotified) {
base::HistogramTester histogram_tester;
NetworkQualityObserverImpl impl(GetNetworkQualityTracker());
// Verify that the network quality is rounded properly.
base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(1123));
int32_t downstream_throughput_kbps = 1303;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
EXPECT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(
NavigateToURL(shell(), embedded_test_server()->GetURL("/net_info.html")));
VerifyRtt(http_rtt, RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(downstream_throughput_kbps,
RunScriptExtractDouble("getDownlink()") * 1000);
// All the 3 metrics change by less than 10%. So, the observers are not
// notified.
http_rtt = base::TimeDelta::FromMilliseconds(1223);
downstream_throughput_kbps = 1403;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
base::RunLoop().RunUntilIdle();
VerifyRtt(base::TimeDelta::FromMilliseconds(1100),
RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(1300, RunScriptExtractDouble("getDownlink()") * 1000);
// HTTP RTT has changed by more than 10% from the last notified value of
// |network_quality_1|. The observers should be notified.
http_rtt = base::TimeDelta::FromMilliseconds(2223);
downstream_throughput_kbps = 1403;
GetNetworkQualityTracker()->ReportRTTsAndThroughputForTesting(
http_rtt, downstream_throughput_kbps);
base::RunLoop().RunUntilIdle();
VerifyRtt(base::TimeDelta::FromMilliseconds(2200),
RunScriptExtractInt("getRtt()"));
VerifyDownlinkKbps(1400, RunScriptExtractDouble("getDownlink()") * 1000);
}
} // namespace content
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: d5acbeaf80ef1244bbf7ec3a5ab9de10
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.